[Vtigercrm-commits] [vtiger-commits] r9150 - /vtigercrm/trunk/include/utils/EditViewUtils.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Mon Aug 28 14:52:05 EDT 2006
Author: richie
Date: Mon Aug 28 12:51:58 2006
New Revision: 9150
Log:
Support for PostGres DB done
Modified:
vtigercrm/trunk/include/utils/EditViewUtils.php
Modified: vtigercrm/trunk/include/utils/EditViewUtils.php
==============================================================================
--- vtigercrm/trunk/include/utils/EditViewUtils.php (original)
+++ vtigercrm/trunk/include/utils/EditViewUtils.php Mon Aug 28 12:51:58 2006
@@ -562,32 +562,38 @@
$editview_label[]=$mod_strings[$fieldlabel];
}
elseif($uitype == 69)
- {
- $editview_label[]=$mod_strings[$fieldlabel];
- //This query is for Products only
- if($module_name == 'Products')
- {
- $query = 'select vtiger_attachments.path, vtiger_attachments.attachmentsid, vtiger_attachments.name from vtiger_products left join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid=vtiger_products.productid inner join vtiger_attachments on vtiger_attachments.attachmentsid=vtiger_seattachmentsrel.attachmentsid where productid='.$col_fields['record_id'];
- }
- else
- {
- $query = "select vtiger_attachments.path, vtiger_attachments.attachmentsid, vtiger_attachments.name from vtiger_contactdetails left join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid=vtiger_contactdetails.contactid inner join vtiger_attachments on vtiger_attachments.attachmentsid=vtiger_seattachmentsrel.attachmentsid where contactid=".$col_fields['record_id'];
- }
- $result_image = $adb->query($query);
- for($image_iter=0;$image_iter < $adb->num_rows($result_image);$image_iter++)
- {
- $image_id_array[] = $adb->query_result($result_image,$image_iter,'attachmentsid');
- $image_array[] = $adb->query_result($result_image,$image_iter,'name');
- $image_path_array[] = $adb->query_result($result_image,$image_iter,'path');
- }
- if(is_array($image_array))
- for($img_itr=0;$img_itr<count($image_array);$img_itr++)
- {
- $fieldvalue[] = array('name'=>$image_array[$img_itr],'path'=>$image_path_array[$img_itr].$image_id_array[$img_itr]."_");
- }
- else
- $fieldvalue[] = '';
- }
+ {
+ $editview_label[]=$mod_strings[$fieldlabel];
+
+ if( $col_fields['record_id'] != "")
+ {
+ //This query is for Products only
+ if($module_name == 'Products')
+ {
+ $query = 'select vtiger_attachments.path, vtiger_attachments.attachmentsid, vtiger_attachments.name from vtiger_products left join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid=vtiger_products.productid inner join vtiger_attachments on vtiger_attachments.attachmentsid=vtiger_seattachmentsrel.attachmentsid where productid='.$col_fields['record_id'];
+ }
+ else
+ {
+ $query = "select vtiger_attachments.path, vtiger_attachments.attachmentsid, vtiger_attachments.name from vtiger_contactdetails left join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid=vtiger_contactdetails.contactid inner join vtiger_attachments on vtiger_attachments.attachmentsid=vtiger_seattachmentsrel.attachmentsid where contactid=".$col_fields['record_id'];
+ }
+ $result_image = $adb->query($query);
+ for($image_iter=0;$image_iter < $adb->num_rows($result_image);$image_iter++)
+ {
+ $image_id_array[] = $adb->query_result($result_image,$image_iter,'attachmentsid');
+ $image_array[] = $adb->query_result($result_image,$image_iter,'name');
+ $image_path_array[] = $adb->query_result($result_image,$image_iter,'path');
+ }
+ if(is_array($image_array))
+ for($img_itr=0;$img_itr<count($image_array);$img_itr++)
+ {
+ $fieldvalue[] = array('name'=>$image_array[$img_itr],'path'=>$image_path_array[$img_itr].$image_id_array[$img_itr]."_");
+ }
+ else
+ $fieldvalue[] = '';
+ }
+ else
+ $fieldvalue[] = '';
+ }
elseif($uitype == 62)
{
if(isset($_REQUEST['parent_id']) && $_REQUEST['parent_id'] != '')
More information about the vtigercrm-commits
mailing list