From mmbrich at fosslabs.com Thu Aug 17 11:40:45 2006 From: mmbrich at fosslabs.com (Matthew Brichacek) Date: Thu, 17 Aug 2006 12:40:45 -0600 Subject: [Vtigercrm-commits] test mail Message-ID: <1155840045.25725.8.camel@localhost.localdomain> test mail to see if my list join worked. From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 17 12:47:32 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 17 Aug 2006 19:47:32 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9018 - /vtigercrm/trunk/testfile Message-ID: <20060817194732.7B53F74F1DF@vtiger.fosslabs.com> Author: mmbrich Date: Thu Aug 17 13:47:31 2006 New Revision: 9018 Log: another post-commit test Modified: vtigercrm/trunk/testfile Modified: vtigercrm/trunk/testfile ============================================================================== --- vtigercrm/trunk/testfile (original) +++ vtigercrm/trunk/testfile Thu Aug 17 13:47:31 2006 @@ -1,1 +1,1 @@ -test +sorry :) From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 17 12:48:16 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 17 Aug 2006 19:48:16 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9019 - /vtigercrm/trunk/testfile Message-ID: <20060817194816.7C7A874FC8E@vtiger.fosslabs.com> Author: mmbrich Date: Thu Aug 17 13:48:15 2006 New Revision: 9019 Log: fixed commit list, enjoy! Removed: vtigercrm/trunk/testfile From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 04:32:37 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 11:32:37 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9020 - in /vtigercrm/trunk: data/CRMEntity.php include/language/en_us.lang.php Message-ID: <20060818113237.0850B75021F@vtiger.fosslabs.com> Author: saraj Date: Fri Aug 18 05:32:32 2006 New Revision: 9020 Log: viewing a deleted record disabled. Fixes #1922 Modified: vtigercrm/trunk/data/CRMEntity.php vtigercrm/trunk/include/language/en_us.lang.php Modified: vtigercrm/trunk/data/CRMEntity.php ============================================================================== --- vtigercrm/trunk/data/CRMEntity.php (original) +++ vtigercrm/trunk/data/CRMEntity.php Fri Aug 18 05:32:32 2006 @@ -1251,11 +1251,13 @@ */ function retrieve_entity_info($record, $module) { - global $adb,$log; + global $adb,$log,$app_strings; $result = Array(); foreach($this->tab_name_index as $table_name=>$index) { $result[$table_name] = $adb->query("select * from ".$table_name." where ".$index."=".$record); + if($adb->query_result($result["vtiger_crmentity"],0,"deleted") == 1) + die("

".$app_strings['LBL_RECORD_DELETE']." ".$app_strings['LBL_GO_BACK'].".
"); } $tabid = getTabid($module); $sql1 = "select * from vtiger_field where tabid=".$tabid; Modified: vtigercrm/trunk/include/language/en_us.lang.php ============================================================================== --- vtigercrm/trunk/include/language/en_us.lang.php (original) +++ vtigercrm/trunk/include/language/en_us.lang.php Fri Aug 18 05:32:32 2006 @@ -1003,6 +1003,9 @@ 'LBL_FINAL_DISCOUNT_AMOUNT'=>'Final Discount Amount', 'LBL_SHIPPING_AND_HANDLING_CHARGE'=>'Shipping & Handling Charge', 'LBL_GO_BACK'=>'Go Back', + +//Record deleted message +'LBL_RECORD_DELETE'=>'The record you are trying to view has been deleted.', ); From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 05:19:57 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 12:19:57 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9021 - /vtigercrm/trunk/include/utils/CommonUtils.php Message-ID: <20060818121958.2CA9E750306@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 06:19:50 2006 New Revision: 9021 Log: Converted the string Month into language in UpdateInfo - Ahmed Modified: vtigercrm/trunk/include/utils/CommonUtils.php Modified: vtigercrm/trunk/include/utils/CommonUtils.php ============================================================================== --- vtigercrm/trunk/include/utils/CommonUtils.php (original) +++ vtigercrm/trunk/include/utils/CommonUtils.php Fri Aug 18 06:19:50 2006 @@ -1224,7 +1224,7 @@ $values=explode(' ',$modifiedtime); $date_info=explode('-',$values[0]); $time_info=explode(':',$values[1]); - $date = $date_info[2].' '.date("M", mktime(0, 0, 0, $date_info[1], $date_info[2],$date_info[0])).' '.$date_info[0]; + $date = $date_info[2].' '.$app_strings[date("M", mktime(0, 0, 0, $date_info[1], $date_info[2],$date_info[0]))].' '.$date_info[0]; $time_modified = mktime($time_info[0], $time_info[1], $time_info[2], $date_info[1], $date_info[2],$date_info[0]); $time_now = time(); $days_diff = (int)(($time_now - $time_modified) / (60 * 60 * 24)); From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 05:21:37 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 12:21:37 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9022 - /vtigercrm/trunk/include/language/en_us.lang.php Message-ID: <20060818122137.DACC2750306@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 06:21:31 2006 New Revision: 9022 Log: Language strings updated for Month -- Ahmed Modified: vtigercrm/trunk/include/language/en_us.lang.php Modified: vtigercrm/trunk/include/language/en_us.lang.php ============================================================================== --- vtigercrm/trunk/include/language/en_us.lang.php (original) +++ vtigercrm/trunk/include/language/en_us.lang.php Fri Aug 18 06:21:31 2006 @@ -920,6 +920,21 @@ 'LBL_DAY_AGO'=>'day ago', 'LBL_DAYS_AGO'=>'days ago', +//Added to convert Month string in update info - ahmed + +'Jan'=>'Jan', +'Feb'=>'Feb', +'Mar'=>'Mar', +'Apr'=>'Apr', +'May'=>'May', +'Jun'=>'Jun', +'Jul'=>'Jul', +'Aug'=>'Aug', +'Sep'=>'Sep', +'Oct'=>'Oct', +'Nov'=>'Nov', +'Dec'=>'Dec', + //Added after 5.0 Alpha5 'Campaign Name'=>'Campaign Name', 'Campaign Type'=>'Campaign Type', From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 05:24:05 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 12:24:05 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9023 - /vtigercrm/trunk/install/1checkSystem.php Message-ID: <20060818122405.B6E9E750304@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 06:23:52 2006 New Revision: 9023 Log: Rearranged the writeable description according to the folder path -- Ahmed Modified: vtigercrm/trunk/install/1checkSystem.php Modified: vtigercrm/trunk/install/1checkSystem.php ============================================================================== --- vtigercrm/trunk/install/1checkSystem.php (original) +++ vtigercrm/trunk/install/1checkSystem.php Fri Aug 18 06:23:52 2006 @@ -250,22 +250,54 @@ Cache Directory
(cache/) Writeable":"Not Writeable"; ?> - + + + Uploads Directory
(storage/) + Writeable":"Not Writeable
You might experience problems with the file vtiger_attachments feature. Refer File vtiger_attachments issue for more details
"; ?> + + + Install Directory
(install/) + Writeable":"Not Writeable
You might experience problems with the last step of installation.
"; ?> + + + Installation file
(install.php) + Writeable":"Not Writeable
You might experience problems with the last step of installation.
"; ?> + + + Tabdata File Permission
(tabdata.php) + Writeable":"Not Writeable
You will not be able to work with the product
";?> + + + + ParentTabdata File Permission
(parent_tabdata.php) + Writeable":"Not Writeable
You will not be able to work with the product
";?> + + + + User Privileges
(user_privileges/) + Writeable":"Not Writeable
You will not be able to login
"; ?> + + + + + Smarty Cache Directory
(Smarty/cache) + Writeable":"Not Writeable";?> + + + Smarty Compile Directory
(Smarty/templates_c) + Writeable":"Not Writeable
You will not be able to login
";?> + + + + Email Templates Directory
(modules/Emails/templates/) + Writeable":"Not Writeable
You might experience problems with the email templates feature. Refer Email templates issue for more details
"; ?> + + + Mail Merge Template Directory
(test/wordtemplatedownload/) Writeable":"Not Writeable
You might experience issues with the word template feature. Visit forums for more details
"; ?> - - Uploads Directory
(storage/) - Writeable":"Not Writeable
You might experience problems with the file vtiger_attachments feature. Refer File vtiger_attachments issue for more details
"; ?> - - - Install Directory
(install/) - Writeable":"Not Writeable
You might experience problems with the last step of installation.
"; ?> - - - Installation file
(install.php) - Writeable":"Not Writeable
You might experience problems with the last step of installation.
"; ?> - + Product Image Directory
(test/product/) Writeable":"Not Writeable
You might experience problems while attaching image for Products.Refer File vtiger_attachments issue for more details
"; ?> @@ -281,34 +313,8 @@ Logo Directory
(test/logo/) Writeable":"Not Writeable
You might experience problems with the company logo in the pdf generation. Refer File vtiger_attachments issue for more details
"; ?> - - - Email Templates Directory
(modules/Emails/templates/) - Writeable":"Not Writeable
You might experience problems with the email templates feature. Refer Email templates issue for more details
"; ?> - - - User Privileges
(user_privileges/) - Writeable":"Not Writeable
You will not be able to login
"; ?> - - - Smarty Compile Directory
(Smarty/templates_c) - Writeable":"Not Writeable
You will not be able to login
";?> - - - - Tabdata File Permission
(tabdata.php) - Writeable":"Not Writeable
You will not be able to work with the product
";?> - - - - ParentTabdata File Permission
(parent_tabdata.php) - Writeable":"Not Writeable
You will not be able to work with the product
";?> - - - - Smarty Cache Directory
(Smarty/cache) - Writeable":"Not Writeable";?> - + +

From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 05:25:47 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 12:25:47 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9024 - /vtigercrm/trunk/modules/CustomView/PopulateCustomView.php Message-ID: <20060818122547.5381D75118F@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 06:25:37 2006 New Revision: 9024 Log: Default CustomView Filters added for PO,SO,FAQ & Invoice -- Ahmed Modified: vtigercrm/trunk/modules/CustomView/PopulateCustomView.php Modified: vtigercrm/trunk/modules/CustomView/PopulateCustomView.php ============================================================================== --- vtigercrm/trunk/modules/CustomView/PopulateCustomView.php (original) +++ vtigercrm/trunk/modules/CustomView/PopulateCustomView.php Fri Aug 18 06:25:37 2006 @@ -128,8 +128,35 @@ Array('viewname'=>'All', 'setdefault'=>'1','setmetrics'=>'0', - 'cvmodule'=>'Webmails','stdfilterid'=>'','advfilterid'=>''), - + 'cvmodule'=>'Webmails','stdfilterid'=>'','advfilterid'=>''), + + Array('viewname'=>'Drafted FAQ', + 'setdefault'=>'0','setmetrics'=>'0', + 'cvmodule'=>'Faq','stdfilterid'=>'','advfilterid'=>'8'), + + Array('viewname'=>'Published FAQ', + 'setdefault'=>'0','setmetrics'=>'0', + 'cvmodule'=>'Faq','stdfilterid'=>'','advfilterid'=>'9'), + + Array('viewname'=>'Open Purchase Orders', + 'setdefault'=>'0','setmetrics'=>'0', + 'cvmodule'=>'PurchaseOrder','stdfilterid'=>'','advfilterid'=>'10'), + + Array('viewname'=>'Received Purchase Orders', + 'setdefault'=>'0','setmetrics'=>'0', + 'cvmodule'=>'PurchaseOrder','stdfilterid'=>'','advfilterid'=>'11'), + + Array('viewname'=>'Open Invoices', + 'setdefault'=>'0','setmetrics'=>'0', + 'cvmodule'=>'Invoice','stdfilterid'=>'','advfilterid'=>'12'), + + Array('viewname'=>'Paid Invoices', + 'setdefault'=>'0','setmetrics'=>'0', + 'cvmodule'=>'Invoice','stdfilterid'=>'','advfilterid'=>'13'), + + Array('viewname'=>'Pending Sales Orders', + 'setdefault'=>'0','setmetrics'=>'0', + 'cvmodule'=>'SalesOrder','stdfilterid'=>'','advfilterid'=>'14'), ); @@ -331,6 +358,54 @@ 'from:fromname:fromname:From:N', 'to:tpname:toname:To:N', 'body:body:body:Body:V'), + + Array ('vtiger_faq:question:question:Faq_Question:V', + 'vtiger_faq:status:faqstatus:Faq_Status:V', + 'vtiger_faq:product_id:product_id:Faq_Product_Name:I', + 'vtiger_faq:category:faqcategories:Faq_Category:V', + 'vtiger_crmentity:createdtime:createdtime:Faq_Created_Time:T'), + + Array( 'vtiger_faq:question:question:Faq_Question:V', + 'vtiger_faq:answer:faq_answer:Faq_Answer:V', + 'vtiger_faq:status:faqstatus:Faq_Status:V', + 'vtiger_faq:product_id:product_id:Faq_Product_Name:I', + 'vtiger_faq:category:faqcategories:Faq_Category:V', + 'vtiger_crmentity:createdtime:createdtime:Faq_Created_Time:T'), + + Array( 'vtiger_purchaseorder:subject:subject:PurchaseOrder_Subject:V', + 'vtiger_purchaseorder:postatus:postatus:PurchaseOrder_Status:V', + 'vtiger_purchaseorder:vendorid:vendor_id:PurchaseOrder_Vendor_Name:I', + 'vtiger_crmentity:smownerid:assigned_user_id:PurchaseOrder_Assigned_To:V', + 'vtiger_purchaseorder:duedate:duedate:PurchaseOrder_Due_Date:V'), + + Array ('vtiger_purchaseorder:subject:subject:PurchaseOrder_Subject:V', + 'vtiger_purchaseorder:vendorid:vendor_id:PurchaseOrder_Vendor_Name:I', + 'vtiger_crmentity:smownerid:assigned_user_id:PurchaseOrder_Assigned_To:V', + 'vtiger_purchaseorder:postatus:postatus:PurchaseOrder_Status:V', + 'vtiger_purchaseorder:carrier:carrier:PurchaseOrder_Carrier:V', + 'vtiger_poshipads:ship_street:ship_street:PurchaseOrder_Shipping_Address:V'), + + Array( 'vtiger_invoice:subject:subject:Invoice_Subject:V', + 'vtiger_invoice:accountid:account_id:Invoice_Account_Name:I', + 'vtiger_invoice:salesorderid:salesorder_id:Invoice_Sales_Order:I', + 'vtiger_invoice:invoicestatus:invoicestatus:Invoice_Status:V', + 'vtiger_crmentity:smownerid:assigned_user_id:Invoice_Assigned_To:V', + 'vtiger_crmentity:createdtime:createdtime:Invoice_Created_Time:T'), + + Array( 'vtiger_invoice:subject:subject:Invoice_Subject:V', + 'vtiger_invoice:accountid:account_id:Invoice_Account_Name:I', + 'vtiger_invoice:salesorderid:salesorder_id:Invoice_Sales_Order:I', + 'vtiger_invoice:invoicestatus:invoicestatus:Invoice_Status:V', + 'vtiger_invoiceshipads:ship_street:ship_street:Invoice_Shipping_Address:V', + 'vtiger_crmentity:smownerid:assigned_user_id:Invoice_Assigned_To:V'), + + Array( 'vtiger_salesorder:subject:subject:SalesOrder_Subject:V', + 'vtiger_salesorder:accountid:account_id:SalesOrder_Account_Name:I', + 'vtiger_salesorder:sostatus:sostatus:SalesOrder_Status:V', + 'vtiger_crmentity:smownerid:assigned_user_id:SalesOrder_Assigned_To:V', + 'vtiger_soshipads:ship_street:ship_street:SalesOrder_Shipping_Address:V', + 'vtiger_salesorder:carrier:carrier:SalesOrder_Carrier:V'), + ); @@ -403,7 +478,57 @@ 'comparator'=>'e', 'value'=>'Rejected' ) - ) + ), + + Array( + Array('columnname'=>'vtiger_faq:status:faqstatus:Faq_Status:V', + 'comparator'=>'e', + 'value'=>'Draft' + ) + ), + + Array( + Array('columnname'=>'vtiger_faq:status:faqstatus:Faq_Status:V', + 'comparator'=>'e', + 'value'=>'Published' + ) + ), + + Array( + Array('columnname'=>'vtiger_purchaseorder:postatus:postatus:PurchaseOrder_Status:V', + 'comparator'=>'e', + 'value'=>'Created, Approved, Delivered' + ) + ), + + Array( + Array('columnname'=>'vtiger_purchaseorder:postatus:postatus:PurchaseOrder_Status:V', + 'comparator'=>'e', + 'value'=>'Recieved Shipment' + ) + ), + + Array( + Array('columnname'=>'vtiger_invoice:invoicestatus:invoicestatus:Invoice_Status:V', + 'comparator'=>'e', + 'value'=>'Created, Approved, Sent' + ) + ), + + Array( + Array('columnname'=>'vtiger_invoice:invoicestatus:invoicestatus:Invoice_Status:V', + 'comparator'=>'e', + 'value'=>'Paid' + ) + ), + + Array( + Array('columnname'=>'vtiger_salesorder:sostatus:sostatus:SalesOrder_Status:V', + 'comparator'=>'e', + 'value'=>'Created, Approved' + ) + ) + ); foreach($customviews as $key=>$customview) From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 05:28:23 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 12:28:23 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9025 - in /vtigercrm/trunk/modules/Users: DefaultDataPopulator.php DetailView.php Message-ID: <20060818122823.D5DA7750973@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 06:28:13 2006 New Revision: 9025 Log: Removed the signature from default email templates, vtiger_ prefix from inventory notifications, increased the change password popup window height -- Ahmed Modified: vtigercrm/trunk/modules/Users/DefaultDataPopulator.php vtigercrm/trunk/modules/Users/DetailView.php Modified: vtigercrm/trunk/modules/Users/DefaultDataPopulator.php ============================================================================== --- vtigercrm/trunk/modules/Users/DefaultDataPopulator.php (original) +++ vtigercrm/trunk/modules/Users/DefaultDataPopulator.php Fri Aug 18 06:28:13 2006 @@ -1851,7 +1851,7 @@ The current stock of {PRODUCTNAME} in our warehouse is {CURRENTSTOCK}. Kindly procure required number of units as the stock level is below reorder level {REORDERLEVELVALUE}. -Please treat this information as Urgent as the vtiger_invoice is already sent to the customer. +Please treat this information as Urgent as the invoice is already sent to the customer. Severity: Critical @@ -1877,7 +1877,7 @@ SalesOrder is generated for {SOQUANTITY} units of {PRODUCTNAME}. The current stock of {PRODUCTNAME} in our warehouse is {CURRENTSTOCK}. -Please treat this information with vtiger_priority as the sales order is already generated. +Please treat this information with priority as the sales order is already generated. Severity: Major @@ -1928,7 +1928,7 @@ Dear - Please check the following vtiger_invoices that are yet to be paid by you: + Please check the following invoices that are yet to be paid by you: No. Date Amount 1 1/1/01 $4000 @@ -1938,11 +1938,7 @@ Kindly let us know if there are any issues that you feel are pending to be discussed. We will be more than happy to give you a call. - We would like to continue our business with you. - - Sincerely, - name - title'; + We would like to continue our business with you.'; $this->db->query("insert into vtiger_emailtemplates(foldername,templatename,subject,description,body,deleted,templateid) values ('Public','Pending Invoices','Invoices Pending','Payment Due','".$body."',0,".$this->db->getUniqueID('vtiger_emailtemplates').")"); @@ -1966,11 +1962,8 @@ Cuff Links Ground. We will be waiting for you in the Executive Lounge. -Looking forward to seeing you there. - -Sincerely, -name -title'; +Looking forward to seeing you there.'; + $this->db->query("insert into vtiger_emailtemplates(foldername,templatename,subject,description,body,deleted,templateid) values ('Public','Acceptance Proposal','Acceptance Proposal','Acceptance of Proposal','".$body."',0,".$this->db->getUniqueID('vtiger_emailtemplates').")"); @@ -1979,11 +1972,8 @@ of the goods. The undersigned will release the payment subject to the goods being discovered not satisfactory. -Signed under seal this - -Sincerely, -name -title'; +Signed under seal this '; + $this->db->query("insert into vtiger_emailtemplates(foldername,templatename,subject,description,body,deleted,templateid) values ('Public','Goods received acknowledgement','Goods received acknowledgement','Acknowledged Receipt of Goods','".$body."',0,".$this->db->getUniqueID('vtiger_emailtemplates').")"); @@ -1995,10 +1985,8 @@ only if the objection is received within ten days of receipt of this notice. -Thank you for your patronage. -Sincerely, -name -title'; +Thank you for your patronage.'; + @@ -2018,12 +2006,8 @@ at 3250 Lovedale Square Avenue, in Frankfurt. We hope to keep in touch with you all. -Please update your addressbooks. - - -Thank You, -name -title'; +Please update your addressbooks.'; + $this->db->query("insert into vtiger_emailtemplates(foldername,templatename,subject,description,body,deleted,templateid) values ('Public','Address Change','Change of Address','Address Change','".$body."',0,".$this->db->getUniqueID('vtiger_emailtemplates').")"); @@ -2034,7 +2018,7 @@ Thank you for extending us the opportunity to meet with you and members of your staff. -I know that John Doe serviced your vtiger_account +I know that John Doe serviced your account for many years and made many friends at your firm. He has personally discussed with me the deep relationship that he had with your firm. While his presence will be missed, I can promise that we will @@ -2043,11 +2027,7 @@ I was genuinely touched to receive such fine hospitality. -Thank you once again. - -Sincerely, -name -title'; +Thank you once again.'; @@ -2066,11 +2046,8 @@ Let us meet at Smoking Joe for a drink in the evening! -C you all there guys! - -Sincerely, -name -title'; +C you all there guys!'; + $this->db->query("insert into vtiger_emailtemplates(foldername,templatename,subject,description,body,deleted,templateid) values ('Public','Target Crossed!','Target Crossed!','Fantastic Sales Spree!','".$body."',0,".$this->db->getUniqueID('vtiger_emailtemplates').")"); @@ -2082,11 +2059,8 @@ We are glad to be given the chance to serve you.I look forward to establishing a long term partnership with you. Consider me as a friend. -Should any need arise,please do give us a call. - -Sincerely, -name -title'; +Should any need arise,please do give us a call.'; + $this->db->query("insert into vtiger_emailtemplates(foldername,templatename,subject,description,body,deleted,templateid) values ('Public','Thanks Note','Thanks Note','Note of thanks','".$body."',0,".$this->db->getUniqueID('vtiger_emailtemplates').")"); Modified: vtigercrm/trunk/modules/Users/DetailView.php ============================================================================== --- vtigercrm/trunk/modules/Users/DetailView.php (original) +++ vtigercrm/trunk/modules/Users/DetailView.php Fri Aug 18 06:28:13 2006 @@ -141,7 +141,7 @@ $buttons = ""; $smarty->assign('EDIT_BUTTON',$buttons); - $buttons = ""; + $buttons = ""; $smarty->assign('CHANGE_PW_BUTTON',$buttons); From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 05:36:36 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 12:36:36 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9026 - /vtigercrm/trunk/schema/DatabaseSchema.xml Message-ID: <20060818123637.29AE075117B@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 06:36:28 2006 New Revision: 9026 Log: Added a forward slash in the siccode field -- Ahmed Modified: vtigercrm/trunk/schema/DatabaseSchema.xml Modified: vtigercrm/trunk/schema/DatabaseSchema.xml ============================================================================== --- vtigercrm/trunk/schema/DatabaseSchema.xml (original) +++ vtigercrm/trunk/schema/DatabaseSchema.xml Fri Aug 18 06:36:28 2006 @@ -322,7 +322,7 @@ - + From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 05:49:24 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 12:49:24 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9027 - /vtigercrm/trunk/modules/CustomView/Delete.php Message-ID: <20060818124924.413FE7511FE@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 06:49:20 2006 New Revision: 9027 Log: changes made to fix the issue in calendar listview --Minnie Modified: vtigercrm/trunk/modules/CustomView/Delete.php Modified: vtigercrm/trunk/modules/CustomView/Delete.php ============================================================================== --- vtigercrm/trunk/modules/CustomView/Delete.php (original) +++ vtigercrm/trunk/modules/CustomView/Delete.php Fri Aug 18 06:49:20 2006 @@ -28,5 +28,5 @@ $smodule_url = "&smodule=".$smodule; } -header("Location: index.php?action=index&parenttab=$parenttab&module=$module".$smodule_url); +header("Location: index.php?action=ListView&parenttab=$parenttab&module=$module".$smodule_url); ?> From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 05:50:17 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 12:50:17 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9028 - /vtigercrm/trunk/modules/Calendar/calendarLayout.php Message-ID: <20060818125017.420867511FE@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 06:50:09 2006 New Revision: 9028 Log: Hardcoded strings converted to language in Calendar -- Ahmed Modified: vtigercrm/trunk/modules/Calendar/calendarLayout.php Modified: vtigercrm/trunk/modules/Calendar/calendarLayout.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/calendarLayout.php (original) +++ vtigercrm/trunk/modules/Calendar/calendarLayout.php Fri Aug 18 06:50:09 2006 @@ -238,7 +238,7 @@ "; $tabhtml .= "view."".$header['calendar']->date_time->get_date_str()."&viewOption=".$viewBox."&subtab=".$subtab."&parenttab=".$category."\");' src='".$header['IMAGE_PATH']."btnL3Calendar.gif' alt='".$mod_strings['LBL_OPENCAL']."...' title='".$mod_strings['LBL_OPENCAL']."...' align='absmiddle' border='0'>"; $tabhtml .= "view."".$header['calendar']->date_time->get_date_str()."&viewOption=".$viewBox."&subtab=".$subtab."&parenttab=".$category."\");' src='".$header['IMAGE_PATH']."tbarSettings.gif' alt='".$mod_strings['LBL_SETTINGS']."' title='".$mod_strings['LBL_SETTINGS']."' align='absmiddle' border='0'>"; - $tabhtml .= "Calendar"; + $tabhtml .= "".$app_strings[Calendar].""; $tabhtml .= ""; echo $tabhtml; $cal_log->debug("Exiting get_cal_header_tab() method..."); From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 05:53:11 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 12:53:11 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9029 - /vtigercrm/trunk/modules/Leads/LeadConvertToEntities.php Message-ID: <20060818125311.B1D7A75122E@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 06:53:08 2006 New Revision: 9029 Log: changes made to fix the convertlead issue --Minnie Modified: vtigercrm/trunk/modules/Leads/LeadConvertToEntities.php Modified: vtigercrm/trunk/modules/Leads/LeadConvertToEntities.php ============================================================================== --- vtigercrm/trunk/modules/Leads/LeadConvertToEntities.php (original) +++ vtigercrm/trunk/modules/Leads/LeadConvertToEntities.php Fri Aug 18 06:53:08 2006 @@ -16,7 +16,6 @@ $module = $_REQUEST["module"]; -$assigned_user_id = $_REQUEST["smowerid"]; $createpotential = $_REQUEST["createpotential"]; $potential_name = $_REQUEST["potential_name"]; $close_date = getDBInsertDateValue($_REQUEST["closedate"]); From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 05:54:51 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 12:54:51 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9030 - /vtigercrm/trunk/modules/Leads/ConvertLead.php Message-ID: <20060818125451.0B55275122E@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 06:54:47 2006 New Revision: 9030 Log: changes made to fix the convertlead issue --Minnie Modified: vtigercrm/trunk/modules/Leads/ConvertLead.php Modified: vtigercrm/trunk/modules/Leads/ConvertLead.php ============================================================================== --- vtigercrm/trunk/modules/Leads/ConvertLead.php (original) +++ vtigercrm/trunk/modules/Leads/ConvertLead.php Fri Aug 18 06:54:47 2006 @@ -99,7 +99,7 @@ '.$app_strings['LBL_ASSIGNED_TO'].' - + From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 05:57:28 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 12:57:28 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9031 - /vtigercrm/trunk/include/language/en_us.lang.php Message-ID: <20060818125728.277DE75122E@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 06:57:24 2006 New Revision: 9031 Log: label added --Minnie Modified: vtigercrm/trunk/include/language/en_us.lang.php Modified: vtigercrm/trunk/include/language/en_us.lang.php ============================================================================== --- vtigercrm/trunk/include/language/en_us.lang.php (original) +++ vtigercrm/trunk/include/language/en_us.lang.php Fri Aug 18 06:57:24 2006 @@ -938,6 +938,9 @@ //Added after 5.0 Alpha5 'Campaign Name'=>'Campaign Name', 'Campaign Type'=>'Campaign Type', +'Campaign Status'=>'Campaign Status', +'Expected Revenue'=>'Expected Revenue', +'Expected Close Date'=>'Expected Close Date', 'LBL_ACTIONS'=>'Actions', 'LBL_SEND'=>'Send', 'LBL_VAT'=>'VAT', From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 05:59:15 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 12:59:15 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9032 - /vtigercrm/trunk/modules/Contacts/CallRelatedList.php Message-ID: <20060818125915.6271E75122E@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 06:59:11 2006 New Revision: 9032 Log: typo error fixed --Minnie Modified: vtigercrm/trunk/modules/Contacts/CallRelatedList.php Modified: vtigercrm/trunk/modules/Contacts/CallRelatedList.php ============================================================================== --- vtigercrm/trunk/modules/Contacts/CallRelatedList.php (original) +++ vtigercrm/trunk/modules/Contacts/CallRelatedList.php Fri Aug 18 06:59:11 2006 @@ -58,7 +58,7 @@ $smarty->assign("id",$focus->id); $smarty->assign("NAME",$focus->name); -$related_array = getrelatedlists($currentModule,$focus); +$related_array = getRelatedLists($currentModule,$focus); $smarty->assign("RELATEDLISTS", $related_array); $smarty->assign("MODULE",$currentmodule); $smarty->assign("SINGLE_MOD",$app_strings['Contact']); From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 06:04:43 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 13:04:43 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9033 - /vtigercrm/trunk/modules/Contacts/Contact.php Message-ID: <20060818130443.E42A8751259@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 07:04:40 2006 New Revision: 9033 Log: changes made to fix the relatedlist issue --Minnie Modified: vtigercrm/trunk/modules/Contacts/Contact.php Modified: vtigercrm/trunk/modules/Contacts/Contact.php ============================================================================== --- vtigercrm/trunk/modules/Contacts/Contact.php (original) +++ vtigercrm/trunk/modules/Contacts/Contact.php Fri Aug 18 07:04:40 2006 @@ -548,7 +548,6 @@ $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; $button = ''; - $returnset = ''; $log->info("Campaign Related List for Contact Displayed"); $query = "SELECT vtiger_users.user_name, vtiger_campaign.campaignid, vtiger_campaign.campaignname, vtiger_campaign.campaigntype, vtiger_campaign.campaignstatus, vtiger_campaign.expectedrevenue, vtiger_campaign.closingdate, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_campaign inner join vtiger_campaigncontrel on vtiger_campaigncontrel.campaignid=vtiger_campaign.campaignid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_campaign.campaignid left join vtiger_campaigngrouprelation on vtiger_campaign.campaignid=vtiger_campaigngrouprelation.campaignid left join vtiger_groups on vtiger_groups.groupname=vtiger_campaigngrouprelation.groupname left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid where vtiger_campaigncontrel.contactid=".$id." and vtiger_crmentity.deleted=0"; From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 06:08:44 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 13:08:44 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9034 - /vtigercrm/trunk/include/utils/DeleteUtils.php Message-ID: <20060818130844.36B29751259@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 07:08:40 2006 New Revision: 9034 Log: changes made to fix the relatedlist issue --Minnie Modified: vtigercrm/trunk/include/utils/DeleteUtils.php Modified: vtigercrm/trunk/include/utils/DeleteUtils.php ============================================================================== --- vtigercrm/trunk/include/utils/DeleteUtils.php (original) +++ vtigercrm/trunk/include/utils/DeleteUtils.php Fri Aug 18 07:08:40 2006 @@ -39,6 +39,15 @@ if($return_id!='') { $sql ='delete from vtiger_seactivityrel where crmid = '.$record.' and activityid = '.$return_id; + $adb->query($sql); + } + break; + case Campaigns: + if($return_module == "Leads") { + $sql = 'delete from vtiger_campaignleadrel where campaignid='.$record.' and leadid='.$return_id; + $adb->query($sql); + } elseif($return_module == "Contacts") { + $sql = 'delete from vtiger_campaigncontrel where campaignid='.$record.' and contactid='.$return_id; $adb->query($sql); } break; From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 06:44:43 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 13:44:43 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9035 - in /vtigercrm/trunk/modules/System/templates/classic: box.tpl form.tpl Message-ID: <20060818134443.882A7751288@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 07:44:35 2006 New Revision: 9035 Log: Unwanted braces removed from sys information -- Ahmed Modified: vtigercrm/trunk/modules/System/templates/classic/box.tpl vtigercrm/trunk/modules/System/templates/classic/form.tpl Modified: vtigercrm/trunk/modules/System/templates/classic/box.tpl ============================================================================== --- vtigercrm/trunk/modules/System/templates/classic/box.tpl (original) +++ vtigercrm/trunk/modules/System/templates/classic/box.tpl Fri Aug 18 07:44:35 2006 @@ -1,4 +1,4 @@ -{**} +--> - '; + '; //Get the attachments list and form in the tr tag $files_array = getTicketAttachmentsList($ticketid); From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 06:15:59 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 13:15:59 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9180 - /vtigercrm/trunk/modules/System/language/en_us.lang.php Message-ID: <20060829131559.6FD8474609D@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 29 07:15:55 2006 New Revision: 9180 Log: Added php closing tag in lang file -- ahmed Modified: vtigercrm/trunk/modules/System/language/en_us.lang.php Modified: vtigercrm/trunk/modules/System/language/en_us.lang.php ============================================================================== --- vtigercrm/trunk/modules/System/language/en_us.lang.php (original) +++ vtigercrm/trunk/modules/System/language/en_us.lang.php Tue Aug 29 07:15:55 2006 @@ -24,3 +24,4 @@ 'LBL_SYSTEM_CONFIG'=>'System Configuration', ); +?> From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 06:20:26 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 13:20:26 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9181 - /vtigercrm/trunk/modules/Calendar/addEventUI.php Message-ID: <20060829132026.9E6D174609F@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 29 07:20:22 2006 New Revision: 9181 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/addEventUI.php Modified: vtigercrm/trunk/modules/Calendar/addEventUI.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/addEventUI.php (original) +++ vtigercrm/trunk/modules/Calendar/addEventUI.php Tue Aug 29 07:20:22 2006 @@ -24,6 +24,7 @@ //echo '
';print_r($userDetails);echo '
'; $to_email = getUserEmailId('id',$current_user->id); $date_format = parse_calendardate($app_strings['NTC_DATE_FORMAT']); + $assignedto = getAssignedTo(); $mysel= $_GET['view']; $calendar_arr = Array(); $calendar_arr['IMAGE_PATH'] = $image_path; @@ -78,25 +79,95 @@ $calendar_arr['calendar']->hour_format = 'am/pm'; else $calendar_arr['calendar']->hour_format = $current_user->hour_format; - - function getPriorityCombo() - { - global $adb, $mod_strings; - $combo = ''; - $combo .= ''; - return $combo; - } +/** Function to construct HTML code for Assigned To field + * @param $assignedto -- Assigned To values :: Type array + * @param $toggletype -- String to different event and task :: Type string + * return $htmlStr -- HTML code in string forat :: Type string + */ +function getAssignedToHTML($assignedto,$toggletype) +{ + global $app_strings; + $userlist = $assignedto[0]; + if(isset($assignedto[1]) && $assignedto[1] != null) + $grouplist = $assignedto[1]; + $htmlStr = ''; + $check = 1; + foreach($userlist as $key_one=>$arr) + { + foreach($arr as $sel_value=>$value) + { + if($value != '') + $check=$check*0; + else + $check=$check*1; + } + } + if($check == 0) + { + $select_user='checked'; + $style_user='display:block'; + $style_group='display:none'; + } + else + { + $select_group='checked'; + $style_user='display:none'; + $style_group='display:block'; + } + if($toggletype == 'task') + $htmlStr .= ' '.$app_strings['LBL_USER']; + else + $htmlStr .= ' '.$app_strings['LBL_USER']; + if($grouplist != '') + { + if($toggletype == 'task') + $htmlStr .= ' '.$app_strings['LBL_GROUP']; + else + $htmlStr .= ' '.$app_strings['LBL_GROUP']; + } + if($toggletype == 'task') + { + $htmlStr .= ' + '; + } + foreach($userlist as $key_one=>$arr) + { + foreach($arr as $sel_value=>$value) + { + $htmlStr .= ''; + } + } + $htmlStr .= ' + '; + if($grouplist != '') + { + if($toggletype == 'task') + { + $htmlStr .= ' + '; + } + foreach($grouplist as $key_one=>$arr) + { + foreach($arr as $sel_value=>$value) + { + $htmlStr .= ''; + } + } + $htmlStr .= ' + '; + } + return $htmlStr; +} ?> @@ -139,12 +210,9 @@ - - - @@ -161,10 +229,10 @@
Modified: vtigercrm/trunk/modules/System/templates/classic/form.tpl ============================================================================== --- vtigercrm/trunk/modules/System/templates/classic/form.tpl (original) +++ vtigercrm/trunk/modules/System/templates/classic/form.tpl Fri Aug 18 07:44:35 2006 @@ -1,4 +1,4 @@ -{**} +// phpsysinfo release version number +--> {errors} From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 07:48:33 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 14:48:33 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9036 - /vtigercrm/trunk/modules/System/templates/classic/form.tpl Message-ID: <20060818144834.1785075120A@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 08:48:26 2006 New Revision: 9036 Log: Removed braces from sysinfo -- Ahmed Modified: vtigercrm/trunk/modules/System/templates/classic/form.tpl Modified: vtigercrm/trunk/modules/System/templates/classic/form.tpl ============================================================================== --- vtigercrm/trunk/modules/System/templates/classic/form.tpl (original) +++ vtigercrm/trunk/modules/System/templates/classic/form.tpl Fri Aug 18 08:48:26 2006 @@ -24,7 +24,6 @@ - From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 08:24:54 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 15:24:54 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9037 - /vtigercrm/trunk/modules/System/includes/xml/vitals.php Message-ID: <20060818152454.31737751321@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 09:24:47 2006 New Revision: 9037 Log: Image path made proper for sys info -- Ahmed Modified: vtigercrm/trunk/modules/System/includes/xml/vitals.php Modified: vtigercrm/trunk/modules/System/includes/xml/vitals.php ============================================================================== --- vtigercrm/trunk/modules/System/includes/xml/vitals.php (original) +++ vtigercrm/trunk/modules/System/includes/xml/vitals.php Fri Aug 18 09:24:47 2006 @@ -79,7 +79,7 @@ . " \n" . " \n" . " \n" - . " \n" + . " \n" . " \n" . " \n" . " \n" From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 08:42:51 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 15:42:51 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9039 - /vtigercrm/trunk/Smarty/templates/SysInformation.tpl Message-ID: <20060818154251.8298F751326@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 09:42:44 2006 New Revision: 9039 Log: Adjusted the system info frame height to get rid of the inside scroll -- Ahmed Modified: vtigercrm/trunk/Smarty/templates/SysInformation.tpl Modified: vtigercrm/trunk/Smarty/templates/SysInformation.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/SysInformation.tpl (original) +++ vtigercrm/trunk/Smarty/templates/SysInformation.tpl Fri Aug 18 09:42:44 2006 @@ -34,7 +34,7 @@ From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 08:25:47 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 15:25:47 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9038 - /vtigercrm/trunk/modules/System/includes/common_functions.php Message-ID: <20060818152547.EEBFB750143@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 09:25:41 2006 New Revision: 9038 Log: Image path made proper for sys info -- Ahmed Modified: vtigercrm/trunk/modules/System/includes/common_functions.php Modified: vtigercrm/trunk/modules/System/includes/common_functions.php ============================================================================== --- vtigercrm/trunk/modules/System/includes/common_functions.php (original) +++ vtigercrm/trunk/modules/System/includes/common_functions.php Fri Aug 18 09:25:41 2006 @@ -32,17 +32,17 @@ $textdir = direction(); - $imgpath = getcwd().'/modules/System/templates/' . TEMPLATE_SET . '/images/'; + $imgpath = '/modules/System/templates/' . TEMPLATE_SET . '/images/'; $maximum == 0 ? $barwidth = 0 : $barwidth = round((100 / $maximum) * $value) * $b; $red = 90 * $b; $yellow = 75 * $b; - if (!file_exists(getcwd()."/modules/System/templates/" . TEMPLATE_SET . "/images/nobar_left.gif")) { + if (!file_exists("/modules/System/templates/" . TEMPLATE_SET . "/images/nobar_left.gif")) { if ($barwidth == 0) { return '' . '' . ''; - } elseif (file_exists(getcwd() . "/modules/System/templates/" . TEMPLATE_SET . "/images/yellowbar_left.gif") && $barwidth > $yellow && $barwidth < $red) { + } elseif (file_exists("/modules/System/templates/" . TEMPLATE_SET . "/images/yellowbar_left.gif") && $barwidth > $yellow && $barwidth < $red) { return '' . '' . ''; @@ -60,7 +60,7 @@ return '' . '' . ''; - } elseif (file_exists(getcwd() . "/modules/System/templates/" . TEMPLATE_SET . "/images/yellowbar_left.gif") && $barwidth > $yellow && $barwidth < $red) { + } elseif (file_exists("/modules/System/templates/" . TEMPLATE_SET . "/images/yellowbar_left.gif") && $barwidth > $yellow && $barwidth < $red) { return '' . '' . '' From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 09:13:04 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 16:13:04 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9040 - /vtigercrm/trunk/include/nusoap/nusoap.php Message-ID: <20060818161305.62B6F751326@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 10:12:58 2006 New Revision: 9040 Log: function parse_http_headers changed to use $_SERVER to get the header informations as getallheaders has some issues in windows + PHP 5.1 ---Jeri Modified: vtigercrm/trunk/include/nusoap/nusoap.php Modified: vtigercrm/trunk/include/nusoap/nusoap.php ============================================================================== --- vtigercrm/trunk/include/nusoap/nusoap.php (original) +++ vtigercrm/trunk/include/nusoap/nusoap.php Fri Aug 18 10:12:58 2006 @@ -3322,7 +3322,12 @@ $this->request = ''; $this->SOAPAction = ''; - if(function_exists('getallheaders')){ + + //Commented to fix the issue in PHP 5 Windows system ---Jeri + //when we use getallheaders function we are geting an error description invalid gzip crc value when parsing the response in VB + // hence the function is commented out and $_SERVER is used to get all the header informations. + + /*if(function_exists('getallheaders')){ $this->debug("In parse_http_headers, use getallheaders"); $headers = getallheaders(); foreach($headers as $k=>$v){ @@ -3347,7 +3352,7 @@ // should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1 $this->xml_encoding = 'ISO-8859-1'; } - } elseif(isset($_SERVER) && is_array($_SERVER)){ + } else*/if(isset($_SERVER) && is_array($_SERVER)){ $this->debug("In parse_http_headers, use _SERVER"); foreach ($_SERVER as $k => $v) { if (substr($k, 0, 5) == 'HTTP_') { From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 13:37:09 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 20:37:09 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9041 - /vtigercrm/trunk/modules/Reports/CreatePDF.php Message-ID: <20060818203709.A842C751609@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 14:37:02 2006 New Revision: 9041 Log: Issue in Reports PDF has been fixed --Jeri Modified: vtigercrm/trunk/modules/Reports/CreatePDF.php Modified: vtigercrm/trunk/modules/Reports/CreatePDF.php ============================================================================== --- vtigercrm/trunk/modules/Reports/CreatePDF.php (original) +++ vtigercrm/trunk/modules/Reports/CreatePDF.php Fri Aug 18 14:37:02 2006 @@ -398,5 +398,5 @@ $pdf->WriteHTML($html); $pdf->Output('Reports.pdf','D'); - +exit(); ?> From vtigercrm-commits at vtiger.fosslabs.com Sun Aug 20 23:02:17 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 21 Aug 2006 06:02:17 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9042 - /vtigercrm/trunk/modules/Settings/CurrencyDeleteStep1.php Message-ID: <20060821060217.BFFB67517FB@vtiger.fosslabs.com> Author: saraj Date: Mon Aug 21 00:02:13 2006 New Revision: 9042 Log: changes made to fix the issue in currency delete --Minnie Modified: vtigercrm/trunk/modules/Settings/CurrencyDeleteStep1.php Modified: vtigercrm/trunk/modules/Settings/CurrencyDeleteStep1.php ============================================================================== --- vtigercrm/trunk/modules/Settings/CurrencyDeleteStep1.php (original) +++ vtigercrm/trunk/modules/Settings/CurrencyDeleteStep1.php Mon Aug 21 00:02:13 2006 @@ -53,7 +53,7 @@ $output.=' From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 02:29:33 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 21 Aug 2006 09:29:33 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9045 - /vtigercrm/trunk/soap/vtigerolservice.php Message-ID: <20060821092933.4F77775A228@vtiger.fosslabs.com> Author: richie Date: Mon Aug 21 03:29:08 2006 New Revision: 9045 Log: plugin_save variable has been set to true when save from outlook --Jeri Modified: vtigercrm/trunk/soap/vtigerolservice.php Modified: vtigercrm/trunk/soap/vtigerolservice.php ============================================================================== --- vtigercrm/trunk/soap/vtigerolservice.php (original) +++ vtigercrm/trunk/soap/vtigerolservice.php Mon Aug 21 03:29:08 2006 @@ -309,6 +309,7 @@ $email->column_fields[date_start] = $date_sent; $email->column_fields[description] = htmlentities($email_body); $email->column_fields[activitytype] = 'Emails'; + $email->plugin_save = true; $email->save("Emails"); $email->set_emails_contact_invitee_relationship($email->id,$contactid); @@ -320,7 +321,7 @@ if(isset($camodulerow)) { $emailid = $camodulerow["email"]; - $query = 'insert into vtiger_emaildetails values ('.$email->id.',"","'.$emailid.'","","","","'.$cotactid."@77|".'","OUTLOOK")'; + $query = 'insert into vtiger_emaildetails values ('.$email->id.',"","'.$emailid.'","","","","'.$contactid."@77|".'","OUTLOOK")'; $adb->query($query); } return $email->id; From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 02:35:13 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 21 Aug 2006 09:35:13 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9046 - /vtigercrm/trunk/modules/Emails/Email.php Message-ID: <20060821093513.B979275A790@vtiger.fosslabs.com> Author: richie Date: Mon Aug 21 03:34:48 2006 New Revision: 9046 Log: plugin_save variable has been added and set to false by default to check for plugin save--Jeri Modified: vtigercrm/trunk/modules/Emails/Email.php Modified: vtigercrm/trunk/modules/Emails/Email.php ============================================================================== --- vtigercrm/trunk/modules/Emails/Email.php (original) +++ vtigercrm/trunk/modules/Emails/Email.php Mon Aug 21 03:34:48 2006 @@ -36,7 +36,9 @@ var $db; // Stored vtiger_fields - var $module_id="emailid"; + var $module_id="emailid"; + // added to check email save from plugin or not + var $plugin_save = false; var $rel_users_table = "vtiger_salesmanactivityrel"; var $rel_contacts_table = "vtiger_cntactivityrel"; From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 02:39:37 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 21 Aug 2006 09:39:37 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9047 - /vtigercrm/trunk/data/CRMEntity.php Message-ID: <20060821093937.377E175A7AC@vtiger.fosslabs.com> Author: richie Date: Mon Aug 21 03:39:07 2006 New Revision: 9047 Log: plugin_save variable checked for inserting into seactiivityrel --Jeri Modified: vtigercrm/trunk/data/CRMEntity.php Modified: vtigercrm/trunk/data/CRMEntity.php ============================================================================== --- vtigercrm/trunk/data/CRMEntity.php (original) +++ vtigercrm/trunk/data/CRMEntity.php Mon Aug 21 03:39:07 2006 @@ -79,10 +79,9 @@ //added by raju elseif($table_name=="vtiger_seactivityrel" ) { - if($module=="Emails" && $_REQUEST['smodule']!='webmails') - //modified by Richie as raju's implementation broke the feature for addition of webmail to vtiger_crmentity.need to be more careful in future while integrating code - //if($_REQUEST['smodule']!='webmails' && $_REQUEST['smodule'] != '') - { + //modified by Richie as raju's implementation broke the feature for addition of webmail to vtiger_crmentity.need to be more careful in future while integrating code + if($module=="Emails" && $_REQUEST['smodule']!='webmails' && (!$this->plugin_save)) + { if($_REQUEST['currentid']!='') { $actid=$_REQUEST['currentid']; From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 03:28:55 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 21 Aug 2006 10:28:55 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9048 - /vtigercrm/trunk/include/utils/ListViewUtils.php Message-ID: <20060821102855.BD1F975A7BA@vtiger.fosslabs.com> Author: saraj Date: Mon Aug 21 04:28:51 2006 New Revision: 9048 Log: Retained navigation page after sorting. Fixes #1923 Modified: vtigercrm/trunk/include/utils/ListViewUtils.php Modified: vtigercrm/trunk/include/utils/ListViewUtils.php ============================================================================== --- vtigercrm/trunk/include/utils/ListViewUtils.php (original) +++ vtigercrm/trunk/include/utils/ListViewUtils.php Mon Aug 21 04:28:51 2006 @@ -162,13 +162,13 @@ $lbl_name .=': (in '.$curr_symbol.')'; } if($relatedlist !='' && $relatedlist != 'global') - $name = "".$lbl_name." ".$arrow.""; + $name = "".$lbl_name." ".$arrow.""; elseif($module == 'Users' && $name == 'User Name') $name = "".$mod_strings['LBL_LIST_USER_NAME_ROLE']." ".$arrow.""; elseif($relatedlist == "global") $name = $lbl_name; else - $name = "".$lbl_name." ".$arrow.""; + $name = "".$lbl_name." ".$arrow.""; $arrow = ''; } else From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 03:50:13 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 21 Aug 2006 10:50:13 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9049 - /vtigercrm/trunk/include/Ajax/TagCloud.php Message-ID: <20060821105013.C6E6675A7BD@vtiger.fosslabs.com> Author: richie Date: Mon Aug 21 04:50:02 2006 New Revision: 9049 Log: SQL Injection in tagcloud has been fixed --Jeri Modified: vtigercrm/trunk/include/Ajax/TagCloud.php Modified: vtigercrm/trunk/include/Ajax/TagCloud.php ============================================================================== --- vtigercrm/trunk/include/Ajax/TagCloud.php (original) +++ vtigercrm/trunk/include/Ajax/TagCloud.php Mon Aug 21 04:50:02 2006 @@ -1,53 +1,60 @@ -id; -if($ajaxaction == "SAVETAG") -{ - - require_once('include/freetag/freetag.class.php'); - $tagfields = $_REQUEST["tagfields"]; - $freetag = new freetag(); - if (isset($_REQUEST["tagfields"]) && trim($_REQUEST["tagfields"]) != "") - { - $freetag->tag_object($userid,$crmid,$tagfields,$module); - $tagcloud = $freetag->get_tag_cloud_html($module,$userid,$crmid); - echo $tagcloud; - } - -} -elseif($ajaxaction == 'GETTAGCLOUD') -{ - require_once('include/freetag/freetag.class.php'); - $freetag = new freetag(); - if(trim($module) != "") - { - $tagcloud = $freetag->get_tag_cloud_html($module,$userid,$crmid); - echo $tagcloud; - }else - { - $tagcloud = $freetag->get_tag_cloud_html("",$userid); - echo $tagcloud; - } -}elseif($ajaxaction == 'DELETETAG') -{ - $tagid = $_REQUEST['tagid']; - global $adb; - $query="delete from vtiger_freetagged_objects where tag_id=".$tagid; - $result=$adb->query($query); - $query="delete from vtiger_freetags where id=".$tagid; - $result=$adb->query($query); - echo 'SUCESS'; -} -?> +id; +if($ajaxaction == "SAVETAG") +{ + + require_once('include/freetag/freetag.class.php'); + $tagfields = $_REQUEST["tagfields"]; + $freetag = new freetag(); + if (isset($_REQUEST["tagfields"]) && trim($_REQUEST["tagfields"]) != "") + { + $freetag->tag_object($userid,$crmid,$tagfields,$module); + $tagcloud = $freetag->get_tag_cloud_html($module,$userid,$crmid); + echo $tagcloud; + } + +} +elseif($ajaxaction == 'GETTAGCLOUD') +{ + require_once('include/freetag/freetag.class.php'); + $freetag = new freetag(); + if(trim($module) != "") + { + $tagcloud = $freetag->get_tag_cloud_html($module,$userid,$crmid); + echo $tagcloud; + }else + { + $tagcloud = $freetag->get_tag_cloud_html("",$userid); + echo $tagcloud; + } +}elseif($ajaxaction == 'DELETETAG') +{ + if(is_numeric($_REQUEST['tagid'])) + { + $tagid = $_REQUEST['tagid']; + global $adb; + $query="delete from vtiger_freetagged_objects where tag_id=".$tagid; + $result=$adb->query($query); + $query="delete from vtiger_freetags where id=".$tagid; + $result=$adb->query($query); + echo 'SUCESS'; + }else + { + die("An invalid tagid to delete."); + } + +} +?> From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 04:42:25 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 21 Aug 2006 11:42:25 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9050 - /vtigercrm/trunk/Smarty/templates/OrgSharingEditView.tpl Message-ID: <20060821114225.6C74175A7C5@vtiger.fosslabs.com> Author: richie Date: Mon Aug 21 05:42:15 2006 New Revision: 9050 Log: Include Settings submenu has been removed --Jeri Modified: vtigercrm/trunk/Smarty/templates/OrgSharingEditView.tpl Modified: vtigercrm/trunk/Smarty/templates/OrgSharingEditView.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/OrgSharingEditView.tpl (original) +++ vtigercrm/trunk/Smarty/templates/OrgSharingEditView.tpl Mon Aug 21 05:42:15 2006 @@ -98,5 +98,4 @@ {rdelim} -{include file='SettingsSubMenu.tpl'} From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 07:11:45 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 21 Aug 2006 14:11:45 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9051 - /vtigercrm/trunk/Smarty/templates/Header.tpl Message-ID: <20060821141145.9A3EE75A7F6@vtiger.fosslabs.com> Author: saraj Date: Mon Aug 21 08:11:41 2006 New Revision: 9051 Log: changes made to get jscalendar popup in qcreate --Minnie Modified: vtigercrm/trunk/Smarty/templates/Header.tpl Modified: vtigercrm/trunk/Smarty/templates/Header.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/Header.tpl (original) +++ vtigercrm/trunk/Smarty/templates/Header.tpl Mon Aug 21 08:11:41 2006 @@ -28,6 +28,10 @@ + + + +
{vitals}
{memory}
{filesystems}
{hardware}
" . $text['dversion'] . "\"\"getData("/phpsysinfo/Vitals/Distroicon") . "\"> " . $XPath->getData("/phpsysinfo/Vitals/Distro") . "\"\"getData("/phpsysinfo/Vitals/Distroicon") . "\"> " . $XPath->getData("/phpsysinfo/Vitals/Distro") . "
" . $text['uptime'] . "
- +
- +
@@ -205,6 +209,7 @@ $("status").style.display="none"; $("qcform").style.display="inline"; $("qcform").innerHTML = response.responseText; + eval($("date_calpopup").innerHTML); eval($("qcform")); {rdelim} {rdelim} From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 07:15:44 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 21 Aug 2006 14:15:44 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9052 - /vtigercrm/trunk/Smarty/templates/DetailView.tpl Message-ID: <20060821141544.CE65975A7F6@vtiger.fosslabs.com> Author: saraj Date: Mon Aug 21 08:15:41 2006 New Revision: 9052 Log: changes made to get jscalendar popup in convertlead --Minnie Modified: vtigercrm/trunk/Smarty/templates/DetailView.tpl Modified: vtigercrm/trunk/Smarty/templates/DetailView.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/DetailView.tpl (original) +++ vtigercrm/trunk/Smarty/templates/DetailView.tpl Mon Aug 21 08:15:41 2006 @@ -37,6 +37,7 @@ postBody: 'module=Leads&action=LeadsAjax&file=ConvertLead&record='+id, onComplete: function(response) { $("convertleaddiv").innerHTML=response.responseText; + eval($("conv_leadcal").innerHTML); } } ); From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 07:21:41 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 21 Aug 2006 14:21:41 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9053 - /vtigercrm/trunk/Smarty/templates/QuickCreate.tpl Message-ID: <20060821142141.C488675A7DE@vtiger.fosslabs.com> Author: saraj Date: Mon Aug 21 08:21:38 2006 New Revision: 9053 Log: changes made to get jscalendar popup in qcreate --Minnie Modified: vtigercrm/trunk/Smarty/templates/QuickCreate.tpl Modified: vtigercrm/trunk/Smarty/templates/QuickCreate.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/QuickCreate.tpl (original) +++ vtigercrm/trunk/Smarty/templates/QuickCreate.tpl Mon Aug 21 08:21:38 2006 @@ -224,6 +224,7 @@ {assign var=time_val value="$time_value"} {/foreach} + {if $uitype eq 6} {/if} @@ -236,6 +237,9 @@ {else}
({$dateStr}) {/if} + {elseif $uitype eq 63} @@ -243,7 +247,7 @@ {$fldlabel} From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 07:38:51 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 21 Aug 2006 14:38:51 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9056 - /wordintegration/trunk/client/bin/Language/english.ini Message-ID: <20060821143851.C12F975A7DF@vtiger.fosslabs.com> Author: richie Date: Mon Aug 21 08:38:44 2006 New Revision: 9056 Log: String added for unable to connect to vtigerCRM --Jeri Modified: wordintegration/trunk/client/bin/Language/english.ini Modified: wordintegration/trunk/client/bin/Language/english.ini ============================================================================== Binary files - no diff available. From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 07:41:41 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 21 Aug 2006 14:41:41 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9057 - /vtigercrm/trunk/modules/Leads/LeadConvertToEntities.php Message-ID: <20060821144141.72A9A75A800@vtiger.fosslabs.com> Author: saraj Date: Mon Aug 21 08:41:37 2006 New Revision: 9057 Log: changes made to handle campaign relation in convertlead functionality --Minnie Modified: vtigercrm/trunk/modules/Leads/LeadConvertToEntities.php Modified: vtigercrm/trunk/modules/Leads/LeadConvertToEntities.php ============================================================================== --- vtigercrm/trunk/modules/Leads/LeadConvertToEntities.php (original) +++ vtigercrm/trunk/modules/Leads/LeadConvertToEntities.php Mon Aug 21 08:41:37 2006 @@ -247,6 +247,27 @@ $log->debug("Exit from function saveLeadRelatedProducts."); } +/** Function used to save the lead related Campaigns with Contact + * $leadid - leadid + * $relatedid - related entity id (contactid) + */ +function saveLeadRelatedCampaigns($leadid, $relatedid) +{ + global $adb, $log; + $log->debug("Entering into function saveLeadRelatedCampaigns($leadid, $relatedid)"); + + $campaign_result = $adb->query("select * from vtiger_campaignleadrel where leadid=$leadid"); + $noofcampaigns = $adb->num_rows($campaign_result); + for($i = 0; $i < $noofcampaigns; $i++) + { + $campaignid = $adb->query_result($campaign_result,$i,'campaignid'); + + $adb->query("insert into vtiger_campaigncontrel (campaignid, contactid) values($campaignid, $relatedid)"); + } + $log->debug("Exit from function saveLeadRelatedCampaigns."); +} + + $crmid = $adb->getUniqueID("vtiger_crmentity"); //Saving Account - starts @@ -335,6 +356,9 @@ //Retrieve the lead related products and relate them with this new contact saveLeadRelatedProducts($id, $contact_id, "Contacts"); + +//Retrieve the lead related Campaigns and relate them with this new contact --Minnie +saveLeadRelatedCampaigns($id, $contact_id); //Up to this, Contact related data save finshed @@ -399,7 +423,9 @@ //Updating the deleted status $sql_update_converted = "UPDATE vtiger_leaddetails SET converted = 1 where leadid='" .$id ."'"; $adb->query($sql_update_converted); - +//updating the campaign-lead relation --Minnie +$sql_update_campleadrel = "delete from vtiger_campaignleadrel where leadid=".$id; +$adb->query($sql_update_campleadrel); header("Location: index.php?action=DetailView&module=Accounts&record=$crmid&parenttab=$category"); ?> From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 07:46:38 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 21 Aug 2006 14:46:38 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9058 - in /wordintegration/trunk/client/source: modGeneral.bas modLang.bas vtigerCRMWordPlugin.vbp vtigerCRMWordPlugin.vbw Message-ID: <20060821144638.BAA4875A814@vtiger.fosslabs.com> Author: richie Date: Mon Aug 21 08:46:25 2006 New Revision: 9058 Log: Issue in Login to word plugin has been fixed --Jeri Modified: wordintegration/trunk/client/source/modGeneral.bas wordintegration/trunk/client/source/modLang.bas wordintegration/trunk/client/source/vtigerCRMWordPlugin.vbp wordintegration/trunk/client/source/vtigerCRMWordPlugin.vbw Modified: wordintegration/trunk/client/source/modGeneral.bas ============================================================================== Binary files - no diff available. Modified: wordintegration/trunk/client/source/modLang.bas ============================================================================== Binary files - no diff available. Modified: wordintegration/trunk/client/source/vtigerCRMWordPlugin.vbp ============================================================================== Binary files - no diff available. Modified: wordintegration/trunk/client/source/vtigerCRMWordPlugin.vbw ============================================================================== Binary files - no diff available. From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 07:53:46 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 21 Aug 2006 14:53:46 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9059 - /vtigercrm/trunk/soap/wordplugin.php Message-ID: <20060821145346.7CD6E75A825@vtiger.fosslabs.com> Author: richie Date: Mon Aug 21 08:53:39 2006 New Revision: 9059 Log: Issue in Login to word plugin has been fixed --Jeri Modified: vtigercrm/trunk/soap/wordplugin.php Modified: vtigercrm/trunk/soap/wordplugin.php ============================================================================== --- vtigercrm/trunk/soap/wordplugin.php (original) +++ vtigercrm/trunk/soap/wordplugin.php Mon Aug 21 08:53:39 2006 @@ -307,8 +307,25 @@ function create_session($user_name, $password) -{ - return "TempSessionID"; +{ + global $adb; + require_once('modules/Users/User.php'); + $objuser = new User(); + if($password != "" && $user_name != '') + { + $objuser->column_fields['user_name'] = $user_name; + $objuser->load_user($password); + if($objuser->is_authenticated()) + { + return "TempSessionID"; + }else + { + return "false"; + } + }else + { + return "false"; + } } function end_session($user_name) From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 22:30:56 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 05:30:56 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9060 - /vtigercrm/branches/4.2/modules/Contacts/Contact.php Message-ID: <20060822053056.472CC75C84B@vtiger.fosslabs.com> Author: allanbush Date: Mon Aug 21 23:30:48 2006 New Revision: 9060 Log: Added contact sub details to contact export. Closes #1813. Modified: vtigercrm/branches/4.2/modules/Contacts/Contact.php Modified: vtigercrm/branches/4.2/modules/Contacts/Contact.php ============================================================================== --- vtigercrm/branches/4.2/modules/Contacts/Contact.php (original) +++ vtigercrm/branches/4.2/modules/Contacts/Contact.php Mon Aug 21 23:30:48 2006 @@ -492,11 +492,12 @@ if($this->checkIfCustomTableExists()) { $query = $this->constructCustomQueryAddendum() .", - contactdetails.*, contactaddress.*, + contactdetails.*, contactsubdetails.*, contactaddress.*, account.accountname AS account_name, users.user_name AS assigned_user_name FROM contactdetails inner join crmentity on crmentity.crmid=contactdetails.contactid + inner join contactsubdetails on contactsubdetails.contactsubscriptionid=contactdetails.contactid LEFT JOIN users ON crmentity.smcreatorid=users.id LEFT JOIN account on contactdetails.accountid=account.accountid left join contactaddress on contactaddress.contactaddressid=contactdetails.contactid @@ -506,11 +507,12 @@ else { $query = "SELECT - contactdetails.*, contactaddress.*, + contactdetails.*, contactsubdetails.*, contactaddress.*, account.accountname AS account_name, users.user_name AS assigned_user_name FROM contactdetails inner join crmentity on crmentity.crmid=contactdetails.contactid + inner join contactsubdetails on contactsubdetails.contactsubscriptionid=contactdetails.contactid LEFT JOIN users ON crmentity.smcreatorid=users.id LEFT JOIN account on contactdetails.accountid=account.accountid left join contactaddress on contactaddress.contactaddressid=contactdetails.contactid From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 22:38:33 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 05:38:33 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9061 - in /vtigercrm/trunk/modules/Users: DefaultDataPopulator.php profilePrivileges.php Message-ID: <20060822053833.7E56A75C88A@vtiger.fosslabs.com> Author: richie Date: Mon Aug 21 23:38:17 2006 New Revision: 9061 Log: Profile Issues has been fixed --Jeri Modified: vtigercrm/trunk/modules/Users/DefaultDataPopulator.php vtigercrm/trunk/modules/Users/profilePrivileges.php Modified: vtigercrm/trunk/modules/Users/DefaultDataPopulator.php ============================================================================== --- vtigercrm/trunk/modules/Users/DefaultDataPopulator.php (original) +++ vtigercrm/trunk/modules/Users/DefaultDataPopulator.php Mon Aug 21 23:38:17 2006 @@ -1411,6 +1411,11 @@ $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",9,3,0)"); $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",9,4,0)"); + $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",10,0,1)"); + $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",10,1,1)"); + $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",10,2,1)"); + $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",10,3,0)"); + $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",10,4,0)"); $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",13,0,1)"); $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",13,1,1)"); @@ -1504,6 +1509,7 @@ $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",7,6,0)"); $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",8,6,0)"); //$this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",9,6,0)"); + $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",10,6,0)"); $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",7,8,0)"); $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",6,8,0)"); $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",4,8,0)"); Modified: vtigercrm/trunk/modules/Users/profilePrivileges.php ============================================================================== --- vtigercrm/trunk/modules/Users/profilePrivileges.php (original) +++ vtigercrm/trunk/modules/Users/profilePrivileges.php Mon Aug 21 23:38:17 2006 @@ -304,7 +304,7 @@ $no_of_actions=sizeof($action_array); foreach($action_array as $action_id=>$act_per) { - $action_name = getActionName($action_id); + $action_name = getActionname($action_id); $tab_util_act_per = $action_array[$action_id]; $tab_util_per = getDisplayValue($tab_util_act_per,$tabid,$action_id); $util[]=$action_name; @@ -325,7 +325,7 @@ $no_of_actions=sizeof($action_array); foreach($action_array as $action_id=>$act_per) { - $action_name = getActionName($action_id); + $action_name = getActionname($action_id); $tab_util_act_per = $action_array[$action_id]; $tab_util_per = getDisplayOutput($tab_util_act_per,$tabid,$action_id); $util[]=$action_name; @@ -348,7 +348,7 @@ $no_of_actions=sizeof($action_array); foreach($action_array as $action_id=>$act_per) { - $action_name = getActionName($action_id); + $action_name = getActionname($action_id); $tab_util_act_per = $action_array[$action_id]; $tab_util_per = getDisplayOutput($tab_util_act_per,$tabid,$action_id); $util[]=$action_name; @@ -369,7 +369,7 @@ $no_of_actions=sizeof($action_array); foreach($action_array as $action_id=>$act_per) { - $action_name = getActionName($action_id); + $action_name = getActionname($action_id); $tab_util_act_per = $action_array[$action_id]; $tab_util_per = getDisplayOutput(0,$tabid,$action_id); $util[]=$action_name; From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 22:40:24 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 05:40:24 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9062 - in /vtigercrm/trunk/Smarty/templates: EditProfile.tpl ProfileDetailView.tpl Message-ID: <20060822054024.B37F375C88A@vtiger.fosslabs.com> Author: richie Date: Mon Aug 21 23:40:13 2006 New Revision: 9062 Log: Export utility privileges in Emails issue has been fixed --jeri Modified: vtigercrm/trunk/Smarty/templates/EditProfile.tpl vtigercrm/trunk/Smarty/templates/ProfileDetailView.tpl Modified: vtigercrm/trunk/Smarty/templates/EditProfile.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/EditProfile.tpl (original) +++ vtigercrm/trunk/Smarty/templates/EditProfile.tpl Mon Aug 21 23:40:13 2006 @@ -157,10 +157,10 @@ - - + + @@ -181,8 +181,8 @@ {$STANDARD_PRIV[$tabid][2]} @@ -190,6 +190,7 @@ From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 11:32:16 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 18:32:16 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9145 - /vtigercrm/trunk/adodb/drivers/adodb-postgres64.inc.php Message-ID: <20060828183216.266EE7081EB@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 12:32:07 2006 New Revision: 9145 Log: Support for PostGres DB done Modified: vtigercrm/trunk/adodb/drivers/adodb-postgres64.inc.php Modified: vtigercrm/trunk/adodb/drivers/adodb-postgres64.inc.php ============================================================================== --- vtigercrm/trunk/adodb/drivers/adodb-postgres64.inc.php (original) +++ vtigercrm/trunk/adodb/drivers/adodb-postgres64.inc.php Mon Aug 28 12:32:07 2006 @@ -169,13 +169,25 @@ } - // returns true/false - function BeginTrans() - { - if ($this->transOff) return true; - $this->transCnt += 1; - return @pg_Exec($this->_connectionID, "begin ".$this->_transmode); - } + function SetTransactionMode( $transaction_mode ) + { + if (empty($transaction_mode)) { + $transaction_mode = 'ISOLATION LEVEL SERIALIZABLE'; + } + if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode; + $this->_transmode = $transaction_mode; + return( @pg_Exec($this->_connectionID, "SET SESSION TRANSACTION ".$transaction_mode)); + } + + function BeginTrans() + { + if ($this->transOff) return true; + $this->transCnt += 1; + if( $this->SetTransactionMode($this->_transmode)) + return @pg_Exec($this->_connectionID, "begin"); + else + return(0); + } function RowLock($tables,$where,$flds='1 as ignore') { @@ -1051,4 +1063,4 @@ } } -?> +?> From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 11:33:19 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 18:33:19 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9146 - /vtigercrm/trunk/adodb/adodb-datadict.inc.php Message-ID: <20060828183319.3D5187081EE@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 12:33:12 2006 New Revision: 9146 Log: Support for PostGres DB done Modified: vtigercrm/trunk/adodb/adodb-datadict.inc.php Modified: vtigercrm/trunk/adodb/adodb-datadict.inc.php ============================================================================== --- vtigercrm/trunk/adodb/adodb-datadict.inc.php (original) +++ vtigercrm/trunk/adodb/adodb-datadict.inc.php Mon Aug 28 12:33:12 2006 @@ -267,7 +267,7 @@ foreach($sql as $line) { if ($this->debug) $conn->debug = true; - $log->fatal($line); + $log->debug($line); $ok = $conn->Execute($line); $conn->debug = $saved; if (!$ok) { From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 11:34:41 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 18:34:41 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9147 - /vtigercrm/trunk/include/freetag/freetag.class.php Message-ID: <20060828183441.C86517081FA@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 12:34:34 2006 New Revision: 9147 Log: Support for PostGres DB done Modified: vtigercrm/trunk/include/freetag/freetag.class.php Modified: vtigercrm/trunk/include/freetag/freetag.class.php ============================================================================== --- vtigercrm/trunk/include/freetag/freetag.class.php (original) +++ vtigercrm/trunk/include/freetag/freetag.class.php Mon Aug 28 12:34:34 2006 @@ -984,7 +984,7 @@ ON (${prefix}freetags.id = tag_id) WHERE 1=1 $tagger_sql - GROUP BY tag + GROUP BY tag,tag_id ORDER BY quantity DESC"; //echo $sql; $rs = $adb->limitQuery($sql, 0, $max) or die("Syntax Error: $sql"); From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 11:37:27 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 18:37:27 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9148 - /vtigercrm/trunk/include/database/PearDatabase.php Message-ID: <20060828183727.63C8A708208@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 12:37:19 2006 New Revision: 9148 Log: Support for PostGres DB done Modified: vtigercrm/trunk/include/database/PearDatabase.php Modified: vtigercrm/trunk/include/database/PearDatabase.php ============================================================================== --- vtigercrm/trunk/include/database/PearDatabase.php (original) +++ vtigercrm/trunk/include/database/PearDatabase.php Mon Aug 28 12:37:19 2006 @@ -20,766 +20,775 @@ $log =& LoggerManager::getLogger('VT'); class PearDatabase{ - var $database = null; - var $dieOnError = false; - var $dbType = null; - var $dbHostName = null; - var $dbName = null; - var $dbOptions = null; - var $userName=null; - var $userPassword=null; - var $query_time = 0; - var $log = null; - var $lastmysqlrow = -1; - var $enableSQLlog = false; - - function isMySQL() { return dbType=='mysql'; } - function isOracle() { return dbType=='oci8'; } + var $database = null; + var $dieOnError = false; + var $dbType = null; + var $dbHostName = null; + var $dbName = null; + var $dbOptions = null; + var $userName=null; + var $userPassword=null; + var $query_time = 0; + var $log = null; + var $lastmysqlrow = -1; + var $enableSQLlog = false; + + function isMySQL() { return dbType=='mysql'; } + function isOracle() { return dbType=='oci8'; } + + function println($msg) + { + require_once('include/logging.php'); + $log1 =& LoggerManager::getLogger('VT'); + if(is_array($msg)) + { + $log1->info("PearDatabse ->".print_r($msg,true)); + } + else + { + $log1->info("PearDatabase ->".$msg); + } + return $msg; + } + + function setDieOnError($value){ + $this->dieOnError = $value; + } + + function setDatabaseType($type){ + $this->dbType = $type; + } + + function setUserName($name){ + $this->userName = $name; + } + + function setOption($name, $value){ + if(isset($this->dbOptions)) + $this->dbOptions[$name] = $value; + if(isset($this->database)) + $this->database->setOption($name, $value); + } + + function setUserPassword($pass){ + $this->userPassword = $pass; + } + + function setDatabaseName($db){ + $this->dbName = $db; + } + + function setDatabaseHost($host){ + $this->dbHostName = $host; + } + + function getDataSourceName(){ + return $this->dbType. "://".$this->userName.":".$this->userPassword."@". $this->dbHostName . "/". $this->dbName; + } + + function startTransaction() + { + $this->checkConnection(); + $this->println("TRANS Started"); + $this->database->StartTrans(); + } + + function completeTransaction() + { + if($this->database->HasFailedTrans()) + $this->println("TRANS Rolled Back"); + else + $this->println("TRANS Commited"); - function println($msg) - { - require_once('include/logging.php'); - $log1 =& LoggerManager::getLogger('VT'); - if(is_array($msg)) - { - $log1->info("PearDatabse ->".print_r($msg,true)); - } - else - { - $log1->info("PearDatabase ->".$msg); - } - return $msg; - } - - function setDieOnError($value){ - $this->dieOnError = $value; - } + $this->database->CompleteTrans(); + $this->println("TRANS Completed"); + } + +/* ADODB converted + * function checkError($msg='', $dieOnError=false) + * { + * if($this->dbType == "mysql") + * { + * if (mysql_errno()) + * { + * if($this->dieOnError || $dieOnError) + * { + * $this->log->fatal("MySQL error ".mysql_errno().": ".mysql_error()); + * die ($msg."MySQL error ".mysql_errno().": ".mysql_error()); + * } else { + * $this->log->error("MySQL error ".mysql_errno().": ".mysql_error()); + * } + * return true; + * } + * return false; + * } + * else + * { + * if(!isset($this->database)) + * { + * $this->log->error("Database Is Not Connected"); + * return true; + * } + * if(DB::isError($this->database)) + * { + * if($this->dieOnError || $dieOnError) + * { + * $this->log->fatal($msg.$this->database->getMessage()); + * die ($msg.$this->database->getMessage()); + * } else { + * $this->log->error($msg.$this->database->getMessage()); + * } + * return true; + * } + * } + * return false; + * } + */ + + function checkError($msg='', $dieOnError=false) + { +/* + * if($this->database->ErrorNo()) + * { + * if($this->dieOnError || $dieOnError) + * { + * $this->println("ADODB error ".$this->database->ErrorNo()); + * die ($msg."ADODB error ".$this->database->ErrorNo()); + * } else { + * $this->log->error("MySQL error ".mysql_errno().": ".mysql_error()); + * } + * return true; + * } + */ - function setDatabaseType($type){ - $this->dbType = $type; - } + if($this->dieOnError || $dieOnError) + { + $this->println("ADODB error ".$msg."->[".$this->database->ErrorNo()."]".$this->database->ErrorMsg()); + die ($msg."ADODB error ".$msg."->".$this->database->ErrorMsg()); + } + else + { + $this->println("ADODB error ".$msg."->[".$this->database->ErrorNo()."]".$this->database->ErrorMsg()); + } + return false; + } + + function change_key_case($arr) + { + return is_array($arr)?array_change_key_case($arr):$arr; + } + + var $req_flist; + + /** + * @return void + * @desc checks if a connection exists if it does not it closes the connection + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function checkConnection(){ + global $log; + + if(!isset($this->database)) + { + $this->println("TRANS creating new connection"); +/* + * $flist=get_included_files(); + * foreach($flist as $key=>$value) + * { + * if(!strstr($value,'\\modules') && !strstr($value,'\\data')) + * unset($flist[$key]); + * } + * $this->println($flist); + */ + $this->connect(false); + } + else + { + //$this->println("checkconnect using old connection"); + } + } + +/* ADODB converted + * function query($sql, $dieOnError=false, $msg='') + * { + * $this->println("query ".$sql); + * $this->log->info('Query:' . $sql); + * $this->checkConnection(); + * $this->query_time = microtime(); + * if($this->dbType == "mysql") + * { + * $result =& mysql_query($sql); + * $this->lastmysqlrow = -1; + * } else { + * $result =& $this->database->query($sql); + * } + * $this->query_time = microtime() - $this->query_time; + * $this->log->info('Query Execution Time:'.$this->query_time); + * $this->checkError($msg.' Query Failed:' . $sql . '::', $dieOnError); + * return $result; + * } + */ + + function query($sql, $dieOnError=false, $msg='') + { + global $log; + //$this->println("ADODB query ".$sql); + $log->debug('query being executed : '.$sql); + $this->checkConnection(); + $result = & $this->database->Execute($sql); + $this->lastmysqlrow = -1; + if(!$result)$this->checkError($msg.' Query Failed:' . $sql . '::', $dieOnError); + return $result; + } + + function getEmptyBlob() + { + //if(dbType=="oci8") return 'empty_blob()'; + //else return 'null'; + return 'null'; + } + + function updateBlob($tablename, $colname, $id, $data) + { + $this->println("updateBlob t=".$tablename." c=".$colname." id=".$id); + $this->checkConnection(); + $result = $this->database->UpdateBlob($tablename, $colname, $data, $id); + $this->println("updateBlob t=".$tablename." c=".$colname." id=".$id." status=".$result); + return $result; + } + + function updateBlobFile($tablename, $colname, $id, $filename) + { + $this->println("updateBlobFile t=".$tablename." c=".$colname." id=".$id." f=".$filename); + $this->checkConnection(); + $result = $this->database->UpdateBlobFile($tablename, $colname, $filename, $id); + $this->println("updateBlobFile t=".$tablename." c=".$colname." id=".$id." f=".$filename." status=".$result); + return $result; + } + +/* ADODB converted + * function limitQuery($sql,$start,$count, $dieOnError=false, $msg='') + * { + * if($this->dbType == "mysql") + * return $this->query("$sql LIMIT $start,$count", $dieOnError, $msg); + * $this->log->info('Limit Query:' . $sql. ' Start: ' .$start . ' count: ' . $count); + * $this->lastsql = $sql; + * + * $this->checkConnection(); + * $this->query_time = microtime(); + * $result =& $this->database->limitQuery($sql,$start, $count); + * $this->query_time = microtime() - $this->query_time; + * $this->log->info('Query Execution Time:'.$this->query_time); + * $this->checkError($msg.' Query Failed:' . $sql . '::', $dieOnError); + * return $result; + * } + */ + + function limitQuery($sql,$start,$count, $dieOnError=false, $msg='') + { + global $log; + //$this->println("ADODB limitQuery sql=".$sql." st=".$start." co=".$count); + $log->debug(' limitQuery sql = '.$sql .' st = '.$start .' co = '.$count); + $this->checkConnection(); + $result =& $this->database->SelectLimit($sql,$count,$start); + if(!$result) $this->checkError($msg.' Limit Query Failed:' . $sql . '::', $dieOnError); + return $result; + } + +/* ADODB converted + * function getOne($sql, $dieOnError=false, $msg='') + * { + * $this->log->info('Get One:' . $sql); + * $this->checkConnection(); + * if($this->dbType == "mysql"){ + * $queryresult =& $this->query($sql, $dieOnError, $msg); + * $result =& mysql_result($queryresult,0); + * } else { + * $result =& $this->database->getOne($sql); + * } + * $this->checkError($msg.' Get One Failed:' . $sql . '::', $dieOnError); + * return $result; + * } + */ + + function getOne($sql, $dieOnError=false, $msg='') + { + $this->println("ADODB getOne sql=".$sql); + $this->checkConnection(); + $result =& $this->database->GetOne($sql); + if(!$result) $this->checkError($msg.' Get one Query Failed:' . $sql . '::', $dieOnError); + return $result; + } + +/* ADODB converted + * function getFieldsArray(&$result) + * { + * $field_array = array(); + * + * if(! isset($result) || empty($result)) + * { + * return 0; + * } + * + * if($this->dbType == "mysql") + * { + * $i = 0; + * while ($i < mysql_num_fields($result)) + * { + * $meta = mysql_fetch_field($result, $i); + * + * if (!$meta) + * { + * return 0; + * } + * + * array_push($field_array,$meta->name); + * + * $i++; + * } + * } + * else + * { + * $arr = tableInfo($result); + * foreach ($arr as $index=>$subarr) + * { + * array_push($field_array,$subarr['name']); + * } + * } + * + * return $field_array; + * } + */ + + function getFieldsArray(&$result) + { + //$this->println("ADODB getFieldsArray"); + $field_array = array(); + if(! isset($result) || empty($result)) + { + return 0; + } + + $i = 0; + $n = $result->FieldCount(); + while ($i < $n) + { + $meta = $result->FetchField($i); + if (!$meta) + { + return 0; + } + array_push($field_array,$meta->name); + $i++; + } + + //$this->println($field_array); + return $field_array; + } + +/* ADODB Converted + * function getRowCount(&$result) + * { + * if(isset($result) && !empty($result)) + * if($this->dbType == "mysql"){ + * return mysql_numrows($result); + * } else { + * return $result->numRows(); + * } + * return 0; + * } + */ + + function getRowCount(&$result){ + global $log; + //$this->println("ADODB getRowCount"); + if(isset($result) && !empty($result)) + $rows= $result->RecordCount(); + //$this->println("ADODB getRowCount rows=".$rows); + //$log->debug('getRowCount rows= '.$rows); + return $rows; + } + + /* ADODB newly added. replacement for mysql_num_rows */ + function num_rows(&$result) + { + return $this->getRowCount($result); + } + + /* ADODB newly added. replacement form mysql_num_fields */ + function num_fields(&$result) + { + return $result->FieldCount(); + } + + /* ADODB newly added. replacement for mysql_fetch_array() */ + function fetch_array(&$result) + { + if($result->EOF) + { + //$this->println("ADODB fetch_array return null"); + return NULL; + } + return $this->change_key_case($result->FetchRow()); + } + + /* ADODB newly added. replacement for mysql_result() */ + function query_result(&$result, $row, $col=0) + { + //$this->println("ADODB query_result r=".$row." c=".$col); + $result->Move($row); + $rowdata = $this->change_key_case($result->FetchRow()); + //$this->println($rowdata); + $coldata = strip_selected_tags($rowdata[$col],'script'); + //$this->println("ADODB query_result ". $coldata); + return $coldata; + } + +/* ADODB Converted + * function getAffectedRowCount(&$result) + * { + * if($this->dbType == "mysql"){ + * return mysql_affected_rows(); + * } + * else { + * return $result->affectedRows(); + * } + * return 0; + * } + */ + + function getAffectedRowCount(&$result) + { + global $log; + //$this->println("ADODB getAffectedRowCount"); + $log->debug('getAffectedRowCount'); + $rows =$this->database->Affected_Rows(); + //$this->println("ADODB getAffectedRowCount rows=".rows); + $log->debug('getAffectedRowCount rows = '.$rows); + return $rows; + } + +/* ADODB converted + * function requireSingleResult($sql, $dieOnError=false,$msg='', $encode=true){ + * $result = $this->query($sql, $dieOnError, $msg); + * + * if($this->getRowCount($result ) == 1) + * return to_html($result, $encode); + * $this->log->error('Rows Returned:'. $this->getRowCount($result) .' More than 1 row returned for '. $sql); + * return ''; + * } + */ + + function requireSingleResult($sql, $dieOnError=false,$msg='', $encode=true) + { + $result = $this->query($sql, $dieOnError, $msg); + + if($this->getRowCount($result ) == 1) + return $result; + $this->log->error('Rows Returned:'. $this->getRowCount($result) .' More than 1 row returned for '. $sql); + return ''; + } + + +/* ADODB converted + * function fetchByAssoc(&$result, $rowNum = -1, $encode=true) + * { + * if(isset($result) && $rowNum < 0) + * { + * if($this->dbType == "mysql"){ + * $row = mysql_fetch_assoc($result); + * + * if($encode&& is_array($row)) + * return array_map('to_html', $row); + * return $row; + * } + * $row = $result->fetchRow(DB_FETCHMODE_ASSOC); + * } + * if($this->dbType == "mysql"){ + * if($this->getRowCount($result) > $rowNum){ + * mysql_data_seek($result, $rowNum); + * } + * $this->lastmysqlrow = $rowNum; + * + * $row = mysql_fetch_assoc($result); + * + * if($encode&& is_array($row)) + * return array_map('to_html', $row); + * return $row; + * } + * $row = $result->fetchRow(DB_FETCHMODE_ASSOC, $rowNum); + * if($encode) + * return array_map('to_html', $row); + * return $row; + * } + */ + + function fetchByAssoc(&$result, $rowNum = -1, $encode=true) + { + //$this->println("ADODB fetchByAssoc ".$rowNum." fetch mode=".$adb->database->$ADODB_FETCH_MODE); + if($result->EOF) + { + $this->println("ADODB fetchByAssoc return null"); + return NULL; + } + if(isset($result) && $rowNum < 0) + { + $row = $this->change_key_case($result->GetRowAssoc(false)); + $result->MoveNext(); + //print_r($row); + //$this->println("ADODB fetchByAssoc r< 0 isarray r=".is_array($row)." r1=".is_array($row[1])); + //$this->println($row); + if($encode&& is_array($row)) + return array_map('to_html', $row); + //$this->println("ADODB fetchByAssoc r< 0 not array r1=".$row[1]); + return $row; + } + + //$this->println("ADODB fetchByAssoc after if ".$rowNum); - function setUserName($name){ - $this->userName = $name; - } + if($this->getRowCount($result) > $rowNum) + { + $result->Move($rowNum); + } + + $this->lastmysqlrow = $rowNum; //srini - think about this + $row = $this->change_key_case($result->GetRowAssoc(false)); + $result->MoveNext(); + //print_r($row); + $this->println($row); + + if($encode&& is_array($row)) + return array_map('to_html', $row); + return $row; + } + +/* ADODB converted + * function getNextRow(&$result, $encode=true) + * { + * if(isset($result)){ + * $row = $result->fetchRow(); + * if($encode&& is_array($row)) + * return array_map('to_html', $row); + * return $row; + * } + * return null; + * } + */ + + function getNextRow(&$result, $encode=true){ + global $log; + + //$this->println("ADODB getNextRow"); + $log->info('getNextRow'); + if(isset($result)){ + $row = $this->change_key_case($result->FetchRow()); + if($row && $encode&& is_array($row)) + return array_map('to_html', $row); + return $row; + } + return null; + } + + function fetch_row(&$result, $encode=true) + { + return $this->getNextRow($result); + } + + function field_name(&$result, $col) + { + return $result->FetchField($col); + } + + function getQueryTime(){ + return $this->query_time; + } + +/* + * function execute($stmt, $data, $dieOnError=false, $msg=''){ + * $this->log->info('Executing:'.$stmt); + * $this->checkConnection(); + * $this->query_time = microtime(); + * $prepared = $this->database->prepare($stmt); + * $result = execute($stmt, $data); + * $this->query_time = microtime() - $this->query_time; + * //$this->log->info('Query Execution Time:'.$this->query_time); + * $this->checkError('Execute Failed:' . $stmt. '::', $dieOnError); + * return $result; + * } + */ + + +/* adodb converted + * function connect($dieOnError = false){ + * $this->println("connect"); + * global $dbconfigoption; + * if($this->dbType == "mysql" && $dbconfigoption['persistent'] == true){ + * $this->database =@mysql_pconnect($this->dbHostName,$this->userName,$this->userPassword); + * @mysql_select_db($this->dbName) or die( "Unable to select database"); + * if(!$this->database){ + * $this->connection = mysql_connect($this->dbHostName,$this->userName,$this->userPassword) or die("Could not connect to server ".$this->dbHostName." as ".$this->userName.".".mysql_error()); + * if($this->connection == false && $dbconfigoption['persistent'] == true){ + * $_SESSION['administrator_error'] = "Severe Performance Degradation: Persistent Database Connections not working. Please set \$dbconfigoption['persistent'] to false in your config.php file"; + * } + * } + * } + * else $this->database = DB::connect($this->getDataSourceName(), $this->dbOptions); + * if($this->checkError('Could Not Connect:', $dieOnError)) + * $this->log->info("connected to db"); + * + * } + */ + + function connect($dieOnError = false) + { + //$this->println("ADODB connect"); + global $dbconfigoption,$dbconfig; + //$this->println("ADODB type=".$this->dbType." host=".$this->dbHostName." dbname=".$this->dbName." user=".$this->userName." password=".$this->userPassword); + +/* + * $driver='mysql'; + * $server='srinivasan'; + * $user='root'; + * $password=''; + * $database='vtigercrm3_2'; + * + * $this->database = ADONewConnection($driver); + * + * #$this->database->debug = true; + * $this->println("ADODB status=".$this->database->PConnect($server, $user, $password, $database)); + */ + +/* + * $this->dbHostName="srinivasan:1521"; + * $this->userName="vt4"; + * $this->userPassword="vt4"; + * $this->dbName="srini"; + * $this->dbType="oci8"; + */ - function setOption($name, $value){ - if(isset($this->dbOptions)) - $this->dbOptions[$name] = $value; - if(isset($this->database)) - $this->database->setOption($name, $value); - } + if(!isset($this->dbType)) + { + $this->println("ADODB Connect : DBType not specified"); + return; + } - function setUserPassword($pass){ - $this->userPassword = $pass; - } + $this->database = ADONewConnection($this->dbType); + //$this->database->debug = true; - function setDatabaseName($db){ - $this->dbName = $db; - } - - function setDatabaseHost($host){ - $this->dbHostName = $host; - } - - function getDataSourceName(){ - return $this->dbType. "://".$this->userName.":".$this->userPassword."@". $this->dbHostName . "/". $this->dbName; - } - - function startTransaction() - { - //$this->println("TRANS Started"); - $this->checkConnection(); - $this->database->StartTrans(); - } - - function completeTransaction() - { - if($this->database->HasFailedTrans()) - $this->println("TRANS Rolled Back"); - else - $this->println("TRANS Commited"); - - $this->database->CompleteTrans(); - $this->println("TRANS Completed"); - } - - /* ADODB converted - function checkError($msg='', $dieOnError=false){ - if($this->dbType == "mysql"){ - if (mysql_errno()){ - if($this->dieOnError || $dieOnError){ - $this->log->fatal("MySQL error ".mysql_errno().": ".mysql_error()); - die ($msg."MySQL error ".mysql_errno().": ".mysql_error()); - - }else{ - $this->log->error("MySQL error ".mysql_errno().": ".mysql_error()); - } - return true; - } - return false; - } - else{ - if(!isset($this->database)){ - $this->log->error("Database Is Not Connected"); - return true; - } - if(DB::isError($this->database)){ - - if($this->dieOnError || $dieOnError){ - $this->log->fatal($msg.$this->database->getMessage()); - die ($msg.$this->database->getMessage()); - }else{ - $this->log->error($msg.$this->database->getMessage()); - } - return true; - } - }return false; - - } - */ - - function checkError($msg='', $dieOnError=false) - { - /*if($this->database->ErrorNo()) - { - if($this->dieOnError || $dieOnError) - { - $this->println("ADODB error ".$this->database->ErrorNo()); - die ($msg."ADODB error ".$this->database->ErrorNo()); - - }else{ - $this->log->error("MySQL error ".mysql_errno().": ".mysql_error()); - } - return true; - }*/ - - if($this->dieOnError || $dieOnError) - { - $this->println("ADODB error ".$msg."->[".$this->database->ErrorNo()."]".$this->database->ErrorMsg()); - die ($msg."ADODB error ".$msg."->".$this->database->ErrorMsg()); - } - else - { - $this->println("ADODB error ".$msg."->[".$this->database->ErrorNo()."]".$this->database->ErrorMsg()); - - } - return false; - } - - function change_key_case($arr) - { - return is_array($arr)?array_change_key_case($arr):$arr; - } - - var $req_flist; - - - /** - * @return void - * @desc checks if a connection exists if it does not it closes the connection - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function checkConnection(){ -global $log; - if(!isset($this->database)) - { - $this->println("TRANS creating new connection"); - /*$flist=get_included_files(); - foreach($flist as $key=>$value) - { - if(!strstr($value,'\\modules') && !strstr($value,'\\data')) - unset($flist[$key]); - - } - $this->println($flist);*/ - $this->connect(false); - } - else - { - // $this->println("checkconnect using old connection"); - /*** Delibrately commented as per Richie's advice(printed frequently)***/ - // $log->debug('checkconnect using old connection'); - } - } - - /* ADODB converted - function query($sql, $dieOnError=false, $msg=''){ - $this->println("query ".$sql); - $this->log->info('Query:' . $sql); - $this->checkConnection(); - $this->query_time = microtime(); - if($this->dbType == "mysql"){ - $result =& mysql_query($sql); - $this->lastmysqlrow = -1; - }else{ - $result =& $this->database->query($sql); - } - $this->query_time = microtime() - $this->query_time; - $this->log->info('Query Execution Time:'.$this->query_time); - $this->checkError($msg.' Query Failed:' . $sql . '::', $dieOnError); - return $result; - } - */ - - function query($sql, $dieOnError=false, $msg='') - { - global $log; - //$this->println("ADODB query ".$sql); - $log->debug('query being executed : '.$sql); - $this->checkConnection(); - $result = & $this->database->Execute($sql); - $this->lastmysqlrow = -1; - if(!$result)$this->checkError($msg.' Query Failed:' . $sql . '::', $dieOnError); - return $result; - } - - - function getEmptyBlob() - { - //if(dbType=="oci8") return 'empty_blob()'; - //else return 'null'; - return 'null'; - } - - function updateBlob($tablename, $colname, $id, $data) - { - $this->println("updateBlob t=".$tablename." c=".$colname." id=".$id); - $this->checkConnection(); - $result = $this->database->UpdateBlob($tablename, $colname, $data, $id); - $this->println("updateBlob t=".$tablename." c=".$colname." id=".$id." status=".$result); - return $result; - } - - function updateBlobFile($tablename, $colname, $id, $filename) - { - $this->println("updateBlobFile t=".$tablename." c=".$colname." id=".$id." f=".$filename); - $this->checkConnection(); - $result = $this->database->UpdateBlobFile($tablename, $colname, $filename, $id); - $this->println("updateBlobFile t=".$tablename." c=".$colname." id=".$id." f=".$filename." status=".$result); - return $result; - } - - /* ADODB converted - function limitQuery($sql,$start,$count, $dieOnError=false, $msg=''){ - if($this->dbType == "mysql") - return $this->query("$sql LIMIT $start,$count", $dieOnError, $msg); - $this->log->info('Limit Query:' . $sql. ' Start: ' .$start . ' count: ' . $count); - $this->lastsql = $sql; - - $this->checkConnection(); - $this->query_time = microtime(); - $result =& $this->database->limitQuery($sql,$start, $count); - $this->query_time = microtime() - $this->query_time; - $this->log->info('Query Execution Time:'.$this->query_time); - $this->checkError($msg.' Query Failed:' . $sql . '::', $dieOnError); - return $result; - } - */ - - function limitQuery($sql,$start,$count, $dieOnError=false, $msg='') - { - global $log; - //$this->println("ADODB limitQuery sql=".$sql." st=".$start." co=".$count); - $log->debug(' limitQuery sql = '.$sql .' st = '.$start .' co = '.$count); - $this->checkConnection(); - $result =& $this->database->SelectLimit($sql,$count,$start); - if(!$result) $this->checkError($msg.' Limit Query Failed:' . $sql . '::', $dieOnError); - return $result; - } - - /* ADODB converted - function getOne($sql, $dieOnError=false, $msg=''){ - $this->log->info('Get One:' . $sql); - $this->checkConnection(); - if($this->dbType == "mysql"){ - $queryresult =& $this->query($sql, $dieOnError, $msg); - $result =& mysql_result($queryresult,0); - }else{ - $result =& $this->database->getOne($sql); - } - $this->checkError($msg.' Get One Failed:' . $sql . '::', $dieOnError); - return $result; - } - */ - - function getOne($sql, $dieOnError=false, $msg='') - { - $this->println("ADODB getOne sql=".$sql); - $this->checkConnection(); - $result =& $this->database->GetOne($sql); - if(!$result) $this->checkError($msg.' Get one Query Failed:' . $sql . '::', $dieOnError); - return $result; - } - - /* ADODB converted - function getFieldsArray(&$result) - { - $field_array = array(); - - if(! isset($result) || empty($result)) - { - return 0; - } - - if($this->dbType == "mysql") - { - $i = 0; - while ($i < mysql_num_fields($result)) - { - $meta = mysql_fetch_field($result, $i); - - if (!$meta) - { - return 0; - } - - array_push($field_array,$meta->name); - - $i++; - } - } - else - { - $arr = tableInfo($result); - foreach ($arr as $index=>$subarr) - { - array_push($field_array,$subarr['name']); - } - - } - - return $field_array; - - } - */ - - function getFieldsArray(&$result) - { - //$this->println("ADODB getFieldsArray"); - $field_array = array(); - if(! isset($result) || empty($result)) - { - return 0; - } - - $i = 0; - $n = $result->FieldCount(); - while ($i < $n) - { - $meta = $result->FetchField($i); - if (!$meta) - { - return 0; - } - array_push($field_array,$meta->name); - $i++; - } - - //$this->println($field_array); - return $field_array; - } - - /* ADODB Converted - function getRowCount(&$result){ - if(isset($result) && !empty($result)) - if($this->dbType == "mysql"){ - return mysql_numrows($result); - }else{ - return $result->numRows(); - } - return 0; - - } - */ - - function getRowCount(&$result){ - global $log; - //$this->println("ADODB getRowCount"); - if(isset($result) && !empty($result)) - $rows= $result->RecordCount(); - //$this->println("ADODB getRowCount rows=".$rows); - //$log->debug('getRowCount rows= '.$rows); - return $rows; - } - - /* ADODB newly added. replacement for mysql_num_rows */ - - function num_rows(&$result) - { - return $this->getRowCount($result); - } - - /* ADODB newly added. replacement form mysql_num_fields */ - - function num_fields(&$result) - { - return $result->FieldCount(); - } - - /* ADODB newly added. replacement for mysql_fetch_array() */ - - function fetch_array(&$result) - { - if($result->EOF) - { - //$this->println("ADODB fetch_array return null"); - return NULL; - } - return $this->change_key_case($result->FetchRow()); - } - - /* ADODB newly added. replacement for mysql_result() */ - - function query_result(&$result, $row, $col=0) - { - //$this->println("ADODB query_result r=".$row." c=".$col); - $result->Move($row); - $rowdata = $this->change_key_case($result->FetchRow()); - //$this->println($rowdata); - $coldata = strip_selected_tags($rowdata[$col],'script'); - //$this->println("ADODB query_result ". $coldata); - return $coldata; - } - - - /* ADODB Converted - function getAffectedRowCount(&$result){ - if($this->dbType == "mysql"){ - return mysql_affected_rows(); - } - else { - return $result->affectedRows(); - } - return 0; - - }*/ - - function getAffectedRowCount(&$result){ - global $log; -// $this->println("ADODB getAffectedRowCount"); - $log->debug('getAffectedRowCount'); - $rows =$this->database->Affected_Rows(); - // $this->println("ADODB getAffectedRowCount rows=".rows); - $log->debug('getAffectedRowCount rows = '.$rows); - return $rows; - } - - - - /* ADODB converted - function requireSingleResult($sql, $dieOnError=false,$msg='', $encode=true){ - $result = $this->query($sql, $dieOnError, $msg); - - if($this->getRowCount($result ) == 1) - return to_html($result, $encode); - $this->log->error('Rows Returned:'. $this->getRowCount($result) .' More than 1 row returned for '. $sql); - return ''; - }*/ - - function requireSingleResult($sql, $dieOnError=false,$msg='', $encode=true){ - $result = $this->query($sql, $dieOnError, $msg); - - /*$row = $this->change_key_case($result->GetRowAssoc(false)); - $this->println("rsr "); - $this->println($row);*/ - if($this->getRowCount($result ) == 1) - //return to_html($result, $encode); // srini - just think $result compatability - return $result; - $this->log->error('Rows Returned:'. $this->getRowCount($result) .' More than 1 row returned for '. $sql); - return ''; - } - - - /* ADODB converted - function fetchByAssoc(&$result, $rowNum = -1, $encode=true){ - if(isset($result) && $rowNum < 0){ - if($this->dbType == "mysql"){ - $row = mysql_fetch_assoc($result); - - if($encode&& is_array($row))return array_map('to_html', $row); - return $row; - } - $row = $result->fetchRow(DB_FETCHMODE_ASSOC); - } - if($this->dbType == "mysql"){ - if($this->getRowCount($result) > $rowNum){ - - mysql_data_seek($result, $rowNum); - } - $this->lastmysqlrow = $rowNum; - - $row = mysql_fetch_assoc($result); - - if($encode&& is_array($row))return array_map('to_html', $row); - return $row; - - } - $row = $result->fetchRow(DB_FETCHMODE_ASSOC, $rowNum); - if($encode)return array_map('to_html', $row); - return $row; - } - */ - - function fetchByAssoc(&$result, $rowNum = -1, $encode=true){ - //$this->println("ADODB fetchByAssoc ".$rowNum." fetch mode=".$adb->database->$ADODB_FETCH_MODE); - if($result->EOF) - { - $this->println("ADODB fetchByAssoc return null"); - return NULL; - } - if(isset($result) && $rowNum < 0) - { - $row = $this->change_key_case($result->GetRowAssoc(false)); - $result->MoveNext(); - //print_r($row); - //$this->println("ADODB fetchByAssoc r< 0 isarray r=".is_array($row)." r1=".is_array($row[1])); - //$this->println($row); - if($encode&& is_array($row)) - return array_map('to_html', $row); - //$this->println("ADODB fetchByAssoc r< 0 not array r1=".$row[1]); - return $row; - } - - //$this->println("ADODB fetchByAssoc after if ".$rowNum); - - if($this->getRowCount($result) > $rowNum) - { - $result->Move($rowNum); - } - - $this->lastmysqlrow = $rowNum; //srini - think about this - $row = $this->change_key_case($result->GetRowAssoc(false)); - $result->MoveNext(); - //print_r($row); - $this->println($row); - - if($encode&& is_array($row))return array_map('to_html', $row); - return $row; - } - - /* ADODB converted - function getNextRow(&$result, $encode=true){ - if(isset($result)){ - $row = $result->fetchRow(); - if($encode&& is_array($row))return array_map('to_html', $row); - return $row; - - } - return null; - } - */ - - function getNextRow(&$result, $encode=true){ - global $log; - - //$this->println("ADODB getNextRow"); - $log->info('getNextRow'); - if(isset($result)){ - $row = $this->change_key_case($result->FetchRow()); - if($row && $encode&& is_array($row))return array_map('to_html', $row); - return $row; - - } - return null; - } - - function fetch_row(&$result, $encode=true) - { - return $this->getNextRow($result); - } - - function field_name(&$result, $col) - { - return $result->FetchField($col); - } - - function getQueryTime(){ - return $this->query_time; - } - /*function execute($stmt, $data, $dieOnError=false, $msg=''){ - $this->log->info('Executing:'.$stmt); - $this->checkConnection(); - $this->query_time = microtime(); - $prepared = $this->database->prepare($stmt); - $result = execute($stmt, $data); - $this->query_time = microtime() - $this->query_time; - //$this->log->info('Query Execution Time:'.$this->query_time); - $this->checkError('Execute Failed:' . $stmt. '::', $dieOnError); - return $result; - }*/ - - - /* adodb converted - function connect($dieOnError = false){ - $this->println("connect"); - global $dbconfigoption; - if($this->dbType == "mysql" && $dbconfigoption['persistent'] == true){ - $this->database =@mysql_pconnect($this->dbHostName,$this->userName,$this->userPassword); - @mysql_select_db($this->dbName) or die( "Unable to select database"); - if(!$this->database){ - $this->connection = mysql_connect($this->dbHostName,$this->userName,$this->userPassword) or die("Could not connect to server ".$this->dbHostName." as ".$this->userName.".".mysql_error()); - if($this->connection == false && $dbconfigoption['persistent'] == true){ - $_SESSION['administrator_error'] = "Severe Performance Degradation: Persistent Database Connections not working. Please set \$dbconfigoption['persistent'] to false in your config.php file"; - } - } - } - else $this->database = DB::connect($this->getDataSourceName(), $this->dbOptions); - if($this->checkError('Could Not Connect:', $dieOnError)) - $this->log->info("connected to db"); - - }*/ - - function connect($dieOnError = false) - { - //$this->println("ADODB connect"); - global $dbconfigoption,$dbconfig; - //$this->println("ADODB type=".$this->dbType." host=".$this->dbHostName." dbname=".$this->dbName." user=".$this->userName." password=".$this->userPassword); - - /*$driver='mysql'; - $server='srinivasan'; - $user='root'; - $password=''; - $database='vtigercrm3_2'; - - $this->database = ADONewConnection($driver); - - #$this->database->debug = true; - $this->println("ADODB status=".$this->database->PConnect($server, $user, $password, $database));*/ - - /*$this->dbHostName="srinivasan:1521"; - $this->userName="vt4"; - $this->userPassword="vt4"; - $this->dbName="srini"; - $this->dbType="oci8";*/ - - if(!isset($this->dbType)) - { - $this->println("ADODB Connect : DBType not specified"); - return; - } - - $this->database = ADONewConnection($this->dbType); - //$this->database->debug = true; - - $this->database->PConnect($this->dbHostName, $this->userName, $this->userPassword, $this->dbName); - $this->database->LogSQL($this->enableSQLlog); - //$this->database->SetFetchMode(ADODB_FETCH_ASSOC); - //$this->println("ADODB type=".$this->dbType." host=".$this->dbHostName." dbname=".$this->dbName." user=".$this->userName." password=".$this->userPassword); - - } + $this->database->PConnect($this->dbHostName, $this->userName, $this->userPassword, $this->dbName); + $this->database->LogSQL($this->enableSQLlog); + //$this->database->SetFetchMode(ADODB_FETCH_ASSOC); + //$this->println("ADODB type=".$this->dbType." host=".$this->dbHostName." dbname=".$this->dbName." user=".$this->userName." password=".$this->userPassword); + } + /* - function PearDatabase(){ - //$this->println("PearDatabase"); - global $currentModule; - $this->log =& LoggerManager::getLogger('PearDatabase_'. $currentModule); - $this->resetSettings(); - - - } - function resetSettings(){ - global $dbconfig, $dbconfigoption; - $this->disconnect(); - $this->setDatabaseType($dbconfig['db_type']); - $this->setUserName($dbconfig['db_username']); - $this->setUserPassword($dbconfig['db_password']); - $this->setDatabaseHost( $dbconfig['db_hostname']); - $this->setDatabaseName($dbconfig['db_name']); - $this->dbOptions = $dbconfigoption; - $this->enableSQLlog = ($dbconfig['log_sql'] == true); - //$this->println("resetSettings log=".$this->enableSQLlog); - //$this->println($dbconfig); - /*if($this->dbType != "mysql"){ - require_once( 'DB.php' ); - }*/ - - - - function PearDatabase($dbtype='',$host='',$dbname='',$username='',$passwd=''){ - //$this->println("PearDatabase"); - global $currentModule; - $this->log =& LoggerManager::getLogger('PearDatabase_'. $currentModule); - $this->resetSettings($dbtype,$host,$dbname,$username,$passwd); - - - } - - + * function PearDatabase(){ + * //$this->println("PearDatabase"); + * global $currentModule; + * $this->log =& LoggerManager::getLogger('PearDatabase_'. $currentModule); + * $this->resetSettings(); + * } + * + * function resetSettings(){ + * global $dbconfig, $dbconfigoption; + * $this->disconnect(); + * $this->setDatabaseType($dbconfig['db_type']); + * $this->setUserName($dbconfig['db_username']); + * $this->setUserPassword($dbconfig['db_password']); + * $this->setDatabaseHost( $dbconfig['db_hostname']); + * $this->setDatabaseName($dbconfig['db_name']); + * $this->dbOptions = $dbconfigoption; + * $this->enableSQLlog = ($dbconfig['log_sql'] == true); + * //$this->println("resetSettings log=".$this->enableSQLlog); + * //$this->println($dbconfig); + * //if($this->dbType != "mysql"){ + * // require_once( 'DB.php' ); + * //} + * } + */ + + function PearDatabase($dbtype='',$host='',$dbname='',$username='',$passwd='') + { + //$this->println("PearDatabase"); + global $currentModule; + $this->log =& LoggerManager::getLogger('PearDatabase_'. $currentModule); + $this->resetSettings($dbtype,$host,$dbname,$username,$passwd); + } + function resetSettings($dbtype,$host,$dbname,$username,$passwd) { - - global $dbconfig, $dbconfigoption; - - if($host == '') - { - $this->disconnect(); - $this->setDatabaseType($dbconfig['db_type']); - $this->setUserName($dbconfig['db_username']); - $this->setUserPassword($dbconfig['db_password']); - $this->setDatabaseHost( $dbconfig['db_hostname']); - $this->setDatabaseName($dbconfig['db_name']); - $this->dbOptions = $dbconfigoption; + global $dbconfig, $dbconfigoption; + + if($host == '') + { + $this->disconnect(); + $this->setDatabaseType($dbconfig['db_type']); + $this->setUserName($dbconfig['db_username']); + $this->setUserPassword($dbconfig['db_password']); + $this->setDatabaseHost( $dbconfig['db_hostname']); + $this->setDatabaseName($dbconfig['db_name']); + $this->dbOptions = $dbconfigoption; if($dbconfig['log_sql']) - $this->enableSQLlog = ($dbconfig['log_sql'] == true); - //$this->println("resetSettings log=".$this->enableSQLlog); - //$this->println($dbconfig); - /*if($this->dbType != "mysql"){ - require_once( 'DB.php' ); - }*/ - } - else - { - - $this->disconnect(); - $this->setDatabaseType($dbtype); - $this->setDatabaseName($dbname); - $this->setUserName($username); - $this->setUserPassword($passwd); - $this->setDatabaseHost( $host); - - } -} - -function quote($string){ + $this->enableSQLlog = ($dbconfig['log_sql'] == true); + //$this->println("resetSettings log=".$this->enableSQLlog); + //$this->println($dbconfig); + /*if($this->dbType != "mysql"){ + require_once( 'DB.php' ); + }*/ + } + else + { + $this->disconnect(); + $this->setDatabaseType($dbtype); + $this->setDatabaseName($dbname); + $this->setUserName($username); + $this->setUserPassword($passwd); + $this->setDatabaseHost( $host); + } + } + + function quote($string){ return $this->database->qstr($string); -} + } /* ADODB converted -function disconnect() { - $this->println("disconnect"); - if(isset($this->database)){ - if($this->dbType == "mysql"){ - mysql_close($this->database); - }else{ - $this->database->disconnect(); - } - unset($this->database); - } - -} -*/ - -function disconnect() { - //$this->println("ADODB disconnect"); - - // srini -- do something - -} - -function setDebug($value) -{ + * function disconnect() { + * $this->println("disconnect"); + * if(isset($this->database)){ + * if($this->dbType == "mysql"){ + * mysql_close($this->database); + * } else { + * $this->database->disconnect(); + * } + * unset($this->database); + * } + * } + */ + + function disconnect() { + $this->println("ADODB disconnect"); + if(isset($this->database)){ + if($this->dbType == "mysql"){ + mysql_close($this->database); + } else { + $this->database->disconnect(); + } + unset($this->database); + } + } + + function setDebug($value) + { $this->database->debug = $value; -} - - -// ADODB newly added methods - - -function createTables($schemaFile, $dbHostName=false, $userName=false, $userPassword=false, $dbName=false, $dbType=false) -{ + } + + + // ADODB newly added methods + function createTables($schemaFile, $dbHostName=false, $userName=false, $userPassword=false, $dbName=false, $dbType=false) + { $this->println("ADODB createTables ".$schemaFile); if($dbHostName!=false) $this->dbHostName=$dbHostName; if($userName!=false) $this->userName=$userPassword; @@ -791,7 +800,6 @@ $this->checkConnection(); $db = $this->database; //$db->debug = true; - //$this->println("ADODB createTables connect status=".$db->Connect($this->dbHostName, $this->userName, $this->userPassword, $this->dbName)); $schema = new adoSchema( $db ); @@ -811,10 +819,10 @@ // needs to return in a decent way $this->println("ADODB createTables ".$schemaFile." status=".$result); return $result; -} - -function createTable($tablename, $flds) -{ + } + + function createTable($tablename, $flds) + { $this->println("ADODB createTable table=".$tablename." flds=".$flds); $this->checkConnection(); //$dict = NewDataDictionary(ADONewConnection($this->dbType)); @@ -823,10 +831,10 @@ $result = $dict->ExecuteSQLArray($sqlarray); $this->println("ADODB createTable table=".$tablename." flds=".$flds." status=".$result); return $result; -} - -function alterTable($tablename, $flds, $oper) -{ + } + + function alterTable($tablename, $flds, $oper) + { $this->println("ADODB alterTableTable table=".$tablename." flds=".$flds." oper=".$oper); //$dict = NewDataDictionary(ADONewConnection($this->dbType)); $this->checkConnection(); @@ -835,11 +843,11 @@ if($oper == 'Add_Column') { - $sqlarray = $dict->AddColumnSQL($tablename, $flds); + $sqlarray = $dict->AddColumnSQL($tablename, $flds); } else if($oper == 'Delete_Column') { - $sqlarray = $dict->DropColumnSQL($tablename, $flds); + $sqlarray = $dict->DropColumnSQL($tablename, $flds); } $this->println("sqlarray"); @@ -850,10 +858,10 @@ $this->println("ADODB alterTableTable table=".$tablename." flds=".$flds." oper=".$oper." status=".$result); return $result; -} - -function getColumnNames($tablename) -{ + } + + function getColumnNames($tablename) + { $this->println("ADODB getColumnNames table=".$tablename); $this->checkConnection(); $adoflds = $this->database->MetaColumns($tablename); @@ -861,83 +869,79 @@ $i=0; foreach($adoflds as $fld) { - $colNames[$i] = $fld->name; - $i++; + $colNames[$i] = $fld->name; + $i++; } return $colNames; -} - -function formatString($tablename,$fldname, $str) -{ + } + + function formatString($tablename,$fldname, $str) + { //$this->println("ADODB formatString table=".$tablename." fldname=".$fldname." str=".$str); $this->checkConnection(); $adoflds = $this->database->MetaColumns($tablename); foreach ( $adoflds as $fld ) { - //$this->println("ADODB formatString adofld =".$fld->name); - if(strcasecmp($fld->name,$fldname)==0) + //$this->println("ADODB formatString adofld =".$fld->name); + if(strcasecmp($fld->name,$fldname)==0) + { + //$this->println("ADODB formatString fldname=".$fldname." fldtype =".$fld->type); + + $fldtype =strtoupper($fld->type); + if(strcmp($fldtype,'CHAR')==0 || strcmp($fldtype,'VARCHAR') == 0 || strcmp($fldtype,'VARCHAR2') == 0 || strcmp($fldtype,'LONGTEXT')==0 || strcmp($fldtype,'TEXT')==0) { - //$this->println("ADODB formatString fldname=".$fldname." fldtype =".$fld->type); - - $fldtype =strtoupper($fld->type); - if(strcmp($fldtype,'CHAR')==0 || strcmp($fldtype,'VARCHAR') == 0 || strcmp($fldtype,'VARCHAR2') == 0 || strcmp($fldtype,'LONGTEXT')==0 || strcmp($fldtype,'TEXT')==0) - { - return $this->database->Quote($str); - //$this->println("ADODB return else normal"); - - } - else if(strcmp($fldtype,'DATE') ==0 || strcmp($fldtype,'TIMESTAMP')==0) - { - return $this->formatDate($str); - } - else - { - return $str; - } + //$this->println("ADODB return else normal"); + return $this->database->Quote($str); } + else if(strcmp($fldtype,'DATE') ==0 || strcmp($fldtype,'TIMESTAMP')==0) + { + return $this->formatDate($str); + } + else + { + return $str; + } + } } $this->println("format String Illegal field name ".$fldname); return $str; -} - -function formatDate($datetime) -{ + } + + function formatDate($datetime) + { $this->checkConnection(); //$db = ADONewConnection($this->dbType); $db = &$this->database; $date = $db->DBTimeStamp($datetime); //if($db->dbType=='mysql') return $this->quote($date); return $date; -} - -function getDBDateString($datecolname) -{ + } + + function getDBDateString($datecolname) + { $this->checkConnection(); $db = &$this->database; $datestr = $db->SQLDate("Y-m-d, H:i:s" ,$datecolname); return $datestr; -} - -function getUniqueID($seqname) -{ + } + + function getUniqueID($seqname) + { $this->checkConnection(); return $this->database->GenID($seqname."_seq",1); -} -function get_tables() -{ - $this->checkConnection(); - $result = & $this->database->MetaTables('TABLES'); - $this->println($result); - return $result; -} - - -} + } + function get_tables() + { + $this->checkConnection(); + $result = & $this->database->MetaTables('TABLES'); + $this->println($result); + return $result; + } +} /* End of class */ $adb = new PearDatabase(); $adb->connect(); - //$adb->database->setFetchMode(ADODB_FETCH_NUM); From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 11:44:31 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 18:44:31 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9149 - /vtigercrm/trunk/include/utils/CommonUtils.php Message-ID: <20060828184431.BFD25708216@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 12:44:24 2006 New Revision: 9149 Log: Support for PostGres DB done Modified: vtigercrm/trunk/include/utils/CommonUtils.php Modified: vtigercrm/trunk/include/utils/CommonUtils.php ============================================================================== --- vtigercrm/trunk/include/utils/CommonUtils.php (original) +++ vtigercrm/trunk/include/utils/CommonUtils.php Mon Aug 28 12:44:24 2006 @@ -960,14 +960,17 @@ if($disp_view == "detail_view") { if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0 || $module == "Users") - { - $sql = "select vtiger_field.* from vtiger_field where vtiger_field.tabid=".$tabid." and vtiger_field.block in $blockid_list and vtiger_field.displaytype in (1,2,4) order by block,sequence"; - } - else - { - $profileList = getCurrentUserProfileList(); - $sql = "select vtiger_field.* from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=".$tabid." and vtiger_field.block in ".$blockid_list." and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList." group by vtiger_field.fieldid order by block,sequence"; - } + { + $sql = "SELECT vtiger_field.* FROM vtiger_field WHERE vtiger_field.tabid=".$tabid." AND vtiger_field.block IN $blockid_list AND vtiger_field.displaytype IN (1,2,4) ORDER BY block,sequence"; + } + else + { + $profileList = getCurrentUserProfileList(); + $sql = "SELECT vtiger_field.* FROM vtiger_field INNER JOIN vtiger_profile2field ON vtiger_profile2field.fieldid=vtiger_field.fieldid INNER JOIN vtiger_def_org_field ON vtiger_def_org_field.fieldid=vtiger_field.fieldid WHERE vtiger_field.tabid=".$tabid." AND vtiger_field.block IN ".$blockid_list." AND vtiger_field.displaytype IN (1,2,4) AND vtiger_profile2field.visible=0 AND vtiger_def_org_field.visible=0 AND vtiger_profile2field.profileid IN ".$profileList." GROUP BY vtiger_field.fieldid ORDER BY block,sequence"; + //Postgres 8 fixes + if( $adb->dbType == "pgsql") + $sql = fixPostgresQuery( $sql, $log, 0); + } $result = $adb->query($sql); $getBlockInfo=getDetailBlockInformation($module,$result,$col_fields,$tabid,$block_label); } @@ -976,26 +979,32 @@ if ($info_type != '') { if($is_admin==true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2]== 0 || $module == 'Users') - { - $sql = "select vtiger_field.* from vtiger_field where vtiger_field.tabid=".$tabid." and vtiger_field.block in ".$blockid_list ." and ".$display_type_check." and info_type = '".$info_type."' order by block,sequence"; - } - else - { - $profileList = getCurrentUserProfileList(); - $sql = "select vtiger_field.* from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=".$tabid." and vtiger_field.block in ".$blockid_list." and ".$display_type_check." and info_type = '".$info_type."' and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList.=" group by vtiger_field.fieldid order by block,sequence"; - } + { + $sql = "SELECT vtiger_field.* FROM vtiger_field WHERE vtiger_field.tabid=".$tabid." AND vtiger_field.block IN ".$blockid_list ." AND ".$display_type_check." AND info_type = '".$info_type."' ORDER BY block,sequence"; + } + else + { + $profileList = getCurrentUserProfileList(); + $sql = "SELECT vtiger_field.* FROM vtiger_field INNER JOIN vtiger_profile2field ON vtiger_profile2field.fieldid=vtiger_field.fieldid INNER JOIN vtiger_def_org_field ON vtiger_def_org_field.fieldid=vtiger_field.fieldid WHERE vtiger_field.tabid=".$tabid." AND vtiger_field.block IN ".$blockid_list." AND ".$display_type_check." AND info_type = '".$info_type."' AND vtiger_profile2field.visible=0 AND vtiger_def_org_field.visible=0 AND vtiger_profile2field.profileid IN ".$profileList.=" GROUP BY vtiger_field.fieldid ORDER BY block,sequence"; + //Postgres 8 fixes + if( $adb->dbType == "pgsql") + $sql = fixPostgresQuery( $sql, $log, 0); + } } else { - if($is_admin==true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0 || $module == 'Users') - { - $sql = "select vtiger_field.* from vtiger_field where vtiger_field.tabid=".$tabid." and vtiger_field.block in ".$blockid_list." and ".$display_type_check." order by block,sequence"; - } - else - { - $profileList = getCurrentUserProfileList(); - $sql = "select vtiger_field.* from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=".$tabid." and vtiger_field.block in ".$blockid_list." and ".$display_type_check." and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList.=" group by vtiger_field.fieldid order by block,sequence"; - } + if($is_admin==true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0 || $module == 'Users') + { + $sql = "SELECT vtiger_field.* FROM vtiger_field WHERE vtiger_field.tabid=".$tabid." AND vtiger_field.block IN ".$blockid_list." AND ".$display_type_check." ORDER BY block,sequence"; + } + else + { + $profileList = getCurrentUserProfileList(); + $sql = "SELECT vtiger_field.* FROM vtiger_field INNER JOIN vtiger_profile2field ON vtiger_profile2field.fieldid=vtiger_field.fieldid INNER JOIN vtiger_def_org_field ON vtiger_def_org_field.fieldid=vtiger_field.fieldid WHERE vtiger_field.tabid=".$tabid." AND vtiger_field.block IN ".$blockid_list." AND ".$display_type_check." AND vtiger_profile2field.visible=0 AND vtiger_def_org_field.visible=0 AND vtiger_profile2field.profileid IN ".$profileList.=" GROUP BY vtiger_field.fieldid ORDER BY block,sequence"; + //Postgres 8 fixes + if( $adb->dbType == "pgsql") + $sql = fixPostgresQuery( $sql, $log, 0); + } } $result = $adb->query($sql); $getBlockInfo=getBlockInformation($module,$result,$col_fields,$tabid,$block_label,$mode); @@ -1790,8 +1799,11 @@ } else { - $profileList = getCurrentUserProfileList(); - $quickcreate_query = "select vtiger_field.* from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=".$tabid." and quickcreate=0 and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList." order by quickcreatesequence"; + $profileList = getCurrentUserProfileList(); + $quickcreate_query = "SELECT vtiger_field.* FROM vtiger_field INNER JOIN vtiger_profile2field ON vtiger_profile2field.fieldid=vtiger_field.fieldid INNER JOIN vtiger_def_org_field ON vtiger_def_org_field.fieldid=vtiger_field.fieldid WHERE vtiger_field.tabid=".$tabid." AND quickcreate=0 AND vtiger_profile2field.visible=0 AND vtiger_def_org_field.visible=0 AND vtiger_profile2field.profileid IN ".$profileList." ORDER BY quickcreatesequence"; + //Postgres 8 fixes + if( $adb->dbType == "pgsql") + $quickcreate_query = fixPostgresQuery( $quickcreate_query, $log, 0); } $category = getParentTab(); From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 11:52:05 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 18:52:05 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9150 - /vtigercrm/trunk/include/utils/EditViewUtils.php Message-ID: <20060828185205.9E31D708226@vtiger.fosslabs.com> 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$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$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'] != '') From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 11:53:06 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 18:53:06 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9151 - /vtigercrm/trunk/include/utils/SearchUtils.php Message-ID: <20060828185306.1F72C70822F@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 12:52:59 2006 New Revision: 9151 Log: Support for PostGres DB done Modified: vtigercrm/trunk/include/utils/SearchUtils.php Modified: vtigercrm/trunk/include/utils/SearchUtils.php ============================================================================== --- vtigercrm/trunk/include/utils/SearchUtils.php (original) +++ vtigercrm/trunk/include/utils/SearchUtils.php Mon Aug 28 12:52:59 2006 @@ -12,6 +12,7 @@ require_once('include/database/PearDatabase.php'); +require_once('include/database/Postgres8.php'); require_once('include/ComboUtil.php'); //new require_once('include/utils/CommonUtils.php'); //new @@ -82,7 +83,9 @@ { $profileList = getCurrentUserProfileList(); //changed to get vtiger_field.fieldname - $query = "select vtiger_profile2field.*,vtiger_field.fieldname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=".$tabid." and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList." and vtiger_field.fieldname in ".$field_list." group by vtiger_field.fieldid"; + $query = "SELECT vtiger_profile2field.*,vtiger_field.fieldname FROM vtiger_field INNER JOIN vtiger_profile2field ON vtiger_profile2field.fieldid=vtiger_field.fieldid INNER JOIN vtiger_def_org_field ON vtiger_def_org_field.fieldid=vtiger_field.fieldid WHERE vtiger_field.tabid=".$tabid." AND vtiger_profile2field.visible=0 AND vtiger_def_org_field.visible=0 AND vtiger_profile2field.profileid IN ".$profileList." AND vtiger_field.fieldname IN ".$field_list." GROUP BY vtiger_field.fieldid"; + if( $adb->dbType == "pgsql") + $query = fixPostgresQuery( $query, $log, 0); $result = $adb->query($query); $field=Array(); for($k=0;$k < $adb->num_rows($result);$k++) From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 11:54:26 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 18:54:26 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9152 - /vtigercrm/trunk/include/utils/UserInfoUtil.php Message-ID: <20060828185426.E4F2F70823A@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 12:54:19 2006 New Revision: 9152 Log: Support for PostGres DB done Modified: vtigercrm/trunk/include/utils/UserInfoUtil.php Modified: vtigercrm/trunk/include/utils/UserInfoUtil.php ============================================================================== --- vtigercrm/trunk/include/utils/UserInfoUtil.php (original) +++ vtigercrm/trunk/include/utils/UserInfoUtil.php Mon Aug 28 12:54:19 2006 @@ -12,6 +12,7 @@ require_once('include/database/PearDatabase.php'); +require_once('include/database/Postgres8.php'); require_once('include/utils/utils.php'); require_once('include/utils/GetUserGroups.php'); include('config.php'); @@ -4580,7 +4581,14 @@ //get tabid $tabid = getTabid($fld_module); - $query="select vtiger_profile2field.* from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=".$tabid." and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in".$profilelist." and vtiger_field.fieldname='".$fieldname."' group by vtiger_field.fieldid"; + + $query="SELECT vtiger_profile2field.* FROM vtiger_field INNER JOIN vtiger_profile2field ON vtiger_profile2field.fieldid=vtiger_field.fieldid INNER JOIN vtiger_def_org_field ON vtiger_def_org_field.fieldid=vtiger_field.fieldid WHERE vtiger_field.tabid=".$tabid." AND vtiger_profile2field.visible=0 AND vtiger_def_org_field.visible=0 AND vtiger_profile2field.profileid in".$profilelist." AND vtiger_field.fieldname='".$fieldname."' GROUP BY vtiger_field.fieldid"; + + //Postgres 8 fixes + if( $adb->dbType == "pgsql") + $query = fixPostgresQuery( $query, $log, 0); + + $result = $adb->query($query); $log->debug("Exiting getFieldVisibilityPermission method ..."); From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 11:55:47 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 18:55:47 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9153 - /vtigercrm/trunk/include/RelatedListView.php Message-ID: <20060828185547.9AD8D70823B@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 12:55:40 2006 New Revision: 9153 Log: Support for PostGres DB done Modified: vtigercrm/trunk/include/RelatedListView.php Modified: vtigercrm/trunk/include/RelatedListView.php ============================================================================== --- vtigercrm/trunk/include/RelatedListView.php (original) +++ vtigercrm/trunk/include/RelatedListView.php Mon Aug 28 12:55:40 2006 @@ -148,7 +148,7 @@ } //Retreiving the no of rows - $count_query = "select count(*) count ".substr($query, stripos($query,'from'),strlen($query)); + $count_query = "select count(*) as count ".substr($query, stripos($query,'from'),strlen($query)); $count_result = $adb->query(substr($count_query, stripos($count_query,'select'),stripos($count_query,'ORDER BY'))); $noofrows = $adb->query_result($count_result,0,"count"); @@ -174,7 +174,10 @@ else $limit_start_rec = $start_rec -1; - $list_result = $adb->query($query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); + if( $adb->dbType == "pgsql") + $list_result = $adb->query($query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); + else + $list_result = $adb->query($query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); //Retreive the List View Table Header if($noofrows == 0) From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 12:04:54 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:04:54 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9154 - /vtigercrm/trunk/install/5createTables.inc.php Message-ID: <20060828190454.DD4FD70823E@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:04:47 2006 New Revision: 9154 Log: Support for PostGres DB done Modified: vtigercrm/trunk/install/5createTables.inc.php Modified: vtigercrm/trunk/install/5createTables.inc.php ============================================================================== --- vtigercrm/trunk/install/5createTables.inc.php (original) +++ vtigercrm/trunk/install/5createTables.inc.php Mon Aug 28 13:04:47 2006 @@ -160,6 +160,78 @@ //$adb->setDebug(true); $success = $adb->createTables("schema/DatabaseSchema.xml"); +//Postgres8 fix - create sequences. +// This should be a part of "createTables" however ... + if( $adb->dbType == "pgsql" ) { + $sequences = array( + "vtiger_leadsource_seq", + "vtiger_accounttype_seq", + "vtiger_industry_seq", + "vtiger_leadstatus_seq", + "vtiger_rating_seq", + "vtiger_licencekeystatus_seq", + "vtiger_opportunity_type_seq", + "vtiger_salutationtype_seq", + "vtiger_sales_stage_seq", + "vtiger_ticketstatus_seq", + "vtiger_ticketpriorities_seq", + "vtiger_ticketseverities_seq", + "vtiger_ticketcategories_seq", + "vtiger_duration_minutes_seq", + "vtiger_eventstatus_seq", + "vtiger_taskstatus_seq", + "vtiger_taskpriority_seq", + "vtiger_manufacturer_seq", + "vtiger_productcategory_seq", + "vtiger_activitytype_seq", + "vtiger_currency_seq", + "vtiger_faqcategories_seq", + "vtiger_usageunit_seq", + "vtiger_glacct_seq", + "vtiger_quotestage_seq", + "vtiger_carrier_seq", + "vtiger_taxclass_seq", + "vtiger_recurringtype_seq", + "vtiger_faqstatus_seq", + "vtiger_invoicestatus_seq", + "vtiger_postatus_seq", + "vtiger_sostatus_seq", + "vtiger_visibility_seq", + "vtiger_campaigntype_seq", + "vtiger_campaignstatus_seq", + "vtiger_expectedresponse_seq", + "vtiger_status_seq", + "vtiger_activity_view_seq", + "vtiger_lead_view_seq", + "vtiger_date_format_seq", + "vtiger_users_seq", + "vtiger_role_seq", + "vtiger_profile_seq", + "vtiger_field_seq", + "vtiger_def_org_share_seq", + "vtiger_datashare_relatedmodules_seq", + "vtiger_relatedlists_seq", + "vtiger_notificationscheduler_seq", + "vtiger_inventorynotification_seq", + "vtiger_currency_info_seq", + "vtiger_emailtemplates_seq", + "vtiger_inventory_tandc_seq", + "vtiger_selectquery_seq", + "vtiger_customview_seq", + "vtiger_crmentity_seq", + "vtiger_seactivityrel_seq", + "vtiger_freetags_seq", + "vtiger_shippingtaxinfo_seq", + "vtiger_inventorytaxinfo_seq" + ); + + foreach ($sequences as $sequence ) { + $log->info( "Creating sequence ".$sequence); + $adb->query( "CREATE SEQUENCE ".$sequence." INCREMENT BY 1 NO MAXVALUE NO MINVALUE CACHE 1;"); + } + } + + // TODO HTML if($success==0) die("Error: Tables not created. Table creation failed.\n"); From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 12:07:13 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:07:13 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9155 - /vtigercrm/trunk/install/4createConfigFile.php Message-ID: <20060828190713.3C182708242@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:07:06 2006 New Revision: 9155 Log: Support for PostGres DB done Modified: vtigercrm/trunk/install/4createConfigFile.php Modified: vtigercrm/trunk/install/4createConfigFile.php ============================================================================== --- vtigercrm/trunk/install/4createConfigFile.php (original) +++ vtigercrm/trunk/install/4createConfigFile.php Mon Aug 28 13:07:06 2006 @@ -47,7 +47,7 @@ $vtiger_version = "5.0 Beta"; $release_date = "31 March 2006"; - +if (isset($_REQUEST['db_type'])) $db_type = $_REQUEST['db_type']; if (isset($_REQUEST['db_hostname'])) { @@ -58,7 +58,11 @@ else { $db_hostname = $_REQUEST['db_hostname']; - $db_port = '3306'; + if($db_type == "pgsql") + $db_port = '5432'; + else + $db_port = '3306'; + } } if (isset($_REQUEST['db_username']))$db_username = $_REQUEST['db_username']; @@ -67,7 +71,7 @@ if (isset($_REQUEST['db_name']))$db_name = $_REQUEST['db_name']; -if (isset($_REQUEST['db_type'])) $db_type = $_REQUEST['db_type']; +//if (isset($_REQUEST['db_type'])) $db_type = $_REQUEST['db_type']; if (isset($_REQUEST['db_drop_tables'])) $db_drop_tables = $_REQUEST['db_drop_tables']; From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 12:09:27 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:09:27 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9157 - /vtigercrm/trunk/modules/Vendors/ListView.php Message-ID: <20060828190927.371D7708252@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:09:20 2006 New Revision: 9157 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/Vendors/ListView.php Modified: vtigercrm/trunk/modules/Vendors/ListView.php ============================================================================== --- vtigercrm/trunk/modules/Vendors/ListView.php (original) +++ vtigercrm/trunk/modules/Vendors/ListView.php Mon Aug 28 13:09:20 2006 @@ -9,11 +9,13 @@ * ********************************************************************************/ require_once('include/database/PearDatabase.php'); +require_once('include/database/Postgres8.php'); require_once('Smarty_setup.php'); require_once('modules/Vendors/Vendor.php'); require_once('include/ListView/ListView.php'); require_once('include/utils/utils.php'); require_once('modules/CustomView/CustomView.php'); +require_once('include/DatabaseUtil.php'); global $app_strings,$mod_strings,$list_max_entries_per_page,$currentModule,$theme; @@ -117,11 +119,14 @@ $tablename = getTableNameForField('Vendors',$order_by); $tablename = (($tablename != '')?($tablename."."):''); + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY '.$tablename.$order_by; + $list_query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder; } //Retreiving the no of rows -$count_result = $adb->query("select count(*) count ".substr($list_query, strpos($list_query,'FROM'),strlen($list_query))); +$count_result = $adb->query( mkCountQuery( $list_query)); $noofrows = $adb->query_result($count_result,0,"count"); //Storing Listview session object @@ -134,6 +139,10 @@ //Retreive the Navigation array $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); +//Postgres 8 fixes + if( $adb->dbType == "pgsql") + $list_query = fixPostgresQuery( $list_query, $log, 0); + // Setting the record count string //modified by rdhital $start_rec = $navigation_array['start']; @@ -146,7 +155,10 @@ else $limit_start_rec = $start_rec -1; -$list_result = $adb->query($list_query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); +if( $adb->dbType == "pgsql") + $list_result = $adb->query($list_query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); +else + $list_result = $adb->query($list_query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); $record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows; From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 12:10:48 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:10:48 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9158 - /vtigercrm/trunk/modules/Potentials/ListView.php Message-ID: <20060828191048.7990570824F@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:10:41 2006 New Revision: 9158 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/Potentials/ListView.php Modified: vtigercrm/trunk/modules/Potentials/ListView.php ============================================================================== --- vtigercrm/trunk/modules/Potentials/ListView.php (original) +++ vtigercrm/trunk/modules/Potentials/ListView.php Mon Aug 28 13:10:41 2006 @@ -22,6 +22,9 @@ require_once('include/ComboUtil.php'); require_once('include/utils/utils.php'); require_once('modules/CustomView/CustomView.php'); +require_once('include/database/Postgres8.php'); +require_once('include/DatabaseUtil.php'); + global $app_strings,$list_max_entries_per_page; @@ -144,12 +147,17 @@ { if($order_by == 'smownerid') { + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY user_name'; $list_query .= ' ORDER BY user_name '.$sorder; } else { $tablename = getTableNameForField('Potentials',$order_by); $tablename = (($tablename != '')?($tablename."."):''); + + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY '.$tablename.$order_by; $list_query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder; } @@ -170,7 +178,7 @@ //Retreiving the no of rows -$count_result = $adb->query("select count(*) count ".substr($list_query, strpos($list_query,'FROM'),strlen($list_query))); +$count_result = $adb->query( mkCountQuery( $list_query)); $noofrows = $adb->query_result($count_result,0,"count"); //Storing Listview session object @@ -183,6 +191,9 @@ //Retreive the Navigation array $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); +//Postgres 8 fixes +if( $adb->dbType == "pgsql") + $list_query = fixPostgresQuery( $list_query, $log, 0); // Setting the record count string @@ -197,7 +208,10 @@ else $limit_start_rec = $start_rec -1; -$list_result = $adb->query($list_query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); +if( $adb->dbType == "pgsql") + $list_result = $adb->query($list_query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); + else + $list_result = $adb->query($list_query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); $record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows; From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 12:11:33 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:11:33 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9159 - /vtigercrm/trunk/modules/Notes/ListView.php Message-ID: <20060828191134.1353370824F@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:11:27 2006 New Revision: 9159 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/Notes/ListView.php Modified: vtigercrm/trunk/modules/Notes/ListView.php ============================================================================== --- vtigercrm/trunk/modules/Notes/ListView.php (original) +++ vtigercrm/trunk/modules/Notes/ListView.php Mon Aug 28 13:11:27 2006 @@ -29,6 +29,8 @@ require_once('include/utils/utils.php'); require_once('include/utils/utils.php'); require_once('modules/CustomView/CustomView.php'); +require_once('include/database/Postgres8.php'); +require_once('include/DatabaseUtil.php'); global $app_strings,$mod_strings,$list_max_entries_per_page; @@ -146,12 +148,15 @@ $tablename = getTableNameForField('Notes',$order_by); $tablename = (($tablename != '')?($tablename."."):''); + if( $adb->dbType == "pgsql") + $query .= ' GROUP BY '.$tablename.$order_by; + $query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder; } //Retreiving the no of rows -$count_result = $adb->query("select count(*) count ".substr($query, strpos($query,'FROM'),strlen($query))); +$count_result = $adb->query( mkCountQuery( $query)); $noofrows = $adb->query_result($count_result,0,"count"); //Storing Listview session object @@ -164,6 +169,11 @@ //Retreive the Navigation array $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); +//Postgres 8 fixes +if( $adb->dbType == "pgsql") + $query = fixPostgresQuery( $query, $log, 0); + + // Setting the record count string //modified by rdhital @@ -177,7 +187,10 @@ else $limit_start_rec = $start_rec -1; -$list_result = $adb->query($query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); + if( $adb->dbType == "pgsql") + $list_result = $adb->query($query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); + else + $list_result = $adb->query($query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); $record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows; From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 12:12:16 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:12:16 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9160 - /vtigercrm/trunk/modules/Leads/ListView.php Message-ID: <20060828191216.7B49770824F@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:12:09 2006 New Revision: 9160 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/Leads/ListView.php Modified: vtigercrm/trunk/modules/Leads/ListView.php ============================================================================== --- vtigercrm/trunk/modules/Leads/ListView.php (original) +++ vtigercrm/trunk/modules/Leads/ListView.php Mon Aug 28 13:12:09 2006 @@ -27,6 +27,9 @@ require_once('include/ComboUtil.php'); require_once('include/utils/utils.php'); require_once('modules/CustomView/CustomView.php'); +require_once('include/database/Postgres8.php'); +require_once('include/DatabaseUtil.php'); + global $app_strings; global $list_max_entries_per_page; @@ -167,12 +170,15 @@ { $tablename = getTableNameForField('Leads',$order_by); $tablename = (($tablename != '')?($tablename."."):''); - + if( $adb->dbType == "pgsql") + $query .= ' GROUP BY '.$tablename.$order_by; + + $query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder; } //Retreiving the no of rows -$count_result = $adb->query("select count(*) count ".substr($query, strpos($query,'FROM'),strlen($query))); +$count_result = $adb->query( mkCountQuery( $query)); $noofrows = $adb->query_result($count_result,0,"count"); //Storing Listview session object @@ -185,6 +191,11 @@ //Retreive the Navigation array $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); + +//Postgres 8 fixes +if( $adb->dbType == "pgsql") + $query = fixPostgresQuery( $query, $log, 0); + //limiting the query if ($start_rec ==0) @@ -192,7 +203,10 @@ else $limit_start_rec = $start_rec -1; -$list_result = $adb->query($query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); + if( $adb->dbType == "pgsql") + $list_result = $adb->query($query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); + else + $list_result = $adb->query($query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); //mass merge for word templates -- *Raj*17/11 @@ -231,7 +245,10 @@ else $limit_start_rec = $start_rec -1; -$list_result = $adb->query($query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); + if( $adb->dbType == "pgsql") + $list_result = $adb->query($query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); + else + $list_result = $adb->query($query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); $record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows; From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 12:13:17 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:13:17 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9161 - /vtigercrm/trunk/modules/Invoice/ListView.php Message-ID: <20060828191317.347C5708252@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:13:10 2006 New Revision: 9161 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/Invoice/ListView.php Modified: vtigercrm/trunk/modules/Invoice/ListView.php ============================================================================== --- vtigercrm/trunk/modules/Invoice/ListView.php (original) +++ vtigercrm/trunk/modules/Invoice/ListView.php Mon Aug 28 13:13:10 2006 @@ -23,7 +23,8 @@ require_once('include/ComboUtil.php'); require_once('include/utils/utils.php'); require_once('modules/CustomView/CustomView.php'); - +require_once('include/database/Postgres8.php'); +require_once('include/DatabaseUtil.php'); global $app_strings,$list_max_entries_per_page,$currentModule,$theme; @@ -129,12 +130,16 @@ { if($order_by == 'smownerid') { + if( $adb->dbType == "pgsql") + $query .= ' GROUP BY user_name'; $query .= ' ORDER BY user_name '.$sorder; } else { $tablename = getTableNameForField('Invoice',$order_by); $tablename = (($tablename != '')?($tablename."."):''); + if( $adb->dbType == "pgsql") + $query .= ' GROUP BY '.$tablename.$order_by; $query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder; } @@ -142,7 +147,7 @@ //Retreiving the no of rows -$count_result = $adb->query("select count(*) count ".substr($query, strpos($query,'FROM'),strlen($query))); +$count_result = $adb->query( mkCountQuery( $query)); $noofrows = $adb->query_result($count_result,0,"count"); //Storing Listview session object @@ -156,6 +161,10 @@ //Retreive the Navigation array $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); + //Postgres 8 fixes + if( $adb->dbType == "pgsql") + $query = fixPostgresQuery( $query, $log, 0); + // Setting the record count string //modified by rdhital @@ -169,7 +178,10 @@ else $limit_start_rec = $start_rec -1; -$list_result = $adb->query($query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); +if( $adb->dbType == "pgsql") + $list_result = $adb->query($query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); +else + $list_result = $adb->query($query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); $record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows; From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 12:13:50 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:13:50 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9162 - /vtigercrm/trunk/modules/Campaigns/ListView.php Message-ID: <20060828191350.A694C708264@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:13:43 2006 New Revision: 9162 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/Campaigns/ListView.php Modified: vtigercrm/trunk/modules/Campaigns/ListView.php ============================================================================== --- vtigercrm/trunk/modules/Campaigns/ListView.php (original) +++ vtigercrm/trunk/modules/Campaigns/ListView.php Mon Aug 28 13:13:43 2006 @@ -18,6 +18,8 @@ require_once('themes/'.$theme.'/layout_utils.php'); require_once('include/utils/utils.php'); require_once('modules/CustomView/CustomView.php'); +require_once('include/database/Postgres8.php'); +require_once('include/DatabaseUtil.php'); global $app_strings,$mod_strings,$current_language; $current_module_strings = return_module_language($current_language, 'Campaigns'); @@ -129,25 +131,31 @@ { if($order_by == 'smownerid') { + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY vtiger_users.user_name'; $list_query .= ' ORDER BY vtiger_users.user_name '.$sorder; } else { $tablename = getTableNameForField('Campaigns',$order_by); $tablename = (($tablename != '')?($tablename."."):''); - + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY '.$tablename.$order_by; + $list_query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder; } } else { - $list_query .= ' order by vtiger_campaign.campaignid DESC'; + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY vtiger_campaign.campaignid'; + $list_query .= ' ORDER BY vtiger_campaign.campaignid DESC'; } //Constructing the list view //Retreiving the no of rows -$count_result = $adb->query("select count(*) count ".substr($list_query, strpos($list_query,'FROM'),strlen($list_query))); +$count_result = $adb->query( mkCountQuery( $list_query)); $noofrows = $adb->query_result($count_result,0,"count"); //Storing Listview session object @@ -167,11 +175,22 @@ $end_rec = $navigation_array['end_val']; //By Raju Ends + + //Postgres 8 fixes + if( $adb->dbType == "pgsql") + $list_query = fixPostgresQuery( $list_query, $log, 0); + + //limiting the query if ($start_rec ==0) $limit_start_rec = 0; else $limit_start_rec = $start_rec -1; + + if( $adb->dbType == "pgsql") + $list_result = $adb->query($list_query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); + else + $list_result = $adb->query($list_query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); $list_result = $adb->query($list_query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 12:14:39 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:14:39 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9163 - /vtigercrm/trunk/modules/SalesOrder/ListView.php Message-ID: <20060828191439.6C8A9708264@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:14:32 2006 New Revision: 9163 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/SalesOrder/ListView.php Modified: vtigercrm/trunk/modules/SalesOrder/ListView.php ============================================================================== --- vtigercrm/trunk/modules/SalesOrder/ListView.php (original) +++ vtigercrm/trunk/modules/SalesOrder/ListView.php Mon Aug 28 13:14:32 2006 @@ -14,7 +14,8 @@ require_once('include/ListView/ListView.php'); require_once('include/utils/utils.php'); require_once('modules/CustomView/CustomView.php'); - +require_once('include/database/Postgres8.php'); +require_once('include/DatabaseUtil.php'); global $app_strings,$mod_strings,$list_max_entries_per_page,$currentModule,$theme; $theme_path="themes/".$theme."/"; @@ -114,20 +115,23 @@ { if($order_by == 'smownerid') { + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY user_name'; $list_query .= ' ORDER BY user_name '.$sorder; } else { $tablename = getTableNameForField('SalesOrder',$order_by); $tablename = (($tablename != '')?($tablename."."):''); - + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY '.$tablename.$order_by; $list_query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder; } } //Retreiving the no of rows -$count_result = $adb->query("select count(*) count ".substr($list_query, strpos($list_query,'FROM'),strlen($list_query))); +$count_result = $adb->query( mkCountQuery( $list_query)); $noofrows = $adb->query_result($count_result,0,"count"); //Storing Listview session object @@ -140,6 +144,11 @@ //Retreive the Navigation array $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); + //Postgres 8 fixes + if( $adb->dbType == "pgsql") + $list_query = fixPostgresQuery( $list_query, $log, 0); + + // Setting the record count string //modified by rdhital @@ -152,8 +161,13 @@ $limit_start_rec = 0; else $limit_start_rec = $start_rec -1; - -$list_result = $adb->query($list_query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); + +if( $adb->dbType == "pgsql") + $list_result = $adb->query($list_query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); +else + $list_result = $adb->query($list_query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); + + $record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows; From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 12:16:10 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:16:10 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9164 - /vtigercrm/trunk/modules/PurchaseOrder/ListView.php Message-ID: <20060828191610.65AA8708264@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:16:03 2006 New Revision: 9164 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/PurchaseOrder/ListView.php Modified: vtigercrm/trunk/modules/PurchaseOrder/ListView.php ============================================================================== --- vtigercrm/trunk/modules/PurchaseOrder/ListView.php (original) +++ vtigercrm/trunk/modules/PurchaseOrder/ListView.php Mon Aug 28 13:16:03 2006 @@ -23,6 +23,9 @@ require_once('include/ComboUtil.php'); require_once('include/utils/utils.php'); require_once('modules/CustomView/CustomView.php'); +require_once('include/database/Postgres8.php'); +require_once('include/DatabaseUtil.php'); + global $app_strings,$list_max_entries_per_page,$currentModule,$theme; @@ -127,19 +130,23 @@ { if($order_by == 'smownerid') { + if( $adb->dbType == "pgsql") + $query .= ' GROUP BY user_name'; $query .= ' ORDER BY user_name '.$sorder; } else { $tablename = getTableNameForField('PurchaseOrder',$order_by); $tablename = (($tablename != '')?($tablename."."):''); + if( $adb->dbType == "pgsql") + $query .= ' GROUP BY '.$tablename.$order_by; $query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder; } } //Retreiving the no of rows -$count_result = $adb->query("select count(*) count ".substr($query, strpos($query,'FROM'),strlen($query))); +$count_result = $adb->query( mkCountQuery( $query)); $noofrows = $adb->query_result($count_result,0,"count"); //Storing Listview session object @@ -152,6 +159,11 @@ //Retreive the Navigation array $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); + //Postgres 8 fixes + if( $adb->dbType == "pgsql") + $query = fixPostgresQuery( $query, $log, 0); + + // Setting the record count string //modified by rdhital @@ -165,7 +177,10 @@ else $limit_start_rec = $start_rec -1; -$list_result = $adb->query($query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); +if( $adb->dbType == "pgsql") + $list_result = $adb->query($query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); +else + $list_result = $adb->query($query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); $record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows; From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 12:34:08 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:34:08 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9165 - /vtigercrm/trunk/modules/HelpDesk/ListView.php Message-ID: <20060828193409.0E38E708264@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:34:02 2006 New Revision: 9165 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/HelpDesk/ListView.php Modified: vtigercrm/trunk/modules/HelpDesk/ListView.php ============================================================================== --- vtigercrm/trunk/modules/HelpDesk/ListView.php (original) +++ vtigercrm/trunk/modules/HelpDesk/ListView.php Mon Aug 28 13:34:02 2006 @@ -23,6 +23,9 @@ require_once('themes/'.$theme.'/layout_utils.php'); require_once('include/utils/utils.php'); require_once('modules/CustomView/CustomView.php'); +require_once('include/database/Postgres8.php'); +require_once('include/DatabaseUtil.php'); + global $app_strings; global $mod_strings; @@ -127,25 +130,31 @@ { if($order_by == 'smownerid') { + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY vtiger_users.user_name'; $list_query .= ' ORDER BY vtiger_users.user_name '.$sorder; } else { $tablename = getTableNameForField('HelpDesk',$order_by); $tablename = (($tablename != '')?($tablename."."):''); - + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY '.$tablename.$order_by; + $list_query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder; } } else { - $list_query .= ' order by vtiger_troubletickets.ticketid DESC'; + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY vtiger_troubletickets.ticketid'; + $list_query .= ' ORDER BY vtiger_troubletickets.ticketid DESC'; } //Constructing the list view //Retreiving the no of rows -$count_result = $adb->query("select count(*) count ".substr($list_query, strpos($list_query,'FROM'),strlen($list_query))); +$count_result = $adb->query( mkCountQuery( $list_query)); $noofrows = $adb->query_result($count_result,0,"count"); //Storing Listview session object @@ -158,6 +167,11 @@ //Retreive the Navigation array $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); + //Postgres 8 fixes + if( $adb->dbType == "pgsql") + $list_query = fixPostgresQuery( $list_query, $log, 0); + + // Setting the record count string //modified by rdhital @@ -171,7 +185,10 @@ else $limit_start_rec = $start_rec -1; -$list_result = $adb->query($list_query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); +if( $adb->dbType == "pgsql") + $list_result = $adb->query($list_query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); +else + $list_result = $adb->query($list_query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); //mass merge for word templates -- *Raj*17/11 while($row = $adb->fetch_array($list_result)) From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 12:35:08 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:35:08 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9166 - /vtigercrm/trunk/modules/PriceBooks/ListView.php Message-ID: <20060828193508.8B777708264@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:35:01 2006 New Revision: 9166 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/PriceBooks/ListView.php Modified: vtigercrm/trunk/modules/PriceBooks/ListView.php ============================================================================== --- vtigercrm/trunk/modules/PriceBooks/ListView.php (original) +++ vtigercrm/trunk/modules/PriceBooks/ListView.php Mon Aug 28 13:35:01 2006 @@ -14,6 +14,8 @@ require_once('include/ListView/ListView.php'); require_once('include/utils/utils.php'); require_once('modules/CustomView/CustomView.php'); +require_once('include/database/Postgres8.php'); +require_once('include/DatabaseUtil.php'); global $app_strings,$mod_strings,$list_max_entries_per_page,$currentModule,$theme; @@ -106,13 +108,14 @@ { $tablename = getTableNameForField('PriceBooks',$order_by); $tablename = (($tablename != '')?($tablename."."):''); - + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY '.$tablename.$order_by; $list_query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder; } //Retreiving the no of rows -$count_result = $adb->query("select count(*) count ".substr($list_query, strpos($list_query,'FROM'),strlen($list_query))); +$count_result = $adb->query( mkCountQuery( $list_query)); $noofrows = $adb->query_result($count_result,0,"count"); //Storing Listview session object @@ -125,6 +128,11 @@ //Retreive the Navigation array $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); + //Postgres 8 fixes + if( $adb->dbType == "pgsql") + $list_query = fixPostgresQuery( $list_query, $log, 0); + + // Setting the record count string //modified by rdhital @@ -138,7 +146,10 @@ else $limit_start_rec = $start_rec -1; -$list_result = $adb->query($list_query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); +if( $adb->dbType == "pgsql") + $list_result = $adb->query($list_query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); +else + $list_result = $adb->query($list_query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); $record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows; From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 12:08:36 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:08:36 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9156 - /vtigercrm/trunk/modules/Accounts/ListView.php Message-ID: <20060828190837.11A3970824C@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:08:30 2006 New Revision: 9156 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/Accounts/ListView.php Modified: vtigercrm/trunk/modules/Accounts/ListView.php ============================================================================== --- vtigercrm/trunk/modules/Accounts/ListView.php (original) +++ vtigercrm/trunk/modules/Accounts/ListView.php Mon Aug 28 13:08:30 2006 @@ -23,6 +23,8 @@ require_once('include/ComboUtil.php'); require_once('include/utils/utils.php'); require_once('modules/CustomView/CustomView.php'); +require_once('include/database/Postgres8.php'); +require_once('include/DatabaseUtil.php'); global $app_strings; global $list_max_entries_per_page; @@ -160,20 +162,24 @@ { if($order_by == 'smownerid') { + if( $adb->dbType == "pgsql") + $query .= ' GROUP BY user_name'; $query .= ' ORDER BY user_name '.$sorder; } else { $tablename = getTableNameForField('Accounts',$order_by); $tablename = (($tablename != '')?($tablename."."):''); - + if( $adb->dbType == "pgsql") + $query .= ' GROUP BY '.$tablename.$order_by; + $query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder; } } //Retreiving the no of rows -$count_result = $adb->query("select count(*) count ".substr($query, strpos($query,'FROM'),strlen($query))); +$count_result = $adb->query( mkCountQuery( $query)); $noofrows = $adb->query_result($count_result,0,"count"); //Storing Listview session object @@ -187,7 +193,9 @@ //Retreive the Navigation array $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); - + //Postgres 8 fixes + if( $adb->dbType == "pgsql") + $query = fixPostgresQuery( $query, $log, 0); // Setting the record count string //modified by rdhital @@ -201,7 +209,10 @@ else $limit_start_rec = $start_rec -1; -$list_result = $adb->query($query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); + if( $adb->dbType == "pgsql") + $list_result = $adb->query($query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); + else + $list_result = $adb->query($query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); //mass merge for word templates -- *Raj*17/11 while($row = $adb->fetch_array($list_result)) From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 12:36:46 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:36:46 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9167 - /vtigercrm/trunk/modules/Users/User.php Message-ID: <20060828193646.3DF5A708252@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:36:39 2006 New Revision: 9167 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/Users/User.php Modified: vtigercrm/trunk/modules/Users/User.php ============================================================================== --- vtigercrm/trunk/modules/Users/User.php (original) +++ vtigercrm/trunk/modules/Users/User.php Mon Aug 28 13:36:39 2006 @@ -656,7 +656,7 @@ */ function saveentity($module) { - global $current_user, $adb;//$adb added by raju for mass mailing + global $current_user;//$adb added by raju for mass mailing $insertion_mode = $this->mode; $this->db->println("TRANS saveentity starts $module"); @@ -692,9 +692,9 @@ if($insertion_mode == 'edit') { $check_query = "select * from ".$table_name." where ".$this->tab_name_index[$table_name]."=".$this->id; - $check_result=$adb->query($check_query); - - $num_rows = $adb->num_rows($check_result); + $check_result=$this->db->query($check_query); + + $num_rows = $this->db->num_rows($check_result); if($num_rows <= 0) { @@ -713,7 +713,7 @@ $column = $this->tab_name_index[$table_name]; if($column == 'id' && $table_name == 'vtiger_users') { - $currentuser_id = $adb->getUniqueID("vtiger_users"); + $currentuser_id = $this->db->getUniqueID("vtiger_users"); $this->id = $currentuser_id; } $value = $this->id; @@ -721,13 +721,13 @@ $sql = "select * from vtiger_field where tabid=".$tabid." and tablename='".$table_name."' and displaytype in (1,3,4)"; } - $result = $adb->query($sql); - $noofrows = $adb->num_rows($result); + $result = $this->db->query($sql); + $noofrows = $this->db->num_rows($result); for($i=0; $i<$noofrows; $i++) { - $fieldname=$adb->query_result($result,$i,"fieldname"); - $columname=$adb->query_result($result,$i,"columnname"); - $uitype=$adb->query_result($result,$i,"uitype"); + $fieldname=$this->db->query_result($result,$i,"fieldname"); + $columname=$this->db->query_result($result,$i,"columnname"); + $uitype=$this->db->query_result($result,$i,"uitype"); if(isset($this->column_fields[$fieldname])) { if($uitype == 56) @@ -769,7 +769,7 @@ $fldvalue = $this->column_fields[$fieldname]; $fldvalue = stripslashes($fldvalue); } - $fldvalue = from_html($adb->formatString($table_name,$columname,$fldvalue),($insertion_mode == 'edit')?true:false); + $fldvalue = from_html($this->db->formatString($table_name,$columname,$fldvalue),($insertion_mode == 'edit')?true:false); @@ -809,14 +809,14 @@ { $sql1 = "update ".$table_name." set ".$update." where ".$this->tab_name_index[$table_name]."=".$this->id; - $adb->query($sql1); + $this->db->query($sql1); } } else { $sql1 = "insert into ".$table_name." (".$column.") values(".$value.")"; - $adb->query($sql1); + $this->db->query($sql1); } } @@ -829,7 +829,7 @@ */ function insertIntoAttachment($id,$module) { - global $log, $adb; + global $log; $log->debug("Entering into insertIntoAttachment($id,$module) method."); foreach($_FILES as $fileindex => $files) @@ -898,7 +898,7 @@ global $log; $log->debug("Entering into uploadAndSaveFile($id,$module,$file_details) method."); - global $adb, $current_user; + global $current_user; global $upload_badext; $date_var = date('YmdHis'); @@ -926,7 +926,7 @@ $filesize = $file_details['size']; $filetmp_name = $file_details['tmp_name']; - $current_id = $adb->getUniqueID("vtiger_crmentity"); + $current_id = $this->db->getUniqueID("vtiger_crmentity"); //get the file path inwhich folder we want to upload the file $upload_file_path = decideFilePath(); @@ -942,23 +942,23 @@ if($save_file == 'true') { - $sql1 = "insert into vtiger_crmentity (crmid,smcreatorid,smownerid,setype,description,createdtime,modifiedtime) values(".$current_id.",".$current_user->id.",".$ownerid.",'".$module." Attachment','".$this->column_fields['description']."',".$adb->formatString("vtiger_crmentity","createdtime",$date_var).",".$adb->formatString("vtiger_crmentity","modifiedtime",$date_var).")"; - $adb->query($sql1); + $sql1 = "insert into vtiger_crmentity (crmid,smcreatorid,smownerid,setype,description,createdtime,modifiedtime) values(".$current_id.",".$current_user->id.",".$ownerid.",'".$module." Attachment','".$this->column_fields['description']."',".$this->db->formatString("vtiger_crmentity","createdtime",$date_var).",".$this->db->formatString("vtiger_crmentity","modifiedtime",$date_var).")"; +- $this->db->query($sql1); $sql2="insert into vtiger_attachments(attachmentsid, name, description, type, path) values(".$current_id.",'".$filename."','".$this->column_fields['description']."','".$filetype."','".$upload_file_path."')"; - $result=$adb->query($sql2); + $result=$this->db->query($sql2); if($id != '') { $delquery = 'delete from vtiger_salesmanattachmentsrel where smid = '.$id; - $adb->query($delquery); + $this->db->query($delquery); } $sql3='insert into vtiger_salesmanattachmentsrel values('.$id.','.$current_id.')'; - $adb->query($sql3); + $this->db->query($sql3); //we should update the imagename in the users table - $adb->query("update vtiger_users set imagename=\"$filename\" where id=$id"); + $this->db->query("update vtiger_users set imagename=\"$filename\" where id=$id"); } else { From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 12:37:22 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:37:22 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9168 - /vtigercrm/trunk/modules/Users/Authenticate.php Message-ID: <20060828193722.DAAB5708272@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:37:15 2006 New Revision: 9168 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/Users/Authenticate.php Modified: vtigercrm/trunk/modules/Users/Authenticate.php ============================================================================== --- vtigercrm/trunk/modules/Users/Authenticate.php (original) +++ vtigercrm/trunk/modules/Users/Authenticate.php Mon Aug 28 13:37:15 2006 @@ -46,9 +46,18 @@ $auditrecord = ''; else $auditrecord = $record; - - $date_var = date('YmdHis'); - $query = "insert into vtiger_audit_trial values(".$adb->getUniqueID('vtiger_audit_trial').",".$focus->id.",'Users','Authenticate','',$date_var)"; + + if( $adb->dbType = "pgsql") + { + $date_var = date('Y-m-d H:i:s'); + $query = "insert into vtiger_audit_trial values(".$adb->getUniqueID('vtiger_audit_trial').",".$focus->id.",'Users','Authenticate','','$date_var')"; + } + else + { + + $date_var = date('YmdHis'); + $query = "insert into vtiger_audit_trial values(".$adb->getUniqueID('vtiger_audit_trial').",".$focus->id.",'Users','Authenticate','',$date_var)"; + } $adb->query($query); } From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 12:38:07 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:38:07 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9169 - /vtigercrm/trunk/modules/Faq/ListView.php Message-ID: <20060828193807.4FEBB708272@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:38:00 2006 New Revision: 9169 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/Faq/ListView.php Modified: vtigercrm/trunk/modules/Faq/ListView.php ============================================================================== --- vtigercrm/trunk/modules/Faq/ListView.php (original) +++ vtigercrm/trunk/modules/Faq/ListView.php Mon Aug 28 13:38:00 2006 @@ -23,6 +23,8 @@ require_once('themes/'.$theme.'/layout_utils.php'); require_once('include/utils/utils.php'); require_once('modules/CustomView/CustomView.php'); +require_once('include/database/Postgres8.php'); +require_once('include/DatabaseUtil.php'); global $app_strings; $current_module_strings = return_module_language($current_language, 'Faq'); @@ -135,7 +137,9 @@ { $tablename = getTableNameForField('Faq',$order_by); $tablename = (($tablename != '')?($tablename."."):''); - + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY '.$tablename.$order_by; + $list_query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder; } //Constructing the list view @@ -149,7 +153,7 @@ $smarty->assign("SINGLE_MOD",'Note'); //Retreiving the no of rows //Retreiving the no of rows -$count_result = $adb->query("select count(*) count ".substr($list_query, strpos($list_query,'FROM'),strlen($list_query))); +$count_result = $adb->query( mkCountQuery( $list_query)); $noofrows = $adb->query_result($count_result,0,"count"); if($viewnamedesc['viewname'] == 'All') @@ -167,6 +171,11 @@ //Retreive the Navigation array $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); + //Postgres 8 fixes + if( $adb->dbType == "pgsql") + $list_query = fixPostgresQuery( $list_query, $log, 0); + + // Setting the record count string //modified by rdhital @@ -180,7 +189,10 @@ else $limit_start_rec = $start_rec -1; -$list_result = $adb->query($list_query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); +if( $adb->dbType == "pgsql") + $list_result = $adb->query($list_query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); +else + $list_result = $adb->query($list_query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); $record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows; From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 12:38:47 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:38:47 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9170 - /vtigercrm/trunk/modules/Contacts/ListView.php Message-ID: <20060828193847.8B5CA708278@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:38:40 2006 New Revision: 9170 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/Contacts/ListView.php Modified: vtigercrm/trunk/modules/Contacts/ListView.php ============================================================================== --- vtigercrm/trunk/modules/Contacts/ListView.php (original) +++ vtigercrm/trunk/modules/Contacts/ListView.php Mon Aug 28 13:38:40 2006 @@ -29,6 +29,8 @@ require_once('include/ComboUtil.php'); require_once('include/utils/utils.php'); require_once('modules/CustomView/CustomView.php'); +require_once('include/database/Postgres8.php'); +require_once('include/DatabaseUtil.php'); global $app_strings; global $list_max_entries_per_page; @@ -158,13 +160,17 @@ { if($order_by == 'smownerid') { + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY user_name'; $list_query .= ' ORDER BY user_name '.$sorder; } else { $tablename = getTableNameForField('Contacts',$order_by); $tablename = (($tablename != '')?($tablename."."):''); - + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY '.$tablename.$order_by; + $list_query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder; } } @@ -181,7 +187,7 @@ $smarty->assign("CUSTOMVIEW_OPTION",$customviewcombo_html); $smarty->assign("VIEWID", $viewid); //Retreiving the no of rows -$count_result = $adb->query("select count(*) count ".substr($list_query, strpos($list_query,'FROM'),strlen($list_query))); +$count_result = $adb->query( mkCountQuery( $list_query)); $noofrows = $adb->query_result($count_result,0,"count"); //Storing Listview session object if($_SESSION['lvs'][$currentModule]) @@ -193,6 +199,11 @@ //Retreive the Navigation array $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); +//Postgres 8 fixes + if( $adb->dbType == "pgsql") + $list_query = fixPostgresQuery( $list_query, $log, 0); + + // Setting the record count string //modified by rdhital @@ -206,7 +217,10 @@ else $limit_start_rec = $start_rec -1; -$list_result = $adb->query($list_query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); +if( $adb->dbType == "pgsql") + $list_result = $adb->query($list_query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); +else + $list_result = $adb->query($list_query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); //mass merge for word templates -- *Raj*17/11 while($row = $adb->fetch_array($list_result)) From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 12:42:29 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:42:29 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9171 - /vtigercrm/trunk/modules/Calendar/calendarLayout.php Message-ID: <20060828194229.812E7708280@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:42:22 2006 New Revision: 9171 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/Calendar/calendarLayout.php Modified: vtigercrm/trunk/modules/Calendar/calendarLayout.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/calendarLayout.php (original) +++ vtigercrm/trunk/modules/Calendar/calendarLayout.php Mon Aug 28 13:42:22 2006 @@ -1242,6 +1242,7 @@ */ function getEventList(& $calendar,$start_date,$end_date,$info='') { + global $log; $Entries = Array(); $category = getParentTab(); global $adb,$current_user,$mod_strings,$cal_log; @@ -1269,7 +1270,7 @@ { $pending_query = $query." AND (vtiger_activity.eventstatus = 'Planned') AND vtiger_crmentity.smownerid = ".$current_user->id." - group by vtiger_activity.activityid + GROUP BY vtiger_activity.activityid ORDER BY vtiger_activity.date_start,vtiger_activity.time_start ASC"; $res = $adb->query($pending_query); $pending_rows = $adb->num_rows($res); @@ -1277,7 +1278,9 @@ if(!is_admin($current_user)) $query .= " AND vtiger_crmentity.smownerid in (".$shared_ids.") "; - $query .= "group by vtiger_activity.activityid ORDER BY vtiger_activity.date_start,vtiger_activity.time_start ASC"; + $query .= "GROUP BY vtiger_activity.activityid ORDER BY vtiger_activity.date_start,vtiger_activity.time_start ASC"; + if( $adb->dbType == "pgsql") + $query = fixPostgresQuery( $query, $log, 0); $result = $adb->query($query); $rows = $adb->num_rows($result); if($info != '') @@ -1354,6 +1357,7 @@ */ function getTodoList(& $calendar,$start_date,$end_date,$info='') { + global $log; $Entries = Array(); $category = getParentTab(); global $adb,$current_user,$mod_strings,$cal_log; @@ -1381,6 +1385,8 @@ $pending_query = $query." AND (vtiger_activity.status != 'Completed') AND vtiger_crmentity.smownerid = ".$current_user->id." ORDER BY vtiger_activity.date_start,vtiger_activity.time_start ASC"; + if( $adb->dbType == "pgsql") + $pending_query = fixPostgresQuery( $pending_query, $log, 0); $res = $adb->query($pending_query); $pending_rows = $adb->num_rows($res); } @@ -1388,6 +1394,8 @@ if(!is_admin($current_user)) $query .= " AND vtiger_crmentity.smownerid in (".$shared_ids.")"; $query .= " ORDER BY vtiger_activity.date_start,vtiger_activity.time_start ASC"; + if( $adb->dbType == "pgsql") + $query = fixPostgresQuery( $query, $log, 0); $result = $adb->query($query); $rows = $adb->num_rows($result); From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 13:24:59 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 20:24:59 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9172 - /vtigercrm/trunk/modules/Calendar/Activity.php Message-ID: <20060828202459.C0CB2708293@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 14:24:52 2006 New Revision: 9172 Log: Security Implemented for Outlook --Jeri Modified: vtigercrm/trunk/modules/Calendar/Activity.php Modified: vtigercrm/trunk/modules/Calendar/Activity.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/Activity.php (original) +++ vtigercrm/trunk/modules/Calendar/Activity.php Mon Aug 28 14:24:52 2006 @@ -398,7 +398,7 @@ global $current_user; require_once("modules/Users/User.php"); $seed_user=new User(); - $user_id=$seed_user->retrieve_user_id($user_name); + $user_id=$seed_user->retrieve_user_id($username); $current_user=$seed_user; $current_user->retrieve_entity_info($user_id, 'Users'); require('user_privileges/user_privileges_'.$current_user->id.'.php'); @@ -406,11 +406,11 @@ if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) { - $sql1 = "select tablename,columnname from vtiger_field where tabid=9"; + $sql1 = "select tablename,columnname from vtiger_field where tabid=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder'"; }else { $profileList = getCurrentUserProfileList(); - $sql1 = "select tablename,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=9 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + $sql1 = "select tablename,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder' and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; } $result1 = $adb->query($sql1); for($i=0;$i < $adb->num_rows($result1);$i++) @@ -434,6 +434,7 @@ inner join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid + left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid where vtiger_users.user_name='".$username."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task'"; $log->debug("Exiting get_tasksforol method ..."); return $query; @@ -457,11 +458,11 @@ if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) { - $sql1 = "select tablename,columnname from vtiger_field where tabid=9"; + $sql1 = "select tablename,columnname from vtiger_field where tabid=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder'"; }else { $profileList = getCurrentUserProfileList(); - $sql1 = "select tablename,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=9 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + $sql1 = "select tablename,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder' and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; } $result1 = $adb->query($sql1); for($i=0;$i < $adb->num_rows($result1);$i++) @@ -486,6 +487,7 @@ inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid + left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid where vtiger_users.user_name='".$user_name."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting'"; $log->debug("Exiting get_calendarsforol method ..."); From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 02:04:32 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 09:04:32 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9173 - /vtigercrm/trunk/include/database/Postgres8.php Message-ID: <20060829090432.1D7B37095E9@vtiger.fosslabs.com> Author: richie Date: Tue Aug 29 03:04:18 2006 New Revision: 9173 Log: Support for PostGres DB done Added: vtigercrm/trunk/include/database/Postgres8.php From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 02:16:06 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 09:16:06 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9174 - /vtigercrm/trunk/include/DatabaseUtil.php Message-ID: <20060829091606.BE77672A323@vtiger.fosslabs.com> Author: richie Date: Tue Aug 29 03:15:16 2006 New Revision: 9174 Log: Support for PostGres DB done Added: vtigercrm/trunk/include/DatabaseUtil.php From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 03:42:59 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 10:42:59 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9175 - /vtigercrm/trunk/soap/vtigerolservice.php Message-ID: <20060829104259.67AA672A323@vtiger.fosslabs.com> Author: richie Date: Tue Aug 29 04:42:35 2006 New Revision: 9175 Log: Issue in Outlook Plugin has been fixed--Jeri Modified: vtigercrm/trunk/soap/vtigerolservice.php Modified: vtigercrm/trunk/soap/vtigerolservice.php ============================================================================== --- vtigercrm/trunk/soap/vtigerolservice.php (original) +++ vtigercrm/trunk/soap/vtigerolservice.php Tue Aug 29 04:42:35 2006 @@ -853,7 +853,7 @@ function AddTasks($username,$taskdtls) { - global $current_user; + global $current_user,$adb; require_once('modules/Users/User.php'); require_once('modules/Calendar/Activity.php'); @@ -934,7 +934,7 @@ function UpdateTasks($username,$taskdtls) { - global $current_user; + global $current_user,$adb; require_once('modules/Users/User.php'); require_once('modules/Calendar/Activity.php'); From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 05:07:06 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 12:07:06 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9176 - /vtigercrm/trunk/modules/Calendar/TodoSave.php Message-ID: <20060829120706.809B572A47E@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 29 06:07:02 2006 New Revision: 9176 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/TodoSave.php Modified: vtigercrm/trunk/modules/Calendar/TodoSave.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/TodoSave.php (original) +++ vtigercrm/trunk/modules/Calendar/TodoSave.php Tue Aug 29 06:07:02 2006 @@ -33,12 +33,16 @@ } $focus->column_fields["subject"] = $_REQUEST["task_subject"]; $focus->column_fields["time_start"] = $_REQUEST["task_time_start"]; - $focus->column_fields["assigned_user_id"] = $_REQUEST["assigned_user_id"]; + $focus->column_fields["assigned_user_id"] = $_REQUEST["task_assigned_user_id"]; + $_REQUEST["assigned_group_name"] = $_REQUEST['task_assigned_group_name']; + $_REQUEST['assigntype'] = $_REQUEST['task_assigntype']; $focus->column_fields["taskstatus"] = $_REQUEST["taskstatus"]; $focus->column_fields["date_start"] = $_REQUEST["task_date_start"]; + $focus->column_fields["due_date"] = $_REQUEST["task_due_date"]; $focus->column_fields["taskpriority"] = $_REQUEST["taskpriority"]; + $focus->column_fields["description"] = $_REQUEST["task_description"]; + $focus->column_fields["sendnotification"] = $_REQUEST["task_sendnotification"]; - //echo '
';print_r($focus->column_fields);echo '
'; die; $focus->save($tab_type); header("Location: index.php?action=index&module=Calendar&view=".$_REQUEST['view']."&hour=".$_REQUEST['hour']."&day=".$_REQUEST['day']."&month=".$_REQUEST['month']."&year=".$_REQUEST['year']."&viewOption=".$_REQUEST['viewOption']."&subtab=".$_REQUEST['subtab']."&parenttab=".$_REQUEST['parenttab']); ?> From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 05:40:08 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 12:40:08 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9177 - /vtigercrm/trunk/modules/Calendar/calendarLayout.php Message-ID: <20060829124008.3426C744DA6@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 29 06:40:03 2006 New Revision: 9177 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/calendarLayout.php Modified: vtigercrm/trunk/modules/Calendar/calendarLayout.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/calendarLayout.php (original) +++ vtigercrm/trunk/modules/Calendar/calendarLayout.php Tue Aug 29 06:40:03 2006 @@ -1338,9 +1338,11 @@ else $element['action'] =" "; $element['status'] = $adb->query_result($result,$i,"eventstatus"); - $element['assignedto'] = $adb->query_result($result,$i,"user_name"); - if(empty($element['assignedto'])) - $element['groupname'] = $adb->query_result($result,$i,"groupname"); + $assignedto = $adb->query_result($result,$i,"user_name"); + if(!empty($assignedto)) + $element['assignedto'] = $assignedto; + else + $element['assignedto'] = $adb->query_result($result,$i,"groupname"); $Entries[] = $element; } $cal_log->debug("Exiting getEventList() method..."); @@ -1423,9 +1425,11 @@ $element['action'] ="date_time->hour."\",\"".$calendar['calendar']->date_time->day."\",\"".$calendar['calendar']->date_time->month."\",\"".$calendar['calendar']->date_time->year."\",\"todo\");' src='".$calendar['IMAGE_PATH']."cal_event.jpg' border='0'>"; else $element['action'] =" "; - $element['assignedto'] = $adb->query_result($result,$i,"user_name"); - if(empty($element['assignedto'])) - $element['groupname'] = $adb->query_result($result,$i,"groupname"); + $assignedto = $adb->query_result($result,$i,"user_name"); + if(!empty($assignedto)) + $element['assignedto'] = $assignedto; + else + $element['assignedto'] = $adb->query_result($result,$i,"groupname"); $Entries[] = $element; } $cal_log->debug("Exiting getTodoList() method..."); @@ -1465,8 +1469,16 @@ */ function constructEventListView(& $cal,$entry_list) { - global $mod_strings,$cal_log; + global $mod_strings,$app_strings,$cal_log,$current_user; $cal_log->debug("Entering constructEventListView() method..."); + $format = $cal['calendar']->hour_format; + $date_format = $current_user->date_format; + $hour_startat = convertTime2UserSelectedFmt($format,$cal['calendar']->day_start_hour,false); + $hour_endat = convertTime2UserSelectedFmt($format,($cal['calendar']->day_start_hour+1),false); + $time_arr = getaddEventPopupTime($hour_startat,$hour_endat,$format); + $temp_ts = $cal['calendar']->date_time->ts; + //to get date in user selected date format + $temp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$temp_ts)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$temp_ts)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $temp_ts)):('')))); $list_view = ""; if($cal['view'] == 'day') { @@ -1479,6 +1491,7 @@ $end_datetime = $mod_strings['LBL_APP_END_DATE']; } + //Events listview header labels $header = Array('0'=>'#', '1'=>$start_datetime, '2'=>$end_datetime, @@ -1520,9 +1533,32 @@ } else { - $list_view .="
"; - $list_view .=""; - $list_view .=""; + $list_view .=""; } $list_view .="
-   +   @@ -120,14 +114,18 @@
*'.$mod_strings['LBL_POTENTIAL_NAME'].' - +
*'.$mod_strings['LBL_POTENTIAL_CLOSE_DATE'].' - + + ('.$current_user->date_format.') +
- Create/Edit + {$CMOD.LBL_CREATE_EDIT}
View
Delete
{$CMOD.LBL_VIEW}
{$CMOD.LBL_DELETE}
 
- {if $FIELD_PRIVILEGES[$tabid] neq NULL} - {$CMOD.LBL_SHOW_FIELDS} + {if $FIELD_PRIVILEGES[$tabid] neq NULL || $modulename eq 'Emails'} + {$APP.LBL_EXPAND_COLLAPSE} {/if}
+ {if $FIELD_PRIVILEGES[$tabid] neq ''} {if $modulename eq 'Calendar'} @@ -197,6 +198,7 @@ {/if} + {/if} {foreach item=row_values from=$FIELD_PRIVILEGES[$tabid]} {foreach item=element from=$row_values} Modified: vtigercrm/trunk/Smarty/templates/ProfileDetailView.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/ProfileDetailView.tpl (original) +++ vtigercrm/trunk/Smarty/templates/ProfileDetailView.tpl Mon Aug 21 23:40:13 2006 @@ -170,8 +170,8 @@ {$STANDARD_PRIV[$tabid][2]} @@ -179,6 +179,7 @@ '; - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; $query = "select vtiger_users.user_name,vtiger_crmentity.crmid, vtiger_troubletickets.title, vtiger_contactdetails.contactid, vtiger_troubletickets.parent_id, vtiger_contactdetails.firstname, vtiger_contactdetails.lastname, vtiger_troubletickets.status, vtiger_troubletickets.priority, vtiger_crmentity.smownerid from vtiger_troubletickets inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_troubletickets.ticketid left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_troubletickets.parent_id left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_ticketgrouprelation on vtiger_troubletickets.ticketid=vtiger_ticketgrouprelation.ticketid left join vtiger_groups on vtiger_groups.groupname=vtiger_ticketgrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_contactdetails.contactid=".$id; $log->info("Ticket Related List for Contact Displayed"); @@ -411,7 +421,7 @@ */ function get_quotes($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_quotes(".$id.") method ..."); global $app_strings; require_once('modules/Quotes/Quote.php'); @@ -422,7 +432,10 @@ { $button .= ' '; } - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; $query = "select vtiger_users.user_name,vtiger_crmentity.*, vtiger_quotes.*,vtiger_potential.potentialname,vtiger_contactdetails.lastname from vtiger_quotes inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_quotes.quoteid left outer join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_quotes.contactid left outer join vtiger_potential on vtiger_potential.potentialid=vtiger_quotes.potentialid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_quotegrouprelation on vtiger_quotes.quoteid=vtiger_quotegrouprelation.quoteid left join vtiger_groups on vtiger_groups.groupname=vtiger_quotegrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_contactdetails.contactid=".$id; $log->debug("Exiting get_quotes method ..."); return GetRelatedList('Contacts','Quotes',$focus,$query,$button,$returnset); @@ -434,7 +447,7 @@ */ function get_salesorder($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_salesorder(".$id.") method ..."); require_once('modules/SalesOrder/SalesOrder.php'); global $app_strings; @@ -446,7 +459,10 @@ $button .= ' '; } - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; $query = "select vtiger_users.user_name,vtiger_crmentity.*, vtiger_salesorder.*, vtiger_quotes.subject as quotename, vtiger_account.accountname, vtiger_contactdetails.lastname from vtiger_salesorder inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_salesorder.salesorderid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left outer join vtiger_quotes on vtiger_quotes.quoteid=vtiger_salesorder.quoteid left outer join vtiger_account on vtiger_account.accountid=vtiger_salesorder.accountid left outer join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_salesorder.contactid left join vtiger_sogrouprelation on vtiger_salesorder.salesorderid=vtiger_sogrouprelation.salesorderid left join vtiger_groups on vtiger_groups.groupname=vtiger_sogrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_salesorder.contactid = ".$id; $log->debug("Exiting get_salesorder method ..."); @@ -459,7 +475,7 @@ */ function get_products($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_products(".$id.") method ..."); global $app_strings; require_once('modules/Products/Product.php'); @@ -471,7 +487,10 @@ $button .= ' '; } - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; $query = 'select vtiger_products.productid, vtiger_products.productname, vtiger_products.productcode, vtiger_products.commissionrate, vtiger_products.qty_per_unit, vtiger_products.unit_price, vtiger_crmentity.crmid, vtiger_crmentity.smownerid,vtiger_contactdetails.lastname from vtiger_products inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_products.productid left outer join vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_products.contactid where vtiger_contactdetails.contactid = '.$id.' and vtiger_crmentity.deleted = 0'; $log->debug("Exiting get_products method ..."); @@ -485,7 +504,7 @@ */ function get_purchase_orders($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_purchase_orders(".$id.") method ..."); global $app_strings; require_once('modules/PurchaseOrder/PurchaseOrder.php'); @@ -498,7 +517,10 @@ $button .= ' '; } - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; $query = "select vtiger_users.user_name,vtiger_crmentity.*, vtiger_purchaseorder.*,vtiger_vendor.vendorname,vtiger_contactdetails.lastname from vtiger_purchaseorder inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_purchaseorder.purchaseorderid left outer join vtiger_vendor on vtiger_purchaseorder.vendorid=vtiger_vendor.vendorid left outer join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_purchaseorder.contactid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_pogrouprelation on vtiger_purchaseorder.purchaseorderid=vtiger_pogrouprelation.purchaseorderid left join vtiger_groups on vtiger_groups.groupname=vtiger_pogrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_purchaseorder.contactid=".$id; $log->debug("Exiting get_purchase_orders method ..."); @@ -512,7 +534,7 @@ */ function get_emails($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_emails(".$id.") method ..."); global $mod_strings; @@ -524,7 +546,10 @@ { $button .= ''; } - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; $log->info("Email Related List for Contact Displayed"); @@ -540,12 +565,15 @@ function get_campaigns($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_campaigns(".$id.") method ..."); global $mod_strings; $focus = new Campaign(); - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; $button = ''; $log->info("Campaign Related List for Contact Displayed"); @@ -604,17 +632,17 @@ */ function getColumnNames() { - global $log,$current_user; + global $log, $current_user; $log->debug("Entering getColumnNames() method ..."); require('user_privileges/user_privileges_'.$current_user->id.'.php'); if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) { - $sql1 = "select fieldlabel from vtiger_field where tabid=4 and block <> 75"; + $sql1 = "select fieldlabel from vtiger_field where tabid=4 and block <> 75"; }else { - $profileList = getCurrentUserProfileList(); - $sql1 = "select fieldlabel from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=4 and vtiger_field.block <> 6 and vtiger_field.block <> 75 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; - } + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldlabel from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=4 and vtiger_field.block <> 6 and vtiger_field.block <> 75 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } $result = $this->db->query($sql1); $numRows = $this->db->num_rows($result); for($i=0; $i < $numRows;$i++) Modified: vtigercrm/trunk/modules/Contacts/DetailView.php ============================================================================== --- vtigercrm/trunk/modules/Contacts/DetailView.php (original) +++ vtigercrm/trunk/modules/Contacts/DetailView.php Wed Aug 23 23:16:24 2006 @@ -1,125 +1,135 @@ -id=$_REQUEST['record']; - $focus->retrieve_entity_info($_REQUEST['record'],'Contacts'); - $log->info("Entity info successfully retrieved for Contact DetailView."); - $focus->firstname=$focus->column_fields['firstname']; - $focus->lastname=$focus->column_fields['lastname']; -} -if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') { - $focus->id = ""; -} - -global $theme; -$theme_path="themes/".$theme."/"; -$image_path=$theme_path."images/"; -require_once($theme_path.'layout_utils.php'); - -$log->info("Contact detail view"); - -$smarty = new vtigerCRM_Smarty; -$smarty->assign("MOD", $mod_strings); -$smarty->assign("APP", $app_strings); - -$smarty->assign("THEME", $theme); -$smarty->assign("IMAGE_PATH", $image_path); -$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']); -$smarty->assign("UPDATEINFO",updateInfo($focus->id)); - -if(useInternalMailer() == 1) - $smarty->assign("INT_MAILER","true"); - -$smarty->assign("NAME",$focus->lastname.' '.$focus->firstname); - -$log->info("Detail Block Informations successfully retrieved."); -$smarty->assign("BLOCKS", getBlocks($currentModule,"detail_view",'',$focus->column_fields)); -$smarty->assign("CUSTOMFIELD", $cust_fld); -$smarty->assign("SINGLE_MOD", 'Contact'); -$smarty->assign("REDIR_MOD","contacts"); - -$smarty->assign("ID", $_REQUEST['record']); -if(isPermitted("Contacts","EditView",$_REQUEST['record']) == 'yes') - $smarty->assign("EDIT_DUPLICATE","permitted"); - -if(isPermitted("Contacts","Delete",$_REQUEST['record']) == 'yes') - $smarty->assign("DELETE","permitted"); -if(isPermitted("Emails","EditView",'') == 'yes') -{ - //Added to pass the parents list as hidden for Emails -- 09-11-2005 - $parent_email = getEmailParentsList('Contacts',$_REQUEST['record']); - $smarty->assign("HIDDEN_PARENTS_LIST",$parent_email); - $smarty->assign("SENDMAILBUTTON","permitted"); -} - -if(isPermitted("Contacts","Merge",'') == 'yes') -{ - $smarty->assign("MERGEBUTTON","permitted"); - require_once('include/utils/UserInfoUtil.php'); - $wordTemplateResult = fetchWordTemplateList("Contacts"); - $tempCount = $adb->num_rows($wordTemplateResult); - $tempVal = $adb->fetch_array($wordTemplateResult); - for($templateCount=0;$templateCount<$tempCount;$templateCount++) - { - $optionString[$tempVal["templateid"]]=$tempVal["filename"]; - $tempVal = $adb->fetch_array($wordTemplateResult); - } - $smarty->assign("WORDTEMPLATEOPTIONS",$app_strings['LBL_SELECT_TEMPLATE_TO_MAIL_MERGE']); - $smarty->assign("TOPTIONS",$optionString); -} - -//Security check for related list -$category = getParentTab(); -$smarty->assign("CATEGORY",$category); - -$check_button = Button_Check($module); -$smarty->assign("CHECK", $check_button); - -$tabid = getTabid("Contacts"); -$validationData = getDBValidationData($focus->tab_name,$tabid); -$data = split_validationdataArray($validationData); - -$smarty->assign("VALIDATION_DATA_FIELDNAME",$data['fieldname']); -$smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data['datatype']); -$smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']); - -$smarty->assign("MODULE",$currentModule); -$smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); -$smarty->display("DetailView.tpl"); -?> - +id=$_REQUEST['record']; + $focus->retrieve_entity_info($_REQUEST['record'],'Contacts'); + $log->info("Entity info successfully retrieved for Contact DetailView."); + $focus->firstname=$focus->column_fields['firstname']; + $focus->lastname=$focus->column_fields['lastname']; +} +if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') { + $focus->id = ""; +} + +global $theme; +$theme_path="themes/".$theme."/"; +$image_path=$theme_path."images/"; +require_once($theme_path.'layout_utils.php'); + +$log->info("Contact detail view"); + +$smarty = new vtigerCRM_Smarty; +$smarty->assign("MOD", $mod_strings); +$smarty->assign("APP", $app_strings); + +$smarty->assign("THEME", $theme); +$smarty->assign("IMAGE_PATH", $image_path); +$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']); +$smarty->assign("UPDATEINFO",updateInfo($focus->id)); + +if(useInternalMailer() == 1) + $smarty->assign("INT_MAILER","true"); + +$smarty->assign("NAME",$focus->lastname.' '.$focus->firstname); + +$log->info("Detail Block Informations successfully retrieved."); +$smarty->assign("BLOCKS", getBlocks($currentModule,"detail_view",'',$focus->column_fields)); +$smarty->assign("CUSTOMFIELD", $cust_fld); +$smarty->assign("SINGLE_MOD", 'Contact'); +$smarty->assign("REDIR_MOD","contacts"); + +$smarty->assign("ID", $_REQUEST['record']); +if(isPermitted("Contacts","EditView",$_REQUEST['record']) == 'yes') + $smarty->assign("EDIT_DUPLICATE","permitted"); + +if(isPermitted("Contacts","Delete",$_REQUEST['record']) == 'yes') + $smarty->assign("DELETE","permitted"); +if(isPermitted("Emails","EditView",'') == 'yes') +{ + //Added to pass the parents list as hidden for Emails -- 09-11-2005 + $parent_email = getEmailParentsList('Contacts',$_REQUEST['record']); + $smarty->assign("HIDDEN_PARENTS_LIST",$parent_email); + $smarty->assign("SENDMAILBUTTON","permitted"); +} + +if(isPermitted("Contacts","Merge",'') == 'yes') +{ + $smarty->assign("MERGEBUTTON","permitted"); + require_once('include/utils/UserInfoUtil.php'); + $wordTemplateResult = fetchWordTemplateList("Contacts"); + $tempCount = $adb->num_rows($wordTemplateResult); + $tempVal = $adb->fetch_array($wordTemplateResult); + for($templateCount=0;$templateCount<$tempCount;$templateCount++) + { + $optionString[$tempVal["templateid"]]=$tempVal["filename"]; + $tempVal = $adb->fetch_array($wordTemplateResult); + } + $smarty->assign("WORDTEMPLATEOPTIONS",$app_strings['LBL_SELECT_TEMPLATE_TO_MAIL_MERGE']); + $smarty->assign("TOPTIONS",$optionString); +} + +//Security check for related list +$category = getParentTab(); +$smarty->assign("CATEGORY",$category); + +$check_button = Button_Check($module); +$smarty->assign("CHECK", $check_button); + +$tabid = getTabid("Contacts"); +$validationData = getDBValidationData($focus->tab_name,$tabid); +$data = split_validationdataArray($validationData); + +$smarty->assign("VALIDATION_DATA_FIELDNAME",$data['fieldname']); +$smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data['datatype']); +$smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']); + +$smarty->assign("MODULE",$currentModule); +$smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); + +if($singlepane_view == 'true') +{ + $related_array = getRelatedLists($currentModule,$focus); + $smarty->assign("RELATEDLISTS", $related_array); +} + +$smarty->assign("SinglePane_View", $singlepane_view); + +$smarty->display("DetailView.tpl"); +?> + Modified: vtigercrm/trunk/modules/Contacts/updateRelations.php ============================================================================== --- vtigercrm/trunk/modules/Contacts/updateRelations.php (original) +++ vtigercrm/trunk/modules/Contacts/updateRelations.php Wed Aug 23 23:16:24 2006 @@ -1,38 +1,45 @@ -query($sql); - } - } - header("Location: index.php?action=CallRelatedList&module=Contacts&record=".$_REQUEST["parentid"]); -} -elseif(isset($_REQUEST['entityid']) && $_REQUEST['entityid'] != '') -{ - $sql = "insert into ".$rel_table." values(".$_REQUEST["entityid"].",".$_REQUEST["parid"].")"; - $adb->query($sql); - header("Location: index.php?action=CallRelatedList&module=Contacts&record=".$_REQUEST["parid"]); -} - -?> +query($sql); + } + } + if($singlepane_view == 'true') + header("Location: index.php?action=DetailView&module=Contacts&record=".$_REQUEST["parentid"]); + else + header("Location: index.php?action=CallRelatedList&module=Contacts&record=".$_REQUEST["parentid"]); +} +elseif(isset($_REQUEST['entityid']) && $_REQUEST['entityid'] != '') +{ + $sql = "insert into ".$rel_table." values(".$_REQUEST["entityid"].",".$_REQUEST["parid"].")"; + $adb->query($sql); + if($singlepane_view == 'true') + header("Location: index.php?action=DetailView&module=Contacts&record=".$_REQUEST["parid"]); + else + header("Location: index.php?action=CallRelatedList&module=Contacts&record=".$_REQUEST["parid"]); +} + +?> From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 22:17:46 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:17:46 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9100 - /vtigercrm/trunk/Smarty/templates/ActivityEditView.tpl Message-ID: <20060824051746.796B775E76C@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:17:42 2006 New Revision: 9100 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/Smarty/templates/ActivityEditView.tpl Modified: vtigercrm/trunk/Smarty/templates/ActivityEditView.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/ActivityEditView.tpl (original) +++ vtigercrm/trunk/Smarty/templates/ActivityEditView.tpl Wed Aug 23 23:17:42 2006 @@ -104,13 +104,17 @@ '; $success_query_array[$success_query_count++] = $query; + $migrationlog->debug("Query Success ==> $query"); } else { @@ -3698,11 +3702,13 @@ '; $failure_query_array[$failure_query_count++] = $query; + $migrationlog->debug("Query Failed ==> $query"); + //$migrationlog->debug("Error is ==> ".$conn->ErrorMsg()); } } //Added on 23-12-2005 which is used to populate the vtiger_profile2field and vtiger_def_org_field table entries for the field per tab -//if we enter a vtiger_field in vtiger_field table then we must populate that vtiger_field in these table for security access +//if we enter a field in vtiger_field table then we must populate that field in these table for security access function populateFieldForSecurity($tabid,$fieldid) { global $conn; Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/rename_tables.php ============================================================================== --- vtigercrm/trunk/modules/Migration/ModifyDatabase/rename_tables.php (original) +++ vtigercrm/trunk/modules/Migration/ModifyDatabase/rename_tables.php Mon Aug 28 06:09:50 2006 @@ -10,9 +10,10 @@ ********************************************************************************/ global $conn; +global $migrationlog; $prefix = "vtiger_"; -$conn->println("Inside the file rename_tables.php to rename the table names with prefix vtiger_"); +$migrationlog->debug("Inside the file rename_tables.php to rename the table names with prefix vtiger_"); //Rename all the tables with prefix vtiger_ $tables_list = $conn->get_tables(); @@ -66,5 +67,5 @@ } -$conn->println("End of file rename_tables.php. The table names renamed with prefix vtiger_"); +$migrationlog->debug("End of file rename_tables.php. The table names renamed with prefix vtiger_"); ?> From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 07:04:22 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 14:04:22 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9144 - in /vtigercrm/trunk/Smarty/templates: Inventory/InventoryEditView.tpl salesEditView.tpl Message-ID: <20060828140422.ECEC36B5506@vtiger.fosslabs.com> Author: saraj Date: Mon Aug 28 08:04:18 2006 New Revision: 9144 Log: Removed the more information tab pertaining to related lists from edit view -- ahmed Modified: vtigercrm/trunk/Smarty/templates/Inventory/InventoryEditView.tpl vtigercrm/trunk/Smarty/templates/salesEditView.tpl Modified: vtigercrm/trunk/Smarty/templates/Inventory/InventoryEditView.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/Inventory/InventoryEditView.tpl (original) +++ vtigercrm/trunk/Smarty/templates/Inventory/InventoryEditView.tpl Mon Aug 28 08:04:18 2006 @@ -78,11 +78,6 @@ - - {if $OP_MODE neq 'create_view'} - - {/if} -
{$CMOD.LBL_FIELDS_SELECT_DESELECT} ({$APP.Tasks}){$CMOD.LBL_FIELDS_SELECT_DESELECT}
 
- {if $FIELD_PRIVILEGES[$tabid] neq NULL} - {$CMOD.LBL_SHOW_FIELDS} + {if $FIELD_PRIVILEGES[$tabid] neq NULL || $modulename eq 'Emails'} + {$APP.LBL_EXPAND_COLLAPSE} {/if}
+ {if $FIELD_PRIVILEGES[$tabid] neq ''} {if $modulename eq 'Calendar'} @@ -186,6 +187,7 @@ {/if} + {/if} {foreach item=row_values from=$FIELD_PRIVILEGES[$tabid]} {foreach item=element from=$row_values} From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 03:03:36 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 10:03:36 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9063 - /customerportal/trunk/PortalConfig.php Message-ID: <20060822100336.F371475E0E3@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 22 04:03:33 2006 New Revision: 9063 Log: * Modified the command to configure the path variables Modified: customerportal/trunk/PortalConfig.php Modified: customerportal/trunk/PortalConfig.php ============================================================================== --- customerportal/trunk/PortalConfig.php (original) +++ customerportal/trunk/PortalConfig.php Tue Aug 22 04:03:33 2006 @@ -13,11 +13,13 @@ global $Server_Path; global $Portal_Path; -//This is the vtigerCRM Server Path where contactserialize.php file is located -$Server_Path = ""; //for eg. http://vtiger-server:90 +//This is the vtiger server path ie., the url to access the vtiger server in browser +//Ex. i access my vtiger as http://mickie:90/vtiger/index.php so i will give as http://mickie:90/vtiger +$Server_Path = ""; -//This is the Customer Portal path where CustomerAuthenticate.php file is located -$Authenticate_Path = ""; //for eg. http://your-server/vtiger_customerportal +//This is the customer portal path ie., url to access the customer portal in browser +//Ex. i access my portal as http://mickie:90/customerportal/login.php so i will give as http://mickie:90/customerportal +$Authenticate_Path = ""; //Give a temporary directory path which is used when we upload attachment $upload_dir = '/tmp'; From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 03:18:54 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 10:18:54 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9064 - /vtigercrm/trunk/modules/System/includes/os/class.Linux.inc.php Message-ID: <20060822101854.C193775E354@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 22 04:18:51 2006 New Revision: 9064 Log: file does not exist error fixed Modified: vtigercrm/trunk/modules/System/includes/os/class.Linux.inc.php Modified: vtigercrm/trunk/modules/System/includes/os/class.Linux.inc.php ============================================================================== --- vtigercrm/trunk/modules/System/includes/os/class.Linux.inc.php (original) +++ vtigercrm/trunk/modules/System/includes/os/class.Linux.inc.php Tue Aug 22 04:18:51 2006 @@ -347,7 +347,7 @@ $bufr = execute_program('lsscsi', '-c', false); if( is_null( $bufr )) { - $bufr = rfts( '/proc/scsi/scsi' ); + $bufr = rfts( '/proc/scsi/scsi', 0, 4096, false ); } if ( $bufr != "ERROR" ) { $bufe = explode("\n", $bufr); From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 03:47:28 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 10:47:28 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9065 - /vtigercrm/trunk/modules/Import/ImportStep2.php Message-ID: <20060822104728.EA27B75E5E4@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 22 04:47:24 2006 New Revision: 9065 Log: * Added double quotes with the fieldnames, becuase it did not allow import when we import otherphone first and phone second Modified: vtigercrm/trunk/modules/Import/ImportStep2.php Modified: vtigercrm/trunk/modules/Import/ImportStep2.php ============================================================================== --- vtigercrm/trunk/modules/Import/ImportStep2.php (original) +++ vtigercrm/trunk/modules/Import/ImportStep2.php Tue Aug 22 04:47:24 2006 @@ -375,10 +375,10 @@ if(optionData != -1) { - tmp = seq_string.indexOf(optionData); + tmp = seq_string.indexOf("\""+optionData+"\""); if(tmp == -1) { - seq_string = seq_string + optionData; + seq_string = seq_string + "\""+optionData+"\""; } else { From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 05:17:34 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 12:17:34 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9066 - /vtigercrm/trunk/modules/Users/DefaultDataPopulator.php Message-ID: <20060822121734.52F8F75E5EE@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 22 06:17:30 2006 New Revision: 9066 Log: Field name changed from Part Number to Product Code Modified: vtigercrm/trunk/modules/Users/DefaultDataPopulator.php Modified: vtigercrm/trunk/modules/Users/DefaultDataPopulator.php ============================================================================== --- vtigercrm/trunk/modules/Users/DefaultDataPopulator.php (original) +++ vtigercrm/trunk/modules/Users/DefaultDataPopulator.php Tue Aug 22 06:17:30 2006 @@ -426,7 +426,7 @@ //Block31-36 -- Start $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'productname','vtiger_products',1,'2','productname','Product Name',1,0,0,100,1,31,1,'V~M',1,null,'BAS')"); - $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'productcode','vtiger_products',1,'1','productcode','Part Number',1,0,0,100,2,31,1,'V~O',1,null,'BAS')"); + $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'productcode','vtiger_products',1,'1','productcode','Product Code',1,0,0,100,2,31,1,'V~O',1,null,'BAS')"); $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'discontinued','vtiger_products',1,'56','discontinued','Product Active',1,0,0,100,3,31,1,'V~O',1,null,'BAS')"); $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'manufacturer','vtiger_products',1,'15','manufacturer','Manufacturer',1,0,0,100,4,1,31,'V~O',1,null,'BAS')"); $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'productcategory','vtiger_products',1,'15','productcategory','Product Category',1,0,0,100,4,31,1,'V~O',1,null,'BAS')"); From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 05:39:16 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 12:39:16 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9067 - in /vtigercrm/trunk/pkg/bin: startvTiger.bat startvTiger.sh stopvTiger.bat uninstallvtiger.sh Message-ID: <20060822123916.3F38D75E5F8@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 22 06:39:10 2006 New Revision: 9067 Log: removed rc Modified: vtigercrm/trunk/pkg/bin/startvTiger.bat vtigercrm/trunk/pkg/bin/startvTiger.sh vtigercrm/trunk/pkg/bin/stopvTiger.bat vtigercrm/trunk/pkg/bin/uninstallvtiger.sh Modified: vtigercrm/trunk/pkg/bin/startvTiger.bat ============================================================================== --- vtigercrm/trunk/pkg/bin/startvTiger.bat (original) +++ vtigercrm/trunk/pkg/bin/startvTiger.bat Tue Aug 22 06:39:10 2006 @@ -43,23 +43,23 @@ echo "" echo "making an attempt to kill any existing vtigercrm service" echo "" -bin\apache -k stop -n vtigercrm5_rc -bin\apache -k uninstall -n vtigercrm5_rc +bin\apache -k stop -n vtigercrm5_0 +bin\apache -k uninstall -n vtigercrm5_0 echo "Uninstalling apache service again for confirmation after sleeping for 10 seconds" echo "" %SLEEP_STR% -n 10 127.0.0.1>nul -bin\apache -k stop -n vtigercrm5_rc -bin\apache -k uninstall -n vtigercrm5_rc +bin\apache -k stop -n vtigercrm5_0 +bin\apache -k uninstall -n vtigercrm5_0 echo "" echo "" -echo "Installing vtigercrm5_rc apache service after sleeping for 10 seconds" +echo "Installing vtigercrm5_0 apache service after sleeping for 10 seconds" echo "" %SLEEP_STR% -n 10 127.0.0.1>nul -bin\apache -k install -n vtigercrm5_rc -f conf\httpd.conf +bin\apache -k install -n vtigercrm5_0 -f conf\httpd.conf echo "" -echo "Starting vtigercrm5_rc apache service" +echo "Starting vtigercrm5_0 apache service" echo "" -bin\apache -n vtigercrm5_rc -k start +bin\apache -n vtigercrm5_0 -k start IF ERRORLEVEL 1 goto stopservice goto checkmysql @@ -117,27 +117,27 @@ :checkdatabase echo "" -echo "check to see if vtigercrm5_rc database already exists" +echo "check to see if vtigercrm5_0 database already exists" echo "" -mysql --port=%mysql_port% --user=%mysql_username% --password=%mysql_password% -e "show databases like 'vtigercrm5_rc'" | "%WINDIR%\system32\find.exe" "vtigercrm5_rc" > NUL +mysql --port=%mysql_port% --user=%mysql_username% --password=%mysql_password% -e "show databases like 'vtigercrm5_0'" | "%WINDIR%\system32\find.exe" "vtigercrm5_0" > NUL IF ERRORLEVEL 1 goto dbnotexists echo "" -ECHO "vtigercrm5_rc database exists" +ECHO "vtigercrm5_0 database exists" echo "" goto end :dbnotexists echo "" -ECHO "vtigercrm5_rc database does not exist" +ECHO "vtigercrm5_0 database does not exist" echo "" echo %cd% echo "" -echo "Proceeding to create database vtigercrm5_rc and populate the same" +echo "Proceeding to create database vtigercrm5_0 and populate the same" echo "" -mysql --user=%mysql_username% --password=%mysql_password% --port=%mysql_port% -e "create database if not exists vtigercrm5_rc" +mysql --user=%mysql_username% --password=%mysql_password% --port=%mysql_port% -e "create database if not exists vtigercrm5_0" echo "" -echo "vtigercrm5_rc database created" +echo "vtigercrm5_0 database created" echo "" goto end Modified: vtigercrm/trunk/pkg/bin/startvTiger.sh ============================================================================== --- vtigercrm/trunk/pkg/bin/startvTiger.sh (original) +++ vtigercrm/trunk/pkg/bin/startvTiger.sh Tue Aug 22 06:39:10 2006 @@ -111,20 +111,20 @@ fi echo "" -echo "Checking if the vtigercrm5_rc database already exists" +echo "Checking if the vtigercrm5_0 database already exists" echo "" -echo "select 1" | ./bin/mysql --user=$mysql_username --password=$mysql_password --port=$mysql_port --socket=$mysql_socket -D vtigercrm5_rc >/dev/null +echo "select 1" | ./bin/mysql --user=$mysql_username --password=$mysql_password --port=$mysql_port --socket=$mysql_socket -D vtigercrm5_0 >/dev/null if [ $? -ne 0 ]; then echo "" - echo "Database vtigercrm5_rc does not exist. Creating database vtigercrm5_rc" + echo "Database vtigercrm5_0 does not exist. Creating database vtigercrm5_0" echo "" - ./bin/mysql --user=$mysql_username --password=$mysql_password --port=$mysql_port --socket=$mysql_socket -e "create database if not exists vtigercrm5_rc" + ./bin/mysql --user=$mysql_username --password=$mysql_password --port=$mysql_port --socket=$mysql_socket -e "create database if not exists vtigercrm5_0" fi host=`hostname` echo "*****************************************************************************************************" if [ $apache_bundled == 'false' ];then - echo "Please access the product at http://${host}:/vtigerCRM5_rc/vtigerCRM" + echo "Please access the product at http://${host}:/vtigerCRM5/vtigerCRM" else echo "Please access the product at http://${host}:" echo "*****************************************************************************************************" Modified: vtigercrm/trunk/pkg/bin/stopvTiger.bat ============================================================================== --- vtigercrm/trunk/pkg/bin/stopvTiger.bat (original) +++ vtigercrm/trunk/pkg/bin/stopvTiger.bat Tue Aug 22 06:39:10 2006 @@ -32,13 +32,13 @@ cd /d %apache_dir% rem shut down apache echo "" -echo "stopping vtigercrm5_rc apache service" +echo "stopping vtigercrm5_0 apache service" echo "" -bin\apache -n vtigercrm5_rc -k stop +bin\apache -n vtigercrm5_0 -k stop echo "" -echo "uninstalling vtigercrm5_rc apache service" +echo "uninstalling vtigercrm5_0 apache service" echo "" -bin\apache -k uninstall -n vtigercrm5_rc +bin\apache -k uninstall -n vtigercrm5_0 rem .\bin\ShutdownApache.exe logs\httpd.pid goto StopMySQL Modified: vtigercrm/trunk/pkg/bin/uninstallvtiger.sh ============================================================================== --- vtigercrm/trunk/pkg/bin/uninstallvtiger.sh (original) +++ vtigercrm/trunk/pkg/bin/uninstallvtiger.sh Tue Aug 22 06:39:10 2006 @@ -17,42 +17,42 @@ cd ${PREV_DIR} if [ ${APACHE_STATUS} == "false" ] then - diff conf/httpd.conf conf/vtiger_conf/vtigerCRM5_rc/httpd.conf > /dev/null; + diff conf/httpd.conf conf/vtiger_conf/vtigerCRM5/httpd.conf > /dev/null; if [ $? -eq 0 ] then - cp conf/vtigerCRMBackup/vtigerCRM5_rc/httpd.vtiger.crm.conf conf/httpd.conf + cp conf/vtigerCRMBackup/vtigerCRM5/httpd.vtiger.crm.conf conf/httpd.conf echo "The httpd.conf file successfully reverted" else - echo "The httpd.conf file under apache/conf has been edited since installation. Hence the uninstallation will not revert the httpd.conf file. The original httpd.conf file is present in /conf/vtigerCRMBackup/vtigerCRM5_rc/httpd.vtiger.crm.conf. Kindly revert the same manually" + echo "The httpd.conf file under apache/conf has been edited since installation. Hence the uninstallation will not revert the httpd.conf file. The original httpd.conf file is present in /conf/vtigerCRMBackup/vtigerCRM5/httpd.vtiger.crm.conf. Kindly revert the same manually" fi - diff modules/libphp4.so modules/vtiger_modules/vtigerCRM5_rc/libphp4.so > /dev/null; + diff modules/libphp4.so modules/vtiger_modules/vtigerCRM5/libphp4.so > /dev/null; if [ $? -eq 0 ] then - cp modules/vtigerCRMBackup/vtigerCRM5_rc/libphp4.vtiger.crm.so modules/libphp4.so + cp modules/vtigerCRMBackup/vtigerCRM5/libphp4.vtiger.crm.so modules/libphp4.so echo "The libphp4.so file successfully reverted" else - echo "The libphp4.so file under apache/modules has been edited since installation. Hence the uninstallation will not revert the libphp4.so file. The original libphp4.so file is present in /modules/vtigerCRMBackup/vtigerCRM5_rc/libphp4.vtiger.crm.so. Kindly revert the same manually" + echo "The libphp4.so file under apache/modules has been edited since installation. Hence the uninstallation will not revert the libphp4.so file. The original libphp4.so file is present in /modules/vtigerCRMBackup/vtigerCRM5/libphp4.vtiger.crm.so. Kindly revert the same manually" fi cd - - if [ -d $PWD/vtigerCRM5_rc ]; then + if [ -d $PWD/vtigerCRM5 ]; then echo "Uninstalling vtigerCRM from the system..." - rm -rf ../conf/vtiger_conf/vtigerCRM5_rc - rm -rf ../modules/vtiger_modules/vtigerCRM5_rc - rm -rf vtigerCRM5_rc + rm -rf ../conf/vtiger_conf/vtigerCRM5 + rm -rf ../modules/vtiger_modules/vtigerCRM5 + rm -rf vtigerCRM5 echo "Uninstallation of vtigerCRM completed" cd ${HOME} fi else cd - - if [ -d $PWD/vtigerCRM5_rc ]; then + if [ -d $PWD/vtigerCRM5 ]; then echo "Uninstalling vtigerCRM from the system..." - rm -rf ../conf/vtiger_conf/vtigerCRM5_rc - rm -rf ../modules/vtiger_modules/vtigerCRM5_rc - rm -rf vtigerCRM5_rc + rm -rf ../conf/vtiger_conf/vtigerCRM5 + rm -rf ../modules/vtiger_modules/vtigerCRM5 + rm -rf vtigerCRM5 echo "Uninstallation of vtigerCRM completed" cd ${HOME} fi From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 06:04:39 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 13:04:39 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9068 - in /customerportal/trunk: Tickets/TicketDetail.php index.php Message-ID: <20060822130439.A717A75E5FC@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 22 07:04:35 2006 New Revision: 9068 Log: * Modified to handle the attachments Modified: customerportal/trunk/Tickets/TicketDetail.php customerportal/trunk/index.php Modified: customerportal/trunk/Tickets/TicketDetail.php ============================================================================== --- customerportal/trunk/Tickets/TicketDetail.php (original) +++ customerportal/trunk/Tickets/TicketDetail.php Tue Aug 22 07:04:35 2006 @@ -180,7 +180,7 @@ $list .= ' - + '; } } Modified: customerportal/trunk/index.php ============================================================================== --- customerportal/trunk/index.php (original) +++ customerportal/trunk/index.php Tue Aug 22 07:04:35 2006 @@ -46,6 +46,27 @@ if($_SESSION['customer_id'] != '') { $is_logged = 1; + + //Added to download attachments + if($_REQUEST['downloadfile'] == 'true') + { + $filename = $_REQUEST['filename']; + $fileType = $_REQUEST['filetype']; + $fileid = $_REQUEST['fileid']; + $filesize = $_REQUEST['filesize']; + + $contentname = $fileid.'_filecontents'; + $fileContent = $_SESSION[$contentname]; + + header("Content-type: $fileType"); + header("Content-length: $filesize"); + header("Cache-Control: private"); + header("Content-Disposition: attachment; filename=$filename"); + header("Content-Description: PHP Generated Data"); + echo base64_decode($fileContent); + + exit; + } if($_REQUEST['module'] != '' && $_REQUEST['action'] != '') { $module = $_REQUEST['module']."/"; From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 06:06:21 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 13:06:21 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9069 - /customerportal/trunk/Tickets/downloadfile.php Message-ID: <20060822130621.3FBA975E5FF@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 22 07:06:17 2006 New Revision: 9069 Log: * Removed this file where as we have handle the download attachment in index.php itself Removed: customerportal/trunk/Tickets/downloadfile.php From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 06:11:29 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 13:11:29 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9070 - in /vtigercrm/trunk/pkg/bin: startvTiger.bat startvTiger.sh stopvTiger.bat Message-ID: <20060822131129.54A4175E605@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 22 07:11:24 2006 New Revision: 9070 Log: db name changed Modified: vtigercrm/trunk/pkg/bin/startvTiger.bat vtigercrm/trunk/pkg/bin/startvTiger.sh vtigercrm/trunk/pkg/bin/stopvTiger.bat Modified: vtigercrm/trunk/pkg/bin/startvTiger.bat ============================================================================== --- vtigercrm/trunk/pkg/bin/startvTiger.bat (original) +++ vtigercrm/trunk/pkg/bin/startvTiger.bat Tue Aug 22 07:11:24 2006 @@ -43,23 +43,23 @@ echo "" echo "making an attempt to kill any existing vtigercrm service" echo "" -bin\apache -k stop -n vtigercrm5_0 -bin\apache -k uninstall -n vtigercrm5_0 +bin\apache -k stop -n vtigercrm5 +bin\apache -k uninstall -n vtigercrm5 echo "Uninstalling apache service again for confirmation after sleeping for 10 seconds" echo "" %SLEEP_STR% -n 10 127.0.0.1>nul -bin\apache -k stop -n vtigercrm5_0 -bin\apache -k uninstall -n vtigercrm5_0 +bin\apache -k stop -n vtigercrm5 +bin\apache -k uninstall -n vtigercrm5 echo "" echo "" -echo "Installing vtigercrm5_0 apache service after sleeping for 10 seconds" +echo "Installing vtigercrm5 apache service after sleeping for 10 seconds" echo "" %SLEEP_STR% -n 10 127.0.0.1>nul -bin\apache -k install -n vtigercrm5_0 -f conf\httpd.conf +bin\apache -k install -n vtigercrm5 -f conf\httpd.conf echo "" -echo "Starting vtigercrm5_0 apache service" +echo "Starting vtigercrm5 apache service" echo "" -bin\apache -n vtigercrm5_0 -k start +bin\apache -n vtigercrm5 -k start IF ERRORLEVEL 1 goto stopservice goto checkmysql @@ -117,27 +117,27 @@ :checkdatabase echo "" -echo "check to see if vtigercrm5_0 database already exists" +echo "check to see if vtigercrm5 database already exists" echo "" -mysql --port=%mysql_port% --user=%mysql_username% --password=%mysql_password% -e "show databases like 'vtigercrm5_0'" | "%WINDIR%\system32\find.exe" "vtigercrm5_0" > NUL +mysql --port=%mysql_port% --user=%mysql_username% --password=%mysql_password% -e "show databases like 'vtigercrm5'" | "%WINDIR%\system32\find.exe" "vtigercrm5" > NUL IF ERRORLEVEL 1 goto dbnotexists echo "" -ECHO "vtigercrm5_0 database exists" +ECHO "vtigercrm5 database exists" echo "" goto end :dbnotexists echo "" -ECHO "vtigercrm5_0 database does not exist" +ECHO "vtigercrm5 database does not exist" echo "" echo %cd% echo "" -echo "Proceeding to create database vtigercrm5_0 and populate the same" +echo "Proceeding to create database vtigercrm5 and populate the same" echo "" -mysql --user=%mysql_username% --password=%mysql_password% --port=%mysql_port% -e "create database if not exists vtigercrm5_0" +mysql --user=%mysql_username% --password=%mysql_password% --port=%mysql_port% -e "create database if not exists vtigercrm5" echo "" -echo "vtigercrm5_0 database created" +echo "vtigercrm5 database created" echo "" goto end Modified: vtigercrm/trunk/pkg/bin/startvTiger.sh ============================================================================== --- vtigercrm/trunk/pkg/bin/startvTiger.sh (original) +++ vtigercrm/trunk/pkg/bin/startvTiger.sh Tue Aug 22 07:11:24 2006 @@ -111,14 +111,14 @@ fi echo "" -echo "Checking if the vtigercrm5_0 database already exists" +echo "Checking if the vtigercrm5 database already exists" echo "" -echo "select 1" | ./bin/mysql --user=$mysql_username --password=$mysql_password --port=$mysql_port --socket=$mysql_socket -D vtigercrm5_0 >/dev/null +echo "select 1" | ./bin/mysql --user=$mysql_username --password=$mysql_password --port=$mysql_port --socket=$mysql_socket -D vtigercrm5 >/dev/null if [ $? -ne 0 ]; then echo "" - echo "Database vtigercrm5_0 does not exist. Creating database vtigercrm5_0" + echo "Database vtigercrm5 does not exist. Creating database vtigercrm5" echo "" - ./bin/mysql --user=$mysql_username --password=$mysql_password --port=$mysql_port --socket=$mysql_socket -e "create database if not exists vtigercrm5_0" + ./bin/mysql --user=$mysql_username --password=$mysql_password --port=$mysql_port --socket=$mysql_socket -e "create database if not exists vtigercrm5" fi host=`hostname` Modified: vtigercrm/trunk/pkg/bin/stopvTiger.bat ============================================================================== --- vtigercrm/trunk/pkg/bin/stopvTiger.bat (original) +++ vtigercrm/trunk/pkg/bin/stopvTiger.bat Tue Aug 22 07:11:24 2006 @@ -32,13 +32,13 @@ cd /d %apache_dir% rem shut down apache echo "" -echo "stopping vtigercrm5_0 apache service" +echo "stopping vtigercrm5 apache service" echo "" -bin\apache -n vtigercrm5_0 -k stop +bin\apache -n vtigercrm5 -k stop echo "" -echo "uninstalling vtigercrm5_0 apache service" +echo "uninstalling vtigercrm5 apache service" echo "" -bin\apache -k uninstall -n vtigercrm5_0 +bin\apache -k uninstall -n vtigercrm5 rem .\bin\ShutdownApache.exe logs\httpd.pid goto StopMySQL From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 06:15:07 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 13:15:07 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9071 - /vtigercrm/trunk/install/2setConfig.php Message-ID: <20060822131507.6C17C75E605@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 22 07:15:01 2006 New Revision: 9071 Log: rc removed Modified: vtigercrm/trunk/install/2setConfig.php Modified: vtigercrm/trunk/install/2setConfig.php ============================================================================== --- vtigercrm/trunk/install/2setConfig.php (original) +++ vtigercrm/trunk/install/2setConfig.php Tue Aug 22 07:15:01 2006 @@ -99,7 +99,7 @@ elseif (isset($dbconfig['db_name']) && $dbconfig['db_name']!='_DBC_NAME_') $db_name = $dbconfig['db_name']; else - $db_name = 'vtigercrm5_rc'; + $db_name = 'vtigercrm5'; !isset($_REQUEST['db_drop_tables']) ? $db_drop_tables = "0" : $db_drop_tables = $_REQUEST['db_drop_tables']; if (isset($_REQUEST['host_name'])) $host_name = $_REQUEST['host_name']; @@ -133,7 +133,7 @@ } else { !isset($_REQUEST['db_hostname']) ? $db_hostname = $hostname: $db_hostname = $_REQUEST['db_hostname']; - !isset($_REQUEST['db_name']) ? $db_name = "vtigercrm5_rc" : $db_name = $_REQUEST['db_name']; + !isset($_REQUEST['db_name']) ? $db_name = "vtigercrm5" : $db_name = $_REQUEST['db_name']; !isset($_REQUEST['db_drop_tables']) ? $db_drop_tables = "0" : $db_drop_tables = $_REQUEST['db_drop_tables']; !isset($_REQUEST['host_name']) ? $host_name= $hostname : $host_name= $_REQUEST['host_name']; !isset($_REQUEST['site_URL']) ? $site_URL = $web_root : $site_URL = $_REQUEST['site_URL']; From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 07:19:42 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 14:19:42 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9072 - /vtigercrm/trunk/modules/Products/language/en_us.lang.php Message-ID: <20060822141942.3A7D975E611@vtiger.fosslabs.com> Author: richie Date: Tue Aug 22 08:19:38 2006 New Revision: 9072 Log: * Modified the Product Code to Part Number because the fieldlabel in field table is Part Number Modified: vtigercrm/trunk/modules/Products/language/en_us.lang.php Modified: vtigercrm/trunk/modules/Products/language/en_us.lang.php ============================================================================== --- vtigercrm/trunk/modules/Products/language/en_us.lang.php (original) +++ vtigercrm/trunk/modules/Products/language/en_us.lang.php Tue Aug 22 08:19:38 2006 @@ -94,7 +94,7 @@ //Added for 4GA 'Product Name'=>'Product Name', -'Product Code'=>'Part Number', +'Part Number'=>'Part Number', 'Product Active'=>'Product Active', 'Commission Rate'=>'Commission Rate (%)', 'Qty/Unit'=>'Qty/Unit', From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 07:21:01 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 14:21:01 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9073 - /vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php Message-ID: <20060822142101.F170D75E612@vtiger.fosslabs.com> Author: richie Date: Tue Aug 22 08:20:57 2006 New Revision: 9073 Log: * Reverted the query from Part Number to Product Code because when we do migration in old db the fieldlable will be Product Code which is in where condition Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php ============================================================================== --- vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php (original) +++ vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php Tue Aug 22 08:20:57 2006 @@ -226,7 +226,7 @@ "UPDATE vtiger_field SET quickcreate = 0,quickcreatesequence = 3 WHERE tabid = 13 and fieldlabel = 'Priority'", "UPDATE vtiger_field SET quickcreate = 0,quickcreatesequence = 1 WHERE tabid = 14 and fieldlabel = 'Product Name'", - "UPDATE vtiger_field SET quickcreate = 0,quickcreatesequence = 2 WHERE tabid = 14 and fieldlabel = 'Part Number'", + "UPDATE vtiger_field SET quickcreate = 0,quickcreatesequence = 2 WHERE tabid = 14 and fieldlabel = 'Product Code'", "UPDATE vtiger_field SET quickcreate = 0,quickcreatesequence = 3 WHERE tabid = 14 and fieldlabel = 'Product Category'", "UPDATE vtiger_field SET quickcreate = 0,quickcreatesequence = 1 WHERE tabid = 16 and fieldlabel = 'Subject'", From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 09:46:24 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 16:46:24 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9074 - /vtigercrm/trunk/modules/Calendar/Activity.php Message-ID: <20060822164624.D821B75E621@vtiger.fosslabs.com> Author: richie Date: Tue Aug 22 10:46:17 2006 New Revision: 9074 Log: vtiger_ issue has been fixed --Jeri Modified: vtigercrm/trunk/modules/Calendar/Activity.php Modified: vtigercrm/trunk/modules/Calendar/Activity.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/Activity.php (original) +++ vtigercrm/trunk/modules/Calendar/Activity.php Tue Aug 22 10:46:17 2006 @@ -397,7 +397,7 @@ $log->debug("Entering get_tasksforol(".$username.") method ..."); $query = "select vtiger_activity.subject,vtiger_activity.date_start startdate, vtiger_activity.activityid as taskid,vtiger_activity.status, - vtiger_crmentity.description,vtiger_activity.priority as vtiger_priority,vtiger_activity.due_date as duedate, + vtiger_crmentity.description,vtiger_activity.priority as priority,vtiger_activity.due_date as duedate, vtiger_contactdetails.firstname, vtiger_contactdetails.lastname from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 10:39:08 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 17:39:08 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9075 - /vtigercrm/trunk/modules/Reports/ReportRun.php Message-ID: <20060822173909.0FBBB75E61F@vtiger.fosslabs.com> Author: richie Date: Tue Aug 22 11:39:00 2006 New Revision: 9075 Log: vtiger_ issue has been fixed --Jeri Modified: vtigercrm/trunk/modules/Reports/ReportRun.php Modified: vtigercrm/trunk/modules/Reports/ReportRun.php ============================================================================== --- vtigercrm/trunk/modules/Reports/ReportRun.php (original) +++ vtigercrm/trunk/modules/Reports/ReportRun.php Tue Aug 22 11:39:00 2006 @@ -893,7 +893,7 @@ left join vtiger_contactdetails as vtiger_contactdetailsProducts on vtiger_contactdetailsProducts.contactid = vtiger_products.contactid left join vtiger_vendor as vtiger_vendorRel on vtiger_vendorRel.vendorid = vtiger_products.vendor_id left join vtiger_crmentity as vtiger_crmentityRel on vtiger_crmentityRel.crmid = vtiger_seproductsrel.crmid - left join vtiger_account as vtiger_accountRel on vtiger_accountRel.accountid=crmentityRel.crmid + left join vtiger_account as vtiger_accountRel on vtiger_accountRel.accountid=vtiger_crmentityRel.crmid left join vtiger_leaddetails as vtiger_leaddetailsRel on vtiger_leaddetailsRel.leadid = vtiger_crmentityRel.crmid left join vtiger_potential as vtiger_potentialRel on vtiger_potentialRel.potentialid = vtiger_crmentityRel.crmid "; } From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 03:18:08 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 23 Aug 2006 10:18:08 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9076 - /vtigercrm/trunk/modules/Products/language/en_us.lang.php Message-ID: <20060823101808.D002775E6CE@vtiger.fosslabs.com> Author: saraj Date: Wed Aug 23 04:18:05 2006 New Revision: 9076 Log: * Modified the Part Number to Product Code as this entry is reverted as Product Code in field table Modified: vtigercrm/trunk/modules/Products/language/en_us.lang.php Modified: vtigercrm/trunk/modules/Products/language/en_us.lang.php ============================================================================== --- vtigercrm/trunk/modules/Products/language/en_us.lang.php (original) +++ vtigercrm/trunk/modules/Products/language/en_us.lang.php Wed Aug 23 04:18:05 2006 @@ -94,7 +94,7 @@ //Added for 4GA 'Product Name'=>'Product Name', -'Part Number'=>'Part Number', +'Product Code'=>'Part Number', 'Product Active'=>'Product Active', 'Commission Rate'=>'Commission Rate (%)', 'Qty/Unit'=>'Qty/Unit', From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 06:56:27 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 23 Aug 2006 13:56:27 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9077 - /vtigercrm/trunk/soap/wordplugin.php Message-ID: <20060823135627.6718175E6ED@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 07:56:13 2006 New Revision: 9077 Log: Security has been implemented --Jeri Modified: vtigercrm/trunk/soap/wordplugin.php Modified: vtigercrm/trunk/soap/wordplugin.php ============================================================================== --- vtigercrm/trunk/soap/wordplugin.php (original) +++ vtigercrm/trunk/soap/wordplugin.php Wed Aug 23 07:56:13 2006 @@ -1,341 +1,354 @@ -configureWSDL('vtigersoap'); - -$server->wsdl->addComplexType( - 'contact_column_detail', - 'complexType', - 'array', - '', - array( - 'email_address' => array('name'=>'email_address','type'=>'xsd:string'), - 'first_name' => array('name'=>'first_name','type'=>'xsd:string'), - 'last_name' => array('name'=>'last_name','type'=>'xsd:string'), - 'primary_address_city' => array('name'=>'primary_address_city','type'=>'xsd:string'), - 'account_name' => array('name'=>'account_name','type'=>'xsd:string'), - 'id' => array('name'=>'id','type'=>'xsd:string'), - 'salutation' => array('name'=>'salutation','type'=>'xsd:string'), - 'title'=> array('name'=>'title','type'=>'xsd:string'), - 'phone_mobile'=> array('name'=>'phone_mobile','type'=>'xsd:string'), - 'reports_to'=> array('name'=>'reports_to','type'=>'xsd:string'), - 'primary_address_city'=> array('name'=>'primary_address_city','type'=>'xsd:string'), - 'primary_address_street'=> array('name'=>'primary_address_street','type'=>'xsd:string'), - 'primary_address_state'=> array('name'=>'primary_address_state','type'=>'xsd:string'), - 'primary_address_postalcode'=> array('name'=>'primary_address_postalcode','type'=>'xsd:string'), - 'primary_address_country'=> array('name'=>'primary_address_country','type'=>'xsd:string'), - 'alt_address_city'=> array('name'=>'alt_address_city','type'=>'xsd:string'), - 'alt_address_street'=> array('name'=>'alt_address_street','type'=>'xsd:string'), - 'alt_address_state'=> array('name'=>'alt_address_state','type'=>'xsd:string'), - 'alt_address_postalcode'=> array('name'=>'alt_address_postalcode','type'=>'xsd:string'), - 'alt_address_country'=> array('name'=>'alt_address_country','type'=>'xsd:string'), - ) -); - -$server->wsdl->addComplexType( - 'account_column_detail', - 'complexType', - 'array', - '', - array( - 'accountid' => array('name'=>'accountid','type'=>'xsd:string'), - 'accountname' => array('name'=>'accountname','type'=>'xsd:string'), - 'parentid' => array('name'=>'parentid','type'=>'xsd:string'), - 'account_type' => array('name'=>'account_type','type'=>'xsd:string'), - 'industry' => array('name'=>'industry','type'=>'xsd:string'), - 'annualrevenue' => array('name'=>'annualrevenue','type'=>'xsd:string'), - 'rating'=> array('name'=>'rating','type'=>'xsd:string'), - 'ownership' => array('name'=>'ownership','type'=>'xsd:string'), - 'siccode' => array('name'=>'siccode','type'=>'xsd:string'), - 'tickersymbol' => array('name'=>'tickersymbol','type'=>'xsd:string'), - 'phone' => array('name'=>'phone','type'=>'xsd:string'), - 'otherphone' => array('name'=>'otherphone','type'=>'xsd:string'), - 'email1' => array('name'=>'email1','type'=>'xsd:string'), - 'email2' => array('name'=>'email2','type'=>'xsd:string'), - 'website' => array('name'=>'website','type'=>'xsd:string'), - 'fax' => array('name'=>'fax','type'=>'xsd:string'), - //'employees' => array('name'=>'employees','type'=>'xsd:string'), - ) -); - -$server->wsdl->addComplexType( - 'lead_column_detail', - 'complexType', - 'array', - '', - array( - 'id' => array('name'=>'id','type'=>'xsd:string'), - 'date_entered' => array('name'=>'date_entered','type'=>'xsd:string'), - 'date_modified' => array('name'=>'date_modified','type'=>'xsd:string'), - 'modified_user_id' => array('name'=>'modified_user_id','type'=>'xsd:string'), - 'assigned_user_id' => array('name'=>'assigned_user_id','type'=>'xsd:string'), - 'salutation' => array('name'=>'salutation','type'=>'xsd:string'), - 'first_name' => array('name'=>'first_name','type'=>'xsd:string'), - 'last_name' => array('name'=>'last_name','type'=>'xsd:string'), - 'company' => array('name'=>'company','type'=>'xsd:string'), - 'designation' => array('name'=>'designation','type'=>'xsd:string'), - 'lead_source' => array('name'=>'lead_source','type'=>'xsd:string'), - 'industry' => array('name'=>'industry','type'=>'xsd:string'), - 'annual_revenue' => array('name'=>'annual_revenue','type'=>'xsd:string'), - 'license_key' => array('name'=>'license_key','type'=>'xsd:string'), - 'phone' => array('name'=>'phone','type'=>'xsd:string'), - 'mobile' => array('name'=>'mobile','type'=>'xsd:string'), - 'fax' => array('name'=>'fax','type'=>'xsd:string'), - 'email' => array('name'=>'email','type'=>'xsd:string'), - 'yahoo_id' => array('name'=>'yahoo_id','type'=>'xsd:string'), - 'website' => array('name'=>'website','type'=>'xsd:string'), - 'lead_status' => array('name'=>'lead_status','type'=>'xsd:string'), - 'rating' => array('name'=>'rating','type'=>'xsd:string'), - 'employees' => array('name'=>'employees','type'=>'xsd:string'), - 'address_street' => array('name'=>'address_street','type'=>'xsd:string'), - 'address_city' => array('name'=>'address_city','type'=>'xsd:string'), - 'address_state' => array('name'=>'address_state','type'=>'xsd:string'), - 'address_postalcode' => array('name'=>'address_postalcode','type'=>'xsd:string'), - 'address_country' => array('name'=>'address_country','type'=>'xsd:string'), - 'description' => array('name'=>'description','type'=>'xsd:string'), - 'deleted' => array('name'=>'deleted','type'=>'xsd:string'), - 'converted' => array('name'=>'converted','type'=>'xsd:string'), - ) -); - -$server->wsdl->addComplexType( - 'user_column_detail', - 'complexType', - 'array', - '', - array( - 'firstname' => array('name'=>'firstname','type'=>'xsd:string'), - 'lastname' => array('name'=>'lastname','type'=>'xsd:string'), - 'username' => array('name'=>'username','type'=>'xsd:string'), - 'yahooid' => array('name'=>'yahooid','type'=>'xsd:string'), - 'title' => array('name'=>'title','type'=>'xsd:string'), - 'workphone' => array('name'=>'workphone','type'=>'xsd:string'), - 'department' => array('name'=>'department','type'=>'xsd:string'), - 'mobilephone' => array('name'=>'mobilephone','type'=>'xsd:string'), - 'otherphone'=> array('name'=>'otherphone','type'=>'xsd:string'), - 'fax' => array('name'=>'fax','type'=>'xsd:string'), - 'email' => array('name'=>'email','type'=>'xsd:string'), - 'homephone' => array('name'=>'homephone','type'=>'xsd:string'), - 'otheremail' => array('name'=>'otheremail','type'=>'xsd:string'), - 'street' => array('name'=>'street','type'=>'xsd:string'), - 'city' => array('name'=>'city','type'=>'xsd:string'), - 'state' => array('name'=>'state','type'=>'xsd:string'), - 'code' => array('name'=>'code','type'=>'xsd:string'), - 'country' => array('name'=>'country','type'=>'xsd:string'), - ) -); - -$server->wsdl->addComplexType( - 'tickets_list_array', - 'complexType', - 'array', - '', - array( - 'ticketid' => array('name'=>'ticketid','type'=>'xsd:string'), - 'title' => array('name'=>'title','type'=>'xsd:string'), - 'groupname' => array('name'=>'groupname','type'=>'xsd:string'), - 'firstname' => array('name'=>'firstname','type'=>'xsd:string'), - 'lastname' => array('name'=>'lastname','type'=>'xsd:string'), - 'parent_id' => array('name'=>'parent_id','type'=>'xsd:string'), - 'productid' => array('name'=>'productid','type'=>'xsd:string'), - 'productname' => array('name'=>'productname','type'=>'xsd:string'), - 'priority' => array('name'=>'priority','type'=>'xsd:string'), - 'severity' => array('name'=>'severity','type'=>'xsd:string'), - 'status' => array('name'=>'status','type'=>'xsd:string'), - 'category' => array('name'=>'category','type'=>'xsd:string'), - 'description' => array('name'=>'description','type'=>'xsd:string'), - 'solution' => array('name'=>'solution','type'=>'xsd:string'), - 'createdtime' => array('name'=>'createdtime','type'=>'xsd:string'), - 'modifiedtime' => array('name'=>'modifiedtime','type'=>'xsd:string'), - ) -); - -$server->register( - 'get_contacts_columns', - array('user_name'=>'xsd:string','password'=>'xsd:string'), - array('return'=>'tns:contact_column_detail'), - $NAMESPACE); - -$server->register( - 'get_accounts_columns', - array('user_name'=>'xsd:string','password'=>'xsd:string'), - array('return'=>'tns:account_column_detail'), - $NAMESPACE); - -$server->register( - 'get_leads_columns', - array('user_name'=>'xsd:string','password'=>'xsd:string'), - array('return'=>'tns:lead_column_detail'), - $NAMESPACE); - -$server->register( - 'get_user_columns', - array('user_name'=>'xsd:string','password'=>'xsd:string'), - array('return'=>'tns:user_column_detail'), - $NAMESPACE); - -$server->register( - 'get_tickets_columns', - array('user_name'=>'xsd:string','password'=>'xsd:string'), - array('return'=>'tns:tickets_list_array'), - $NAMESPACE); - -$server->register( - 'create_session', - array('user_name'=>'xsd:string','password'=>'xsd:string'), - array('return'=>'xsd:string'), - $NAMESPACE); - -$server->register( - 'end_session', - array('user_name'=>'xsd:string'), - array('return'=>'xsd:string'), - $NAMESPACE); - - -function get_tickets_columns($user_name, $password) -{ - global $current_user; - require_once("modules/Users/User.php"); - $seed_user=new User(); - $user_id=$seed_user->retrieve_user_id($user_name); - $current_user=$seed_user; - $current_user->retrieve_entity_info($user_id, 'Users'); - if(isPermitted("HelpDesk","index") == "yes") - { - require_once('modules/HelpDesk/HelpDesk.php'); - $helpdesk = new HelpDesk(); - return $helpdesk->getColumnNames_Hd(); - } - else - return null; -} - -function get_contacts_columns($user_name, $password) -{ - global $current_user; - require_once("modules/Users/User.php"); - $seed_user=new User(); - $user_id=$seed_user->retrieve_user_id($user_name); - $current_user=$seed_user; - $current_user->retrieve_entity_info($user_id, 'Users'); - if(isPermitted("Contacts","index") == "yes") - { - require_once('modules/Contacts/Contact.php'); - $contact = new Contact(); - return $contact->getColumnNames(); - } - else - return null; - -} - - -function get_accounts_columns($user_name, $password) -{ - global $current_user; - require_once("modules/Users/User.php"); - $seed_user=new User(); - $user_id=$seed_user->retrieve_user_id($user_name); - $current_user=$seed_user; - $current_user->retrieve_entity_info($user_id, 'Users'); - if(isPermitted("Accounts","index") == "yes") - { - require_once('modules/Accounts/Account.php'); - $account = new Account(); - return $account->getColumnNames_Acnt(); - } - else - return null; - -} - - -function get_leads_columns($user_name, $password) -{ - global $current_user; - require_once("modules/Users/User.php"); - $seed_user=new User(); - $user_id=$seed_user->retrieve_user_id($user_name); - $current_user=$seed_user; - $current_user->retrieve_entity_info($user_id, 'Users'); - - if(isPermitted("Leads","index") == "yes") - { - require_once('modules/Leads/Lead.php'); - $lead = new Lead(); - return $lead->getColumnNames_Lead(); - } - else - return null; -} - -function get_user_columns($user_name, $password) -{ - global $current_user; - require_once('modules/Users/User.php'); - $seed_user=new User(); - $user_id=$seed_user->retrieve_user_id($user_name); - $current_user=$seed_user; - $current_user->retrieve_entity_info($user_id, 'Users'); - if(isPermitted("Users","index") == "yes") - { - $user = new User(); - return $user->getColumnNames_User(); - } - else - return null; -} - - -function create_session($user_name, $password) -{ - global $adb; - require_once('modules/Users/User.php'); - $objuser = new User(); - if($password != "" && $user_name != '') - { - $objuser->column_fields['user_name'] = $user_name; - $objuser->load_user($password); - if($objuser->is_authenticated()) - { - return "TempSessionID"; - }else - { - return "false"; - } - }else - { - return "false"; - } -} - -function end_session($user_name) -{ - return "Success"; -} - - - - -$server->service($HTTP_RAW_POST_DATA); -exit(); -?> +configureWSDL('vtigersoap'); + +$server->wsdl->addComplexType( + 'contact_column_detail', + 'complexType', + 'array', + '', + array( + 'email_address' => array('name'=>'email_address','type'=>'xsd:string'), + 'first_name' => array('name'=>'first_name','type'=>'xsd:string'), + 'last_name' => array('name'=>'last_name','type'=>'xsd:string'), + 'primary_address_city' => array('name'=>'primary_address_city','type'=>'xsd:string'), + 'account_name' => array('name'=>'account_name','type'=>'xsd:string'), + 'id' => array('name'=>'id','type'=>'xsd:string'), + 'salutation' => array('name'=>'salutation','type'=>'xsd:string'), + 'title'=> array('name'=>'title','type'=>'xsd:string'), + 'phone_mobile'=> array('name'=>'phone_mobile','type'=>'xsd:string'), + 'reports_to'=> array('name'=>'reports_to','type'=>'xsd:string'), + 'primary_address_city'=> array('name'=>'primary_address_city','type'=>'xsd:string'), + 'primary_address_street'=> array('name'=>'primary_address_street','type'=>'xsd:string'), + 'primary_address_state'=> array('name'=>'primary_address_state','type'=>'xsd:string'), + 'primary_address_postalcode'=> array('name'=>'primary_address_postalcode','type'=>'xsd:string'), + 'primary_address_country'=> array('name'=>'primary_address_country','type'=>'xsd:string'), + 'alt_address_city'=> array('name'=>'alt_address_city','type'=>'xsd:string'), + 'alt_address_street'=> array('name'=>'alt_address_street','type'=>'xsd:string'), + 'alt_address_state'=> array('name'=>'alt_address_state','type'=>'xsd:string'), + 'alt_address_postalcode'=> array('name'=>'alt_address_postalcode','type'=>'xsd:string'), + 'alt_address_country'=> array('name'=>'alt_address_country','type'=>'xsd:string'), + ) +); + +$server->wsdl->addComplexType( + 'account_column_detail', + 'complexType', + 'array', + '', + array( + 'accountid' => array('name'=>'accountid','type'=>'xsd:string'), + 'accountname' => array('name'=>'accountname','type'=>'xsd:string'), + 'parentid' => array('name'=>'parentid','type'=>'xsd:string'), + 'account_type' => array('name'=>'account_type','type'=>'xsd:string'), + 'industry' => array('name'=>'industry','type'=>'xsd:string'), + 'annualrevenue' => array('name'=>'annualrevenue','type'=>'xsd:string'), + 'rating'=> array('name'=>'rating','type'=>'xsd:string'), + 'ownership' => array('name'=>'ownership','type'=>'xsd:string'), + 'siccode' => array('name'=>'siccode','type'=>'xsd:string'), + 'tickersymbol' => array('name'=>'tickersymbol','type'=>'xsd:string'), + 'phone' => array('name'=>'phone','type'=>'xsd:string'), + 'otherphone' => array('name'=>'otherphone','type'=>'xsd:string'), + 'email1' => array('name'=>'email1','type'=>'xsd:string'), + 'email2' => array('name'=>'email2','type'=>'xsd:string'), + 'website' => array('name'=>'website','type'=>'xsd:string'), + 'fax' => array('name'=>'fax','type'=>'xsd:string'), + //'employees' => array('name'=>'employees','type'=>'xsd:string'), + ) +); + +$server->wsdl->addComplexType( + 'lead_column_detail', + 'complexType', + 'array', + '', + array( + 'id' => array('name'=>'id','type'=>'xsd:string'), + 'date_entered' => array('name'=>'date_entered','type'=>'xsd:string'), + 'date_modified' => array('name'=>'date_modified','type'=>'xsd:string'), + 'modified_user_id' => array('name'=>'modified_user_id','type'=>'xsd:string'), + 'assigned_user_id' => array('name'=>'assigned_user_id','type'=>'xsd:string'), + 'salutation' => array('name'=>'salutation','type'=>'xsd:string'), + 'first_name' => array('name'=>'first_name','type'=>'xsd:string'), + 'last_name' => array('name'=>'last_name','type'=>'xsd:string'), + 'company' => array('name'=>'company','type'=>'xsd:string'), + 'designation' => array('name'=>'designation','type'=>'xsd:string'), + 'lead_source' => array('name'=>'lead_source','type'=>'xsd:string'), + 'industry' => array('name'=>'industry','type'=>'xsd:string'), + 'annual_revenue' => array('name'=>'annual_revenue','type'=>'xsd:string'), + 'license_key' => array('name'=>'license_key','type'=>'xsd:string'), + 'phone' => array('name'=>'phone','type'=>'xsd:string'), + 'mobile' => array('name'=>'mobile','type'=>'xsd:string'), + 'fax' => array('name'=>'fax','type'=>'xsd:string'), + 'email' => array('name'=>'email','type'=>'xsd:string'), + 'yahoo_id' => array('name'=>'yahoo_id','type'=>'xsd:string'), + 'website' => array('name'=>'website','type'=>'xsd:string'), + 'lead_status' => array('name'=>'lead_status','type'=>'xsd:string'), + 'rating' => array('name'=>'rating','type'=>'xsd:string'), + 'employees' => array('name'=>'employees','type'=>'xsd:string'), + 'address_street' => array('name'=>'address_street','type'=>'xsd:string'), + 'address_city' => array('name'=>'address_city','type'=>'xsd:string'), + 'address_state' => array('name'=>'address_state','type'=>'xsd:string'), + 'address_postalcode' => array('name'=>'address_postalcode','type'=>'xsd:string'), + 'address_country' => array('name'=>'address_country','type'=>'xsd:string'), + 'description' => array('name'=>'description','type'=>'xsd:string'), + 'deleted' => array('name'=>'deleted','type'=>'xsd:string'), + 'converted' => array('name'=>'converted','type'=>'xsd:string'), + ) +); + +$server->wsdl->addComplexType( + 'user_column_detail', + 'complexType', + 'array', + '', + array( + 'firstname' => array('name'=>'firstname','type'=>'xsd:string'), + 'lastname' => array('name'=>'lastname','type'=>'xsd:string'), + 'username' => array('name'=>'username','type'=>'xsd:string'), + 'yahooid' => array('name'=>'yahooid','type'=>'xsd:string'), + 'title' => array('name'=>'title','type'=>'xsd:string'), + 'workphone' => array('name'=>'workphone','type'=>'xsd:string'), + 'department' => array('name'=>'department','type'=>'xsd:string'), + 'mobilephone' => array('name'=>'mobilephone','type'=>'xsd:string'), + 'otherphone'=> array('name'=>'otherphone','type'=>'xsd:string'), + 'fax' => array('name'=>'fax','type'=>'xsd:string'), + 'email' => array('name'=>'email','type'=>'xsd:string'), + 'homephone' => array('name'=>'homephone','type'=>'xsd:string'), + 'otheremail' => array('name'=>'otheremail','type'=>'xsd:string'), + 'street' => array('name'=>'street','type'=>'xsd:string'), + 'city' => array('name'=>'city','type'=>'xsd:string'), + 'state' => array('name'=>'state','type'=>'xsd:string'), + 'code' => array('name'=>'code','type'=>'xsd:string'), + 'country' => array('name'=>'country','type'=>'xsd:string'), + ) +); + +$server->wsdl->addComplexType( + 'tickets_list_array', + 'complexType', + 'array', + '', + array( + 'ticketid' => array('name'=>'ticketid','type'=>'xsd:string'), + 'title' => array('name'=>'title','type'=>'xsd:string'), + 'groupname' => array('name'=>'groupname','type'=>'xsd:string'), + 'firstname' => array('name'=>'firstname','type'=>'xsd:string'), + 'lastname' => array('name'=>'lastname','type'=>'xsd:string'), + 'parent_id' => array('name'=>'parent_id','type'=>'xsd:string'), + 'productid' => array('name'=>'productid','type'=>'xsd:string'), + 'productname' => array('name'=>'productname','type'=>'xsd:string'), + 'priority' => array('name'=>'priority','type'=>'xsd:string'), + 'severity' => array('name'=>'severity','type'=>'xsd:string'), + 'status' => array('name'=>'status','type'=>'xsd:string'), + 'category' => array('name'=>'category','type'=>'xsd:string'), + 'description' => array('name'=>'description','type'=>'xsd:string'), + 'solution' => array('name'=>'solution','type'=>'xsd:string'), + 'createdtime' => array('name'=>'createdtime','type'=>'xsd:string'), + 'modifiedtime' => array('name'=>'modifiedtime','type'=>'xsd:string'), + ) +); + +$server->register( + 'get_contacts_columns', + array('user_name'=>'xsd:string','password'=>'xsd:string'), + array('return'=>'tns:contact_column_detail'), + $NAMESPACE); + +$server->register( + 'get_accounts_columns', + array('user_name'=>'xsd:string','password'=>'xsd:string'), + array('return'=>'tns:account_column_detail'), + $NAMESPACE); + +$server->register( + 'get_leads_columns', + array('user_name'=>'xsd:string','password'=>'xsd:string'), + array('return'=>'tns:lead_column_detail'), + $NAMESPACE); + +$server->register( + 'get_user_columns', + array('user_name'=>'xsd:string','password'=>'xsd:string'), + array('return'=>'tns:user_column_detail'), + $NAMESPACE); + +$server->register( + 'get_tickets_columns', + array('user_name'=>'xsd:string','password'=>'xsd:string'), + array('return'=>'tns:tickets_list_array'), + $NAMESPACE); + +$server->register( + 'create_session', + array('user_name'=>'xsd:string','password'=>'xsd:string'), + array('return'=>'xsd:string'), + $NAMESPACE); + +$server->register( + 'end_session', + array('user_name'=>'xsd:string'), + array('return'=>'xsd:string'), + $NAMESPACE); + + +function get_tickets_columns($user_name, $password) +{ + global $current_user,$log; + require_once("modules/Users/User.php"); + $seed_user=new User(); + $user_id=$seed_user->retrieve_user_id($user_name); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + if(isPermitted("HelpDesk","index") == "yes") + { + require_once('modules/HelpDesk/HelpDesk.php'); + $helpdesk = new HelpDesk(); + $log->debug($helpdesk->getColumnNames_Hd()); + return $helpdesk->getColumnNames_Hd(); + } + else + { + $return_array = array(); + return $return_array; + } +} + +function get_contacts_columns($user_name, $password) +{ + global $current_user,$log; + require_once("modules/Users/User.php"); + $seed_user=new User(); + $user_id=$seed_user->retrieve_user_id($user_name); + $current_user = $seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + if(isPermitted("Contacts","index") == "yes") + { + require_once('modules/Contacts/Contact.php'); + $contact = new Contact(); + $log->debug($contact->getColumnNames()); + return $contact->getColumnNames(); + } + else + { + $return_array = array(); + return $return_array; + } + +} + + +function get_accounts_columns($user_name, $password) +{ + global $current_user,$log; + require_once("modules/Users/User.php"); + $seed_user=new User(); + $user_id=$seed_user->retrieve_user_id($user_name); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + if(isPermitted("Accounts","index") == "yes") + { + require_once('modules/Accounts/Account.php'); + $account = new Account(); + $log->debug($account->getColumnNames_Acnt()); + return $account->getColumnNames_Acnt(); + } + else + { + $return_array = array(); + return $return_array; + } + +} + + +function get_leads_columns($user_name, $password) +{ + global $current_user,$log; + require_once("modules/Users/User.php"); + $seed_user=new User(); + $user_id=$seed_user->retrieve_user_id($user_name); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + + if(isPermitted("Leads","index") == "yes") + { + require_once('modules/Leads/Lead.php'); + $lead = new Lead(); + $log->debug($lead->getColumnNames_Lead()); + return $lead->getColumnNames_Lead(); + } + else + { + $return_array = array(); + return $return_array; + } + +} + +function get_user_columns($user_name, $password) +{ + global $current_user; + require_once('modules/Users/User.php'); + $seed_user=new User(); + $user_id=$seed_user->retrieve_user_id($user_name); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + $user = new User(); + return $user->getColumnNames_User(); + +} + + +function create_session($user_name, $password) +{ + global $adb; + require_once('modules/Users/User.php'); + $objuser = new User(); + if($password != "" && $user_name != '') + { + $objuser->column_fields['user_name'] = $user_name; + $objuser->load_user($password); + if($objuser->is_authenticated()) + { + return "TempSessionID"; + }else + { + return "false"; + } + }else + { + return "false"; + } +} + +function end_session($user_name) +{ + return "Success"; +} + + + + +$server->service($HTTP_RAW_POST_DATA); +exit(); +?> From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 07:01:35 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 23 Aug 2006 14:01:35 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9078 - in /vtigercrm/trunk/modules: Accounts/Account.php Contacts/Contact.php HelpDesk/HelpDesk.php Leads/Lead.php Message-ID: <20060823140135.0FAFE75E6EF@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 08:00:50 2006 New Revision: 9078 Log: Security implemented for WordPlugin Modified: vtigercrm/trunk/modules/Accounts/Account.php vtigercrm/trunk/modules/Contacts/Contact.php vtigercrm/trunk/modules/HelpDesk/HelpDesk.php vtigercrm/trunk/modules/Leads/Lead.php Modified: vtigercrm/trunk/modules/Accounts/Account.php ============================================================================== --- vtigercrm/trunk/modules/Accounts/Account.php (original) +++ vtigercrm/trunk/modules/Accounts/Account.php Wed Aug 23 08:00:50 2006 @@ -1,743 +1,751 @@ -'crmid','vtiger_account'=>'accountid','vtiger_accountbillads'=>'accountaddressid','vtiger_accountshipads'=>'accountaddressid','vtiger_accountscf'=>'accountid'); - - var $entity_table = "vtiger_crmentity"; - - var $billadr_table = "vtiger_accountbillads"; - - var $object_name = "Accounts"; - // Mike Crowe Mod --------------------------------------------------------added for general search - var $base_table_name = "vtiger_account"; - var $cf_table_name = "vtiger_accountscf"; - - var $new_schema = true; - - var $module_id = "accountid"; - - var $column_fields = Array(); - - var $sortby_fields = Array('accountname','city','website','phone','smownerid'); - - - // This is the list of vtiger_fields that are in the lists. - var $list_fields = Array( - 'Account Name'=>Array('vtiger_account'=>'accountname'), - 'City'=>Array('vtiger_accountbillads'=>'city'), - 'Website'=>Array('vtiger_account'=>'website'), - 'Phone'=>Array('vtiger_account'=> 'phone'), - 'Assigned To'=>Array('vtiger_crmentity'=>'smownerid') - ); - - var $list_fields_name = Array( - 'Account Name'=>'accountname', - 'City'=>'bill_city', - 'Website'=>'website', - 'Phone'=>'phone', - 'Assigned To'=>'assigned_user_id' - ); - var $list_link_field= 'accountname'; - - var $search_fields = Array( - 'Account Name'=>Array('vtiger_account'=>'accountname'), - 'City'=>Array('vtiger_accountbillads'=>'city'), - ); - - var $search_fields_name = Array( - 'Account Name'=>'accountname', - 'City'=>'bill_city', - ); - - // This is the list of vtiger_fields that are required. - var $required_fields = array("accountname"=>1); - - //Added these variables which are used as default order by and sortorder in ListView - var $default_order_by = 'accountname'; - var $default_sort_order = 'ASC'; - - function Account() { - $this->log =LoggerManager::getLogger('account'); - $this->db = new PearDatabase(); - $this->column_fields = getColumnFields('Accounts'); - } - - // Mike Crowe Mod --------------------------------------------------------Default ordering for us - /** - * Function to get sort order - * return string $sorder - sortorder string either 'ASC' or 'DESC' - */ - function getSortOrder() - { - global $log; - $log->debug("Entering getSortOrder() method ..."); - if(isset($_REQUEST['sorder'])) - $sorder = $_REQUEST['sorder']; - else - $sorder = (($_SESSION['ACCOUNTS_SORT_ORDER'] != '')?($_SESSION['ACCOUNTS_SORT_ORDER']):($this->default_sort_order)); - $log->debug("Exiting getSortOrder() method ..."); - return $sorder; - } - /** - * Function to get order by - * return string $order_by - fieldname(eg: 'accountname') - */ - function getOrderBy() - { - global $log; - $log->debug("Entering getOrderBy() method ..."); - if (isset($_REQUEST['order_by'])) - $order_by = $_REQUEST['order_by']; - else - $order_by = (($_SESSION['ACCOUNTS_ORDER_BY'] != '')?($_SESSION['ACCOUNTS_ORDER_BY']):($this->default_order_by)); - $log->debug("Exiting getOrderBy method ..."); - return $order_by; - } - // Mike Crowe Mod -------------------------------------------------------- - - - /** Returns a list of the associated contacts - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function get_contacts($id) - { - global $log; - $log->debug("Entering get_contacts(".$id.") method ..."); - global $mod_strings; - - $focus = new Contact(); - - $button = ''; - if(isPermitted("Contacts",1,"") == 'yes') - { - $button .= ' '; - } - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - //SQL - $query = "SELECT vtiger_contactdetails.*, - vtiger_crmentity.crmid, - vtiger_crmentity.smownerid, - vtiger_users.user_name - FROM vtiger_contactdetails - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_contactdetails.contactid - LEFT JOIN vtiger_contactgrouprelation - ON vtiger_contactdetails.contactid = vtiger_contactgrouprelation.contactid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id - WHERE vtiger_crmentity.deleted = 0 - AND vtiger_contactdetails.accountid = ".$id; - $log->debug("Exiting get_contacts method ..."); - return GetRelatedList('Accounts','Contacts',$focus,$query,$button,$returnset); - } - - /** Returns a list of the associated opportunities - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function get_opportunities($id) - { - global $log; - $log->debug("Entering get_opportunities(".$id.") method ..."); - global $mod_strings; - - $focus = new Potential(); - $button = ''; - - if(isPermitted("Potentials",1,"") == 'yes') - { - $button .= ''; - } - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_potential.potentialid, vtiger_potential.accountid, - vtiger_potential.potentialname, vtiger_potential.sales_stage, - vtiger_potential.potentialtype, vtiger_potential.amount, - vtiger_potential.closingdate, vtiger_potential.potentialtype, - vtiger_users.user_name, - vtiger_crmentity.crmid, vtiger_crmentity.smownerid - FROM vtiger_potential - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_potential.potentialid - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id - LEFT JOIN vtiger_potentialgrouprelation - ON vtiger_potential.potentialid = vtiger_potentialgrouprelation.potentialid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_potentialgrouprelation.groupname - WHERE vtiger_crmentity.deleted = 0 - AND vtiger_potential.accountid = ".$id; - $log->debug("Exiting get_opportunities method ..."); - - return GetRelatedList('Accounts','Potentials',$focus,$query,$button,$returnset); - } - - /** Returns a list of the associated tasks - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function get_activities($id) - { - global $log; - $log->debug("Entering get_activities(".$id.") method ..."); - global $mod_strings; - - $focus = new Activity(); - $button = ''; - if(isPermitted("Calendar",1,"") == 'yes') - { - - $button .= ' '; - $button .= ' '; - } - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_activity.*, - vtiger_seactivityrel.*, - vtiger_crmentity.crmid, vtiger_crmentity.smownerid, - vtiger_crmentity.modifiedtime, - vtiger_users.user_name, - vtiger_recurringevents.recurringtype - FROM vtiger_activity - INNER JOIN vtiger_seactivityrel - ON vtiger_seactivityrel.activityid = vtiger_activity.activityid - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_activity.activityid - LEFT JOIN vtiger_users - ON vtiger_users.id = vtiger_crmentity.smownerid - LEFT OUTER JOIN vtiger_recurringevents - ON vtiger_recurringevents.activityid = vtiger_activity.activityid - LEFT JOIN vtiger_activitygrouprelation - ON vtiger_activitygrouprelation.activityid = vtiger_crmentity.crmid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_activitygrouprelation.groupname - WHERE vtiger_seactivityrel.crmid = ".$id." - AND (activitytype='Task' - OR activitytype='Call' - OR activitytype='Meeting') - AND vtiger_crmentity.deleted = 0 - AND ((vtiger_activity.status IS NOT NULL - AND vtiger_activity.status != 'Completed') - AND (vtiger_activity.status IS NOT NULL - AND vtiger_activity.status != 'Deferred') - OR (vtiger_activity.eventstatus !='' - AND vtiger_activity.eventstatus != 'Held'))"; - $log->debug("Exiting get_activities method ..."); - return GetRelatedList('Accounts','Calendar',$focus,$query,$button,$returnset); - - } - /** - * Function to get Account related Task & Event which have activity type Held, Completed or Deferred. - * @param integer $id - accountid - * returns related Task or Event record in array format - */ - function get_history($id) - { - global $log; - $log->debug("Entering get_history(".$id.") method ..."); - $query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, - vtiger_activity.status, vtiger_activity.eventstatus, - vtiger_activity.activitytype, - vtiger_crmentity.modifiedtime, vtiger_crmentity.createdtime, - vtiger_crmentity.description, - vtiger_users.user_name - FROM vtiger_activity - INNER JOIN vtiger_seactivityrel - ON vtiger_seactivityrel.activityid = vtiger_activity.activityid - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_activity.activityid - LEFT JOIN vtiger_activitygrouprelation - ON vtiger_activitygrouprelation.activityid = vtiger_activity.activityid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_activitygrouprelation.groupname - INNER JOIN vtiger_users - ON vtiger_crmentity.smcreatorid = vtiger_users.id - WHERE (vtiger_activity.activitytype = 'Meeting' - OR vtiger_activity.activitytype = 'Call' - OR vtiger_activity.activitytype = 'Task') - AND (vtiger_activity.status = 'Completed' - OR vtiger_activity.status = 'Deferred' - OR (vtiger_activity.eventstatus = 'Held' - AND vtiger_activity.eventstatus != '')) - AND vtiger_seactivityrel.crmid = ".$id; - //Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php - $log->debug("Exiting get_history method ..."); - return getHistory('Accounts',$query,$id); - } - /** - * Function to get Account related Attachments - * @param integer $id - accountid - * returns related Attachment record in array format - */ - function get_attachments($id) - { - global $log; - $log->debug("Entering get_attachments(".$id.") method ..."); - // Armando L?scher 18.10.2005 -> ?visibleDescription - // Desc: Inserted crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name - // Inserted inner join vtiger_users on crm2.smcreatorid= vtiger_users.id - $query = "SELECT vtiger_notes.title, vtiger_notes.notecontent AS description, - vtiger_notes.filename, vtiger_notes.notesid AS crmid, - 'Notes ' AS ActivityType, - vtiger_attachments.type AS FileType, - crm2.modifiedtime AS lastmodified, crm2.createdtime, - vtiger_seattachmentsrel.attachmentsid, - vtiger_users.user_name - FROM vtiger_notes - INNER JOIN vtiger_senotesrel - ON vtiger_senotesrel.notesid = vtiger_notes.notesid - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_senotesrel.crmid - INNER JOIN vtiger_crmentity crm2 - ON crm2.crmid = vtiger_notes.notesid - AND crm2.deleted = 0 - LEFT JOIN vtiger_seattachmentsrel - ON vtiger_seattachmentsrel.crmid = vtiger_notes.notesid - LEFT JOIN vtiger_attachments - ON vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid - INNER JOIN vtiger_users - ON crm2.smcreatorid = vtiger_users.id - WHERE vtiger_crmentity.crmid = ".$id." - UNION ALL - SELECT vtiger_attachments.description AS title, vtiger_attachments.description, - vtiger_attachments.name AS filename, - vtiger_seattachmentsrel.attachmentsid AS crmid, - 'Attachments' AS ActivityType, - vtiger_attachments.type AS FileType, - crm2.modifiedtime AS lastmodified, crm2.createdtime, - vtiger_attachments.attachmentsid, - vtiger_users.user_name - FROM vtiger_attachments - INNER JOIN vtiger_seattachmentsrel - ON vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_seattachmentsrel.crmid - INNER JOIN vtiger_crmentity crm2 - ON crm2.crmid = vtiger_attachments.attachmentsid - INNER JOIN vtiger_users - ON crm2.smcreatorid = vtiger_users.id - WHERE vtiger_crmentity.crmid = ".$id." - ORDER BY createdtime DESC"; - $log->debug("Exiting get_attachments method ..."); - return getAttachmentsAndNotes('Accounts',$query,$id); - } - /** - * Function to get Account related Quotes - * @param integer $id - accountid - * returns related Quotes record in array format - */ - function get_quotes($id) - { - global $log; - $log->debug("Entering get_quotes(".$id.") method ..."); - global $app_strings; - require_once('modules/Quotes/Quote.php'); - - $focus = new Quote(); - - $button = ''; - if(isPermitted("Quotes",1,"") == 'yes') - { - $button .= ' '; - } - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_users.user_name, - vtiger_groups.groupname, - vtiger_crmentity.*, - vtiger_quotes.*, - vtiger_potential.potentialname, - vtiger_account.accountname - FROM vtiger_quotes - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_quotes.quoteid - LEFT OUTER JOIN vtiger_account - ON vtiger_account.accountid = vtiger_quotes.accountid - LEFT OUTER JOIN vtiger_potential - ON vtiger_potential.potentialid = vtiger_quotes.potentialid - LEFT JOIN vtiger_quotegrouprelation - ON vtiger_quotes.quoteid = vtiger_quotegrouprelation.quoteid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_quotegrouprelation.groupname - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id - WHERE vtiger_crmentity.deleted = 0 - AND vtiger_account.accountid = ".$id; - $log->debug("Exiting get_quotes method ..."); - return GetRelatedList('Accounts','Quotes',$focus,$query,$button,$returnset); - } - /** - * Function to get Account related Invoices - * @param integer $id - accountid - * returns related Invoices record in array format - */ - function get_invoices($id) - { - global $log; - $log->debug("Entering get_invoices(".$id.") method ..."); - global $app_strings; - require_once('modules/Invoice/Invoice.php'); - - $focus = new Invoice(); - - $button = ''; - if(isPermitted("Invoice",1,"") == 'yes') - { - $button .= ' '; - } - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_users.user_name, - vtiger_groups.groupname, - vtiger_crmentity.*, - vtiger_invoice.*, - vtiger_account.accountname, - vtiger_salesorder.subject AS salessubject - FROM vtiger_invoice - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_invoice.invoiceid - LEFT OUTER JOIN vtiger_account - ON vtiger_account.accountid = vtiger_invoice.accountid - LEFT OUTER JOIN vtiger_salesorder - ON vtiger_salesorder.salesorderid = vtiger_invoice.salesorderid - LEFT JOIN vtiger_invoicegrouprelation - ON vtiger_invoice.invoiceid = vtiger_invoicegrouprelation.invoiceid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_invoicegrouprelation.groupname - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id - WHERE vtiger_crmentity.deleted = 0 - AND vtiger_account.accountid = ".$id; - $log->debug("Exiting get_invoices method ..."); - return GetRelatedList('Accounts','Invoice',$focus,$query,$button,$returnset); - } - - /** - * Function to get Account related SalesOrder - * @param integer $id - accountid - * returns related SalesOrder record in array format - */ - function get_salesorder($id) - { - global $log; - $log->debug("Entering get_salesorder(".$id.") method ..."); - require_once('modules/SalesOrder/SalesOrder.php'); - global $app_strings; - - $focus = new SalesOrder(); - - $button = ''; - if(isPermitted("SalesOrder",1,"") == 'yes') - { - $button .= ' '; - } - - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_crmentity.*, - vtiger_salesorder.*, - vtiger_quotes.subject AS quotename, - vtiger_account.accountname, - vtiger_users.user_name, - vtiger_groups.groupname - FROM vtiger_salesorder - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_salesorder.salesorderid - LEFT OUTER JOIN vtiger_quotes - ON vtiger_quotes.quoteid = vtiger_salesorder.quoteid - LEFT OUTER JOIN vtiger_account - ON vtiger_account.accountid = vtiger_salesorder.accountid - LEFT JOIN vtiger_sogrouprelation - ON vtiger_salesorder.salesorderid = vtiger_sogrouprelation.salesorderid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_sogrouprelation.groupname - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id - WHERE vtiger_crmentity.deleted = 0 - AND vtiger_salesorder.accountid = ".$id; - $log->debug("Exiting get_salesorder method ..."); - return GetRelatedList('Accounts','SalesOrder',$focus,$query,$button,$returnset); - } - /** - * Function to get Account related Tickets - * @param integer $id - accountid - * returns related Ticket record in array format - */ - function get_tickets($id) - { - global $log; - $log->debug("Entering get_tickets(".$id.") method ..."); - global $app_strings; - - $focus = new HelpDesk(); - $button = ''; - - $button .= ''; - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_users.user_name, vtiger_users.id, - vtiger_troubletickets.title, vtiger_troubletickets.ticketid AS crmid, - vtiger_troubletickets.status, vtiger_troubletickets.priority, - vtiger_troubletickets.parent_id, - vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime - FROM vtiger_troubletickets - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid - LEFT JOIN vtiger_account - ON vtiger_account.accountid = vtiger_troubletickets.parent_id - LEFT JOIN vtiger_contactdetails - ON vtiger_contactdetails.contactid=vtiger_troubletickets.parent_id - LEFT JOIN vtiger_users - ON vtiger_users.id=vtiger_crmentity.smownerid - LEFT JOIN vtiger_ticketgrouprelation - ON vtiger_troubletickets.ticketid = vtiger_ticketgrouprelation.ticketid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_ticketgrouprelation.groupname - WHERE vtiger_troubletickets.parent_id=".$id." or " ; - - $query .= "vtiger_troubletickets.parent_id in(SELECT vtiger_contactdetails.contactid - FROM vtiger_contactdetails - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_contactdetails.contactid - LEFT JOIN vtiger_contactgrouprelation - ON vtiger_contactdetails.contactid = vtiger_contactgrouprelation.contactid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id - WHERE vtiger_crmentity.deleted = 0 - AND vtiger_contactdetails.accountid = ".$id; - - - //Appending the security parameter - global $current_user; - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); - $tab_id=getTabid('Contacts'); - if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[$tab_id] == 3) - { - $sec_parameter=getListViewSecurityParameter('Contacts'); - $query .= ' '.$sec_parameter; - - } - - $query .= ") "; - - /* - $query .= " UNION ALL - SELECT vtiger_users.user_name, vtiger_users.id, - vtiger_troubletickets.title, vtiger_troubletickets.ticketid AS crmid, - vtiger_troubletickets.status, vtiger_troubletickets.priority, - vtiger_troubletickets.parent_id, - vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime - FROM vtiger_troubletickets - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid - LEFT JOIN vtiger_contactdetails - ON vtiger_contactdetails.contactid = vtiger_troubletickets.parent_id - LEFT JOIN vtiger_account - ON vtiger_account.accountid = vtiger_contactdetails.accountid - LEFT JOIN vtiger_users - ON vtiger_users.id = vtiger_crmentity.smownerid - LEFT JOIN vtiger_ticketgrouprelation - ON vtiger_troubletickets.ticketid = vtiger_ticketgrouprelation.ticketid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_ticketgrouprelation.groupname - WHERE vtiger_account.accountid = ".$id; - */ - $log->debug("Exiting get_tickets method ..."); - return GetRelatedList('Accounts','HelpDesk',$focus,$query,$button,$returnset); - } - /** - * Function to get Account related Products - * @param integer $id - accountid - * returns related Products record in array format - */ - function get_products($id) - { - global $log; - $log->debug("Entering get_products(".$id.") method ..."); - require_once('modules/Products/Product.php'); - global $app_strings; - - $focus = new Product(); - - $button = ''; - - if(isPermitted("Products",1,"") == 'yes') - { - - - $button .= ' '; - } - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_products.productid, vtiger_products.productname, - vtiger_products.productcode, vtiger_products.commissionrate, - vtiger_products.qty_per_unit, vtiger_products.unit_price, - vtiger_crmentity.crmid, vtiger_crmentity.smownerid - FROM vtiger_products - INNER JOIN vtiger_seproductsrel - ON vtiger_products.productid = vtiger_seproductsrel.productid - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_products.productid - INNER JOIN vtiger_account - ON vtiger_account.accountid = vtiger_seproductsrel.crmid - WHERE vtiger_account.accountid = ".$id." - AND vtiger_crmentity.deleted = 0"; - $log->debug("Exiting get_products method ..."); - return GetRelatedList('Accounts','Products',$focus,$query,$button,$returnset); - } - - /** Function to export the account records in CSV Format - * @param reference variable - order by is passed when the query is executed - * @param reference variable - where condition is passed when the query is executed - * Returns Export Accounts Query. - */ - function create_export_query(&$order_by, &$where) - { - global $log; - $log->debug("Entering create_export_query(".$order_by.",".$where.") method ..."); - if($this->checkIfCustomTableExists('vtiger_accountscf')) - { - - $query = $this->constructCustomQueryAddendum('vtiger_accountscf','Accounts') . " - vtiger_account.*, - ".$this->entity_table.".*, - vtiger_accountbillads.city AS billing_city, - vtiger_accountbillads.country AS billing_country, - vtiger_accountbillads.code AS billing_code, - vtiger_accountbillads.state AS billing_state, - vtiger_accountbillads.street AS billing_street, - vtiger_accountshipads.city AS shipping_city, - vtiger_accountshipads.country AS shipping_country, - vtiger_accountshipads.code AS shipping_code, - vtiger_accountshipads.state AS shipping_state, - vtiger_accountshipads.street AS shipping_street, - vtiger_users.user_name, - vtiger_users.status AS user_status - FROM ".$this->entity_table." - INNER JOIN vtiger_account - ON vtiger_crmentity.crmid = vtiger_account.accountid - LEFT JOIN vtiger_accountbillads - ON vtiger_account.accountid = vtiger_accountbillads.accountaddressid - LEFT JOIN vtiger_accountshipads - ON vtiger_account.accountid = vtiger_accountshipads.accountaddressid - LEFT JOIN vtiger_accountscf - ON vtiger_accountscf.accountid = vtiger_account.accountid - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id "; - - } - else - { - $query = "SELECT vtiger_account.*, - ".$this->entity_table.".*, - vtiger_accountbillads.city AS billing_city, - vtiger_accountbillads.country AS billing_country, - vtiger_accountbillads.code AS billing_code, - vtiger_accountbillads.state AS billing_state, - vtiger_accountbillads.street AS billing_street, - vtiger_accountshipads.city AS shipping_city, - vtiger_accountshipads.country AS shipping_country, - vtiger_accountshipads.code AS shipping_code, - vtiger_accountshipads.state AS shipping_state, - vtiger_accountshipads.street AS shipping_street, - vtiger_users.user_name, - vtiger_users.status AS user_status - FROM ".$this->entity_table." - INNER JOIN vtiger_account - ON vtiger_crmentity.crmid = vtiger_account.accountid - LEFT JOIN vtiger_accountbillads - ON vtiger_account.accountid = vtiger_accountbillads.accountaddressid - LEFT JOIN vtiger_accountshipads - ON vtiger_account.accountid = vtiger_accountshipads.accountaddressid - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id "; - } - - $where_auto = " vtiger_users.status = 'Active' - AND vtiger_crmentity.deleted = 0 "; - - if($where != "") - $query .= "WHERE ($where) AND ".$where_auto; - else - $query .= "WHERE ".$where_auto; - - if(!empty($order_by)) - $query .= " ORDER BY $order_by"; - $log->debug("Exiting create_export_query method ..."); - return $query; - } - - /** Function to get the Columnnames of the Account Record - * Used By vtigerCRM Word Plugin - * Returns the Merge Fields for Word Plugin - */ - function getColumnNames_Acnt() - { - global $log; - $log->debug("Entering getColumnNames_Acnt() method ..."); - $sql1 = "SELECT fieldlabel FROM vtiger_field WHERE tabid = 6"; - $result = $this->db->query($sql1); - $numRows = $this->db->num_rows($result); - for($i=0; $i < $numRows;$i++) - { - $custom_fields[$i] = $this->db->query_result($result,$i,"fieldlabel"); - $custom_fields[$i] = ereg_replace(" ","",$custom_fields[$i]); - $custom_fields[$i] = strtoupper($custom_fields[$i]); - } - $mergeflds = $custom_fields; - $log->debug("Exiting getColumnNames_Acnt method ..."); - return $mergeflds; - } - -} - -?> +'crmid','vtiger_account'=>'accountid','vtiger_accountbillads'=>'accountaddressid','vtiger_accountshipads'=>'accountaddressid','vtiger_accountscf'=>'accountid'); + + var $entity_table = "vtiger_crmentity"; + + var $billadr_table = "vtiger_accountbillads"; + + var $object_name = "Accounts"; + // Mike Crowe Mod --------------------------------------------------------added for general search + var $base_table_name = "vtiger_account"; + var $cf_table_name = "vtiger_accountscf"; + + var $new_schema = true; + + var $module_id = "accountid"; + + var $column_fields = Array(); + + var $sortby_fields = Array('accountname','city','website','phone','smownerid'); + + + // This is the list of vtiger_fields that are in the lists. + var $list_fields = Array( + 'Account Name'=>Array('vtiger_account'=>'accountname'), + 'City'=>Array('vtiger_accountbillads'=>'city'), + 'Website'=>Array('vtiger_account'=>'website'), + 'Phone'=>Array('vtiger_account'=> 'phone'), + 'Assigned To'=>Array('vtiger_crmentity'=>'smownerid') + ); + + var $list_fields_name = Array( + 'Account Name'=>'accountname', + 'City'=>'bill_city', + 'Website'=>'website', + 'Phone'=>'phone', + 'Assigned To'=>'assigned_user_id' + ); + var $list_link_field= 'accountname'; + + var $search_fields = Array( + 'Account Name'=>Array('vtiger_account'=>'accountname'), + 'City'=>Array('vtiger_accountbillads'=>'city'), + ); + + var $search_fields_name = Array( + 'Account Name'=>'accountname', + 'City'=>'bill_city', + ); + + // This is the list of vtiger_fields that are required. + var $required_fields = array("accountname"=>1); + + //Added these variables which are used as default order by and sortorder in ListView + var $default_order_by = 'accountname'; + var $default_sort_order = 'ASC'; + + function Account() { + $this->log =LoggerManager::getLogger('account'); + $this->db = new PearDatabase(); + $this->column_fields = getColumnFields('Accounts'); + } + + // Mike Crowe Mod --------------------------------------------------------Default ordering for us + /** + * Function to get sort order + * return string $sorder - sortorder string either 'ASC' or 'DESC' + */ + function getSortOrder() + { + global $log; + $log->debug("Entering getSortOrder() method ..."); + if(isset($_REQUEST['sorder'])) + $sorder = $_REQUEST['sorder']; + else + $sorder = (($_SESSION['ACCOUNTS_SORT_ORDER'] != '')?($_SESSION['ACCOUNTS_SORT_ORDER']):($this->default_sort_order)); + $log->debug("Exiting getSortOrder() method ..."); + return $sorder; + } + /** + * Function to get order by + * return string $order_by - fieldname(eg: 'accountname') + */ + function getOrderBy() + { + global $log; + $log->debug("Entering getOrderBy() method ..."); + if (isset($_REQUEST['order_by'])) + $order_by = $_REQUEST['order_by']; + else + $order_by = (($_SESSION['ACCOUNTS_ORDER_BY'] != '')?($_SESSION['ACCOUNTS_ORDER_BY']):($this->default_order_by)); + $log->debug("Exiting getOrderBy method ..."); + return $order_by; + } + // Mike Crowe Mod -------------------------------------------------------- + + + /** Returns a list of the associated contacts + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function get_contacts($id) + { + global $log; + $log->debug("Entering get_contacts(".$id.") method ..."); + global $mod_strings; + + $focus = new Contact(); + + $button = ''; + if(isPermitted("Contacts",1,"") == 'yes') + { + $button .= ' '; + } + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + //SQL + $query = "SELECT vtiger_contactdetails.*, + vtiger_crmentity.crmid, + vtiger_crmentity.smownerid, + vtiger_users.user_name + FROM vtiger_contactdetails + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_contactdetails.contactid + LEFT JOIN vtiger_contactgrouprelation + ON vtiger_contactdetails.contactid = vtiger_contactgrouprelation.contactid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id + WHERE vtiger_crmentity.deleted = 0 + AND vtiger_contactdetails.accountid = ".$id; + $log->debug("Exiting get_contacts method ..."); + return GetRelatedList('Accounts','Contacts',$focus,$query,$button,$returnset); + } + + /** Returns a list of the associated opportunities + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function get_opportunities($id) + { + global $log; + $log->debug("Entering get_opportunities(".$id.") method ..."); + global $mod_strings; + + $focus = new Potential(); + $button = ''; + + if(isPermitted("Potentials",1,"") == 'yes') + { + $button .= ''; + } + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_potential.potentialid, vtiger_potential.accountid, + vtiger_potential.potentialname, vtiger_potential.sales_stage, + vtiger_potential.potentialtype, vtiger_potential.amount, + vtiger_potential.closingdate, vtiger_potential.potentialtype, + vtiger_users.user_name, + vtiger_crmentity.crmid, vtiger_crmentity.smownerid + FROM vtiger_potential + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_potential.potentialid + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id + LEFT JOIN vtiger_potentialgrouprelation + ON vtiger_potential.potentialid = vtiger_potentialgrouprelation.potentialid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_potentialgrouprelation.groupname + WHERE vtiger_crmentity.deleted = 0 + AND vtiger_potential.accountid = ".$id; + $log->debug("Exiting get_opportunities method ..."); + + return GetRelatedList('Accounts','Potentials',$focus,$query,$button,$returnset); + } + + /** Returns a list of the associated tasks + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function get_activities($id) + { + global $log; + $log->debug("Entering get_activities(".$id.") method ..."); + global $mod_strings; + + $focus = new Activity(); + $button = ''; + if(isPermitted("Calendar",1,"") == 'yes') + { + + $button .= ' '; + $button .= ' '; + } + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_activity.*, + vtiger_seactivityrel.*, + vtiger_crmentity.crmid, vtiger_crmentity.smownerid, + vtiger_crmentity.modifiedtime, + vtiger_users.user_name, + vtiger_recurringevents.recurringtype + FROM vtiger_activity + INNER JOIN vtiger_seactivityrel + ON vtiger_seactivityrel.activityid = vtiger_activity.activityid + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_activity.activityid + LEFT JOIN vtiger_users + ON vtiger_users.id = vtiger_crmentity.smownerid + LEFT OUTER JOIN vtiger_recurringevents + ON vtiger_recurringevents.activityid = vtiger_activity.activityid + LEFT JOIN vtiger_activitygrouprelation + ON vtiger_activitygrouprelation.activityid = vtiger_crmentity.crmid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_activitygrouprelation.groupname + WHERE vtiger_seactivityrel.crmid = ".$id." + AND (activitytype='Task' + OR activitytype='Call' + OR activitytype='Meeting') + AND vtiger_crmentity.deleted = 0 + AND ((vtiger_activity.status IS NOT NULL + AND vtiger_activity.status != 'Completed') + AND (vtiger_activity.status IS NOT NULL + AND vtiger_activity.status != 'Deferred') + OR (vtiger_activity.eventstatus !='' + AND vtiger_activity.eventstatus != 'Held'))"; + $log->debug("Exiting get_activities method ..."); + return GetRelatedList('Accounts','Calendar',$focus,$query,$button,$returnset); + + } + /** + * Function to get Account related Task & Event which have activity type Held, Completed or Deferred. + * @param integer $id - accountid + * returns related Task or Event record in array format + */ + function get_history($id) + { + global $log; + $log->debug("Entering get_history(".$id.") method ..."); + $query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, + vtiger_activity.status, vtiger_activity.eventstatus, + vtiger_activity.activitytype, + vtiger_crmentity.modifiedtime, vtiger_crmentity.createdtime, + vtiger_crmentity.description, + vtiger_users.user_name + FROM vtiger_activity + INNER JOIN vtiger_seactivityrel + ON vtiger_seactivityrel.activityid = vtiger_activity.activityid + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_activity.activityid + LEFT JOIN vtiger_activitygrouprelation + ON vtiger_activitygrouprelation.activityid = vtiger_activity.activityid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_activitygrouprelation.groupname + INNER JOIN vtiger_users + ON vtiger_crmentity.smcreatorid = vtiger_users.id + WHERE (vtiger_activity.activitytype = 'Meeting' + OR vtiger_activity.activitytype = 'Call' + OR vtiger_activity.activitytype = 'Task') + AND (vtiger_activity.status = 'Completed' + OR vtiger_activity.status = 'Deferred' + OR (vtiger_activity.eventstatus = 'Held' + AND vtiger_activity.eventstatus != '')) + AND vtiger_seactivityrel.crmid = ".$id; + //Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php + $log->debug("Exiting get_history method ..."); + return getHistory('Accounts',$query,$id); + } + /** + * Function to get Account related Attachments + * @param integer $id - accountid + * returns related Attachment record in array format + */ + function get_attachments($id) + { + global $log; + $log->debug("Entering get_attachments(".$id.") method ..."); + // Armando L?scher 18.10.2005 -> ?visibleDescription + // Desc: Inserted crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name + // Inserted inner join vtiger_users on crm2.smcreatorid= vtiger_users.id + $query = "SELECT vtiger_notes.title, vtiger_notes.notecontent AS description, + vtiger_notes.filename, vtiger_notes.notesid AS crmid, + 'Notes ' AS ActivityType, + vtiger_attachments.type AS FileType, + crm2.modifiedtime AS lastmodified, crm2.createdtime, + vtiger_seattachmentsrel.attachmentsid, + vtiger_users.user_name + FROM vtiger_notes + INNER JOIN vtiger_senotesrel + ON vtiger_senotesrel.notesid = vtiger_notes.notesid + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_senotesrel.crmid + INNER JOIN vtiger_crmentity crm2 + ON crm2.crmid = vtiger_notes.notesid + AND crm2.deleted = 0 + LEFT JOIN vtiger_seattachmentsrel + ON vtiger_seattachmentsrel.crmid = vtiger_notes.notesid + LEFT JOIN vtiger_attachments + ON vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid + INNER JOIN vtiger_users + ON crm2.smcreatorid = vtiger_users.id + WHERE vtiger_crmentity.crmid = ".$id." + UNION ALL + SELECT vtiger_attachments.description AS title, vtiger_attachments.description, + vtiger_attachments.name AS filename, + vtiger_seattachmentsrel.attachmentsid AS crmid, + 'Attachments' AS ActivityType, + vtiger_attachments.type AS FileType, + crm2.modifiedtime AS lastmodified, crm2.createdtime, + vtiger_attachments.attachmentsid, + vtiger_users.user_name + FROM vtiger_attachments + INNER JOIN vtiger_seattachmentsrel + ON vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_seattachmentsrel.crmid + INNER JOIN vtiger_crmentity crm2 + ON crm2.crmid = vtiger_attachments.attachmentsid + INNER JOIN vtiger_users + ON crm2.smcreatorid = vtiger_users.id + WHERE vtiger_crmentity.crmid = ".$id." + ORDER BY createdtime DESC"; + $log->debug("Exiting get_attachments method ..."); + return getAttachmentsAndNotes('Accounts',$query,$id); + } + /** + * Function to get Account related Quotes + * @param integer $id - accountid + * returns related Quotes record in array format + */ + function get_quotes($id) + { + global $log; + $log->debug("Entering get_quotes(".$id.") method ..."); + global $app_strings; + require_once('modules/Quotes/Quote.php'); + + $focus = new Quote(); + + $button = ''; + if(isPermitted("Quotes",1,"") == 'yes') + { + $button .= ' '; + } + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_users.user_name, + vtiger_groups.groupname, + vtiger_crmentity.*, + vtiger_quotes.*, + vtiger_potential.potentialname, + vtiger_account.accountname + FROM vtiger_quotes + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_quotes.quoteid + LEFT OUTER JOIN vtiger_account + ON vtiger_account.accountid = vtiger_quotes.accountid + LEFT OUTER JOIN vtiger_potential + ON vtiger_potential.potentialid = vtiger_quotes.potentialid + LEFT JOIN vtiger_quotegrouprelation + ON vtiger_quotes.quoteid = vtiger_quotegrouprelation.quoteid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_quotegrouprelation.groupname + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id + WHERE vtiger_crmentity.deleted = 0 + AND vtiger_account.accountid = ".$id; + $log->debug("Exiting get_quotes method ..."); + return GetRelatedList('Accounts','Quotes',$focus,$query,$button,$returnset); + } + /** + * Function to get Account related Invoices + * @param integer $id - accountid + * returns related Invoices record in array format + */ + function get_invoices($id) + { + global $log; + $log->debug("Entering get_invoices(".$id.") method ..."); + global $app_strings; + require_once('modules/Invoice/Invoice.php'); + + $focus = new Invoice(); + + $button = ''; + if(isPermitted("Invoice",1,"") == 'yes') + { + $button .= ' '; + } + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_users.user_name, + vtiger_groups.groupname, + vtiger_crmentity.*, + vtiger_invoice.*, + vtiger_account.accountname, + vtiger_salesorder.subject AS salessubject + FROM vtiger_invoice + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_invoice.invoiceid + LEFT OUTER JOIN vtiger_account + ON vtiger_account.accountid = vtiger_invoice.accountid + LEFT OUTER JOIN vtiger_salesorder + ON vtiger_salesorder.salesorderid = vtiger_invoice.salesorderid + LEFT JOIN vtiger_invoicegrouprelation + ON vtiger_invoice.invoiceid = vtiger_invoicegrouprelation.invoiceid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_invoicegrouprelation.groupname + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id + WHERE vtiger_crmentity.deleted = 0 + AND vtiger_account.accountid = ".$id; + $log->debug("Exiting get_invoices method ..."); + return GetRelatedList('Accounts','Invoice',$focus,$query,$button,$returnset); + } + + /** + * Function to get Account related SalesOrder + * @param integer $id - accountid + * returns related SalesOrder record in array format + */ + function get_salesorder($id) + { + global $log; + $log->debug("Entering get_salesorder(".$id.") method ..."); + require_once('modules/SalesOrder/SalesOrder.php'); + global $app_strings; + + $focus = new SalesOrder(); + + $button = ''; + if(isPermitted("SalesOrder",1,"") == 'yes') + { + $button .= ' '; + } + + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_crmentity.*, + vtiger_salesorder.*, + vtiger_quotes.subject AS quotename, + vtiger_account.accountname, + vtiger_users.user_name, + vtiger_groups.groupname + FROM vtiger_salesorder + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_salesorder.salesorderid + LEFT OUTER JOIN vtiger_quotes + ON vtiger_quotes.quoteid = vtiger_salesorder.quoteid + LEFT OUTER JOIN vtiger_account + ON vtiger_account.accountid = vtiger_salesorder.accountid + LEFT JOIN vtiger_sogrouprelation + ON vtiger_salesorder.salesorderid = vtiger_sogrouprelation.salesorderid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_sogrouprelation.groupname + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id + WHERE vtiger_crmentity.deleted = 0 + AND vtiger_salesorder.accountid = ".$id; + $log->debug("Exiting get_salesorder method ..."); + return GetRelatedList('Accounts','SalesOrder',$focus,$query,$button,$returnset); + } + /** + * Function to get Account related Tickets + * @param integer $id - accountid + * returns related Ticket record in array format + */ + function get_tickets($id) + { + global $log; + $log->debug("Entering get_tickets(".$id.") method ..."); + global $app_strings; + + $focus = new HelpDesk(); + $button = ''; + + $button .= ''; + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_users.user_name, vtiger_users.id, + vtiger_troubletickets.title, vtiger_troubletickets.ticketid AS crmid, + vtiger_troubletickets.status, vtiger_troubletickets.priority, + vtiger_troubletickets.parent_id, + vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime + FROM vtiger_troubletickets + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid + LEFT JOIN vtiger_account + ON vtiger_account.accountid = vtiger_troubletickets.parent_id + LEFT JOIN vtiger_contactdetails + ON vtiger_contactdetails.contactid=vtiger_troubletickets.parent_id + LEFT JOIN vtiger_users + ON vtiger_users.id=vtiger_crmentity.smownerid + LEFT JOIN vtiger_ticketgrouprelation + ON vtiger_troubletickets.ticketid = vtiger_ticketgrouprelation.ticketid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_ticketgrouprelation.groupname + WHERE vtiger_troubletickets.parent_id=".$id." or " ; + + $query .= "vtiger_troubletickets.parent_id in(SELECT vtiger_contactdetails.contactid + FROM vtiger_contactdetails + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_contactdetails.contactid + LEFT JOIN vtiger_contactgrouprelation + ON vtiger_contactdetails.contactid = vtiger_contactgrouprelation.contactid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id + WHERE vtiger_crmentity.deleted = 0 + AND vtiger_contactdetails.accountid = ".$id; + + + //Appending the security parameter + global $current_user; + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + $tab_id=getTabid('Contacts'); + if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[$tab_id] == 3) + { + $sec_parameter=getListViewSecurityParameter('Contacts'); + $query .= ' '.$sec_parameter; + + } + + $query .= ") "; + + /* + $query .= " UNION ALL + SELECT vtiger_users.user_name, vtiger_users.id, + vtiger_troubletickets.title, vtiger_troubletickets.ticketid AS crmid, + vtiger_troubletickets.status, vtiger_troubletickets.priority, + vtiger_troubletickets.parent_id, + vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime + FROM vtiger_troubletickets + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid + LEFT JOIN vtiger_contactdetails + ON vtiger_contactdetails.contactid = vtiger_troubletickets.parent_id + LEFT JOIN vtiger_account + ON vtiger_account.accountid = vtiger_contactdetails.accountid + LEFT JOIN vtiger_users + ON vtiger_users.id = vtiger_crmentity.smownerid + LEFT JOIN vtiger_ticketgrouprelation + ON vtiger_troubletickets.ticketid = vtiger_ticketgrouprelation.ticketid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_ticketgrouprelation.groupname + WHERE vtiger_account.accountid = ".$id; + */ + $log->debug("Exiting get_tickets method ..."); + return GetRelatedList('Accounts','HelpDesk',$focus,$query,$button,$returnset); + } + /** + * Function to get Account related Products + * @param integer $id - accountid + * returns related Products record in array format + */ + function get_products($id) + { + global $log; + $log->debug("Entering get_products(".$id.") method ..."); + require_once('modules/Products/Product.php'); + global $app_strings; + + $focus = new Product(); + + $button = ''; + + if(isPermitted("Products",1,"") == 'yes') + { + + + $button .= ' '; + } + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_products.productid, vtiger_products.productname, + vtiger_products.productcode, vtiger_products.commissionrate, + vtiger_products.qty_per_unit, vtiger_products.unit_price, + vtiger_crmentity.crmid, vtiger_crmentity.smownerid + FROM vtiger_products + INNER JOIN vtiger_seproductsrel + ON vtiger_products.productid = vtiger_seproductsrel.productid + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_products.productid + INNER JOIN vtiger_account + ON vtiger_account.accountid = vtiger_seproductsrel.crmid + WHERE vtiger_account.accountid = ".$id." + AND vtiger_crmentity.deleted = 0"; + $log->debug("Exiting get_products method ..."); + return GetRelatedList('Accounts','Products',$focus,$query,$button,$returnset); + } + + /** Function to export the account records in CSV Format + * @param reference variable - order by is passed when the query is executed + * @param reference variable - where condition is passed when the query is executed + * Returns Export Accounts Query. + */ + function create_export_query(&$order_by, &$where) + { + global $log; + $log->debug("Entering create_export_query(".$order_by.",".$where.") method ..."); + if($this->checkIfCustomTableExists('vtiger_accountscf')) + { + + $query = $this->constructCustomQueryAddendum('vtiger_accountscf','Accounts') . " + vtiger_account.*, + ".$this->entity_table.".*, + vtiger_accountbillads.city AS billing_city, + vtiger_accountbillads.country AS billing_country, + vtiger_accountbillads.code AS billing_code, + vtiger_accountbillads.state AS billing_state, + vtiger_accountbillads.street AS billing_street, + vtiger_accountshipads.city AS shipping_city, + vtiger_accountshipads.country AS shipping_country, + vtiger_accountshipads.code AS shipping_code, + vtiger_accountshipads.state AS shipping_state, + vtiger_accountshipads.street AS shipping_street, + vtiger_users.user_name, + vtiger_users.status AS user_status + FROM ".$this->entity_table." + INNER JOIN vtiger_account + ON vtiger_crmentity.crmid = vtiger_account.accountid + LEFT JOIN vtiger_accountbillads + ON vtiger_account.accountid = vtiger_accountbillads.accountaddressid + LEFT JOIN vtiger_accountshipads + ON vtiger_account.accountid = vtiger_accountshipads.accountaddressid + LEFT JOIN vtiger_accountscf + ON vtiger_accountscf.accountid = vtiger_account.accountid + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id "; + + } + else + { + $query = "SELECT vtiger_account.*, + ".$this->entity_table.".*, + vtiger_accountbillads.city AS billing_city, + vtiger_accountbillads.country AS billing_country, + vtiger_accountbillads.code AS billing_code, + vtiger_accountbillads.state AS billing_state, + vtiger_accountbillads.street AS billing_street, + vtiger_accountshipads.city AS shipping_city, + vtiger_accountshipads.country AS shipping_country, + vtiger_accountshipads.code AS shipping_code, + vtiger_accountshipads.state AS shipping_state, + vtiger_accountshipads.street AS shipping_street, + vtiger_users.user_name, + vtiger_users.status AS user_status + FROM ".$this->entity_table." + INNER JOIN vtiger_account + ON vtiger_crmentity.crmid = vtiger_account.accountid + LEFT JOIN vtiger_accountbillads + ON vtiger_account.accountid = vtiger_accountbillads.accountaddressid + LEFT JOIN vtiger_accountshipads + ON vtiger_account.accountid = vtiger_accountshipads.accountaddressid + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id "; + } + + $where_auto = " vtiger_users.status = 'Active' + AND vtiger_crmentity.deleted = 0 "; + + if($where != "") + $query .= "WHERE ($where) AND ".$where_auto; + else + $query .= "WHERE ".$where_auto; + + if(!empty($order_by)) + $query .= " ORDER BY $order_by"; + $log->debug("Exiting create_export_query method ..."); + return $query; + } + + /** Function to get the Columnnames of the Account Record + * Used By vtigerCRM Word Plugin + * Returns the Merge Fields for Word Plugin + */ + function getColumnNames_Acnt() + { + global $log,$current_user; + $log->debug("Entering getColumnNames_Acnt() method ..."); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "SELECT fieldlabel FROM vtiger_field WHERE tabid = 6"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldlabel from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=6 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result = $this->db->query($sql1); + $numRows = $this->db->num_rows($result); + for($i=0; $i < $numRows;$i++) + { + $custom_fields[$i] = $this->db->query_result($result,$i,"fieldlabel"); + $custom_fields[$i] = ereg_replace(" ","",$custom_fields[$i]); + $custom_fields[$i] = strtoupper($custom_fields[$i]); + } + $mergeflds = $custom_fields; + $log->debug("Exiting getColumnNames_Acnt method ..."); + return $mergeflds; + } + +} + +?> Modified: vtigercrm/trunk/modules/Contacts/Contact.php ============================================================================== --- vtigercrm/trunk/modules/Contacts/Contact.php (original) +++ vtigercrm/trunk/modules/Contacts/Contact.php Wed Aug 23 08:00:50 2006 @@ -604,9 +604,17 @@ */ function getColumnNames() { - global $log; + global $log,$current_user; $log->debug("Entering getColumnNames() method ..."); - $sql1 = "select fieldlabel from vtiger_field where tabid=4 and block <> 6 and block <> 75"; + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select fieldlabel from vtiger_field where tabid=4 and block <> 75"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldlabel from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=4 and vtiger_field.block <> 6 and vtiger_field.block <> 75 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } $result = $this->db->query($sql1); $numRows = $this->db->num_rows($result); for($i=0; $i < $numRows;$i++) Modified: vtigercrm/trunk/modules/HelpDesk/HelpDesk.php ============================================================================== --- vtigercrm/trunk/modules/HelpDesk/HelpDesk.php (original) +++ vtigercrm/trunk/modules/HelpDesk/HelpDesk.php Wed Aug 23 08:00:50 2006 @@ -1,462 +1,470 @@ -'crmid','vtiger_troubletickets'=>'ticketid','vtiger_seticketsrel'=>'ticketid','vtiger_ticketcf'=>'ticketid','vtiger_ticketcomments'=>'ticketid','vtiger_attachments'=>'attachmentsid'); - var $column_fields = Array(); - - var $sortby_fields = Array('title','status','priority','crmid','firstname','smownerid'); - - var $list_fields = Array( - 'Ticket ID'=>Array('crmentity'=>'crmid'), - 'Subject'=>Array('troubletickets'=>'title'), - 'Related to'=>Array('troubletickets'=>'parent_id'), - 'Status'=>Array('troubletickets'=>'status'), - 'Priority'=>Array('troubletickets'=>'priority'), - 'Assigned To'=>Array('crmentity','smownerid') - ); - - var $list_fields_name = Array( - 'Ticket ID'=>'', - 'Subject'=>'ticket_title', - 'Related to'=>'parent_id', - 'Status'=>'ticketstatus', - 'Priority'=>'ticketpriorities', - 'Assigned To'=>'assigned_user_id' - ); - - var $list_link_field= 'ticket_title'; - - var $range_fields = Array( - 'ticketid', - 'title', - 'firstname', - 'lastname', - 'parent_id', - 'productid', - 'productname', - 'priority', - 'severity', - 'status', - 'category', - 'description', - 'solution', - 'modifiedtime', - 'createdtime' - ); - - //Added these variables which are used as default order by and sortorder in ListView - var $default_order_by = 'crmid'; - var $default_sort_order = 'DESC'; - - /** Constructor which will set the column_fields in this object - */ - function HelpDesk() - { - $this->log =LoggerManager::getLogger('helpdesk'); - $this->log->debug("Entering HelpDesk() method ..."); - $this->db = new PearDatabase(); - $this->column_fields = getColumnFields('HelpDesk'); - $this->log->debug("Exiting HelpDesk method ..."); - } - - /** Function used to get the sort order for HelpDesk listview - * @return string $sorder - first check the $_REQUEST['sorder'] if request value is empty then check in the $_SESSION['HELPDESK_SORT_ORDER'] if this session value is empty then default sort order will be returned. - */ - function getSortOrder() - { - global $log; - $log->debug("Entering getSortOrder() method ..."); - if(isset($_REQUEST['sorder'])) - $sorder = $_REQUEST['sorder']; - else - $sorder = (($_SESSION['HELPDESK_SORT_ORDER'] != '')?($_SESSION['HELPDESK_SORT_ORDER']):($this->default_sort_order)); - $log->debug("Exiting getSortOrder() method ..."); - return $sorder; - } - - /** Function used to get the order by value for HelpDesk listview - * @return string $order_by - first check the $_REQUEST['order_by'] if request value is empty then check in the $_SESSION['HELPDESK_ORDER_BY'] if this session value is empty then default order by will be returned. - */ - function getOrderBy() - { - global $log; - $log->debug("Entering getOrderBy() method ..."); - if (isset($_REQUEST['order_by'])) - $order_by = $_REQUEST['order_by']; - else - $order_by = (($_SESSION['HELPDESK_ORDER_BY'] != '')?($_SESSION['HELPDESK_ORDER_BY']):($this->default_order_by)); - $log->debug("Exiting getOrderBy method ..."); - return $order_by; - } - - /** Function to form the query to get the list of activities - * @param int $id - ticket id - * @return array - return an array which will be returned from the function GetRelatedList - **/ - function get_activities($id) - { - global $log; - $log->debug("Entering get_activities(".$id.") method ..."); - global $mod_strings; - global $app_strings; - require_once('modules/Calendar/Activity.php'); - $focus = new Activity(); - - $button = ''; - - $returnset = '&return_module=HelpDesk&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_activity.*, vtiger_crmentity.crmid, vtiger_recurringevents.recurringtype, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_users.user_name from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.crmid=".$id." and (activitytype='Task' or activitytype='Call' or activitytype='Meeting') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held')"; - $log->debug("Exiting get_activities method ..."); - - return GetRelatedList('HelpDesk','Calendar',$focus,$query,$button,$returnset); - } - - /** Function to get the Ticket History information as in array format - * @param int $ticketid - ticket id - * @return array - return an array with title and the ticket history informations in the following format - array( - header=>array('0'=>'title'), - entries=>array('0'=>'info1','1'=>'info2',etc.,) - ) - */ - function get_ticket_history($ticketid) - { - global $log, $adb; - $log->debug("Entering into get_ticket_history($ticketid) method ..."); - - $query="select title,update_log from vtiger_troubletickets where ticketid=".$ticketid; - $result=$adb->query($query); - $update_log = $adb->query_result($result,0,"update_log"); - - $splitval = split('--//--',trim($update_log,'--//--')); - - $header[] = $adb->query_result($result,0,"title"); - - $return_value = Array('header'=>$header,'entries'=>$splitval); - - $log->debug("Exiting from get_ticket_history($ticketid) method ..."); - - return $return_value; - } - - /** Function to form the query to get the list of attachments and notes - * @param int $id - ticket id - * @return array - return an array which will be returned from the function getAttachmentsAndNotes - **/ - function get_attachments($id) - { - global $log; - $log->debug("Entering get_attachments(".$id.") method ..."); - $query = "select vtiger_notes.title,'Notes ' ActivityType, vtiger_notes.filename, - vtiger_attachments.type FileType,crm2.modifiedtime lastmodified, - vtiger_seattachmentsrel.attachmentsid attachmentsid, vtiger_notes.notesid crmid, - crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name - from vtiger_notes - inner join vtiger_senotesrel on vtiger_senotesrel.notesid= vtiger_notes.notesid - inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_senotesrel.crmid - inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_notes.notesid and crm2.deleted=0 - left join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid =vtiger_notes.notesid - left join vtiger_attachments on vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid - inner join vtiger_users on crm2.smcreatorid= vtiger_users.id - where vtiger_crmentity.crmid=".$id; - - $query .= ' union all '; - - $query .= "select vtiger_attachments.description title ,'Attachments' ActivityType, - vtiger_attachments.name filename, vtiger_attachments.type FileType,crm2.modifiedtime lastmodified, - vtiger_attachments.attachmentsid attachmentsid, vtiger_seattachmentsrel.attachmentsid crmid, - crm2.createdtime, vtiger_attachments.description, vtiger_users.user_name - from vtiger_attachments - inner join vtiger_seattachmentsrel on vtiger_seattachmentsrel.attachmentsid= vtiger_attachments.attachmentsid - inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_seattachmentsrel.crmid - inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_attachments.attachmentsid - left join vtiger_users on crm2.smcreatorid= vtiger_users.id - where vtiger_crmentity.crmid=".$id; - $log->debug("Exiting get_attachments method ..."); - return getAttachmentsAndNotes('HelpDesk',$query,$id); - } - - /** Function to get the ticket comments as a array - * @param int $ticketid - ticketid - * @return array $output - array( - [$i][comments] => comments - [$i][owner] => name of the user or customer who made the comment - [$i][createdtime] => the comment created time - ) - where $i = 0,1,..n which are all made for the ticket - **/ - function get_ticket_comments_list($ticketid) - { - global $log; - $log->debug("Entering get_ticket_comments_list(".$ticketid.") method ..."); - $sql = "select * from vtiger_ticketcomments where ticketid=".$ticketid." order by createdtime DESC"; - $result = $this->db->query($sql); - $noofrows = $this->db->num_rows($result); - for($i=0;$i<$noofrows;$i++) - { - $ownerid = $this->db->query_result($result,$i,"ownerid"); - $ownertype = $this->db->query_result($result,$i,"ownertype"); - if($ownertype == 'user') - $name = getUserName($ownerid); - elseif($ownertype == 'customer') - { - $sql1 = 'select * from vtiger_portalinfo where id='.$ownerid; - $name = $this->db->query_result($this->db->query($sql1),0,'user_name'); - } - - $output[$i]['comments'] = nl2br($this->db->query_result($result,$i,"comments")); - $output[$i]['owner'] = $name; - $output[$i]['createdtime'] = $this->db->query_result($result,$i,"createdtime"); - } - $log->debug("Exiting get_ticket_comments_list method ..."); - return $output; - } - - /** Function to form the query which will give the list of tickets based on customername and id ie., contactname and contactid - * @param string $user_name - name of the customer ie., contact name - * @param int $id - contact id - * @return array - return an array which will be returned from the function process_list_query - **/ - function get_user_tickets_list($user_name,$id,$where='',$match='') - { - global $log; - $log->debug("Entering get_user_tickets_list(".$user_name.",".$id.",".$where.",".$match.") method ..."); - - $this->db->println("where ==> ".$where); - - $query = "select vtiger_crmentity.crmid, vtiger_troubletickets.*, vtiger_crmentity.smownerid, vtiger_crmentity.createdtime, vtiger_crmentity.modifiedtime, vtiger_contactdetails.firstname, vtiger_contactdetails.lastname, vtiger_products.productid, vtiger_products.productname, vtiger_ticketcf.* from vtiger_troubletickets inner join vtiger_ticketcf on vtiger_ticketcf.ticketid = vtiger_troubletickets.ticketid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_troubletickets.ticketid left join vtiger_contactdetails on vtiger_troubletickets.parent_id=vtiger_contactdetails.contactid left join vtiger_products on vtiger_products.productid = vtiger_troubletickets.product_id left join vtiger_users on vtiger_crmentity.smownerid=vtiger_users.id where vtiger_crmentity.deleted=0 and vtiger_contactdetails.email='".$user_name."' and vtiger_troubletickets.parent_id = '".$id."'"; - - if(trim($where) != '') - { - if($match == 'all' || $match == '') - { - $join = " and "; - } - elseif($match == 'any') - { - $join = " or "; - } - $where = explode("&&&",$where); - $count = count($where); - $count --; - $where_conditions = ""; - foreach($where as $key => $value) - { - $this->db->println('key : '.$key.'...........value : '.$value); - $val = explode(" = ",$value); - $this->db->println('val0 : '.$val[0].'...........val1 : '.$val[1]); - if($val[0] == 'vtiger_troubletickets.title') - { - $where_conditions .= $val[0]." ".$val[1]; - if($count != $key) $where_conditions .= $join; - } - elseif($val[1] != '' && $val[1] != 'Any') - { - $where_conditions .= $val[0]." = ".$val[1]; - if($count != $key) $where_conditions .= $join; - } - } - if($where_conditions != '') - $where_conditions = " and ( ".$where_conditions." ) "; - - $query .= $where_conditions; - $this->db->println("where condition for customer portal tickets search : ".$where_conditions); - } - - $query .= " order by vtiger_crmentity.crmid desc"; - $log->debug("Exiting get_user_tickets_list method ..."); - return $this->process_list_query($query); - } - - /** Function to process the list query and return the result with number of rows - * @param string $query - query - * @return array $response - array( list => array( - $i => array(key => val) - ), - row_count => '', - next_offset => '', - previous_offset =>'' - ) - where $i=0,1,..n & key = ticketid, title, firstname, ..etc(range_fields) & val = value of the key from db retrieved row - **/ - function process_list_query($query) - { - global $log; - $log->debug("Entering process_list_query(".$query.") method ..."); - - $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); - $list = Array(); - $rows_found = $this->db->getRowCount($result); - if($rows_found != 0) - { - $ticket = Array(); - for($index = 0 , $row = $this->db->fetchByAssoc($result, $index); $row && $index <$rows_found;$index++, $row = $this->db->fetchByAssoc($result, $index)) - { - foreach($this->range_fields as $columnName) - { - if (isset($row[$columnName])) - { - $ticket[$columnName] = $row[$columnName]; - } - else - { - $ticket[$columnName] = ""; - } - } - $list[] = $ticket; - } - } - - $response = Array(); - $response['list'] = $list; - $response['row_count'] = $rows_found; - $response['next_offset'] = $next_offset; - $response['previous_offset'] = $previous_offset; - - $log->debug("Exiting process_list_query method ..."); - return $response; - } - - /** Function to get the HelpDesk field labels in caps letters without space - * @return array $mergeflds - array( key => val ) where key=0,1,2..n & val = ASSIGNEDTO,RELATEDTO, .,etc - **/ - function getColumnNames_Hd() - { - global $log; - $log->debug("Entering getColumnNames_Hd() method ..."); - $sql1 = "select fieldlabel from vtiger_field where tabid=13 and block <> 6 "; - $result = $this->db->query($sql1); - $numRows = $this->db->num_rows($result); - for($i=0; $i < $numRows;$i++) - { - $custom_fields[$i] = $this->db->query_result($result,$i,"fieldlabel"); - $custom_fields[$i] = ereg_replace(" ","",$custom_fields[$i]); - $custom_fields[$i] = strtoupper($custom_fields[$i]); - } - $mergeflds = $custom_fields; - $log->debug("Exiting getColumnNames_Hd method ..."); - return $mergeflds; - } - - /** Function to get the list of comments for the given ticket id - * @param int $ticketid - Ticket id - * @return list $list - return the list of comments and comment informations as a html output where as these comments and comments informations will be formed in div tag. - **/ - function getCommentInformation($ticketid) - { - global $log; - $log->debug("Entering getCommentInformation(".$ticketid.") method ..."); - global $adb; - global $mod_strings; - $sql = "select * from vtiger_ticketcomments where ticketid=".$ticketid; - $result = $adb->query($sql); - $noofrows = $adb->num_rows($result); - - if($noofrows == 0) - { - $log->debug("Exiting getCommentInformation method ..."); - return ''; - } - - $list .= '
'; - for($i=0;$i<$noofrows;$i++) - { - if($adb->query_result($result,$i,'comments') != '') - { - //this div is to display the comment - $list .= '
'; - $list .= make_clickable(nl2br($adb->query_result($result,$i,'comments'))); - - $list .= '
'; - - //this div is to display the author and time - $list .= '
'; - $list .= $mod_strings['LBL_AUTHOR'].' : '; - - if($adb->query_result($result,$i,'ownertype') == 'user') - $list .= getUserName($adb->query_result($result,$i,'ownerid')); - else - $list .= $this->getCustomerName($ticketid); - - $list .= ' on '.$adb->query_result($result,$i,'createdtime').'  '; - - $list .= '
'; - } - } - $list .= '
'; - - $log->debug("Exiting getCommentInformation method ..."); - return $list; - } - - /** Function to get the Customer Name who has made comment to the ticket from the customer portal - * @param int $id - Ticket id - * @return string $customername - The contact name - **/ - function getCustomerName($id) - { - global $log; - $log->debug("Entering getCustomerName(".$id.") method ..."); - global $adb; - $sql = "select * from vtiger_portalinfo inner join vtiger_troubletickets on vtiger_troubletickets.parent_id = vtiger_portalinfo.id where vtiger_troubletickets.ticketid=".$id; - $result = $adb->query($sql); - $customername = $adb->query_result($result,0,'user_name'); - $log->debug("Exiting getCustomerName method ..."); - return $customername; - } - - /** Function used to get the Activity History - * @param int $id - ticket id to which we want to display the activity history - * @return array - return an array which will be returned from the function getHistory - */ - function get_history($id) - { - global $log; - $log->debug("Entering get_history(".$id.") method ..."); - $query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.status, vtiger_activity.eventstatus, - vtiger_activity.activitytype, vtiger_troubletickets.ticketid, vtiger_troubletickets.title, vtiger_crmentity.modifiedtime, - vtiger_crmentity.createdtime, vtiger_crmentity.description, vtiger_users.user_name - from vtiger_activity - inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid= vtiger_activity.activityid - inner join vtiger_troubletickets on vtiger_troubletickets.ticketid = vtiger_seactivityrel.crmid - inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid - left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid - left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname - inner join vtiger_users on vtiger_crmentity.smcreatorid= vtiger_users.id - where (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') - and (vtiger_activity.status = 'Completed' or vtiger_activity.status = 'Deferred' or (vtiger_activity.eventstatus = 'Held' and vtiger_activity.eventstatus != '')) - and vtiger_seactivityrel.crmid=".$id; - //Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php - $log->debug("Entering get_history method ..."); - return getHistory('HelpDesk',$query,$id); - } - - - -} -?> +'crmid','vtiger_troubletickets'=>'ticketid','vtiger_seticketsrel'=>'ticketid','vtiger_ticketcf'=>'ticketid','vtiger_ticketcomments'=>'ticketid','vtiger_attachments'=>'attachmentsid'); + var $column_fields = Array(); + + var $sortby_fields = Array('title','status','priority','crmid','firstname','smownerid'); + + var $list_fields = Array( + 'Ticket ID'=>Array('crmentity'=>'crmid'), + 'Subject'=>Array('troubletickets'=>'title'), + 'Related to'=>Array('troubletickets'=>'parent_id'), + 'Status'=>Array('troubletickets'=>'status'), + 'Priority'=>Array('troubletickets'=>'priority'), + 'Assigned To'=>Array('crmentity','smownerid') + ); + + var $list_fields_name = Array( + 'Ticket ID'=>'', + 'Subject'=>'ticket_title', + 'Related to'=>'parent_id', + 'Status'=>'ticketstatus', + 'Priority'=>'ticketpriorities', + 'Assigned To'=>'assigned_user_id' + ); + + var $list_link_field= 'ticket_title'; + + var $range_fields = Array( + 'ticketid', + 'title', + 'firstname', + 'lastname', + 'parent_id', + 'productid', + 'productname', + 'priority', + 'severity', + 'status', + 'category', + 'description', + 'solution', + 'modifiedtime', + 'createdtime' + ); + + //Added these variables which are used as default order by and sortorder in ListView + var $default_order_by = 'crmid'; + var $default_sort_order = 'DESC'; + + /** Constructor which will set the column_fields in this object + */ + function HelpDesk() + { + $this->log =LoggerManager::getLogger('helpdesk'); + $this->log->debug("Entering HelpDesk() method ..."); + $this->db = new PearDatabase(); + $this->column_fields = getColumnFields('HelpDesk'); + $this->log->debug("Exiting HelpDesk method ..."); + } + + /** Function used to get the sort order for HelpDesk listview + * @return string $sorder - first check the $_REQUEST['sorder'] if request value is empty then check in the $_SESSION['HELPDESK_SORT_ORDER'] if this session value is empty then default sort order will be returned. + */ + function getSortOrder() + { + global $log; + $log->debug("Entering getSortOrder() method ..."); + if(isset($_REQUEST['sorder'])) + $sorder = $_REQUEST['sorder']; + else + $sorder = (($_SESSION['HELPDESK_SORT_ORDER'] != '')?($_SESSION['HELPDESK_SORT_ORDER']):($this->default_sort_order)); + $log->debug("Exiting getSortOrder() method ..."); + return $sorder; + } + + /** Function used to get the order by value for HelpDesk listview + * @return string $order_by - first check the $_REQUEST['order_by'] if request value is empty then check in the $_SESSION['HELPDESK_ORDER_BY'] if this session value is empty then default order by will be returned. + */ + function getOrderBy() + { + global $log; + $log->debug("Entering getOrderBy() method ..."); + if (isset($_REQUEST['order_by'])) + $order_by = $_REQUEST['order_by']; + else + $order_by = (($_SESSION['HELPDESK_ORDER_BY'] != '')?($_SESSION['HELPDESK_ORDER_BY']):($this->default_order_by)); + $log->debug("Exiting getOrderBy method ..."); + return $order_by; + } + + /** Function to form the query to get the list of activities + * @param int $id - ticket id + * @return array - return an array which will be returned from the function GetRelatedList + **/ + function get_activities($id) + { + global $log; + $log->debug("Entering get_activities(".$id.") method ..."); + global $mod_strings; + global $app_strings; + require_once('modules/Calendar/Activity.php'); + $focus = new Activity(); + + $button = ''; + + $returnset = '&return_module=HelpDesk&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_activity.*, vtiger_crmentity.crmid, vtiger_recurringevents.recurringtype, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_users.user_name from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.crmid=".$id." and (activitytype='Task' or activitytype='Call' or activitytype='Meeting') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held')"; + $log->debug("Exiting get_activities method ..."); + + return GetRelatedList('HelpDesk','Calendar',$focus,$query,$button,$returnset); + } + + /** Function to get the Ticket History information as in array format + * @param int $ticketid - ticket id + * @return array - return an array with title and the ticket history informations in the following format + array( + header=>array('0'=>'title'), + entries=>array('0'=>'info1','1'=>'info2',etc.,) + ) + */ + function get_ticket_history($ticketid) + { + global $log, $adb; + $log->debug("Entering into get_ticket_history($ticketid) method ..."); + + $query="select title,update_log from vtiger_troubletickets where ticketid=".$ticketid; + $result=$adb->query($query); + $update_log = $adb->query_result($result,0,"update_log"); + + $splitval = split('--//--',trim($update_log,'--//--')); + + $header[] = $adb->query_result($result,0,"title"); + + $return_value = Array('header'=>$header,'entries'=>$splitval); + + $log->debug("Exiting from get_ticket_history($ticketid) method ..."); + + return $return_value; + } + + /** Function to form the query to get the list of attachments and notes + * @param int $id - ticket id + * @return array - return an array which will be returned from the function getAttachmentsAndNotes + **/ + function get_attachments($id) + { + global $log; + $log->debug("Entering get_attachments(".$id.") method ..."); + $query = "select vtiger_notes.title,'Notes ' ActivityType, vtiger_notes.filename, + vtiger_attachments.type FileType,crm2.modifiedtime lastmodified, + vtiger_seattachmentsrel.attachmentsid attachmentsid, vtiger_notes.notesid crmid, + crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name + from vtiger_notes + inner join vtiger_senotesrel on vtiger_senotesrel.notesid= vtiger_notes.notesid + inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_senotesrel.crmid + inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_notes.notesid and crm2.deleted=0 + left join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid =vtiger_notes.notesid + left join vtiger_attachments on vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid + inner join vtiger_users on crm2.smcreatorid= vtiger_users.id + where vtiger_crmentity.crmid=".$id; + + $query .= ' union all '; + + $query .= "select vtiger_attachments.description title ,'Attachments' ActivityType, + vtiger_attachments.name filename, vtiger_attachments.type FileType,crm2.modifiedtime lastmodified, + vtiger_attachments.attachmentsid attachmentsid, vtiger_seattachmentsrel.attachmentsid crmid, + crm2.createdtime, vtiger_attachments.description, vtiger_users.user_name + from vtiger_attachments + inner join vtiger_seattachmentsrel on vtiger_seattachmentsrel.attachmentsid= vtiger_attachments.attachmentsid + inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_seattachmentsrel.crmid + inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_attachments.attachmentsid + left join vtiger_users on crm2.smcreatorid= vtiger_users.id + where vtiger_crmentity.crmid=".$id; + $log->debug("Exiting get_attachments method ..."); + return getAttachmentsAndNotes('HelpDesk',$query,$id); + } + + /** Function to get the ticket comments as a array + * @param int $ticketid - ticketid + * @return array $output - array( + [$i][comments] => comments + [$i][owner] => name of the user or customer who made the comment + [$i][createdtime] => the comment created time + ) + where $i = 0,1,..n which are all made for the ticket + **/ + function get_ticket_comments_list($ticketid) + { + global $log; + $log->debug("Entering get_ticket_comments_list(".$ticketid.") method ..."); + $sql = "select * from vtiger_ticketcomments where ticketid=".$ticketid." order by createdtime DESC"; + $result = $this->db->query($sql); + $noofrows = $this->db->num_rows($result); + for($i=0;$i<$noofrows;$i++) + { + $ownerid = $this->db->query_result($result,$i,"ownerid"); + $ownertype = $this->db->query_result($result,$i,"ownertype"); + if($ownertype == 'user') + $name = getUserName($ownerid); + elseif($ownertype == 'customer') + { + $sql1 = 'select * from vtiger_portalinfo where id='.$ownerid; + $name = $this->db->query_result($this->db->query($sql1),0,'user_name'); + } + + $output[$i]['comments'] = nl2br($this->db->query_result($result,$i,"comments")); + $output[$i]['owner'] = $name; + $output[$i]['createdtime'] = $this->db->query_result($result,$i,"createdtime"); + } + $log->debug("Exiting get_ticket_comments_list method ..."); + return $output; + } + + /** Function to form the query which will give the list of tickets based on customername and id ie., contactname and contactid + * @param string $user_name - name of the customer ie., contact name + * @param int $id - contact id + * @return array - return an array which will be returned from the function process_list_query + **/ + function get_user_tickets_list($user_name,$id,$where='',$match='') + { + global $log; + $log->debug("Entering get_user_tickets_list(".$user_name.",".$id.",".$where.",".$match.") method ..."); + + $this->db->println("where ==> ".$where); + + $query = "select vtiger_crmentity.crmid, vtiger_troubletickets.*, vtiger_crmentity.smownerid, vtiger_crmentity.createdtime, vtiger_crmentity.modifiedtime, vtiger_contactdetails.firstname, vtiger_contactdetails.lastname, vtiger_products.productid, vtiger_products.productname, vtiger_ticketcf.* from vtiger_troubletickets inner join vtiger_ticketcf on vtiger_ticketcf.ticketid = vtiger_troubletickets.ticketid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_troubletickets.ticketid left join vtiger_contactdetails on vtiger_troubletickets.parent_id=vtiger_contactdetails.contactid left join vtiger_products on vtiger_products.productid = vtiger_troubletickets.product_id left join vtiger_users on vtiger_crmentity.smownerid=vtiger_users.id where vtiger_crmentity.deleted=0 and vtiger_contactdetails.email='".$user_name."' and vtiger_troubletickets.parent_id = '".$id."'"; + + if(trim($where) != '') + { + if($match == 'all' || $match == '') + { + $join = " and "; + } + elseif($match == 'any') + { + $join = " or "; + } + $where = explode("&&&",$where); + $count = count($where); + $count --; + $where_conditions = ""; + foreach($where as $key => $value) + { + $this->db->println('key : '.$key.'...........value : '.$value); + $val = explode(" = ",$value); + $this->db->println('val0 : '.$val[0].'...........val1 : '.$val[1]); + if($val[0] == 'vtiger_troubletickets.title') + { + $where_conditions .= $val[0]." ".$val[1]; + if($count != $key) $where_conditions .= $join; + } + elseif($val[1] != '' && $val[1] != 'Any') + { + $where_conditions .= $val[0]." = ".$val[1]; + if($count != $key) $where_conditions .= $join; + } + } + if($where_conditions != '') + $where_conditions = " and ( ".$where_conditions." ) "; + + $query .= $where_conditions; + $this->db->println("where condition for customer portal tickets search : ".$where_conditions); + } + + $query .= " order by vtiger_crmentity.crmid desc"; + $log->debug("Exiting get_user_tickets_list method ..."); + return $this->process_list_query($query); + } + + /** Function to process the list query and return the result with number of rows + * @param string $query - query + * @return array $response - array( list => array( + $i => array(key => val) + ), + row_count => '', + next_offset => '', + previous_offset =>'' + ) + where $i=0,1,..n & key = ticketid, title, firstname, ..etc(range_fields) & val = value of the key from db retrieved row + **/ + function process_list_query($query) + { + global $log; + $log->debug("Entering process_list_query(".$query.") method ..."); + + $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); + $list = Array(); + $rows_found = $this->db->getRowCount($result); + if($rows_found != 0) + { + $ticket = Array(); + for($index = 0 , $row = $this->db->fetchByAssoc($result, $index); $row && $index <$rows_found;$index++, $row = $this->db->fetchByAssoc($result, $index)) + { + foreach($this->range_fields as $columnName) + { + if (isset($row[$columnName])) + { + $ticket[$columnName] = $row[$columnName]; + } + else + { + $ticket[$columnName] = ""; + } + } + $list[] = $ticket; + } + } + + $response = Array(); + $response['list'] = $list; + $response['row_count'] = $rows_found; + $response['next_offset'] = $next_offset; + $response['previous_offset'] = $previous_offset; + + $log->debug("Exiting process_list_query method ..."); + return $response; + } + + /** Function to get the HelpDesk field labels in caps letters without space + * @return array $mergeflds - array( key => val ) where key=0,1,2..n & val = ASSIGNEDTO,RELATEDTO, .,etc + **/ + function getColumnNames_Hd() + { + global $log,$current_user; + $log->debug("Entering getColumnNames_Hd() method ..."); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select fieldlabel from vtiger_field where tabid=13 and block <> 30 "; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldlabel from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=13 and vtiger_field.block <> 30 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result = $this->db->query($sql1); + $numRows = $this->db->num_rows($result); + for($i=0; $i < $numRows;$i++) + { + $custom_fields[$i] = $this->db->query_result($result,$i,"fieldlabel"); + $custom_fields[$i] = ereg_replace(" ","",$custom_fields[$i]); + $custom_fields[$i] = strtoupper($custom_fields[$i]); + } + $mergeflds = $custom_fields; + $log->debug("Exiting getColumnNames_Hd method ..."); + return $mergeflds; + } + + /** Function to get the list of comments for the given ticket id + * @param int $ticketid - Ticket id + * @return list $list - return the list of comments and comment informations as a html output where as these comments and comments informations will be formed in div tag. + **/ + function getCommentInformation($ticketid) + { + global $log; + $log->debug("Entering getCommentInformation(".$ticketid.") method ..."); + global $adb; + global $mod_strings; + $sql = "select * from vtiger_ticketcomments where ticketid=".$ticketid; + $result = $adb->query($sql); + $noofrows = $adb->num_rows($result); + + if($noofrows == 0) + { + $log->debug("Exiting getCommentInformation method ..."); + return ''; + } + + $list .= '
'; + for($i=0;$i<$noofrows;$i++) + { + if($adb->query_result($result,$i,'comments') != '') + { + //this div is to display the comment + $list .= '
'; + $list .= make_clickable(nl2br($adb->query_result($result,$i,'comments'))); + + $list .= '
'; + + //this div is to display the author and time + $list .= '
'; + $list .= $mod_strings['LBL_AUTHOR'].' : '; + + if($adb->query_result($result,$i,'ownertype') == 'user') + $list .= getUserName($adb->query_result($result,$i,'ownerid')); + else + $list .= $this->getCustomerName($ticketid); + + $list .= ' on '.$adb->query_result($result,$i,'createdtime').'  '; + + $list .= '
'; + } + } + $list .= '
'; + + $log->debug("Exiting getCommentInformation method ..."); + return $list; + } + + /** Function to get the Customer Name who has made comment to the ticket from the customer portal + * @param int $id - Ticket id + * @return string $customername - The contact name + **/ + function getCustomerName($id) + { + global $log; + $log->debug("Entering getCustomerName(".$id.") method ..."); + global $adb; + $sql = "select * from vtiger_portalinfo inner join vtiger_troubletickets on vtiger_troubletickets.parent_id = vtiger_portalinfo.id where vtiger_troubletickets.ticketid=".$id; + $result = $adb->query($sql); + $customername = $adb->query_result($result,0,'user_name'); + $log->debug("Exiting getCustomerName method ..."); + return $customername; + } + + /** Function used to get the Activity History + * @param int $id - ticket id to which we want to display the activity history + * @return array - return an array which will be returned from the function getHistory + */ + function get_history($id) + { + global $log; + $log->debug("Entering get_history(".$id.") method ..."); + $query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.status, vtiger_activity.eventstatus, + vtiger_activity.activitytype, vtiger_troubletickets.ticketid, vtiger_troubletickets.title, vtiger_crmentity.modifiedtime, + vtiger_crmentity.createdtime, vtiger_crmentity.description, vtiger_users.user_name + from vtiger_activity + inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid= vtiger_activity.activityid + inner join vtiger_troubletickets on vtiger_troubletickets.ticketid = vtiger_seactivityrel.crmid + inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid + left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid + left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname + inner join vtiger_users on vtiger_crmentity.smcreatorid= vtiger_users.id + where (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') + and (vtiger_activity.status = 'Completed' or vtiger_activity.status = 'Deferred' or (vtiger_activity.eventstatus = 'Held' and vtiger_activity.eventstatus != '')) + and vtiger_seactivityrel.crmid=".$id; + //Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php + $log->debug("Entering get_history method ..."); + return getHistory('HelpDesk',$query,$id); + } + + + +} +?> Modified: vtigercrm/trunk/modules/Leads/Lead.php ============================================================================== --- vtigercrm/trunk/modules/Leads/Lead.php (original) +++ vtigercrm/trunk/modules/Leads/Lead.php Wed Aug 23 08:00:50 2006 @@ -382,9 +382,17 @@ */ function getColumnNames_Lead() { - global $log; + global $log,$current_user; $log->debug("Entering getColumnNames_Lead() method ..."); - $sql1 = "select fieldlabel from vtiger_field where tabid=7"; + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select fieldlabel from vtiger_field where tabid=7"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldlabel from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=7 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } $result = $this->db->query($sql1); $numRows = $this->db->num_rows($result); for($i=0; $i < $numRows;$i++) From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 10:01:26 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 23 Aug 2006 17:01:26 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9079 - in /wordintegration/trunk/client/source: frmvtigerTempate.frm modGeneral.bas vtigerCRMWordPlugin.vbw Message-ID: <20060823170126.3F34675E6E5@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 11:01:15 2006 New Revision: 9079 Log: Security for wordPlugin has been integrated --Jeri Modified: wordintegration/trunk/client/source/frmvtigerTempate.frm wordintegration/trunk/client/source/modGeneral.bas wordintegration/trunk/client/source/vtigerCRMWordPlugin.vbw Modified: wordintegration/trunk/client/source/frmvtigerTempate.frm ============================================================================== Binary files - no diff available. Modified: wordintegration/trunk/client/source/modGeneral.bas ============================================================================== Binary files - no diff available. Modified: wordintegration/trunk/client/source/vtigerCRMWordPlugin.vbw ============================================================================== Binary files - no diff available. From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 10:05:02 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 23 Aug 2006 17:05:02 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9080 - in /wordintegration/trunk/client/bin/Language: deutsch.ini portuguese.ini Message-ID: <20060823170502.B4ED875E6E5@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 11:04:48 2006 New Revision: 9080 Log: Deutch and portuguese language pack added --Jeri Added: wordintegration/trunk/client/bin/Language/deutsch.ini wordintegration/trunk/client/bin/Language/portuguese.ini From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 21:29:14 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 04:29:14 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9082 - /vtigercrm/trunk/include/utils/ListViewUtils.php Message-ID: <20060824042914.65AD875E73D@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 22:29:10 2006 New Revision: 9082 Log: changes made to reduce the no. of currency query --Minnie Modified: vtigercrm/trunk/include/utils/ListViewUtils.php Modified: vtigercrm/trunk/include/utils/ListViewUtils.php ============================================================================== --- vtigercrm/trunk/include/utils/ListViewUtils.php (original) +++ vtigercrm/trunk/include/utils/ListViewUtils.php Wed Aug 23 22:29:10 2006 @@ -156,8 +156,7 @@ //added to display vtiger_currency symbol in listview header if($lbl_name =='Amount') { - $currencyid=fetchCurrency($current_user->id); - $rate_symbol=getCurrencySymbolandCRate($currencyid); + $rate_symbol=getCurrencySymbolandCRate($user_info['currency_id']); $curr_symbol = $rate_symbol['symbol']; $lbl_name .=': (in '.$curr_symbol.')'; } @@ -187,8 +186,7 @@ //added to display vtiger_currency symbol in related listview header if($name =='Amount' && $relatedlist !='' ) { - $currencyid=fetchCurrency($current_user->id); - $rate_symbol=getCurrencySymbolandCRate($currencyid); + $rate_symbol=getCurrencySymbolandCRate($user_info['currency_id']); $curr_symbol = $rate_symbol['symbol']; $name .=': (in '.$curr_symbol.')'; } @@ -979,9 +977,7 @@ global $log; $log->debug("Entering getValue(".$field_result.",". $list_result.",".$fieldname.",".$focus.",".$module.",".$entity_id.",".$list_result_count.",".$mode.",".$popuptype.",".$returnset.",".$viewid.") method ..."); global $adb,$current_user; - $currencyid=fetchCurrency($current_user->id); - $rate_symbol=getCurrencySymbolandCRate($currencyid); - $rate = $rate_symbol['rate']; + require('user_privileges/user_privileges_'.$current_user->id.'.php'); $tabname = getParentTab(); $uicolarr=$field_result[$fieldname]; foreach($uicolarr as $key=>$value) @@ -1022,6 +1018,8 @@ } elseif($uitype == 71 || $uitype == 72) { + $rate_symbol=getCurrencySymbolandCRate($user_info['currency_id']); + $rate = $rate_symbol['rate']; if($temp_val != '' && $temp_val != 0) { //changes made to remove vtiger_currency symbol infront of each vtiger_potential amount $value = convertFromDollar($temp_val,$rate); @@ -1343,7 +1341,8 @@ $tax_str .= $tax_details[$tax_count]['taxname'].'='.$tax_details[$tax_count]['percentage'].','; } $tax_str = trim($tax_str,','); - + $rate_symbol=getCurrencySymbolandCRate($user_info['currency_id']); + $rate = $rate_symbol['rate']; $unitprice=$adb->query_result($list_result,$list_result_count,'unit_price'); $unitprice = convertFromDollar($unitprice,$rate); $qty_stock=$adb->query_result($list_result,$list_result_count,'qtyinstock'); @@ -1362,7 +1361,8 @@ $tax_str .= $tax_details[$tax_count]['taxname'].'='.$tax_details[$tax_count]['percentage'].','; } $tax_str = trim($tax_str,','); - + $rate_symbol=getCurrencySymbolandCRate($user_info['currency_id']); + $rate = $rate_symbol['rate']; $unitprice=$adb->query_result($list_result,$list_result_count,'unit_price'); $unitprice = convertFromDollar($unitprice,$rate); $value = ''.$temp_val.''; @@ -1541,6 +1541,8 @@ } elseif($fieldname == 'hdnGrandTotal' || $fieldname == 'expectedroi' || $fieldname == 'actualroi' || $fieldname == 'actualcost' || $fieldname == 'budgetcost' || $fieldname == 'expectedrevenue') { + $rate_symbol=getCurrencySymbolandCRate($user_info['currency_id']); + $rate = $rate_symbol['rate']; $value = convertFromDollar($temp_val,$rate); } else From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 21:39:56 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 04:39:56 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9083 - /vtigercrm/trunk/include/utils/EditViewUtils.php Message-ID: <20060824043956.31E7975E73D@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 22:39:52 2006 New Revision: 9083 Log: changes made to reduce the no. of currency query --Minnie 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 Wed Aug 23 22:39:52 2006 @@ -58,11 +58,6 @@ $custfld = ''; $ui_type[]= $uitype; $editview_fldname[] = $fieldname; - - $currencyid=fetchCurrency($current_user->id); - $rate_symbol = getCurrencySymbolandCRate($currencyid); - $rate = $rate_symbol['rate']; - $currency= $rate_symbol['symbol']; if($generatedtype == 2) $mod_strings[$fieldlabel] = $fieldlabel; @@ -983,6 +978,9 @@ elseif($uitype == 71 || $uitype == 72) { + $rate_symbol = getCurrencySymbolandCRate($user_info['currency_id']); + $rate = $rate_symbol['rate']; + $currency= $rate_symbol['symbol']; $editview_label[]=$mod_strings[$fieldlabel].': ('.$currency.')'; if($value!='') $fieldvalue[] = convertFromDollar($value,$rate); From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 21:42:23 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 04:42:23 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9084 - /vtigercrm/trunk/include/utils/ListViewUtils.php Message-ID: <20060824044223.C288375E74E@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 22:42:09 2006 New Revision: 9084 Log: Updated ListviewUtils to get the sorting of header proper for singlepane view -- ahmed Modified: vtigercrm/trunk/include/utils/ListViewUtils.php Modified: vtigercrm/trunk/include/utils/ListViewUtils.php ============================================================================== --- vtigercrm/trunk/include/utils/ListViewUtils.php (original) +++ vtigercrm/trunk/include/utils/ListViewUtils.php Wed Aug 23 22:42:09 2006 @@ -23,6 +23,7 @@ require_once('include/database/PearDatabase.php'); require_once('include/ComboUtil.php'); //new require_once('include/utils/CommonUtils.php'); //new +require_once('user_privileges/default_module_view.php'); //new /**This function is used to get the list view header values in a list view *Param $focus - module object @@ -36,7 +37,7 @@ */ function getListViewHeader($focus, $module,$sort_qry='',$sorder='',$order_by='',$relatedlist='',$oCv='',$relatedmodule='') { - global $log; + global $log, $singlepane_view; $log->debug("Entering getListViewHeader(".$focus.",". $module.",".$sort_qry.",".$sorder.",".$order_by.",".$relatedlist.",".$oCv.") method ..."); global $adb; global $theme; @@ -161,7 +162,10 @@ $lbl_name .=': (in '.$curr_symbol.')'; } if($relatedlist !='' && $relatedlist != 'global') - $name = "".$lbl_name." ".$arrow.""; + if($singlepane_view == 'true') + $name = "".$lbl_name." ".$arrow.""; + else + $name = "".$lbl_name." ".$arrow.""; elseif($module == 'Users' && $name == 'User Name') $name = "".$mod_strings['LBL_LIST_USER_NAME_ROLE']." ".$arrow.""; elseif($relatedlist == "global") @@ -2738,14 +2742,18 @@ */ //Temp function to be be deleted -function getRelatedTableHeaderNavigation($navigation_array, $url_qry,$module='',$action_val='CallRelatedList',$viewid='') +function getRelatedTableHeaderNavigation($navigation_array, $url_qry,$module='',$action_val='',$viewid='') { - global $log; + global $log, $singlepane_view; $log->debug("Entering getTableHeaderNavigation(".$navigation_array.",". $url_qry.",".$module.",".$action_val.",".$viewid.") method ..."); global $theme; $theme_path="themes/".$theme."/"; $image_path=$theme_path."images/"; $output = ' -
{$CMOD.LBL_FIELDS_SELECT_DESELECT} ({$APP.Tasks}){$CMOD.LBL_FIELDS_SELECT_DESELECT}
'.$attachments_title.''.ltrim($filename,$ticketid.'_').''.ltrim($filename,$ticketid.'_').'
  '; + if($singlepane_view == 'true') + $action_val = 'DetailView'; + else + $action_val = 'CallRelatedList'; if(($navigation_array['prev']) != 0) { $output .= ' '; From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 21:44:29 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 04:44:29 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9085 - /vtigercrm/trunk/user_privileges/default_module_view.php Message-ID: <20060824044429.4D7CA75E74E@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 22:44:19 2006 New Revision: 9085 Log: Added a new file default_module_view.php for writing the status of detail view (Singlepane/Multi) -- Ahmed Added: vtigercrm/trunk/user_privileges/default_module_view.php From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 21:47:06 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 04:47:06 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9086 - /vtigercrm/trunk/Smarty/templates/Inventory/InventoryDetailView.tpl Message-ID: <20060824044706.EB7B475E73D@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 22:46:49 2006 New Revision: 9086 Log: Updated InventoryDetailView.tpl for single pane view for Inventory modules -- Ahmed Modified: vtigercrm/trunk/Smarty/templates/Inventory/InventoryDetailView.tpl Modified: vtigercrm/trunk/Smarty/templates/Inventory/InventoryDetailView.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/Inventory/InventoryDetailView.tpl (original) +++ vtigercrm/trunk/Smarty/templates/Inventory/InventoryDetailView.tpl Wed Aug 23 22:46:49 2006 @@ -49,14 +49,8 @@ - - - - + {if $SinglePane_View eq 'false'} + + {/if}
  - - {include file='DetailViewHidden.tpl'} -
- {include file='Buttons_List1.tpl'} @@ -90,8 +84,9 @@
  {$MOD[$SINGLE_MOD]} {$APP.LBL_INFORMATION}  {$APP.LBL_MORE} {$APP.LBL_INFORMATION}{$APP.LBL_MORE} {$APP.LBL_INFORMATION} 
@@ -112,6 +107,8 @@ + + {include file='DetailViewHidden.tpl'} {strip} @@ -219,6 +216,7 @@
+ {if $SinglePane_View eq 'false'} {strip} @@ -251,6 +249,15 @@ {/strip}
+{/if} + + + +
+ {if $SinglePane_View eq 'true'} + {include file= 'RelatedListNew.tpl'} + {/if} +
@@ -310,7 +317,6 @@
+query($cvObj->getModifiedCvListQuery($_REQUEST["cvid"],$listquery,$_REQUEST["list_type"])); + +if($_REQUEST["list_type"] == "Leads") + $reltable = "vtiger_campaignleadrel"; +elseif($_REQUEST["list_type"] == "Contacts") + $reltable = "vtiger_campaigncontrel"; + +while($row=$adb->fetch_array($rs)) { + $adb->query("INSERT INTO ".$reltable." VALUES('".$_REQUEST["return_id"]."','".$row["crmid"]."')"); +} + +if ($singlepane_view == 'true') +{ +?> + + + + Modified: vtigercrm/trunk/modules/Campaigns/updateRelations.php ============================================================================== --- vtigercrm/trunk/modules/Campaigns/updateRelations.php (original) +++ vtigercrm/trunk/modules/Campaigns/updateRelations.php Wed Aug 23 23:10:05 2006 @@ -1,53 +1,61 @@ -query($sql); - $sql = "update ".$mod_table." set campaignid = ".$_REQUEST["parentid"]." where ".$mod_field." = ".$id; - $adb->query($sql); - } - } - header("Location: index.php?action=CallRelatedList&module=Campaigns&record=".$_REQUEST["parentid"]); -} -elseif(isset($_REQUEST['entityid']) && $_REQUEST['entityid'] != '') -{ - $sql = "insert into ".$rel_table." values(".$_REQUEST["parid"].",".$_REQUEST["entityid"].")"; - $adb->query($sql); - $sql = "update ".$mod_table." set campaignid = ".$_REQUEST["parid"]." where ".$mod_field." = ".$_REQUEST["entityid"]; - $adb->query($sql); - header("Location: index.php?action=CallRelatedList&module=Campaigns&record=".$_REQUEST["parid"]); -} - -?> +query($sql); + $sql = "update ".$mod_table." set campaignid = ".$_REQUEST["parentid"]." where ".$mod_field." = ".$id; + $adb->query($sql); + } + } + if($singlepane_view == 'true') + header("Location: index.php?action=DetailView&module=Campaigns&record=".$_REQUEST["parentid"]); + else + header("Location: index.php?action=CallRelatedList&module=Campaigns&record=".$_REQUEST["parentid"]); +} +elseif(isset($_REQUEST['entityid']) && $_REQUEST['entityid'] != '') +{ + $sql = "insert into ".$rel_table." values(".$_REQUEST["parid"].",".$_REQUEST["entityid"].")"; + $adb->query($sql); + $sql = "update ".$mod_table." set campaignid = ".$_REQUEST["parid"]." where ".$mod_field." = ".$_REQUEST["entityid"]; + $adb->query($sql); + + if($singlepane_view == 'true') + header("Location: index.php?action=DetailView&module=Campaigns&record=".$_REQUEST["parid"]); + else + header("Location: index.php?action=CallRelatedList&module=Campaigns&record=".$_REQUEST["parid"]); +} + +?> From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 22:11:16 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:11:16 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9097 - /vtigercrm/trunk/modules/Potentials/Charts.php Message-ID: <20060824051116.A2B7375E76C@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:11:13 2006 New Revision: 9097 Log: changes made to fix the dashboard issue --Minnie Modified: vtigercrm/trunk/modules/Potentials/Charts.php Modified: vtigercrm/trunk/modules/Potentials/Charts.php ============================================================================== --- vtigercrm/trunk/modules/Potentials/Charts.php (original) +++ vtigercrm/trunk/modules/Potentials/Charts.php Wed Aug 23 23:11:13 2006 @@ -127,7 +127,7 @@ } if (isset($record->column_fields['amount'])) { // Strip all non numbers from this string. - $amount = ereg_replace('[^0-9]', '', $record->column_fields['amount']); + $amount = ereg_replace('[^0-9]', '', floor($record->column_fields['amount'])); $sum[$month][$sales_stage] = $sum[$month][$sales_stage] + $amount; if (isset($count[$month][$sales_stage])) { $count[$month][$sales_stage]++; @@ -261,10 +261,10 @@ $gbplot->setBackground(Image_Graph::factory('gradient', array(IMAGE_GRAPH_GRAD_VERTICAL, 'white', '#E5E5E5'))); // Setup title - //$titlestr = $current_module_strings['LBL_TOTAL_PIPELINE'].$curr_symbol.$total.$app_strings['LBL_THOUSANDS_SYMBOL']; - $titlestr = $current_module_strings['LBL_TOTAL_PIPELINE'].$curr_symbol.$total; - - $title->setText($titleStr); + $titlestr = $current_module_strings['LBL_TOTAL_PIPELINE'].$curr_symbol.$total.$app_strings['LBL_THOUSANDS_SYMBOL']; + //$titlestr = $current_module_strings['LBL_TOTAL_PIPELINE'].$curr_symbol.$total; + + $title->setText($titlestr); // Create the xaxis labels $array_data =& Image_Graph::factory('Image_Graph_DataPreprocessor_Array', @@ -323,7 +323,7 @@ $marker->setFontSize(8); $gbplot->setMarker($marker); - //$subtitle .= $current_module_strings['LBL_OPP_SIZE'].$curr_symbol.$current_module_strings['LBL_OPP_SIZE_VALUE']; + $subtitle .= $current_module_strings['LBL_OPP_SIZE'].$curr_symbol.$current_module_strings['LBL_OPP_SIZE_VALUE']; $footer->setText($subtitle); $footer->setAlignment(IMAGE_GRAPH_ALIGN_TOP_RIGHT); @@ -471,7 +471,7 @@ } if (isset($record->column_fields['amount'])) { // Strip all non numbers from this string. - $amount = ereg_replace('[^0-9]', '', $record->column_fields['amount']); + $amount = ereg_replace('[^0-9]', '', floor($record->column_fields['amount'])); $sum[$lead_source][$sales_stage] = $sum[$lead_source][$sales_stage] + $amount; if (isset($count[$lead_source][$sales_stage])) { $count[$lead_source][$sales_stage]++; @@ -602,8 +602,8 @@ $gbplot->setBackground(Image_Graph::factory('gradient', array(IMAGE_GRAPH_GRAD_HORIZONTAL, 'white', '#E5E5E5'))); // Setup title - //$titlestr = $current_module_strings['LBL_ALL_OPPORTUNITIES'].$curr_symbol.$total.$app_strings['LBL_THOUSANDS_SYMBOL']; - $titlestr = $current_module_strings['LBL_ALL_OPPORTUNITIES'].$curr_symbol.$total; + $titlestr = $current_module_strings['LBL_ALL_OPPORTUNITIES'].$curr_symbol.$total.$app_strings['LBL_THOUSANDS_SYMBOL']; + //$titlestr = $current_module_strings['LBL_ALL_OPPORTUNITIES'].$curr_symbol.$total; $title->setText($titlestr); // Create the xaxis labels @@ -655,7 +655,7 @@ $gbplot->setMarker($marker); // Finally setup the title - //$subtitle = $current_module_strings['LBL_OPP_SIZE'].$curr_symbol.$current_module_strings['LBL_OPP_SIZE_VALUE']; + $subtitle = $current_module_strings['LBL_OPP_SIZE'].$curr_symbol.$current_module_strings['LBL_OPP_SIZE_VALUE']; $footer->setText($subtitle); $footer->setAlignment(IMAGE_GRAPH_ALIGN_TOP_RIGHT); @@ -793,7 +793,7 @@ } if (isset($record->column_fields['amount'])) { // Strip all non numbers from this string. - $amount = ereg_replace('[^0-9]', '', $record->column_fields['amount']); + $amount = ereg_replace('[^0-9]', '', floor($record->column_fields['amount'])); $sum[$record->column_fields['sales_stage']][$record->column_fields['assigned_user_id']] = $sum[$record->column_fields['sales_stage']][$record->column_fields['assigned_user_id']] + $amount; if (isset($count[$record->column_fields['sales_stage']][$record->column_fields['assigned_user_id']])) { $count[$record->column_fields['sales_stage']][$record->column_fields['assigned_user_id']]++; @@ -915,8 +915,8 @@ $font->setColor($font_color); // Setup title - //$titlestr = $current_module_strings['LBL_TOTAL_PIPELINE'].$curr_symbol.$total.$app_strings['LBL_THOUSANDS_SYMBOL']; - $titlestr = $current_module_strings['LBL_TOTAL_PIPELINE'].$curr_symbol.$total; + $titlestr = $current_module_strings['LBL_TOTAL_PIPELINE'].$curr_symbol.$total.$app_strings['LBL_THOUSANDS_SYMBOL']; + //$titlestr = $current_module_strings['LBL_TOTAL_PIPELINE'].$curr_symbol.$total; $title->setText($titlestr); // Create the xaxis labels @@ -972,7 +972,7 @@ // Finally setup the title - //$subtitle .= $current_module_strings['LBL_OPP_SIZE'].$curr_symbol.$current_module_strings['LBL_OPP_SIZE_VALUE']; + $subtitle .= $current_module_strings['LBL_OPP_SIZE'].$curr_symbol.$current_module_strings['LBL_OPP_SIZE_VALUE']; $footer->setText($subtitle); $footer->setAlignment(IMAGE_GRAPH_ALIGN_TOP_RIGHT); @@ -1069,7 +1069,7 @@ if (!isset($sum[$record->column_fields['leadsource']])) $sum[$record->column_fields['leadsource']] = 0; if (isset($record->column_fields['amount']) && isset($record->column_fields['leadsource'])) { // Strip all non numbers from this string. - $amount = ereg_replace('[^0-9]', '', $record->column_fields['amount']); + $amount = ereg_replace('[^0-9]', '', floor($record->column_fields['amount'])); $sum[$record->column_fields['leadsource']] = $sum[$record->column_fields['leadsource']] + ($amount/1000); if (isset($count[$record->column_fields['leadsource']])) $count[$record->column_fields['leadsource']]++; else $count[$record->column_fields['leadsource']] = 1; @@ -1174,10 +1174,10 @@ $gbplot->setFillStyle($fills); // Setup title -// $titlestr = $current_module_strings['LBL_TOTAL_PIPELINE'].$curr_symbol.$total.$app_strings['LBL_THOUSANDS_SYMBOL']; - $titlestr = $current_module_strings['LBL_TOTAL_PIPELINE'].$curr_symbol.$total; - -$title->setText($titlestr); + $titlestr = $current_module_strings['LBL_TOTAL_PIPELINE'].$curr_symbol.$total.$app_strings['LBL_THOUSANDS_SYMBOL']; + //$titlestr = $current_module_strings['LBL_TOTAL_PIPELINE'].$curr_symbol.$total; + + $title->setText($titlestr); // format the data values $valueproc =& Image_Graph::factory('Image_Graph_DataPreprocessor_Formatted', $curr_symbol."%d"); @@ -1198,7 +1198,7 @@ $legend_box->setFillColor('#F5F5F5'); $legend_box->showShadow(); - //$subtitle = $current_module_strings['LBL_OPP_SIZE'].$curr_symbol.$current_module_strings['LBL_OPP_SIZE_VALUE']; + $subtitle = $current_module_strings['LBL_OPP_SIZE'].$curr_symbol.$current_module_strings['LBL_OPP_SIZE_VALUE']; $footer->setText($subtitle); $footer->setAlignment(IMAGE_GRAPH_ALIGN_TOP_LEFT); From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 22:13:59 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:13:59 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9098 - /vtigercrm/trunk/modules/Calendar/EditView.php Message-ID: <20060824051359.ECB0475E76C@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:13:56 2006 New Revision: 9098 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/EditView.php Modified: vtigercrm/trunk/modules/Calendar/EditView.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/EditView.php (original) +++ vtigercrm/trunk/modules/Calendar/EditView.php Wed Aug 23 23:13:56 2006 @@ -37,8 +37,6 @@ $focus = new Activity(); $smarty = new vtigerCRM_Smarty(); $activity_mode = $_REQUEST['activity_mode']; -if(isset($_REQUEST['activitytype']) && $_REQUEST['activitytype'] != '') - $activitytype = $_REQUEST['activitytype']; if($activity_mode == 'Task') { $tab_type = 'Calendar'; @@ -179,7 +177,6 @@ $smarty->assign("fldlabel_sel",$fldlabel_sel); $smarty->assign("OP_MODE",$disp_view); $smarty->assign("ACTIVITY_MODE",$activity_mode); -$smarty->assign("ACTIVITY_TYPE",$activitytype); $smarty->assign("HOURFORMAT",$format); $smarty->assign("USERSLIST",$userDetails); $smarty->assign("USEREMAILID",$to_email); From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 22:16:49 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:16:49 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9099 - in /vtigercrm/trunk/modules/Contacts: CallRelatedList.php Contact.php DetailView.php updateRelations.php Message-ID: <20060824051649.8A89875E76C@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:16:24 2006 New Revision: 9099 Log: Updated the single pane view feature for detailview in Contacts Modules -- ahmed Modified: vtigercrm/trunk/modules/Contacts/CallRelatedList.php vtigercrm/trunk/modules/Contacts/Contact.php vtigercrm/trunk/modules/Contacts/DetailView.php vtigercrm/trunk/modules/Contacts/updateRelations.php Modified: vtigercrm/trunk/modules/Contacts/CallRelatedList.php ============================================================================== --- vtigercrm/trunk/modules/Contacts/CallRelatedList.php (original) +++ vtigercrm/trunk/modules/Contacts/CallRelatedList.php Wed Aug 23 23:16:24 2006 @@ -56,13 +56,12 @@ $category = getparenttab(); $smarty->assign("CATEGORY",$category); -$smarty->assign("id",$focus->id); +$smarty->assign("ID",$focus->id); $smarty->assign("NAME",$focus->name); $related_array = getRelatedLists($currentModule,$focus); $smarty->assign("RELATEDLISTS", $related_array); $smarty->assign("MODULE",$currentmodule); $smarty->assign("SINGLE_MOD",$app_strings['Contact']); -$smarty->assign("ID",$record ); $smarty->assign("UPDATEINFO",updateInfo($focus->id)); $smarty->assign("MOD",$mod_strings); $smarty->assign("APP",$app_strings); Modified: vtigercrm/trunk/modules/Contacts/Contact.php ============================================================================== --- vtigercrm/trunk/modules/Contacts/Contact.php (original) +++ vtigercrm/trunk/modules/Contacts/Contact.php Wed Aug 23 23:16:24 2006 @@ -31,6 +31,7 @@ require_once('modules/Notes/Note.php'); require_once('modules/Emails/Email.php'); require_once('modules/HelpDesk/HelpDesk.php'); +require_once('user_privileges/default_module_view.php'); // Contact is used to store customer information. @@ -267,7 +268,7 @@ */ function get_opportunities($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_opportunities(".$id.") method ..."); global $mod_strings; @@ -279,7 +280,10 @@ $button .= ' '; } - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; $log->info("Potential Related List for Contact Displayed"); @@ -298,7 +302,7 @@ */ function get_activities($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_activities(".$id.") method ..."); global $mod_strings; @@ -311,7 +315,10 @@ $button .= ' '; $button .= ' '; } - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; $log->info("Activity Related List for Contact Displayed"); @@ -355,13 +362,16 @@ */ function get_tickets($id) { - global $log; + global $log, $singlepane_view; global $app_strings; $log->debug("Entering get_tickets(".$id.") method ..."); $focus = new HelpDesk(); $button = '
  - {if $ACTIVITY_TYPE eq 'Meeting'} - {assign var='meetcheck' value='checked'} - {assign var='callcheck' value=''} - {else} - {assign var='meetcheck' value=''} - {assign var='callcheck' value='checked'} - {/if} + {foreach key=tyeparrkey item=typearr from=$ACTIVITYDATA.activitytype} + {foreach key=sel_value item=value from=$typearr} + {if $value eq 'selected' && $sel_value eq 'Meeting'} + {assign var='meetcheck' value='checked'} + {assign var='callcheck' value=''} + {else} + {assign var='meetcheck' value=''} + {assign var='callcheck' value='checked'} + {/if} + {/foreach} + {/foreach} From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 22:21:42 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:21:42 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9101 - in /vtigercrm/trunk/modules/HelpDesk: CallRelatedList.php DetailView.php HelpDesk.php Message-ID: <20060824052142.A06D875E76C@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:21:26 2006 New Revision: 9101 Log: Updated the single pane view feature for detailview in HelpDesk Module -- ahmed Modified: vtigercrm/trunk/modules/HelpDesk/CallRelatedList.php vtigercrm/trunk/modules/HelpDesk/DetailView.php vtigercrm/trunk/modules/HelpDesk/HelpDesk.php Modified: vtigercrm/trunk/modules/HelpDesk/CallRelatedList.php ============================================================================== --- vtigercrm/trunk/modules/HelpDesk/CallRelatedList.php (original) +++ vtigercrm/trunk/modules/HelpDesk/CallRelatedList.php Wed Aug 23 23:21:26 2006 @@ -50,8 +50,7 @@ $category = getParentTab(); $smarty->assign("CATEGORY",$category); -$smarty->assign("id",$focus->id); -$smarty->assign("ID",$RECORD ); +$smarty->assign("ID",$focus->id); $smarty->assign("MODULE",$currentmodule); $smarty->assign("SINGLE_MOD",$app_strings['Ticket']); $smarty->assign("UPDATEINFO",updateInfo($focus->id)); Modified: vtigercrm/trunk/modules/HelpDesk/DetailView.php ============================================================================== --- vtigercrm/trunk/modules/HelpDesk/DetailView.php (original) +++ vtigercrm/trunk/modules/HelpDesk/DetailView.php Wed Aug 23 23:21:26 2006 @@ -1,109 +1,119 @@ -retrieve_entity_info($_REQUEST['record'],"HelpDesk"); - $focus->name=$focus->column_fields['ticket_title']; -} - -if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') -{ - $focus->id = ""; -} - -//Added code for Error display in sending mail to assigned to user when ticket is created or updated. -if($_REQUEST['mail_error'] != '') -{ - require_once("modules/Emails/mail.php"); - echo parseEmailErrorString($_REQUEST['mail_error']); -} - -global $app_strings; -global $mod_strings; -global $currentModule; - -global $theme; -$theme_path="themes/".$theme."/"; -$image_path=$theme_path."images/"; -require_once($theme_path.'layout_utils.php'); - -$smarty = new vtigerCRM_Smarty; -$smarty->assign("MOD", $mod_strings); -$smarty->assign("APP", $app_strings); - -if (isset($focus->name)) $smarty->assign("NAME", $focus->name); -else $smarty->assign("NAME", ""); -$smarty->assign("BLOCKS", getBlocks($currentModule,"detail_view",'',$focus->column_fields)); -$smarty->assign("TICKETID", $_REQUEST['record']); - -$smarty->assign("CUSTOMFIELD", $cust_fld); -$smarty->assign("SINGLE_MOD", 'HelpDesk'); -$category = getParentTab(); -$smarty->assign("CATEGORY",$category); -$smarty->assign("UPDATEINFO",updateInfo($_REQUEST['record'])); - -if(isPermitted("HelpDesk","EditView",$_REQUEST['record']) == 'yes') - $smarty->assign("EDIT_DUPLICATE","permitted"); - -if(isPermitted("HelpDesk","Delete",$_REQUEST['record']) == 'yes') - $smarty->assign("DELETE","permitted"); - -//Added button for Convert the ticket to FAQ -if(isPermitted("Faq","EditView",'') == 'yes') - $smarty->assign("CONVERTASFAQ","permitted"); - -$smarty->assign("IMAGE_PATH", $image_path); -$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']); -$smarty->assign("ID", $_REQUEST['record']); -if(isPermitted("HelpDesk","Merge",'') == 'yes') -{ - $smarty->assign("MERGEBUTTON","permitted"); - require_once('include/utils/UserInfoUtil.php'); - $wordTemplateResult = fetchWordTemplateList("HelpDesk"); - $tempCount = $adb->num_rows($wordTemplateResult); - $tempVal = $adb->fetch_array($wordTemplateResult); - for($templateCount=0;$templateCount<$tempCount;$templateCount++) - { - $optionString[$tempVal["templateid"]]=$tempVal["filename"]; - $tempVal = $adb->fetch_array($wordTemplateResult); - } - $smarty->assign("WORDTEMPLATEOPTIONS",$app_strings['LBL_SELECT_TEMPLATE_TO_MAIL_MERGE']); - $smarty->assign("TOPTIONS",$optionString); -} - -$check_button = Button_Check($module); -$smarty->assign("CHECK", $check_button); - -$tabid = getTabid("HelpDesk"); -$validationData = getDBValidationData($focus->tab_name,$tabid); -$data = split_validationdataArray($validationData); -$smarty->assign("VALIDATION_DATA_FIELDNAME",$data['fieldname']); -$smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data['datatype']); -$smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']); - -//Added to display the ticket comments information -$smarty->assign("COMMENT_BLOCK",$focus->getCommentInformation($_REQUEST['record'])); - -$smarty->assign("MODULE",$currentModule); -$smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); -$smarty->display("DetailView.tpl"); -$focus->id = $_REQUEST['record']; - - -?> +retrieve_entity_info($_REQUEST['record'],"HelpDesk"); + $focus->name=$focus->column_fields['ticket_title']; +} + +if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') +{ + $focus->id = ""; +} + +//Added code for Error display in sending mail to assigned to user when ticket is created or updated. +if($_REQUEST['mail_error'] != '') +{ + require_once("modules/Emails/mail.php"); + echo parseEmailErrorString($_REQUEST['mail_error']); +} + +global $app_strings; +global $mod_strings; +global $currentModule, $singlepane_view; + +global $theme; +$theme_path="themes/".$theme."/"; +$image_path=$theme_path."images/"; +require_once($theme_path.'layout_utils.php'); + +$smarty = new vtigerCRM_Smarty; +$smarty->assign("MOD", $mod_strings); +$smarty->assign("APP", $app_strings); + +$focus->id = $_REQUEST['record']; +if (isset($focus->name)) $smarty->assign("NAME", $focus->name); +else $smarty->assign("NAME", ""); +$smarty->assign("BLOCKS", getBlocks($currentModule,"detail_view",'',$focus->column_fields)); +$smarty->assign("TICKETID", $_REQUEST['record']); + +$smarty->assign("CUSTOMFIELD", $cust_fld); +$smarty->assign("SINGLE_MOD", 'HelpDesk'); +$category = getParentTab(); +$smarty->assign("CATEGORY",$category); +$smarty->assign("UPDATEINFO",updateInfo($_REQUEST['record'])); + +if(isPermitted("HelpDesk","EditView",$_REQUEST['record']) == 'yes') + $smarty->assign("EDIT_DUPLICATE","permitted"); + +if(isPermitted("HelpDesk","Delete",$_REQUEST['record']) == 'yes') + $smarty->assign("DELETE","permitted"); + +//Added button for Convert the ticket to FAQ +if(isPermitted("Faq","EditView",'') == 'yes') + $smarty->assign("CONVERTASFAQ","permitted"); + +$smarty->assign("IMAGE_PATH", $image_path); +$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']); +$smarty->assign("ID", $_REQUEST['record']); +if(isPermitted("HelpDesk","Merge",'') == 'yes') +{ + $smarty->assign("MERGEBUTTON","permitted"); + require_once('include/utils/UserInfoUtil.php'); + $wordTemplateResult = fetchWordTemplateList("HelpDesk"); + $tempCount = $adb->num_rows($wordTemplateResult); + $tempVal = $adb->fetch_array($wordTemplateResult); + for($templateCount=0;$templateCount<$tempCount;$templateCount++) + { + $optionString[$tempVal["templateid"]]=$tempVal["filename"]; + $tempVal = $adb->fetch_array($wordTemplateResult); + } + $smarty->assign("WORDTEMPLATEOPTIONS",$app_strings['LBL_SELECT_TEMPLATE_TO_MAIL_MERGE']); + $smarty->assign("TOPTIONS",$optionString); +} + +$check_button = Button_Check($module); +$smarty->assign("CHECK", $check_button); + +$tabid = getTabid("HelpDesk"); +$validationData = getDBValidationData($focus->tab_name,$tabid); +$data = split_validationdataArray($validationData); +$smarty->assign("VALIDATION_DATA_FIELDNAME",$data['fieldname']); +$smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data['datatype']); +$smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']); + +//Added to display the ticket comments information +$smarty->assign("COMMENT_BLOCK",$focus->getCommentInformation($_REQUEST['record'])); + +$smarty->assign("MODULE",$currentModule); +$smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); + +if($singlepane_view == 'true') +{ + $related_array = getRelatedLists($currentModule,$focus); + $smarty->assign("RELATEDLISTS", $related_array); +} + +$smarty->assign("SinglePane_View", $singlepane_view); + +$smarty->display("DetailView.tpl"); + + +?> Modified: vtigercrm/trunk/modules/HelpDesk/HelpDesk.php ============================================================================== --- vtigercrm/trunk/modules/HelpDesk/HelpDesk.php (original) +++ vtigercrm/trunk/modules/HelpDesk/HelpDesk.php Wed Aug 23 23:21:26 2006 @@ -18,7 +18,7 @@ require_once('data/SugarBean.php'); require_once('data/CRMEntity.php'); require_once('include/utils/utils.php'); - +require_once('user_privileges/default_module_view.php'); class HelpDesk extends CRMEntity { var $log; @@ -119,7 +119,7 @@ **/ function get_activities($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_activities(".$id.") method ..."); global $mod_strings; global $app_strings; @@ -128,7 +128,10 @@ $button = ''; - $returnset = '&return_module=HelpDesk&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=HelpDesk&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=HelpDesk&return_action=CallRelatedList&return_id='.$id; $query = "SELECT vtiger_activity.*, vtiger_crmentity.crmid, vtiger_recurringevents.recurringtype, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_users.user_name from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.crmid=".$id." and (activitytype='Task' or activitytype='Call' or activitytype='Meeting') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held')"; $log->debug("Exiting get_activities method ..."); @@ -350,14 +353,14 @@ global $log,$current_user; $log->debug("Entering getColumnNames_Hd() method ..."); require('user_privileges/user_privileges_'.$current_user->id.'.php'); - if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) - { - $sql1 = "select fieldlabel from vtiger_field where tabid=13 and block <> 30 "; + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select fieldlabel from vtiger_field where tabid=13 and block <> 30 "; }else { - $profileList = getCurrentUserProfileList(); - $sql1 = "select fieldlabel from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=13 and vtiger_field.block <> 30 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; - } + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldlabel from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=13 and vtiger_field.block <> 30 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } $result = $this->db->query($sql1); $numRows = $this->db->num_rows($result); for($i=0; $i < $numRows;$i++) From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 22:23:05 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:23:05 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9102 - in /vtigercrm/trunk/modules/Invoice: CallRelatedList.php DetailView.php Invoice.php Message-ID: <20060824052305.05F4575E76C@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:22:53 2006 New Revision: 9102 Log: Updated the single pane view feature for detailview in Invoice Module -- ahmed Modified: vtigercrm/trunk/modules/Invoice/CallRelatedList.php vtigercrm/trunk/modules/Invoice/DetailView.php vtigercrm/trunk/modules/Invoice/Invoice.php Modified: vtigercrm/trunk/modules/Invoice/CallRelatedList.php ============================================================================== --- vtigercrm/trunk/modules/Invoice/CallRelatedList.php (original) +++ vtigercrm/trunk/modules/Invoice/CallRelatedList.php Wed Aug 23 23:22:53 2006 @@ -44,8 +44,7 @@ $smarty->assign("OP_MODE",$_REQUEST['mode']); } -$smarty->assign("id",$focus->id); -$smarty->assign("ID",$RECORD ); +$smarty->assign("ID",$focus->id); $smarty->assign("MODULE",$currentmodule); $smarty->assign("SINGLE_MOD",$app_strings['Invoice']); $smarty->assign("UPDATEINFO",updateInfo($focus->id)); Modified: vtigercrm/trunk/modules/Invoice/DetailView.php ============================================================================== --- vtigercrm/trunk/modules/Invoice/DetailView.php (original) +++ vtigercrm/trunk/modules/Invoice/DetailView.php Wed Aug 23 23:22:53 2006 @@ -26,7 +26,8 @@ require_once('include/CustomFieldUtil.php'); require_once('include/database/PearDatabase.php'); require_once('include/utils/utils.php'); -global $mod_strings,$app_strings,$currentModule,$theme; +require_once('user_privileges/default_module_view.php'); +global $mod_strings,$app_strings,$currentModule,$theme,$singlepane_view; $focus = new Invoice(); if(isset($_REQUEST['record']) && isset($_REQUEST['record'])) { @@ -88,6 +89,15 @@ $smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data['datatype']); $smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); + +if($singlepane_view == 'true') +{ + $related_array = getRelatedLists($currentModule,$focus); + $smarty->assign("RELATEDLISTS", $related_array); +} + +$smarty->assign("SinglePane_View", $singlepane_view); + $smarty->display("Inventory/InventoryDetailView.tpl"); ?> Modified: vtigercrm/trunk/modules/Invoice/Invoice.php ============================================================================== --- vtigercrm/trunk/modules/Invoice/Invoice.php (original) +++ vtigercrm/trunk/modules/Invoice/Invoice.php Wed Aug 23 23:22:53 2006 @@ -27,6 +27,7 @@ require_once('data/SugarBean.php'); require_once('data/CRMEntity.php'); require_once('include/utils/utils.php'); +require_once('user_privileges/default_module_view.php'); // Account is used to store vtiger_account information. class Invoice extends CRMEntity { @@ -151,7 +152,7 @@ */ function get_activities($id) { - global $log; + global $log,$singlepane_view; $log->debug("Entering get_activities(".$id.") method ..."); global $app_strings; require_once('modules/Calendar/Activity.php'); @@ -159,7 +160,10 @@ $button = ''; - $returnset = '&return_module=Invoice&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Invoice&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Invoice&return_action=CallRelatedList&return_id='.$id; $query = "SELECT vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid, vtiger_activity.*,vtiger_seactivityrel.*,vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_users.user_name from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_cntactivityrel.contactid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.crmid=".$id." and activitytype='Task' and vtiger_crmentity.deleted=0 and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Completed') and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Deferred')"; $log->debug("Exiting get_activities method ..."); From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 22:27:31 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:27:31 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9103 - in /vtigercrm/trunk/modules/Leads: CallRelatedList.php DetailView.php Lead.php updateRelations.php Message-ID: <20060824052731.B0D5175E76C@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:27:04 2006 New Revision: 9103 Log: Updated the single pane view feature for detailview in Leads Module -- ahmed Modified: vtigercrm/trunk/modules/Leads/CallRelatedList.php vtigercrm/trunk/modules/Leads/DetailView.php vtigercrm/trunk/modules/Leads/Lead.php vtigercrm/trunk/modules/Leads/updateRelations.php Modified: vtigercrm/trunk/modules/Leads/CallRelatedList.php ============================================================================== --- vtigercrm/trunk/modules/Leads/CallRelatedList.php (original) +++ vtigercrm/trunk/modules/Leads/CallRelatedList.php Wed Aug 23 23:27:04 2006 @@ -55,14 +55,13 @@ $parent_email = getEmailParentsList('Leads',$focus->id); $smarty->assign("HIDDEN_PARENTS_LIST",$parent_email); -$smarty->assign("id",$focus->id); +$smarty->assign("ID",$focus->id); $smarty->assign("NAME",$focus->lastname.' '.$focus->firstname); $related_array = getRelatedLists($currentModule,$focus); $smarty->assign("RELATEDLISTS", $related_array); $smarty->assign("SINGLE_MOD",$app_strings['Lead']); $smarty->assign("REDIR_MOD","leads"); $smarty->assign("MODULE", $currentmodule); -$smarty->assign("ID",$RECORD ); $smarty->assign("UPDATEINFO",updateInfo($focus->id)); $smarty->assign("MOD",$mod_strings); $smarty->assign("APP",$app_strings); Modified: vtigercrm/trunk/modules/Leads/DetailView.php ============================================================================== --- vtigercrm/trunk/modules/Leads/DetailView.php (original) +++ vtigercrm/trunk/modules/Leads/DetailView.php Wed Aug 23 23:27:04 2006 @@ -19,10 +19,11 @@ require_once('include/CustomFieldUtil.php'); require_once('include/utils/utils.php'); require_once('include/utils/UserInfoUtil.php'); +require_once('user_privileges/default_module_view.php'); global $mod_strings; global $app_strings; -global $currentModule; +global $currentModule, $singlepane_view; global $log; $focus = new Lead(); @@ -123,6 +124,15 @@ $smarty->assign("MODULE", $currentModule); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); + +if($singlepane_view == 'true') +{ + $related_array = getRelatedLists($currentModule,$focus); + $smarty->assign("RELATEDLISTS", $related_array); +} + +$smarty->assign("SinglePane_View", $singlepane_view); + $smarty->display("DetailView.tpl"); ?> Modified: vtigercrm/trunk/modules/Leads/Lead.php ============================================================================== --- vtigercrm/trunk/modules/Leads/Lead.php (original) +++ vtigercrm/trunk/modules/Leads/Lead.php Wed Aug 23 23:27:04 2006 @@ -24,6 +24,7 @@ require_once('modules/Emails/Email.php'); require_once('include/ComboUtil.php'); require_once('include/utils/utils.php'); +require_once('user_privileges/default_module_view.php'); class Lead extends CRMEntity { var $log; @@ -193,7 +194,7 @@ */ function get_activities($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_activities(".$id.") method ..."); global $app_strings; @@ -205,7 +206,10 @@ $button .= ' '; $button .= ' '; } - $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Leads&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; // First, get the list of IDs. @@ -220,13 +224,17 @@ */ function get_campaigns($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_campaigns(".$id.") method ..."); global $mod_strings; $focus = new Campaign(); $button = ''; - $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Leads&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; + $log->info("Campaign Related List for Lead Displayed"); $query = "SELECT vtiger_users.user_name, vtiger_campaign.campaignid, vtiger_campaign.campaignname, vtiger_campaign.campaigntype, vtiger_campaign.campaignstatus, vtiger_campaign.expectedrevenue, vtiger_campaign.closingdate, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_campaign inner join vtiger_campaignleadrel on vtiger_campaignleadrel.campaignid=vtiger_campaign.campaignid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_campaign.campaignid left join vtiger_campaigngrouprelation on vtiger_campaign.campaignid=vtiger_campaigngrouprelation.campaignid left join vtiger_groups on vtiger_groups.groupname=vtiger_campaigngrouprelation.groupname left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid where vtiger_campaignleadrel.leadid=".$id." and vtiger_crmentity.deleted=0"; @@ -242,7 +250,7 @@ */ function get_emails($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_emails(".$id.") method ..."); global $mod_strings; require_once('include/RelatedListView.php'); @@ -256,7 +264,10 @@ $button .= ' '; } - $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Leads&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; $query ="select vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.semodule, vtiger_activity.activitytype, vtiger_activity.date_start, vtiger_activity.status, vtiger_activity.priority, vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.modifiedtime, vtiger_users.user_name from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where vtiger_activity.activitytype='Emails' and vtiger_crmentity.deleted=0 and vtiger_seactivityrel.crmid=".$id; $log->debug("Exiting get_emails method ..."); @@ -342,7 +353,7 @@ */ function get_products($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_products(".$id.") method ..."); require_once('modules/Products/Product.php'); global $mod_strings; @@ -356,7 +367,10 @@ { $button .= ' '; } - $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Leads&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; $query = 'select vtiger_products.productid, vtiger_products.productname, vtiger_products.productcode, vtiger_products.commissionrate, vtiger_products.qty_per_unit, vtiger_products.unit_price, vtiger_crmentity.crmid, vtiger_crmentity.smownerid from vtiger_products inner join vtiger_seproductsrel on vtiger_products.productid = vtiger_seproductsrel.productid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_products.productid inner join vtiger_leaddetails on vtiger_leaddetails.leadid = vtiger_seproductsrel.crmid where vtiger_leaddetails.leadid = '.$id.' and vtiger_crmentity.deleted = 0'; $log->debug("Exiting get_products method ..."); @@ -387,12 +401,12 @@ require('user_privileges/user_privileges_'.$current_user->id.'.php'); if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) { - $sql1 = "select fieldlabel from vtiger_field where tabid=7"; - }else - { - $profileList = getCurrentUserProfileList(); - $sql1 = "select fieldlabel from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=7 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; - } + $sql1 = "select fieldlabel from vtiger_field where tabid=7"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldlabel from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=7 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } $result = $this->db->query($sql1); $numRows = $this->db->num_rows($result); for($i=0; $i < $numRows;$i++) Modified: vtigercrm/trunk/modules/Leads/updateRelations.php ============================================================================== --- vtigercrm/trunk/modules/Leads/updateRelations.php (original) +++ vtigercrm/trunk/modules/Leads/updateRelations.php Wed Aug 23 23:27:04 2006 @@ -1,38 +1,46 @@ -query($sql); - } - } - header("Location: index.php?action=CallRelatedList&module=Leads&record=".$_REQUEST["parentid"]); -} -elseif(isset($_REQUEST['entityid']) && $_REQUEST['entityid'] != '') -{ - $sql = "insert into ".$rel_table." values(".$_REQUEST["entityid"].",".$_REQUEST["parid"].")"; - $adb->query($sql); - header("Location: index.php?action=CallRelatedList&module=Leads&record=".$_REQUEST["parid"]); -} - -?> +query($sql); + } + } + if($singlepane_view == 'true') + header("Location: index.php?action=DetailView&module=Leads&record=".$_REQUEST["parentid"]); + else + header("Location: index.php?action=CallRelatedList&module=Leads&record=".$_REQUEST["parentid"]); +} +elseif(isset($_REQUEST['entityid']) && $_REQUEST['entityid'] != '') +{ + $sql = "insert into ".$rel_table." values(".$_REQUEST["entityid"].",".$_REQUEST["parid"].")"; + $adb->query($sql); + + if($singlepane_view == 'true') + header("Location: index.php?action=DetailView&module=Leads&record=".$_REQUEST["parid"]); + else + header("Location: index.php?action=CallRelatedList&module=Leads&record=".$_REQUEST["parid"]); +} + +?> From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 22:29:35 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:29:35 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9104 - /vtigercrm/trunk/modules/Dashboard/HomepageDB.php Message-ID: <20060824052935.3743F75E784@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:29:30 2006 New Revision: 9104 Log: changes made to fix the dashboard issue --Minnie Modified: vtigercrm/trunk/modules/Dashboard/HomepageDB.php Modified: vtigercrm/trunk/modules/Dashboard/HomepageDB.php ============================================================================== --- vtigercrm/trunk/modules/Dashboard/HomepageDB.php (original) +++ vtigercrm/trunk/modules/Dashboard/HomepageDB.php Wed Aug 23 23:29:30 2006 @@ -19,7 +19,8 @@ //if($is_admin) // $homepagedb_query = "select vtiger_crmentity.* from vtiger_crmentity where vtiger_crmentity.setype in ('Accounts','Contacts','Leads','Potentials','Quotes','Invoice','PurchaseOrder','SalesOrder','Activities','HelpDesk','Campaigns') and vtiger_crmentity.deleted=0"; //else - $homepagedb_query = "select vtiger_crmentity.* from vtiger_crmentity where vtiger_crmentity.setype in ('Accounts','Contacts','Leads','Potentials','Quotes','Invoice','PurchaseOrder','SalesOrder','Calendar','HelpDesk','Campaigns') and vtiger_crmentity.deleted=0 and vtiger_crmentity.smownerid=".$current_user->id; + $homepagedb_query = "select * from vtiger_crmentity se left join vtiger_leaddetails le on le.leadid=se.crmid where se.deleted=0 and (le.converted=0 or le.converted is null) and setype in ('Accounts','Contacts','Leads','Potentials','Quotes','Invoice','PurchaseOrder', 'SalesOrder','Calendar','HelpDesk','Campaigns') and se.deleted=0 and se.smownerid=".$current_user->id; + //$homepagedb_query = "select vtiger_crmentity.* from vtiger_crmentity where vtiger_crmentity.setype in ('Accounts','Contacts','Leads','Potentials','Quotes','Invoice','PurchaseOrder','SalesOrder','Calendar','HelpDesk','Campaigns') and vtiger_crmentity.deleted=0 and vtiger_crmentity.smownerid=".$current_user->id; $graph_by="setype"; $graph_title=$mod_strings['recordsforuser'].' '.$current_user->user_name; $module="Home"; From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 22:29:41 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:29:41 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9105 - in /vtigercrm/trunk/modules/Potentials: CallRelatedList.php DetailView.php Opportunity.php updateRelations.php Message-ID: <20060824052941.F1A0B75E757@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:29:28 2006 New Revision: 9105 Log: Updated the single pane view feature for detailview in Potentials Module -- ahmed Modified: vtigercrm/trunk/modules/Potentials/CallRelatedList.php vtigercrm/trunk/modules/Potentials/DetailView.php vtigercrm/trunk/modules/Potentials/Opportunity.php vtigercrm/trunk/modules/Potentials/updateRelations.php Modified: vtigercrm/trunk/modules/Potentials/CallRelatedList.php ============================================================================== --- vtigercrm/trunk/modules/Potentials/CallRelatedList.php (original) +++ vtigercrm/trunk/modules/Potentials/CallRelatedList.php Wed Aug 23 23:29:28 2006 @@ -46,8 +46,7 @@ $category = getParentTab(); $smarty->assign("CATEGORY",$category); $smarty->assign("UPDATEINFO",updateInfo($focus->id)); -$smarty->assign("id",$focus->id); -$smarty->assign("ID",$RECORD ); +$smarty->assign("ID",$focus->id); $smarty->assign("MODULE",$currentModule); $smarty->assign("SINGLE_MOD",$app_strings['Potential']); $smarty->assign("MOD",$mod_strings); Modified: vtigercrm/trunk/modules/Potentials/DetailView.php ============================================================================== --- vtigercrm/trunk/modules/Potentials/DetailView.php (original) +++ vtigercrm/trunk/modules/Potentials/DetailView.php Wed Aug 23 23:29:28 2006 @@ -25,10 +25,11 @@ require_once('modules/Potentials/Opportunity.php'); require_once('include/CustomFieldUtil.php'); require_once('include/utils/utils.php'); +require_once('user_privileges/default_module_view.php'); global $mod_strings; global $app_strings; -global $currentModule; +global $currentModule, $singlepane_view; $focus = new Potential(); $smarty = new vtigerCRM_Smarty; @@ -92,5 +93,14 @@ $smarty->assign("CONVERTMODE",'potentoinvoice'); $smarty->assign("MODULE","Potentials"); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); + +if($singlepane_view == 'true') +{ + $related_array = getRelatedLists($currentModule,$focus); + $smarty->assign("RELATEDLISTS", $related_array); +} + +$smarty->assign("SinglePane_View", $singlepane_view); + $smarty->display("DetailView.tpl"); ?> Modified: vtigercrm/trunk/modules/Potentials/Opportunity.php ============================================================================== --- vtigercrm/trunk/modules/Potentials/Opportunity.php (original) +++ vtigercrm/trunk/modules/Potentials/Opportunity.php Wed Aug 23 23:29:28 2006 @@ -1,491 +1,507 @@ -'crmid','vtiger_potential'=>'potentialid','vtiger_potentialscf'=>'potentialid'); - - var $column_fields = Array(); - - var $sortby_fields = Array('potentialname','amount','closingdate','smownerid'); - - - // This is the list of vtiger_fields that are in the lists. - var $list_fields = Array( - 'Potential'=>Array('potential'=>'potentialname'), - 'Account Name'=>Array('account'=>'accountname'), - 'Sales Stage'=>Array('potential'=>'sales_stage'), - 'Amount'=>Array('potential'=>'amount'), - 'Expected Close'=>Array('potential'=>'closingdate'), - 'Assigned To'=>Array('crmentity','smownerid') - ); - - var $list_fields_name = Array( - 'Potential'=>'potentialname', - 'Account Name'=>'accountid', - 'Sales Stage'=>'sales_stage', - 'Amount'=>'amount', - 'Expected Close'=>'closingdate', - 'Assigned To'=>'assigned_user_id'); - - var $list_link_field= 'potentialname'; - - var $search_fields = Array( - 'Potential'=>Array('potential'=>'potentialname'), - 'Account Name'=>Array('potential'=>'accountid'), - 'Expected Close'=>Array('potential'=>'closedate') - ); - - var $search_fields_name = Array( - 'Potential'=>'potentialname', - 'Account Name'=>'account_id', - 'Expected Close'=>'closingdate' - ); - - var $required_fields = array( - "potentialname"=>1, - "account_id"=>1, - "closingdate"=>1, - "sales_stage"=>1, - "amount"=>1 - ); - - //Added these variables which are used as default order by and sortorder in ListView - var $default_order_by = 'potentialname'; - var $default_sort_order = 'ASC'; - - function Potential() { - $this->log = LoggerManager::getLogger('potential'); - $this->db = new PearDatabase(); - $this->column_fields = getColumnFields('Potentials'); - } - - var $new_schema = true; - - /** - * Function to get sort order - * return string $sorder - sortorder string either 'ASC' or 'DESC' - */ - function getSortOrder() - { - global $log; - $log->debug("Entering getSortOrder() method ..."); - if(isset($_REQUEST['sorder'])) - $sorder = $_REQUEST['sorder']; - else - $sorder = (($_SESSION['POTENTIALS_SORT_ORDER'] != '')?($_SESSION['POTENTIALS_SORT_ORDER']):($this->default_sort_order)); - $log->debug("Exiting getSortOrder() method ..."); - return $sorder; - } - - /** - * Function to get order by - * return string $order_by - fieldname(eg: 'Potentialname') - */ - function getOrderBy() - { - global $log; - $log->debug("Entering getOrderBy() method ..."); - if (isset($_REQUEST['order_by'])) - $order_by = $_REQUEST['order_by']; - else - $order_by = (($_SESSION['POTENTIALS_ORDER_BY'] != '')?($_SESSION['POTENTIALS_ORDER_BY']):($this->default_order_by)); - $log->debug("Exiting getOrderBy method ..."); - return $order_by; - } - - /** Function to create list query - * @param reference variable - order by is passed when the query is executed - * @param reference variable - where condition is passed when the query is executed - * Returns Query. - */ - function create_list_query($order_by, $where) - { - global $log; - $log->debug("Entering create_list_query(".$order_by.",". $where.") method ..."); - // Determine if the vtiger_account name is present in the where clause. - $account_required = ereg("accounts\.name", $where); - - if($account_required) - { - $query = "SELECT vtiger_potential.potentialid, vtiger_potential.potentialname, vtiger_potential.dateclosed FROM vtiger_potential, vtiger_account "; - $where_auto = "account.accountid = vtiger_potential.accountid AND vtiger_crmentity.deleted=0 "; - } - else - { - $query = 'SELECT potentialid, potentialname, smcreatorid, closingdate FROM vtiger_potential inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_potential.potentialid '; - $where_auto = 'AND vtiger_crmentity.deleted=0'; - } - - if($where != "") - $query .= "where $where ".$where_auto; - else - $query .= "where ".$where_auto; - - if($order_by != "") - $query .= " ORDER BY vtiger_potential.$order_by"; - else - $query .= " ORDER BY vtiger_potential.potentialname"; - - - - $log->debug("Exiting create_list_query method ..."); - return $query; - } - - /** Function to export the Opportunities records in CSV Format - * @param reference variable - order by is passed when the query is executed - * @param reference variable - where condition is passed when the query is executed - * Returns Export Potentials Query. - */ - function create_export_query($order_by, $where) - { - global $log; - $log->debug("Entering create_export_query(".$order_by.",". $where.") method ..."); - - if($this->checkIfCustomTableExists('vtiger_potentialscf')) - { - $query = $this->constructCustomQueryAddendum('vtiger_potentialscf','Potentials') ." - vtiger_potential.*, - vtiger_account.accountname account_name, - vtiger_users.user_name assigned_user_name - FROM vtiger_potential - INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid=vtiger_potential.potentialid - LEFT JOIN vtiger_account on vtiger_potential.accountid=vtiger_account.accountid - left join vtiger_potentialscf on vtiger_potentialscf.potentialid=vtiger_potential.potentialid - left join vtiger_users on vtiger_crmentity.smownerid=vtiger_users.id - where vtiger_crmentity.deleted=0 "; - } - else - { - $query = "SELECT - vtiger_potential.*, - vtiger_account.accountname account_name, - vtiger_users.user_name assigned_user_name - FROM vtiger_potential - inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_potential.potentialid - LEFT JOIN vtiger_users ON vtiger_crmentity.smownerid=vtiger_users.id - LEFT JOIN vtiger_account on vtiger_potential.accountid=vtiger_account.accountid - LEFT JOIN vtiger_potentialscf on vtiger_potentialscf.potentialid=vtiger_potential.potentialid - where vtiger_crmentity.deleted=0 "; - } - - $log->debug("Exiting create_export_query method ..."); - return $query; - - } - - - - /** Returns a list of the associated contacts - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function get_contacts($id) - { - global $log; - $log->debug("Entering get_contacts(".$id.") method ..."); - global $app_strings; - - $focus = new Contact(); - - $button = ''; - - if(isPermitted("Contacts",3,"") == 'yes') - { - - $button .= ' '; - } - $returnset = '&return_module=Potentials&return_action=CallRelatedList&return_id='.$id; - - $query = 'select vtiger_contactdetails.accountid, vtiger_users.user_name,vtiger_groups.groupname,vtiger_potential.potentialid, vtiger_potential.potentialname, vtiger_contactdetails.contactid, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.title, vtiger_contactdetails.department, vtiger_contactdetails.email, vtiger_contactdetails.phone, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_potential inner join vtiger_contpotentialrel on vtiger_contpotentialrel.potentialid = vtiger_potential.potentialid inner join vtiger_contactdetails on vtiger_contpotentialrel.contactid = vtiger_contactdetails.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid left join vtiger_contactgrouprelation on vtiger_contactdetails.contactid=vtiger_contactgrouprelation.contactid left join vtiger_groups on vtiger_groups.groupname=vtiger_contactgrouprelation.groupname left join vtiger_users on vtiger_crmentity.smownerid=vtiger_users.id where vtiger_potential.potentialid = '.$id.' and vtiger_crmentity.deleted=0'; - - $log->debug("Exiting get_contacts method ..."); - return GetRelatedList('Potentials','Contacts',$focus,$query,$button,$returnset); - } - - /** Returns a list of the associated calls - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function get_activities($id) - { - global $log; - $log->debug("Entering get_activities(".$id.") method ..."); - global $mod_strings; - - $focus = new Activity(); - - $button = ''; - - if(isPermitted("Calendar",1,"") == 'yes') - { - - $button .= ' '; - $button .= ' '; - } - $returnset = '&return_module=Potentials&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_activity.*,vtiger_seactivityrel.*,vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_users.user_name, vtiger_recurringevents.recurringtype from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_potential on vtiger_potential.potentialid=vtiger_seactivityrel.crmid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid where vtiger_seactivityrel.crmid=".$id." and (activitytype='Task' or activitytype='Call' or activitytype='Meeting') and vtiger_crmentity.deleted=0 and ((vtiger_activity.status is not NULL && vtiger_activity.status != 'Completed') and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Deferred') or (vtiger_activity.eventstatus != '' && vtiger_activity.eventstatus != 'Held'))"; - $log->debug("Exiting get_activities method ..."); - return GetRelatedList('Potentials','Calendar',$focus,$query,$button,$returnset); - - } - - /** - * Function to get Contact related Products - * @param integer $id - contactid - * returns related Products record in array format - */ - function get_products($id) - { - global $log; - $log->debug("Entering get_products(".$id.") method ..."); - require_once('modules/Products/Product.php'); - global $app_strings; - - $focus = new Product(); - - $button = ''; - - if(isPermitted("Products",1,"") == 'yes') - { - - - $button .= ' '; - } - if(isPermitted("Products",3,"") == 'yes') - { - $button .= ' '; - } - $returnset = '&return_module=Potentials&return_action=CallRelatedList&return_id='.$id; - - $query = 'select vtiger_products.productid, vtiger_products.productname, vtiger_products.productcode, vtiger_products.commissionrate, vtiger_products.qty_per_unit, vtiger_products.unit_price, vtiger_crmentity.crmid, vtiger_crmentity.smownerid from vtiger_products inner join vtiger_seproductsrel on vtiger_products.productid = vtiger_seproductsrel.productid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_products.productid inner join vtiger_potential on vtiger_potential.potentialid = vtiger_seproductsrel.crmid where vtiger_potential.potentialid = '.$id.' and vtiger_crmentity.deleted = 0'; - $log->debug("Exiting get_products method ..."); - return GetRelatedList('Potentials','Products',$focus,$query,$button,$returnset); - } - - /** Function used to get the Sales Stage history of the Potential - * @param $id - potentialid - * return $return_data - array with header and the entries in format Array('header'=>$header,'entries'=>$entries_list) where as $header and $entries_list are array which contains all the column values of an row - */ - function get_stage_history($id) - { - global $log; - $log->debug("Entering get_stage_history(".$id.") method ..."); - - global $adb; - global $mod_strings; - global $app_strings; - - $query = 'select vtiger_potstagehistory.*, vtiger_potential.potentialname from vtiger_potstagehistory inner join vtiger_potential on vtiger_potential.potentialid = vtiger_potstagehistory.potentialid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_potential.potentialid where vtiger_crmentity.deleted = 0 and vtiger_potential.potentialid = '.$id; - $result=$adb->query($query); - $noofrows = $adb->num_rows($result); - - $header[] = $app_strings['LBL_AMOUNT']; - $header[] = $app_strings['LBL_SALES_STAGE']; - $header[] = $app_strings['LBL_PROBABILITY']; - $header[] = $app_strings['LBL_CLOSE_DATE']; - $header[] = $app_strings['LBL_LAST_MODIFIED']; - - while($row = $adb->fetch_array($result)) - { - $entries = Array(); - - $entries[] = $row['amount']; - $entries[] = $row['stage']; - $entries[] = $row['probability']; - $entries[] = getDisplayDate($row['closedate']); - $entries[] = getDisplayDate($row['lastmodified']); - - $entries_list[] = $entries; - } - - $return_data = Array('header'=>$header,'entries'=>$entries_list); - - $log->debug("Exiting get_stage_history method ..."); - - return $return_data; - } - - /** - * Function to get Potential related Task & Event which have activity type Held, Completed or Deferred. - * @param integer $id - * returns related Task or Event record in array format - */ - function get_history($id) - { - global $log; - $log->debug("Entering get_history(".$id.") method ..."); - $query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.status, - vtiger_activity.eventstatus, vtiger_activity.activitytype, vtiger_crmentity.modifiedtime, - vtiger_crmentity.createdtime, vtiger_crmentity.description, vtiger_users.user_name - from vtiger_activity - inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid - inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid - left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid - left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname - inner join vtiger_users on vtiger_crmentity.smcreatorid= vtiger_users.id - where (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') - and (vtiger_activity.status = 'Completed' or vtiger_activity.status = 'Deferred' or (vtiger_activity.eventstatus = 'Held' and vtiger_activity.eventstatus != '')) - and vtiger_seactivityrel.crmid=".$id; - //Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php - - $log->debug("Exiting get_history method ..."); - return getHistory('Potentials',$query,$id); - } - - /** - * Function to get Potential related Attachments - * @param integer $id - * returns related Attachment record in array format - */ - function get_attachments($id) - { - global $log; - $log->debug("Entering get_attachments(".$id.") method ..."); - // Armando L?scher 18.10.2005 -> ?visibleDescription - // Desc: Inserted crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name - // Inserted inner join vtiger_users on crm2.smcreatorid= vtiger_users.id - $query = "select vtiger_notes.title,'Notes ' ActivityType, vtiger_notes.filename, - vtiger_attachments.type FileType, crm2.modifiedtime lastmodified, - vtiger_seattachmentsrel.attachmentsid, vtiger_notes.notesid crmid, - crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name - from vtiger_notes - inner join vtiger_senotesrel on vtiger_senotesrel.notesid= vtiger_notes.notesid - inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_senotesrel.crmid - inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_notes.notesid and crm2.deleted=0 - left join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid =vtiger_notes.notesid - left join vtiger_attachments on vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid - inner join vtiger_users on crm2.smcreatorid= vtiger_users.id - where vtiger_crmentity.crmid=".$id; - $query .= ' union all '; - // Armando L?scher 18.10.2005 -> ?visibleDescription - // Desc: Inserted crm2.createdtime, vtiger_attachments.description, vtiger_users.user_name - // Inserted inner join vtiger_users on crm2.smcreatorid= vtiger_users.id - // Inserted order by createdtime desc - $query .= "select vtiger_attachments.description title ,'Attachments' ActivityType, - vtiger_attachments.name filename, vtiger_attachments.type FileType,crm2.modifiedtime lastmodified, - vtiger_attachments.attachmentsid, vtiger_seattachmentsrel.attachmentsid crmid, - crm2.createdtime, vtiger_attachments.description, vtiger_users.user_name - from vtiger_attachments - inner join vtiger_seattachmentsrel on vtiger_seattachmentsrel.attachmentsid= vtiger_attachments.attachmentsid - inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_seattachmentsrel.crmid - inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_attachments.attachmentsid - inner join vtiger_users on crm2.smcreatorid= vtiger_users.id - where vtiger_crmentity.crmid=".$id." - order by createdtime desc"; - - $log->debug("Exiting get_attachments method ..."); - return getAttachmentsAndNotes('Potentials',$query,$id); - } - - /** - * Function to get Potential related Quotes - * @param integer $id - potentialid - * returns related Quotes record in array format - */ - function get_quotes($id) - { - global $log; - $log->debug("Entering get_quotes(".$id.") method ..."); - global $app_strings; - require_once('modules/Quotes/Quote.php'); - - if($this->column_fields['account_id']!='') - $focus = new Quote(); - - $button = ''; - if(isPermitted("Quotes",1,"") == 'yes') - { - $button .= ' '; - } - $returnset = '&return_module=Potentials&return_action=CallRelatedList&return_id='.$id; - - - $query = "select vtiger_crmentity.*, vtiger_quotes.*, vtiger_potential.potentialname, vtiger_users.user_name from vtiger_quotes inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_quotes.quoteid left outer join vtiger_potential on vtiger_potential.potentialid=vtiger_quotes.potentialid left join vtiger_quotegrouprelation on vtiger_quotes.quoteid=vtiger_quotegrouprelation.quoteid left join vtiger_groups on vtiger_groups.groupname=vtiger_quotegrouprelation.groupname left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where vtiger_crmentity.deleted=0 and vtiger_potential.potentialid=".$id; - $log->debug("Exiting get_quotes method ..."); - return GetRelatedList('Potentials','Quotes',$focus,$query,$button,$returnset); - } - - /** - * Function to get Potential related SalesOrder - * @param integer $id - potentialid - * returns related SalesOrder record in array format - */ - function get_salesorder($id) - { - global $log; - $log->debug("Entering get_salesorder(".$id.") method ..."); - require_once('modules/SalesOrder/SalesOrder.php'); - global $mod_strings; - global $app_strings; - - $focus = new SalesOrder(); - - $button = ''; - if(isPermitted("SalesOrder",1,"") == 'yes') - { - $button .= ' '; - } - - $returnset = '&return_module=Potentials&return_action=CallRelatedList&return_id='.$id; - - - $query = "select vtiger_crmentity.*, vtiger_salesorder.*, vtiger_quotes.subject as quotename, vtiger_account.accountname, vtiger_potential.potentialname from vtiger_salesorder inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_salesorder.salesorderid left outer join vtiger_quotes on vtiger_quotes.quoteid=vtiger_salesorder.quoteid left outer join vtiger_account on vtiger_account.accountid=vtiger_salesorder.accountid left outer join vtiger_potential on vtiger_potential.potentialid=vtiger_salesorder.potentialid left join vtiger_sogrouprelation on vtiger_salesorder.salesorderid=vtiger_sogrouprelation.salesorderid left join vtiger_groups on vtiger_groups.groupname=vtiger_sogrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_potential.potentialid = ".$id; - $log->debug("Exiting get_salesorder method ..."); - return GetRelatedList('Potentials','SalesOrder',$focus,$query,$button,$returnset); - - } - - - - -} - - - -?> +'crmid','vtiger_potential'=>'potentialid','vtiger_potentialscf'=>'potentialid'); + + var $column_fields = Array(); + + var $sortby_fields = Array('potentialname','amount','closingdate','smownerid'); + + + // This is the list of vtiger_fields that are in the lists. + var $list_fields = Array( + 'Potential'=>Array('potential'=>'potentialname'), + 'Account Name'=>Array('account'=>'accountname'), + 'Sales Stage'=>Array('potential'=>'sales_stage'), + 'Amount'=>Array('potential'=>'amount'), + 'Expected Close'=>Array('potential'=>'closingdate'), + 'Assigned To'=>Array('crmentity','smownerid') + ); + + var $list_fields_name = Array( + 'Potential'=>'potentialname', + 'Account Name'=>'accountid', + 'Sales Stage'=>'sales_stage', + 'Amount'=>'amount', + 'Expected Close'=>'closingdate', + 'Assigned To'=>'assigned_user_id'); + + var $list_link_field= 'potentialname'; + + var $search_fields = Array( + 'Potential'=>Array('potential'=>'potentialname'), + 'Account Name'=>Array('potential'=>'accountid'), + 'Expected Close'=>Array('potential'=>'closedate') + ); + + var $search_fields_name = Array( + 'Potential'=>'potentialname', + 'Account Name'=>'account_id', + 'Expected Close'=>'closingdate' + ); + + var $required_fields = array( + "potentialname"=>1, + "account_id"=>1, + "closingdate"=>1, + "sales_stage"=>1, + "amount"=>1 + ); + + //Added these variables which are used as default order by and sortorder in ListView + var $default_order_by = 'potentialname'; + var $default_sort_order = 'ASC'; + + function Potential() { + $this->log = LoggerManager::getLogger('potential'); + $this->db = new PearDatabase(); + $this->column_fields = getColumnFields('Potentials'); + } + + var $new_schema = true; + + /** + * Function to get sort order + * return string $sorder - sortorder string either 'ASC' or 'DESC' + */ + function getSortOrder() + { + global $log; + $log->debug("Entering getSortOrder() method ..."); + if(isset($_REQUEST['sorder'])) + $sorder = $_REQUEST['sorder']; + else + $sorder = (($_SESSION['POTENTIALS_SORT_ORDER'] != '')?($_SESSION['POTENTIALS_SORT_ORDER']):($this->default_sort_order)); + $log->debug("Exiting getSortOrder() method ..."); + return $sorder; + } + + /** + * Function to get order by + * return string $order_by - fieldname(eg: 'Potentialname') + */ + function getOrderBy() + { + global $log; + $log->debug("Entering getOrderBy() method ..."); + if (isset($_REQUEST['order_by'])) + $order_by = $_REQUEST['order_by']; + else + $order_by = (($_SESSION['POTENTIALS_ORDER_BY'] != '')?($_SESSION['POTENTIALS_ORDER_BY']):($this->default_order_by)); + $log->debug("Exiting getOrderBy method ..."); + return $order_by; + } + + /** Function to create list query + * @param reference variable - order by is passed when the query is executed + * @param reference variable - where condition is passed when the query is executed + * Returns Query. + */ + function create_list_query($order_by, $where) + { + global $log; + $log->debug("Entering create_list_query(".$order_by.",". $where.") method ..."); + // Determine if the vtiger_account name is present in the where clause. + $account_required = ereg("accounts\.name", $where); + + if($account_required) + { + $query = "SELECT vtiger_potential.potentialid, vtiger_potential.potentialname, vtiger_potential.dateclosed FROM vtiger_potential, vtiger_account "; + $where_auto = "account.accountid = vtiger_potential.accountid AND vtiger_crmentity.deleted=0 "; + } + else + { + $query = 'SELECT potentialid, potentialname, smcreatorid, closingdate FROM vtiger_potential inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_potential.potentialid '; + $where_auto = 'AND vtiger_crmentity.deleted=0'; + } + + if($where != "") + $query .= "where $where ".$where_auto; + else + $query .= "where ".$where_auto; + + if($order_by != "") + $query .= " ORDER BY vtiger_potential.$order_by"; + else + $query .= " ORDER BY vtiger_potential.potentialname"; + + + + $log->debug("Exiting create_list_query method ..."); + return $query; + } + + /** Function to export the Opportunities records in CSV Format + * @param reference variable - order by is passed when the query is executed + * @param reference variable - where condition is passed when the query is executed + * Returns Export Potentials Query. + */ + function create_export_query($order_by, $where) + { + global $log; + $log->debug("Entering create_export_query(".$order_by.",". $where.") method ..."); + + if($this->checkIfCustomTableExists('vtiger_potentialscf')) + { + $query = $this->constructCustomQueryAddendum('vtiger_potentialscf','Potentials') ." + vtiger_potential.*, + vtiger_account.accountname account_name, + vtiger_users.user_name assigned_user_name + FROM vtiger_potential + INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid=vtiger_potential.potentialid + LEFT JOIN vtiger_account on vtiger_potential.accountid=vtiger_account.accountid + left join vtiger_potentialscf on vtiger_potentialscf.potentialid=vtiger_potential.potentialid + left join vtiger_users on vtiger_crmentity.smownerid=vtiger_users.id + where vtiger_crmentity.deleted=0 "; + } + else + { + $query = "SELECT + vtiger_potential.*, + vtiger_account.accountname account_name, + vtiger_users.user_name assigned_user_name + FROM vtiger_potential + inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_potential.potentialid + LEFT JOIN vtiger_users ON vtiger_crmentity.smownerid=vtiger_users.id + LEFT JOIN vtiger_account on vtiger_potential.accountid=vtiger_account.accountid + LEFT JOIN vtiger_potentialscf on vtiger_potentialscf.potentialid=vtiger_potential.potentialid + where vtiger_crmentity.deleted=0 "; + } + + $log->debug("Exiting create_export_query method ..."); + return $query; + + } + + + + /** Returns a list of the associated contacts + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function get_contacts($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_contacts(".$id.") method ..."); + global $app_strings; + + $focus = new Contact(); + + $button = ''; + + if(isPermitted("Contacts",3,"") == 'yes') + { + + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Potentials&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Potentials&return_action=CallRelatedList&return_id='.$id; + + $query = 'select vtiger_contactdetails.accountid, vtiger_users.user_name,vtiger_groups.groupname,vtiger_potential.potentialid, vtiger_potential.potentialname, vtiger_contactdetails.contactid, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.title, vtiger_contactdetails.department, vtiger_contactdetails.email, vtiger_contactdetails.phone, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_potential inner join vtiger_contpotentialrel on vtiger_contpotentialrel.potentialid = vtiger_potential.potentialid inner join vtiger_contactdetails on vtiger_contpotentialrel.contactid = vtiger_contactdetails.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid left join vtiger_contactgrouprelation on vtiger_contactdetails.contactid=vtiger_contactgrouprelation.contactid left join vtiger_groups on vtiger_groups.groupname=vtiger_contactgrouprelation.groupname left join vtiger_users on vtiger_crmentity.smownerid=vtiger_users.id where vtiger_potential.potentialid = '.$id.' and vtiger_crmentity.deleted=0'; + + $log->debug("Exiting get_contacts method ..."); + return GetRelatedList('Potentials','Contacts',$focus,$query,$button,$returnset); + } + + /** Returns a list of the associated calls + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function get_activities($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_activities(".$id.") method ..."); + global $mod_strings; + + $focus = new Activity(); + + $button = ''; + + if(isPermitted("Calendar",1,"") == 'yes') + { + + $button .= ' '; + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Potentials&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Potentials&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_activity.*,vtiger_seactivityrel.*,vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_users.user_name, vtiger_recurringevents.recurringtype from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_potential on vtiger_potential.potentialid=vtiger_seactivityrel.crmid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid where vtiger_seactivityrel.crmid=".$id." and (activitytype='Task' or activitytype='Call' or activitytype='Meeting') and vtiger_crmentity.deleted=0 and ((vtiger_activity.status is not NULL && vtiger_activity.status != 'Completed') and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Deferred') or (vtiger_activity.eventstatus != '' && vtiger_activity.eventstatus != 'Held'))"; + $log->debug("Exiting get_activities method ..."); + return GetRelatedList('Potentials','Calendar',$focus,$query,$button,$returnset); + + } + + /** + * Function to get Contact related Products + * @param integer $id - contactid + * returns related Products record in array format + */ + function get_products($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_products(".$id.") method ..."); + require_once('modules/Products/Product.php'); + global $app_strings; + + $focus = new Product(); + + $button = ''; + + if(isPermitted("Products",1,"") == 'yes') + { + + + $button .= ' '; + } + if(isPermitted("Products",3,"") == 'yes') + { + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Potentials&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Potentials&return_action=CallRelatedList&return_id='.$id; + + $query = 'select vtiger_products.productid, vtiger_products.productname, vtiger_products.productcode, vtiger_products.commissionrate, vtiger_products.qty_per_unit, vtiger_products.unit_price, vtiger_crmentity.crmid, vtiger_crmentity.smownerid from vtiger_products inner join vtiger_seproductsrel on vtiger_products.productid = vtiger_seproductsrel.productid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_products.productid inner join vtiger_potential on vtiger_potential.potentialid = vtiger_seproductsrel.crmid where vtiger_potential.potentialid = '.$id.' and vtiger_crmentity.deleted = 0'; + $log->debug("Exiting get_products method ..."); + return GetRelatedList('Potentials','Products',$focus,$query,$button,$returnset); + } + + /** Function used to get the Sales Stage history of the Potential + * @param $id - potentialid + * return $return_data - array with header and the entries in format Array('header'=>$header,'entries'=>$entries_list) where as $header and $entries_list are array which contains all the column values of an row + */ + function get_stage_history($id) + { + global $log; + $log->debug("Entering get_stage_history(".$id.") method ..."); + + global $adb; + global $mod_strings; + global $app_strings; + + $query = 'select vtiger_potstagehistory.*, vtiger_potential.potentialname from vtiger_potstagehistory inner join vtiger_potential on vtiger_potential.potentialid = vtiger_potstagehistory.potentialid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_potential.potentialid where vtiger_crmentity.deleted = 0 and vtiger_potential.potentialid = '.$id; + $result=$adb->query($query); + $noofrows = $adb->num_rows($result); + + $header[] = $app_strings['LBL_AMOUNT']; + $header[] = $app_strings['LBL_SALES_STAGE']; + $header[] = $app_strings['LBL_PROBABILITY']; + $header[] = $app_strings['LBL_CLOSE_DATE']; + $header[] = $app_strings['LBL_LAST_MODIFIED']; + + while($row = $adb->fetch_array($result)) + { + $entries = Array(); + + $entries[] = $row['amount']; + $entries[] = $row['stage']; + $entries[] = $row['probability']; + $entries[] = getDisplayDate($row['closedate']); + $entries[] = getDisplayDate($row['lastmodified']); + + $entries_list[] = $entries; + } + + $return_data = Array('header'=>$header,'entries'=>$entries_list); + + $log->debug("Exiting get_stage_history method ..."); + + return $return_data; + } + + /** + * Function to get Potential related Task & Event which have activity type Held, Completed or Deferred. + * @param integer $id + * returns related Task or Event record in array format + */ + function get_history($id) + { + global $log; + $log->debug("Entering get_history(".$id.") method ..."); + $query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.status, + vtiger_activity.eventstatus, vtiger_activity.activitytype, vtiger_crmentity.modifiedtime, + vtiger_crmentity.createdtime, vtiger_crmentity.description, vtiger_users.user_name + from vtiger_activity + inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid + inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid + left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid + left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname + inner join vtiger_users on vtiger_crmentity.smcreatorid= vtiger_users.id + where (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') + and (vtiger_activity.status = 'Completed' or vtiger_activity.status = 'Deferred' or (vtiger_activity.eventstatus = 'Held' and vtiger_activity.eventstatus != '')) + and vtiger_seactivityrel.crmid=".$id; + //Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php + + $log->debug("Exiting get_history method ..."); + return getHistory('Potentials',$query,$id); + } + + /** + * Function to get Potential related Attachments + * @param integer $id + * returns related Attachment record in array format + */ + function get_attachments($id) + { + global $log; + $log->debug("Entering get_attachments(".$id.") method ..."); + // Armando L?scher 18.10.2005 -> ?visibleDescription + // Desc: Inserted crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name + // Inserted inner join vtiger_users on crm2.smcreatorid= vtiger_users.id + $query = "select vtiger_notes.title,'Notes ' ActivityType, vtiger_notes.filename, + vtiger_attachments.type FileType, crm2.modifiedtime lastmodified, + vtiger_seattachmentsrel.attachmentsid, vtiger_notes.notesid crmid, + crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name + from vtiger_notes + inner join vtiger_senotesrel on vtiger_senotesrel.notesid= vtiger_notes.notesid + inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_senotesrel.crmid + inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_notes.notesid and crm2.deleted=0 + left join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid =vtiger_notes.notesid + left join vtiger_attachments on vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid + inner join vtiger_users on crm2.smcreatorid= vtiger_users.id + where vtiger_crmentity.crmid=".$id; + $query .= ' union all '; + // Armando L?scher 18.10.2005 -> ?visibleDescription + // Desc: Inserted crm2.createdtime, vtiger_attachments.description, vtiger_users.user_name + // Inserted inner join vtiger_users on crm2.smcreatorid= vtiger_users.id + // Inserted order by createdtime desc + $query .= "select vtiger_attachments.description title ,'Attachments' ActivityType, + vtiger_attachments.name filename, vtiger_attachments.type FileType,crm2.modifiedtime lastmodified, + vtiger_attachments.attachmentsid, vtiger_seattachmentsrel.attachmentsid crmid, + crm2.createdtime, vtiger_attachments.description, vtiger_users.user_name + from vtiger_attachments + inner join vtiger_seattachmentsrel on vtiger_seattachmentsrel.attachmentsid= vtiger_attachments.attachmentsid + inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_seattachmentsrel.crmid + inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_attachments.attachmentsid + inner join vtiger_users on crm2.smcreatorid= vtiger_users.id + where vtiger_crmentity.crmid=".$id." + order by createdtime desc"; + + $log->debug("Exiting get_attachments method ..."); + return getAttachmentsAndNotes('Potentials',$query,$id); + } + + /** + * Function to get Potential related Quotes + * @param integer $id - potentialid + * returns related Quotes record in array format + */ + function get_quotes($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_quotes(".$id.") method ..."); + global $app_strings; + require_once('modules/Quotes/Quote.php'); + + if($this->column_fields['account_id']!='') + $focus = new Quote(); + + $button = ''; + if(isPermitted("Quotes",1,"") == 'yes') + { + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Potentials&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Potentials&return_action=CallRelatedList&return_id='.$id; + + + $query = "select vtiger_crmentity.*, vtiger_quotes.*, vtiger_potential.potentialname, vtiger_users.user_name from vtiger_quotes inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_quotes.quoteid left outer join vtiger_potential on vtiger_potential.potentialid=vtiger_quotes.potentialid left join vtiger_quotegrouprelation on vtiger_quotes.quoteid=vtiger_quotegrouprelation.quoteid left join vtiger_groups on vtiger_groups.groupname=vtiger_quotegrouprelation.groupname left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where vtiger_crmentity.deleted=0 and vtiger_potential.potentialid=".$id; + $log->debug("Exiting get_quotes method ..."); + return GetRelatedList('Potentials','Quotes',$focus,$query,$button,$returnset); + } + + /** + * Function to get Potential related SalesOrder + * @param integer $id - potentialid + * returns related SalesOrder record in array format + */ + function get_salesorder($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_salesorder(".$id.") method ..."); + require_once('modules/SalesOrder/SalesOrder.php'); + global $mod_strings; + global $app_strings; + + $focus = new SalesOrder(); + + $button = ''; + if(isPermitted("SalesOrder",1,"") == 'yes') + { + $button .= ' '; + } + + if($singlepane_view == 'true') + $returnset = '&return_module=Potentials&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Potentials&return_action=CallRelatedList&return_id='.$id; + + + $query = "select vtiger_crmentity.*, vtiger_salesorder.*, vtiger_quotes.subject as quotename, vtiger_account.accountname, vtiger_potential.potentialname from vtiger_salesorder inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_salesorder.salesorderid left outer join vtiger_quotes on vtiger_quotes.quoteid=vtiger_salesorder.quoteid left outer join vtiger_account on vtiger_account.accountid=vtiger_salesorder.accountid left outer join vtiger_potential on vtiger_potential.potentialid=vtiger_salesorder.potentialid left join vtiger_sogrouprelation on vtiger_salesorder.salesorderid=vtiger_sogrouprelation.salesorderid left join vtiger_groups on vtiger_groups.groupname=vtiger_sogrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_potential.potentialid = ".$id; + $log->debug("Exiting get_salesorder method ..."); + return GetRelatedList('Potentials','SalesOrder',$focus,$query,$button,$returnset); + + } + + + + +} + + + +?> Modified: vtigercrm/trunk/modules/Potentials/updateRelations.php ============================================================================== --- vtigercrm/trunk/modules/Potentials/updateRelations.php (original) +++ vtigercrm/trunk/modules/Potentials/updateRelations.php Wed Aug 23 23:29:28 2006 @@ -1,41 +1,48 @@ -query($sql); - $sql = "insert into vtiger_seproductsrel values (". $_REQUEST["parentid"] .",".$id.")"; - $adb->query($sql); - } - } - header("Location: index.php?action=CallRelatedList&module=Potentials&record=".$_REQUEST["parentid"]); -} -elseif(isset($_REQUEST['entityid']) && $_REQUEST['entityid'] != '') -{ - $sql = "insert into vtiger_contpotentialrel values (". $_REQUEST["entityid"] .",".$_REQUEST["parid"] .")"; - $adb->query($sql); - $sql = "insert into vtiger_seproductsrel values (". $_REQUEST["parid"] .",".$_REQUEST["entityid"] .")"; - $adb->query($sql); - header("Location: index.php?action=CallRelatedList&module=Potentials&record=".$_REQUEST["parid"]); -} - -?> +query($sql); + $sql = "insert into vtiger_seproductsrel values (". $_REQUEST["parentid"] .",".$id.")"; + $adb->query($sql); + } + } + if($singlepane_view == 'true') + header("Location: index.php?action=DetailView&module=Potentials&record=".$_REQUEST["parentid"]); + else + header("Location: index.php?action=CallRelatedList&module=Potentials&record=".$_REQUEST["parentid"]); +} +elseif(isset($_REQUEST['entityid']) && $_REQUEST['entityid'] != '') +{ + $sql = "insert into vtiger_contpotentialrel values (". $_REQUEST["entityid"] .",".$_REQUEST["parid"] .")"; + $adb->query($sql); + $sql = "insert into vtiger_seproductsrel values (". $_REQUEST["parid"] .",".$_REQUEST["entityid"] .")"; + $adb->query($sql); + if($singlepane_view == 'true') + header("Location: index.php?action=DetailView&module=Potentials&record=".$_REQUEST["parid"]); + else + header("Location: index.php?action=CallRelatedList&module=Potentials&record=".$_REQUEST["parid"]); +} + +?> From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 22:31:16 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:31:16 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9106 - in /vtigercrm/trunk/modules/PriceBooks: CallRelatedList.php DetailView.php PriceBook.php Message-ID: <20060824053116.840B075E76C@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:30:51 2006 New Revision: 9106 Log: Updated the single pane view feature for detailview in PriceBooks Module -- ahmed Modified: vtigercrm/trunk/modules/PriceBooks/CallRelatedList.php vtigercrm/trunk/modules/PriceBooks/DetailView.php vtigercrm/trunk/modules/PriceBooks/PriceBook.php Modified: vtigercrm/trunk/modules/PriceBooks/CallRelatedList.php ============================================================================== --- vtigercrm/trunk/modules/PriceBooks/CallRelatedList.php (original) +++ vtigercrm/trunk/modules/PriceBooks/CallRelatedList.php Wed Aug 23 23:30:51 2006 @@ -50,8 +50,7 @@ if(isset($_REQUEST['mode']) && $_REQUEST['mode'] != ' ') { $smarty->assign("OP_MODE",$_REQUEST['mode']); } -$smarty->assign("id",$focus->id); -$smarty->assign("ID",$RECORD ); +$smarty->assign("ID",$focus->id); $smarty->assign("MODULE",$currentmodule); $smarty->assign("RELATEDLISTS", $related_array); $smarty->assign("SINGLE_MOD",$app_strings['PriceBook']); Modified: vtigercrm/trunk/modules/PriceBooks/DetailView.php ============================================================================== --- vtigercrm/trunk/modules/PriceBooks/DetailView.php (original) +++ vtigercrm/trunk/modules/PriceBooks/DetailView.php Wed Aug 23 23:30:51 2006 @@ -12,6 +12,7 @@ require_once('Smarty_setup.php'); require_once('modules/PriceBooks/PriceBook.php'); require_once('include/utils/utils.php'); +require_once('user_privileges/default_module_view.php'); $focus = new PriceBook(); @@ -27,7 +28,7 @@ $focus->id = ""; } -global $app_strings,$mod_strings,$theme,$currentModule; +global $app_strings,$mod_strings,$theme,$currentModule,$singlepane_view; $theme_path="themes/".$theme."/"; $image_path=$theme_path."images/"; @@ -73,5 +74,14 @@ $smarty->assign("MODULE", $currentModule); $smarty->assign("SINGLE_MOD", 'PriceBook'); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); + +if($singlepane_view == 'true') +{ + $related_array = getRelatedLists($currentModule,$focus); + $smarty->assign("RELATEDLISTS", $related_array); +} + +$smarty->assign("SinglePane_View", $singlepane_view); + $smarty->display("Inventory/InventoryDetailView.tpl"); ?> Modified: vtigercrm/trunk/modules/PriceBooks/PriceBook.php ============================================================================== --- vtigercrm/trunk/modules/PriceBooks/PriceBook.php (original) +++ vtigercrm/trunk/modules/PriceBooks/PriceBook.php Wed Aug 23 23:30:51 2006 @@ -15,7 +15,7 @@ require_once('data/SugarBean.php'); require_once('data/CRMEntity.php'); require_once('include/utils/utils.php'); - +require_once('user_privileges/default_module_view.php'); class PriceBook extends CRMEntity { var $log; @@ -95,7 +95,7 @@ **/ function get_pricebook_products($id) { - global $log; + global $log,$singlepane_view; $log->debug("Entering get_pricebook_products(".$id.") method ..."); global $app_strings; require_once('modules/Products/Product.php'); @@ -103,7 +103,10 @@ $button = ''; - $returnset = '&return_module=PriceBooks&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=PriceBooks&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=PriceBooks&return_action=CallRelatedList&return_id='.$id; $query = 'select vtiger_products.productid, vtiger_products.productname, vtiger_products.productcode, vtiger_products.commissionrate, vtiger_products.qty_per_unit, vtiger_products.unit_price, vtiger_crmentity.crmid, vtiger_crmentity.smownerid,vtiger_pricebookproductrel.listprice from vtiger_products inner join vtiger_pricebookproductrel on vtiger_products.productid = vtiger_pricebookproductrel.productid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_products.productid inner join vtiger_pricebook on vtiger_pricebook.pricebookid = vtiger_pricebookproductrel.pricebookid where vtiger_pricebook.pricebookid = '.$id.' and vtiger_crmentity.deleted = 0'; $log->debug("Exiting get_pricebook_products method ..."); From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 22:33:23 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:33:23 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9107 - in /vtigercrm/trunk/modules/Products: CallRelatedList.php DetailView.php Product.php addPbProductRelToDB.php Message-ID: <20060824053323.0F8D375E76C@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:33:09 2006 New Revision: 9107 Log: Updated the single pane view feature for detailview in Products Module -- ahmed Modified: vtigercrm/trunk/modules/Products/CallRelatedList.php vtigercrm/trunk/modules/Products/DetailView.php vtigercrm/trunk/modules/Products/Product.php vtigercrm/trunk/modules/Products/addPbProductRelToDB.php Modified: vtigercrm/trunk/modules/Products/CallRelatedList.php ============================================================================== --- vtigercrm/trunk/modules/Products/CallRelatedList.php (original) +++ vtigercrm/trunk/modules/Products/CallRelatedList.php Wed Aug 23 23:33:09 2006 @@ -46,8 +46,7 @@ $category = getParentTab(); $smarty->assign("CATEGORY",$category); -$smarty->assign("id",$focus->id); -$smarty->assign("ID",$RECORD ); +$smarty->assign("ID",$focus->id); $smarty->assign("MODULE",$currentmodule); $smarty->assign("UPDATEINFO",updateInfo($focus->id)); $smarty->assign("SINGLE_MOD",$app_strings['Product']); Modified: vtigercrm/trunk/modules/Products/DetailView.php ============================================================================== --- vtigercrm/trunk/modules/Products/DetailView.php (original) +++ vtigercrm/trunk/modules/Products/DetailView.php Wed Aug 23 23:33:09 2006 @@ -12,6 +12,7 @@ require_once('Smarty_setup.php'); require_once('modules/Products/Product.php'); require_once('include/utils/utils.php'); +require_once('user_privileges/default_module_view.php'); $focus = new Product(); @@ -32,7 +33,7 @@ $focus->id = ""; } -global $app_strings,$currentModule; +global $app_strings,$currentModule,$singlepane_view; global $mod_strings; global $theme; @@ -89,6 +90,14 @@ //Security check for related list $smarty->assign("MODULE", $currentModule); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); + +if($singlepane_view == 'true') +{ + $related_array = getRelatedLists($currentModule,$focus); + $smarty->assign("RELATEDLISTS", $related_array); +} + +$smarty->assign("SinglePane_View", $singlepane_view); $smarty->display("Inventory/InventoryDetailView.tpl"); ?> Modified: vtigercrm/trunk/modules/Products/Product.php ============================================================================== --- vtigercrm/trunk/modules/Products/Product.php (original) +++ vtigercrm/trunk/modules/Products/Product.php Wed Aug 23 23:33:09 2006 @@ -16,6 +16,7 @@ require_once('data/CRMEntity.php'); require_once('include/utils/utils.php'); require_once('include/RelatedListView.php'); +require_once('user_privileges/default_module_view.php'); class Product extends CRMEntity { var $log; @@ -197,7 +198,7 @@ */ function get_tickets($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_tickets(".$id.") method ..."); global $mod_strings; require_once('modules/HelpDesk/HelpDesk.php'); @@ -205,7 +206,10 @@ $button = ''; - $returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Products&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id; $query = "SELECT vtiger_users.user_name, vtiger_users.id, vtiger_products.productid, vtiger_products.productname, @@ -237,7 +241,7 @@ */ function get_activities($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_activities(".$id.") method ..."); global $app_strings; @@ -248,7 +252,10 @@ $button = ''; - $returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Products&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id; $query = "SELECT vtiger_contactdetails.lastname, @@ -291,14 +298,17 @@ */ function get_quotes($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_quotes(".$id.") method ..."); global $app_strings; require_once('modules/Quotes/Quote.php'); $focus = new Quote(); $button = ''; - $returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Products&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id; $query = "SELECT vtiger_crmentity.*, @@ -331,7 +341,7 @@ */ function get_purchase_orders($id) { - global $log; + global $log,$singlepane_view; $log->debug("Entering get_purchase_orders(".$id.") method ..."); global $app_strings; require_once('modules/PurchaseOrder/PurchaseOrder.php'); @@ -339,7 +349,10 @@ $button = ''; - $returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Products&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id; $query = "SELECT vtiger_crmentity.*, vtiger_purchaseorder.*, @@ -368,7 +381,7 @@ */ function get_salesorder($id) { - global $log; + global $log,$singlepane_view; $log->debug("Entering get_salesorder(".$id.") method ..."); global $app_strings; require_once('modules/SalesOrder/SalesOrder.php'); @@ -376,7 +389,10 @@ $focus = new SalesOrder(); $button = ''; - $returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Products&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id; $query = "SELECT vtiger_crmentity.*, vtiger_salesorder.*, @@ -407,14 +423,17 @@ */ function get_invoices($id) { - global $log; + global $log,$singlepane_view; $log->debug("Entering get_invoices(".$id.") method ..."); global $app_strings; require_once('modules/Invoice/Invoice.php'); $focus = new Invoice(); $button = ''; - $returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Products&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id; $query = "SELECT vtiger_crmentity.*, @@ -444,13 +463,16 @@ */ function get_product_pricebooks($id) { - global $log; + global $log,$singlepane_view; $log->debug("Entering get_product_pricebooks(".$id.") method ..."); global $mod_strings; require_once('modules/PriceBooks/PriceBook.php'); $focus = new PriceBook(); $button = ''; - $returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Products&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id; $query = "SELECT vtiger_crmentity.crmid, Modified: vtigercrm/trunk/modules/Products/addPbProductRelToDB.php ============================================================================== --- vtigercrm/trunk/modules/Products/addPbProductRelToDB.php (original) +++ vtigercrm/trunk/modules/Products/addPbProductRelToDB.php Wed Aug 23 23:33:09 2006 @@ -11,9 +11,10 @@ * ********************************************************************************/ -global $adb; +require_once('include/database/PearDatabase.php'); +require_once('user_privileges/default_module_view.php'); +global $adb,$singlepane_view; global $log; -require_once('include/database/PearDatabase.php'); $idlist = $_POST['idlist']; $returnmodule=$_REQUEST['return_module']; $pricebook_id=$_REQUEST['pricebook_id']; @@ -33,7 +34,10 @@ $adb->query($query); } } - header("Location: index.php?module=PriceBooks&action=CallRelatedList&record=".$pricebook_id); + if($singlepane_view == 'true') + header("Location: index.php?module=PriceBooks&action=DetailView&record=".$pricebook_id); + else + header("Location: index.php?module=PriceBooks&action=CallRelatedList&record=".$pricebook_id); } elseif(isset($_REQUEST['product_id']) && $_REQUEST['product_id']!='') { @@ -50,7 +54,10 @@ $adb->query($query); } } - header("Location: index.php?module=Products&action=CallRelatedList&record=".$productid); + if($singlepane_view == 'true') + header("Location: index.php?module=Products&action=DetailView&record=".$productid); + else + header("Location: index.php?module=Products&action=CallRelatedList&record=".$productid); } ?> From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 22:34:55 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:34:55 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9108 - in /vtigercrm/trunk/modules/PurchaseOrder: CallRelatedList.php DetailView.php PurchaseOrder.php Message-ID: <20060824053455.EB30D75E76C@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:34:33 2006 New Revision: 9108 Log: Updated the single pane view feature for detailview in PurchaseOrders Module -- ahmed Modified: vtigercrm/trunk/modules/PurchaseOrder/CallRelatedList.php vtigercrm/trunk/modules/PurchaseOrder/DetailView.php vtigercrm/trunk/modules/PurchaseOrder/PurchaseOrder.php Modified: vtigercrm/trunk/modules/PurchaseOrder/CallRelatedList.php ============================================================================== --- vtigercrm/trunk/modules/PurchaseOrder/CallRelatedList.php (original) +++ vtigercrm/trunk/modules/PurchaseOrder/CallRelatedList.php Wed Aug 23 23:34:33 2006 @@ -40,8 +40,7 @@ if(isset($_REQUEST['mode']) && $_REQUEST['mode'] != ' ') { $smarty->assign("OP_MODE",$_REQUEST['mode']); } -$smarty->assign("id",$focus->id); -$smarty->assign("ID",$RECORD ); +$smarty->assign("ID",$focus->id); $smarty->assign("MODULE",$currentmodule); $smarty->assign("SINGLE_MOD",$app_strings['PurchaseOrder']); $smarty->assign("UPDATEINFO",updateInfo($focus->id)); Modified: vtigercrm/trunk/modules/PurchaseOrder/DetailView.php ============================================================================== --- vtigercrm/trunk/modules/PurchaseOrder/DetailView.php (original) +++ vtigercrm/trunk/modules/PurchaseOrder/DetailView.php Wed Aug 23 23:34:33 2006 @@ -26,7 +26,8 @@ require_once('include/CustomFieldUtil.php'); require_once('include/database/PearDatabase.php'); require_once('include/utils/utils.php'); -global $mod_strings,$app_strings,$theme,$currentModule; +require_once('user_privileges/default_module_view.php'); +global $mod_strings,$app_strings,$theme,$currentModule,$singlepane_view; $focus = new Order(); @@ -90,6 +91,15 @@ $check_button = Button_Check($module); $smarty->assign("CHECK", $check_button); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); + +if($singlepane_view == 'true') +{ + $related_array = getRelatedLists($currentModule,$focus); + $smarty->assign("RELATEDLISTS", $related_array); +} + +$smarty->assign("SinglePane_View", $singlepane_view); + $smarty->display("Inventory/InventoryDetailView.tpl"); Modified: vtigercrm/trunk/modules/PurchaseOrder/PurchaseOrder.php ============================================================================== --- vtigercrm/trunk/modules/PurchaseOrder/PurchaseOrder.php (original) +++ vtigercrm/trunk/modules/PurchaseOrder/PurchaseOrder.php Wed Aug 23 23:34:33 2006 @@ -27,6 +27,7 @@ require_once('data/SugarBean.php'); require_once('data/CRMEntity.php'); require_once('include/utils/utils.php'); +require_once('user_privileges/default_module_view.php'); // Account is used to store vtiger_account information. class Order extends CRMEntity { @@ -135,7 +136,7 @@ */ function get_activities($id) { - global $log; + global $log,$singlepane_view; $log->debug("Entering get_activities(".$id.") method ..."); global $app_strings; require_once('modules/Calendar/Activity.php'); @@ -143,7 +144,10 @@ $button = ''; - $returnset = '&return_module=PurchaseOrder&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=PurchaseOrder&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=PurchaseOrder&return_action=CallRelatedList&return_id='.$id; $query = "SELECT vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid,vtiger_activity.*,vtiger_seactivityrel.*,vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_users.user_name from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_cntactivityrel.contactid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.crmid=".$id." and activitytype='Task' and vtiger_crmentity.deleted=0 and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Completed') and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Deferred') "; $log->debug("Exiting get_activities method ..."); From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 22:36:38 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:36:38 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9109 - in /vtigercrm/trunk/modules/Quotes: CallRelatedList.php DetailView.php Quote.php Message-ID: <20060824053638.CA94975E76C@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:36:01 2006 New Revision: 9109 Log: Updated the single pane view feature for detailview in Quotes Module -- ahmed Modified: vtigercrm/trunk/modules/Quotes/CallRelatedList.php vtigercrm/trunk/modules/Quotes/DetailView.php vtigercrm/trunk/modules/Quotes/Quote.php Modified: vtigercrm/trunk/modules/Quotes/CallRelatedList.php ============================================================================== --- vtigercrm/trunk/modules/Quotes/CallRelatedList.php (original) +++ vtigercrm/trunk/modules/Quotes/CallRelatedList.php Wed Aug 23 23:36:01 2006 @@ -40,8 +40,7 @@ if(isset($_REQUEST['mode']) && $_REQUEST['mode'] != ' ') { $smarty->assign("OP_MODE",$_REQUEST['mode']); } -$smarty->assign("id",$focus->id); -$smarty->assign("ID",$RECORD ); +$smarty->assign("ID",$focus->id); $smarty->assign("MODULE",$currentmodule); $smarty->assign("SINGLE_MOD",$app_strings['Quote']); $smarty->assign("UPDATEINFO",updateInfo($focus->id)); Modified: vtigercrm/trunk/modules/Quotes/DetailView.php ============================================================================== --- vtigercrm/trunk/modules/Quotes/DetailView.php (original) +++ vtigercrm/trunk/modules/Quotes/DetailView.php Wed Aug 23 23:36:01 2006 @@ -26,7 +26,8 @@ require_once('include/CustomFieldUtil.php'); require_once('include/database/PearDatabase.php'); require_once('include/utils/utils.php'); -global $mod_strings,$app_strings,$currentModule,$theme; +require_once('user_privileges/default_module_view.php'); +global $mod_strings,$app_strings,$currentModule,$theme,$singlepane_view; $focus = new Quote(); if(isset($_REQUEST['record']) && isset($_REQUEST['record'])) { @@ -99,6 +100,15 @@ $smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data['datatype']); $smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); + +if($singlepane_view == 'true') +{ + $related_array = getRelatedLists($currentModule,$focus); + $smarty->assign("RELATEDLISTS", $related_array); +} + +$smarty->assign("SinglePane_View", $singlepane_view); + $smarty->display("Inventory/InventoryDetailView.tpl"); ?> Modified: vtigercrm/trunk/modules/Quotes/Quote.php ============================================================================== --- vtigercrm/trunk/modules/Quotes/Quote.php (original) +++ vtigercrm/trunk/modules/Quotes/Quote.php Wed Aug 23 23:36:01 2006 @@ -28,6 +28,8 @@ require_once('data/CRMEntity.php'); require_once('include/utils/utils.php'); require_once('include/RelatedListView.php'); +require_once('user_privileges/default_module_view.php'); + // Account is used to store vtiger_account information. class Quote extends CRMEntity { var $log; @@ -141,14 +143,17 @@ */ function get_salesorder($id) { - global $log; + global $log,$singlepane_view; $log->debug("Entering get_salesorder(".$id.") method ..."); require_once('modules/SalesOrder/SalesOrder.php'); $focus = new SalesOrder(); $button = ''; - $returnset = '&return_module=Quotes&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Quotes&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Quotes&return_action=CallRelatedList&return_id='.$id; $query = "select vtiger_crmentity.*, vtiger_salesorder.*, vtiger_quotes.subject as quotename, vtiger_account.accountname from vtiger_salesorder inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_salesorder.salesorderid left outer join vtiger_quotes on vtiger_quotes.quoteid=vtiger_salesorder.quoteid left outer join vtiger_account on vtiger_account.accountid=vtiger_salesorder.accountid left join vtiger_sogrouprelation on vtiger_salesorder.salesorderid=vtiger_sogrouprelation.salesorderid left join vtiger_groups on vtiger_groups.groupname=vtiger_sogrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_salesorder.quoteid = ".$id; $log->debug("Exiting get_salesorder method ..."); @@ -161,7 +166,7 @@ */ function get_activities($id) { - global $log; + global $log,$singlepane_view; $log->debug("Entering get_activities(".$id.") method ..."); global $app_strings; require_once('modules/Calendar/Activity.php'); @@ -169,7 +174,10 @@ $button = ''; - $returnset = '&return_module=Quotes&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Quotes&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Quotes&return_action=CallRelatedList&return_id='.$id; $query = "SELECT vtiger_contactdetails.contactid, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_activity.*,vtiger_seactivityrel.*,vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_users.user_name,vtiger_recurringevents.recurringtype from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_cntactivityrel.contactid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.crmid=".$id." and activitytype='Task' and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Completed') and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Deferred')"; $log->debug("Exiting get_activities method ..."); From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 22:39:54 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:39:54 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9110 - in /vtigercrm/trunk/modules/SalesOrder: CallRelatedList.php DetailView.php SalesOrder.php Message-ID: <20060824053954.91BAD75E76C@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:38:40 2006 New Revision: 9110 Log: Updated the single pane view feature for detailview in SalesOrders Module -- ahmed Modified: vtigercrm/trunk/modules/SalesOrder/CallRelatedList.php vtigercrm/trunk/modules/SalesOrder/DetailView.php vtigercrm/trunk/modules/SalesOrder/SalesOrder.php Modified: vtigercrm/trunk/modules/SalesOrder/CallRelatedList.php ============================================================================== --- vtigercrm/trunk/modules/SalesOrder/CallRelatedList.php (original) +++ vtigercrm/trunk/modules/SalesOrder/CallRelatedList.php Wed Aug 23 23:38:40 2006 @@ -40,8 +40,7 @@ $category = getParentTab(); $smarty->assign("CATEGORY",$category); $smarty->assign("UPDATEINFO",updateInfo($focus->id)); -$smarty->assign("id",$focus->id); -$smarty->assign("ID",$RECORD ); +$smarty->assign("ID",$focus->id); $smarty->assign("MODULE",$currentmodule); $smarty->assign("SINGLE_MOD",$app_strings['SalesOrder']); $smarty->assign("MOD",$mod_strings); Modified: vtigercrm/trunk/modules/SalesOrder/DetailView.php ============================================================================== --- vtigercrm/trunk/modules/SalesOrder/DetailView.php (original) +++ vtigercrm/trunk/modules/SalesOrder/DetailView.php Wed Aug 23 23:38:40 2006 @@ -26,7 +26,8 @@ require_once('include/CustomFieldUtil.php'); require_once('include/database/PearDatabase.php'); require_once('include/utils/utils.php'); -global $mod_strings,$app_strings,$theme,$currentModule; +require_once('user_privileges/default_module_view.php'); +global $mod_strings,$app_strings,$theme,$currentModule,$singlepane_view; $focus = new SalesOrder(); @@ -96,6 +97,15 @@ $check_button = Button_Check($module); $smarty->assign("CHECK", $check_button); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); + +if($singlepane_view == 'true') +{ + $related_array = getRelatedLists($currentModule,$focus); + $smarty->assign("RELATEDLISTS", $related_array); +} + +$smarty->assign("SinglePane_View", $singlepane_view); + $smarty->display("Inventory/InventoryDetailView.tpl"); ?> Modified: vtigercrm/trunk/modules/SalesOrder/SalesOrder.php ============================================================================== --- vtigercrm/trunk/modules/SalesOrder/SalesOrder.php (original) +++ vtigercrm/trunk/modules/SalesOrder/SalesOrder.php Wed Aug 23 23:38:40 2006 @@ -27,6 +27,7 @@ require_once('data/SugarBean.php'); require_once('data/CRMEntity.php'); require_once('include/utils/utils.php'); +require_once('user_privileges/default_module_view.php'); // Account is used to store vtiger_account information. class SalesOrder extends CRMEntity { @@ -142,7 +143,7 @@ */ function get_activities($id) { - global $log; + global $log,$singlepane_view; $log->debug("Entering get_activities(".$id.") method ..."); global $app_strings; require_once('modules/Calendar/Activity.php'); @@ -150,7 +151,10 @@ $button = ''; - $returnset = '&return_module=SalesOrder&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=SalesOrder&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=SalesOrder&return_action=CallRelatedList&return_id='.$id; $query = "SELECT vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid, vtiger_activity.*,vtiger_seactivityrel.*,vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_users.user_name from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_cntactivityrel.contactid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.crmid=".$id." and activitytype='Task' and vtiger_crmentity.deleted=0 and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Completed') and (vtiger_activity.status is not NULL && vtiger_activity.status !='Deferred')"; $log->debug("Exiting get_activities method ..."); @@ -231,14 +235,17 @@ */ function get_invoices($id) { - global $log; + global $log,$singlepane_view; $log->debug("Entering get_invoices(".$id.") method ..."); require_once('modules/Invoice/Invoice.php'); $focus = new Invoice(); $button = ''; - $returnset = '&return_module=SalesOrder&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=SalesOrder&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=SalesOrder&return_action=CallRelatedList&return_id='.$id; $query = "select vtiger_crmentity.*, vtiger_invoice.*, vtiger_account.accountname, vtiger_salesorder.subject as salessubject from vtiger_invoice inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_invoice.invoiceid left outer join vtiger_account on vtiger_account.accountid=vtiger_invoice.accountid inner join vtiger_salesorder on vtiger_salesorder.salesorderid=vtiger_invoice.salesorderid left join vtiger_invoicegrouprelation on vtiger_invoice.invoiceid=vtiger_invoicegrouprelation.invoiceid left join vtiger_groups on vtiger_groups.groupname=vtiger_invoicegrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_salesorder.salesorderid=".$id; From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 22:41:37 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:41:37 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9111 - in /vtigercrm/trunk/modules/Vendors: CallRelatedList.php DetailView.php Vendor.php updateRelations.php Message-ID: <20060824054137.F2B0675E78B@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:41:16 2006 New Revision: 9111 Log: Updated the single pane view feature for detailview in Vendors Module -- ahmed Modified: vtigercrm/trunk/modules/Vendors/CallRelatedList.php vtigercrm/trunk/modules/Vendors/DetailView.php vtigercrm/trunk/modules/Vendors/Vendor.php vtigercrm/trunk/modules/Vendors/updateRelations.php Modified: vtigercrm/trunk/modules/Vendors/CallRelatedList.php ============================================================================== --- vtigercrm/trunk/modules/Vendors/CallRelatedList.php (original) +++ vtigercrm/trunk/modules/Vendors/CallRelatedList.php Wed Aug 23 23:41:16 2006 @@ -51,8 +51,7 @@ if(isset($focus->name)) $smarty->assign("UPDATEINFO",updateInfo($focus->id)); $smarty->assign("NAME", $focus->name); -$smarty->assign("id",$focus->id); -$smarty->assign("ID",$RECORD ); +$smarty->assign("ID",$focus->id); $smarty->assign("MODULE",$currentmodule); $smarty->assign("SINGLE_MOD",$app_strings['Vendor']); $smarty->assign("RELATEDLISTS", $related_array); Modified: vtigercrm/trunk/modules/Vendors/DetailView.php ============================================================================== --- vtigercrm/trunk/modules/Vendors/DetailView.php (original) +++ vtigercrm/trunk/modules/Vendors/DetailView.php Wed Aug 23 23:41:16 2006 @@ -12,6 +12,7 @@ require_once('Smarty_setup.php'); require_once('modules/Vendors/Vendor.php'); require_once('include/utils/utils.php'); +require_once('user_privileges/default_module_view.php'); $focus = new Vendor(); @@ -27,7 +28,7 @@ $focus->id = ""; } -global $app_strings,$mod_strings,$theme,$currentModule; +global $app_strings,$mod_strings,$theme,$currentModule,$singlepane_view; $theme_path="themes/".$theme."/"; $image_path=$theme_path."images/"; @@ -69,6 +70,15 @@ $smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data['datatype']); $smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); + +if($singlepane_view == 'true') +{ + $related_array = getRelatedLists($currentModule,$focus); + $smarty->assign("RELATEDLISTS", $related_array); +} + +$smarty->assign("SinglePane_View", $singlepane_view); + $smarty->display("Inventory/InventoryDetailView.tpl"); ?> Modified: vtigercrm/trunk/modules/Vendors/Vendor.php ============================================================================== --- vtigercrm/trunk/modules/Vendors/Vendor.php (original) +++ vtigercrm/trunk/modules/Vendors/Vendor.php Wed Aug 23 23:41:16 2006 @@ -16,6 +16,7 @@ require_once('data/CRMEntity.php'); require_once('include/utils/utils.php'); require_once('include/RelatedListView.php'); +require_once('user_privileges/default_module_view.php'); class Vendor extends CRMEntity { var $log; @@ -71,7 +72,7 @@ */ function get_products($id) { - global $log; + global $log,$singlepane_view; $log->debug("Entering get_products(".$id.") method ..."); global $app_strings; require_once('modules/Products/Product.php'); @@ -79,7 +80,10 @@ $button = ''; - $returnset = '&return_module=Vendors&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Vendors&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Vendors&return_action=CallRelatedList&return_id='.$id; $query = 'select vtiger_products.productid, vtiger_products.productname, vtiger_products.productcode, vtiger_products.commissionrate, vtiger_products.qty_per_unit, vtiger_products.unit_price, vtiger_crmentity.crmid, vtiger_crmentity.smownerid,vtiger_vendor.vendorname from vtiger_products inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_products.productid left outer join vtiger_vendor on vtiger_vendor.vendorid = vtiger_products.vendor_id where vtiger_vendor.vendorid = '.$id.' and vtiger_crmentity.deleted = 0'; $log->debug("Exiting get_products method ..."); @@ -92,7 +96,7 @@ */ function get_purchase_orders($id) { - global $log; + global $log,$singlepane_view; $log->debug("Entering get_purchase_orders(".$id.") method ..."); global $app_strings; require_once('modules/PurchaseOrder/PurchaseOrder.php'); @@ -100,7 +104,10 @@ $button = ''; - $returnset = '&return_module=Vendors&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Vendors&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Vendors&return_action=CallRelatedList&return_id='.$id; $query = "select vtiger_users.user_name,vtiger_groups.groupname,vtiger_crmentity.*, vtiger_purchaseorder.*,vtiger_vendor.vendorname from vtiger_purchaseorder inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_purchaseorder.purchaseorderid left outer join vtiger_vendor on vtiger_purchaseorder.vendorid=vtiger_vendor.vendorid left join vtiger_pogrouprelation on vtiger_purchaseorder.purchaseorderid=vtiger_pogrouprelation.purchaseorderid left join vtiger_groups on vtiger_groups.groupname=vtiger_pogrouprelation.groupname left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where vtiger_crmentity.deleted=0 and vtiger_purchaseorder.vendorid=".$id; $log->debug("Exiting get_purchase_orders method ..."); @@ -113,14 +120,17 @@ */ function get_contacts($id) { - global $log; + global $log,$singlepane_view; $log->debug("Entering get_contacts(".$id.") method ..."); global $app_strings; require_once('modules/Contacts/Contact.php'); $focus = new Contact(); $button = ''; - $returnset = '&return_module=Vendors&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Vendors&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Vendors&return_action=CallRelatedList&return_id='.$id; $query = 'SELECT vtiger_users.user_name,vtiger_groups.groupname,vtiger_contactdetails.*, vtiger_crmentity.crmid, vtiger_crmentity.smownerid,vtiger_vendorcontactrel.vendorid from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid inner join vtiger_vendorcontactrel on vtiger_vendorcontactrel.contactid=vtiger_contactdetails.contactid left join vtiger_contactgrouprelation on vtiger_contactdetails.contactid=vtiger_contactgrouprelation.contactid left join vtiger_groups on vtiger_groups.groupname=vtiger_contactgrouprelation.groupname left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where vtiger_crmentity.deleted=0 and vtiger_vendorcontactrel.vendorid = '.$id; $log->debug("Exiting get_contacts method ..."); Modified: vtigercrm/trunk/modules/Vendors/updateRelations.php ============================================================================== --- vtigercrm/trunk/modules/Vendors/updateRelations.php (original) +++ vtigercrm/trunk/modules/Vendors/updateRelations.php Wed Aug 23 23:41:16 2006 @@ -10,7 +10,9 @@ ********************************************************************************/ require_once('include/database/PearDatabase.php'); -global $adb; +require_once('user_privileges/default_module_view.php'); +global $adb, $singlepane_view; + $idlist = $_REQUEST['idlist']; if(isset($_REQUEST['idlist']) && $_REQUEST['idlist'] != '') @@ -27,6 +29,9 @@ $adb->query($sql); } } + if($singlepane_view == 'true') + header("Location: index.php?action=DetailView&module=Vendors&record=".$_REQUEST["parentid"]); + else header("Location: index.php?action=CallRelatedList&module=Vendors&record=".$_REQUEST["parentid"]); } @@ -37,7 +42,10 @@ $adb->query($sql); $sql = "insert into vtiger_seproductsrel values (". $_REQUEST["parid"] .",".$_REQUEST["entityid"] .")"; $adb->query($sql); - header("Location:index.php?action=CallRelatedList&module=Vendors&record=".$_REQUEST["parid"]); + if($singlepane_view == 'true') + header("Location: index.php?action=DetailView&module=Vendors&record=".$_REQUEST["parid"]); + else + header("Location:index.php?action=CallRelatedList&module=Vendors&record=".$_REQUEST["parid"]); } From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 22:46:01 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:46:01 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9112 - /vtigercrm/trunk/modules/Settings/language/en_us.lang.php Message-ID: <20060824054601.37B4875E792@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:45:52 2006 New Revision: 9112 Log: Lang strings updated -- ahmed Modified: vtigercrm/trunk/modules/Settings/language/en_us.lang.php Modified: vtigercrm/trunk/modules/Settings/language/en_us.lang.php ============================================================================== --- vtigercrm/trunk/modules/Settings/language/en_us.lang.php (original) +++ vtigercrm/trunk/modules/Settings/language/en_us.lang.php Wed Aug 23 23:45:52 2006 @@ -713,6 +713,7 @@ 'LBL_DEFAULT_MODULE_VIEW_DESC'=>'Set Default Detail View for All Modules', 'LBL_ENABLE_SINGLEPANE_VIEW'=>'Enable Singlepane View', +'LBL_CLEAR_DATA'=>'Clear Data', ); From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 22:47:45 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:47:45 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9113 - /vtigercrm/trunk/Smarty/templates/Settings/BackupServer.tpl Message-ID: <20060824054745.A1D8975E792@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:47:32 2006 New Revision: 9113 Log: Updated BackupServer.tpl for adding a feature to clear existing data -- ahmed Modified: vtigercrm/trunk/Smarty/templates/Settings/BackupServer.tpl Modified: vtigercrm/trunk/Smarty/templates/Settings/BackupServer.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/Settings/BackupServer.tpl (original) +++ vtigercrm/trunk/Smarty/templates/Settings/BackupServer.tpl Wed Aug 23 23:47:32 2006 @@ -46,7 +46,8 @@ {if $BKP_SERVER_MODE neq 'edit'} {else}
{$APP.Call} {$APP.Meeting}
{$MOD.LBL_BACKUP_SERVER_SETTINGS} ({$MOD.LBL_FTP})
{$ERROR_MSG}
- +   + @@ -57,61 +58,9 @@
- {if $BKP_SERVER_MODE eq 'edit'} - - -
- - - - - - - - - - - - - -
*{$MOD.LBL_SERVER_ADDRESS} - -
*{$MOD.LBL_USERNAME} - -
*{$MOD.LBL_PASWRD} - -
- {else} - - - - -
- - - - - - - - - - - - -
{$MOD.LBL_SERVER_ADDRESS} {$FTPSERVER} 
{$MOD.LBL_USERNAME}{$FTPUSER} 
{$MOD.LBL_PASWRD} - {if $FTPPASSWORD neq ''} - ****** - {/if}  -
- - {/if} -
- - - - -
{$MOD.LBL_SCROLL}
+
+ {include file="Settings/BackupServerContents.tpl"} +
@@ -141,5 +90,18 @@ return true; } + +function clearBackupServer() +{ +new Ajax.Request('index.php', + {queue: {position: 'end', scope: 'command'}, + method: 'post', + postBody: 'module=Settings&action=SettingsAjax&ajax=true&file=BackupServerConfig&opmode=del', + onComplete: function(response) { + $("BackupServerContents").innerHTML=response.responseText; + } + } + ); +} {/literal} From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 22:49:22 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:49:22 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9114 - /vtigercrm/trunk/Smarty/templates/Settings/BackupServerContents.tpl Message-ID: <20060824054922.9BB8F75E78B@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:48:45 2006 New Revision: 9114 Log: Added a new file for clear exising backup server data -- ahmed Added: vtigercrm/trunk/Smarty/templates/Settings/BackupServerContents.tpl From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 22:53:01 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:53:01 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9115 - /vtigercrm/trunk/modules/Settings/BackupServerConfig.php Message-ID: <20060824055301.2AEAD75E792@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:52:51 2006 New Revision: 9115 Log: Updated BackupServerConfig.php for adding a feature to clear existing data -- ahmed Modified: vtigercrm/trunk/modules/Settings/BackupServerConfig.php Modified: vtigercrm/trunk/modules/Settings/BackupServerConfig.php ============================================================================== --- vtigercrm/trunk/modules/Settings/BackupServerConfig.php (original) +++ vtigercrm/trunk/modules/Settings/BackupServerConfig.php Wed Aug 23 23:52:51 2006 @@ -1,53 +1,62 @@ -assign("ERROR_MSG",''.$_REQUEST["error"].''); -} -$sql="select * from vtiger_systems where server_type = 'backup'"; -$result = $adb->query($sql); -$server = $adb->query_result($result,0,'server'); -$server_username = $adb->query_result($result,0,'server_username'); -$server_password = $adb->query_result($result,0,'server_password'); - -if(isset($_REQUEST['bkp_server_mode']) && $_REQUEST['bkp_server_mode'] != '') - $smarty->assign("BKP_SERVER_MODE",$_REQUEST['bkp_server_mode']); -else - $smarty->assign("BKP_SERVER_MODE",'view'); - -if (isset($server)) - $smarty->assign("FTPSERVER",$server); -if (isset($server_username)) - $smarty->assign("FTPUSER",$server_username); -if (isset($server_password)) - $smarty->assign("FTPPASSWORD",$server_password); - - -$smarty->assign("MOD", return_module_language($current_language,'Settings')); -$smarty->assign("IMAGE_PATH",$image_path); -$smarty->assign("APP", $app_strings); -$smarty->assign("CMOD", $mod_strings); -$smarty->display("Settings/BackupServer.tpl"); -?> +query($sql_del); +} + +$smarty = new vtigerCRM_Smarty; +if($_REQUEST['error'] != '') +{ + $smarty->assign("ERROR_MSG",''.$_REQUEST["error"].''); +} +$sql="select * from vtiger_systems where server_type = 'backup'"; +$result = $adb->query($sql); +$server = $adb->query_result($result,0,'server'); +$server_username = $adb->query_result($result,0,'server_username'); +$server_password = $adb->query_result($result,0,'server_password'); + +if(isset($_REQUEST['bkp_server_mode']) && $_REQUEST['bkp_server_mode'] != '') + $smarty->assign("BKP_SERVER_MODE",$_REQUEST['bkp_server_mode']); +else + $smarty->assign("BKP_SERVER_MODE",'view'); + +if (isset($server)) + $smarty->assign("FTPSERVER",$server); +if (isset($server_username)) + $smarty->assign("FTPUSER",$server_username); +if (isset($server_password)) + $smarty->assign("FTPPASSWORD",$server_password); + + +$smarty->assign("MOD", return_module_language($current_language,'Settings')); +$smarty->assign("IMAGE_PATH",$image_path); +$smarty->assign("APP", $app_strings); +$smarty->assign("CMOD", $mod_strings); + +if($_REQUEST['ajax'] == 'true') + $smarty->display("Settings/BackupServerContents.tpl"); +else + $smarty->display("Settings/BackupServer.tpl"); +?> From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 00:28:02 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 07:28:02 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9116 - /vtigercrm/trunk/user_privileges/default_module_view.php Message-ID: <20060824072802.6531075E792@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 24 01:27:58 2006 New Revision: 9116 Log: By Default Single Pane View is Disabled - Ahmed Modified: vtigercrm/trunk/user_privileges/default_module_view.php Modified: vtigercrm/trunk/user_privileges/default_module_view.php ============================================================================== --- vtigercrm/trunk/user_privileges/default_module_view.php (original) +++ vtigercrm/trunk/user_privileges/default_module_view.php Thu Aug 24 01:27:58 2006 @@ -9,6 +9,6 @@ * ********************************************************************************/ -$singlepane_view = 'true'; +$singlepane_view = 'false'; ?> From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 01:32:03 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 08:32:03 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9117 - /vtigercrm/trunk/include/ComboStrings.php Message-ID: <20060824083203.D7E6175E790@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 24 02:32:00 2006 New Revision: 9117 Log: Removed the term Caton from usage unit list -- Ahmed Modified: vtigercrm/trunk/include/ComboStrings.php Modified: vtigercrm/trunk/include/ComboStrings.php ============================================================================== --- vtigercrm/trunk/include/ComboStrings.php (original) +++ vtigercrm/trunk/include/ComboStrings.php Thu Aug 24 02:32:00 2006 @@ -190,8 +190,7 @@ 'usageunit_dom' => Array('Box'=>'Box', 'Carton'=>'Carton', - 'Caton'=>'Caton', - 'Dozen'=>'Dazon', + 'Dozen'=>'Dozen', 'Each'=>'Each', 'Hours'=>'Hours', 'Impressions'=>'Impressions', From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 02:48:06 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 09:48:06 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9118 - in /wordintegration/trunk/client/source: modLang.bas vtigerCRMWordPlugin.vbw Message-ID: <20060824094807.6F70775E7B7@vtiger.fosslabs.com> Author: richie Date: Thu Aug 24 03:47:51 2006 New Revision: 9118 Log: New Languages added --Jeri Modified: wordintegration/trunk/client/source/modLang.bas wordintegration/trunk/client/source/vtigerCRMWordPlugin.vbw Modified: wordintegration/trunk/client/source/modLang.bas ============================================================================== Binary files - no diff available. Modified: wordintegration/trunk/client/source/vtigerCRMWordPlugin.vbw ============================================================================== Binary files - no diff available. From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 03:15:51 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 10:15:51 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9119 - /vtigercrm/trunk/pkg/apache/conf/lin_httpd.conf Message-ID: <20060824101551.BE72575E7C0@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 24 04:15:48 2006 New Revision: 9119 Log: directory name removed, this will appended in the variable Modified: vtigercrm/trunk/pkg/apache/conf/lin_httpd.conf Modified: vtigercrm/trunk/pkg/apache/conf/lin_httpd.conf ============================================================================== --- vtigercrm/trunk/pkg/apache/conf/lin_httpd.conf (original) +++ vtigercrm/trunk/pkg/apache/conf/lin_httpd.conf Thu Aug 24 04:15:48 2006 @@ -25,8 +25,8 @@ # of the server's control files begin with "/" (or "drive:/" for Win32), the # server will use that explicit path. If the filenames do *not* begin # with "/", the value of ServerRoot is prepended -- so "logs/foo.log" -# with ServerRoot set to "VTIGERCRM/vtigerCRM5_rc/apache" will be interpreted by the -# server as "VTIGERCRM/vtigerCRM5_rc/apache/logs/foo.log". +# with ServerRoot set to "VTIGERCRM/apache" will be interpreted by the +# server as "VTIGERCRM/apache/logs/foo.log". # ### Section 1: Global Environment @@ -47,7 +47,7 @@ # # Do NOT add a slash at the end of the directory path. # -ServerRoot "VTIGERCRM/vtigerCRM5_rc/apache" +ServerRoot "VTIGERCRM/apache" #refer http://www.faqs.org/docs/securing/chap29sec245.html MinSpareServers 16 MaxSpareServers 64 @@ -311,7 +311,7 @@ # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # -DocumentRoot "VTIGERCRM/vtigerCRM5_rc/apache/htdocs/vtigerCRM" +DocumentRoot "VTIGERCRM/apache/htdocs/vtigerCRM" # # Each directory to which Apache has access can be configured with respect @@ -336,7 +336,7 @@ # # This should be changed to whatever you set DocumentRoot to. # - + # # Possible values for the Options directive are "None", "All", @@ -554,9 +554,9 @@ # We include the /icons/ alias for FancyIndexed directory listings. If you # do not use FancyIndexing, you may comment this out. # -Alias /icons/ "VTIGERCRM/vtigerCRM5_rc/apache/icons/" - - +Alias /icons/ "VTIGERCRM/apache/icons/" + + Options Indexes MultiViews AllowOverride None Order allow,deny @@ -568,9 +568,9 @@ # the manual, even if you choose to move your DocumentRoot. You may comment # this out if you do not care for the documentation. # -AliasMatch ^/manual(?:/(?:de|en|es|fr|ja|ko|ru))?(/.*)?$ "VTIGERCRM/vtigerCRM5_rc/apache/manual$1" - - +AliasMatch ^/manual(?:/(?:de|en|es|fr|ja|ko|ru))?(/.*)?$ "VTIGERCRM/apache/manual$1" + + Options Indexes AllowOverride None Order allow,deny @@ -592,7 +592,7 @@ # The same rules about trailing "/" apply to ScriptAlias directives as to # Alias. # -ScriptAlias /cgi-bin/ "VTIGERCRM/vtigerCRM5_rc/apache/cgi-bin/" +ScriptAlias /cgi-bin/ "VTIGERCRM/apache/cgi-bin/" # @@ -603,10 +603,10 @@ # -# "VTIGERCRM/vtigerCRM5_rc/apache/cgi-bin" should be changed to whatever your ScriptAliased +# "VTIGERCRM/apache/cgi-bin" should be changed to whatever your ScriptAliased # CGI directory exists, if you have that configured. # - + AllowOverride None Options None Order allow,deny @@ -922,7 +922,7 @@ # Alias /error/include/ "/your/include/path/" # # which allows you to create your own set of files by starting with the -# VTIGERCRM/vtigerCRM5_rc/apache/error/include/ files and copying them to /your/include/path/, +# VTIGERCRM/apache/error/include/ files and copying them to /your/include/path/, # even on a per-VirtualHost basis. The default include files will display # your Apache version number and your ServerAdmin email address regardless # of the setting of ServerSignature. @@ -930,9 +930,9 @@ # The internationalized error documents require mod_alias, mod_include # and mod_negotiation. To activate them, uncomment the following 30 lines. -# Alias /error/ "VTIGERCRM/vtigerCRM5_rc/apache/error/" -# -# +# Alias /error/ "VTIGERCRM/apache/error/" +# +# # AllowOverride None # Options IncludesNoExec # AddOutputFilter Includes html From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 03:25:03 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 10:25:03 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9120 - /vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php Message-ID: <20060824102503.CB6DB75E7BE@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 24 04:24:59 2006 New Revision: 9120 Log: * Modified to handle the sequence number in inventory product details Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php ============================================================================== --- vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php (original) +++ vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php Thu Aug 24 04:24:59 2006 @@ -3429,17 +3429,26 @@ { $res = $conn->query("select * from $tablename order by $idname"); $count = $conn->num_rows($res); + + $id = $oldid = 0; + $seqno = 0; + for($i=0;$i<$count;$i++) { + $oldid = $id; $id = $conn->query_result($res,$i,$idname); + + //for every new PO/SO/Quotes/Invoice entity we should set the sequence start value as 1 + if($id != $oldid) + $seqno = 1; + $productid = $conn->query_result($res,$i,'productid'); $quantity = $conn->query_result($res,$i,'quantity'); $listprice = $conn->query_result($res,$i,'listprice'); - // DG 15 Aug 2006 - // Support sequence_no - $seqno = $conn->query_result($res, $i, 'sequence_no'); + $query1 = "insert into vtiger_inventoryproductrel(id,productid,sequence_no,quantity,listprice) values($id, $productid,$seqno, $quantity, $listprice)"; Execute($query1); + $seqno++; } } From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 03:26:46 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 10:26:46 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9121 - /vtigercrm/trunk/modules/Migration/Migration.php Message-ID: <20060824102646.D03B175E7BE@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 24 04:26:43 2006 New Revision: 9121 Log: * Modified to handle the dump file size ie., if the dump taken is not valid file then skip migration and go to step1 Modified: vtigercrm/trunk/modules/Migration/Migration.php Modified: vtigercrm/trunk/modules/Migration/Migration.php ============================================================================== --- vtigercrm/trunk/modules/Migration/Migration.php (original) +++ vtigercrm/trunk/modules/Migration/Migration.php Thu Aug 24 04:26:43 2006 @@ -91,7 +91,7 @@ */ function takeDatabaseDump($host_name,$mysql_port,$mysql_username,$mysql_password,$dbname) { - $this->conn->println("Inside the function takeDatabaseDump. Going to take the old database dump..."); + $this->conn->println("Inside the function takeDatabaseDump. Going to take the specified database dump..."); $dump_filename = 'dump_'.$dbname.'.txt'; if($mysql_password != '') @@ -322,6 +322,18 @@ //Take the dump of the old Database $this->conn->println("Going to take the old Database Dump."); $dump_file = $this->takeDatabaseDump($old_host_name,$old_mysql_port,$old_mysql_username,$old_mysql_password,$old_dbname); + + //check the file size is greater than 10000 bytes (~app) and if yes then continue else goto step1 + if(is_file($dump_file) && filesize($dump_file) > 10000) + { + $_SESSION['migration_log'] .= "Source database dump taken successfully."; + } + else + { + echo '
The Source database dump taken may not contain all values. So please use other option.'; + include("modules/Migration/MigrationStep1.php"); + exit; + } } elseif($option == 'dumpsource') { @@ -334,6 +346,19 @@ //This is to take dump of the new database for backup purpose $this->conn->println("Going to take the current Database Dump."); $new_dump_file = $this->takeDatabaseDump($new_host_name,$new_mysql_port,$new_mysql_username,$new_mysql_password,$new_dbname); + + //check the file size is greater than 10000 bytes (~app) and if yes then continue else goto step1 + if(is_file($new_dump_file) && filesize($new_dump_file) > 10000) + { + $_SESSION['migration_log'] .= "Current database dump taken successfully."; + } + else + { + $_SESSION['migration_log'] .= '
The Current database dump taken may not contain all values. So may not be reload the current database if any problem occurs in migration. If the migration not completed please rename the install.php and install folder and run the install.php'; + //include("modules/Migration/MigrationStep1.php"); + //exit; + } + } From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 03:34:45 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 10:34:45 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9122 - /vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50.php Message-ID: <20060824103445.BEDB075E7C3@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 24 04:34:40 2006 New Revision: 9122 Log: * Added file which contains the database modification from 42Patch2 to 5.0 because old file 42P2_to_50Alpha.php will be deleted Added: vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50.php From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 03:36:07 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 10:36:07 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9123 - /vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php Message-ID: <20060824103607.6E0FC75E7C3@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 24 04:36:03 2006 New Revision: 9123 Log: * Removed this file becuase we have renamed this file without Alpha and checkedin Removed: vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 03:36:58 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 10:36:58 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9124 - /vtigercrm/trunk/modules/Migration/ModifyDatabase/MigrationInfo.php Message-ID: <20060824103658.1991C75E7C3@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 24 04:36:54 2006 New Revision: 9124 Log: * Changed the filename from 42P2_to_50Alpha.php to 42P2_to_50.php becuase we have renamed that filename Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/MigrationInfo.php Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/MigrationInfo.php ============================================================================== --- vtigercrm/trunk/modules/Migration/ModifyDatabase/MigrationInfo.php (original) +++ vtigercrm/trunk/modules/Migration/ModifyDatabase/MigrationInfo.php Thu Aug 24 04:36:54 2006 @@ -212,7 +212,7 @@ //Now all the queries will be placed inside the above div tag in tr tag - include("modules/Migration/ModifyDatabase/42P2_to_50Alpha.php"); + include("modules/Migration/ModifyDatabase/42P2_to_50.php"); ?> From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 04:50:09 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 11:50:09 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9125 - /vtigercrm/trunk/soap/vtigerolservice.php Message-ID: <20060824115009.F214D75E7D5@vtiger.fosslabs.com> Author: richie Date: Thu Aug 24 05:49:47 2006 New Revision: 9125 Log: Security Implemented for OutLook Plugin --jeri Modified: vtigercrm/trunk/soap/vtigerolservice.php Modified: vtigercrm/trunk/soap/vtigerolservice.php ============================================================================== --- vtigercrm/trunk/soap/vtigerolservice.php (original) +++ vtigercrm/trunk/soap/vtigerolservice.php Thu Aug 24 05:49:47 2006 @@ -161,6 +161,26 @@ $NAMESPACE); $server->register( + 'CheckEmailPermission', + array('username'=>'xsd:string'), + array('return'=>'xsd:string'), + $NAMESPACE); + +$server->register( + 'CheckContactPermission', + array('username'=>'xsd:string'), + array('return'=>'xsd:string'), + $NAMESPACE); + +$server->register( + 'CheckActivityPermission', + array('username'=>'xsd:string'), + array('return'=>'xsd:string'), + $NAMESPACE); + + + +$server->register( 'SearchContactsByEmail', array('username'=>'xsd:string','emailaddress'=>'xsd:string'), array('return'=>'tns:contactdetails'), @@ -175,8 +195,8 @@ $server->register( 'AddEmailAttachment', array('emailid'=>'xsd:string','filedata'=>'xsd:string', - 'filename'=>'xsd:string','filesize'=>'xsd:string','filetype'=>'xsd:string', - 'username'=>'xsd:string'), + 'filename'=>'xsd:string','filesize'=>'xsd:string','filetype'=>'xsd:string', + 'username'=>'xsd:string'), array('return'=>'xsd:string'), $NAMESPACE); @@ -351,7 +371,7 @@ $return_access = "TRUE"; }else { - $return_access = "FALSE"; + $return_access = "FALSE"; } }else { @@ -360,6 +380,60 @@ } $objuser = $objuser; return $return_access; +} + +function CheckEmailPermission($username) +{ + global $current_user,$log; + require_once("modules/Users/User.php"); + $seed_user=new User(); + $user_id=$seed_user->retrieve_user_id($username); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + + if(isPermitted("Emails","EditView") == "yes") + { + return "allowed"; + }else + { + return "denied"; + } +} + +function CheckContactPermission($username) +{ + global $current_user; + require_once("modules/Users/User.php"); + $seed_user=new User(); + $user_id=$seed_user->retrieve_user_id($username); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + + if(isPermitted("Contacts","EditView") == "yes") + { + return "allowed"; + }else + { + return "denied"; + } +} + +function CheckActivityPermission($username) +{ + global $current_user; + require_once("modules/Users/User.php"); + $seed_user=new User(); + $user_id=$seed_user->retrieve_user_id($username); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + + if(isPermitted("Calendar","EditView") == "yes") + { + return "allowed"; + }else + { + return "denied"; + } } function AddEmailAttachment($emailid,$filedata,$filename,$filesize,$filetype,$username) @@ -751,6 +825,9 @@ foreach($taskdtls as $taskrow) { + + + //Currently only 3 status avail Note ************************************************ if(isset($taskrow)) { if($taskrow["status"] == "0") From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 04:52:17 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 11:52:17 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9126 - in /vtigercrmoutlook/trunk/vtigercrmoladdin/source: clsExplWrap.cls vtigeroladdin.vbp vtigeroladdin.vbw Message-ID: <20060824115217.517B575E7D5@vtiger.fosslabs.com> Author: richie Date: Thu Aug 24 05:51:35 2006 New Revision: 9126 Log: Security Implemented for OutLook Plugin --jeri Modified: vtigercrmoutlook/trunk/vtigercrmoladdin/source/clsExplWrap.cls vtigercrmoutlook/trunk/vtigercrmoladdin/source/vtigeroladdin.vbp vtigercrmoutlook/trunk/vtigercrmoladdin/source/vtigeroladdin.vbw Modified: vtigercrmoutlook/trunk/vtigercrmoladdin/source/clsExplWrap.cls ============================================================================== --- vtigercrmoutlook/trunk/vtigercrmoladdin/source/clsExplWrap.cls (original) +++ vtigercrmoutlook/trunk/vtigercrmoladdin/source/clsExplWrap.cls Thu Aug 24 05:51:35 2006 @@ -131,10 +131,31 @@ Exit Sub Else If gsLoginSuccess = True Then + Dim oPSoap As New PocketSOAP.CoEnvelope + Dim oXMLHttp As New MSXML.XMLHTTPRequest + Dim oXMLDoc As New MSXML.DOMDocument + Dim oXMLDocElmnt As MSXML.IXMLDOMElement + If objFolder.DefaultItemType = olMailItem And Trim(sGetPathAsString(objFolder)) <> "Personal Folders" Then - objEmailButton.Enabled = True - objEmailButton.Enabled = True - objEmailMenu.Enabled = True + 'Added to integrate Security for Emails + oPSoap.MethodName = "CheckEmailPermission" + + oPSoap.Parameters.Create "username", gsVtUserId + + oXMLHttp.Open "POST", gsVtUrl, False + oXMLHttp.setRequestHeader "SOAPAction", "vtigerolservice" + oXMLHttp.setRequestHeader "Content-Type", "text/xml" + oXMLHttp.send oPSoap.Serialize + oXMLDoc.loadXML (oXMLHttp.responseText) + Set oXMLDocElmnt = oXMLDoc.documentElement + If oXMLDocElmnt.selectSingleNode("//ns1:CheckEmailPermissionResponse/return").nodeTypedValue <> "denied" Then + objEmailButton.Enabled = True + objEmailMenu.Enabled = True + Else + objEmailButton.Enabled = False + objEmailMenu.Enabled = False + End If + objSCButton.Enabled = False objSCMenu.Enabled = False objSyncTaskButton.Enabled = False @@ -143,34 +164,88 @@ objSyncClndrMenu.Enabled = False ElseIf Trim(sGetPathAsString(objFolder)) = Trim(gsCntsSyncFolder) Then gsCntsSyncFolderId = objFolder.EntryID - objEmailButton.Enabled = False - objEmailMenu.Enabled = False - objSCButton.Enabled = True - objSCMenu.Enabled = True + + 'Added to integrate Security for Contacts + oPSoap.MethodName = "CheckContactPermission" + + oPSoap.Parameters.Create "username", gsVtUserId + + oXMLHttp.Open "POST", gsVtUrl, False + oXMLHttp.setRequestHeader "SOAPAction", "vtigerolservice" + oXMLHttp.setRequestHeader "Content-Type", "text/xml" + oXMLHttp.send oPSoap.Serialize + oXMLDoc.loadXML (oXMLHttp.responseText) + Set oXMLDocElmnt = oXMLDoc.documentElement + If oXMLDocElmnt.selectSingleNode("//ns1:CheckContactPermissionResponse/return").nodeTypedValue <> "denied" Then + objSCButton.Enabled = True + objSCMenu.Enabled = True + Else + objSCButton.Enabled = False + objSCMenu.Enabled = False + End If + + + objEmailButton.Enabled = False + objEmailMenu.Enabled = False objSyncTaskButton.Enabled = False objSyncTaskMenu.Enabled = False objSyncClndrButton.Enabled = False objSyncClndrMenu.Enabled = False ElseIf Trim(sGetPathAsString(objFolder)) = Trim(gsTaskSyncFolder) Then gsTaskSyncFolderId = objFolder.EntryID - objEmailButton.Enabled = False - objEmailMenu.Enabled = False - objSCButton.Enabled = False - objSCMenu.Enabled = False - objSyncTaskButton.Enabled = True - objSyncTaskMenu.Enabled = True + + 'Added to integrate Security for Activity + oPSoap.MethodName = "CheckActivityPermission" + + oPSoap.Parameters.Create "username", gsVtUserId + + oXMLHttp.Open "POST", gsVtUrl, False + oXMLHttp.setRequestHeader "SOAPAction", "vtigerolservice" + oXMLHttp.setRequestHeader "Content-Type", "text/xml" + oXMLHttp.send oPSoap.Serialize + oXMLDoc.loadXML (oXMLHttp.responseText) + Set oXMLDocElmnt = oXMLDoc.documentElement + If oXMLDocElmnt.selectSingleNode("//ns1:CheckActivityPermissionResponse/return").nodeTypedValue <> "denied" Then + objSyncTaskButton.Enabled = True + objSyncTaskMenu.Enabled = True + Else + objSyncTaskButton.Enabled = False + objSyncTaskMenu.Enabled = False + End If + objEmailButton.Enabled = False + objEmailMenu.Enabled = False + objSCButton.Enabled = False + objSCMenu.Enabled = False objSyncClndrButton.Enabled = False objSyncClndrMenu.Enabled = False ElseIf Trim(sGetPathAsString(objFolder)) = Trim(gsClndrSyncFolder) Then gsClndrSyncFolderId = objFolder.EntryID - objEmailButton.Enabled = False - objEmailMenu.Enabled = False - objSCButton.Enabled = False - objSCMenu.Enabled = False - objSyncTaskButton.Enabled = False - objSyncTaskMenu.Enabled = False - objSyncClndrButton.Enabled = True - objSyncClndrMenu.Enabled = True + + 'Added to integrate Security for Calendar + oPSoap.MethodName = "CheckActivityPermission" + + oPSoap.Parameters.Create "username", gsVtUserId + + oXMLHttp.Open "POST", gsVtUrl, False + oXMLHttp.setRequestHeader "SOAPAction", "vtigerolservice" + oXMLHttp.setRequestHeader "Content-Type", "text/xml" + oXMLHttp.send oPSoap.Serialize + oXMLDoc.loadXML (oXMLHttp.responseText) + Set oXMLDocElmnt = oXMLDoc.documentElement + If oXMLDocElmnt.selectSingleNode("//ns1:CheckActivityPermissionResponse/return").nodeTypedValue <> "denied" Then + objSyncClndrButton.Enabled = True + objSyncClndrMenu.Enabled = True + Else + objSyncClndrButton.Enabled = False + objSyncClndrMenu.Enabled = False + End If + + objEmailButton.Enabled = False + objEmailMenu.Enabled = False + objSCButton.Enabled = False + objSCMenu.Enabled = False + objSyncTaskButton.Enabled = False + objSyncTaskMenu.Enabled = False Else objEmailButton.Enabled = False objEmailMenu.Enabled = False Modified: vtigercrmoutlook/trunk/vtigercrmoladdin/source/vtigeroladdin.vbp ============================================================================== Binary files - no diff available. Modified: vtigercrmoutlook/trunk/vtigercrmoladdin/source/vtigeroladdin.vbw ============================================================================== Binary files - no diff available. From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 05:46:20 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 12:46:20 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9127 - /vtigercrm/tags/vtigercrm-4.2.4/modules/Leads/LeadConvertToEntities.php Message-ID: <20060824124620.9305A75E7E7@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 24 06:46:15 2006 New Revision: 9127 Log: removed extra quote Modified: vtigercrm/tags/vtigercrm-4.2.4/modules/Leads/LeadConvertToEntities.php Modified: vtigercrm/tags/vtigercrm-4.2.4/modules/Leads/LeadConvertToEntities.php ============================================================================== --- vtigercrm/tags/vtigercrm-4.2.4/modules/Leads/LeadConvertToEntities.php (original) +++ vtigercrm/tags/vtigercrm-4.2.4/modules/Leads/LeadConvertToEntities.php Thu Aug 24 06:46:15 2006 @@ -279,7 +279,7 @@ $adb->query($sql_insert_contact); -$sql_insert_contactsubdetails = "INSERT INTO contactsubdetails (contactsubscriptionid,homephone,otherphone,leadsource) VALUES (".$contact_id.",'','','".$adb->quote($row['leadsource'])."')"; +$sql_insert_contactsubdetails = "INSERT INTO contactsubdetails (contactsubscriptionid,homephone,otherphone,leadsource) VALUES (".$contact_id.",'','',".$adb->quote($row['leadsource']).")"; $adb->query($sql_insert_contactsubdetails); From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 06:52:39 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 13:52:39 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9128 - /vtigercrm/trunk/modules/Dashboard/HomepageDB.php Message-ID: <20060824135239.2DBC575E7EF@vtiger.fosslabs.com> Author: richie Date: Thu Aug 24 07:52:34 2006 New Revision: 9128 Log: changes made to fix the DashBoard related issue --Minnie Modified: vtigercrm/trunk/modules/Dashboard/HomepageDB.php Modified: vtigercrm/trunk/modules/Dashboard/HomepageDB.php ============================================================================== --- vtigercrm/trunk/modules/Dashboard/HomepageDB.php (original) +++ vtigercrm/trunk/modules/Dashboard/HomepageDB.php Thu Aug 24 07:52:34 2006 @@ -19,8 +19,7 @@ //if($is_admin) // $homepagedb_query = "select vtiger_crmentity.* from vtiger_crmentity where vtiger_crmentity.setype in ('Accounts','Contacts','Leads','Potentials','Quotes','Invoice','PurchaseOrder','SalesOrder','Activities','HelpDesk','Campaigns') and vtiger_crmentity.deleted=0"; //else - $homepagedb_query = "select * from vtiger_crmentity se left join vtiger_leaddetails le on le.leadid=se.crmid where se.deleted=0 and (le.converted=0 or le.converted is null) and setype in ('Accounts','Contacts','Leads','Potentials','Quotes','Invoice','PurchaseOrder', 'SalesOrder','Calendar','HelpDesk','Campaigns') and se.deleted=0 and se.smownerid=".$current_user->id; - //$homepagedb_query = "select vtiger_crmentity.* from vtiger_crmentity where vtiger_crmentity.setype in ('Accounts','Contacts','Leads','Potentials','Quotes','Invoice','PurchaseOrder','SalesOrder','Calendar','HelpDesk','Campaigns') and vtiger_crmentity.deleted=0 and vtiger_crmentity.smownerid=".$current_user->id; + $homepagedb_query = "select * from vtiger_crmentity se left join vtiger_leaddetails le on le.leadid=se.crmid left join vtiger_activity act on act.activityid=se.crmid where se.deleted=0 and (le.converted=0 or le.converted is null) and ((act.status!='Completed' and act.status!='Deferred') or act.status is null) and ((act.eventstatus!='Held' and act.eventstatus!='Not Held') or act.eventstatus is null) and setype in ('Accounts','Contacts','Leads','Potentials','Quotes','Invoice','PurchaseOrder', 'SalesOrder','Calendar','HelpDesk','Campaigns') and se.deleted=0 and se.smownerid=".$current_user->id; $graph_by="setype"; $graph_title=$mod_strings['recordsforuser'].' '.$current_user->user_name; $module="Home"; From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 06:57:09 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 13:57:09 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9129 - /vtigercrm/trunk/modules/Dashboard/Entity_charts.php Message-ID: <20060824135709.0B83C75E7F4@vtiger.fosslabs.com> Author: richie Date: Thu Aug 24 07:57:06 2006 New Revision: 9129 Log: changes made to fix the DashBoard related issue --Minnie Modified: vtigercrm/trunk/modules/Dashboard/Entity_charts.php Modified: vtigercrm/trunk/modules/Dashboard/Entity_charts.php ============================================================================== --- vtigercrm/trunk/modules/Dashboard/Entity_charts.php (original) +++ vtigercrm/trunk/modules/Dashboard/Entity_charts.php Thu Aug 24 07:57:06 2006 @@ -278,13 +278,13 @@ } //added to get valid url in dashbord for tickets by team - if($graph_for == "ticketgroupname") $graph_for = "smownerid"; + if($graph_for == "ticketgroupname" || $graph_for == "groupname") $graph_for = "smownerid"; if($graph_for == "accountid") $graph_for = "account_id"; if($module == "Home") - $link_val="index.php?module=".$name."&action=ListView&search_field=assigned_user_id&searchtype=BasicSearch&query=true&type=entchar&search_text=".$current_user->user_name; + $link_val="index.php?module=".$name."&action=ListView&from_homepagedb=true&search_field=assigned_user_id&searchtype=BasicSearch&query=true&type=entchar&search_text=".$current_user->user_name; else - $link_val="index.php?module=".$module."&action=index&search_text=".$name."&search_field=".$graph_for."&searchtype=BasicSearch&query=true&type=entchar"; + $link_val="index.php?module=".$module."&action=index&from_dashboard=true&search_text=".$name."&search_field=".$graph_for."&searchtype=BasicSearch&query=true&type=entchar"; if($graph_for == "account_id") $graph_for = "accountid"; From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 06:59:37 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 13:59:37 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9130 - /vtigercrm/trunk/modules/Calendar/ListView.php Message-ID: <20060824135937.9697A75E7F4@vtiger.fosslabs.com> Author: richie Date: Thu Aug 24 07:59:34 2006 New Revision: 9130 Log: changes made to fix the DashBoard related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/ListView.php Modified: vtigercrm/trunk/modules/Calendar/ListView.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/ListView.php (original) +++ vtigercrm/trunk/modules/Calendar/ListView.php Thu Aug 24 07:59:34 2006 @@ -122,7 +122,10 @@ if(isset($where) && $where != '') { - $list_query .= " AND " .$where; + if(isset($_REQUEST['from_homepagedb']) && $_REQUEST['from_homepagedb'] == 'true') + $list_query .= " and ((vtiger_activity.status!='Completed' and vtiger_activity.status!='Deferred') or vtiger_activity.status is null) and ((vtiger_activity.eventstatus!='Held' and vtiger_activity.eventstatus!='Not Held') or vtiger_activity.eventstatus is null) AND ".$where; + else + $list_query .= " AND " .$where; } $list_query .= ' group by vtiger_activity.activityid'; From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 07:02:04 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 14:02:04 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9131 - /vtigercrm/trunk/modules/Potentials/ListView.php Message-ID: <20060824140204.4CE4675E7F4@vtiger.fosslabs.com> Author: richie Date: Thu Aug 24 08:02:00 2006 New Revision: 9131 Log: changes made to fix the DashBoard related issue --Minnie Modified: vtigercrm/trunk/modules/Potentials/ListView.php Modified: vtigercrm/trunk/modules/Potentials/ListView.php ============================================================================== --- vtigercrm/trunk/modules/Potentials/ListView.php (original) +++ vtigercrm/trunk/modules/Potentials/ListView.php Thu Aug 24 08:02:00 2006 @@ -134,7 +134,10 @@ if(isset($where) && $where != '') { - $list_query .= " AND ".$where; + if(isset($_REQUEST['from_dashboard']) && $_REQUEST['from_dashboard'] == 'true') + $list_query .= " AND vtiger_potential.sales_stage = 'Closed Won' AND ".$where; + else + $list_query .= " AND ".$where; } if(isset($order_by) && $order_by != '') From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 07:05:34 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 14:05:34 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9132 - /vtigercrm/trunk/include/utils/RecurringType.php Message-ID: <20060824140534.EE59C75E7F4@vtiger.fosslabs.com> Author: richie Date: Thu Aug 24 08:05:30 2006 New Revision: 9132 Log: changes made to fix the recurring event issue --Minnie Modified: vtigercrm/trunk/include/utils/RecurringType.php Modified: vtigercrm/trunk/include/utils/RecurringType.php ============================================================================== --- vtigercrm/trunk/include/utils/RecurringType.php (original) +++ vtigercrm/trunk/include/utils/RecurringType.php Thu Aug 24 08:05:30 2006 @@ -155,7 +155,6 @@ } elseif($this->recur_type == 'Monthly') { - $recurringDates[] = $tempdate; $st_date = explode("-",$tempdate); $date_arr = Array( 'day' => $st_date[2], @@ -248,6 +247,7 @@ $tempdateObj = new DateTime($date_arr,true); } $tempdate = $tempdateObj->get_formatted_date(); + $recurringDates[] = $tempdate; } elseif($this->recur_type == 'Yearly') { From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 07:11:31 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 14:11:31 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9133 - in /vtigercrm/trunk/modules/Migration/ModifyDatabase: 42P2_to_50.php rename_tables.php Message-ID: <20060824141131.A831575E7F4@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 24 08:11:25 2006 New Revision: 9133 Log: * Modified to handle the reports and customview changes for the moduels Calendar and PurchaseOrder Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50.php vtigercrm/trunk/modules/Migration/ModifyDatabase/rename_tables.php Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50.php ============================================================================== --- vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50.php (original) +++ vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50.php Thu Aug 24 08:11:25 2006 @@ -3551,6 +3551,64 @@ //audit trial table Execute("create table vtiger_audit_trial(auditid int(19) NOT NULL, userid int(19) default NULL, module varchar(255) default NULL, action varchar(255) default NULL, recordid varchar(20) default NULL, actiondate datetime default NULL, PRIMARY KEY (auditid)) ENGINE=InnoDB"); +//Added after 5 rc release +Execute("alter table vtiger_account modify siccode varchar(50)"); +Execute("update vtiger_field set typeofdata='V~O' where fieldname='siccode' and columnname='siccode' and tabid=6"); +Execute("alter table vtiger_inventoryproductrel add column sequence_no int(4) not null default 1 after productid"); + +//changes made for CustomView and Reports - Activities changed to Calendar -- Starts +//Added to change the entitytype from Activities to Calendar for customview +Execute("update vtiger_customview set entitytype='Calendar' where entitytype='Activities'"); + +//Added to change the primarymodule from Activities to Calendar for Reports +Execute("update vtiger_reportmodules set primarymodule='Calendar' where primarymodule='Activities'"); +Execute("update vtiger_reportmodules set primarymodule='PurchaseOrder' where primarymodule='Orders'"); +Execute("update vtiger_reportmodules set secondarymodules='PurchaseOrder' where secondarymodules='Orders'"); + +//we should change the Activities to Calendar in columnname values in customview and report related tables +$prefix = "vtiger_"; +$change_cols_array = Array( + "cvcolumnlist"=>"columnname", + "cvstdfilter"=>"columnname", + "cvadvfilter"=>"columnname", + "selectcolumn"=>"columnname", + "relcriteria"=>"columnname", + "reportsortcol"=>"columnname", + "reportdatefilter"=>"datecolumnname", + "reportsummary"=>"columnname", + ); + +//This is to change Activities to Calendar +foreach($change_cols_array as $tablename => $columnname) +{ + $result = $conn->query("select $columnname from $prefix$tablename where $columnname like \"%Activities%\""); + + while($row = $conn->fetch_row($result)) + { + if($row[$columnname] !='' && $row[$columnname] != 'none') + { + Execute("update $prefix$tablename set $columnname=\"".str_replace("Activities","Calendar",$row[$columnname])."\" where $columnname=\"$row[$columnname]\""); + } + } +} + +//This is to change the Orders to PurchaseOrder +foreach($change_cols_array as $tablename => $columnname) +{ + $result1 = $conn->query("select $columnname from $prefix$tablename where $columnname like \"%Orders%\""); + + while($row1 = $conn->fetch_row($result1)) + { + if($row1[$columnname] !='' && $row1[$columnname] != 'none') + { + Execute("update $prefix$tablename set $columnname=\"".str_replace("Orders","PurchaseOrder",$row1[$columnname])."\" where $columnname=\"$row1[$columnname]\""); + } + } +} +//changes made for CustomView and Reports - Activities changed to Calendar -- Ends + + + Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/rename_tables.php ============================================================================== --- vtigercrm/trunk/modules/Migration/ModifyDatabase/rename_tables.php (original) +++ vtigercrm/trunk/modules/Migration/ModifyDatabase/rename_tables.php Thu Aug 24 08:11:25 2006 @@ -45,7 +45,15 @@ { if((!strstr($row[$columnname],$prefix)) && $row[$columnname] !='' && $row[$columnname] != 'none') { - $queries_list .= "update $prefix$tablename set $columnname=\"$prefix$row[$columnname]\" where $columnname=\"$row[$columnname]\"&&##"; + //for reportsummary we should add prefix in second value ie., after first :(semicolon) + if($tablename == 'reportsummary') + { + $queries_list .= "update $prefix$tablename set $columnname=\"".str_replace("cb:","cb:$prefix",$row[$columnname])."\" where $columnname=\"$row[$columnname]\"&&##"; + } + else + { + $queries_list .= "update $prefix$tablename set $columnname=\"$prefix$row[$columnname]\" where $columnname=\"$row[$columnname]\"&&##"; + } } } } From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 07:27:33 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 14:27:33 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9134 - /vtigercrm/trunk/Smarty/templates/CurrencyEditView.tpl Message-ID: <20060824142733.7A7A175E6E9@vtiger.fosslabs.com> Author: richie Date: Thu Aug 24 08:27:29 2006 New Revision: 9134 Log: changes made to fix the currency related issue --Minnie Modified: vtigercrm/trunk/Smarty/templates/CurrencyEditView.tpl Modified: vtigercrm/trunk/Smarty/templates/CurrencyEditView.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/CurrencyEditView.tpl (original) +++ vtigercrm/trunk/Smarty/templates/CurrencyEditView.tpl Thu Aug 24 08:27:29 2006 @@ -128,7 +128,13 @@ if (!emptyCheck("currency_symbol","Currency Symbol","text")) return false if (!emptyCheck("conversion_rate","Conversion Rate","text")) return false if (!emptyCheck("currency_status","Currency Status","text")) return false - return true; + if(isNaN(getObj("conversion_rate").value) || eval(getObj("conversion_rate") +.value) == 0) + { + alert("Enter valid Conversion Rate") + return false + } + return true; } From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 08:01:09 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 15:01:09 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9135 - /vtigercrm/trunk/modules/Migration/ModifyDatabase/MigrationInfo.php Message-ID: <20060824150109.6847A75E808@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 24 09:01:05 2006 New Revision: 9135 Log: * Changed the information Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/MigrationInfo.php Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/MigrationInfo.php ============================================================================== --- vtigercrm/trunk/modules/Migration/ModifyDatabase/MigrationInfo.php (original) +++ vtigercrm/trunk/modules/Migration/ModifyDatabase/MigrationInfo.php Thu Aug 24 09:01:05 2006 @@ -199,7 +199,7 @@ From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 25 04:07:58 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 25 Aug 2006 11:07:58 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9136 - in /vtigercrm/trunk: Smarty/templates/MigrationStep1.tpl modules/Migration/MigrationCheck.php modules/Migration/MigrationStep1.php Message-ID: <20060825110758.BFD0675E88E@vtiger.fosslabs.com> Author: saraj Date: Fri Aug 25 05:07:51 2006 New Revision: 9136 Log: * Added changes to avoid to get the MySQL server path for the option 3 and added check user_privileges folder write permission Modified: vtigercrm/trunk/Smarty/templates/MigrationStep1.tpl vtigercrm/trunk/modules/Migration/MigrationCheck.php vtigercrm/trunk/modules/Migration/MigrationStep1.php Modified: vtigercrm/trunk/Smarty/templates/MigrationStep1.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/MigrationStep1.tpl (original) +++ vtigercrm/trunk/Smarty/templates/MigrationStep1.tpl Fri Aug 25 05:07:51 2006 @@ -264,6 +264,18 @@ document.getElementById('mnuTab1').style.display = 'none'; document.getElementById('mnuTab2').style.display = 'block'; {rdelim} + + //show/hide MySQL server path + if(document.getElementById('getmysqlpath').value == 1 && document.getElementById('mnuTab2').style.display == 'none') + {ldelim} + //show MySQL server path + document.getElementById('mnuTab3').style.display = 'block'; + {rdelim} + else + {ldelim} + //hide MySQL server path + document.getElementById('mnuTab3').style.display = 'none'; + {rdelim} {rdelim} //function to validate the input values based on the radio option selected @@ -343,7 +355,7 @@ //this is added to check whether the getmysql path is true and the user has entered the path or not if(error != true) {ldelim} - if(document.getElementById("getmysqlpath").value == 1 && trim(formname.server_mysql_path.value) == '') + if(document.getElementById("getmysqlpath").value == 1 && trim(formname.server_mysql_path.value) == '' && document.getElementById("alter_db_details").checked != true) {ldelim} //alert(document.getElementById("getmysqlpath").value+" Enter the mysql path"); error_msg = "Please enter the Correct MySQL Path"; Modified: vtigercrm/trunk/modules/Migration/MigrationCheck.php ============================================================================== --- vtigercrm/trunk/modules/Migration/MigrationCheck.php (original) +++ vtigercrm/trunk/modules/Migration/MigrationCheck.php Fri Aug 25 05:07:51 2006 @@ -20,6 +20,14 @@ $new_mysql_password = $dbconfig['db_password']; $new_dbname = $dbconfig['db_name']; +//this is to check whether the user_privileges folder has write permission +if(!is_writable($root_directory."user_privileges/")) +{ + echo "
Please give read/write permission to user_privileges folder."; + include("modules/Migration/MigrationStep1.php"); + exit; +} + //this is to check whether the mysql path is needed and has been entered or not if($_REQUEST['getmysqlpath'] == 1 && $_REQUEST['server_mysql_path'] != '') { @@ -40,7 +48,7 @@ $migration_log .='MySQL Dump file has found in ==> '.$server_mysql_path; } - if(!$mysql_path_found) + if(!$mysql_path_found && $_REQUEST['migration_option'] != 'alter_db_details') { //header("Location: index.php?module=Migration&action=MigrationStep1&parenttab=Settings"); echo '
MySQL dump file is not exist in the specified MySQL Server Path'; Modified: vtigercrm/trunk/modules/Migration/MigrationStep1.php ============================================================================== --- vtigercrm/trunk/modules/Migration/MigrationStep1.php (original) +++ vtigercrm/trunk/modules/Migration/MigrationStep1.php Fri Aug 25 05:07:51 2006 @@ -41,6 +41,11 @@ else { $getmysqlpath = 1; + + if($_REQUEST['migration_option'] == 'alter_db_details') + $showmysqlpath = 'none'; + else + $showmysqlpath = 'block'; } @@ -69,6 +74,7 @@ //Based on this $getmysqlpath variable we should get the mysql path from the user $smarty->assign("GET_MYSQL_PATH",$getmysqlpath); +$smarty->assign("SHOW_MYSQL_PATH",$showmysqlpath); //this is to set the entered values when we could not proceed the migration and return to step1 if($_REQUEST['migration_option'] != '') From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 25 04:22:28 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 25 Aug 2006 11:22:28 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9137 - /thunderbirdextn/trunk/chrome/vtiger/content/vtiger/addtovtiger.js Message-ID: <20060825112228.6727F75E912@vtiger.fosslabs.com> Author: richie Date: Fri Aug 25 05:22:11 2006 New Revision: 9137 Log: Issue in Thunderbird Plugin has been fixed--Jeri Modified: thunderbirdextn/trunk/chrome/vtiger/content/vtiger/addtovtiger.js Modified: thunderbirdextn/trunk/chrome/vtiger/content/vtiger/addtovtiger.js ============================================================================== Binary files - no diff available. From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 25 11:49:59 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 25 Aug 2006 18:49:59 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9138 - in /vtigercrm/trunk: install/2setConfig.php install/3confirmConfig.php install/4createConfigFile.php install/5createTables.inc.php install/5createTables.php modules/Users/DefaultDataPopulator.php Message-ID: <20060825184959.460A675E951@vtiger.fosslabs.com> Author: saraj Date: Fri Aug 25 12:49:50 2006 New Revision: 9138 Log: Selecting Master currency option provided Modified: vtigercrm/trunk/install/2setConfig.php vtigercrm/trunk/install/3confirmConfig.php vtigercrm/trunk/install/4createConfigFile.php vtigercrm/trunk/install/5createTables.inc.php vtigercrm/trunk/install/5createTables.php vtigercrm/trunk/modules/Users/DefaultDataPopulator.php Modified: vtigercrm/trunk/install/2setConfig.php ============================================================================== --- vtigercrm/trunk/install/2setConfig.php (original) +++ vtigercrm/trunk/install/2setConfig.php Fri Aug 25 12:49:50 2006 @@ -130,6 +130,10 @@ if (isset($_REQUEST['admin_password'])) $admin_password = $_REQUEST['admin_password']; + + if (isset($_REQUEST['currency'])) + $currency = $_REQUEST['currency']; + } else { !isset($_REQUEST['db_hostname']) ? $db_hostname = $hostname: $db_hostname = $_REQUEST['db_hostname']; @@ -424,7 +428,40 @@ + + + + + + + + Modified: vtigercrm/trunk/install/3confirmConfig.php ============================================================================== --- vtigercrm/trunk/install/3confirmConfig.php (original) +++ vtigercrm/trunk/install/3confirmConfig.php Fri Aug 25 12:49:50 2006 @@ -25,7 +25,7 @@ if (isset($_REQUEST['site_URL'])) $site_URL= $_REQUEST['site_URL']; if (isset($_REQUEST['admin_email'])) $admin_email= $_REQUEST['admin_email']; if (isset($_REQUEST['admin_password'])) $admin_password = $_REQUEST['admin_password']; -if (isset($_REQUEST['admin_email'])) $admin_email = $_REQUEST['admin_email']; +if (isset($_REQUEST['currency'])) $currency = $_REQUEST['currency']; if (isset($_REQUEST['cache_dir'])) $cache_dir= $_REQUEST['cache_dir']; if (isset($_REQUEST['mail_server'])) $mail_server= $_REQUEST['mail_server']; if (isset($_REQUEST['mail_server_username'])) $mail_server_username= $_REQUEST['mail_server_username']; @@ -234,6 +234,10 @@ + + + +
-
Note : Please note that for each query the "Object" string will be displayed at the starting of the line if the query executed successfully. If the query fails then "Object" will not be displayed. we can find out the failed queries based on these Object display. +
These following queries are executed to modify the 4.2.3/4.2 Patch2 database to 5.0 database.
Email* ">
Master Currency*
Note: The default password is 'admin'. You can change the password if necessary now or else you can change it later after logging-in.
Admin Password
Master Currency


@@ -252,6 +256,7 @@ " /> " /> " /> + " /> @@ -286,6 +291,7 @@ " /> " /> " /> + " /> Modified: vtigercrm/trunk/install/4createConfigFile.php ============================================================================== --- vtigercrm/trunk/install/4createConfigFile.php (original) +++ vtigercrm/trunk/install/4createConfigFile.php Fri Aug 25 12:49:50 2006 @@ -80,6 +80,8 @@ if (isset($_REQUEST['admin_email'])) $admin_email = $_REQUEST['admin_email']; if (isset($_REQUEST['admin_password'])) $admin_password = $_REQUEST['admin_password']; + +if (isset($_REQUEST['currency'])) $currency = $_REQUEST['currency']; if (isset($_REQUEST['mail_server'])) $mail_server = $_REQUEST['mail_server']; @@ -438,6 +440,7 @@ " /> " /> " /> + " /> Modified: vtigercrm/trunk/install/5createTables.inc.php ============================================================================== --- vtigercrm/trunk/install/5createTables.inc.php (original) +++ vtigercrm/trunk/install/5createTables.inc.php Fri Aug 25 12:49:50 2006 @@ -198,6 +198,24 @@ $db->getUniqueID("vtiger_seactivityrel"); $db->getUniqueID("vtiger_freetags"); +//Master currency population +$currencies = array('Euro'=>array('name'=>'Euro','symbol'=>'&euro','code'=>'EUR'), + 'United States Dollar'=>array('name'=>'United States Dollar','symbol'=>'$','code'=>'USD'), + 'United Kingdom Pounds'=>array('name'=>'United Kingdom Pounds','symbol'=>'£','code'=>'GBP'), + 'Canada Dollars'=>array('name'=>'Canada Dollars','symbol'=>'$','code'=>'CAD'), + 'Australia Dollars'=>array('name'=>'Australia Dollars','symbol'=>'$','code'=>'AUD'), + 'Japan Yen'=>array('name'=>'Japan Yen','symbol'=>'¥','code'=>'JPY'), + 'Indian Rupee'=>array('name'=>'Indian Rupee','symbol'=>'₨','code'=>'INR'), + 'New Zealand Dollars'=>array('name'=>'New Zealand Dollars','symbol'=>'$','code'=>''), + 'South Africa Rand'=>array('name'=>'South Africa Rand','symbol'=>'R','code'=>'ZAR'), + ); + +$symbol = $currencies[$sel_currency]['symbol']; +$code = $currencies[$sel_currency]['code']; + +//Insert into vtiger_currency vtiger_table + $db->query("insert into vtiger_currency_info values(".$db->getUniqueID("vtiger_currency_info").",'$sel_currency','$code','$symbol',1,'Active','-11')"); + // populate the db with seed data if ($db_populate) { //eecho ("Populate seed data into $db_name"); Modified: vtigercrm/trunk/install/5createTables.php ============================================================================== --- vtigercrm/trunk/install/5createTables.php (original) +++ vtigercrm/trunk/install/5createTables.php Fri Aug 25 12:49:50 2006 @@ -24,6 +24,7 @@ if (isset($_REQUEST['db_populate'])) $db_populate = $_REQUEST['db_populate']; if (isset($_REQUEST['admin_email'])) $admin_email = $_REQUEST['admin_email']; if (isset($_REQUEST['admin_password'])) $admin_password = $_REQUEST['admin_password']; +if (isset($_REQUEST['currency'])) $sel_currency = $_REQUEST['currency']; ?> Modified: vtigercrm/trunk/modules/Users/DefaultDataPopulator.php ============================================================================== --- vtigercrm/trunk/modules/Users/DefaultDataPopulator.php (original) +++ vtigercrm/trunk/modules/Users/DefaultDataPopulator.php Fri Aug 25 12:49:50 2006 @@ -1893,12 +1893,6 @@ $this->db->query("insert into vtiger_inventorynotification(notificationid,notificationname,notificationsubject,notificationbody,label) values (".$this->db->getUniqueID("vtiger_inventorynotification").",'SalesOrderNotification','Sales Order generated for {PRODUCTNAME}','".$so_body." ','SalesOrderNotificationDescription')"); - //Insert into vtiger_currency vtiger_table - $this->db->query("insert into vtiger_currency_info values(".$this->db->getUniqueID("vtiger_currency_info").",'U.S Dollar','USD','$',1,'Active','-11')"); - - - - //insert into email template vtiger_table $body=' From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 01:08:18 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 08:08:18 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9139 - /vtigercrm/trunk/modules/Calendar/Activity.php Message-ID: <20060828080819.2054772A0E2@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 02:08:07 2006 New Revision: 9139 Log: Security implemented for Outlook Plugin --Jeri Modified: vtigercrm/trunk/modules/Calendar/Activity.php Modified: vtigercrm/trunk/modules/Calendar/Activity.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/Activity.php (original) +++ vtigercrm/trunk/modules/Calendar/Activity.php Mon Aug 28 02:08:07 2006 @@ -1,435 +1,497 @@ -'crmid','vtiger_activity'=>'activityid','vtiger_seactivityrel'=>'activityid','vtiger_cntactivityrel'=>'activityid','vtiger_salesmanactivityrel'=>'activityid','vtiger_activity_reminder'=>'activity_id','vtiger_recurringevents'=>'activityid'); - - var $column_fields = Array(); - var $sortby_fields = Array('subject','due_date','date_start','smownerid','activitytype'); //Sorting is added for due date and start date - - // This is used to retrieve related vtiger_fields from form posts. - var $additional_column_fields = Array('assigned_user_name', 'assigned_user_id', 'contactname', 'contact_phone', 'contact_email', 'parent_name'); - - // This is the list of vtiger_fields that are in the lists. - var $list_fields = Array( - 'Close'=>Array('activity'=>'status'), - 'Type'=>Array('activity'=>'activitytype'), - 'Subject'=>Array('activity'=>'subject'), - 'Contact Name'=>Array('contactdetails'=>'lastname'), - 'Related to'=>Array('seactivityrel'=>'activityid'), - 'Start Date'=>Array('activity'=>'date_start'), - 'End Date'=>Array('activity'=>'due_date'), - 'Recurring Type'=>Array('recurringevents'=>'recurringtype'), - 'Assigned To'=>Array('crmentity'=>'smownerid') - ); - - var $range_fields = Array( - 'name', - 'date_modified', - 'start_date', - 'id', - 'status', - 'date_due', - 'time_start', - 'description', - 'contact_name', - 'priority', - 'duehours', - 'dueminutes', - 'location' - ); - - - var $list_fields_name = Array( - 'Close'=>'status', - 'Type'=>'activitytype', - 'Subject'=>'subject', - 'Contact Name'=>'lastname', - 'Related to'=>'activityid', - 'Start Date'=>'date_start', - 'End Date'=>'due_date', - 'Recurring Type'=>'recurringtype', - 'Assigned To'=>'assigned_user_id'); - - var $list_link_field= 'subject'; - - //Added these variables which are used as default order by and sortorder in ListView - var $default_order_by = 'due_date'; - var $default_sort_order = 'ASC'; - - function Activity() { - $this->log = LoggerManager::getLogger('Calendar'); - $this->db = new PearDatabase(); - $this->column_fields = getColumnFields('Calendar'); - } - - var $new_schema = true; - - - // Mike Crowe Mod --------------------------------------------------------Default ordering for us - /** - * Function to get sort order - * return string $sorder - sortorder string either 'ASC' or 'DESC' - */ - function getSortOrder() - { - global $log; $log->debug("Entering getSortOrder() method ..."); - if(isset($_REQUEST['sorder'])) - $sorder = $_REQUEST['sorder']; - else - $sorder = (($_SESSION['ACTIVITIES_SORT_ORDER'] != '')?($_SESSION['ACTIVITIES_SORT_ORDER']):($this->default_sort_order)); - $log->debug("Exiting getSortOrder method ..."); - return $sorder; - } - - /** - * Function to get order by - * return string $order_by - fieldname(eg: 'subject') - */ - function getOrderBy() - { - global $log; - $log->debug("Entering getOrderBy() method ..."); - if (isset($_REQUEST['order_by'])) - $order_by = $_REQUEST['order_by']; - else - $order_by = (($_SESSION['ACTIVITIES_ORDER_BY'] != '')?($_SESSION['ACTIVITIES_ORDER_BY']):($this->default_order_by)); - $log->debug("Exiting getOrderBy method ..."); - return $order_by; - } - // Mike Crowe Mod -------------------------------------------------------- - - - -//Function Call for Related List -- Start - /** - * Function to get Activity related Contacts - * @param integer $id - activityid - * returns related Contacts record in array format - */ - function get_contacts($id) - { - global $log; - $log->debug("Entering get_contacts(".$id.") method ..."); - global $app_strings; - - $focus = new Contact(); - - $button = ''; - - $returnset = '&return_module=Calendar&return_action=CallRelatedList&activity_mode=Events&return_id='.$id; - - $query = 'select vtiger_users.user_name,vtiger_contactdetails.accountid,vtiger_contactdetails.contactid, vtiger_contactdetails.firstname,vtiger_contactdetails.lastname, vtiger_contactdetails.department, vtiger_contactdetails.title, vtiger_contactdetails.email, vtiger_contactdetails.phone, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_contactdetails inner join vtiger_cntactivityrel on vtiger_cntactivityrel.contactid=vtiger_contactdetails.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid where vtiger_cntactivityrel.activityid='.$id.' and vtiger_crmentity.deleted=0'; - $log->debug("Exiting get_contacts method ..."); - return GetRelatedList('Calendar','Contacts',$focus,$query,$button,$returnset); - } - - /** - * Function to get Activity related Users - * @param integer $id - activityid - * returns related Users record in array format - */ - - function get_users($id) - { - global $log; - $log->debug("Entering get_contacts(".$id.") method ..."); - global $app_strings; - - $focus = new User(); - - $button = ''; - - $returnset = '&return_module=Calendar&return_action=CallRelatedList&return_id='.$id; - - $query = 'SELECT vtiger_users.id, vtiger_users.first_name,vtiger_users.last_name, vtiger_users.user_name, vtiger_users.email1, vtiger_users.email2, vtiger_users.status, vtiger_users.is_admin, vtiger_user2role.roleid, vtiger_users.yahoo_id, vtiger_users.phone_home, vtiger_users.phone_work, vtiger_users.phone_mobile, vtiger_users.phone_other, vtiger_users.phone_fax,vtiger_activity.date_start,vtiger_activity.due_date,vtiger_activity.time_start,vtiger_activity.duration_hours,vtiger_activity.duration_minutes from vtiger_users inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.smid=vtiger_users.id inner join vtiger_activity on vtiger_activity.activityid=vtiger_salesmanactivityrel.activityid inner join vtiger_user2role on vtiger_user2role.userid=vtiger_users.id where vtiger_activity.activityid='.$id; - $log->debug("Exiting get_users method ..."); - return GetRelatedList('Calendar','Users',$focus,$query,$button,$returnset); - - - } - - /** - * Function to get activities for given criteria - * @param string $criteria - query string - * returns activity records in array format($list) or null value - */ - function get_full_list($criteria) - { - global $log; - $log->debug("Entering get_full_list(".$criteria.") method ..."); - $query = "select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 ".$criteria; - $result =& $this->db->query($query); - - if($this->db->getRowCount($result) > 0){ - - // We have some data. - while ($row = $this->db->fetchByAssoc($result)) { - foreach($this->list_fields_name as $field) - { - if (isset($row[$field])) { - $this->$field = $row[$field]; - } - else { - $this->$field = ''; - } - } - $list[] = $this; - } - } - if (isset($list)) - { - $log->debug("Exiting get_full_list method ..."); - return $list; - } - else - { - $log->debug("Exiting get_full_list method ..."); - return null; - } - - } - - -//calendarsync - /** - * Function to get meeting count - * @param string $user_name - User Name - * return integer $row["count(*)"] - count - */ - function getCount_Meeting($user_name) - { - global $log; - $log->debug("Entering getCount_Meeting(".$user_name.") method ..."); - $query = "select count(*) from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting'"; - - $result = $this->db->query($query,true,"Error retrieving contacts count"); - $rows_found = $this->db->getRowCount($result); - $row = $this->db->fetchByAssoc($result, 0); - $log->debug("Exiting getCount_Meeting method ..."); - return $row["count(*)"]; - } - - function get_calendars($user_name,$from_index,$offset) - { - global $log; - $log->debug("Entering get_calendars(".$user_name.",".$from_index.",".$offset.") method ..."); - $query = "select vtiger_activity.location as location,vtiger_activity.duration_hours as duehours, vtiger_activity.duration_minutes as dueminutes,vtiger_activity.time_start as time_start, vtiger_activity.subject as name,vtiger_crmentity.modifiedtime as date_modified, vtiger_activity.date_start start_date,vtiger_activity.activityid as id,vtiger_activity.status as status, vtiger_crmentity.description as description, vtiger_activity.priority as vtiger_priority, vtiger_activity.due_date as date_due ,vtiger_contactdetails.firstname cfn, vtiger_contactdetails.lastname cln from vtiger_activity inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting' limit " .$from_index ."," .$offset; - $log->debug("Exiting get_calendars method ..."); - return $this->process_list_query1($query); - } -//calendarsync - /** - * Function to get task count - * @param string $user_name - User Name - * return integer $row["count(*)"] - count - */ - function getCount($user_name) - { - global $log; - $log->debug("Entering getCount(".$user_name.") method ..."); - $query = "select count(*) from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task'"; - - $result = $this->db->query($query,true,"Error retrieving contacts count"); - $rows_found = $this->db->getRowCount($result); - $row = $this->db->fetchByAssoc($result, 0); - - $log->debug("Exiting getCount method ..."); - return $row["count(*)"]; - } - - /** - * Function to get list of task for user with given limit - * @param string $user_name - User Name - * @param string $from_index - query string - * @param string $offset - query string - * returns tasks in array format - */ - function get_tasks($user_name,$from_index,$offset) - { - global $log; - $log->debug("Entering get_tasks(".$user_name.",".$from_index.",".$offset.") method ..."); - $query = "select vtiger_activity.subject as name,vtiger_crmentity.modifiedtime as date_modified, vtiger_activity.date_start start_date,vtiger_activity.activityid as id,vtiger_activity.status as status, vtiger_crmentity.description as description, vtiger_activity.priority as priority, vtiger_activity.due_date as date_due ,vtiger_contactdetails.firstname cfn, vtiger_contactdetails.lastname cln from vtiger_activity inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task' limit " .$from_index ."," .$offset; - $log->debug("Exiting get_tasks method ..."); - return $this->process_list_query1($query); - - } - - /** - * Function to process the activity list query - * @param string $query - query string - * return array $response - activity lists - */ - function process_list_query1($query) - { - global $log; - $log->debug("Entering process_list_query1(".$query.") method ..."); - $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); - $list = Array(); - $rows_found = $this->db->getRowCount($result); - if($rows_found != 0) - { - $task = Array(); - for($index = 0 , $row = $this->db->fetchByAssoc($result, $index); $row && $index <$rows_found;$index++, $row = $this->db->fetchByAssoc($result, $index)) - - { - foreach($this->range_fields as $columnName) - { - if (isset($row[$columnName])) { - - $task[$columnName] = $row[$columnName]; - } - else - { - $task[$columnName] = ""; - } - } - - $task[contact_name] = return_name($row, 'cfn', 'cln'); - - $list[] = $task; - } - } - - $response = Array(); - $response['list'] = $list; - $response['row_count'] = $rows_found; - $response['next_offset'] = $next_offset; - $response['previous_offset'] = $previous_offset; - - - $log->debug("Exiting process_list_query1 method ..."); - return $response; - } - - /** - * Function to get reminder for activity - * @param integer $activity_id - activity id - * @param string $reminder_time - reminder time - * @param integer $reminder_sent - 0 or 1 - * @param integer $recurid - recuring eventid - * @param string $remindermode - string like 'edit' - */ - function activity_reminder($activity_id,$reminder_time,$reminder_sent=0,$recurid,$remindermode='') - { - global $log; - $log->debug("Entering vtiger_activity_reminder(".$activity_id.",".$reminder_time.",".$reminder_sent.",".$recurid.",".$remindermode.") method ..."); - //Check for vtiger_activityid already present in the reminder_table - $query_exist = "SELECT activity_id FROM ".$this->reminder_table." WHERE activity_id = ".$activity_id; - $result_exist = $this->db->query($query_exist); - - if($remindermode == 'edit') - { - if($this->db->num_rows($result_exist) == 1) - { - $query = "UPDATE ".$this->reminder_table." SET"; - $query .=" reminder_sent = ".$reminder_sent.","; - $query .=" reminder_time = ".$reminder_time." WHERE activity_id =".$activity_id; - } - else - { - $query = "INSERT INTO ".$this->reminder_table." VALUES (".$activity_id.",".$reminder_time.",0,'".$recurid."')"; - } - } - elseif(($remindermode == 'delete') && ($this->db->num_rows($result_exist) == 1)) - { - $query = "DELETE FROM ".$this->reminder_table." WHERE activity_id = ".$activity_id; - } - else - { - $query = "INSERT INTO ".$this->reminder_table." VALUES (".$activity_id.",".$reminder_time.",0,'".$recurid."')"; - } - $this->db->query($query,true,"Error in processing vtiger_table $this->reminder_table"); - $log->debug("Exiting vtiger_activity_reminder method ..."); - } - -//Used for vtigerCRM Outlook Add-In -/** - * Function to get tasks to display in outlookplugin - * @param string $username - User name - * return string $query - sql query - */ -function get_tasksforol($username) -{ - global $log; - $log->debug("Entering get_tasksforol(".$username.") method ..."); - $query = "select vtiger_activity.subject,vtiger_activity.date_start startdate, - vtiger_activity.activityid as taskid,vtiger_activity.status, - vtiger_crmentity.description,vtiger_activity.priority as priority,vtiger_activity.due_date as duedate, - vtiger_contactdetails.firstname, vtiger_contactdetails.lastname - from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid - inner join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid - left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid - left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid - where vtiger_users.user_name='".$username."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task'"; - $log->debug("Exiting get_tasksforol method ..."); - return $query; -} - -/** - * Function to get calendar query for outlookplugin - * @param string $username - User name * return string $query - sql query */ -function get_calendarsforol($user_name) -{ - global $log; - $log->debug("Entering get_calendarsforol(".$user_name.") method ..."); - $query = "select vtiger_activity.location, vtiger_activity.duration_hours as duehours, - vtiger_activity.duration_minutes as dueminutes,vtiger_activity.time_start as startime, - vtiger_activity.subject,vtiger_activity.date_start as startdate,vtiger_activity.activityid as clndrid, - vtiger_crmentity.description,vtiger_activity.due_date as duedate , - vtiger_contactdetails.firstname, vtiger_contactdetails.lastname from vtiger_activity - inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid - inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid - left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid - left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid - inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid - where vtiger_users.user_name='".$user_name."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting'"; - $log->debug("Exiting get_calendarsforol method ..."); - return $query; -} -//End - -} -?> +'crmid','vtiger_activity'=>'activityid','vtiger_seactivityrel'=>'activityid','vtiger_cntactivityrel'=>'activityid','vtiger_salesmanactivityrel'=>'activityid','vtiger_activity_reminder'=>'activity_id','vtiger_recurringevents'=>'activityid'); + + var $column_fields = Array(); + var $sortby_fields = Array('subject','due_date','date_start','smownerid','activitytype'); //Sorting is added for due date and start date + + // This is used to retrieve related vtiger_fields from form posts. + var $additional_column_fields = Array('assigned_user_name', 'assigned_user_id', 'contactname', 'contact_phone', 'contact_email', 'parent_name'); + + // This is the list of vtiger_fields that are in the lists. + var $list_fields = Array( + 'Close'=>Array('activity'=>'status'), + 'Type'=>Array('activity'=>'activitytype'), + 'Subject'=>Array('activity'=>'subject'), + 'Contact Name'=>Array('contactdetails'=>'lastname'), + 'Related to'=>Array('seactivityrel'=>'activityid'), + 'Start Date'=>Array('activity'=>'date_start'), + 'End Date'=>Array('activity'=>'due_date'), + 'Recurring Type'=>Array('recurringevents'=>'recurringtype'), + 'Assigned To'=>Array('crmentity'=>'smownerid') + ); + + var $range_fields = Array( + 'name', + 'date_modified', + 'start_date', + 'id', + 'status', + 'date_due', + 'time_start', + 'description', + 'contact_name', + 'priority', + 'duehours', + 'dueminutes', + 'location' + ); + + + var $list_fields_name = Array( + 'Close'=>'status', + 'Type'=>'activitytype', + 'Subject'=>'subject', + 'Contact Name'=>'lastname', + 'Related to'=>'activityid', + 'Start Date'=>'date_start', + 'End Date'=>'due_date', + 'Recurring Type'=>'recurringtype', + 'Assigned To'=>'assigned_user_id'); + + var $list_link_field= 'subject'; + + //Added these variables which are used as default order by and sortorder in ListView + var $default_order_by = 'due_date'; + var $default_sort_order = 'ASC'; + + function Activity() { + $this->log = LoggerManager::getLogger('Calendar'); + $this->db = new PearDatabase(); + $this->column_fields = getColumnFields('Calendar'); + } + + var $new_schema = true; + + + // Mike Crowe Mod --------------------------------------------------------Default ordering for us + /** + * Function to get sort order + * return string $sorder - sortorder string either 'ASC' or 'DESC' + */ + function getSortOrder() + { + global $log; $log->debug("Entering getSortOrder() method ..."); + if(isset($_REQUEST['sorder'])) + $sorder = $_REQUEST['sorder']; + else + $sorder = (($_SESSION['ACTIVITIES_SORT_ORDER'] != '')?($_SESSION['ACTIVITIES_SORT_ORDER']):($this->default_sort_order)); + $log->debug("Exiting getSortOrder method ..."); + return $sorder; + } + + /** + * Function to get order by + * return string $order_by - fieldname(eg: 'subject') + */ + function getOrderBy() + { + global $log; + $log->debug("Entering getOrderBy() method ..."); + if (isset($_REQUEST['order_by'])) + $order_by = $_REQUEST['order_by']; + else + $order_by = (($_SESSION['ACTIVITIES_ORDER_BY'] != '')?($_SESSION['ACTIVITIES_ORDER_BY']):($this->default_order_by)); + $log->debug("Exiting getOrderBy method ..."); + return $order_by; + } + // Mike Crowe Mod -------------------------------------------------------- + + + +//Function Call for Related List -- Start + /** + * Function to get Activity related Contacts + * @param integer $id - activityid + * returns related Contacts record in array format + */ + function get_contacts($id) + { + global $log; + $log->debug("Entering get_contacts(".$id.") method ..."); + global $app_strings; + + $focus = new Contact(); + + $button = ''; + + $returnset = '&return_module=Calendar&return_action=CallRelatedList&activity_mode=Events&return_id='.$id; + + $query = 'select vtiger_users.user_name,vtiger_contactdetails.accountid,vtiger_contactdetails.contactid, vtiger_contactdetails.firstname,vtiger_contactdetails.lastname, vtiger_contactdetails.department, vtiger_contactdetails.title, vtiger_contactdetails.email, vtiger_contactdetails.phone, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_contactdetails inner join vtiger_cntactivityrel on vtiger_cntactivityrel.contactid=vtiger_contactdetails.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid where vtiger_cntactivityrel.activityid='.$id.' and vtiger_crmentity.deleted=0'; + $log->debug("Exiting get_contacts method ..."); + return GetRelatedList('Calendar','Contacts',$focus,$query,$button,$returnset); + } + + /** + * Function to get Activity related Users + * @param integer $id - activityid + * returns related Users record in array format + */ + + function get_users($id) + { + global $log; + $log->debug("Entering get_contacts(".$id.") method ..."); + global $app_strings; + + $focus = new User(); + + $button = ''; + + $returnset = '&return_module=Calendar&return_action=CallRelatedList&return_id='.$id; + + $query = 'SELECT vtiger_users.id, vtiger_users.first_name,vtiger_users.last_name, vtiger_users.user_name, vtiger_users.email1, vtiger_users.email2, vtiger_users.status, vtiger_users.is_admin, vtiger_user2role.roleid, vtiger_users.yahoo_id, vtiger_users.phone_home, vtiger_users.phone_work, vtiger_users.phone_mobile, vtiger_users.phone_other, vtiger_users.phone_fax,vtiger_activity.date_start,vtiger_activity.due_date,vtiger_activity.time_start,vtiger_activity.duration_hours,vtiger_activity.duration_minutes from vtiger_users inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.smid=vtiger_users.id inner join vtiger_activity on vtiger_activity.activityid=vtiger_salesmanactivityrel.activityid inner join vtiger_user2role on vtiger_user2role.userid=vtiger_users.id where vtiger_activity.activityid='.$id; + $log->debug("Exiting get_users method ..."); + return GetRelatedList('Calendar','Users',$focus,$query,$button,$returnset); + + + } + + /** + * Function to get activities for given criteria + * @param string $criteria - query string + * returns activity records in array format($list) or null value + */ + function get_full_list($criteria) + { + global $log; + $log->debug("Entering get_full_list(".$criteria.") method ..."); + $query = "select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 ".$criteria; + $result =& $this->db->query($query); + + if($this->db->getRowCount($result) > 0){ + + // We have some data. + while ($row = $this->db->fetchByAssoc($result)) { + foreach($this->list_fields_name as $field) + { + if (isset($row[$field])) { + $this->$field = $row[$field]; + } + else { + $this->$field = ''; + } + } + $list[] = $this; + } + } + if (isset($list)) + { + $log->debug("Exiting get_full_list method ..."); + return $list; + } + else + { + $log->debug("Exiting get_full_list method ..."); + return null; + } + + } + + +//calendarsync + /** + * Function to get meeting count + * @param string $user_name - User Name + * return integer $row["count(*)"] - count + */ + function getCount_Meeting($user_name) + { + global $log; + $log->debug("Entering getCount_Meeting(".$user_name.") method ..."); + $query = "select count(*) from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting'"; + + $result = $this->db->query($query,true,"Error retrieving contacts count"); + $rows_found = $this->db->getRowCount($result); + $row = $this->db->fetchByAssoc($result, 0); + $log->debug("Exiting getCount_Meeting method ..."); + return $row["count(*)"]; + } + + function get_calendars($user_name,$from_index,$offset) + { + global $log; + $log->debug("Entering get_calendars(".$user_name.",".$from_index.",".$offset.") method ..."); + $query = "select vtiger_activity.location as location,vtiger_activity.duration_hours as duehours, vtiger_activity.duration_minutes as dueminutes,vtiger_activity.time_start as time_start, vtiger_activity.subject as name,vtiger_crmentity.modifiedtime as date_modified, vtiger_activity.date_start start_date,vtiger_activity.activityid as id,vtiger_activity.status as status, vtiger_crmentity.description as description, vtiger_activity.priority as vtiger_priority, vtiger_activity.due_date as date_due ,vtiger_contactdetails.firstname cfn, vtiger_contactdetails.lastname cln from vtiger_activity inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting' limit " .$from_index ."," .$offset; + $log->debug("Exiting get_calendars method ..."); + return $this->process_list_query1($query); + } +//calendarsync + /** + * Function to get task count + * @param string $user_name - User Name + * return integer $row["count(*)"] - count + */ + function getCount($user_name) + { + global $log; + $log->debug("Entering getCount(".$user_name.") method ..."); + $query = "select count(*) from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task'"; + + $result = $this->db->query($query,true,"Error retrieving contacts count"); + $rows_found = $this->db->getRowCount($result); + $row = $this->db->fetchByAssoc($result, 0); + + $log->debug("Exiting getCount method ..."); + return $row["count(*)"]; + } + + /** + * Function to get list of task for user with given limit + * @param string $user_name - User Name + * @param string $from_index - query string + * @param string $offset - query string + * returns tasks in array format + */ + function get_tasks($user_name,$from_index,$offset) + { + global $log; + $log->debug("Entering get_tasks(".$user_name.",".$from_index.",".$offset.") method ..."); + $query = "select vtiger_activity.subject as name,vtiger_crmentity.modifiedtime as date_modified, vtiger_activity.date_start start_date,vtiger_activity.activityid as id,vtiger_activity.status as status, vtiger_crmentity.description as description, vtiger_activity.priority as priority, vtiger_activity.due_date as date_due ,vtiger_contactdetails.firstname cfn, vtiger_contactdetails.lastname cln from vtiger_activity inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task' limit " .$from_index ."," .$offset; + $log->debug("Exiting get_tasks method ..."); + return $this->process_list_query1($query); + + } + + /** + * Function to process the activity list query + * @param string $query - query string + * return array $response - activity lists + */ + function process_list_query1($query) + { + global $log; + $log->debug("Entering process_list_query1(".$query.") method ..."); + $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); + $list = Array(); + $rows_found = $this->db->getRowCount($result); + if($rows_found != 0) + { + $task = Array(); + for($index = 0 , $row = $this->db->fetchByAssoc($result, $index); $row && $index <$rows_found;$index++, $row = $this->db->fetchByAssoc($result, $index)) + + { + foreach($this->range_fields as $columnName) + { + if (isset($row[$columnName])) { + + $task[$columnName] = $row[$columnName]; + } + else + { + $task[$columnName] = ""; + } + } + + $task[contact_name] = return_name($row, 'cfn', 'cln'); + + $list[] = $task; + } + } + + $response = Array(); + $response['list'] = $list; + $response['row_count'] = $rows_found; + $response['next_offset'] = $next_offset; + $response['previous_offset'] = $previous_offset; + + + $log->debug("Exiting process_list_query1 method ..."); + return $response; + } + + /** + * Function to get reminder for activity + * @param integer $activity_id - activity id + * @param string $reminder_time - reminder time + * @param integer $reminder_sent - 0 or 1 + * @param integer $recurid - recuring eventid + * @param string $remindermode - string like 'edit' + */ + function activity_reminder($activity_id,$reminder_time,$reminder_sent=0,$recurid,$remindermode='') + { + global $log; + $log->debug("Entering vtiger_activity_reminder(".$activity_id.",".$reminder_time.",".$reminder_sent.",".$recurid.",".$remindermode.") method ..."); + //Check for vtiger_activityid already present in the reminder_table + $query_exist = "SELECT activity_id FROM ".$this->reminder_table." WHERE activity_id = ".$activity_id; + $result_exist = $this->db->query($query_exist); + + if($remindermode == 'edit') + { + if($this->db->num_rows($result_exist) == 1) + { + $query = "UPDATE ".$this->reminder_table." SET"; + $query .=" reminder_sent = ".$reminder_sent.","; + $query .=" reminder_time = ".$reminder_time." WHERE activity_id =".$activity_id; + } + else + { + $query = "INSERT INTO ".$this->reminder_table." VALUES (".$activity_id.",".$reminder_time.",0,'".$recurid."')"; + } + } + elseif(($remindermode == 'delete') && ($this->db->num_rows($result_exist) == 1)) + { + $query = "DELETE FROM ".$this->reminder_table." WHERE activity_id = ".$activity_id; + } + else + { + $query = "INSERT INTO ".$this->reminder_table." VALUES (".$activity_id.",".$reminder_time.",0,'".$recurid."')"; + } + $this->db->query($query,true,"Error in processing vtiger_table $this->reminder_table"); + $log->debug("Exiting vtiger_activity_reminder method ..."); + } + +//Used for vtigerCRM Outlook Add-In +/** + * Function to get tasks to display in outlookplugin + * @param string $username - User name + * return string $query - sql query + */ +function get_tasksforol($username) +{ + global $log,$adb; + $log->debug("Entering get_tasksforol(".$username.") method ..."); + global $current_user; + require_once("modules/Users/User.php"); + $seed_user=new User(); + $user_id=$seed_user->retrieve_user_id($user_name); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select tablename,columnname from vtiger_field where tabid=9"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select tablename,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=9 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $adb->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_lists[] = $adb->query_result($result1,$i,'tablename'); + $permitted_lists[] = $adb->query_result($result1,$i,'columnname'); + /*if($adb->query_result($result1,$i,'columnname') == "parentid") + { + $permitted_lists[] = 'vtiger_account'; + $permitted_lists[] = 'accountname'; + }*/ + } + $permitted_lists = array_chunk($permitted_lists,2); + $column_table_lists = array(); + for($i=0;$i < count($permitted_lists);$i++) + { + $column_table_lists[] = implode(".",$permitted_lists[$i]); + } + + $query = "select vtiger_activity.activityid as taskid, ".implode(',',$column_table_lists)." from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid + inner join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid + left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid + left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid + where vtiger_users.user_name='".$username."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task'"; + $log->debug("Exiting get_tasksforol method ..."); + return $query; +} + +/** + * Function to get calendar query for outlookplugin + * @param string $username - User name * return string $query - sql query */ +function get_calendarsforol($user_name) +{ + global $log,$adb; + $log->debug("Entering get_calendarsforol(".$user_name.") method ..."); + global $current_user; + require_once("modules/Users/User.php"); + $seed_user=new User(); + $user_id=$seed_user->retrieve_user_id($user_name); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select tablename,columnname from vtiger_field where tabid=9"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select tablename,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=9 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $adb->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_lists[] = $adb->query_result($result1,$i,'tablename'); + $permitted_lists[] = $adb->query_result($result1,$i,'columnname'); + /*if($adb->query_result($result1,$i,'columnname') == "parentid") + { + $permitted_lists[] = 'vtiger_account'; + $permitted_lists[] = 'accountname'; + }*/ + } + $permitted_lists = array_chunk($permitted_lists,2); + $column_table_lists = array(); + for($i=0;$i < count($permitted_lists);$i++) + { + $column_table_lists[] = implode(".",$permitted_lists[$i]); + } + + $query = "select vtiger_activity.activityid as clndrid, ".implode(',',$column_table_lists)." from vtiger_activity + inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid + inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid + left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid + left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid + inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid + where vtiger_users.user_name='".$user_name."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting'"; + $log->debug("Exiting get_calendarsforol method ..."); + return $query; +} +//End + +} +?> From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 01:29:30 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 08:29:30 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9140 - /vtigercrm/trunk/modules/Contacts/Contact.php Message-ID: <20060828082930.6E8D372A0E2@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 02:29:16 2006 New Revision: 9140 Log: Security Implemented for Outlook Plugin --Jeri Modified: vtigercrm/trunk/modules/Contacts/Contact.php Modified: vtigercrm/trunk/modules/Contacts/Contact.php ============================================================================== --- vtigercrm/trunk/modules/Contacts/Contact.php (original) +++ vtigercrm/trunk/modules/Contacts/Contact.php Mon Aug 28 02:29:16 2006 @@ -240,8 +240,7 @@ { $contact[$columnName] = ""; } - } - + } // TODO OPTIMIZE THE QUERY ACCOUNT NAME AND ID are set separetly for every vtiger_contactdetails and hence // vtiger_account query goes for ecery single vtiger_account row @@ -258,6 +257,69 @@ $log->debug("Exiting process_list_query1 method ..."); return $response; + } + + + /** Function to process list query for Plugin with Security Parameters for a given query + * @param $query + * Returns the results of query in array format + */ + function plugin_process_list_query($query) + { + global $log,$adb,$current_user; + $log->debug("Entering process_list_query1(".$query.") method ..."); + $permitted_field_lists = Array(); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select columnname from vtiger_field where tabid=4 and block <> 75"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=4 and vtiger_field.block <> 6 and vtiger_field.block <> 75 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $this->db->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_field_lists[] = $adb->query_result($result1,$i,'columnname'); + } + + $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); + $list = Array(); + $rows_found = $this->db->getRowCount($result); + if($rows_found != 0) + { + for($index = 0 , $row = $this->db->fetchByAssoc($result, $index); $row && $index <$rows_found;$index++, $row = $this->db->fetchByAssoc($result, $index)) + { + $contact = Array(); + foreach($permitted_field_lists as $columnName) + { + if ($columnName == "lastname" || $columnName == "firstname" || $columnName == "email") + { + $contact[$columnName] = $row[$columnName]; + } + else + { + $contact[$columnName] = ""; + } + } + if(in_array("accountid",$permitted_field_lists)) + { + $contact[accountname] = $row[accountname]; + $contact[account_id] = $row[accountid]; + } + $contact[contactid] = $row[contactid]; + $list[] = $contact; + } + } + + $response = Array(); + $response['list'] = $list; + $response['row_count'] = $rows_found; + $response['next_offset'] = $next_offset; + $response['previous_offset'] = $previous_offset; + $log->debug("Exiting process_list_query1 method ..."); + return $response; } @@ -637,12 +699,12 @@ require('user_privileges/user_privileges_'.$current_user->id.'.php'); if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) { - $sql1 = "select fieldlabel from vtiger_field where tabid=4 and block <> 75"; + $sql1 = "select fieldlabel from vtiger_field where tabid=4 and block <> 75"; }else { - $profileList = getCurrentUserProfileList(); - $sql1 = "select fieldlabel from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=4 and vtiger_field.block <> 6 and vtiger_field.block <> 75 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; - } + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldlabel from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=4 and vtiger_field.block <> 6 and vtiger_field.block <> 75 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } $result = $this->db->query($sql1); $numRows = $this->db->num_rows($result); for($i=0; $i < $numRows;$i++) @@ -665,55 +727,96 @@ function get_searchbyemailid($username,$emailaddress) { global $log; + global $current_user; + require_once("modules/Users/User.php"); + $seed_user=new User(); + $user_id=$seed_user->retrieve_user_id($username); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); $log->debug("Entering get_searchbyemailid(".$username.",".$emailaddress.") method ..."); - $query = "select vtiger_contactdetails.lastname as last_name,vtiger_contactdetails.firstname as first_name, - vtiger_contactdetails.contactid as id, vtiger_contactdetails.salutation as salutation, - vtiger_contactdetails.email as email1,vtiger_contactdetails.title as title, - vtiger_contactdetails.mobile as phone_mobile,vtiger_account.accountname as account_name, - vtiger_account.accountid as vtiger_account_id from vtiger_contactdetails + $query = "select vtiger_contactdetails.lastname,vtiger_contactdetails.firstname, + vtiger_contactdetails.contactid, vtiger_contactdetails.salutation, + vtiger_contactdetails.email,vtiger_contactdetails.title, + vtiger_contactdetails.mobile,vtiger_account.accountname, + vtiger_account.accountid as accountid from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_account on vtiger_account.accountid=vtiger_contactdetails.accountid - left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid - where user_name='" .$username ."' and vtiger_crmentity.deleted=0 and vtiger_contactdetails.email like '%".$emailaddress."%'"; - + left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid + LEFT JOIN vtiger_contactgrouprelation ON vtiger_contactdetails.contactid = vtiger_contactgrouprelation.contactid + LEFT JOIN vtiger_groups ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname + where vtiger_crmentity.deleted=0 and vtiger_contactdetails.email like '%".$emailaddress."%'"; + $tab_id = getTabid("Contacts"); + if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[$tab_id] == 3) + { + $sec_parameter=getListViewSecurityParameter("Contacts"); + $query .= $sec_parameter; + + } $log->debug("Exiting get_searchbyemailid method ..."); - return $this->process_list_query1($query); + return $this->plugin_process_list_query($query); } /** Function to get the Contacts associated with the particular User Name. * @param varchar $user_name - User Name * Returns query */ + function get_contactsforol($user_name) { - global $log; + global $log,$adb; + global $current_user; + require_once("modules/Users/User.php"); + $seed_user=new User(); + $user_id=$seed_user->retrieve_user_id($user_name); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select tablename,columnname from vtiger_field where tabid=4 and block <> 75 and block <> 6 and vtiger_field.block <> 5"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select tablename,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=4 and vtiger_field.block <> 75 and vtiger_field.block <> 6 and vtiger_field.block <> 5 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $adb->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_lists[] = $adb->query_result($result1,$i,'tablename'); + $permitted_lists[] = $adb->query_result($result1,$i,'columnname'); + if($adb->query_result($result1,$i,'columnname') == "accountid") + { + $permitted_lists[] = 'vtiger_account'; + $permitted_lists[] = 'accountname'; + } + } + $permitted_lists = array_chunk($permitted_lists,2); + $column_table_lists = array(); + for($i=0;$i < count($permitted_lists);$i++) + { + $column_table_lists[] = implode(".",$permitted_lists[$i]); + } + $log->debug("Entering get_contactsforol(".$user_name.") method ..."); - $query = "select vtiger_contactdetails.department department, vtiger_contactdetails.phone, - vtiger_contactdetails.fax, vtiger_contactsubdetails.assistant assistant_name, - vtiger_contactsubdetails.assistantphone, - vtiger_contactsubdetails.otherphone, vtiger_contactsubdetails.homephone, - vtiger_contactsubdetails.birthday birthdate, vtiger_contactdetails.lastname last_name, - vtiger_contactdetails.firstname first_name,vtiger_contactdetails.contactid as id, - vtiger_contactdetails.salutation, vtiger_contactdetails.email, - vtiger_contactdetails.title,vtiger_contactdetails.mobile, - vtiger_account.accountname as account_name,vtiger_account.accountid as account_id, - vtiger_contactaddress.mailingcity, vtiger_contactaddress.mailingstreet, - vtiger_contactaddress.mailingcountry, vtiger_contactaddress.mailingstate, - vtiger_contactaddress.mailingzip, vtiger_contactaddress.othercity, - vtiger_contactaddress.otherstreet, vtiger_contactaddress.othercountry, - vtiger_contactaddress.otherstate, vtiger_contactaddress.otherzip - from vtiger_contactdetails + $query = "select vtiger_contactdetails.contactid as id, ".implode(',',$column_table_lists)." from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_account on vtiger_account.accountid=vtiger_contactdetails.accountid left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid - left join vtiger_contactsubdetails on vtiger_contactsubdetails.contactsubscriptionid = vtiger_contactdetails.contactid - where vtiger_users.user_name='" .$user_name ."' and vtiger_crmentity.deleted=0"; - - $log->debug("Exiting get_contactsforol method ..."); + left join vtiger_contactsubdetails on vtiger_contactsubdetails.contactsubscriptionid = vtiger_contactdetails.contactid + LEFT JOIN vtiger_contactgrouprelation ON vtiger_contactdetails.contactid = vtiger_contactgrouprelation.contactid + LEFT JOIN vtiger_groups ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname + where vtiger_crmentity.deleted=0 and vtiger_users.user_name='".$user_name."'"; + $log->debug("Exiting get_contactsforol method ..."); return $query; } + + //End } From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 01:30:32 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 08:30:32 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9141 - in /vtigercrm/trunk/soap: thunderbirdplugin.php vtigerolservice.php Message-ID: <20060828083033.770F975EC75@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 02:30:11 2006 New Revision: 9141 Log: Security Implemented for Outlook and Thunderbird Plugin --Jeri Modified: vtigercrm/trunk/soap/thunderbirdplugin.php vtigercrm/trunk/soap/vtigerolservice.php Modified: vtigercrm/trunk/soap/thunderbirdplugin.php ============================================================================== --- vtigercrm/trunk/soap/thunderbirdplugin.php (original) +++ vtigercrm/trunk/soap/thunderbirdplugin.php Mon Aug 28 02:30:11 2006 @@ -1,382 +1,395 @@ -configureWSDL('vtigersoap'); - -$server->register( - 'create_session', - array('user_name'=>'xsd:string','password'=>'xsd:string'), - array('return'=>'xsd:string'), - $NAMESPACE); - -$server->register( - 'end_session', - array('user_name'=>'xsd:string'), - array('return'=>'xsd:string'), - $NAMESPACE); - -$server->register( - 'SearchContactsByEmail', - array('username'=>'xsd:string','emailaddress'=>'xsd:string'), - array('return'=>'tns:contactdetails'), - $NAMESPACE); - -$server->register( - 'GetContacts', - array('username'=>'xsd:string'), - array('return'=>'tns:contactdetails'), - $NAMESPACE); - -$server->register( - 'AddContact', - array('user_name'=>'xsd:string', - 'first_name'=>'xsd:string', - 'last_name'=>'xsd:string', - 'email_address'=>'xsd:string', - 'account_name'=>'xsd:string', - 'salutation'=>'xsd:string', - 'title'=>'xsd:string', - 'phone_mobile'=>'xsd:string', - 'reports_to'=>'xsd:string', - 'primary_address_street'=>'xsd:string', - 'primary_address_city'=>'xsd:string', - 'primary_address_state'=>'xsd:string' , - 'primary_address_postalcode'=>'xsd:string', - 'primary_address_country'=>'xsd:string', - 'alt_address_city'=>'xsd:string', - 'alt_address_street'=>'xsd:string', - 'alt_address_state'=>'xsd:string', - 'alt_address_postalcode'=>'xsd:string', - 'alt_address_country'=>'xsd:string', - 'office_phone'=>'xsd:string', - 'home_phone'=>'xsd:string', - 'fax'=>'xsd:string', - 'department'=>'xsd:string', - 'description'=>'xsd:string'), - array('return'=>'xsd:string'), - $NAMESPACE); - - -$server->register( - 'track_email', - array('user_name'=>'xsd:string', 'contact_ids'=>'xsd:string', 'date_sent'=>'xsd:date', 'email_subject'=>'xsd:string', 'email_body'=>'xsd:string'), - array('return'=>'xsd:string'), - $NAMESPACE); - -$server->wsdl->addComplexType( - 'contactdetail', - 'complexType', - 'struct', - 'all', - '', - array( - 'id' => array('name'=>'id','type'=>'xsd:string'), - 'firstname' => array('name'=>'firstname','type'=>'xsd:string'), - 'lastname' => array('name'=>'lastname','type'=>'xsd:string'), - 'emailaddress' => array('name'=>'emailaddress','type'=>'xsd:string'), - 'accountname' => array('name'=>'accountname','type'=>'xsd:string'), - 'middlename' => array('name'=>'middlename','type'=>'xsd:string'), - 'birthdate'=> array('name'=>'birthdate','type'=>'xsd:string'), - 'jobtitle'=> array('name'=>'jobtitle','type'=>'xsd:string'), - 'department'=> array('name'=>'department','type'=>'xsd:string'), - 'title' => array('name'=>'title','type'=>'xsd:string'), - 'officephone'=> array('name'=>'officephone','type'=>'xsd:string'), - 'homephone'=> array('name'=>'homephone','type'=>'xsd:string'), - 'otherphone'=> array('name'=>'otherphone','type'=>'xsd:string'), - 'fax'=> array('name'=>'fax','type'=>'xsd:string'), - 'mobile'=> array('name'=>'mobile','type'=>'xsd:string'), - 'asstname'=> array('name'=>'asstname','type'=>'xsd:string'), - 'asstphone'=> array('name'=>'asstphone','type'=>'xsd:string'), - 'reportsto'=> array('name'=>'reportsto','type'=>'xsd:string'), - 'mailingstreet'=> array('name'=>'mailingstreet','type'=>'xsd:string'), - 'mailingcity'=> array('name'=>'mailingcity','type'=>'xsd:string'), - 'mailingstate'=> array('name'=>'mailingstate','type'=>'xsd:string'), - 'mailingzip'=> array('name'=>'mailingzip','type'=>'xsd:string'), - 'mailingcountry'=> array('name'=>'mailingcountry','type'=>'xsd:string'), - 'otherstreet'=> array('name'=>'otherstreet','type'=>'xsd:string'), - 'othercity'=> array('name'=>'othercity','type'=>'xsd:string'), - 'otherstate'=> array('name'=>'otherstate','type'=>'xsd:string'), - 'otherzip'=> array('name'=>'otherzip','type'=>'xsd:string'), - 'othercountry'=> array('name'=>'othercountry','type'=>'xsd:string'), - 'description'=> array('name'=>'description','type'=>'xsd:string'), - 'category'=> array('name'=>'category','type'=>'xsd:string'), - ) -); - -$server->wsdl->addComplexType( - 'contactdetails', - 'complexType', - 'array', - '', - 'SOAP-ENC:Array', - array(), - array( - array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:contactdetail[]') - ), - 'tns:contactdetail' -); - - -function SearchContactsByEmail($username,$emailaddress) -{ - require_once('modules/Contacts/Contact.php'); - - $seed_contact = new Contact(); - $output_list = Array(); - - $response = $seed_contact->get_searchbyemailid($username,$emailaddress); - $contactList = $response['list']; - - // create a return array of names and email addresses. - foreach($contactList as $contact) - { - $output_list[] = Array( - "id" => $contact[id], - "firstname" => $contact[first_name], - "lastname" => $contact[last_name], - "emailaddress" => $contact[email1], - "accountname" => $contact[account_name], - ); - } - - //to remove an erroneous compiler warning - $seed_contact = $seed_contact; - return $output_list; -} - -function track_email($user_name, $contact_ids, $date_sent, $email_subject, $email_body) -{ - global $adb; - require_once('modules/Users/User.php'); - require_once('modules/Emails/Email.php'); - - $seed_user = new User(); - $user_id = $seed_user->retrieve_user_id($user_name); - - $email = new Email(); - //$log->debug($msgdtls['contactid']); - $emailbody = str_replace("'", "''", $email_body); - $emailsubject = str_replace("'", "''",$email_subject); - $datesent = getDisplayDate($date_sent); - - $email->column_fields[subject] = $emailsubject; - $email->column_fields[assigned_user_id] = $user_id; - $email->column_fields[date_start] = $datesent; - $email->column_fields[description] = htmlentities($emailbody); - $email->column_fields[activitytype] = 'Emails'; - $email->save("Emails"); - - $email->set_emails_contact_invitee_relationship($email->id,$contact_ids); - $email->set_emails_se_invitee_relationship($email->id,$contact_ids); - $email->set_emails_user_invitee_relationship($email->id,$user_id); - $sql = "select email from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid where vtiger_crmentity.deleted =0 and vtiger_contactdetails.contactid='".$contact_ids."'"; - $result = $adb->query($sql); - $camodulerow = $adb->fetch_array($result); - if(isset($camodulerow)) - { - $emailid = $camodulerow["email"]; - $query = 'insert into vtiger_emaildetails values ('.$email->id.',"","'.$emailid.'","","","","'.$contact_ids."@77|".'","OUTLOOK")'; - $adb->query($query); - } - return $email->id; -} - - -function GetContacts($username) -{ - global $adb; - global $log; - require_once('modules/Contacts/Contact.php'); - - $seed_contact = new Contact(); - $output_list = Array(); - - $query = $seed_contact->get_contactsforol($username); - $result = $adb->query($query); - - while($contact = $adb->fetch_array($result)) - { - if($contact["birthdate"] == "0000-00-00") - { - $contact["birthdate"] = ""; - } - if($contact["salutation"] == "--None--") - { - $contact["salutation"] = ""; - } - - $namelist = explode(" ", $contact["last_name"]); - if(isset($namelist)) - { - if(count($namelist) >= 2) - { - $contact["last_name"] = $namelist[count($namelist)-1]; - for($i=0; $i $contact["id"], - "title" => $contact["salutation"], - "firstname" => $contact["first_name"], - "middlename" => trim($middlename), - "lastname" => trim($contact["last_name"]), - "birthdate" => $contact["birthdate"], - "emailaddress" => $contact["email"], - "jobtitle" => $contact["title"], - "department" => $contact["department"], - "accountname" => $contact["account_name"], - "officephone" => $contact["phone"], - "homephone" => $contact["homephone"], - "otherphone" => $contact["otherphone"], - "fax" => $contact["fax"], - "mobile" => $contact["mobile"], - "asstname" => $contact["assistant_name"], - "asstphone" => $contact["assistantphone"], - "reportsto" => $contact["reports_to_name"], - "mailingstreet" => $contact["mailingstreet"], - "mailingcity" => $contact["mailingcity"], - "mailingstate" => $contact["mailingstate"], - "mailingzip" => $contact["mailingzip"], - "mailingcountry" => $contact["mailingcountry"], - "otherstreet" => $contact["otherstreet"], - "othercity" => $contact["othercity"], - "otherstate" => $contact["otherstate"], - "otherzip" => $contact["otherzip"], - "othercountry" => $contact["othercountry"], - "description" => "", - "category" => "", - ); - } - $log->debug("*******************"); - $log->fatal($output_list); - - //to remove an erroneous compiler warning - $seed_contact = $seed_contact; - return $output_list; -} - -function retrieve_account_id($account_name,$user_id) -{ - - if($account_name=="") - { - return null; - } - - $query = "select vtiger_account.accountname accountname,vtiger_account.accountid accountid from vtiger_account inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_account.accountid where vtiger_crmentity.deleted=0 and vtiger_account.accountname='" .$account_name."'"; - - - $db = new PearDatabase(); - $result= $db->query($query) or die ("Not able to execute insert"); - - $rows_count = $db->getRowCount($result); - if($rows_count==0) - { - require_once('modules/Accounts/Account.php'); - $account = new Account(); - $account->column_fields[accountname] = $account_name; - $account->column_fields[assigned_user_id]=$user_id; - //$account->saveentity("Accounts"); - $account->save("Accounts"); - //mysql_close(); - return $account->id; - } - else if ($rows_count==1) - { - $row = $db->fetchByAssoc($result, 0); - //mysql_close(); - return $row["accountid"]; - } - else - { - $row = $db->fetchByAssoc($result, 0); - //mysql_close(); - return $row["accountid"]; - } - -} - -function AddContact($user_name, $first_name, $last_name, $email_address ,$account_name , $salutation , $title, $phone_mobile, $reports_to,$primary_address_street,$primary_address_city,$primary_address_state,$primary_address_postalcode,$primary_address_country,$alt_address_city,$alt_address_street,$alt_address_state,$alt_address_postalcode,$alt_address_country,$office_phone="",$home_phone="",$fax="",$department="",$description="") -{ - global $adb; - global $current_user; - require_once('modules/Users/User.php'); - require_once('modules/Contacts/Contact.php'); - - $seed_user = new User(); - $user_id = $seed_user->retrieve_user_id($user_name); - $current_user = $seed_user; - $current_user->retrieve_entity_info($user_id,"Users"); - - $contact = new Contact(); - $contact->column_fields[firstname]=$first_name; - $contact->column_fields[lastname]=$last_name; - $contact->column_fields[birthday]= getDisplayDate("0000-00-00"); - $contact->column_fields[email]=$email_address; - $contact->column_fields[title]=$title; - $contact->column_fields[department]=$department; - $contact->column_fields[account_id]= retrieve_account_id($account_name,$user_id); - $contact->column_fields[phone]= $office_phone; - $contact->column_fields[homephone]= $home_phone; - $contact->column_fields[fax]= $fax; - $contact->column_fields[mobile]=$phone_mobile; - $contact->column_fields[mailingstreet]=$primary_address_street; - $contact->column_fields[mailingcity]=$primary_address_city; - $contact->column_fields[mailingstate]=$primary_address_state; - $contact->column_fields[mailingzip]=$primary_address_postalcode; - $contact->column_fields[mailingcountry]=$primary_address_country; - $contact->column_fields[otherstreet]=$alt_address_street; - $contact->column_fields[othercity]=$alt_address_city; - $contact->column_fields[otherstate]=$alt_address_state; - $contact->column_fields[otherzip]=$alt_address_postalcode; - $contact->column_fields[othercountry]=$alt_address_country; - $contact->column_fields[assigned_user_id]=$user_id; - $contact->column_fields[description]= ""; - $contact->save("Contacts"); - - $contact = $contact; - return $contact->id; -} - -function create_session($user_name, $password) -{ - return "TempSessionID"; -} - -function end_session($user_name) -{ - return "Success"; -} - - -$server->service($HTTP_RAW_POST_DATA); -exit(); -?> +configureWSDL('vtigersoap'); + +$server->register( + 'create_session', + array('user_name'=>'xsd:string','password'=>'xsd:string'), + array('return'=>'xsd:string'), + $NAMESPACE); + +$server->register( + 'end_session', + array('user_name'=>'xsd:string'), + array('return'=>'xsd:string'), + $NAMESPACE); + +$server->register( + 'SearchContactsByEmail', + array('username'=>'xsd:string','emailaddress'=>'xsd:string'), + array('return'=>'tns:contactdetails'), + $NAMESPACE); + +$server->register( + 'GetContacts', + array('username'=>'xsd:string'), + array('return'=>'tns:contactdetails'), + $NAMESPACE); + +$server->register( + 'AddContact', + array('user_name'=>'xsd:string', + 'first_name'=>'xsd:string', + 'last_name'=>'xsd:string', + 'email_address'=>'xsd:string', + 'account_name'=>'xsd:string', + 'salutation'=>'xsd:string', + 'title'=>'xsd:string', + 'phone_mobile'=>'xsd:string', + 'reports_to'=>'xsd:string', + 'primary_address_street'=>'xsd:string', + 'primary_address_city'=>'xsd:string', + 'primary_address_state'=>'xsd:string' , + 'primary_address_postalcode'=>'xsd:string', + 'primary_address_country'=>'xsd:string', + 'alt_address_city'=>'xsd:string', + 'alt_address_street'=>'xsd:string', + 'alt_address_state'=>'xsd:string', + 'alt_address_postalcode'=>'xsd:string', + 'alt_address_country'=>'xsd:string', + 'office_phone'=>'xsd:string', + 'home_phone'=>'xsd:string', + 'fax'=>'xsd:string', + 'department'=>'xsd:string', + 'description'=>'xsd:string'), + array('return'=>'xsd:string'), + $NAMESPACE); + + +$server->register( + 'track_email', + array('user_name'=>'xsd:string', 'contact_ids'=>'xsd:string', 'date_sent'=>'xsd:date', 'email_subject'=>'xsd:string', 'email_body'=>'xsd:string'), + array('return'=>'xsd:string'), + $NAMESPACE); + +$server->wsdl->addComplexType( + 'contactdetail', + 'complexType', + 'struct', + 'all', + '', + array( + 'id' => array('name'=>'id','type'=>'xsd:string'), + 'firstname' => array('name'=>'firstname','type'=>'xsd:string'), + 'lastname' => array('name'=>'lastname','type'=>'xsd:string'), + 'emailaddress' => array('name'=>'emailaddress','type'=>'xsd:string'), + 'accountname' => array('name'=>'accountname','type'=>'xsd:string'), + 'middlename' => array('name'=>'middlename','type'=>'xsd:string'), + 'birthdate'=> array('name'=>'birthdate','type'=>'xsd:string'), + 'jobtitle'=> array('name'=>'jobtitle','type'=>'xsd:string'), + 'department'=> array('name'=>'department','type'=>'xsd:string'), + 'title' => array('name'=>'title','type'=>'xsd:string'), + 'officephone'=> array('name'=>'officephone','type'=>'xsd:string'), + 'homephone'=> array('name'=>'homephone','type'=>'xsd:string'), + 'otherphone'=> array('name'=>'otherphone','type'=>'xsd:string'), + 'fax'=> array('name'=>'fax','type'=>'xsd:string'), + 'mobile'=> array('name'=>'mobile','type'=>'xsd:string'), + 'asstname'=> array('name'=>'asstname','type'=>'xsd:string'), + 'asstphone'=> array('name'=>'asstphone','type'=>'xsd:string'), + 'reportsto'=> array('name'=>'reportsto','type'=>'xsd:string'), + 'mailingstreet'=> array('name'=>'mailingstreet','type'=>'xsd:string'), + 'mailingcity'=> array('name'=>'mailingcity','type'=>'xsd:string'), + 'mailingstate'=> array('name'=>'mailingstate','type'=>'xsd:string'), + 'mailingzip'=> array('name'=>'mailingzip','type'=>'xsd:string'), + 'mailingcountry'=> array('name'=>'mailingcountry','type'=>'xsd:string'), + 'otherstreet'=> array('name'=>'otherstreet','type'=>'xsd:string'), + 'othercity'=> array('name'=>'othercity','type'=>'xsd:string'), + 'otherstate'=> array('name'=>'otherstate','type'=>'xsd:string'), + 'otherzip'=> array('name'=>'otherzip','type'=>'xsd:string'), + 'othercountry'=> array('name'=>'othercountry','type'=>'xsd:string'), + 'description'=> array('name'=>'description','type'=>'xsd:string'), + 'category'=> array('name'=>'category','type'=>'xsd:string'), + ) +); + +$server->wsdl->addComplexType( + 'contactdetails', + 'complexType', + 'array', + '', + 'SOAP-ENC:Array', + array(), + array( + array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:contactdetail[]') + ), + 'tns:contactdetail' +); + + +function SearchContactsByEmail($username,$emailaddress) +{ + require_once('modules/Contacts/Contact.php'); + + $seed_contact = new Contact(); + $output_list = Array(); + + $response = $seed_contact->get_searchbyemailid($username,$emailaddress); + $contactList = $response['list']; + + // create a return array of names and email addresses. + foreach($contactList as $contact) + { + $output_list[] = Array( + "id" => $contact[contactid], + "firstname" => $contact[firstname], + "lastname" => $contact[lastname], + "emailaddress" => $contact[email], + "accountname" => $contact[accountname], + ); + } + + //to remove an erroneous compiler warning + $seed_contact = $seed_contact; + return $output_list; +} + +function track_email($user_name, $contact_ids, $date_sent, $email_subject, $email_body) +{ + global $adb; + require_once('modules/Users/User.php'); + require_once('modules/Emails/Email.php'); + + $seed_user = new User(); + $user_id = $seed_user->retrieve_user_id($user_name); + + $email = new Email(); + //$log->debug($msgdtls['contactid']); + $emailbody = str_replace("'", "''", $email_body); + $emailsubject = str_replace("'", "''",$email_subject); + $datesent = getDisplayDate($date_sent); + + $email->column_fields[subject] = $emailsubject; + $email->column_fields[assigned_user_id] = $user_id; + $email->column_fields[date_start] = $datesent; + $email->column_fields[description] = htmlentities($emailbody); + $email->column_fields[activitytype] = 'Emails'; + $email->save("Emails"); + + $email->set_emails_contact_invitee_relationship($email->id,$contact_ids); + $email->set_emails_se_invitee_relationship($email->id,$contact_ids); + $email->set_emails_user_invitee_relationship($email->id,$user_id); + $sql = "select email from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid where vtiger_crmentity.deleted =0 and vtiger_contactdetails.contactid='".$contact_ids."'"; + $result = $adb->query($sql); + $camodulerow = $adb->fetch_array($result); + if(isset($camodulerow)) + { + $emailid = $camodulerow["email"]; + $query = 'insert into vtiger_emaildetails values ('.$email->id.',"","'.$emailid.'","","","","'.$contact_ids."@77|".'","OUTLOOK")'; + $adb->query($query); + } + return $email->id; +} + + +function GetContacts($username) +{ + global $adb; + global $log; + require_once('modules/Contacts/Contact.php'); + + $seed_contact = new Contact(); + $output_list = Array(); + + $query = $seed_contact->get_contactsforol($username); + $result = $adb->query($query); + + while($contact = $adb->fetch_array($result)) + { + if($contact["birthdate"] == "0000-00-00") + { + $contact["birthdate"] = ""; + } + if($contact["salutation"] == "--None--") + { + $contact["salutation"] = ""; + } + + $namelist = explode(" ", $contact["lastname"]); + if(isset($namelist)) + { + if(count($namelist) >= 2) + { + $contact["lastname"] = $namelist[count($namelist)-1]; + for($i=0; $i $contact["id"], + "title" => $contact["salutation"], + "firstname" => $contact["firstname"], + "middlename" => trim($middlename), + "lastname" => trim($contact["lastname"]), + "birthdate" => $contact["birthday"], + "emailaddress" => $contact["email"], + "jobtitle" => $contact["title"], + "department" => $contact["department"], + "accountname" => $contact["accountname"], + "officephone" => $contact["phone"], + "homephone" => $contact["homephone"], + "otherphone" => $contact["otherphone"], + "fax" => $contact["fax"], + "mobile" => $contact["mobile"], + "asstname" => $contact["assistant"], + "asstphone" => $contact["assistantphone"], + "reportsto" => $contact["reports_to_name"], + "mailingstreet" => $contact["mailingstreet"], + "mailingcity" => $contact["mailingcity"], + "mailingstate" => $contact["mailingstate"], + "mailingzip" => $contact["mailingzip"], + "mailingcountry" => $contact["mailingcountry"], + "otherstreet" => $contact["otherstreet"], + "othercity" => $contact["othercity"], + "otherstate" => $contact["otherstate"], + "otherzip" => $contact["otherzip"], + "othercountry" => $contact["othercountry"], + "description" => "", + "category" => "", + ); + } + //to remove an erroneous compiler warning + $seed_contact = $seed_contact; + return $output_list; +} + +function retrieve_account_id($account_name,$user_id) +{ + + if($account_name=="") + { + return null; + } + + $query = "select vtiger_account.accountname accountname,vtiger_account.accountid accountid from vtiger_account inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_account.accountid where vtiger_crmentity.deleted=0 and vtiger_account.accountname='" .$account_name."'"; + + + $db = new PearDatabase(); + $result= $db->query($query) or die ("Not able to execute insert"); + + $rows_count = $db->getRowCount($result); + if($rows_count==0) + { + require_once('modules/Accounts/Account.php'); + $account = new Account(); + $account->column_fields[accountname] = $account_name; + $account->column_fields[assigned_user_id]=$user_id; + //$account->saveentity("Accounts"); + $account->save("Accounts"); + //mysql_close(); + return $account->id; + } + else if ($rows_count==1) + { + $row = $db->fetchByAssoc($result, 0); + //mysql_close(); + return $row["accountid"]; + } + else + { + $row = $db->fetchByAssoc($result, 0); + //mysql_close(); + return $row["accountid"]; + } + +} + +function AddContact($user_name, $first_name, $last_name, $email_address ,$account_name , $salutation , $title, $phone_mobile, $reports_to,$primary_address_street,$primary_address_city,$primary_address_state,$primary_address_postalcode,$primary_address_country,$alt_address_city,$alt_address_street,$alt_address_state,$alt_address_postalcode,$alt_address_country,$office_phone="",$home_phone="",$fax="",$department="",$description="") +{ + global $adb; + global $current_user; + require_once('modules/Users/User.php'); + require_once('modules/Contacts/Contact.php'); + + $seed_user = new User(); + $user_id = $seed_user->retrieve_user_id($user_name); + $current_user = $seed_user; + $current_user->retrieve_entity_info($user_id,"Users"); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select fieldname,columnname from vtiger_field where tabid=4 and block <> 75 and block <> 6 and block <> 5"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldname,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=4 and vtiger_field.block <> 75 and vtiger_field.block <> 6 and vtiger_field.block <> 5 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $adb->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_lists[] = $adb->query_result($result1,$i,'fieldname'); + } + + $contact = new Contact(); + $contact->column_fields[firstname]=in_array('salutation',$permitted_lists) ? $first_name : ""; + $contact->column_fields[lastname]=in_array('lastname',$permitted_lists) ? $last_name : ""; + $contact->column_fields[birthday]=in_array('birthday',$permitted_lists) ? getDisplayDate("0000-00-00") : ""; + $contact->column_fields[email]=in_array('email',$permitted_lists) ? $email_address : ""; + $contact->column_fields[title]=in_array('title',$permitted_lists) ? $title : ""; + $contact->column_fields[department]=in_array('department',$permitted_lists) ? $department : ""; + $contact->column_fields[account_id]=in_array('account_id',$permitted_lists) ? retrieve_account_id($account_name,$user_id) : ""; + $contact->column_fields[phone]=in_array('phone',$permitted_lists) ? $office_phone : ""; + $contact->column_fields[homephone]=in_array('homephone',$permitted_lists) ? $home_phone : ""; + $contact->column_fields[fax]=in_array('fax',$permitted_lists) ? $fax : ""; + $contact->column_fields[mobile]=in_array('mobile',$permitted_lists) ? $phone_mobile : ""; + $contact->column_fields[mailingstreet]=in_array('mailingstreet',$permitted_lists) ? $primary_address_street : ""; + $contact->column_fields[mailingcity]=in_array('mailingcity',$permitted_lists) ? $primary_address_city : ""; + $contact->column_fields[mailingstate]=in_array('mailingstate',$permitted_lists) ? $primary_address_state : ""; + $contact->column_fields[mailingzip]=in_array('mailingzip',$permitted_lists) ? $primary_address_postalcode : ""; + $contact->column_fields[mailingcountry]=in_array('mailingcountry',$permitted_lists) ? $primary_address_country : ""; + $contact->column_fields[otherstreet]=in_array('otherstreet',$permitted_lists) ? $alt_address_street : ""; + $contact->column_fields[othercity]=in_array('othercity',$permitted_lists) ? $alt_address_city : ""; + $contact->column_fields[otherstate]=in_array('otherstate',$permitted_lists) ? $alt_address_state : ""; + $contact->column_fields[otherzip]=in_array('otherzip',$permitted_lists) ? $alt_address_postalcode : ""; + $contact->column_fields[othercountry]=in_array('othercountry',$permitted_lists) ? $alt_address_country : ""; + $contact->column_fields[assigned_user_id]=in_array('assigned_user_id',$permitted_lists) ? $user_id : ""; + $contact->column_fields[description]= ""; + $contact->save("Contacts"); + + $contact = $contact; + return $contact->id; +} + +function create_session($user_name, $password) +{ + return "TempSessionID"; +} + +function end_session($user_name) +{ + return "Success"; +} + + +$server->service($HTTP_RAW_POST_DATA); +exit(); +?> Modified: vtigercrm/trunk/soap/vtigerolservice.php ============================================================================== --- vtigercrm/trunk/soap/vtigerolservice.php (original) +++ vtigercrm/trunk/soap/vtigerolservice.php Mon Aug 28 02:30:11 2006 @@ -292,11 +292,11 @@ foreach($contactList as $contact) { $output_list[] = Array( - "id" => $contact[id], - "firstname" => $contact[first_name], - "lastname" => $contact[last_name], - "accountname" => $contact[account_name], - "emailaddress" => $contact[email1], + "id" => $contact[contactid], + "firstname" => $contact[firstname], + "lastname" => $contact[lastname], + "accountname" => $contact[accountname], + "emailaddress" => $contact[email], ); } @@ -316,35 +316,35 @@ foreach($msgdtls as $msgdtl) { - if(isset($msgdtl)) - { - $email = new Email(); - //$log->debug($msgdtls['contactid']); - $email_body = str_replace("'", "''", $msgdtl['body']); - $email_subject = str_replace("'", "''",$msgdtl['subject']); - $date_sent = getDisplayDate($msgdtl['datesent']); - - $email->column_fields[subject] = $email_subject; - $email->column_fields[assigned_user_id] = $user_id; - $email->column_fields[date_start] = $date_sent; - $email->column_fields[description] = htmlentities($email_body); - $email->column_fields[activitytype] = 'Emails'; - $email->plugin_save = true; - $email->save("Emails"); - - $email->set_emails_contact_invitee_relationship($email->id,$contactid); - $email->set_emails_se_invitee_relationship($email->id,$contactid); - $email->set_emails_user_invitee_relationship($email->id,$user_id); - $sql = "select email from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid where vtiger_crmentity.deleted =0 and vtiger_contactdetails.contactid='".$contactid."'"; - $result = $adb->query($sql); - $camodulerow = $adb->fetch_array($result); - if(isset($camodulerow)) - { - $emailid = $camodulerow["email"]; - $query = 'insert into vtiger_emaildetails values ('.$email->id.',"","'.$emailid.'","","","","'.$contactid."@77|".'","OUTLOOK")'; - $adb->query($query); - } - return $email->id; + if(isset($msgdtl)) + { + $email = new Email(); + //$log->debug($msgdtls['contactid']); + $email_body = str_replace("'", "''", $msgdtl['body']); + $email_subject = str_replace("'", "''",$msgdtl['subject']); + $date_sent = getDisplayDate($msgdtl['datesent']); + + $email->column_fields[subject] = $email_subject; + $email->column_fields[assigned_user_id] = $user_id; + $email->column_fields[date_start] = $date_sent; + $email->column_fields[description] = htmlentities($email_body); + $email->column_fields[activitytype] = 'Emails'; + $email->plugin_save = true; + $email->save("Emails"); + + $email->set_emails_contact_invitee_relationship($email->id,$contactid); + $email->set_emails_se_invitee_relationship($email->id,$contactid); + $email->set_emails_user_invitee_relationship($email->id,$user_id); + $sql = "select email from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid where vtiger_crmentity.deleted =0 and vtiger_contactdetails.contactid='".$contactid."'"; + $result = $adb->query($sql); + $camodulerow = $adb->fetch_array($result); + if(isset($camodulerow)) + { + $emailid = $camodulerow["email"]; + $query = 'insert into vtiger_emaildetails values ('.$email->id.',"","'.$emailid.'","","","","'.$contactid."@77|".'","OUTLOOK")'; + $adb->query($query); + } + return $email->id; } else { @@ -409,7 +409,7 @@ $current_user=$seed_user; $current_user->retrieve_entity_info($user_id, 'Users'); - if(isPermitted("Contacts","EditView") == "yes") + if(isPermitted("Contacts","Delete") == "yes") { return "allowed"; }else @@ -427,7 +427,7 @@ $current_user=$seed_user; $current_user->retrieve_entity_info($user_id, 'Users'); - if(isPermitted("Calendar","EditView") == "yes") + if(isPermitted("Calendar","Delete") == "yes") { return "allowed"; }else @@ -502,12 +502,12 @@ $contact["salutation"] = ""; } - $namelist = explode(" ", $contact["last_name"]); + $namelist = explode(" ", $contact["lastname"]); if(isset($namelist)) { if(count($namelist) >= 2) { - $contact["last_name"] = $namelist[count($namelist)-1]; + $contact["lastname"] = $namelist[count($namelist)-1]; for($i=0; $i $contact["id"], "title" => $contact["salutation"], - "firstname" => $contact["first_name"], + "firstname" => $contact["firstname"], "middlename" => trim($middlename), - "lastname" => trim($contact["last_name"]), - "birthdate" => $contact["birthdate"], + "lastname" => trim($contact["lastname"]), + "birthdate" => $contact["birthday"], "emailaddress" => $contact["email"], "jobtitle" => $contact["title"], "department" => $contact["department"], - "accountname" => $contact["account_name"], + "accountname" => $contact["accountname"], "officephone" => $contact["phone"], "homephone" => $contact["homephone"], "otherphone" => $contact["otherphone"], "fax" => $contact["fax"], "mobile" => $contact["mobile"], - "asstname" => $contact["assistant_name"], + "asstname" => $contact["assistant"], "asstphone" => $contact["assistantphone"], "reportsto" => $contact["reports_to_name"], "mailingstreet" => $contact["mailingstreet"], @@ -550,7 +550,7 @@ "othercountry" => $contact["othercountry"], "description" => "", "category" => "", - ); + ); } //to remove an erroneous compiler warning @@ -572,48 +572,69 @@ $contact = new Contact(); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select fieldname,columnname from vtiger_field where tabid=4 and block <> 75 and block <> 6 and block <> 5"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldname,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=4 and vtiger_field.block <> 75 and vtiger_field.block <> 6 and vtiger_field.block <> 5 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $adb->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_lists[] = $adb->query_result($result1,$i,'fieldname'); + } + foreach($cntdtls as $cntrow) { if(isset($cntrow)) { - $contact->column_fields[salutation]=$cntrow["title"]; - $contact->column_fields[firstname]=$cntrow["firstname"]; - - if($cntrow["middlename"] != "") - { - $contact->column_fields[lastname]=$cntrow["middlename"]." ".$cntrow["lastname"]; - }else - { - $contact->column_fields[lastname]=$cntrow["lastname"]; - } - - $contact->column_fields[birthday]= getDisplayDate($cntrow["birthdate"]); - $contact->column_fields[email]=$cntrow["emailaddress"]; - $contact->column_fields[title]=$cntrow["jobtitle"]; - $contact->column_fields[department]=$cntrow["department"]; - $contact->column_fields[account_id]= retrieve_account_id($cntrow["accountname"],$user_id); - $contact->column_fields[phone]= $cntrow["officephone"]; - $contact->column_fields[homephone]= $cntrow["homephone"]; - $contact->column_fields[otherphone]= $cntrow["otherphone"]; - $contact->column_fields[fax]= $cntrow["fax"]; - $contact->column_fields[mobile]=$cntrow["mobile"]; - $contact->column_fields[assistant]= $cntrow["asstname"]; - $contact->column_fields[assistantphone]= $cntrow["asstphone"]; - //$contact->column_fields[reports_to_id] =retrievereportsto($reportsto,$user_id,$account_id);// NOT FIXED IN SAVEENTITY.PHP - $contact->column_fields[mailingstreet]=$cntrow["mailingstreet"]; - $contact->column_fields[mailingcity]=$cntrow["mailingcity"]; - $contact->column_fields[mailingstate]=$cntrow["mailingstate"]; - $contact->column_fields[mailingzip]=$cntrow["mailingzip"]; - $contact->column_fields[mailingcountry]=$cntrow["mailingcountry"]; - $contact->column_fields[otherstreet]=$cntrow["otherstreet"]; - $contact->column_fields[othercity]=$cntrow["othercity"]; - $contact->column_fields[otherstate]=$cntrow["otherstate"]; - $contact->column_fields[otherzip]=$cntrow["otherzip"]; - $contact->column_fields[othercountry]=$cntrow["othercountry"]; - $contact->column_fields[assigned_user_id]=$user_id; - $contact->column_fields[description]= $cntrow["description"]; - $contact->save("Contacts"); - } + $contact->column_fields[salutation]=in_array('salutation',$permitted_lists) ? $cntrow["title"] : ""; + $contact->column_fields[firstname]=in_array('firstname',$permitted_lists) ? $cntrow["firstname"] : ""; + + if($cntrow["middlename"] != "") + { + $contact->column_fields[lastname]=$cntrow["middlename"]." ".$cntrow["lastname"]; + }elseif($cntrow["middlename"] != "") + { + $contact->column_fields[lastname]=$cntrow["lastname"]; + }else + { + $contact->column_fields[lastname]=$cntrow["firstname"]." ".$cntrow["middlename"]." ".$cntrow["lastname"]; + } + + $contact->column_fields[birthday]= in_array('birthday',$permitted_lists) ? getDisplayDate($cntrow["birthdate"]) : ""; + $contact->column_fields[email]=in_array('email',$permitted_lists) ? $cntrow["emailaddress"] : ""; + $contact->column_fields[title]=in_array('title',$permitted_lists) ? $cntrow["jobtitle"] : ""; + $contact->column_fields[department]=in_array('department',$permitted_lists) ? $cntrow["department"] : ""; + $contact->column_fields[account_id]= in_array('account_id',$permitted_lists) ? retrieve_account_id($cntrow["accountname"],$user_id) : ""; + $contact->column_fields[phone]= in_array('phone',$permitted_lists) ? $cntrow["officephone"] : ""; + $contact->column_fields[homephone]= in_array('homephone',$permitted_lists) ? $cntrow["homephone"] : ""; + $contact->column_fields[otherphone]= in_array('otherphone',$permitted_lists) ? $cntrow["otherphone"] : ""; + $contact->column_fields[fax]= in_array('fax',$permitted_lists) ? $cntrow["fax"] : ""; + $contact->column_fields[mobile]=in_array('mobile',$permitted_lists) ? $cntrow["mobile"] : ""; + $contact->column_fields[assistant]= in_array('assistant',$permitted_lists) ? $cntrow["asstname"] : ""; + $contact->column_fields[assistantphone]= in_array('assistantphone',$permitted_lists) ? $cntrow["asstphone"] : ""; + //$contact->column_fields[reports_to_id] =retrievereportsto($reportsto,$user_id,$account_id);// NOT FIXED IN SAVEENTITY.PHP + $contact->column_fields[mailingstreet]=in_array('mailingstreet',$permitted_lists) ? $cntrow["mailingstreet"] : ""; + $contact->column_fields[mailingcity]=in_array('mailingcity',$permitted_lists) ? $cntrow["mailingcity"] : ""; + $contact->column_fields[mailingstate]=in_array('mailingstate',$permitted_lists) ? $cntrow["mailingstate"] : ""; + $contact->column_fields[mailingzip]=in_array('mailingzip',$permitted_lists) ? $cntrow["mailingzip"] : ""; + $contact->column_fields[mailingcountry]=in_array('mailingcountry',$permitted_lists) ? $cntrow["mailingcountry"] : ""; + $contact->column_fields[otherstreet]=in_array('otherstreet',$permitted_lists) ? $cntrow["otherstreet"] : ""; + $contact->column_fields[othercity]=in_array('othercity',$permitted_lists) ? $cntrow["othercity"] : ""; + $contact->column_fields[otherstate]=in_array('otherstate',$permitted_lists) ? $cntrow["otherstate"] : ""; + $contact->column_fields[otherzip]=in_array('otherzip',$permitted_lists) ? $cntrow["otherzip"] : ""; + $contact->column_fields[othercountry]=in_array('othercountry',$permitted_lists) ? $cntrow["othercountry"] : ""; + $contact->column_fields[assigned_user_id]=in_array('assigned_user_id',$permitted_lists) ? $user_id : ""; + $contact->column_fields[description]= in_array('description',$permitted_lists) ? $cntrow["description"] : ""; + $contact->save("Contacts"); + + } } $contact = $contact; return $contact->id; @@ -632,46 +653,66 @@ $current_user->retrieve_entity_info($user_id,"Users"); $contact = new Contact(); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select fieldname,columnname from vtiger_field where tabid=4 and block <> 75 and block <> 6 and block <> 5"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldname,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=4 and vtiger_field.block <> 75 and vtiger_field.block <> 6 and vtiger_field.block <> 5 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $adb->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_lists[] = $adb->query_result($result1,$i,'fieldname'); + } foreach($cntdtls as $cntrow) { if(isset($cntrow)) { $contact->retrieve_entity_info($cntrow["id"],"Contacts"); - $contact->column_fields[salutation]=$cntrow["title"]; - $contact->column_fields[firstname]=$cntrow["firstname"]; + $contact->column_fields[salutation]=in_array('salutation',$permitted_lists) ? $cntrow["title"] : ""; + $contact->column_fields[firstname]=in_array('firstname',$permitted_lists) ? $cntrow["firstname"] : ""; if($cntrow["middlename"] != "") { $contact->column_fields[lastname]=$cntrow["middlename"]." ".$cntrow["lastname"]; + }elseif($cntrow["lastname"] != "") + { + $contact->column_fields[lastname]=$cntrow["lastname"]; }else { - $contact->column_fields[lastname]=$cntrow["lastname"]; - } - $contact->column_fields[birthday]= getDisplayDate($cntrow["birthdate"]); - $contact->column_fields[email]=$cntrow["emailaddress"]; - $contact->column_fields[title]=$cntrow["jobtitle"]; - $contact->column_fields[department]=$cntrow["department"]; - $contact->column_fields[account_id]= retrieve_account_id($cntrow["accountname"],$user_id); - $contact->column_fields[phone]= $cntrow["officephone"]; - $contact->column_fields[homephone]= $cntrow["homephone"]; - $contact->column_fields[otherphone]= $cntrow["otherphone"]; - $contact->column_fields[fax]= $cntrow["fax"]; - $contact->column_fields[mobile]=$cntrow["mobile"]; - $contact->column_fields[assistant]= $cntrow["asstname"]; - $contact->column_fields[assistantphone]= $cntrow["asstphone"]; + $contact->column_fields[lastname]=$cntrow["firstname"]." ".$cntrow["middlename"]." ".$cntrow["lastname"]; + } + + $contact->column_fields[birthday]= in_array('birthday',$permitted_lists) ? getDisplayDate($cntrow["birthdate"]) : ""; + $contact->column_fields[email]= in_array('email',$permitted_lists) ? $cntrow["emailaddress"] : ""; + $contact->column_fields[title]= in_array('title',$permitted_lists) ? $cntrow["jobtitle"] : ""; + $contact->column_fields[department]= in_array('department',$permitted_lists) ? $cntrow["department"] : ""; + $contact->column_fields[account_id]= in_array('account_id',$permitted_lists) ? retrieve_account_id($cntrow["accountname"],$user_id) : ""; + $contact->column_fields[phone]= in_array('phone',$permitted_lists) ? $cntrow["officephone"] : ""; + $contact->column_fields[homephone]= in_array('homephone',$permitted_lists) ? $cntrow["homephone"] : ""; + $contact->column_fields[otherphone]= in_array('otherphone',$permitted_lists) ? $cntrow["otherphone"] : ""; + $contact->column_fields[fax]= in_array('fax',$permitted_lists) ? $cntrow["fax"] : ""; + $contact->column_fields[mobile]= in_array('mobile',$permitted_lists) ? $cntrow["mobile"] : ""; + $contact->column_fields[assistant]= in_array('assistant',$permitted_lists) ? $cntrow["asstname"] : ""; + $contact->column_fields[assistantphone]= in_array('assistantphone',$permitted_lists) ? $cntrow["asstphone"] : ""; //$contact->column_fields[reports_to_id] =retrievereportsto($reportsto,$user_id,$account_id);// NOT FIXED IN SAVEENTITY.PHP - $contact->column_fields[mailingstreet]=$cntrow["mailingstreet"]; - $contact->column_fields[mailingcity]=$cntrow["mailingcity"]; - $contact->column_fields[mailingstate]=$cntrow["mailingstate"]; - $contact->column_fields[mailingzip]=$cntrow["mailingzip"]; - $contact->column_fields[mailingcountry]=$cntrow["mailingcountry"]; - $contact->column_fields[otherstreet]=$cntrow["otherstreet"]; - $contact->column_fields[othercity]=$cntrow["othercity"]; - $contact->column_fields[otherstate]=$cntrow["otherstate"]; - $contact->column_fields[otherzip]=$cntrow["otherzip"]; - $contact->column_fields[othercountry]=$cntrow["othercountry"]; - $contact->column_fields[assigned_user_id]=$user_id; - $contact->column_fields[description]= $cntrow["description"]; + $contact->column_fields[mailingstreet]= in_array('mailingstreet',$permitted_lists) ? $cntrow["mailingstreet"] : ""; + $contact->column_fields[mailingcity]= in_array('mailingcity',$permitted_lists) ? $cntrow["mailingcity"] : ""; + $contact->column_fields[mailingstate]= in_array('mailingstate',$permitted_lists) ? $cntrow["mailingstate"] : ""; + $contact->column_fields[mailingzip]= in_array('mailingzip',$permitted_lists) ? $cntrow["mailingzip"] : ""; + $contact->column_fields[mailingcountry]= in_array('mailingcountry',$permitted_lists) ? $cntrow["mailingcountry"] : ""; + $contact->column_fields[otherstreet]= in_array('otherstreet',$permitted_lists) ? $cntrow["otherstreet"] : ""; + $contact->column_fields[othercity]= in_array('othercity',$permitted_lists) ? $cntrow["othercity"] : ""; + $contact->column_fields[otherstate]= in_array('otherstate',$permitted_lists) ? $cntrow["otherstate"] : ""; + $contact->column_fields[otherzip]= in_array('otherzip',$permitted_lists) ? $cntrow["otherzip"] : ""; + $contact->column_fields[othercountry]= in_array('othercountry',$permitted_lists) ? $cntrow["othercountry"] : ""; + $contact->column_fields[assigned_user_id]= in_array('assigned_user_id',$permitted_lists) ? $user_id : ""; + $contact->column_fields[description]= in_array('description',$permitted_lists) ? $cntrow["description"] : ""; $contact->id = $cntrow["id"]; $contact->mode = "edit"; $contact->save("Contacts"); @@ -743,7 +784,7 @@ function GetTasks($username) { - global $adb; + global $adb,$log; require_once('modules/Calendar/Activity.php'); $seed_task = new Activity(); @@ -754,11 +795,11 @@ while($task = $adb->fetch_array($result)) { - if($task["startdate"] == "0000-00-00" || $task["startdate"] == NULL) + if($task["date_start"] == "0000-00-00" || $task["date_start"] == NULL) { $task["startdate"] = ""; } - if($task["duedate"] == "0000-00-00" || $task["duedate"] == NULL) + if($task["due_date"] == "0000-00-00" || $task["due_date"] == NULL) { $task["duedate"] = ""; } @@ -821,15 +862,30 @@ $current_user = $seed_user; $current_user->retrieve_entity_info($user_id,"Users"); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select fieldname,columnname from vtiger_field where tabid=9"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldname,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=9 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $adb->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_lists[] = $adb->query_result($result1,$i,'fieldname'); + } + $task = new Activity(); foreach($taskdtls as $taskrow) { - - //Currently only 3 status avail Note ************************************************ - if(isset($taskrow)) - { + if(isset($taskrow)) + { if($taskrow["status"] == "0") { $taskrow["status"] = "Not Started"; @@ -861,17 +917,17 @@ $taskrow["priority"] = "Medium"; } - $task->column_fields[subject] = $taskrow["subject"]; - $task->column_fields[date_start]=getDisplayDate($taskrow["startdate"]); - $task->column_fields[due_date]=getDisplayDate($taskrow["duedate"]); - $task->column_fields[taskstatus]=$taskrow["status"]; - $task->column_fields[taskpriority]=$taskrow["priority"]; - $task->column_fields[description]=$taskrow["description"]; + $task->column_fields[subject] = in_array('subject',$permitted_lists) ? $taskrow["subject"] : ""; + $task->column_fields[date_start]= in_array('date_start',$permitted_lists) ? getDisplayDate($taskrow["startdate"]) : ""; + $task->column_fields[due_date]= in_array('due_date',$permitted_lists) ? getDisplayDate($taskrow["duedate"]) : ""; + $task->column_fields[taskstatus]= in_array('taskstatus',$permitted_lists) ? $taskrow["status"] : ""; + $task->column_fields[taskpriority]= in_array('taskpriority',$permitted_lists) ? $taskrow["priority"] : ""; + $task->column_fields[description]= in_array('description',$permitted_lists) ? $taskrow["description"] : ""; $task->column_fields[activitytype]="Task"; //$task->column_fields[contact_id]= retrievereportsto($contact_name,$user_id,null); - $task->column_fields[assigned_user_id]=$user_id; + $task->column_fields[assigned_user_id]=in_array('assigned_user_id',$permitted_lists) ? $user_id : ""; $task->save("Calendar"); - } + } } return $task->id; } @@ -887,6 +943,23 @@ $current_user = $seed_user; $current_user->retrieve_entity_info($user_id,"Users"); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select fieldname,columnname from vtiger_field where tabid=9"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldname,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=9 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $adb->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_lists[] = $adb->query_result($result1,$i,'fieldname'); + } + $task = new Activity(); foreach($taskdtls as $taskrow) @@ -913,24 +986,24 @@ $taskrow["status"] = "Not Started"; } - if($taskrow["priority"] == "2") - { - $taskrow["priority"] = "High"; - }else if($taskrow["priority"] == "0") - { - $taskrow["priority"] = "Low"; - }else if($taskrow["priority"] == "1") - { - $taskrow["priority"] = "Medium"; - } - + if($taskrow["priority"] == "2") + { + $taskrow["priority"] = "High"; + }else if($taskrow["priority"] == "0") + { + $taskrow["priority"] = "Low"; + }else if($taskrow["priority"] == "1") + { + $taskrow["priority"] = "Medium"; + } + $task->retrieve_entity_info($taskrow["id"],"Calendar"); - $task->column_fields[subject] = $taskrow["subject"]; - $task->column_fields[date_start] = getDisplayDate($taskrow["startdate"]); - $task->column_fields[due_date] = getDisplayDate($taskrow["duedate"]); - $task->column_fields[taskstatus] = $taskrow["status"]; - $task->column_fields[taskpriority] = $taskrow["priority"]; - $task->column_fields[description] = $taskrow["description"]; + $task->column_fields[subject] = in_array('subject',$permitted_lists) ? $taskrow["subject"] : ""; + $task->column_fields[date_start] = in_array('date_start',$permitted_lists) ? getDisplayDate($taskrow["startdate"]) : ""; + $task->column_fields[due_date] = in_array('due_date',$permitted_lists) ? getDisplayDate($taskrow["duedate"]) : ""; + $task->column_fields[taskstatus] = in_array('taskstatus',$permitted_lists) ? $taskrow["status"] : ""; + $task->column_fields[taskpriority] = in_array('taskpriority',$permitted_lists) ? $taskrow["priority"] : ""; + $task->column_fields[description] = in_array('description',$permitted_lists) ? $taskrow["description"] : ""; $task->column_fields[activitytype] = "Task"; //$task->column_fields[contact_id]= retrievereportsto($contact_name,$user_id,null); $task->column_fields[assigned_user_id] = $user_id; @@ -963,7 +1036,7 @@ function GetClndr($username) { - global $adb; + global $adb,$log; require_once('modules/Calendar/Activity.php'); $seed_clndr = new Activity(); @@ -974,34 +1047,34 @@ while($clndr = $adb->fetch_array($result)) { - if($clndr["startdate"] == "0000-00-00" || $clndr["startdate"] == NULL) + if($clndr["date_start"] == "0000-00-00" || $clndr["date_start"] == NULL) { - $clndr["startdate"] = ""; + $clndr["date_start"] = ""; } - if($clndr["duedate"] == "0000-00-00" || $clndr["duedate"] == NULL) + if($clndr["due_date"] == "0000-00-00" || $clndr["due_date"] == NULL) { - $clndr["duedate"] = ""; + $clndr["due_date"] = ""; } //this seperates the $$clndr["startdate"] into an array - YYYY-MM-DD - $expldstartdate = explode("-", $clndr["startdate"]); - $expldtimestart = explode(":", $clndr["startime"]); - - $expldduedate = explode("-", $clndr["duedate"]); + $expldstartdate = explode("-", $clndr["date_start"]); + $expldtimestart = explode(":", $clndr["time_start"]); + + $expldduedate = explode("-", $clndr["due_date"]); //this makes a timestamp out of the exploded date this number is in seconds $startdtm = mktime($expldtimestart[0], $expldtimestart[1], 0, $expldstartdate[1], $expldstartdate[2], $expldstartdate[0]); - $duedtm = mktime($expldtimestart[0]+$clndr["duehours"], $expldtimestart[1]+$clndr["dueminutes"], 0, $expldduedate[1], $expldduedate[2], $expldduedate[0]); - - $clndr["startdate"] = date("Y-m-d H:i:s", $startdtm); - $clndr["duedate"] = date("Y-m-d H:i:s", $duedtm); + $duedtm = mktime($expldtimestart[0]+$clndr["duration_hours"], $expldtimestart[1]+$clndr["duration_minutes"], 0, $expldduedate[1], $expldduedate[2], $expldduedate[0]); + + $clndr["date_start"] = date("Y-m-d H:i:s", $startdtm); + $clndr["due_date"] = date("Y-m-d H:i:s", $duedtm); $output_list[] = Array( "id" => $clndr["clndrid"], "subject" => $clndr["subject"], - "startdate" => $clndr["startdate"], - "duedate" => $clndr["duedate"], + "startdate" => $clndr["date_start"], + "duedate" => $clndr["due_date"], "location" => $clndr["location"], "description" => $clndr["description"], "contactname" => $clndr["firstname"]." ".$clndr["lastname"], @@ -1014,7 +1087,7 @@ function AddClndr($username,$clndrdtls) { - global $current_user; + global $current_user,$adb; require_once('modules/Users/User.php'); require_once('modules/Calendar/Activity.php'); @@ -1023,6 +1096,23 @@ $current_user = $seed_user; $current_user->retrieve_entity_info($user_id,"Users"); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select fieldname,columnname from vtiger_field where tabid=16"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldname,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=16 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $adb->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_lists[] = $adb->query_result($result1,$i,'fieldname'); + } + $clndr = new Activity(); foreach($clndrdtls as $clndrow) @@ -1044,16 +1134,16 @@ $stimeduemin = sprintf('%02d',$diff['minutes']); } - $clndr->column_fields[subject] = $clndrow["subject"]; - $clndr->column_fields[date_start]=getDisplayDate(trim($astartdtm[0])); - $clndr->column_fields[due_date]=getDisplayDate(trim($aduedtm[0])); - $clndr->column_fields[time_start]=$stimestart; - $clndr->column_fields[duration_hours]=$stimeduehr; - $clndr->column_fields[duration_minutes]=$stimeduemin; - $clndr->column_fields[location]=$clndrow["location"]; - $clndr->column_fields[description]=$clndrow["description"]; + $clndr->column_fields[subject] = in_array('subject',$permitted_lists) ? $clndrow["subject"] : ""; + $clndr->column_fields[date_start]= in_array('date_start',$permitted_lists) ? getDisplayDate(trim($astartdtm[0])) : ""; + $clndr->column_fields[due_date]= in_array('due_date',$permitted_lists) ? getDisplayDate(trim($aduedtm[0])) : ""; + $clndr->column_fields[time_start]= in_array('time_start',$permitted_lists) ? $stimestart : ""; + $clndr->column_fields[duration_hours]= in_array('duration_hours',$permitted_lists) ? $stimeduehr : ""; + $clndr->column_fields[duration_minutes]= in_array('duration_minutes',$permitted_lists) ? $stimeduemin : ""; + $clndr->column_fields[location]= in_array('location',$permitted_lists) ? $clndrow["location"] : ""; + $clndr->column_fields[description]= in_array('description',$permitted_lists) ? $clndrow["description"] : ""; $clndr->column_fields[activitytype]="Meeting"; - $clndr->column_fields[assigned_user_id]=$user_id; + $clndr->column_fields[assigned_user_id]= in_array('assigned_user_id',$permitted_lists) ? $user_id : ""; $clndr->save("Calendar"); } } @@ -1063,7 +1153,7 @@ function UpdateClndr($username,$clndrdtls) { global $current_user; - global $adb; + global $adb,$log; require_once('modules/Users/User.php'); require_once('modules/Calendar/Activity.php'); @@ -1071,6 +1161,23 @@ $user_id = $seed_user->retrieve_user_id($username); $current_user = $seed_user; $current_user->retrieve_entity_info($user_id,"Users"); + + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select fieldname,columnname from vtiger_field where tabid=16"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldname,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=16 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $adb->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_lists[] = $adb->query_result($result1,$i,'fieldname'); + } $clndr = new Activity(); @@ -1094,16 +1201,16 @@ } $clndr->retrieve_entity_info($clndrow["id"],"Calendar"); - $clndr->column_fields[subject] = $clndrow["subject"]; - $clndr->column_fields[date_start]=getDisplayDate(trim($astartdtm[0])); - $clndr->column_fields[due_date]=getDisplayDate(trim($aduedtm[0])); - $clndr->column_fields[time_start]=$stimestart; - $clndr->column_fields[duration_hours]=$stimeduehr; - $clndr->column_fields[duration_minutes]=$stimeduemin; - $clndr->column_fields[location]=$clndrow["location"]; - $clndr->column_fields[description]=$clndrow["description"]; + $clndr->column_fields[subject] = in_array('subject',$permitted_lists) ? $clndrow["subject"] : ""; + $clndr->column_fields[date_start]= in_array('date_start',$permitted_lists) ? getDisplayDate(trim($astartdtm[0])) : ""; + $clndr->column_fields[due_date]= in_array('due_date',$permitted_lists) ? getDisplayDate(trim($aduedtm[0])) : ""; + $clndr->column_fields[time_start]= in_array('time_start',$permitted_lists) ? $stimestart : ""; + $clndr->column_fields[duration_hours]= in_array('duration_hours',$permitted_lists) ? $stimeduehr : ""; + $clndr->column_fields[duration_minutes]= in_array('duration_minutes',$permitted_lists) ? $stimeduemin : ""; + $clndr->column_fields[location]= in_array('location',$permitted_lists) ? $clndrow["location"] : ""; + $clndr->column_fields[description]= in_array('description',$permitted_lists) ? $clndrow["description"] : ""; $clndr->column_fields[activitytype]="Meeting"; - $clndr->column_fields[assigned_user_id]=$user_id; + $clndr->column_fields[assigned_user_id]= in_array('assigned_user_id',$permitted_lists) ? $user_id : ""; $clndr->id = $clndrow["id"]; $clndr->mode="edit"; $clndr->save("Calendar"); From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 05:09:15 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 12:09:15 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9142 - in /vtigercrm/trunk/modules: Settings/BackupServerConfig.php Users/Logout.php Message-ID: <20060828120916.6109C6B520C@vtiger.fosslabs.com> Author: saraj Date: Mon Aug 28 06:09:11 2006 New Revision: 9142 Log: backup server filename changed Modified: vtigercrm/trunk/modules/Settings/BackupServerConfig.php vtigercrm/trunk/modules/Users/Logout.php Modified: vtigercrm/trunk/modules/Settings/BackupServerConfig.php ============================================================================== --- vtigercrm/trunk/modules/Settings/BackupServerConfig.php (original) +++ vtigercrm/trunk/modules/Settings/BackupServerConfig.php Mon Aug 28 06:09:11 2006 @@ -29,7 +29,7 @@ $smarty = new vtigerCRM_Smarty; if($_REQUEST['error'] != '') { - $smarty->assign("ERROR_MSG",''.$_REQUEST["error"].''); + $smarty->assign("ERROR_MSG",''.$_REQUEST["error"].''); } $sql="select * from vtiger_systems where server_type = 'backup'"; $result = $adb->query($sql); Modified: vtigercrm/trunk/modules/Users/Logout.php ============================================================================== --- vtigercrm/trunk/modules/Users/Logout.php (original) +++ vtigercrm/trunk/modules/Users/Logout.php Mon Aug 28 06:09:11 2006 @@ -42,7 +42,7 @@ //Taking the Backup of DB - $currenttime=date("Ymd_his"); + $currenttime=date("Ymd_His"); if($ftpserver != '' && $ftpuser != '' && $ftppassword != '') { $backupFileName="backup_".$currenttime.".sql"; save_structure($backupFileName, $root_directory); From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 05:09:59 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 12:09:59 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9143 - in /vtigercrm/trunk: log4php.properties log4php_1.properties modules/Migration/Migration.php modules/Migration/MigrationCheck.php modules/Migration/ModifyDatabase/42P2_to_50.php modules/Migration/ModifyDatabase/rename_tables.php Message-ID: <20060828120959.461296B51E4@vtiger.fosslabs.com> Author: saraj Date: Mon Aug 28 06:09:50 2006 New Revision: 9143 Log: * Modified to handle the migration logs seperately Modified: vtigercrm/trunk/log4php.properties vtigercrm/trunk/log4php_1.properties vtigercrm/trunk/modules/Migration/Migration.php vtigercrm/trunk/modules/Migration/MigrationCheck.php vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50.php vtigercrm/trunk/modules/Migration/ModifyDatabase/rename_tables.php Modified: vtigercrm/trunk/log4php.properties ============================================================================== --- vtigercrm/trunk/log4php.properties (original) +++ vtigercrm/trunk/log4php.properties Mon Aug 28 06:09:50 2006 @@ -24,3 +24,12 @@ log4php.appender.A1.layout.ContextPrinting="true" log4php.appender.A1.layout.DateFormat="%c" log4php.appender.A1.File=logs/vtigercrm.log + +log4php.logger.MIGRATION=DEBUG,A4 +log4php.appender.A4=LoggerAppenderRollingFile +log4php.appender.A4.MaxFileSize=3MB +log4php.appender.A4.MaxBackupIndex=10 +log4php.appender.A4.layout=LoggerLayoutTTCC +log4php.appender.A4.layout.ContextPrinting="true" +log4php.appender.A4.layout.DateFormat="%c" +log4php.appender.A4.File=logs/migration.log Modified: vtigercrm/trunk/log4php_1.properties ============================================================================== Binary files - no diff available. Modified: vtigercrm/trunk/modules/Migration/Migration.php ============================================================================== --- vtigercrm/trunk/modules/Migration/Migration.php (original) +++ vtigercrm/trunk/modules/Migration/Migration.php Mon Aug 28 06:09:50 2006 @@ -40,9 +40,12 @@ */ function Migration($old='',$new='') { + global $migrationlog; + $migrationlog->debug("Inside the constructor Migration."); + $this->oldconn = $old; $this->conn = $new; - $this->conn->println("Database Object has been created."); + $migrationlog->debug("Database Object has been created."); } /** function used to set the Old database parameters in the migration object properties @@ -55,12 +58,16 @@ */ function setOldDatabaseParams($hostname,$mysql_port,$mysql_username,$mysql_password,$dbname) { + global $migrationlog; + $migrationlog->debug("Inside the function setOldDatabaseParams($hostname,$mysql_port,$mysql_username,$mysql_password,$dbname)"); + $this->old_hostname = $hostname; $this->old_mysql_port = $mysql_port; $this->old_mysql_username = $mysql_username; $this->old_mysql_password = $mysql_password; $this->old_dbname = $dbname; - $this->conn->println("Old Database Parameters has been set."); + + $migrationlog->debug("Old Database Parameters has been set."); } /** function used to set the Current ie., new 5.0 database parameters in the migration object properties @@ -73,12 +80,16 @@ */ function setNewDatabaseParams($hostname,$mysql_port,$mysql_username,$mysql_password,$dbname) { + global $migrationlog; + $migrationlog->debug("Inside the function setNewDatabaseParams($hostname,$mysql_port,$mysql_username,$mysql_password,$dbname)"); + $this->new_hostname = $hostname; $this->new_mysql_port = $mysql_port; $this->new_mysql_username = $mysql_username; $this->new_mysql_password = $mysql_password; $this->new_dbname = $dbname; - $this->conn->println("New Database Parameters has been set."); + + $migrationlog->debug("New Database Parameters has been set."); } /** function used to take the database dump @@ -91,7 +102,9 @@ */ function takeDatabaseDump($host_name,$mysql_port,$mysql_username,$mysql_password,$dbname) { - $this->conn->println("Inside the function takeDatabaseDump. Going to take the specified database dump..."); + global $migrationlog; + $migrationlog->debug("Inside the function takeDatabaseDump($host_name,$mysql_port,$mysql_username,$mysql_password,$dbname). Going to take the specified database dump..."); + $dump_filename = 'dump_'.$dbname.'.txt'; if($mysql_password != '') @@ -110,7 +123,8 @@ $server_mysql_path = $_SESSION['set_server_mysql_path']; $dump_str = "mysqldump -u".$mysql_username.$password_str." -h ".$host_name." --port=".$mysql_port." ".$dbname." >> ".$dump_filename; - + $migrationlog->debug("Server path set. Dump string to execute ==> $dump_str"); + chdir ($server_mysql_path); exec("echo 'set FOREIGN_KEY_CHECKS = 0;' > ".$dump_filename); @@ -122,12 +136,15 @@ } else { + $migrationlog->debug("Dump string to execute ==> mysqldump -u".$mysql_username." -h ".$host_name.$password_str." --port=".$mysql_port." ".$dbname." >> ".$dump_filename); + exec("echo 'set FOREIGN_KEY_CHECKS = 0;' > ".$dump_filename); exec("mysqldump -u".$mysql_username." -h ".$host_name.$password_str." --port=".$mysql_port." ".$dbname." >> ".$dump_filename); exec("echo 'set FOREIGN_KEY_CHECKS = 1;' >> ".$dump_filename); } $_SESSION['migration_log'] .= '
'.$dbname.' Database Dump has been taken and the file is ==> '.$dump_filename; + $migrationlog->debug("
$dbname Database Dump has been taken and the file is ==> $dump_filename"); return $dump_filename; } @@ -139,10 +156,12 @@ */ function dropDatabase($conn,$dbname) { - $this->conn->println("Inside the function dropDatabase. Going to drop the new database..."); + global $migrationlog; + $migrationlog->debug("Inside the function dropDatabase($conn,$dbname). Going to drop the database - $dbname"); $sql = "drop database ".$dbname; $conn->query($sql); + $migrationlog->debug("Database ($dbname) has been dropped."); $_SESSION['migration_log'] .= '
'.$dbname.' Database has been dropped.'; } @@ -153,12 +172,15 @@ */ function createDatabase($conn,$dbname) { - $this->conn->println("Inside the function createDatabase. Going to create the new database..."); + global $migrationlog; + $migrationlog->debug("Inside the function createDatabase($conn, $dbname). Going to create the database - $dbname"); + $sql = "create database ".$dbname; $conn->query($sql); $_SESSION['migration_log'] .= '
'.$dbname.' Database has been created.'; - + $migrationlog->debug("Database ($dbname) has been dropped."); + //Added to avoid the No Database Selected error when execute the queries $conn->connect(); } @@ -174,8 +196,9 @@ */ function applyDumpData($host_name,$mysql_port,$mysql_username,$mysql_password,$dbname,$dumpfile) { - $this->conn->println("Inside the function applyDumpData."); - $this->conn->println("hostname=$host_name&port=$mysql_port&username=$mysql_username&password=$mysql_password& dump file = $dumpfile"); + global $migrationlog; + $migrationlog->debug("Inside the function applyDumpData($host_name,$mysql_port,$mysql_username,$mysql_password,$dbname,$dumpfile)."); + if($mysql_password != '') { $password_str = " --password=".$mysql_password; @@ -190,8 +213,9 @@ { $current_working_dir = getcwd(); $server_mysql_path = $_SESSION['set_server_mysql_path']; - + $dump_str = "mysql --user=".$mysql_username.$password_str." -h ".$host_name." --force --port=".$mysql_port." ".$dbname." < ".$dumpfile; + $migrationlog->debug("MySQL server path set. Dump string to apply ==> $dump_str"); //exec("path = $server_mysql_path"); chdir ($server_mysql_path); @@ -203,9 +227,11 @@ else { exec("mysql --user=".$mysql_username." -h ".$host_name." --force --port=".$mysql_port.$password_str." ".$dbname." < ".$dumpfile); + $migrationlog->debug("Dump string to apply ==> mysql --user=$mysql_username -h $host_name --force --port=$mysql_port $password_str $dbname < $dumpfile"); } $_SESSION['migration_log'] .= '
Database Dump has been applied to the '.$dbname.' Database from '.$dumpfile.''; + $migrationlog->debug("
Database Dump has been applied to the $dbname database from $dumpfile "); } @@ -229,11 +255,12 @@ */ function getTablesCountInNewDatabase() { - $this->conn->println("Inside the function getTablesCountInNewDatabase"); + global $migrationlog; + $migrationlog->debug("Inside the function getTablesCountInNewDatabase()"); $newconn = @mysql_connect($this->new_hostname.':'.$this->new_mysql_port,$this->new_mysql_username,$this->new_mysql_password); $tables = @mysql_num_rows(mysql_list_tables($this->new_dbname,$newconn)); - $this->conn->println("Number of Tables in New Database = ".$tables); + $migrationlog->debug("Number of Tables in New Database = $tables"); return $tables; } @@ -242,11 +269,12 @@ */ function getTablesCountInOldDatabase() { - $this->conn->println("Inside the function getTablesCountInOldDatabase"); + global $migrationlog; + $migrationlog->debug("Inside the function getTablesCountInOldDatabase()"); $oldconn = @mysql_connect($this->old_hostname.':'.$this->old_mysql_port,$this->old_mysql_username,$this->old_mysql_password); $tables = @mysql_num_rows(mysql_list_tables($this->old_dbname,$oldconn)); - $this->conn->println("Number of Tables in Old Database = ".$tables); + $migrationlog->debug("Number of Tables in Old Database = $tables"); return $tables; } @@ -256,8 +284,9 @@ */ function modifyDatabase($conn) { - $this->conn->println("Inside the function modifyDatabase"); - $conn->println("\n\n\nMickie ---- Starts"); + global $migrationlog; + $migrationlog->debug("Inside the function modifyDatabase($conn)"); + $migrationlog->debug("\n\n\nMickie ---- Starts"); $_SESSION['migration_log'] .= "
The current database is going to be modified by executing the following queries...
"; @@ -273,7 +302,7 @@ //Handle Here -- Mickie include("modules/Migration/ModifyDatabase/MigrationInfo.php"); - $conn->println("Mickie ---- Ends\n\n\n"); + $migrationlog->debug("Mickie ---- Ends\n\n\n"); } /** function used to run the migration process based on the option selected and values given @@ -297,10 +326,10 @@ //Step : 3 => Put the dump into the New Database //Step : 4 => Modify the new database with the new changes - + global $migrationlog; global $conn; - $this->conn->println("Database Migration from Old Database to the Current Database Starts."); - $this->conn->println("Migration Option = $option"); + $migrationlog->debug("Database Migration from Old Database to the Current Database Starts."); + $migrationlog->debug("Migration Option = $option"); //Set the old database parameters $old_host_name = $this->old_hostname; @@ -320,7 +349,7 @@ if($option == 'dbsource') { //Take the dump of the old Database - $this->conn->println("Going to take the old Database Dump."); + $migrationlog->debug("Going to take the old Database Dump."); $dump_file = $this->takeDatabaseDump($old_host_name,$old_mysql_port,$old_mysql_username,$old_mysql_password,$old_dbname); //check the file size is greater than 10000 bytes (~app) and if yes then continue else goto step1 @@ -344,7 +373,7 @@ if($old_dbname != $new_dbname) { //This is to take dump of the new database for backup purpose - $this->conn->println("Going to take the current Database Dump."); + $migrationlog->debug("Going to take the current Database Dump."); $new_dump_file = $this->takeDatabaseDump($new_host_name,$new_mysql_port,$new_mysql_username,$new_mysql_password,$new_dbname); //check the file size is greater than 10000 bytes (~app) and if yes then continue else goto step1 @@ -371,15 +400,15 @@ { $_SESSION['migration_log'] .= '
Databases are different. So drop the Current Database and create. Also apply the dump of Old Database'; //Drop the current(latest) Database - $this->conn->println("Going to Drop the current Database"); + $migrationlog->debug("Going to Drop the current Database"); $this->dropDatabase($conn,$new_dbname); //Create the new current(latest) Database - $this->conn->println("Going to Create the current Database"); + $migrationlog->debug("Going to Create the current Database"); $this->createDatabase($conn,$new_dbname); //Apply the dump of the old database to the current database - $this->conn->println("Going to apply the old database dump to the new database."); + $migrationlog->debug("Going to apply the old database dump to the new database."); $this->applyDumpData($new_host_name,$new_mysql_port,$new_mysql_username,$new_mysql_password,$new_dbname,$dump_file); //get the number of tables in new database @@ -391,7 +420,7 @@ //if tables are missing after apply the dump, then alert the user and quit if(($new_tables_count != $old_tables_count && $option == 'dbsource') || ($new_tables_count < 180 && $option == 'dumpsource')) { - $this->conn->println("New Database tables not equal to Old Database tables count. Reload the current database again and quit."); + $migrationlog->debug("New Database tables not equal to Old Database tables count. Reload the current database again and quit."); $continue_process = 0; $msg = "The dump may not be applied correctly. Tables exist in 4.2.3 database : $old_tables_count. Tables exist in current database after apply the dump : $new_tables_count"; @@ -406,25 +435,25 @@ if($continue_process == 1) { //Modify the database which is now as old database setup - $this->conn->println("Going to modify the current database which is now as old database setup"); + $migrationlog->debug("Going to modify the current database which is now as old database setup"); $this->modifyDatabase($conn); - $this->conn->println("Database Modifications Ends......"); - $this->conn->println("Database Migration from Old Database to the Current Database has been Finished."); + $migrationlog->debug("Database Modifications Ends......"); + $migrationlog->debug("Database Migration from Old Database to the Current Database has been Finished."); } else { //Drop the current(latest) Database - $this->conn->println("Going to Restore the current Database"); - $this->conn->println("Going to Drop the current Database"); + $migrationlog->debug("Problem in migration. so going to Restore the current Database"); + $migrationlog->debug("Going to Drop the current Database"); $this->dropDatabase($conn,$new_dbname); //Create the new current(latest) Database - $this->conn->println("Going to Create the current Database"); + $migrationlog->debug("Going to Create the current Database"); $this->createDatabase($conn,$new_dbname); //Reload the new db dump and quit - $this->conn->println("Going to apply the new backup db dump"); + $migrationlog->debug("Going to apply the new backup db dump"); $this->applyDumpData($new_host_name,$new_mysql_port,$new_mysql_username,$new_mysql_password,$new_dbname,$new_dump_file); //Return to Step1 Modified: vtigercrm/trunk/modules/Migration/MigrationCheck.php ============================================================================== --- vtigercrm/trunk/modules/Migration/MigrationCheck.php (original) +++ vtigercrm/trunk/modules/Migration/MigrationCheck.php Mon Aug 28 06:09:50 2006 @@ -13,6 +13,9 @@ include("config.inc.php"); $migration_log = ''; +//Added for Migration Log +$migrationlog =& LoggerManager::getLogger('MIGRATION'); + //new database values get from the current vtigerCRM's config.php global $dbconfig; $new_host_name = $dbconfig['db_hostname']; @@ -56,8 +59,11 @@ exit; } } +$migrationlog->debug("$migration_log"); //echo '
Proceed with migration'; + +$migrationlog->debug("Migration Option - ".$_REQUEST['migration_option']); include("modules/Migration/Migration.php"); if($_REQUEST['migration_option'] == 'db_details') { @@ -69,6 +75,12 @@ $old_mysql_password = $_REQUEST['old_mysql_password']; $old_dbname = $_REQUEST['old_dbname']; + $migrationlog->debug("old host name = ".$old_host_name); + $migrationlog->debug("old MySQL port = ".$old_mysql_port); + $migrationlog->debug("old MySQL username = ".$old_mysql_username); + $migrationlog->debug("old MySQL password = ".$old_mysql_password); + $migrationlog->debug("old db name = ".$old_dbname); + //make a connection with the old database $oldconn = @mysql_connect($old_host_name.":".$old_mysql_port,$old_mysql_username,$old_mysql_password); @@ -88,6 +100,7 @@ else { $migration_log .= ' Database Servers can be connected. Can proceed with migration'; + $migrationlog->debug("Database Servers can be connected. continue1 = 1"); $continue1 = 1; } @@ -109,6 +122,7 @@ else { $migration_log .= '
Required databases exist'; + $migrationlog->debug("Required databases exist. continue2 = 1"); $continue2 = 1; } } @@ -133,6 +147,7 @@ else { $migration_log .= '
Tables exist in both the Databases'; + $migrationlog->debug("Tables exist in the database. continue3 = 1"); $continue3 = 1; } } @@ -162,17 +177,21 @@ if($continue1 == 1 && $continue2 == 1 && $continue3 == 1 && $continue4 == 1) { + $migrationlog->debug("Going to migrate..."); + $new_host = explode(":",$new_host_name); $conn = new PearDatabase("mysql",$new_host_name,$new_dbname,$new_mysql_username,$new_mysql_password); $conn->connect(); - $conn->println("MICKIE ==> Option = DB details. From the given DB details we will migrate."); + $migrationlog->debug("MICKIE ==> Option = DB details. From the given DB details we will migrate."); @session_unregister('migration_log'); $_SESSION['migration_log'] = $migration_log; if($conn) { + $migrationlog->debug("Pear Database object created. Going to create migration object."); + $obj = new Migration('',$conn); $obj->setOldDatabaseParams($old_host_name,$old_mysql_port,$old_mysql_username,$old_mysql_password,$old_dbname); $obj->setNewDatabaseParams($new_host[0],$new_host[1],$new_mysql_username,$new_mysql_password,$new_dbname); @@ -196,7 +215,8 @@ { $old_dump_details = $_FILES['old_dump_filename']; $old_dump_filename = $old_dump_details['name']; - + $migrationlog->debug("Dump file name ==> $old_dump_filename"); + //MySQL Dump file details has given if($old_dump_details['size'] != 0 && is_file($old_dump_details['tmp_name'])) { @@ -217,6 +237,7 @@ $invalid_dump = 1; $errormessage = "Please enter a valid Dump file."; } + $migrationlog->debug("Dump file error no = ".$old_dump_details['error']); } if($gotostep1 == 1) @@ -249,12 +270,14 @@ $conn = new PearDatabase("mysql",$new_host_name,$new_dbname,$new_mysql_username,$new_mysql_password); $conn->connect(); - $conn->println("MICKIE ==> Option = Dump File. Selected Dump File will be applied to the new database"); + $migrationlog->debug("MICKIE ==> Option = Dump File. Selected Dump File will be applied to the new database"); @session_unregister('migration_log'); $_SESSION['migration_log'] = $migration_log; if($conn) { + $migrationlog->debug("Pear Database object created. Going to create migration object."); + $obj = new Migration('',$conn); $new_host = explode(":",$new_host_name); @@ -276,6 +299,12 @@ $old_mysql_password = $_REQUEST['alter_old_mysql_password']; $old_dbname = $_REQUEST['alter_old_dbname']; + $migrationlog->debug("old host name = ".$old_host_name); + $migrationlog->debug("old MySQL port = ".$old_mysql_port); + $migrationlog->debug("old MySQL username = ".$old_mysql_username); + $migrationlog->debug("old MySQL password = ".$old_mysql_password); + $migrationlog->debug("old db name = ".$old_dbname); + //make a connection with the old database $oldconn = @mysql_connect($old_host_name.":".$old_mysql_port,$old_mysql_username,$old_mysql_password); @@ -287,6 +316,7 @@ else { $migration_log .= ' Database Server can be connected. Can proceed with migration'; + $migrationlog->debug("Database server connected. continue1 = 1"); $continue1 = 1; } @@ -303,6 +333,7 @@ else { $migration_log .= '
Required database exist'; + $migrationlog->debug("Database exist. continue2 = 1"); $continue2 = 1; } } @@ -320,6 +351,7 @@ else { $migration_log .= '
Tables exist in the Database'; + $migrationlog->debug("Tables exist. continue3 = 1"); $continue3 = 1; } } @@ -334,12 +366,14 @@ $conn = new PearDatabase("mysql",$old_host_name.":".$old_mysql_port,$old_dbname,$old_mysql_username,$old_mysql_password); $conn->connect(); - $conn->println("MICKIE ==> Option = Alter DB details. From the given DB details we will migrate."); + $migrationlog->debug("MICKIE ==> Option = Alter DB details. From the given DB details we will migrate."); @session_unregister('migration_log'); $_SESSION['migration_log'] = $migration_log; if($conn) { + $migrationlog->debug("Database object created. Going to create Migration object"); + $obj = new Migration('',$conn); $obj->setOldDatabaseParams($old_host_name,$old_mysql_port,$old_mysql_username,$old_mysql_password,$old_dbname); //$obj->migrate($same_databases,'dbsource'); Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50.php ============================================================================== --- vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50.php (original) +++ vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50.php Mon Aug 28 06:09:50 2006 @@ -13,20 +13,21 @@ global $conn; +global $migrationlog; global $query_count, $success_query_count, $failure_query_count; global $success_query_array, $failure_query_array; //Added to put prefix vtiger_ in some of the columns in tables which are used for CV and Reports and field -- 23-06-06 -$conn->println("Going to rename the table names with prefix vtiger_"); +$migrationlog->debug("Going to rename the table names with prefix vtiger_"); include("modules/Migration/ModifyDatabase/rename_tables.php"); -$conn->println("Renaming the table names with prefix vtiger_ has been finished"); - - - - - - -$conn->println("Database Modifications for 4.2 Patch2 ==> 5.0(Alpha) Dev 3 Starts here."); +$migrationlog->debug("Renaming the table names with prefix vtiger_ has been finished"); + + + + + + +$migrationlog->debug("Database Modifications for 4.2 Patch2 ==> 5.0(Alpha) Dev 3 Starts here."); @@ -841,7 +842,7 @@ -$conn->println("Database Modifications for 5.0(Alpha) Dev 3 ==> 5.0 Alpha starts here."); +$migrationlog->debug("Database Modifications for 5.0(Alpha) Dev 3 ==> 5.0 Alpha starts here."); //echo "

Database Modifications for 5.0(Alpha) Dev3 ==> 5.0 Alpha starts here.....
"; $alter_query_array6 = Array( "ALTER TABLE vtiger_users ADD column activity_view VARCHAR(25) DEFAULT 'Today' AFTER homeorder", @@ -2650,11 +2651,11 @@ } } -$conn->println("Database Modifications for 5.0(Alpha) Dev 3 ==> 5.0 Alpha (5) ends here."); +$migrationlog->debug("Database Modifications for 5.0(Alpha) Dev 3 ==> 5.0 Alpha (5) ends here."); /************************* The following changes have been made after 5.0 Alpha 5 *************************/ -$conn->println("Database Modifications after 5.0(Alpha 5) starts here."); +$migrationlog->debug("Database Modifications after 5.0(Alpha 5) starts here."); //Added on 22-04-06 - to add the Notify Owner vtiger_field in Contacts and Accounts @@ -2783,7 +2784,7 @@ mkdir($filepath."$year/$month/$week"); $filepath = $filepath.$year."/".$month."/".$week."/"; - $conn->println("File Path = $filepath"); + $migrationlog->debug("File Path = $filepath"); //upto this added to set the file path based on attachment created time //In this file name (attachmentid_filename) the file will be stored in the harddisk @@ -3676,8 +3677,10 @@ function Execute($query) { global $conn, $query_count, $success_query_count, $failure_query_count, $success_query_array, $failure_query_array; - + global $migrationlog; + $status = $conn->query($query); + $query_count++; if(is_object($status)) { @@ -3688,6 +3691,7 @@
'.$query.'
'.$query.'
  {$MOD[$SINGLE_MOD]} {$APP.LBL_INFORMATION}  {$APP.LBL_MORE} {$APP.LBL_INFORMATION} 
Modified: vtigercrm/trunk/Smarty/templates/salesEditView.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/salesEditView.tpl (original) +++ vtigercrm/trunk/Smarty/templates/salesEditView.tpl Mon Aug 28 08:04:18 2006 @@ -73,20 +73,9 @@ - - {if $MODULE eq 'Notes' || $MODULE eq 'Faq'} - - - {else} - - {if $OP_MODE neq 'create_view'} - - {/if} - - {/if}
 {$APP[$SINGLE_MOD]} {$APP.LBL_INFORMATION} {$APP[$SINGLE_MOD]} {$APP.LBL_INFORMATION}  {$APP.LBL_MORE} {$APP.LBL_INFORMATION} 
".$mod_strings['LBL_NONE_SCHEDULED']."
+ "; + $list_view .="
+ + + + + + "; + //checking permission for Create/Edit Operation + if(isPermitted("Calendar","EditView") == "yes") + { + $list_view .=""; + } + else + { + $list_view .=""; + } + $list_view .=" +
+ ".$app_strings['LBL_NO']." ".$app_strings['Events']." ".$app_strings['LBL_FOUND']." !
".$app_strings['LBL_YOU_CAN_CREATE']." ".$app_strings['LBL_AN']." ".$app_strings['Event']." ".$app_strings['LBL_NOW'].". ".$app_strings['LBL_CLICK_THE_LINK']." :
+   -".$app_strings['LBL_CREATE']." ".$app_strings['LBL_A']." ".$app_strings['Meeting']."
+   -".$app_strings['LBL_CREATE']." ".$app_strings['LBL_A']." ".$app_strings['Call']."
+
".$app_strings['LBL_YOU_ARE_NOT_ALLOWED_TO_CREATE']." ".$app_strings['LBL_AN']." ".$app_strings['Event']."
+
"; + $list_view .="
"; $cal_log->debug("Exiting constructEventListView() method..."); @@ -1546,8 +1582,10 @@ $hour_endat = convertTime2UserSelectedFmt($format,($cal['calendar']->day_start_hour+1),false); $time_arr = getaddEventPopupTime($hour_startat,$hour_endat,$format); $temp_ts = $cal['calendar']->date_time->ts; + //to get date in user selected date format $temp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$temp_ts)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$temp_ts)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $temp_ts)):('')))); $list_view = ""; + //labels of listview header $header = Array('0'=>'#', '1'=>$mod_strings['LBL_TIME'], '2'=>$mod_strings['LBL_TODO'], @@ -1564,6 +1602,7 @@ ); $list_view .=""; + //checking permission for Create/Edit Operation if(isPermitted("Calendar","EditView") == "yes") { $list_view .=" @@ -1603,9 +1642,31 @@ } else { - $list_view .=""; - $list_view .=""; - $list_view .=""; + $list_view .=""; } $list_view .="
 
".$mod_strings['LBL_NONE_SCHEDULED']."
"; + $list_view .="
+ + + + + + "; + //checking permission for Create/Edit Operation + if(isPermitted("Calendar","EditView") == "yes") + { + $list_view .=""; + } + else + { + $list_view .=""; + } + + $list_view .=" +
+ ".$app_strings['LBL_NO']." ".$app_strings['Todo']."s ".$app_strings['LBL_FOUND']." !
".$app_strings['LBL_YOU_CAN_CREATE']." ".$app_strings['LBL_A']." ".$app_strings['Todo']." ".$app_strings['LBL_NOW'].". ".$app_strings['LBL_CLICK_THE_LINK']." :
+   -".$app_strings['LBL_CREATE']." ".$app_strings['LBL_A']." ".$app_strings['Todo']." +
".$app_strings['LBL_YOU_ARE_NOT_ALLOWED_TO_CREATE']." ".$app_strings['LBL_A']." ".$app_strings['Todo']."
+
"; + $list_view .="

"; $cal_log->debug("Exiting constructTodoListView() method..."); From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 05:59:55 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 12:59:55 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9178 - /vtigercrm/trunk/modules/Products/Product.php Message-ID: <20060829125955.AC20E745F27@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 29 06:59:52 2006 New Revision: 9178 Log: * Modified the date format in export query form alphabetical to numerical only Modified: vtigercrm/trunk/modules/Products/Product.php Modified: vtigercrm/trunk/modules/Products/Product.php ============================================================================== --- vtigercrm/trunk/modules/Products/Product.php (original) +++ vtigercrm/trunk/modules/Products/Product.php Tue Aug 29 06:59:52 2006 @@ -531,8 +531,8 @@ vtiger_products.unit_price AS unit_price, vtiger_products.weight AS weight, vtiger_products.pack_size AS pack_size, - DATE_FORMAT(vtiger_products.start_date, '%Y-%M-%D') AS start_date, - DATE_FORMAT(vtiger_products.expiry_date, '%Y-%M-%D') AS expiry_date, + DATE_FORMAT(vtiger_products.start_date, '%Y-%m-%d') AS start_date, + DATE_FORMAT(vtiger_products.expiry_date, '%Y-%m-%d') AS expiry_date, vtiger_products.cost_factor AS cost_factor, vtiger_products.commissionrate AS commissionrate, vtiger_products.commissionmethod AS commissionmethod, @@ -571,8 +571,8 @@ vtiger_products.unit_price AS unit_price, vtiger_products.weight AS weight, vtiger_products.pack_size AS pack_size, - DATE_FORMAT(vtiger_products.start_date, '%Y-%M-%D') AS start_date, - DATE_FORMAT(vtiger_products.expiry_date, '%Y-%M-%D') AS expiry_date, + DATE_FORMAT(vtiger_products.start_date, '%Y-%m-%d') AS start_date, + DATE_FORMAT(vtiger_products.expiry_date, '%Y-%m-%d') AS expiry_date, vtiger_products.cost_factor AS cost_factor, vtiger_products.commissionrate AS commissionrate, vtiger_products.commissionmethod AS commissionmethod, From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 06:12:56 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 13:12:56 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9179 - /customerportal/trunk/Tickets/TicketDetail.php Message-ID: <20060829131256.2B70474609F@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 29 07:12:52 2006 New Revision: 9179 Log: * Corrected the attachment spelling Modified: customerportal/trunk/Tickets/TicketDetail.php Modified: customerportal/trunk/Tickets/TicketDetail.php ============================================================================== --- customerportal/trunk/Tickets/TicketDetail.php (original) +++ customerportal/trunk/Tickets/TicketDetail.php Tue Aug 29 07:12:52 2006 @@ -153,7 +153,7 @@
 
Attachemnts
Attachments
+ +
- - - - + +
: + + + + - - - - - - - - - -
@@ -172,24 +240,46 @@
:
-
- - + + + + + + + + + + + + +
   
+ + + + + + + + + + + + +
+ +
  +
+
+
+
+
+ + - - - - -
- +
-
- +
hour_format,'start');?> @@ -205,7 +295,7 @@
- +
hour_format,'end');?> @@ -221,21 +311,15 @@
-
-  :  -
- - - -
- - +
+ + + +
+ + - - + +
@@ -251,8 +335,8 @@
@@ -499,15 +583,12 @@
- -
+ + - - - - -
@@ -612,12 +693,9 @@ - - - @@ -629,35 +707,64 @@
- - + + - - + + - - - - - - - - - +
:
: - hour_format,'start'); ?> -
  -  Set date.. - + + + + + + + + + + + + +
 : 

- + + + +
+ + + + +
+ + + + +
hour_format,'start'); ?>
+ Set date.. + +
+ + + +
+ Set date.. + +
+
 
- - - - - - - - + +
@@ -678,7 +785,7 @@
- +
From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 06:21:18 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 13:21:18 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9182 - in /vtigercrm/trunk/install: 2setConfig.php 3confirmConfig.php 4createConfigFile.php 5createTables.inc.php 5createTables.php Message-ID: <20060829132118.81B6974609D@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 29 07:21:11 2006 New Revision: 9182 Log: changes made to have user defined currency configuration Modified: vtigercrm/trunk/install/2setConfig.php vtigercrm/trunk/install/3confirmConfig.php vtigercrm/trunk/install/4createConfigFile.php vtigercrm/trunk/install/5createTables.inc.php vtigercrm/trunk/install/5createTables.php Modified: vtigercrm/trunk/install/2setConfig.php ============================================================================== --- vtigercrm/trunk/install/2setConfig.php (original) +++ vtigercrm/trunk/install/2setConfig.php Tue Aug 29 07:21:11 2006 @@ -131,9 +131,15 @@ if (isset($_REQUEST['admin_password'])) $admin_password = $_REQUEST['admin_password']; - if (isset($_REQUEST['currency'])) - $currency = $_REQUEST['currency']; + if (isset($_REQUEST['currency_name'])) + $currency_name = $_REQUEST['currency_name']; + if (isset($_REQUEST['currency_symbol'])) + $currency_symbol = $_REQUEST['currency_symbol']; + + if (isset($_REQUEST['currency_code'])) + $currency_code = $_REQUEST['currency_code']; + } else { !isset($_REQUEST['db_hostname']) ? $db_hostname = $hostname: $db_hostname = $_REQUEST['db_hostname']; @@ -243,8 +249,25 @@ if (trim(form.cache_dir.value) =='') { isError = true; errorMessage += "\n temp directory path"; - form.root_directory.focus(); + form.cache_dir.focus(); } + if (trim(form.currency_name.value) =='') { + isError = true; + errorMessage += "\n currency name"; + form.currency_name.focus(); + } + if (trim(form.currency_symbol.value) =='') { + isError = true; + errorMessage += "\n currency symbol"; + form.currency_symbol.focus(); + } + if (trim(form.currency_code.value) =='') { + isError = true; + errorMessage += "\n currency code"; + form.currency_code.focus(); + } + + if(document.getElementById('check_createdb').checked == true) { if (trim(form.root_user.value) =='') { @@ -430,40 +453,27 @@
">
Master Currency*
Note: The default password is 'admin'. You can change the password if necessary now or else you can change it later after logging-in.
+ +

+ + + + + + + + + + + + + + + +
Currency Configuration
Name*">
Symbol*">
Code*">
Modified: vtigercrm/trunk/install/3confirmConfig.php ============================================================================== --- vtigercrm/trunk/install/3confirmConfig.php (original) +++ vtigercrm/trunk/install/3confirmConfig.php Tue Aug 29 07:21:11 2006 @@ -25,7 +25,9 @@ if (isset($_REQUEST['site_URL'])) $site_URL= $_REQUEST['site_URL']; if (isset($_REQUEST['admin_email'])) $admin_email= $_REQUEST['admin_email']; if (isset($_REQUEST['admin_password'])) $admin_password = $_REQUEST['admin_password']; -if (isset($_REQUEST['currency'])) $currency = $_REQUEST['currency']; +if (isset($_REQUEST['currency_name'])) $currency_name = $_REQUEST['currency_name']; +if (isset($_REQUEST['currency_symbol'])) $currency_symbol = $_REQUEST['currency_symbol']; +if (isset($_REQUEST['currency_code'])) $currency_code = $_REQUEST['currency_code']; if (isset($_REQUEST['cache_dir'])) $cache_dir= $_REQUEST['cache_dir']; if (isset($_REQUEST['mail_server'])) $mail_server= $_REQUEST['mail_server']; if (isset($_REQUEST['mail_server_username'])) $mail_server_username= $_REQUEST['mail_server_username']; @@ -226,19 +228,42 @@ Cache Path - - Admin Username + + + + + + + - + - - - -
Admin Configuration
Username admin
Admin PasswordPassword
Master Currency
+ Email + + + + + + + + + + + + + + + + + + + +
Currency Configuration
Name
Symbol
Code
+

@@ -256,7 +281,9 @@ " /> " /> " /> - " /> + " /> + " /> + " /> @@ -291,7 +318,9 @@ " /> " /> " /> - " /> + " /> + " /> + " /> Modified: vtigercrm/trunk/install/4createConfigFile.php ============================================================================== --- vtigercrm/trunk/install/4createConfigFile.php (original) +++ vtigercrm/trunk/install/4createConfigFile.php Tue Aug 29 07:21:11 2006 @@ -47,7 +47,7 @@ $vtiger_version = "5.0 Beta"; $release_date = "31 March 2006"; -if (isset($_REQUEST['db_type'])) $db_type = $_REQUEST['db_type']; + if (isset($_REQUEST['db_hostname'])) { @@ -59,10 +59,9 @@ { $db_hostname = $_REQUEST['db_hostname']; if($db_type == "pgsql") - $db_port = '5432'; - else - $db_port = '3306'; - + $db_port = '5432'; + else + $db_port = '3306'; } } if (isset($_REQUEST['db_username']))$db_username = $_REQUEST['db_username']; @@ -71,7 +70,7 @@ if (isset($_REQUEST['db_name']))$db_name = $_REQUEST['db_name']; -//if (isset($_REQUEST['db_type'])) $db_type = $_REQUEST['db_type']; +if (isset($_REQUEST['db_type'])) $db_type = $_REQUEST['db_type']; if (isset($_REQUEST['db_drop_tables'])) $db_drop_tables = $_REQUEST['db_drop_tables']; @@ -85,7 +84,11 @@ if (isset($_REQUEST['admin_password'])) $admin_password = $_REQUEST['admin_password']; -if (isset($_REQUEST['currency'])) $currency = $_REQUEST['currency']; +if (isset($_REQUEST['currency_name'])) $currency_name = $_REQUEST['currency_name']; + +if (isset($_REQUEST['currency_code'])) $currency_code = $_REQUEST['currency_code']; + +if (isset($_REQUEST['currency_symbol'])) $currency_symbol = $_REQUEST['currency_symbol']; if (isset($_REQUEST['mail_server'])) $mail_server = $_REQUEST['mail_server']; @@ -444,7 +447,9 @@ " /> " /> " /> - " /> + " /> + " /> + " /> Modified: vtigercrm/trunk/install/5createTables.inc.php ============================================================================== --- vtigercrm/trunk/install/5createTables.inc.php (original) +++ vtigercrm/trunk/install/5createTables.inc.php Tue Aug 29 07:21:11 2006 @@ -271,22 +271,8 @@ $db->getUniqueID("vtiger_freetags"); //Master currency population -$currencies = array('Euro'=>array('name'=>'Euro','symbol'=>'&euro','code'=>'EUR'), - 'United States Dollar'=>array('name'=>'United States Dollar','symbol'=>'$','code'=>'USD'), - 'United Kingdom Pounds'=>array('name'=>'United Kingdom Pounds','symbol'=>'£','code'=>'GBP'), - 'Canada Dollars'=>array('name'=>'Canada Dollars','symbol'=>'$','code'=>'CAD'), - 'Australia Dollars'=>array('name'=>'Australia Dollars','symbol'=>'$','code'=>'AUD'), - 'Japan Yen'=>array('name'=>'Japan Yen','symbol'=>'¥','code'=>'JPY'), - 'Indian Rupee'=>array('name'=>'Indian Rupee','symbol'=>'₨','code'=>'INR'), - 'New Zealand Dollars'=>array('name'=>'New Zealand Dollars','symbol'=>'$','code'=>''), - 'South Africa Rand'=>array('name'=>'South Africa Rand','symbol'=>'R','code'=>'ZAR'), - ); - -$symbol = $currencies[$sel_currency]['symbol']; -$code = $currencies[$sel_currency]['code']; - //Insert into vtiger_currency vtiger_table - $db->query("insert into vtiger_currency_info values(".$db->getUniqueID("vtiger_currency_info").",'$sel_currency','$code','$symbol',1,'Active','-11')"); + $db->query("insert into vtiger_currency_info values(".$db->getUniqueID("vtiger_currency_info").",'$currency_name','$currency_code','$currency_symbol',1,'Active','-11')"); // populate the db with seed data if ($db_populate) { Modified: vtigercrm/trunk/install/5createTables.php ============================================================================== --- vtigercrm/trunk/install/5createTables.php (original) +++ vtigercrm/trunk/install/5createTables.php Tue Aug 29 07:21:11 2006 @@ -24,7 +24,9 @@ if (isset($_REQUEST['db_populate'])) $db_populate = $_REQUEST['db_populate']; if (isset($_REQUEST['admin_email'])) $admin_email = $_REQUEST['admin_email']; if (isset($_REQUEST['admin_password'])) $admin_password = $_REQUEST['admin_password']; -if (isset($_REQUEST['currency'])) $sel_currency = $_REQUEST['currency']; +if (isset($_REQUEST['currency_name'])) $currency_name = $_REQUEST['currency_name']; +if (isset($_REQUEST['currency_code'])) $currency_code = $_REQUEST['currency_code']; +if (isset($_REQUEST['currency_symbol'])) $currency_symbol = $_REQUEST['currency_symbol']; ?> From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 06:30:21 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 13:30:21 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9183 - /vtigercrm/trunk/modules/Calendar/CalendarCommon.php Message-ID: <20060829133021.362BF72A465@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 29 07:30:18 2006 New Revision: 9183 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/CalendarCommon.php Modified: vtigercrm/trunk/modules/Calendar/CalendarCommon.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/CalendarCommon.php (original) +++ vtigercrm/trunk/modules/Calendar/CalendarCommon.php Tue Aug 29 07:30:18 2006 @@ -11,11 +11,12 @@ //Code Added by Minnie -Starts require_once('include/database/PearDatabase.php'); -global $mod_strings; +global $mod_strings,$current_user; global $theme; $theme_path="themes/".$theme."/"; $image_path=$theme_path."images/"; - +require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); +require('user_privileges/user_privileges_'.$current_user->id.'.php'); /** * To get the lists of sharedids * @param $id -- The user id :: Type integer @@ -246,5 +247,71 @@ return $combo; } +/** + *Function to construct HTML select combo box + *@param $fieldname -- the field name :: Type string + *@param $tablename -- The table name :: Type string + *constructs html select combo box for combo field + *and returns it in string format. + */ + +function getActFieldCombo($fieldname,$tablename) +{ + global $adb, $mod_strings; + $combo = ''; + $combo .= ''; + return $combo; +} + +/*Fuction to get value for Assigned To field + *returns values of Assigned To field in array format +*/ +function getAssignedTo() +{ + global $current_user,$noof_group_rows,$adb; + $assigned_user_id = $current_user->id; + if($is_admin==false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[getTabid('Calendar')] == 3 or $defaultOrgSharingPermission[getTabid('Calendar')] == 0)) + { + $result=get_current_user_access_groups('Calendar'); + } + else + { + $result = get_group_options(); + } + $nameArray = $adb->fetch_array($result); + global $current_user; + if($is_admin==false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[getTabid($module_name)] == 3 or $defaultOrgSharingPermission[getTabid($module_name)] == 0)) + { + $users_combo = get_select_options_array(get_user_array(FALSE, "Active", $assigned_user_id,'private'), $assigned_user_id); + } + else + { + $users_combo = get_select_options_array(get_user_array(FALSE, "Active", $assigned_user_id), $assigned_user_id); + } + if($noof_group_rows!=0) + { + do + { + $groupname=$nameArray["groupname"]; + $group_option[] = array($groupname=>$selected); + + }while($nameArray = $adb->fetch_array($result)); + } + $fieldvalue[]=$users_combo; + $fieldvalue[] = $group_option; + return $fieldvalue; +} + //Code Added by Minnie -Ends ?> From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 06:39:28 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 13:39:28 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9184 - /vtigercrm/trunk/modules/Calendar/DetailView.php Message-ID: <20060829133928.2C0C374609F@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 29 07:39:24 2006 New Revision: 9184 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/DetailView.php Modified: vtigercrm/trunk/modules/Calendar/DetailView.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/DetailView.php (original) +++ vtigercrm/trunk/modules/Calendar/DetailView.php Tue Aug 29 07:39:24 2006 @@ -128,37 +128,30 @@ $data['endmin'] = $time_arr['endmin']; $data['endfmt'] = $time_arr['endfmt']; $data['record'] = $focus->id; +if(isset($finaldata['sendnotification']) && $finaldata['sendnotification'] == 'yes') + $data['sendnotification'] = 'Yes'; +else + $data['sendnotification'] = 'No'; +$data['subject'] = $finaldata['subject']; +$data['date_start'] = $stdate; +$data['due_date'] = $enddate; +$data['assigned_user_id'] = $finaldata['assigned_user_id']; +$data['taskpriority'] = $finaldata['taskpriority']; +$data['modifiedtime'] = $finaldata['modifiedtime']; +$data['createdtime'] = $finaldata['createdtime']; +$data['parent_name'] = $finaldata['parent_id']; +$data['description'] = $finaldata['description']; if($activity_mode == 'Task') { - $data['task_subject'] = $finaldata['subject']; - $data['task_date_start'] = $stdate; - $data['assigned_user_id'] = $finaldata['assigned_user_id']; $data['taskstatus'] = $finaldata['taskstatus']; - $data['priority'] = $finaldata['taskpriority']; $data['activitytype'] = $activity_mode; - $data['modifiedtime'] = $finaldata['modifiedtime']; - $data['createdtime'] = $finaldata['createdtime']; - $data['parent_name'] = $finaldata['parent_id']; $data['contact_id'] = $finaldata['contact_id']; - if(isset($finaldata['sendnotification']) && $finaldata['sendnotification'] == 'yes') - $data['sendnotification'] = 'Yes'; - else - $data['sendnotification'] = 'No'; } elseif($activity_mode == 'Events') { - $data['subject'] = $finaldata['subject']; - $data['date_start'] = $stdate; - $data['due_date'] = $enddate; $data['visibility'] = $finaldata['visibility']; - $data['assigned_user_id'] = $finaldata['assigned_user_id']; $data['eventstatus'] = $finaldata['eventstatus']; - $data['priority'] = $finaldata['taskpriority']; - $data['sendnotification'] = $finaldata['sendnotification']; $data['activitytype'] = $finaldata['activitytype']; - $data['modifiedtime'] = $finaldata['modifiedtime']; - $data['createdtime'] = $finaldata['createdtime']; - $data['parent_name'] = $finaldata['parent_id']; //Calculating reminder time $rem_days = 0; $rem_hrs = 0; From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 06:50:26 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 13:50:26 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9185 - /vtigercrm/trunk/modules/Calendar/script.js Message-ID: <20060829135026.8515B6B54F9@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 29 07:50:22 2006 New Revision: 9185 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/script.js Modified: vtigercrm/trunk/modules/Calendar/script.js ============================================================================== --- vtigercrm/trunk/modules/Calendar/script.js (original) +++ vtigercrm/trunk/modules/Calendar/script.js Tue Aug 29 07:50:22 2006 @@ -969,3 +969,21 @@ function doNothing() { } + +/** This is Javascript Function which is used to toogle between + * assigntype user and group/team select options while assigning owner to Task. + */ +function toggleTaskAssignType(currType) +{ + if (currType=="U") + { + getObj("task_assign_user").style.display="block" + getObj("task_assign_team").style.display="none" + } + else + { + getObj("task_assign_user").style.display="none" + getObj("task_assign_team").style.display="block" + } +} + From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 06:52:49 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 13:52:49 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9186 - /vtigercrm/trunk/Smarty/templates/EditViewHidden.tpl Message-ID: <20060829135249.8E7B3746280@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 29 07:52:45 2006 New Revision: 9186 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/Smarty/templates/EditViewHidden.tpl Modified: vtigercrm/trunk/Smarty/templates/EditViewHidden.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/EditViewHidden.tpl (original) +++ vtigercrm/trunk/Smarty/templates/EditViewHidden.tpl Tue Aug 29 07:52:45 2006 @@ -42,14 +42,6 @@ - {foreach key=key_one item=arr from=$ACTIVITYDATA.assigned_user_id} - {foreach key=sel_value item=keyvalue from=$arr} - {if $keyvalue eq "selected"} - - - {/if} - {/foreach} - {/foreach} {elseif $MODULE eq 'PurchaseOrder' || $MODULE eq 'SalesOrder' || $MODULE eq 'Invoice' || $MODULE eq 'Quotes'} From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 06:56:03 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 13:56:03 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9187 - /vtigercrm/trunk/Smarty/templates/ActivityEditView.tpl Message-ID: <20060829135603.D4E0A746280@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 29 07:55:59 2006 New Revision: 9187 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/Smarty/templates/ActivityEditView.tpl Modified: vtigercrm/trunk/Smarty/templates/ActivityEditView.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/ActivityEditView.tpl (original) +++ vtigercrm/trunk/Smarty/templates/ActivityEditView.tpl Tue Aug 29 07:55:59 2006 @@ -85,23 +85,12 @@ {if $ACTIVITY_MODE neq 'Task'} - {if $OP_MODE eq 'edit_view'} - {foreach item=arr from=$ACTIVITYDATA.eventstatus} - {foreach key=sel_value item=value from=$arr} - {if $value eq 'selected'} - - {/if} - {/foreach} - {/foreach} - {else} - - {/if} -
+
- - +
{$MOD.LBL_EVENTTYPE} : + {$MOD.LBL_EVENTTYPE} {foreach key=tyeparrkey item=typearr from=$ACTIVITYDATA.activitytype} @@ -122,32 +111,125 @@ - - + + - - - + + + + +
{$MOD.LBL_EVENTNAME} :{$MOD.LBL_EVENTNAME}    + {foreach key=key_one item=arr from=$ACTIVITYDATA.visibility} + {foreach key=sel_value item=value from=$arr} + {if $value eq 'selected' && $sel_value eq 'Public'} + {assign var="visiblecheck" value="checked"} + {else} + {assign var="visiblecheck" value=""} + {/if} + {/foreach} + {/foreach} + {$MOD.LBL_PUBLIC} +
- {foreach key=key_one item=arr from=$ACTIVITYDATA.visibility} - {foreach key=sel_value item=value from=$arr} - {if $value eq 'selected' && $sel_value eq 'Public'} - {assign var="visiblecheck" value="checked"} - {else} - {assign var="visiblecheck" value=""} - {/if} - {/foreach} - {/foreach} - - {$MOD.LBL_PUBLIC}
{$LABEL.description}
+ + + + + + + + + + + + + +
{$LABEL.eventstatus}{$LABEL.assigned_user_id}
+ + + {assign var=check value=1} + {foreach key=key_one item=arr from=$ACTIVITYDATA.assigned_user_id} + {foreach key=sel_value item=value from=$arr} + {if $value ne ''} + {assign var=check value=$check*0} + {else} + {assign var=check value=$check*1} + {/if} + {/foreach} + {/foreach} + + {if $check eq 0} + {assign var=select_user value='checked'} + {assign var=style_user value='display:block'} + {assign var=style_group value='display:none'} + {else} + {assign var=select_group value='checked'} + {assign var=style_user value='display:none'} + {assign var=style_group value='display:block'} + {/if} +  {$APP.LBL_USER} + {if $secondvalue.assigned_user_id neq ''} +  {$APP.LBL_GROUP} + {/if} + + + + + {if $secondvalue.assigned_user_id neq ''} + + + + {/if} +
 {$LABEL.sendnotification} +
{$LABEL.taskpriority} +
+ +
+
-
- +
+
- - - +
- +
-
- +
{$MOD.LBL_EVENTSTAT}
{$STARTHOUR}
@@ -167,7 +249,7 @@
- +
@@ -189,30 +271,11 @@
{$MOD.LBL_EVENTEDAT}
{$ENDHOUR}
-
- {$LABEL.taskpriority} :  - -

- +
@@ -485,65 +548,153 @@
{else} - {if $OP_MODE eq 'edit_view'} - {foreach item=arr from=$ACTIVITYDATA.taskstatus} - {foreach key=sel_value item=value from=$arr} - {if $value eq 'selected'} - - {/if} - {/foreach} - {/foreach} - {else} - - {/if} - +
- - + + - - + + - - - - - - -
{$MOD.LBL_TODO} :{$MOD.LBL_TODO}
{$MOD.LBL_TODODATETIME} :{$STARTHOUR}{$LABEL.description}
  - {foreach key=date_value item=time_value from=$ACTIVITYDATA.date_start} - {assign var=date_val value="$date_value"} - {assign var=time_val value="$time_value"} - {/foreach} -  Set date.. - {foreach key=date_fmt item=date_str from=$secondvalue.date_start} - {assign var=date_vl value="$date_fmt"} - {/foreach} - + + + + + + + + + + + + +
{$LABEL.taskstatus}{$LABEL.taskpriority}{$LABEL.assigned_user_id}
+ + + + + {assign var=check value=1} + {foreach key=key_one item=arr from=$ACTIVITYDATA.assigned_user_id} + {foreach key=sel_value item=value from=$arr} + {if $value ne ''} + {assign var=check value=$check*0} + {else} + {assign var=check value=$check*1} + {/if} + {/foreach} + {/foreach} + {if $check eq 0} + {assign var=select_user value='checked'} + {assign var=style_user value='display:block'} + {assign var=style_group value='display:none'} + {else} + {assign var=select_group value='checked'} + {assign var=style_user value='display:none'} + {assign var=style_group value='display:block'} + {/if} +  User + {if $secondvalue.assigned_user_id neq ''} +  Group + {/if} + + + + {if $secondvalue.assigned_user_id neq ''} + + + + {/if} +
{$LABEL.taskpriority} :  - -
-
- + +

+ + + +
+ + + + +
+ + + + +
{$MOD.LBL_TODODATETIME}
{$STARTHOUR}
+ {foreach key=date_value item=time_value from=$ACTIVITYDATA.date_start} + {assign var=date_val value="$date_value"} + {assign var=time_val value="$time_value"} + {/foreach} + Set date.. + {foreach key=date_fmt item=date_str from=$secondvalue.date_start} + {assign var=date_vl value="$date_fmt"} + {/foreach} + +
+ + + +
{$LABEL.due_date}
+ {foreach key=date_value item=time_value from=$ACTIVITYDATA.due_date} + {assign var=date_val value="$date_value"} + {assign var=time_val value="$time_value"} + {/foreach} + Set date.. + {foreach key=date_fmt item=date_str from=$secondvalue.due_date} + {assign var=date_vl value="$date_fmt"} + {/foreach} + +
+
 
+
From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 06:56:35 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 13:56:35 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9188 - /vtigercrm/trunk/Smarty/templates/ActivityDetailView.tpl Message-ID: <20060829135635.B987F74609F@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 29 07:56:31 2006 New Revision: 9188 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/Smarty/templates/ActivityDetailView.tpl Modified: vtigercrm/trunk/Smarty/templates/ActivityDetailView.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/ActivityDetailView.tpl (original) +++ vtigercrm/trunk/Smarty/templates/ActivityDetailView.tpl Tue Aug 29 07:56:31 2006 @@ -106,58 +106,77 @@
{/foreach} {if $ACTIVITYDATA.activitytype neq 'Task'} - +
- - + + + + - - + + + + - - - -
{$MOD.LBL_EVENTTYPE} :{$ACTIVITYDATA.activitytype}{$MOD.LBL_EVENTTYPE}{$ACTIVITYDATA.activitytype}  
{$MOD.LBL_EVENTNAME} :{$ACTIVITYDATA.subject}{$MOD.LBL_EVENTNAME}{$ACTIVITYDATA.subject}{$LABEL.visibility}{$ACTIVITYDATA.visibility}
{$LABEL.visibility} :{$ACTIVITYDATA.visibility}
- - - - - - - + + + + + + + + + + + +
{$LABEL.createdtime} :{$ACTIVITYDATA.createdtime}{$LABEL.modifiedtime} :{$ACTIVITYDATA.modifiedtime}
{$LABEL.description}{$ACTIVITYDATA.description}
+ + + + + + + + + + + + + + + + + +
{$LABEL.eventstatus}{$LABEL.assigned_user_id}
{$ACTIVITYDATA.eventstatus}{$ACTIVITYDATA.assigned_user_id}
{$LABEL.taskpriority}{$LABEL.sendnotification}
{$ACTIVITYDATA.taskpriority}{$ACTIVITYDATA.sendnotification}
+
{$LABEL.createdtime}{$ACTIVITYDATA.createdtime}{$LABEL.modifiedtime}{$ACTIVITYDATA.modifiedtime}
-
- - - +
+
+ + + +
- - - - - - +
- - - + - + - -
{$MOD.LBL_EVENTSTAT}
{$ACTIVITYDATA.starthr}:{$ACTIVITYDATA.startmin}{$ACTIVITYDATA.startfmt}
+ + + -
{$MOD.LBL_EVENTSTAT}
{$ACTIVITYDATA.starthr}:{$ACTIVITYDATA.startmin}{$ACTIVITYDATA.startfmt}
{$ACTIVITYDATA.date_start}
-
- - - +
{$MOD.LBL_EVENTEDAT}
{$ACTIVITYDATA.endhr}:{$ACTIVITYDATA.endmin}{$ACTIVITYDATA.endfmt}
+ + + -
{$MOD.LBL_EVENTEDAT}
{$ACTIVITYDATA.endhr}:{$ACTIVITYDATA.endmin}{$ACTIVITYDATA.endfmt}
{$ACTIVITYDATA.due_date}
-
-
{$MOD.Priority} : {$ACTIVITYDATA.priority}
+
+

- +
@@ -182,8 +201,8 @@
- - + + -
{$MOD.LBL_USERS} : + {$MOD.LBL_USERS} {foreach item=username key=userid from=$INVITEDUSERS} {$username.3}
{/foreach} @@ -195,12 +214,12 @@
From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 23:41:34 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 30 Aug 2006 06:41:34 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9197 - /vtigercrm/trunk/soap/vtigerolservice.php Message-ID: <20060830064134.EF4067467D3@vtiger.fosslabs.com> Author: richie Date: Wed Aug 30 00:41:23 2006 New Revision: 9197 Log: Issue in Outlook Plugin has been fixed --Jeri Modified: vtigercrm/trunk/soap/vtigerolservice.php Modified: vtigercrm/trunk/soap/vtigerolservice.php ============================================================================== --- vtigercrm/trunk/soap/vtigerolservice.php (original) +++ vtigercrm/trunk/soap/vtigerolservice.php Wed Aug 30 00:41:23 2006 @@ -503,6 +503,7 @@ } $namelist = explode(" ", $contact["lastname"]); + $middlename = ""; if(isset($namelist)) { if(count($namelist) >= 2) @@ -510,7 +511,8 @@ $contact["lastname"] = $namelist[count($namelist)-1]; for($i=0; $icolumn_fields[description]= in_array('description',$permitted_lists) ? $taskrow["description"] : ""; $task->column_fields[activitytype]="Task"; //$task->column_fields[contact_id]= retrievereportsto($contact_name,$user_id,null); - $task->column_fields[assigned_user_id]=in_array('assigned_user_id',$permitted_lists) ? $user_id : ""; + $task->column_fields[assigned_user_id]= in_array('assigned_user_id',$permitted_lists) ? $user_id : ""; $task->save("Calendar"); } } @@ -1006,7 +1008,7 @@ $task->column_fields[description] = in_array('description',$permitted_lists) ? $taskrow["description"] : ""; $task->column_fields[activitytype] = "Task"; //$task->column_fields[contact_id]= retrievereportsto($contact_name,$user_id,null); - $task->column_fields[assigned_user_id] = $user_id; + $task->column_fields[assigned_user_id] = in_array('assigned_user_id',$permitted_lists) ? $user_id : ""; $task->id = $taskrow["id"]; $task->mode="edit"; From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 30 03:07:15 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 30 Aug 2006 10:07:15 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9198 - /vtigercrm/trunk/modules/Calendar/calendarLayout.php Message-ID: <20060830100716.1ADFA746805@vtiger.fosslabs.com> Author: saraj Date: Wed Aug 30 04:07:12 2006 New Revision: 9198 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/calendarLayout.php Modified: vtigercrm/trunk/modules/Calendar/calendarLayout.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/calendarLayout.php (original) +++ vtigercrm/trunk/modules/Calendar/calendarLayout.php Wed Aug 30 04:07:12 2006 @@ -127,17 +127,18 @@ $minical .= " - "; + "; $minical .= ""; $minical .= ""; //To display days in week + $minical .= ''; for ($i = 0; $i < 7; $i ++) { $weekdays_row = $cal['calendar']->month_array[$cal['calendar']->slices[$i]]; $weekday = $weekdays_row->start_time->getdayofWeek_inshort(); - $minical .= ''; + $minical .= ''; } $minical .= ""; $event_class = ''; @@ -149,6 +150,8 @@ { $cal['slice'] = $cal['calendar']->month_array[$cal['calendar']->slices[$count]]; $class = dateCheck($cal['slice']->start_time->get_formatted_date()); + if($count%7 == 0) + $minical .= ""; //To differentiate day having events from other days if(count($cal['slice']->activities) != 0 && ($cal['slice']->start_time->get_formatted_date() == $cal['slice']->activities[0]->start_time->get_formatted_date())) { @@ -163,14 +166,18 @@ $class = 'class="'.$class.'"'; else $class = $event_class; - $minical .= ""; } - $monthview_layout .= ''; + else + { + $minical .= ""; + } $count++; } $minical .= ''; @@ -876,7 +883,7 @@ if ($cal['slice']->start_time->getMonth() == $cal['calendar']->date_time->getMonth()) { $monthview_layout .= ''; for($w=0;$w<7;$w++) { - $yearview_layout .= ''; + $yearview_layout .= ''; } $yearview_layout .= ''; list($_3rdyear,$_3rdmonth,$_3rddate) = explode("-",$cal['calendar']->month_day_slices[$count][35]); From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 30 05:53:06 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 30 Aug 2006 12:53:06 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9199 - in /vtigercrm/trunk: data/CRMEntity.php modules/HelpDesk/DetailViewAjax.php modules/HelpDesk/HelpDesk.php modules/HelpDesk/Save.php Message-ID: <20060830125306.C3DA7746862@vtiger.fosslabs.com> Author: saraj Date: Wed Aug 30 06:52:59 2006 New Revision: 9199 Log: * Removed the ticket history update code from common function and added as seperate, now when we create or update ticket then the history will be updated seperately and not inside the saveentity function Modified: vtigercrm/trunk/data/CRMEntity.php vtigercrm/trunk/modules/HelpDesk/DetailViewAjax.php vtigercrm/trunk/modules/HelpDesk/HelpDesk.php vtigercrm/trunk/modules/HelpDesk/Save.php Modified: vtigercrm/trunk/data/CRMEntity.php ============================================================================== --- vtigercrm/trunk/data/CRMEntity.php (original) +++ vtigercrm/trunk/data/CRMEntity.php Wed Aug 30 06:52:59 2006 @@ -494,64 +494,7 @@ $adb->query($sql_qry); } - //code added by richie starts - - /** Function to get the update ticket history for the specified ticketid - * @param $id -- $ticketid:: Type Integer - */ - function constructUpdateLog($id) - { - global $adb; - global $current_user; - $ticketid = $id; - //Updating History - $tktresult = $adb->query("select * from vtiger_troubletickets where ticketid='".$ticketid."'"); - $crmresult = $adb->query("select * from vtiger_crmentity where crmid='".$ticketid."'"); - $updatelog = $adb->query_result($tktresult,0,"update_log"); - $old_user_id = $adb->query_result($crmresult,0,"smownerid"); - $old_status = $adb->query_result($tktresult,0,"status"); - $old_priority = $adb->query_result($tktresult,0,"priority"); - $old_severity = $adb->query_result($tktresult,0,"severity"); - $old_category = $adb->query_result($tktresult,0,"category"); - if($_REQUEST['old_smownerid'] != $old_user_id && $old_user_id != 0) - { - $user_name = getUserName($this->column_fields['assigned_user_id']); - $updatelog .= ' Transferred to '.$user_name.'\.'; - } - elseif($old_user_id == 0) - { - $group_info = getGroupName($ticketid,'HelpDesk'); - $group_name = $group_info[0]; - if($group_name != $_REQUEST['assigned_group_name']) - $updatelog .= ' Transferred to group '.$_REQUEST['assigned_group_name'].'\.'; - } - if($old_status != $this->column_fields['ticketstatus']) - { - $updatelog .= ' Status Changed to '.$this->column_fields['ticketstatus'].'\.'; - } - if($old_priority != $this->column_fields['ticketpriorities']) - { - $updatelog .= ' Priority Changed to '.$this->column_fields['ticketpriorities'].'\.'; - } - if($old_severity != $this->column_fields['ticketseverities']) - { - $updatelog .= ' Severity Changed to '.$this->column_fields['ticketseverities'].'\.'; - } - if($old_category != $this->column_fields['ticketcategories']) - { - $updatelog .= ' Category Changed to '.$this->column_fields['ticketcategories'].'\.'; - } - if($_REQUEST['old_smownerid'] != $old_user_id || $old_status != $this->column_fields['ticketstatus'] || $old_priority != $this->column_fields['ticketpriorities'] || $old_severity != $this->column_fields['ticketseverities'] || $old_category != $this->column_fields['ticketcategories'] || $old_userid == 0) - { - $updatelog .= ' -- '.date("l dS F Y h:i:s A").' by '.$current_user->user_name.'--//--'; - } - else - { - $update_log .= '--//--'; - } - - return $updatelog; - } + /** Function to insert values in the specifed table for the specified module * @param $table_name -- table name:: Type varchar * @param $module -- module:: Type varchar @@ -560,7 +503,7 @@ { global $log; global $current_user; - $log->info("function insertIntoCrmEntity ".$module.' vtiger_table name ' .$table_name); + $log->info("function insertIntoEntityTable ".$module.' vtiger_table name ' .$table_name); global $adb; $insertion_mode = $this->mode; @@ -667,6 +610,12 @@ $fldvalue = getDBInsertDateValue($this->column_fields[$fieldname]); } } + elseif($uitype == 7) + { + //strip out the spaces and commas in numbers if given ie., in amounts there may be , + $fldvalue = str_replace(",","",$this->column_fields[$fieldname]);//trim($this->column_fields[$fieldname],","); + + } else { $fldvalue = $this->column_fields[$fieldname]; @@ -684,14 +633,6 @@ if($fldvalue=='') $fldvalue ="NULL"; if($insertion_mode == 'edit') { - //code by richie starts - if(($table_name == "vtiger_troubletickets") && ($columname == "update_log")) - { - $fldvalue = $this->constructUpdateLog($this->id); - $fldvalue = from_html($adb->formatString($table_name,$columname,$fldvalue),($insertion_mode == 'edit')?true:false); - } - //code by richie ends - if($table_name == 'vtiger_notes' && $columname == 'filename' && $_FILES['filename']['name'] == '') { $fldvalue = $this->getOldFileName($this->id); @@ -715,32 +656,6 @@ } else { - //code by richie starts - if(($table_name == "vtiger_troubletickets") && ($columname == "update_log")) - { - global $current_user; - $fldvalue = date("l dS F Y h:i:s A").' by '.$current_user->user_name; - if($_REQUEST['assigned_group_name'] != '' && $_REQUEST['assigntype'] == 'T') - { - $group_name = $_REQUEST['assigned_group_name']; - } - elseif($this->column_fields['assigned_user_id'] != '') - { - $tkt_ownerid = $this->column_fields['assigned_user_id']; - } - else - { - $tkt_ownerid = $current_user->id; - } - if($group_name != '') - $tkt_ownername = $group_name; - else - $tkt_ownername = getUserName($tkt_ownerid); - $fldvalue = " Ticket created. Assigned to ".$tkt_ownername." -- ".$fldvalue."--//--"; - $fldvalue = from_html($adb->formatString($table_name,$columname,$fldvalue),($insertion_mode == 'edit')?true:false); - //echo ' updatevalue is ............. ' .$fldvalue; - } - //code by richie ends $column .= ", ".$columname; $value .= ", ".$fldvalue.""; } Modified: vtigercrm/trunk/modules/HelpDesk/DetailViewAjax.php ============================================================================== --- vtigercrm/trunk/modules/HelpDesk/DetailViewAjax.php (original) +++ vtigercrm/trunk/modules/HelpDesk/DetailViewAjax.php Wed Aug 30 06:52:59 2006 @@ -36,7 +36,19 @@ $modObj->column_fields[$fieldname] = $fieldvalue; $modObj->id = $crmid; $modObj->mode = "edit"; + + //Added to construct the update log for Ticket history + $assigned_group_name = $_REQUEST['assigned_group_name']; + $assigntype = $_REQUEST['assigntype']; + + $fldvalue = $modObj->constructUpdateLog(&$modObj, $modObj->mode, $assigned_group_name, $assigntype); + $fldvalue = from_html($adb->formatString('vtiger_troubletickets','update_log',$fldvalue),($modObj->mode == 'edit')?true:false); + $modObj->save("HelpDesk"); + + //update the log information for ticket history + $adb->query("update vtiger_troubletickets set update_log=$fldvalue where ticketid=".$modObj->id); + if($modObj->id != "") { echo ":#:SUCCESS"; Modified: vtigercrm/trunk/modules/HelpDesk/HelpDesk.php ============================================================================== --- vtigercrm/trunk/modules/HelpDesk/HelpDesk.php (original) +++ vtigercrm/trunk/modules/HelpDesk/HelpDesk.php Wed Aug 30 06:52:59 2006 @@ -467,6 +467,89 @@ return getHistory('HelpDesk',$query,$id); } + /** Function to get the update ticket history for the specified ticketid + * @param $id -- $ticketid:: Type Integer + */ + function constructUpdateLog($focus, $mode, $assigned_group_name, $assigntype) + { + global $adb; + global $current_user; + + if($mode != 'edit')//this will be updated when we create new ticket + { + $updatelog = " Ticket created. Assigned to "; + + if($assigned_group_name != '' && $assigntype == 'T') + { + $updatelog .= " group ".$assigned_group_name; + } + elseif($focus->column_fields['assigned_user_id'] != '') + { + $updatelog .= " user ".getUserName($focus->column_fields['assigned_user_id']); + } + else + { + $updatelog .= " user ".getUserName($current_user->id); + } + + $fldvalue = date("l dS F Y h:i:s A").' by '.$current_user->user_name; + $updatelog .= " -- ".$fldvalue."--//--"; + } + else + { + $ticketid = $focus->id; + + //First retrieve the existing information + $tktresult = $adb->query("select * from vtiger_troubletickets where ticketid='".$ticketid."'"); + $crmresult = $adb->query("select * from vtiger_crmentity where crmid='".$ticketid."'"); + + $updatelog = $adb->query_result($tktresult,0,"update_log"); + + $old_user_id = $adb->query_result($crmresult,0,"smownerid"); + $old_status = $adb->query_result($tktresult,0,"status"); + $old_priority = $adb->query_result($tktresult,0,"priority"); + $old_severity = $adb->query_result($tktresult,0,"severity"); + $old_category = $adb->query_result($tktresult,0,"category"); + + //Assigned to change log + if($assigned_group_name != '' && $assigntype == 'T') + { + $group_info = getGroupName($ticketid,'HelpDesk'); + $group_name = $group_info[0]; + if($group_name != $assigned_group_name) + $updatelog .= ' Transferred to group '.$assigned_group_name.'\.'; + } + elseif($focus->column_fields['assigned_user_id'] != $old_user_id) + { + $user_name = getUserName($focus->column_fields['assigned_user_id']); + $updatelog .= ' Transferred to user '.$user_name.'\.'; + } + //Status change log + if($old_status != $focus->column_fields['ticketstatus']) + { + $updatelog .= ' Status Changed to '.$focus->column_fields['ticketstatus'].'\.'; + } + //Priority change log + if($old_priority != $focus->column_fields['ticketpriorities']) + { + $updatelog .= ' Priority Changed to '.$focus->column_fields['ticketpriorities'].'\.'; + } + //Severity change log + if($old_severity != $focus->column_fields['ticketseverities']) + { + $updatelog .= ' Severity Changed to '.$focus->column_fields['ticketseverities'].'\.'; + } + //Category change log + if($old_category != $focus->column_fields['ticketcategories']) + { + $updatelog .= ' Category Changed to '.$focus->column_fields['ticketcategories'].'\.'; + } + + $updatelog .= ' -- '.date("l dS F Y h:i:s A").' by '.$current_user->user_name.'--//--'; + } + return $updatelog; + } + } Modified: vtigercrm/trunk/modules/HelpDesk/Save.php ============================================================================== --- vtigercrm/trunk/modules/HelpDesk/Save.php (original) +++ vtigercrm/trunk/modules/HelpDesk/Save.php Wed Aug 30 06:52:59 2006 @@ -29,7 +29,17 @@ setObjectValuesFromRequest(&$focus); +global $adb; +//Added to update the ticket history +//Before save we have to construct the update log. +$mode = $_REQUEST['mode']; +$fldvalue = $focus->constructUpdateLog(&$focus, $mode, $_REQUEST['assigned_group_name'], $_REQUEST['assigntype']); +$fldvalue = from_html($adb->formatString('vtiger_troubletickets','update_log',$fldvalue),($mode == 'edit')?true:false); + $focus->save("HelpDesk"); + +//After save the record, we should update the log +$adb->query("update vtiger_troubletickets set update_log=$fldvalue where ticketid=".$focus->id); //Added to retrieve the existing attachment of the ticket and save it for the new duplicated ticket if($_FILES['filename']['name'] == '' && $_REQUEST['mode'] != 'edit' && $_REQUEST['old_id'] != '') @@ -213,4 +223,5 @@ $log->debug("Exiting getTicketComments method ..."); return $commentlist; } + ?> From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 30 05:57:54 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 30 Aug 2006 12:57:54 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9200 - in /wordintegration/trunk: package/ resources/ resources/images/ resources/supportingdlls/ resources/supportingdlls/vb6runtime/ Message-ID: <20060830125754.3069D746839@vtiger.fosslabs.com> Author: richie Date: Wed Aug 30 06:49:51 2006 New Revision: 9200 Log: Files added to SVN --Jeri Added: wordintegration/trunk/package/ wordintegration/trunk/package/ACKNOWLEDGMENT.txt wordintegration/trunk/package/LICENSE_AGREEMENT.txt wordintegration/trunk/package/MSXML_3.0_LICENSE.txt wordintegration/trunk/package/PocketSOAP_LICENSE.txt wordintegration/trunk/package/VISUAL_STUDIO_LICENSE.txt wordintegration/trunk/resources/ wordintegration/trunk/resources/images/ wordintegration/trunk/resources/images/config.gif (with props) wordintegration/trunk/resources/images/vtiger.ico (with props) wordintegration/trunk/resources/images/vtiger.jpg (with props) wordintegration/trunk/resources/supportingdlls/ wordintegration/trunk/resources/supportingdlls/pSOAP32.dll (with props) wordintegration/trunk/resources/supportingdlls/pocketHTTP.dll (with props) wordintegration/trunk/resources/supportingdlls/psDime.dll (with props) wordintegration/trunk/resources/supportingdlls/psProxy.dll (with props) wordintegration/trunk/resources/supportingdlls/vb6runtime/ wordintegration/trunk/resources/supportingdlls/vb6runtime/ASYCFILT.DLL (with props) wordintegration/trunk/resources/supportingdlls/vb6runtime/COMCAT.DLL (with props) wordintegration/trunk/resources/supportingdlls/vb6runtime/MSVBVM60.DLL (with props) wordintegration/trunk/resources/supportingdlls/vb6runtime/OLEAUT32.DLL (with props) wordintegration/trunk/resources/supportingdlls/vb6runtime/OLEPRO32.DLL (with props) wordintegration/trunk/resources/supportingdlls/vb6runtime/STDOLE2.TLB (with props) wordintegration/trunk/resources/supportingdlls/vb6runtime/msxml3.dll (with props) From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 30 07:46:08 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 30 Aug 2006 14:46:08 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9201 - in /wordintegration/trunk/client/bin/Language: deutsch.ini english.ini french.ini german.ini portuguese.ini Message-ID: <20060830144608.CE9D174684C@vtiger.fosslabs.com> Author: richie Date: Wed Aug 30 08:45:41 2006 New Revision: 9201 Log: version changed --Jeri Modified: wordintegration/trunk/client/bin/Language/deutsch.ini wordintegration/trunk/client/bin/Language/english.ini wordintegration/trunk/client/bin/Language/french.ini wordintegration/trunk/client/bin/Language/german.ini wordintegration/trunk/client/bin/Language/portuguese.ini Modified: wordintegration/trunk/client/bin/Language/deutsch.ini ============================================================================== --- wordintegration/trunk/client/bin/Language/deutsch.ini (original) +++ wordintegration/trunk/client/bin/Language/deutsch.ini Wed Aug 30 08:45:41 2006 @@ -1,7 +1,7 @@ [vtigerCRM_Common] CompanyName=vtiger.com ProductName=vtiger Office Plug-in -ProductVersion=5.0 beta +ProductVersion=5.0.0 ProductSite=www.vtiger.com ProductLanguage=Deutsch @@ -36,7 +36,7 @@ Frame1_Label1=vtiger Benutzername: Frame1_Label2=vtiger Passwort: Frame1_Label3=vtiger URL: -Frame1_Label4=(z.B.: http://localhost/) +Frame1_Label4=(z.B.: http://en.vtiger.com/) Frame2=Proxy Einstellungen um vtiger via Internet zu erreichen Frame2_Label1=IP-Adresse: Frame2_Label2=Port: Modified: wordintegration/trunk/client/bin/Language/english.ini ============================================================================== Binary files - no diff available. Modified: wordintegration/trunk/client/bin/Language/french.ini ============================================================================== --- wordintegration/trunk/client/bin/Language/french.ini (original) +++ wordintegration/trunk/client/bin/Language/french.ini Wed Aug 30 08:45:41 2006 @@ -1,7 +1,7 @@ [vtigerCRM_Common] CompanyName=vtiger.com ProductName=vtiger Office Plug-in -ProductVersion=5.0 beta +ProductVersion=5.0.0 ProductSite=www.vtiger.com ProductLanguage=French @@ -36,7 +36,7 @@ Frame1_Label1=Nom d'utilisateur: Frame1_Label2=Mot de passe: Frame1_Label3=URL vTiger: -Frame1_Label4=(E.g.,http://localhost/) +Frame1_Label4=(E.g.,http://en.vtiger.com/) Frame2=Configurer Proxy pour acc?der ? vtiger CRM via Internet Frame2_Label1=Adresse: Frame2_Label2=Port: Modified: wordintegration/trunk/client/bin/Language/german.ini ============================================================================== Binary files - no diff available. Modified: wordintegration/trunk/client/bin/Language/portuguese.ini ============================================================================== --- wordintegration/trunk/client/bin/Language/portuguese.ini (original) +++ wordintegration/trunk/client/bin/Language/portuguese.ini Wed Aug 30 08:45:41 2006 @@ -1,7 +1,7 @@ [vtigerCRM_Common] CompanyName=vtiger.com ProductName=vtiger Office Plug-in -ProductVersion=5.0 beta +ProductVersion=5.0.0 ProductSite=www.vtiger.com ProductLanguage=Portugu?s @@ -36,7 +36,7 @@ Frame1_Label1=Utilizador vtiger: Frame1_Label2=Palavra chave vtiger: Frame1_Label3=URL do vtiger: -Frame1_Label4=(Exemplo: http://localhost/) +Frame1_Label4=(Exemplo: http://en.vtiger.com/) Frame2=Configure o proxy para aceder ao vtiger CRM Frame2_Label1=Endere?o: Frame2_Label2=Porta: From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 30 07:46:12 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 30 Aug 2006 14:46:12 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9202 - /wordintegration/trunk/client/source/frmConf.frm Message-ID: <20060830144612.EC2B4746841@vtiger.fosslabs.com> Author: richie Date: Wed Aug 30 08:45:52 2006 New Revision: 9202 Log: Demo URL modified --Jeri Modified: wordintegration/trunk/client/source/frmConf.frm Modified: wordintegration/trunk/client/source/frmConf.frm ============================================================================== Binary files - no diff available. From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 30 07:50:53 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 30 Aug 2006 14:50:53 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9203 - in /vtigercrmoutlook/trunk/vtigercrmoladdin/source: frmAbout.frm frmLogin.frm Message-ID: <20060830145053.BB17474684F@vtiger.fosslabs.com> Author: richie Date: Wed Aug 30 08:50:41 2006 New Revision: 9203 Log: version and demo url has been changed --Jeri Modified: vtigercrmoutlook/trunk/vtigercrmoladdin/source/frmAbout.frm vtigercrmoutlook/trunk/vtigercrmoladdin/source/frmLogin.frm Modified: vtigercrmoutlook/trunk/vtigercrmoladdin/source/frmAbout.frm ============================================================================== Binary files - no diff available. Modified: vtigercrmoutlook/trunk/vtigercrmoladdin/source/frmLogin.frm ============================================================================== Binary files - no diff available. From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 30 08:28:15 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 30 Aug 2006 15:28:15 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9204 - /vtigercrm/trunk/include/js/general.js Message-ID: <20060830152815.E849472A31A@vtiger.fosslabs.com> Author: richie Date: Wed Aug 30 09:27:55 2006 New Revision: 9204 Log: line breaks checked in trim function --Jeri Modified: vtigercrm/trunk/include/js/general.js Modified: vtigercrm/trunk/include/js/general.js ============================================================================== --- vtigercrm/trunk/include/js/general.js (original) +++ vtigercrm/trunk/include/js/general.js Wed Aug 30 09:27:55 2006 @@ -1421,11 +1421,11 @@ function trim(s) { - while (s.substring(0,1) == " ") + while (s.substring(0,1) == " " || s.substring(0,1) == "\n") { s = s.substring(1, s.length); } - while (s.substring(s.length-1, s.length) == ' ') { + while (s.substring(s.length-1, s.length) == " " || s.substring(s.length-1,s.length) == "\n") { s = s.substring(0,s.length-1); } return s; From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 30 08:29:10 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 30 Aug 2006 15:29:10 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9205 - /vtigercrm/trunk/modules/Users/DefaultDataPopulator.php Message-ID: <20060830152910.6391472A31A@vtiger.fosslabs.com> Author: richie Date: Wed Aug 30 09:29:02 2006 New Revision: 9205 Log: Sales Stage UI type changed back to 16 from 111 --Jeri Modified: vtigercrm/trunk/modules/Users/DefaultDataPopulator.php Modified: vtigercrm/trunk/modules/Users/DefaultDataPopulator.php ============================================================================== --- vtigercrm/trunk/modules/Users/DefaultDataPopulator.php (original) +++ vtigercrm/trunk/modules/Users/DefaultDataPopulator.php Wed Aug 30 09:29:02 2006 @@ -350,7 +350,7 @@ $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'potentialtype','vtiger_potential',1,'15','opportunity_type','Type',1,0,0,100,6,1,1,'V~O',1,null,'BAS')"); $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'nextstep','vtiger_potential',1,'1','nextstep','Next Step',1,0,0,100,7,1,1,'V~O',1,null,'BAS')"); $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'leadsource','vtiger_potential',1,'15','leadsource','Lead Source',1,0,0,100,8,1,1,'V~O',1,null,'BAS')"); - $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'sales_stage','vtiger_potential',1,'111','sales_stage','Sales Stage',1,0,0,100,9,1,1,'V~O',0,4,'BAS')"); + $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'sales_stage','vtiger_potential',1,'16','sales_stage','Sales Stage',1,0,0,100,9,1,1,'V~O',0,4,'BAS')"); $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'smownerid','vtiger_crmentity',1,'53','assigned_user_id','Assigned To',1,0,0,100,10,1,1,'V~M',1,null,'BAS')"); $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'probability','vtiger_potential',1,'9','probability','Probability',1,0,0,100,11,1,1,'N~O',1,null,'BAS')"); $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'campaignid','vtiger_potential',1,'58','campaignid','Campaign Source',1,0,0,100,12,1,1,'N~O',1,null,'BAS')"); From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 30 08:31:09 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 30 Aug 2006 15:31:09 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9206 - /vtigercrm/trunk/Smarty/templates/DetailViewFields.tpl Message-ID: <20060830153109.B13997467BA@vtiger.fosslabs.com> Author: richie Date: Wed Aug 30 09:30:52 2006 New Revision: 9206 Log: UI Type 111 added --Jeri Modified: vtigercrm/trunk/Smarty/templates/DetailViewFields.tpl Modified: vtigercrm/trunk/Smarty/templates/DetailViewFields.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/DetailViewFields.tpl (original) +++ vtigercrm/trunk/Smarty/templates/DetailViewFields.tpl Wed Aug 30 09:30:52 2006 @@ -25,7 +25,7 @@ {elseif $keyid eq '13'} - {elseif $keyid eq '15' || $keyid eq '16'} + {elseif $keyid eq '15' || $keyid eq '16' || $keyid eq '111'} {elseif $keyid eq '17'} From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 30 08:34:43 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 30 Aug 2006 15:34:43 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9207 - in /vtigercrm/trunk/Smarty/templates/Settings: EditPickList.tpl PickList.tpl PickListContents.tpl Message-ID: <20060830153443.D263A7467BA@vtiger.fosslabs.com> Author: richie Date: Wed Aug 30 09:34:31 2006 New Revision: 9207 Log: Edit allowed for newly added Picklist values and validation integrated --Jeri Modified: vtigercrm/trunk/Smarty/templates/Settings/EditPickList.tpl vtigercrm/trunk/Smarty/templates/Settings/PickList.tpl vtigercrm/trunk/Smarty/templates/Settings/PickListContents.tpl Modified: vtigercrm/trunk/Smarty/templates/Settings/EditPickList.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/Settings/EditPickList.tpl (original) +++ vtigercrm/trunk/Smarty/templates/Settings/EditPickList.tpl Wed Aug 30 09:34:31 2006 @@ -43,7 +43,11 @@
 ".get_previous_cal($cal)." "; - $minical .= "date_time->get_date_str()."&parenttab=".$category."'>".display_date($cal['view'],$cal['calendar']->date_time)." ".get_next_cal($cal)."".get_previous_cal($cal)." "; + $minical .= "date_time->get_date_str()."&parenttab=".$category."'>".display_date($cal['view'],$cal['calendar']->date_time)." ".get_next_cal($cal)."
Week'.$weekday.''.$weekday.'
start_time->get_date_str()."&parenttab=".$category."'>".$cal['slice']->start_time->week.""; - $minical .= "getView()."&".$cal['slice']->start_time->get_date_str()."&parenttab=".$category."'>"; + //To display month dates if ($cal['slice']->start_time->getMonth() == $cal['calendar']->date_time->getMonth()) { - $minical .= $cal['slice']->start_time->get_Date(); + $minical .= ""; + $minical .= "getView()."".$cal['slice']->start_time->get_date_str()."&parenttab=".$category."'>"; + $minical .= $cal['slice']->start_time->get_Date()."
'; - $monthview_layout .= ''; + $monthview_layout .= ''; $monthview_layout .= $cal['slice']->start_time->get_Date(); $monthview_layout .= ''; $monthview_layout .= '
'.$mod_strings['cal_weekdays_short'][$w].''.$mod_strings['cal_weekdays_short'][$w].'
 {$keyval}  {$keyval}
Modified: vtigercrm/trunk/Smarty/templates/Settings/PickList.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/Settings/PickList.tpl (original) +++ vtigercrm/trunk/Smarty/templates/Settings/PickList.tpl Wed Aug 30 09:34:31 2006 @@ -168,7 +168,7 @@ {/literal} Modified: vtigercrm/trunk/Smarty/templates/Settings/PickListContents.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/Settings/PickListContents.tpl (original) +++ vtigercrm/trunk/Smarty/templates/Settings/PickListContents.tpl Wed Aug 30 09:34:31 2006 @@ -30,11 +30,7 @@ {/if} {else} From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 30 08:51:44 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 30 Aug 2006 15:51:44 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9208 - /vtigercrm/trunk/include/utils/ListViewUtils.php Message-ID: <20060830155144.B831F74685C@vtiger.fosslabs.com> Author: richie Date: Wed Aug 30 09:51:32 2006 New Revision: 9208 Log: lablel issue in custom field has been fixed --Jeri Modified: vtigercrm/trunk/include/utils/ListViewUtils.php Modified: vtigercrm/trunk/include/utils/ListViewUtils.php ============================================================================== --- vtigercrm/trunk/include/utils/ListViewUtils.php (original) +++ vtigercrm/trunk/include/utils/ListViewUtils.php Wed Aug 30 09:51:32 2006 @@ -150,9 +150,12 @@ { $lbl_name = $app_strings[$name]; } - else + elseif($mod_strings[$name]) { $lbl_name = $mod_strings[$name]; + }else + { + $lbl_name = $name; } //added to display vtiger_currency symbol in listview header if($lbl_name =='Amount') From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 30 11:28:27 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 30 Aug 2006 18:28:27 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9209 - /vtigercrm/trunk/soap/vtigerolservice.php Message-ID: <20060830182827.A531F746824@vtiger.fosslabs.com> Author: richie Date: Wed Aug 30 12:28:17 2006 New Revision: 9209 Log: Issue in Plugin has been fixed --Jeri Modified: vtigercrm/trunk/soap/vtigerolservice.php Modified: vtigercrm/trunk/soap/vtigerolservice.php ============================================================================== --- vtigercrm/trunk/soap/vtigerolservice.php (original) +++ vtigercrm/trunk/soap/vtigerolservice.php Wed Aug 30 12:28:17 2006 @@ -601,13 +601,13 @@ if($cntrow["middlename"] != "") { $contact->column_fields[lastname]=$cntrow["middlename"]." ".$cntrow["lastname"]; - }elseif($cntrow["middlename"] != "") + }elseif($cntrow["lastname"] != "") { $contact->column_fields[lastname]=$cntrow["lastname"]; }else { $contact->column_fields[lastname]=$cntrow["firstname"]." ".$cntrow["middlename"]." ".$cntrow["lastname"]; - } + } $contact->column_fields[birthday]= in_array('birthday',$permitted_lists) ? getDisplayDate($cntrow["birthdate"]) : ""; $contact->column_fields[email]=in_array('email',$permitted_lists) ? $cntrow["emailaddress"] : ""; @@ -688,7 +688,7 @@ }else { $contact->column_fields[lastname]=$cntrow["firstname"]." ".$cntrow["middlename"]." ".$cntrow["lastname"]; - } + } $contact->column_fields[birthday]= in_array('birthday',$permitted_lists) ? getDisplayDate($cntrow["birthdate"]) : ""; $contact->column_fields[email]= in_array('email',$permitted_lists) ? $cntrow["emailaddress"] : ""; From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 30 23:42:06 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 31 Aug 2006 06:42:06 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9210 - /vtigercrm/trunk/modules/Settings/EditComboField.php Message-ID: <20060831064206.1E46A7468B8@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 31 00:42:02 2006 New Revision: 9210 Log: Added empty check for picklist values -- ahmed Modified: vtigercrm/trunk/modules/Settings/EditComboField.php Modified: vtigercrm/trunk/modules/Settings/EditComboField.php ============================================================================== --- vtigercrm/trunk/modules/Settings/EditComboField.php (original) +++ vtigercrm/trunk/modules/Settings/EditComboField.php Thu Aug 31 00:42:02 2006 @@ -83,6 +83,10 @@ $query = 'select fieldlabel from vtiger_tab inner join vtiger_field on vtiger_tab.tabid=vtiger_field.tabid where vtiger_tab.name="'.$moduleName.'" and fieldname="'.$tableName.'"'; $fieldlabel = $adb->query_result($adb->query($query),0,'fieldlabel'); +if($nonedit_fldVal == '') + $smarty->assign("EDITABLE_MODE","edit"); + else + $smarty->assign("EDITABLE_MODE","nonedit"); $smarty->assign("NON_EDITABLE_ENTRIES", $nonedit_fldVal); $smarty->assign("ENTRIES",$fldVal); $smarty->assign("MODULE",$moduleName); From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 31 00:30:32 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 31 Aug 2006 07:30:32 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9211 - /vtigercrm/trunk/pkg/php/php.ini Message-ID: <20060831073032.B64BC7468CB@vtiger.fosslabs.com> Author: richie Date: Thu Aug 31 01:30:22 2006 New Revision: 9211 Log: MySQl Socket path added --Jeri Modified: vtigercrm/trunk/pkg/php/php.ini Modified: vtigercrm/trunk/pkg/php/php.ini ============================================================================== --- vtigercrm/trunk/pkg/php/php.ini (original) +++ vtigercrm/trunk/pkg/php/php.ini Thu Aug 31 01:30:22 2006 @@ -656,7 +656,7 @@ ; Default socket name for local MySQL connects. If empty, uses the built-in ; MySQL defaults. -mysql.default_socket = +mysql.default_socket = MYSQLSOCKET ; Default host for mysql_connect() (doesn't apply in safe mode). mysql.default_host = From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 31 00:45:02 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 31 Aug 2006 07:45:02 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9212 - in /vtigertoolbar/trunk/firefox/chrome/content: vtiger_loginconfig.xul vtigercrm_toolbar.js vtigertoolbar.xul Message-ID: <20060831074502.2FED07468CB@vtiger.fosslabs.com> Author: richie Date: Thu Aug 31 01:44:47 2006 New Revision: 9212 Log: Logout options given and security implemented for Firefox toolbar --Jeri Modified: vtigertoolbar/trunk/firefox/chrome/content/vtiger_loginconfig.xul vtigertoolbar/trunk/firefox/chrome/content/vtigercrm_toolbar.js vtigertoolbar/trunk/firefox/chrome/content/vtigertoolbar.xul Modified: vtigertoolbar/trunk/firefox/chrome/content/vtiger_loginconfig.xul ============================================================================== Binary files - no diff available. Modified: vtigertoolbar/trunk/firefox/chrome/content/vtigercrm_toolbar.js ============================================================================== Binary files - no diff available. Modified: vtigertoolbar/trunk/firefox/chrome/content/vtigertoolbar.xul ============================================================================== Binary files - no diff available. From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 31 00:48:24 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 31 Aug 2006 07:48:24 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9213 - /thunderbirdextn/trunk/install.rdf Message-ID: <20060831074824.CC3337468CB@vtiger.fosslabs.com> Author: richie Date: Thu Aug 31 01:48:16 2006 New Revision: 9213 Log: Version changed --Jeri Modified: thunderbirdextn/trunk/install.rdf Modified: thunderbirdextn/trunk/install.rdf ============================================================================== Binary files - no diff available. From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 31 00:49:55 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 31 Aug 2006 07:49:55 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9214 - in /thunderbirdextn/trunk/chrome/vtiger/content/vtiger: addtovtiger.js vtiger-settings.xul Message-ID: <20060831074955.6A0607468CB@vtiger.fosslabs.com> Author: richie Date: Thu Aug 31 01:49:46 2006 New Revision: 9214 Log: Demo url Changed --Jeri Modified: thunderbirdextn/trunk/chrome/vtiger/content/vtiger/addtovtiger.js thunderbirdextn/trunk/chrome/vtiger/content/vtiger/vtiger-settings.xul Modified: thunderbirdextn/trunk/chrome/vtiger/content/vtiger/addtovtiger.js ============================================================================== Binary files - no diff available. Modified: thunderbirdextn/trunk/chrome/vtiger/content/vtiger/vtiger-settings.xul ============================================================================== Binary files - no diff available. From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 31 03:23:31 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 31 Aug 2006 10:23:31 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9215 - /vtigercrm/trunk/modules/Calendar/calendarLayout.php Message-ID: <20060831102331.945377468E8@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 31 04:23:27 2006 New Revision: 9215 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/calendarLayout.php Modified: vtigercrm/trunk/modules/Calendar/calendarLayout.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/calendarLayout.php (original) +++ vtigercrm/trunk/modules/Calendar/calendarLayout.php Thu Aug 31 04:23:27 2006 @@ -574,11 +574,11 @@ "; $list_view .="
+ {if $NON_EDITABLE_ENTRIES neq ''} + {else} + + {/if}
{$picklistfields.fieldlabel} - {if $picklistfields.fieldname neq 'eventstatus' && $picklistfields.fieldname neq 'taskstatus'} - - {else} -   - {/if} +  
-
+ - +
"; @@ -636,13 +636,13 @@ $list_view .="
"; //To get Todos listView $list_view .= constructTodoListView($todo_list,$cal,$subtab); - $list_view .="
+ $list_view .=" - + @@ -701,7 +701,10 @@ } else { - $hour = $i; + if($i == 0) + $hour = 12; + else + $hour = $i; $sub_str = 'am'; } @@ -718,10 +721,20 @@ $hour_endat = convertTime2UserSelectedFmt($format,$y,false); $time_arr = getaddEventPopupTime($hour_startat,$hour_endat,$format); $temp_ts = $cal['calendar']->date_time->ts; - $temp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$temp_ts)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$temp_ts)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $temp_ts)):('')))); + $sttemp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$temp_ts)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$temp_ts)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $temp_ts)):('')))); + if($i != 23) + { + $endtemp_date = $sttemp_date; + } + else + { + $addday = $temp_ts + (1 * 24 * 60 * 60); + $endtemp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$addday)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$addday)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $addday)):('')))); + } + $js_string = ""; if(isPermitted("Calendar","EditView") == "yes") - $js_string = 'onClick="gshow(\'addEvent\',\'call\',\''.$temp_date.'\',\''.$temp_date.'\',\''.$time_arr['starthour'].'\',\''.$time_arr['startmin'].'\',\''.$time_arr['startfmt'].'\',\''.$time_arr['endhour'].'\',\''.$time_arr['endmin'].'\',\''.$time_arr['endfmt'].'\',\'hourview\',\'event\')"'; + $js_string = 'onClick="gshow(\'addEvent\',\'call\',\''.$sttemp_date.'\',\''.$endtemp_date.'\',\''.$time_arr['starthour'].'\',\''.$time_arr['startmin'].'\',\''.$time_arr['startfmt'].'\',\''.$time_arr['endhour'].'\',\''.$time_arr['endmin'].'\',\''.$time_arr['endfmt'].'\',\'hourview\',\'event\')"'; $dayview_layout .= ' '.$hour.''.$sub_str.''; //To display events in Dayview @@ -796,7 +809,10 @@ } else { - $hour = $i; + if($i == 0) + $hour = 12; + else + $hour = $i; $sub_str = 'am'; } @@ -816,12 +832,19 @@ for ($column=0;$column<=6;$column++) { $temp_ts = $cal['calendar']->week_array[$cal['calendar']->slices[$column]]->start_time->ts; - $temp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$temp_ts)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$temp_ts)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $temp_ts)):('')))); - - $weekview_layout .= ''; - $weekview_layout .= ''; @@ -1131,7 +1162,7 @@ { for($i=0;$iweek_slice[$slice]->start_time->hour.'_'.$i; + $arrow_img_name = 'weekevent'.$cal['calendar']->week_slice[$slice]->start_time->get_formatted_date().'_'.$i; $id = $act[$i]->record; $subject = $act[$i]->subject; if(strlen($subject)>25) @@ -1141,7 +1172,7 @@ $duration_min = $act[$i]->duration_minute; $start_time = $act[$i]->start_time->hour.':'.$act[$i]->start_time->minute; $end_time = $act[$i]->end_time->hour.':'.$act[$i]->end_time->minute; - $st_end_time = convertStEdTime2UserSelectedFmt($format,$start_time,$duration_hour,$duration_min); + //$st_end_time = convertStEdTime2UserSelectedFmt($format,$start_time,$duration_hour,$duration_min); //$start_hour = $st_end_time['starttime']; //$end_hour = $st_end_time['endtime']; $value = getaddEventPopupTime($start_time,$end_time,$format); @@ -1149,18 +1180,25 @@ $end_hour = $value['endhour'] .':'.$value['endmin'].''.$value['endfmt']; $account_name = $act[$i]->accountname; $eventstatus = $act[$i]->eventstatus; + $user = $act[$i]->owner; + $priority = $act[$i]->priority; $image = $cal['IMAGE_PATH'].''.$act[$i]->image_name; $color = $act[$i]->color; - $eventlayer .='
+ if(isPermitted("Calendar","EditView") == "yes") + $javacript_str = 'onMouseOver="cal_show(\''.$arrow_img_name.'\');" onMouseOut="fnHide_Event(\''.$arrow_img_name.'\');"'; + $action_str = ''; + + $eventlayer .='
- + +
'.$start_hour.' - '.$end_hour.'
  '.$subject.'
'.$action_str.'('.$user.' | '.$eventstatus.' | '.$priority.')

'; } @@ -1209,7 +1247,7 @@ $format = $cal['calendar']->hour_format; $duration_hour = $act[$i]->duration_hour; $duration_min = $act[$i]->duration_minute; - $st_end_time = convertStEdTime2UserSelectedFmt($format,$start_time,$duration_hour,$duration_min); + //$st_end_time = convertStEdTime2UserSelectedFmt($format,$start_time,$duration_hour,$duration_min); //$start_hour = $st_end_time['starttime']; //$end_hour = $st_end_time['endtime']; $value = getaddEventPopupTime($start_time,$end_time,$format); @@ -1307,7 +1345,7 @@ $start_time = $adb->query_result($result,$i,"time_start"); $end_time = $adb->query_result($result,$i,"time_end"); $format = $calendar['calendar']->hour_format; - $st_end_time = convertStEdTime2UserSelectedFmt($format,$start_time,$duration_hour,$duration_min); + //$st_end_time = convertStEdTime2UserSelectedFmt($format,$start_time,$duration_hour,$duration_min); $value = getaddEventPopupTime($start_time,$end_time,$format); $start_hour = $value['starthour'].':'.$value['startmin'].''.$value['startfmt']; $end_hour = $value['endhour'] .':'.$value['endmin'].''.$value['endfmt']; @@ -1420,8 +1458,9 @@ $more_link = ""; $start_time = $adb->query_result($result,$i,"time_start"); $format = $calendar['calendar']->hour_format; - $st_end_time = convertStEdTime2UserSelectedFmt($format,$start_time); - $element['starttime'] = $st_end_time['starttime']; + //$st_end_time = convertStEdTime2UserSelectedFmt($format,$start_time); + $value = getaddEventPopupTime($start_time,$start_time,$format); + $element['starttime'] = $value['starthour'].':'.$value['startmin'].''.$value['startfmt']; $id = $adb->query_result($result,$i,"activityid"); $subject = $adb->query_result($result,$i,"subject"); $status = $adb->query_result($result,$i,"status"); @@ -1486,6 +1525,13 @@ $temp_ts = $cal['calendar']->date_time->ts; //to get date in user selected date format $temp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$temp_ts)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$temp_ts)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $temp_ts)):('')))); + if($cal['calendar']->day_start_hour != 23) + $endtemp_date = $temp_date; + else + { + $endtemp_ts = $temp_ts + (1 * 24 * 60 * 60); + $endtemp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$endtemp_ts)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$endtemp_ts)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $endtemp_ts)):('')))); + } $list_view = ""; if($cal['view'] == 'day') { @@ -1508,21 +1554,21 @@ '6'=>$mod_strings['LBL_STATUS'], '7'=>$mod_strings['LBL_ASSINGEDTO'], ); - $header_width = Array('0'=>'5', - '1'=>'10', - '2'=>'10', - '3'=>'10', - '4'=>'30', - '5'=>'10', - '6'=>'10', - '7'=>'15' + $header_width = Array('0'=>'5%', + '1'=>'10%', + '2'=>'10%', + '3'=>'10%', + '4'=>'28%', + '5'=>'10%', + '6'=>'10%', + '7'=>'15%' ); $list_view .=""; $header_rows = count($header); for($i=0;$i<$header_rows;$i++) { - $list_view .=""; + $list_view .=""; } $list_view .=""; $rows = count($entry_list); @@ -1533,7 +1579,7 @@ $list_view .=""; foreach($entry_list[$i] as $key=>$entry) { - $list_view .=""; + $list_view .=""; } $list_view .=""; } @@ -1554,8 +1600,8 @@ if(isPermitted("Calendar","EditView") == "yes") { $list_view .=""; } else @@ -1591,6 +1637,13 @@ $temp_ts = $cal['calendar']->date_time->ts; //to get date in user selected date format $temp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$temp_ts)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$temp_ts)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $temp_ts)):('')))); + if($cal['calendar']->day_start_hour != 23) + $endtemp_date = $temp_date; + else + { + $endtemp_ts = $temp_ts + (1 * 24 * 60 * 60); + $endtemp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$endtemp_ts)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$endtemp_ts)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $endtemp_ts)):('')))); + } $list_view = ""; //labels of listview header $header = Array('0'=>'#', @@ -1602,7 +1655,7 @@ ); $header_width = Array('0'=>'5%', '1'=>'10%', - '2'=>'50%', + '2'=>'48%', '3'=>'10%', '4'=>'10%', '5'=>'15%', @@ -1613,7 +1666,7 @@ if(isPermitted("Calendar","EditView") == "yes") { $list_view .=" - "; } @@ -1631,7 +1684,7 @@ $header_rows = count($header); for($i=0;$i<$header_rows;$i++) { - $list_view .=""; + $list_view .=""; } $list_view .=""; $rows = count($todo_list); From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 31 03:24:05 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 31 Aug 2006 10:24:05 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9216 - /vtigercrm/trunk/modules/Calendar/script.js Message-ID: <20060831102405.252DF7468E8@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 31 04:24:01 2006 New Revision: 9216 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/script.js Modified: vtigercrm/trunk/modules/Calendar/script.js ============================================================================== --- vtigercrm/trunk/modules/Calendar/script.js (original) +++ vtigercrm/trunk/modules/Calendar/script.js Thu Aug 31 04:24:01 2006 @@ -210,7 +210,10 @@ } else { - starthour = starthour; + if(starthour == '12') + starthour = 0; + else + starthour = starthour; startmin = startmin; } } @@ -226,7 +229,10 @@ } else { - endhour = endhour; + if(endhour == '12') + endhour = 0; + else + endhour = endhour; endmin = endmin; } } @@ -326,7 +332,10 @@ } else { - starthour = starthour; + if(starthour == '12') + starthour = 0; + else + starthour = starthour; startmin = startmin; } } @@ -342,7 +351,10 @@ } else { - endhour = endhour; + if(endhour == '12') + endhour == 0; + else + endhour = endhour; endmin = endmin; } } @@ -419,12 +431,19 @@ { if(startformat == 'pm') { - starthour = eval(starthour) + 12; + if(starthour == '12') + starthour = 12; + else + starthour = eval(starthour) + 12; + startmin = startmin; } else { - starthour = starthour; + if(starthour == '12') + starthour = 0; + else + starthour = starthour; startmin = startmin; } } @@ -450,12 +469,18 @@ { if(startformat == 'pm') { - starthour = eval(starthour) + 12; + if(starthour == '12') + starthour = 12; + else + starthour = eval(starthour) + 12; startmin = startmin; } else { - starthour = starthour; + if(starthour == '12') + starthour = 0; + else + starthour = starthour; startmin = startmin; } } From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 31 03:24:52 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 31 Aug 2006 10:24:52 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9217 - /vtigercrm/trunk/modules/Calendar/Save.php Message-ID: <20060831102452.F28D37468E8@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 31 04:24:49 2006 New Revision: 9217 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/Save.php Modified: vtigercrm/trunk/modules/Calendar/Save.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/Save.php (original) +++ vtigercrm/trunk/modules/Calendar/Save.php Thu Aug 31 04:24:49 2006 @@ -112,14 +112,15 @@ $adb->query($sql); } } -if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] == "Contacts") -{ - if(isset($_REQUEST['return_id']) && $_REQUEST['return_id'] != "") - { - $sql = "insert into vtiger_cntactivityrel values (".$_REQUEST['return_id'].",".$focus->id.")"; - $adb->query($sql); - } -} +if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] == "Contacts" && $_REQUEST['activity_mode'] == 'Events') +{ + if(isset($_REQUEST['return_id']) && $_REQUEST['return_id'] != "") + { + $sql = "insert into vtiger_cntactivityrel values (".$_REQUEST['return_id'].",".$focus->id.")"; + $adb->query($sql); + } +} + $activemode = ""; if($activity_mode != '') $activemode = "&activity_mode=".$activity_mode; From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 31 03:25:36 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 31 Aug 2006 10:25:36 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9218 - /vtigercrm/trunk/modules/Calendar/TodoSave.php Message-ID: <20060831102536.32B167468C2@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 31 04:25:32 2006 New Revision: 9218 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/TodoSave.php Modified: vtigercrm/trunk/modules/Calendar/TodoSave.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/TodoSave.php (original) +++ vtigercrm/trunk/modules/Calendar/TodoSave.php Thu Aug 31 04:25:32 2006 @@ -40,8 +40,11 @@ $focus->column_fields["date_start"] = $_REQUEST["task_date_start"]; $focus->column_fields["due_date"] = $_REQUEST["task_due_date"]; $focus->column_fields["taskpriority"] = $_REQUEST["taskpriority"]; + $focus->column_fields["parent_id"] = $_REQUEST["task_parent_id"]; + $focus->column_fields["contact_id"] = $_REQUEST["task_contact_id"]; $focus->column_fields["description"] = $_REQUEST["task_description"]; - $focus->column_fields["sendnotification"] = $_REQUEST["task_sendnotification"]; + if(isset($_REQUEST['task_sendnotification']) && $_REQUEST['task_sendnotification'] != null) + $focus->column_fields["sendnotification"] = $_REQUEST["task_sendnotification"]; $focus->save($tab_type); header("Location: index.php?action=index&module=Calendar&view=".$_REQUEST['view']."&hour=".$_REQUEST['hour']."&day=".$_REQUEST['day']."&month=".$_REQUEST['month']."&year=".$_REQUEST['year']."&viewOption=".$_REQUEST['viewOption']."&subtab=".$_REQUEST['subtab']."&parenttab=".$_REQUEST['parenttab']); From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 31 03:26:29 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 31 Aug 2006 10:26:29 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9219 - /vtigercrm/trunk/modules/Calendar/addEventUI.php Message-ID: <20060831102629.77D5C7468C2@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 31 04:26:25 2006 New Revision: 9219 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/addEventUI.php Modified: vtigercrm/trunk/modules/Calendar/addEventUI.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/addEventUI.php (original) +++ vtigercrm/trunk/modules/Calendar/addEventUI.php Thu Aug 31 04:26:25 2006 @@ -177,30 +177,10 @@ - -
- - - - - '; -?>
".$header[$i]."".$header[$i]."
".$entry."".$entry."
".$app_strings['LBL_YOU_CAN_CREATE']." ".$app_strings['LBL_AN']." ".$app_strings['Event']." ".$app_strings['LBL_NOW'].". ".$app_strings['LBL_CLICK_THE_LINK']." :
-   -".$app_strings['LBL_CREATE']." ".$app_strings['LBL_A']." ".$app_strings['Meeting']."
-   -".$app_strings['LBL_CREATE']." ".$app_strings['LBL_A']." ".$app_strings['Call']."
+   -".$app_strings['LBL_CREATE']." ".$app_strings['LBL_A']." ".$app_strings['Meeting']."
+   -".$app_strings['LBL_CREATE']." ".$app_strings['LBL_A']." ".$app_strings['Call']."
+ ".$mod_strings['LBL_ADD']." ".$header[$i]."".$header[$i]."
- +
@@ -598,39 +578,12 @@ - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - @@ -862,9 +775,6 @@ var fielddatatype = new Array('V~M','D~M~time_start','T~O','V~O'); -
From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 31 03:27:07 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 31 Aug 2006 10:27:07 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9220 - /vtigercrm/trunk/modules/Calendar/Appointment.php Message-ID: <20060831102707.A00EA7468B8@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 31 04:27:03 2006 New Revision: 9220 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/Appointment.php Modified: vtigercrm/trunk/modules/Calendar/Appointment.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/Appointment.php (original) +++ vtigercrm/trunk/modules/Calendar/Appointment.php Thu Aug 31 04:27:03 2006 @@ -28,6 +28,7 @@ var $ownerid; var $assignedto; var $eventstatus; + var $priority; var $activity_type; var $description; var $record; @@ -133,6 +134,7 @@ //$this->account_name = $act_array["accountname"]; //$this->account_id = $act_array["accountid"]; $this->eventstatus = $act_array["eventstatus"]; + $this->priority = $act_array["priority"]; $this->subject = $act_array["subject"]; $this->activity_type = $act_array["activitytype"]; $this->duration_hour = $act_array["duration_hours"]; From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 31 03:27:40 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 31 Aug 2006 10:27:40 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9221 - /vtigercrm/trunk/modules/Calendar/Activity.php Message-ID: <20060831102741.0BC597468C2@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 31 04:27:37 2006 New Revision: 9221 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/Activity.php Modified: vtigercrm/trunk/modules/Calendar/Activity.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/Activity.php (original) +++ vtigercrm/trunk/modules/Calendar/Activity.php Thu Aug 31 04:27:37 2006 @@ -57,7 +57,6 @@ 'Close'=>Array('activity'=>'status'), 'Type'=>Array('activity'=>'activitytype'), 'Subject'=>Array('activity'=>'subject'), - 'Contact Name'=>Array('contactdetails'=>'lastname'), 'Related to'=>Array('seactivityrel'=>'activityid'), 'Start Date'=>Array('activity'=>'date_start'), 'End Date'=>Array('activity'=>'due_date'), From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 31 03:28:14 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 31 Aug 2006 10:28:14 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9222 - /vtigercrm/trunk/modules/Calendar/CalendarCommon.php Message-ID: <20060831102814.498F27468C2@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 31 04:28:10 2006 New Revision: 9222 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/CalendarCommon.php Modified: vtigercrm/trunk/modules/Calendar/CalendarCommon.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/CalendarCommon.php (original) +++ vtigercrm/trunk/modules/Calendar/CalendarCommon.php Thu Aug 31 04:28:10 2006 @@ -98,40 +98,51 @@ $hr = $sthr+0; if($hr <= 11) { + if($hr == 0) + $sthr = 12; $timearr['starthour'] = $sthr; $timearr['startfmt'] = 'am'; } else { - if($hr == 12) - $sthr = $hr; - else - $sthr = $hr - 12; + if($hr == 12) $sthr = $hr; + else $sthr = $hr - 12; + if($sthr <= 9 && strlen(trim($sthr)) < 2) - { $hrvalue= '0'.$sthr; - }else $hrvalue=$sthr; + else $hrvalue=$sthr; + $timearr['starthour'] = $hrvalue; $timearr['startfmt'] = 'pm'; } - $ehr = $edhr+0; - if($ehr <= 11) + $edhr = $edhr+0; + if($edhr <= 11) { - $timearr['endhour'] = $edhr; + if($edhr == 0) + $edhr = 12; + + if($edhr <= 9 && strlen(trim($edhr)) < 2) + $edhr = '0'.$edhr; + $timearr['endhour'] = $edhr; $timearr['endfmt'] = 'am'; } else { + $fmt = 'pm'; if($edhr == 12) $edhr = $edhr; else + { $edhr = $edhr - 12; + if($edhr == 12) + $fmt = 'am'; + } if($edhr <= 9 && strlen(trim($edhr)) < 2) - { $hrvalue= '0'.$edhr; - }else $hrvalue=$edhr; + else $hrvalue=$edhr; + $timearr['endhour'] = $hrvalue; - $timearr['endfmt'] = 'pm'; + $timearr['endfmt'] = $fmt; } $timearr['startmin'] = $stmin; $timearr['endmin'] = $edmin; @@ -139,6 +150,10 @@ } if($format == '24') { + if($edhr <= 9 && strlen(trim($edhr)) < 2) + $edhr = '0'.$edhr; + if($sthr <= 9 && strlen(trim($sthr)) < 2) + $sthr = '0'.$sthr; $timearr['starthour'] = $sthr; $timearr['startmin'] = $stmin; $timearr['startfmt'] = ''; @@ -162,19 +177,27 @@ if($format == 'am/pm') { $combo .= ' '; $combo .= 'Hr '; $combo .= 'start_hour != ''){?> checked onClick="enableCalstarttime();">  "; $smarty->assign('EDIT_BUTTON',$buttons); - $buttons = ""; + $buttons = ""; $smarty->assign('CHANGE_PW_BUTTON',$buttons); From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 08:36:36 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 12:36:36 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9026 - /vtigercrm/trunk/schema/DatabaseSchema.xml Message-ID: <20060818123637.29AE075117B@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 06:36:28 2006 New Revision: 9026 Log: Added a forward slash in the siccode field -- Ahmed Modified: vtigercrm/trunk/schema/DatabaseSchema.xml Modified: vtigercrm/trunk/schema/DatabaseSchema.xml ============================================================================== --- vtigercrm/trunk/schema/DatabaseSchema.xml (original) +++ vtigercrm/trunk/schema/DatabaseSchema.xml Fri Aug 18 06:36:28 2006 @@ -322,7 +322,7 @@ - + From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 08:49:24 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 12:49:24 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9027 - /vtigercrm/trunk/modules/CustomView/Delete.php Message-ID: <20060818124924.413FE7511FE@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 06:49:20 2006 New Revision: 9027 Log: changes made to fix the issue in calendar listview --Minnie Modified: vtigercrm/trunk/modules/CustomView/Delete.php Modified: vtigercrm/trunk/modules/CustomView/Delete.php ============================================================================== --- vtigercrm/trunk/modules/CustomView/Delete.php (original) +++ vtigercrm/trunk/modules/CustomView/Delete.php Fri Aug 18 06:49:20 2006 @@ -28,5 +28,5 @@ $smodule_url = "&smodule=".$smodule; } -header("Location: index.php?action=index&parenttab=$parenttab&module=$module".$smodule_url); +header("Location: index.php?action=ListView&parenttab=$parenttab&module=$module".$smodule_url); ?> From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 08:50:17 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 12:50:17 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9028 - /vtigercrm/trunk/modules/Calendar/calendarLayout.php Message-ID: <20060818125017.420867511FE@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 06:50:09 2006 New Revision: 9028 Log: Hardcoded strings converted to language in Calendar -- Ahmed Modified: vtigercrm/trunk/modules/Calendar/calendarLayout.php Modified: vtigercrm/trunk/modules/Calendar/calendarLayout.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/calendarLayout.php (original) +++ vtigercrm/trunk/modules/Calendar/calendarLayout.php Fri Aug 18 06:50:09 2006 @@ -238,7 +238,7 @@ "; $tabhtml .= "view."".$header['calendar']->date_time->get_date_str()."&viewOption=".$viewBox."&subtab=".$subtab."&parenttab=".$category."\");' src='".$header['IMAGE_PATH']."btnL3Calendar.gif' alt='".$mod_strings['LBL_OPENCAL']."...' title='".$mod_strings['LBL_OPENCAL']."...' align='absmiddle' border='0'>"; $tabhtml .= "view."".$header['calendar']->date_time->get_date_str()."&viewOption=".$viewBox."&subtab=".$subtab."&parenttab=".$category."\");' src='".$header['IMAGE_PATH']."tbarSettings.gif' alt='".$mod_strings['LBL_SETTINGS']."' title='".$mod_strings['LBL_SETTINGS']."' align='absmiddle' border='0'>"; - $tabhtml .= "Calendar"; + $tabhtml .= "".$app_strings[Calendar].""; $tabhtml .= ""; echo $tabhtml; $cal_log->debug("Exiting get_cal_header_tab() method..."); From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 08:53:11 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 12:53:11 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9029 - /vtigercrm/trunk/modules/Leads/LeadConvertToEntities.php Message-ID: <20060818125311.B1D7A75122E@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 06:53:08 2006 New Revision: 9029 Log: changes made to fix the convertlead issue --Minnie Modified: vtigercrm/trunk/modules/Leads/LeadConvertToEntities.php Modified: vtigercrm/trunk/modules/Leads/LeadConvertToEntities.php ============================================================================== --- vtigercrm/trunk/modules/Leads/LeadConvertToEntities.php (original) +++ vtigercrm/trunk/modules/Leads/LeadConvertToEntities.php Fri Aug 18 06:53:08 2006 @@ -16,7 +16,6 @@ $module = $_REQUEST["module"]; -$assigned_user_id = $_REQUEST["smowerid"]; $createpotential = $_REQUEST["createpotential"]; $potential_name = $_REQUEST["potential_name"]; $close_date = getDBInsertDateValue($_REQUEST["closedate"]); From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 08:54:51 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 12:54:51 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9030 - /vtigercrm/trunk/modules/Leads/ConvertLead.php Message-ID: <20060818125451.0B55275122E@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 06:54:47 2006 New Revision: 9030 Log: changes made to fix the convertlead issue --Minnie Modified: vtigercrm/trunk/modules/Leads/ConvertLead.php Modified: vtigercrm/trunk/modules/Leads/ConvertLead.php ============================================================================== --- vtigercrm/trunk/modules/Leads/ConvertLead.php (original) +++ vtigercrm/trunk/modules/Leads/ConvertLead.php Fri Aug 18 06:54:47 2006 @@ -99,7 +99,7 @@ '.$app_strings['LBL_ASSIGNED_TO'].' - + From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 08:57:28 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 12:57:28 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9031 - /vtigercrm/trunk/include/language/en_us.lang.php Message-ID: <20060818125728.277DE75122E@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 06:57:24 2006 New Revision: 9031 Log: label added --Minnie Modified: vtigercrm/trunk/include/language/en_us.lang.php Modified: vtigercrm/trunk/include/language/en_us.lang.php ============================================================================== --- vtigercrm/trunk/include/language/en_us.lang.php (original) +++ vtigercrm/trunk/include/language/en_us.lang.php Fri Aug 18 06:57:24 2006 @@ -938,6 +938,9 @@ //Added after 5.0 Alpha5 'Campaign Name'=>'Campaign Name', 'Campaign Type'=>'Campaign Type', +'Campaign Status'=>'Campaign Status', +'Expected Revenue'=>'Expected Revenue', +'Expected Close Date'=>'Expected Close Date', 'LBL_ACTIONS'=>'Actions', 'LBL_SEND'=>'Send', 'LBL_VAT'=>'VAT', From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 08:59:15 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 12:59:15 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9032 - /vtigercrm/trunk/modules/Contacts/CallRelatedList.php Message-ID: <20060818125915.6271E75122E@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 06:59:11 2006 New Revision: 9032 Log: typo error fixed --Minnie Modified: vtigercrm/trunk/modules/Contacts/CallRelatedList.php Modified: vtigercrm/trunk/modules/Contacts/CallRelatedList.php ============================================================================== --- vtigercrm/trunk/modules/Contacts/CallRelatedList.php (original) +++ vtigercrm/trunk/modules/Contacts/CallRelatedList.php Fri Aug 18 06:59:11 2006 @@ -58,7 +58,7 @@ $smarty->assign("id",$focus->id); $smarty->assign("NAME",$focus->name); -$related_array = getrelatedlists($currentModule,$focus); +$related_array = getRelatedLists($currentModule,$focus); $smarty->assign("RELATEDLISTS", $related_array); $smarty->assign("MODULE",$currentmodule); $smarty->assign("SINGLE_MOD",$app_strings['Contact']); From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 09:04:43 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 13:04:43 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9033 - /vtigercrm/trunk/modules/Contacts/Contact.php Message-ID: <20060818130443.E42A8751259@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 07:04:40 2006 New Revision: 9033 Log: changes made to fix the relatedlist issue --Minnie Modified: vtigercrm/trunk/modules/Contacts/Contact.php Modified: vtigercrm/trunk/modules/Contacts/Contact.php ============================================================================== --- vtigercrm/trunk/modules/Contacts/Contact.php (original) +++ vtigercrm/trunk/modules/Contacts/Contact.php Fri Aug 18 07:04:40 2006 @@ -548,7 +548,6 @@ $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; $button = ''; - $returnset = ''; $log->info("Campaign Related List for Contact Displayed"); $query = "SELECT vtiger_users.user_name, vtiger_campaign.campaignid, vtiger_campaign.campaignname, vtiger_campaign.campaigntype, vtiger_campaign.campaignstatus, vtiger_campaign.expectedrevenue, vtiger_campaign.closingdate, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_campaign inner join vtiger_campaigncontrel on vtiger_campaigncontrel.campaignid=vtiger_campaign.campaignid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_campaign.campaignid left join vtiger_campaigngrouprelation on vtiger_campaign.campaignid=vtiger_campaigngrouprelation.campaignid left join vtiger_groups on vtiger_groups.groupname=vtiger_campaigngrouprelation.groupname left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid where vtiger_campaigncontrel.contactid=".$id." and vtiger_crmentity.deleted=0"; From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 09:08:44 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 13:08:44 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9034 - /vtigercrm/trunk/include/utils/DeleteUtils.php Message-ID: <20060818130844.36B29751259@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 07:08:40 2006 New Revision: 9034 Log: changes made to fix the relatedlist issue --Minnie Modified: vtigercrm/trunk/include/utils/DeleteUtils.php Modified: vtigercrm/trunk/include/utils/DeleteUtils.php ============================================================================== --- vtigercrm/trunk/include/utils/DeleteUtils.php (original) +++ vtigercrm/trunk/include/utils/DeleteUtils.php Fri Aug 18 07:08:40 2006 @@ -39,6 +39,15 @@ if($return_id!='') { $sql ='delete from vtiger_seactivityrel where crmid = '.$record.' and activityid = '.$return_id; + $adb->query($sql); + } + break; + case Campaigns: + if($return_module == "Leads") { + $sql = 'delete from vtiger_campaignleadrel where campaignid='.$record.' and leadid='.$return_id; + $adb->query($sql); + } elseif($return_module == "Contacts") { + $sql = 'delete from vtiger_campaigncontrel where campaignid='.$record.' and contactid='.$return_id; $adb->query($sql); } break; From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 09:44:43 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 13:44:43 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9035 - in /vtigercrm/trunk/modules/System/templates/classic: box.tpl form.tpl Message-ID: <20060818134443.882A7751288@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 07:44:35 2006 New Revision: 9035 Log: Unwanted braces removed from sys information -- Ahmed Modified: vtigercrm/trunk/modules/System/templates/classic/box.tpl vtigercrm/trunk/modules/System/templates/classic/form.tpl Modified: vtigercrm/trunk/modules/System/templates/classic/box.tpl ============================================================================== --- vtigercrm/trunk/modules/System/templates/classic/box.tpl (original) +++ vtigercrm/trunk/modules/System/templates/classic/box.tpl Fri Aug 18 07:44:35 2006 @@ -1,4 +1,4 @@ -{**} +--> - '; + '; //Get the attachments list and form in the tr tag $files_array = getTicketAttachmentsList($ticketid); From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 09:15:59 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 13:15:59 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9180 - /vtigercrm/trunk/modules/System/language/en_us.lang.php Message-ID: <20060829131559.6FD8474609D@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 29 07:15:55 2006 New Revision: 9180 Log: Added php closing tag in lang file -- ahmed Modified: vtigercrm/trunk/modules/System/language/en_us.lang.php Modified: vtigercrm/trunk/modules/System/language/en_us.lang.php ============================================================================== --- vtigercrm/trunk/modules/System/language/en_us.lang.php (original) +++ vtigercrm/trunk/modules/System/language/en_us.lang.php Tue Aug 29 07:15:55 2006 @@ -24,3 +24,4 @@ 'LBL_SYSTEM_CONFIG'=>'System Configuration', ); +?> From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 09:20:26 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 13:20:26 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9181 - /vtigercrm/trunk/modules/Calendar/addEventUI.php Message-ID: <20060829132026.9E6D174609F@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 29 07:20:22 2006 New Revision: 9181 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/addEventUI.php Modified: vtigercrm/trunk/modules/Calendar/addEventUI.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/addEventUI.php (original) +++ vtigercrm/trunk/modules/Calendar/addEventUI.php Tue Aug 29 07:20:22 2006 @@ -24,6 +24,7 @@ //echo '
';print_r($userDetails);echo '
'; $to_email = getUserEmailId('id',$current_user->id); $date_format = parse_calendardate($app_strings['NTC_DATE_FORMAT']); + $assignedto = getAssignedTo(); $mysel= $_GET['view']; $calendar_arr = Array(); $calendar_arr['IMAGE_PATH'] = $image_path; @@ -78,25 +79,95 @@ $calendar_arr['calendar']->hour_format = 'am/pm'; else $calendar_arr['calendar']->hour_format = $current_user->hour_format; - - function getPriorityCombo() - { - global $adb, $mod_strings; - $combo = ''; - $combo .= ''; - return $combo; - } +/** Function to construct HTML code for Assigned To field + * @param $assignedto -- Assigned To values :: Type array + * @param $toggletype -- String to different event and task :: Type string + * return $htmlStr -- HTML code in string forat :: Type string + */ +function getAssignedToHTML($assignedto,$toggletype) +{ + global $app_strings; + $userlist = $assignedto[0]; + if(isset($assignedto[1]) && $assignedto[1] != null) + $grouplist = $assignedto[1]; + $htmlStr = ''; + $check = 1; + foreach($userlist as $key_one=>$arr) + { + foreach($arr as $sel_value=>$value) + { + if($value != '') + $check=$check*0; + else + $check=$check*1; + } + } + if($check == 0) + { + $select_user='checked'; + $style_user='display:block'; + $style_group='display:none'; + } + else + { + $select_group='checked'; + $style_user='display:none'; + $style_group='display:block'; + } + if($toggletype == 'task') + $htmlStr .= ' '.$app_strings['LBL_USER']; + else + $htmlStr .= ' '.$app_strings['LBL_USER']; + if($grouplist != '') + { + if($toggletype == 'task') + $htmlStr .= ' '.$app_strings['LBL_GROUP']; + else + $htmlStr .= ' '.$app_strings['LBL_GROUP']; + } + if($toggletype == 'task') + { + $htmlStr .= ' + '; + } + foreach($userlist as $key_one=>$arr) + { + foreach($arr as $sel_value=>$value) + { + $htmlStr .= ''; + } + } + $htmlStr .= ' + '; + if($grouplist != '') + { + if($toggletype == 'task') + { + $htmlStr .= ' + '; + } + foreach($grouplist as $key_one=>$arr) + { + foreach($arr as $sel_value=>$value) + { + $htmlStr .= ''; + } + } + $htmlStr .= ' + '; + } + return $htmlStr; +} ?> @@ -139,12 +210,9 @@ - - - @@ -161,10 +229,10 @@
Modified: vtigercrm/trunk/modules/System/templates/classic/form.tpl ============================================================================== --- vtigercrm/trunk/modules/System/templates/classic/form.tpl (original) +++ vtigercrm/trunk/modules/System/templates/classic/form.tpl Fri Aug 18 07:44:35 2006 @@ -1,4 +1,4 @@ -{**} +// phpsysinfo release version number +--> {errors} From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 10:48:33 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 14:48:33 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9036 - /vtigercrm/trunk/modules/System/templates/classic/form.tpl Message-ID: <20060818144834.1785075120A@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 08:48:26 2006 New Revision: 9036 Log: Removed braces from sysinfo -- Ahmed Modified: vtigercrm/trunk/modules/System/templates/classic/form.tpl Modified: vtigercrm/trunk/modules/System/templates/classic/form.tpl ============================================================================== --- vtigercrm/trunk/modules/System/templates/classic/form.tpl (original) +++ vtigercrm/trunk/modules/System/templates/classic/form.tpl Fri Aug 18 08:48:26 2006 @@ -24,7 +24,6 @@ - From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 11:24:54 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 15:24:54 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9037 - /vtigercrm/trunk/modules/System/includes/xml/vitals.php Message-ID: <20060818152454.31737751321@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 09:24:47 2006 New Revision: 9037 Log: Image path made proper for sys info -- Ahmed Modified: vtigercrm/trunk/modules/System/includes/xml/vitals.php Modified: vtigercrm/trunk/modules/System/includes/xml/vitals.php ============================================================================== --- vtigercrm/trunk/modules/System/includes/xml/vitals.php (original) +++ vtigercrm/trunk/modules/System/includes/xml/vitals.php Fri Aug 18 09:24:47 2006 @@ -79,7 +79,7 @@ . " \n" . " \n" . " \n" - . " \n" + . " \n" . " \n" . " \n" . " \n" From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 11:42:51 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 15:42:51 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9039 - /vtigercrm/trunk/Smarty/templates/SysInformation.tpl Message-ID: <20060818154251.8298F751326@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 09:42:44 2006 New Revision: 9039 Log: Adjusted the system info frame height to get rid of the inside scroll -- Ahmed Modified: vtigercrm/trunk/Smarty/templates/SysInformation.tpl Modified: vtigercrm/trunk/Smarty/templates/SysInformation.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/SysInformation.tpl (original) +++ vtigercrm/trunk/Smarty/templates/SysInformation.tpl Fri Aug 18 09:42:44 2006 @@ -34,7 +34,7 @@ From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 11:25:47 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 15:25:47 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9038 - /vtigercrm/trunk/modules/System/includes/common_functions.php Message-ID: <20060818152547.EEBFB750143@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 09:25:41 2006 New Revision: 9038 Log: Image path made proper for sys info -- Ahmed Modified: vtigercrm/trunk/modules/System/includes/common_functions.php Modified: vtigercrm/trunk/modules/System/includes/common_functions.php ============================================================================== --- vtigercrm/trunk/modules/System/includes/common_functions.php (original) +++ vtigercrm/trunk/modules/System/includes/common_functions.php Fri Aug 18 09:25:41 2006 @@ -32,17 +32,17 @@ $textdir = direction(); - $imgpath = getcwd().'/modules/System/templates/' . TEMPLATE_SET . '/images/'; + $imgpath = '/modules/System/templates/' . TEMPLATE_SET . '/images/'; $maximum == 0 ? $barwidth = 0 : $barwidth = round((100 / $maximum) * $value) * $b; $red = 90 * $b; $yellow = 75 * $b; - if (!file_exists(getcwd()."/modules/System/templates/" . TEMPLATE_SET . "/images/nobar_left.gif")) { + if (!file_exists("/modules/System/templates/" . TEMPLATE_SET . "/images/nobar_left.gif")) { if ($barwidth == 0) { return '' . '' . ''; - } elseif (file_exists(getcwd() . "/modules/System/templates/" . TEMPLATE_SET . "/images/yellowbar_left.gif") && $barwidth > $yellow && $barwidth < $red) { + } elseif (file_exists("/modules/System/templates/" . TEMPLATE_SET . "/images/yellowbar_left.gif") && $barwidth > $yellow && $barwidth < $red) { return '' . '' . ''; @@ -60,7 +60,7 @@ return '' . '' . ''; - } elseif (file_exists(getcwd() . "/modules/System/templates/" . TEMPLATE_SET . "/images/yellowbar_left.gif") && $barwidth > $yellow && $barwidth < $red) { + } elseif (file_exists("/modules/System/templates/" . TEMPLATE_SET . "/images/yellowbar_left.gif") && $barwidth > $yellow && $barwidth < $red) { return '' . '' . '' From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 12:13:04 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 16:13:04 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9040 - /vtigercrm/trunk/include/nusoap/nusoap.php Message-ID: <20060818161305.62B6F751326@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 10:12:58 2006 New Revision: 9040 Log: function parse_http_headers changed to use $_SERVER to get the header informations as getallheaders has some issues in windows + PHP 5.1 ---Jeri Modified: vtigercrm/trunk/include/nusoap/nusoap.php Modified: vtigercrm/trunk/include/nusoap/nusoap.php ============================================================================== --- vtigercrm/trunk/include/nusoap/nusoap.php (original) +++ vtigercrm/trunk/include/nusoap/nusoap.php Fri Aug 18 10:12:58 2006 @@ -3322,7 +3322,12 @@ $this->request = ''; $this->SOAPAction = ''; - if(function_exists('getallheaders')){ + + //Commented to fix the issue in PHP 5 Windows system ---Jeri + //when we use getallheaders function we are geting an error description invalid gzip crc value when parsing the response in VB + // hence the function is commented out and $_SERVER is used to get all the header informations. + + /*if(function_exists('getallheaders')){ $this->debug("In parse_http_headers, use getallheaders"); $headers = getallheaders(); foreach($headers as $k=>$v){ @@ -3347,7 +3352,7 @@ // should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1 $this->xml_encoding = 'ISO-8859-1'; } - } elseif(isset($_SERVER) && is_array($_SERVER)){ + } else*/if(isset($_SERVER) && is_array($_SERVER)){ $this->debug("In parse_http_headers, use _SERVER"); foreach ($_SERVER as $k => $v) { if (substr($k, 0, 5) == 'HTTP_') { From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 18 16:37:09 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Fri, 18 Aug 2006 20:37:09 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9041 - /vtigercrm/trunk/modules/Reports/CreatePDF.php Message-ID: <20060818203709.A842C751609@vtiger.fosslabs.com> Author: richie Date: Fri Aug 18 14:37:02 2006 New Revision: 9041 Log: Issue in Reports PDF has been fixed --Jeri Modified: vtigercrm/trunk/modules/Reports/CreatePDF.php Modified: vtigercrm/trunk/modules/Reports/CreatePDF.php ============================================================================== --- vtigercrm/trunk/modules/Reports/CreatePDF.php (original) +++ vtigercrm/trunk/modules/Reports/CreatePDF.php Fri Aug 18 14:37:02 2006 @@ -398,5 +398,5 @@ $pdf->WriteHTML($html); $pdf->Output('Reports.pdf','D'); - +exit(); ?> From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 02:02:17 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 21 Aug 2006 06:02:17 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9042 - /vtigercrm/trunk/modules/Settings/CurrencyDeleteStep1.php Message-ID: <20060821060217.BFFB67517FB@vtiger.fosslabs.com> Author: saraj Date: Mon Aug 21 00:02:13 2006 New Revision: 9042 Log: changes made to fix the issue in currency delete --Minnie Modified: vtigercrm/trunk/modules/Settings/CurrencyDeleteStep1.php Modified: vtigercrm/trunk/modules/Settings/CurrencyDeleteStep1.php ============================================================================== --- vtigercrm/trunk/modules/Settings/CurrencyDeleteStep1.php (original) +++ vtigercrm/trunk/modules/Settings/CurrencyDeleteStep1.php Mon Aug 21 00:02:13 2006 @@ -53,7 +53,7 @@ $output.=' From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 05:29:33 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 21 Aug 2006 09:29:33 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9045 - /vtigercrm/trunk/soap/vtigerolservice.php Message-ID: <20060821092933.4F77775A228@vtiger.fosslabs.com> Author: richie Date: Mon Aug 21 03:29:08 2006 New Revision: 9045 Log: plugin_save variable has been set to true when save from outlook --Jeri Modified: vtigercrm/trunk/soap/vtigerolservice.php Modified: vtigercrm/trunk/soap/vtigerolservice.php ============================================================================== --- vtigercrm/trunk/soap/vtigerolservice.php (original) +++ vtigercrm/trunk/soap/vtigerolservice.php Mon Aug 21 03:29:08 2006 @@ -309,6 +309,7 @@ $email->column_fields[date_start] = $date_sent; $email->column_fields[description] = htmlentities($email_body); $email->column_fields[activitytype] = 'Emails'; + $email->plugin_save = true; $email->save("Emails"); $email->set_emails_contact_invitee_relationship($email->id,$contactid); @@ -320,7 +321,7 @@ if(isset($camodulerow)) { $emailid = $camodulerow["email"]; - $query = 'insert into vtiger_emaildetails values ('.$email->id.',"","'.$emailid.'","","","","'.$cotactid."@77|".'","OUTLOOK")'; + $query = 'insert into vtiger_emaildetails values ('.$email->id.',"","'.$emailid.'","","","","'.$contactid."@77|".'","OUTLOOK")'; $adb->query($query); } return $email->id; From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 05:35:13 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 21 Aug 2006 09:35:13 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9046 - /vtigercrm/trunk/modules/Emails/Email.php Message-ID: <20060821093513.B979275A790@vtiger.fosslabs.com> Author: richie Date: Mon Aug 21 03:34:48 2006 New Revision: 9046 Log: plugin_save variable has been added and set to false by default to check for plugin save--Jeri Modified: vtigercrm/trunk/modules/Emails/Email.php Modified: vtigercrm/trunk/modules/Emails/Email.php ============================================================================== --- vtigercrm/trunk/modules/Emails/Email.php (original) +++ vtigercrm/trunk/modules/Emails/Email.php Mon Aug 21 03:34:48 2006 @@ -36,7 +36,9 @@ var $db; // Stored vtiger_fields - var $module_id="emailid"; + var $module_id="emailid"; + // added to check email save from plugin or not + var $plugin_save = false; var $rel_users_table = "vtiger_salesmanactivityrel"; var $rel_contacts_table = "vtiger_cntactivityrel"; From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 05:39:37 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 21 Aug 2006 09:39:37 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9047 - /vtigercrm/trunk/data/CRMEntity.php Message-ID: <20060821093937.377E175A7AC@vtiger.fosslabs.com> Author: richie Date: Mon Aug 21 03:39:07 2006 New Revision: 9047 Log: plugin_save variable checked for inserting into seactiivityrel --Jeri Modified: vtigercrm/trunk/data/CRMEntity.php Modified: vtigercrm/trunk/data/CRMEntity.php ============================================================================== --- vtigercrm/trunk/data/CRMEntity.php (original) +++ vtigercrm/trunk/data/CRMEntity.php Mon Aug 21 03:39:07 2006 @@ -79,10 +79,9 @@ //added by raju elseif($table_name=="vtiger_seactivityrel" ) { - if($module=="Emails" && $_REQUEST['smodule']!='webmails') - //modified by Richie as raju's implementation broke the feature for addition of webmail to vtiger_crmentity.need to be more careful in future while integrating code - //if($_REQUEST['smodule']!='webmails' && $_REQUEST['smodule'] != '') - { + //modified by Richie as raju's implementation broke the feature for addition of webmail to vtiger_crmentity.need to be more careful in future while integrating code + if($module=="Emails" && $_REQUEST['smodule']!='webmails' && (!$this->plugin_save)) + { if($_REQUEST['currentid']!='') { $actid=$_REQUEST['currentid']; From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 06:28:55 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 21 Aug 2006 10:28:55 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9048 - /vtigercrm/trunk/include/utils/ListViewUtils.php Message-ID: <20060821102855.BD1F975A7BA@vtiger.fosslabs.com> Author: saraj Date: Mon Aug 21 04:28:51 2006 New Revision: 9048 Log: Retained navigation page after sorting. Fixes #1923 Modified: vtigercrm/trunk/include/utils/ListViewUtils.php Modified: vtigercrm/trunk/include/utils/ListViewUtils.php ============================================================================== --- vtigercrm/trunk/include/utils/ListViewUtils.php (original) +++ vtigercrm/trunk/include/utils/ListViewUtils.php Mon Aug 21 04:28:51 2006 @@ -162,13 +162,13 @@ $lbl_name .=': (in '.$curr_symbol.')'; } if($relatedlist !='' && $relatedlist != 'global') - $name = "".$lbl_name." ".$arrow.""; + $name = "".$lbl_name." ".$arrow.""; elseif($module == 'Users' && $name == 'User Name') $name = "".$mod_strings['LBL_LIST_USER_NAME_ROLE']." ".$arrow.""; elseif($relatedlist == "global") $name = $lbl_name; else - $name = "".$lbl_name." ".$arrow.""; + $name = "".$lbl_name." ".$arrow.""; $arrow = ''; } else From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 06:50:13 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 21 Aug 2006 10:50:13 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9049 - /vtigercrm/trunk/include/Ajax/TagCloud.php Message-ID: <20060821105013.C6E6675A7BD@vtiger.fosslabs.com> Author: richie Date: Mon Aug 21 04:50:02 2006 New Revision: 9049 Log: SQL Injection in tagcloud has been fixed --Jeri Modified: vtigercrm/trunk/include/Ajax/TagCloud.php Modified: vtigercrm/trunk/include/Ajax/TagCloud.php ============================================================================== --- vtigercrm/trunk/include/Ajax/TagCloud.php (original) +++ vtigercrm/trunk/include/Ajax/TagCloud.php Mon Aug 21 04:50:02 2006 @@ -1,53 +1,60 @@ -id; -if($ajaxaction == "SAVETAG") -{ - - require_once('include/freetag/freetag.class.php'); - $tagfields = $_REQUEST["tagfields"]; - $freetag = new freetag(); - if (isset($_REQUEST["tagfields"]) && trim($_REQUEST["tagfields"]) != "") - { - $freetag->tag_object($userid,$crmid,$tagfields,$module); - $tagcloud = $freetag->get_tag_cloud_html($module,$userid,$crmid); - echo $tagcloud; - } - -} -elseif($ajaxaction == 'GETTAGCLOUD') -{ - require_once('include/freetag/freetag.class.php'); - $freetag = new freetag(); - if(trim($module) != "") - { - $tagcloud = $freetag->get_tag_cloud_html($module,$userid,$crmid); - echo $tagcloud; - }else - { - $tagcloud = $freetag->get_tag_cloud_html("",$userid); - echo $tagcloud; - } -}elseif($ajaxaction == 'DELETETAG') -{ - $tagid = $_REQUEST['tagid']; - global $adb; - $query="delete from vtiger_freetagged_objects where tag_id=".$tagid; - $result=$adb->query($query); - $query="delete from vtiger_freetags where id=".$tagid; - $result=$adb->query($query); - echo 'SUCESS'; -} -?> +id; +if($ajaxaction == "SAVETAG") +{ + + require_once('include/freetag/freetag.class.php'); + $tagfields = $_REQUEST["tagfields"]; + $freetag = new freetag(); + if (isset($_REQUEST["tagfields"]) && trim($_REQUEST["tagfields"]) != "") + { + $freetag->tag_object($userid,$crmid,$tagfields,$module); + $tagcloud = $freetag->get_tag_cloud_html($module,$userid,$crmid); + echo $tagcloud; + } + +} +elseif($ajaxaction == 'GETTAGCLOUD') +{ + require_once('include/freetag/freetag.class.php'); + $freetag = new freetag(); + if(trim($module) != "") + { + $tagcloud = $freetag->get_tag_cloud_html($module,$userid,$crmid); + echo $tagcloud; + }else + { + $tagcloud = $freetag->get_tag_cloud_html("",$userid); + echo $tagcloud; + } +}elseif($ajaxaction == 'DELETETAG') +{ + if(is_numeric($_REQUEST['tagid'])) + { + $tagid = $_REQUEST['tagid']; + global $adb; + $query="delete from vtiger_freetagged_objects where tag_id=".$tagid; + $result=$adb->query($query); + $query="delete from vtiger_freetags where id=".$tagid; + $result=$adb->query($query); + echo 'SUCESS'; + }else + { + die("An invalid tagid to delete."); + } + +} +?> From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 07:42:25 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 21 Aug 2006 11:42:25 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9050 - /vtigercrm/trunk/Smarty/templates/OrgSharingEditView.tpl Message-ID: <20060821114225.6C74175A7C5@vtiger.fosslabs.com> Author: richie Date: Mon Aug 21 05:42:15 2006 New Revision: 9050 Log: Include Settings submenu has been removed --Jeri Modified: vtigercrm/trunk/Smarty/templates/OrgSharingEditView.tpl Modified: vtigercrm/trunk/Smarty/templates/OrgSharingEditView.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/OrgSharingEditView.tpl (original) +++ vtigercrm/trunk/Smarty/templates/OrgSharingEditView.tpl Mon Aug 21 05:42:15 2006 @@ -98,5 +98,4 @@ {rdelim} -{include file='SettingsSubMenu.tpl'} From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 10:11:45 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 21 Aug 2006 14:11:45 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9051 - /vtigercrm/trunk/Smarty/templates/Header.tpl Message-ID: <20060821141145.9A3EE75A7F6@vtiger.fosslabs.com> Author: saraj Date: Mon Aug 21 08:11:41 2006 New Revision: 9051 Log: changes made to get jscalendar popup in qcreate --Minnie Modified: vtigercrm/trunk/Smarty/templates/Header.tpl Modified: vtigercrm/trunk/Smarty/templates/Header.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/Header.tpl (original) +++ vtigercrm/trunk/Smarty/templates/Header.tpl Mon Aug 21 08:11:41 2006 @@ -28,6 +28,10 @@ + + + +
{vitals}
{memory}
{filesystems}
{hardware}
" . $text['dversion'] . "\"\"getData("/phpsysinfo/Vitals/Distroicon") . "\"> " . $XPath->getData("/phpsysinfo/Vitals/Distro") . "\"\"getData("/phpsysinfo/Vitals/Distroicon") . "\"> " . $XPath->getData("/phpsysinfo/Vitals/Distro") . "
" . $text['uptime'] . "
- +
- +
@@ -205,6 +209,7 @@ $("status").style.display="none"; $("qcform").style.display="inline"; $("qcform").innerHTML = response.responseText; + eval($("date_calpopup").innerHTML); eval($("qcform")); {rdelim} {rdelim} From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 10:15:44 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 21 Aug 2006 14:15:44 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9052 - /vtigercrm/trunk/Smarty/templates/DetailView.tpl Message-ID: <20060821141544.CE65975A7F6@vtiger.fosslabs.com> Author: saraj Date: Mon Aug 21 08:15:41 2006 New Revision: 9052 Log: changes made to get jscalendar popup in convertlead --Minnie Modified: vtigercrm/trunk/Smarty/templates/DetailView.tpl Modified: vtigercrm/trunk/Smarty/templates/DetailView.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/DetailView.tpl (original) +++ vtigercrm/trunk/Smarty/templates/DetailView.tpl Mon Aug 21 08:15:41 2006 @@ -37,6 +37,7 @@ postBody: 'module=Leads&action=LeadsAjax&file=ConvertLead&record='+id, onComplete: function(response) { $("convertleaddiv").innerHTML=response.responseText; + eval($("conv_leadcal").innerHTML); } } ); From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 10:21:41 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 21 Aug 2006 14:21:41 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9053 - /vtigercrm/trunk/Smarty/templates/QuickCreate.tpl Message-ID: <20060821142141.C488675A7DE@vtiger.fosslabs.com> Author: saraj Date: Mon Aug 21 08:21:38 2006 New Revision: 9053 Log: changes made to get jscalendar popup in qcreate --Minnie Modified: vtigercrm/trunk/Smarty/templates/QuickCreate.tpl Modified: vtigercrm/trunk/Smarty/templates/QuickCreate.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/QuickCreate.tpl (original) +++ vtigercrm/trunk/Smarty/templates/QuickCreate.tpl Mon Aug 21 08:21:38 2006 @@ -224,6 +224,7 @@ {assign var=time_val value="$time_value"} {/foreach} + {if $uitype eq 6} {/if} @@ -236,6 +237,9 @@ {else}
({$dateStr}) {/if} + {elseif $uitype eq 63} @@ -243,7 +247,7 @@ {$fldlabel} From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 10:38:51 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 21 Aug 2006 14:38:51 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9056 - /wordintegration/trunk/client/bin/Language/english.ini Message-ID: <20060821143851.C12F975A7DF@vtiger.fosslabs.com> Author: richie Date: Mon Aug 21 08:38:44 2006 New Revision: 9056 Log: String added for unable to connect to vtigerCRM --Jeri Modified: wordintegration/trunk/client/bin/Language/english.ini Modified: wordintegration/trunk/client/bin/Language/english.ini ============================================================================== Binary files - no diff available. From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 10:41:41 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 21 Aug 2006 14:41:41 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9057 - /vtigercrm/trunk/modules/Leads/LeadConvertToEntities.php Message-ID: <20060821144141.72A9A75A800@vtiger.fosslabs.com> Author: saraj Date: Mon Aug 21 08:41:37 2006 New Revision: 9057 Log: changes made to handle campaign relation in convertlead functionality --Minnie Modified: vtigercrm/trunk/modules/Leads/LeadConvertToEntities.php Modified: vtigercrm/trunk/modules/Leads/LeadConvertToEntities.php ============================================================================== --- vtigercrm/trunk/modules/Leads/LeadConvertToEntities.php (original) +++ vtigercrm/trunk/modules/Leads/LeadConvertToEntities.php Mon Aug 21 08:41:37 2006 @@ -247,6 +247,27 @@ $log->debug("Exit from function saveLeadRelatedProducts."); } +/** Function used to save the lead related Campaigns with Contact + * $leadid - leadid + * $relatedid - related entity id (contactid) + */ +function saveLeadRelatedCampaigns($leadid, $relatedid) +{ + global $adb, $log; + $log->debug("Entering into function saveLeadRelatedCampaigns($leadid, $relatedid)"); + + $campaign_result = $adb->query("select * from vtiger_campaignleadrel where leadid=$leadid"); + $noofcampaigns = $adb->num_rows($campaign_result); + for($i = 0; $i < $noofcampaigns; $i++) + { + $campaignid = $adb->query_result($campaign_result,$i,'campaignid'); + + $adb->query("insert into vtiger_campaigncontrel (campaignid, contactid) values($campaignid, $relatedid)"); + } + $log->debug("Exit from function saveLeadRelatedCampaigns."); +} + + $crmid = $adb->getUniqueID("vtiger_crmentity"); //Saving Account - starts @@ -335,6 +356,9 @@ //Retrieve the lead related products and relate them with this new contact saveLeadRelatedProducts($id, $contact_id, "Contacts"); + +//Retrieve the lead related Campaigns and relate them with this new contact --Minnie +saveLeadRelatedCampaigns($id, $contact_id); //Up to this, Contact related data save finshed @@ -399,7 +423,9 @@ //Updating the deleted status $sql_update_converted = "UPDATE vtiger_leaddetails SET converted = 1 where leadid='" .$id ."'"; $adb->query($sql_update_converted); - +//updating the campaign-lead relation --Minnie +$sql_update_campleadrel = "delete from vtiger_campaignleadrel where leadid=".$id; +$adb->query($sql_update_campleadrel); header("Location: index.php?action=DetailView&module=Accounts&record=$crmid&parenttab=$category"); ?> From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 10:46:38 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 21 Aug 2006 14:46:38 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9058 - in /wordintegration/trunk/client/source: modGeneral.bas modLang.bas vtigerCRMWordPlugin.vbp vtigerCRMWordPlugin.vbw Message-ID: <20060821144638.BAA4875A814@vtiger.fosslabs.com> Author: richie Date: Mon Aug 21 08:46:25 2006 New Revision: 9058 Log: Issue in Login to word plugin has been fixed --Jeri Modified: wordintegration/trunk/client/source/modGeneral.bas wordintegration/trunk/client/source/modLang.bas wordintegration/trunk/client/source/vtigerCRMWordPlugin.vbp wordintegration/trunk/client/source/vtigerCRMWordPlugin.vbw Modified: wordintegration/trunk/client/source/modGeneral.bas ============================================================================== Binary files - no diff available. Modified: wordintegration/trunk/client/source/modLang.bas ============================================================================== Binary files - no diff available. Modified: wordintegration/trunk/client/source/vtigerCRMWordPlugin.vbp ============================================================================== Binary files - no diff available. Modified: wordintegration/trunk/client/source/vtigerCRMWordPlugin.vbw ============================================================================== Binary files - no diff available. From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 21 10:53:46 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 21 Aug 2006 14:53:46 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9059 - /vtigercrm/trunk/soap/wordplugin.php Message-ID: <20060821145346.7CD6E75A825@vtiger.fosslabs.com> Author: richie Date: Mon Aug 21 08:53:39 2006 New Revision: 9059 Log: Issue in Login to word plugin has been fixed --Jeri Modified: vtigercrm/trunk/soap/wordplugin.php Modified: vtigercrm/trunk/soap/wordplugin.php ============================================================================== --- vtigercrm/trunk/soap/wordplugin.php (original) +++ vtigercrm/trunk/soap/wordplugin.php Mon Aug 21 08:53:39 2006 @@ -307,8 +307,25 @@ function create_session($user_name, $password) -{ - return "TempSessionID"; +{ + global $adb; + require_once('modules/Users/User.php'); + $objuser = new User(); + if($password != "" && $user_name != '') + { + $objuser->column_fields['user_name'] = $user_name; + $objuser->load_user($password); + if($objuser->is_authenticated()) + { + return "TempSessionID"; + }else + { + return "false"; + } + }else + { + return "false"; + } } function end_session($user_name) From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 01:30:56 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 05:30:56 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9060 - /vtigercrm/branches/4.2/modules/Contacts/Contact.php Message-ID: <20060822053056.472CC75C84B@vtiger.fosslabs.com> Author: allanbush Date: Mon Aug 21 23:30:48 2006 New Revision: 9060 Log: Added contact sub details to contact export. Closes #1813. Modified: vtigercrm/branches/4.2/modules/Contacts/Contact.php Modified: vtigercrm/branches/4.2/modules/Contacts/Contact.php ============================================================================== --- vtigercrm/branches/4.2/modules/Contacts/Contact.php (original) +++ vtigercrm/branches/4.2/modules/Contacts/Contact.php Mon Aug 21 23:30:48 2006 @@ -492,11 +492,12 @@ if($this->checkIfCustomTableExists()) { $query = $this->constructCustomQueryAddendum() .", - contactdetails.*, contactaddress.*, + contactdetails.*, contactsubdetails.*, contactaddress.*, account.accountname AS account_name, users.user_name AS assigned_user_name FROM contactdetails inner join crmentity on crmentity.crmid=contactdetails.contactid + inner join contactsubdetails on contactsubdetails.contactsubscriptionid=contactdetails.contactid LEFT JOIN users ON crmentity.smcreatorid=users.id LEFT JOIN account on contactdetails.accountid=account.accountid left join contactaddress on contactaddress.contactaddressid=contactdetails.contactid @@ -506,11 +507,12 @@ else { $query = "SELECT - contactdetails.*, contactaddress.*, + contactdetails.*, contactsubdetails.*, contactaddress.*, account.accountname AS account_name, users.user_name AS assigned_user_name FROM contactdetails inner join crmentity on crmentity.crmid=contactdetails.contactid + inner join contactsubdetails on contactsubdetails.contactsubscriptionid=contactdetails.contactid LEFT JOIN users ON crmentity.smcreatorid=users.id LEFT JOIN account on contactdetails.accountid=account.accountid left join contactaddress on contactaddress.contactaddressid=contactdetails.contactid From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 01:38:33 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 05:38:33 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9061 - in /vtigercrm/trunk/modules/Users: DefaultDataPopulator.php profilePrivileges.php Message-ID: <20060822053833.7E56A75C88A@vtiger.fosslabs.com> Author: richie Date: Mon Aug 21 23:38:17 2006 New Revision: 9061 Log: Profile Issues has been fixed --Jeri Modified: vtigercrm/trunk/modules/Users/DefaultDataPopulator.php vtigercrm/trunk/modules/Users/profilePrivileges.php Modified: vtigercrm/trunk/modules/Users/DefaultDataPopulator.php ============================================================================== --- vtigercrm/trunk/modules/Users/DefaultDataPopulator.php (original) +++ vtigercrm/trunk/modules/Users/DefaultDataPopulator.php Mon Aug 21 23:38:17 2006 @@ -1411,6 +1411,11 @@ $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",9,3,0)"); $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",9,4,0)"); + $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",10,0,1)"); + $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",10,1,1)"); + $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",10,2,1)"); + $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",10,3,0)"); + $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",10,4,0)"); $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",13,0,1)"); $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",13,1,1)"); @@ -1504,6 +1509,7 @@ $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",7,6,0)"); $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",8,6,0)"); //$this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",9,6,0)"); + $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",10,6,0)"); $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",7,8,0)"); $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",6,8,0)"); $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",4,8,0)"); Modified: vtigercrm/trunk/modules/Users/profilePrivileges.php ============================================================================== --- vtigercrm/trunk/modules/Users/profilePrivileges.php (original) +++ vtigercrm/trunk/modules/Users/profilePrivileges.php Mon Aug 21 23:38:17 2006 @@ -304,7 +304,7 @@ $no_of_actions=sizeof($action_array); foreach($action_array as $action_id=>$act_per) { - $action_name = getActionName($action_id); + $action_name = getActionname($action_id); $tab_util_act_per = $action_array[$action_id]; $tab_util_per = getDisplayValue($tab_util_act_per,$tabid,$action_id); $util[]=$action_name; @@ -325,7 +325,7 @@ $no_of_actions=sizeof($action_array); foreach($action_array as $action_id=>$act_per) { - $action_name = getActionName($action_id); + $action_name = getActionname($action_id); $tab_util_act_per = $action_array[$action_id]; $tab_util_per = getDisplayOutput($tab_util_act_per,$tabid,$action_id); $util[]=$action_name; @@ -348,7 +348,7 @@ $no_of_actions=sizeof($action_array); foreach($action_array as $action_id=>$act_per) { - $action_name = getActionName($action_id); + $action_name = getActionname($action_id); $tab_util_act_per = $action_array[$action_id]; $tab_util_per = getDisplayOutput($tab_util_act_per,$tabid,$action_id); $util[]=$action_name; @@ -369,7 +369,7 @@ $no_of_actions=sizeof($action_array); foreach($action_array as $action_id=>$act_per) { - $action_name = getActionName($action_id); + $action_name = getActionname($action_id); $tab_util_act_per = $action_array[$action_id]; $tab_util_per = getDisplayOutput(0,$tabid,$action_id); $util[]=$action_name; From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 01:40:24 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 05:40:24 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9062 - in /vtigercrm/trunk/Smarty/templates: EditProfile.tpl ProfileDetailView.tpl Message-ID: <20060822054024.B37F375C88A@vtiger.fosslabs.com> Author: richie Date: Mon Aug 21 23:40:13 2006 New Revision: 9062 Log: Export utility privileges in Emails issue has been fixed --jeri Modified: vtigercrm/trunk/Smarty/templates/EditProfile.tpl vtigercrm/trunk/Smarty/templates/ProfileDetailView.tpl Modified: vtigercrm/trunk/Smarty/templates/EditProfile.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/EditProfile.tpl (original) +++ vtigercrm/trunk/Smarty/templates/EditProfile.tpl Mon Aug 21 23:40:13 2006 @@ -157,10 +157,10 @@ - - + + @@ -181,8 +181,8 @@ {$STANDARD_PRIV[$tabid][2]} @@ -190,6 +190,7 @@ From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 14:32:16 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 18:32:16 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9145 - /vtigercrm/trunk/adodb/drivers/adodb-postgres64.inc.php Message-ID: <20060828183216.266EE7081EB@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 12:32:07 2006 New Revision: 9145 Log: Support for PostGres DB done Modified: vtigercrm/trunk/adodb/drivers/adodb-postgres64.inc.php Modified: vtigercrm/trunk/adodb/drivers/adodb-postgres64.inc.php ============================================================================== --- vtigercrm/trunk/adodb/drivers/adodb-postgres64.inc.php (original) +++ vtigercrm/trunk/adodb/drivers/adodb-postgres64.inc.php Mon Aug 28 12:32:07 2006 @@ -169,13 +169,25 @@ } - // returns true/false - function BeginTrans() - { - if ($this->transOff) return true; - $this->transCnt += 1; - return @pg_Exec($this->_connectionID, "begin ".$this->_transmode); - } + function SetTransactionMode( $transaction_mode ) + { + if (empty($transaction_mode)) { + $transaction_mode = 'ISOLATION LEVEL SERIALIZABLE'; + } + if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode; + $this->_transmode = $transaction_mode; + return( @pg_Exec($this->_connectionID, "SET SESSION TRANSACTION ".$transaction_mode)); + } + + function BeginTrans() + { + if ($this->transOff) return true; + $this->transCnt += 1; + if( $this->SetTransactionMode($this->_transmode)) + return @pg_Exec($this->_connectionID, "begin"); + else + return(0); + } function RowLock($tables,$where,$flds='1 as ignore') { @@ -1051,4 +1063,4 @@ } } -?> +?> From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 14:33:19 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 18:33:19 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9146 - /vtigercrm/trunk/adodb/adodb-datadict.inc.php Message-ID: <20060828183319.3D5187081EE@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 12:33:12 2006 New Revision: 9146 Log: Support for PostGres DB done Modified: vtigercrm/trunk/adodb/adodb-datadict.inc.php Modified: vtigercrm/trunk/adodb/adodb-datadict.inc.php ============================================================================== --- vtigercrm/trunk/adodb/adodb-datadict.inc.php (original) +++ vtigercrm/trunk/adodb/adodb-datadict.inc.php Mon Aug 28 12:33:12 2006 @@ -267,7 +267,7 @@ foreach($sql as $line) { if ($this->debug) $conn->debug = true; - $log->fatal($line); + $log->debug($line); $ok = $conn->Execute($line); $conn->debug = $saved; if (!$ok) { From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 14:34:41 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 18:34:41 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9147 - /vtigercrm/trunk/include/freetag/freetag.class.php Message-ID: <20060828183441.C86517081FA@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 12:34:34 2006 New Revision: 9147 Log: Support for PostGres DB done Modified: vtigercrm/trunk/include/freetag/freetag.class.php Modified: vtigercrm/trunk/include/freetag/freetag.class.php ============================================================================== --- vtigercrm/trunk/include/freetag/freetag.class.php (original) +++ vtigercrm/trunk/include/freetag/freetag.class.php Mon Aug 28 12:34:34 2006 @@ -984,7 +984,7 @@ ON (${prefix}freetags.id = tag_id) WHERE 1=1 $tagger_sql - GROUP BY tag + GROUP BY tag,tag_id ORDER BY quantity DESC"; //echo $sql; $rs = $adb->limitQuery($sql, 0, $max) or die("Syntax Error: $sql"); From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 14:37:27 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 18:37:27 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9148 - /vtigercrm/trunk/include/database/PearDatabase.php Message-ID: <20060828183727.63C8A708208@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 12:37:19 2006 New Revision: 9148 Log: Support for PostGres DB done Modified: vtigercrm/trunk/include/database/PearDatabase.php Modified: vtigercrm/trunk/include/database/PearDatabase.php ============================================================================== --- vtigercrm/trunk/include/database/PearDatabase.php (original) +++ vtigercrm/trunk/include/database/PearDatabase.php Mon Aug 28 12:37:19 2006 @@ -20,766 +20,775 @@ $log =& LoggerManager::getLogger('VT'); class PearDatabase{ - var $database = null; - var $dieOnError = false; - var $dbType = null; - var $dbHostName = null; - var $dbName = null; - var $dbOptions = null; - var $userName=null; - var $userPassword=null; - var $query_time = 0; - var $log = null; - var $lastmysqlrow = -1; - var $enableSQLlog = false; - - function isMySQL() { return dbType=='mysql'; } - function isOracle() { return dbType=='oci8'; } + var $database = null; + var $dieOnError = false; + var $dbType = null; + var $dbHostName = null; + var $dbName = null; + var $dbOptions = null; + var $userName=null; + var $userPassword=null; + var $query_time = 0; + var $log = null; + var $lastmysqlrow = -1; + var $enableSQLlog = false; + + function isMySQL() { return dbType=='mysql'; } + function isOracle() { return dbType=='oci8'; } + + function println($msg) + { + require_once('include/logging.php'); + $log1 =& LoggerManager::getLogger('VT'); + if(is_array($msg)) + { + $log1->info("PearDatabse ->".print_r($msg,true)); + } + else + { + $log1->info("PearDatabase ->".$msg); + } + return $msg; + } + + function setDieOnError($value){ + $this->dieOnError = $value; + } + + function setDatabaseType($type){ + $this->dbType = $type; + } + + function setUserName($name){ + $this->userName = $name; + } + + function setOption($name, $value){ + if(isset($this->dbOptions)) + $this->dbOptions[$name] = $value; + if(isset($this->database)) + $this->database->setOption($name, $value); + } + + function setUserPassword($pass){ + $this->userPassword = $pass; + } + + function setDatabaseName($db){ + $this->dbName = $db; + } + + function setDatabaseHost($host){ + $this->dbHostName = $host; + } + + function getDataSourceName(){ + return $this->dbType. "://".$this->userName.":".$this->userPassword."@". $this->dbHostName . "/". $this->dbName; + } + + function startTransaction() + { + $this->checkConnection(); + $this->println("TRANS Started"); + $this->database->StartTrans(); + } + + function completeTransaction() + { + if($this->database->HasFailedTrans()) + $this->println("TRANS Rolled Back"); + else + $this->println("TRANS Commited"); - function println($msg) - { - require_once('include/logging.php'); - $log1 =& LoggerManager::getLogger('VT'); - if(is_array($msg)) - { - $log1->info("PearDatabse ->".print_r($msg,true)); - } - else - { - $log1->info("PearDatabase ->".$msg); - } - return $msg; - } - - function setDieOnError($value){ - $this->dieOnError = $value; - } + $this->database->CompleteTrans(); + $this->println("TRANS Completed"); + } + +/* ADODB converted + * function checkError($msg='', $dieOnError=false) + * { + * if($this->dbType == "mysql") + * { + * if (mysql_errno()) + * { + * if($this->dieOnError || $dieOnError) + * { + * $this->log->fatal("MySQL error ".mysql_errno().": ".mysql_error()); + * die ($msg."MySQL error ".mysql_errno().": ".mysql_error()); + * } else { + * $this->log->error("MySQL error ".mysql_errno().": ".mysql_error()); + * } + * return true; + * } + * return false; + * } + * else + * { + * if(!isset($this->database)) + * { + * $this->log->error("Database Is Not Connected"); + * return true; + * } + * if(DB::isError($this->database)) + * { + * if($this->dieOnError || $dieOnError) + * { + * $this->log->fatal($msg.$this->database->getMessage()); + * die ($msg.$this->database->getMessage()); + * } else { + * $this->log->error($msg.$this->database->getMessage()); + * } + * return true; + * } + * } + * return false; + * } + */ + + function checkError($msg='', $dieOnError=false) + { +/* + * if($this->database->ErrorNo()) + * { + * if($this->dieOnError || $dieOnError) + * { + * $this->println("ADODB error ".$this->database->ErrorNo()); + * die ($msg."ADODB error ".$this->database->ErrorNo()); + * } else { + * $this->log->error("MySQL error ".mysql_errno().": ".mysql_error()); + * } + * return true; + * } + */ - function setDatabaseType($type){ - $this->dbType = $type; - } + if($this->dieOnError || $dieOnError) + { + $this->println("ADODB error ".$msg."->[".$this->database->ErrorNo()."]".$this->database->ErrorMsg()); + die ($msg."ADODB error ".$msg."->".$this->database->ErrorMsg()); + } + else + { + $this->println("ADODB error ".$msg."->[".$this->database->ErrorNo()."]".$this->database->ErrorMsg()); + } + return false; + } + + function change_key_case($arr) + { + return is_array($arr)?array_change_key_case($arr):$arr; + } + + var $req_flist; + + /** + * @return void + * @desc checks if a connection exists if it does not it closes the connection + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function checkConnection(){ + global $log; + + if(!isset($this->database)) + { + $this->println("TRANS creating new connection"); +/* + * $flist=get_included_files(); + * foreach($flist as $key=>$value) + * { + * if(!strstr($value,'\\modules') && !strstr($value,'\\data')) + * unset($flist[$key]); + * } + * $this->println($flist); + */ + $this->connect(false); + } + else + { + //$this->println("checkconnect using old connection"); + } + } + +/* ADODB converted + * function query($sql, $dieOnError=false, $msg='') + * { + * $this->println("query ".$sql); + * $this->log->info('Query:' . $sql); + * $this->checkConnection(); + * $this->query_time = microtime(); + * if($this->dbType == "mysql") + * { + * $result =& mysql_query($sql); + * $this->lastmysqlrow = -1; + * } else { + * $result =& $this->database->query($sql); + * } + * $this->query_time = microtime() - $this->query_time; + * $this->log->info('Query Execution Time:'.$this->query_time); + * $this->checkError($msg.' Query Failed:' . $sql . '::', $dieOnError); + * return $result; + * } + */ + + function query($sql, $dieOnError=false, $msg='') + { + global $log; + //$this->println("ADODB query ".$sql); + $log->debug('query being executed : '.$sql); + $this->checkConnection(); + $result = & $this->database->Execute($sql); + $this->lastmysqlrow = -1; + if(!$result)$this->checkError($msg.' Query Failed:' . $sql . '::', $dieOnError); + return $result; + } + + function getEmptyBlob() + { + //if(dbType=="oci8") return 'empty_blob()'; + //else return 'null'; + return 'null'; + } + + function updateBlob($tablename, $colname, $id, $data) + { + $this->println("updateBlob t=".$tablename." c=".$colname." id=".$id); + $this->checkConnection(); + $result = $this->database->UpdateBlob($tablename, $colname, $data, $id); + $this->println("updateBlob t=".$tablename." c=".$colname." id=".$id." status=".$result); + return $result; + } + + function updateBlobFile($tablename, $colname, $id, $filename) + { + $this->println("updateBlobFile t=".$tablename." c=".$colname." id=".$id." f=".$filename); + $this->checkConnection(); + $result = $this->database->UpdateBlobFile($tablename, $colname, $filename, $id); + $this->println("updateBlobFile t=".$tablename." c=".$colname." id=".$id." f=".$filename." status=".$result); + return $result; + } + +/* ADODB converted + * function limitQuery($sql,$start,$count, $dieOnError=false, $msg='') + * { + * if($this->dbType == "mysql") + * return $this->query("$sql LIMIT $start,$count", $dieOnError, $msg); + * $this->log->info('Limit Query:' . $sql. ' Start: ' .$start . ' count: ' . $count); + * $this->lastsql = $sql; + * + * $this->checkConnection(); + * $this->query_time = microtime(); + * $result =& $this->database->limitQuery($sql,$start, $count); + * $this->query_time = microtime() - $this->query_time; + * $this->log->info('Query Execution Time:'.$this->query_time); + * $this->checkError($msg.' Query Failed:' . $sql . '::', $dieOnError); + * return $result; + * } + */ + + function limitQuery($sql,$start,$count, $dieOnError=false, $msg='') + { + global $log; + //$this->println("ADODB limitQuery sql=".$sql." st=".$start." co=".$count); + $log->debug(' limitQuery sql = '.$sql .' st = '.$start .' co = '.$count); + $this->checkConnection(); + $result =& $this->database->SelectLimit($sql,$count,$start); + if(!$result) $this->checkError($msg.' Limit Query Failed:' . $sql . '::', $dieOnError); + return $result; + } + +/* ADODB converted + * function getOne($sql, $dieOnError=false, $msg='') + * { + * $this->log->info('Get One:' . $sql); + * $this->checkConnection(); + * if($this->dbType == "mysql"){ + * $queryresult =& $this->query($sql, $dieOnError, $msg); + * $result =& mysql_result($queryresult,0); + * } else { + * $result =& $this->database->getOne($sql); + * } + * $this->checkError($msg.' Get One Failed:' . $sql . '::', $dieOnError); + * return $result; + * } + */ + + function getOne($sql, $dieOnError=false, $msg='') + { + $this->println("ADODB getOne sql=".$sql); + $this->checkConnection(); + $result =& $this->database->GetOne($sql); + if(!$result) $this->checkError($msg.' Get one Query Failed:' . $sql . '::', $dieOnError); + return $result; + } + +/* ADODB converted + * function getFieldsArray(&$result) + * { + * $field_array = array(); + * + * if(! isset($result) || empty($result)) + * { + * return 0; + * } + * + * if($this->dbType == "mysql") + * { + * $i = 0; + * while ($i < mysql_num_fields($result)) + * { + * $meta = mysql_fetch_field($result, $i); + * + * if (!$meta) + * { + * return 0; + * } + * + * array_push($field_array,$meta->name); + * + * $i++; + * } + * } + * else + * { + * $arr = tableInfo($result); + * foreach ($arr as $index=>$subarr) + * { + * array_push($field_array,$subarr['name']); + * } + * } + * + * return $field_array; + * } + */ + + function getFieldsArray(&$result) + { + //$this->println("ADODB getFieldsArray"); + $field_array = array(); + if(! isset($result) || empty($result)) + { + return 0; + } + + $i = 0; + $n = $result->FieldCount(); + while ($i < $n) + { + $meta = $result->FetchField($i); + if (!$meta) + { + return 0; + } + array_push($field_array,$meta->name); + $i++; + } + + //$this->println($field_array); + return $field_array; + } + +/* ADODB Converted + * function getRowCount(&$result) + * { + * if(isset($result) && !empty($result)) + * if($this->dbType == "mysql"){ + * return mysql_numrows($result); + * } else { + * return $result->numRows(); + * } + * return 0; + * } + */ + + function getRowCount(&$result){ + global $log; + //$this->println("ADODB getRowCount"); + if(isset($result) && !empty($result)) + $rows= $result->RecordCount(); + //$this->println("ADODB getRowCount rows=".$rows); + //$log->debug('getRowCount rows= '.$rows); + return $rows; + } + + /* ADODB newly added. replacement for mysql_num_rows */ + function num_rows(&$result) + { + return $this->getRowCount($result); + } + + /* ADODB newly added. replacement form mysql_num_fields */ + function num_fields(&$result) + { + return $result->FieldCount(); + } + + /* ADODB newly added. replacement for mysql_fetch_array() */ + function fetch_array(&$result) + { + if($result->EOF) + { + //$this->println("ADODB fetch_array return null"); + return NULL; + } + return $this->change_key_case($result->FetchRow()); + } + + /* ADODB newly added. replacement for mysql_result() */ + function query_result(&$result, $row, $col=0) + { + //$this->println("ADODB query_result r=".$row." c=".$col); + $result->Move($row); + $rowdata = $this->change_key_case($result->FetchRow()); + //$this->println($rowdata); + $coldata = strip_selected_tags($rowdata[$col],'script'); + //$this->println("ADODB query_result ". $coldata); + return $coldata; + } + +/* ADODB Converted + * function getAffectedRowCount(&$result) + * { + * if($this->dbType == "mysql"){ + * return mysql_affected_rows(); + * } + * else { + * return $result->affectedRows(); + * } + * return 0; + * } + */ + + function getAffectedRowCount(&$result) + { + global $log; + //$this->println("ADODB getAffectedRowCount"); + $log->debug('getAffectedRowCount'); + $rows =$this->database->Affected_Rows(); + //$this->println("ADODB getAffectedRowCount rows=".rows); + $log->debug('getAffectedRowCount rows = '.$rows); + return $rows; + } + +/* ADODB converted + * function requireSingleResult($sql, $dieOnError=false,$msg='', $encode=true){ + * $result = $this->query($sql, $dieOnError, $msg); + * + * if($this->getRowCount($result ) == 1) + * return to_html($result, $encode); + * $this->log->error('Rows Returned:'. $this->getRowCount($result) .' More than 1 row returned for '. $sql); + * return ''; + * } + */ + + function requireSingleResult($sql, $dieOnError=false,$msg='', $encode=true) + { + $result = $this->query($sql, $dieOnError, $msg); + + if($this->getRowCount($result ) == 1) + return $result; + $this->log->error('Rows Returned:'. $this->getRowCount($result) .' More than 1 row returned for '. $sql); + return ''; + } + + +/* ADODB converted + * function fetchByAssoc(&$result, $rowNum = -1, $encode=true) + * { + * if(isset($result) && $rowNum < 0) + * { + * if($this->dbType == "mysql"){ + * $row = mysql_fetch_assoc($result); + * + * if($encode&& is_array($row)) + * return array_map('to_html', $row); + * return $row; + * } + * $row = $result->fetchRow(DB_FETCHMODE_ASSOC); + * } + * if($this->dbType == "mysql"){ + * if($this->getRowCount($result) > $rowNum){ + * mysql_data_seek($result, $rowNum); + * } + * $this->lastmysqlrow = $rowNum; + * + * $row = mysql_fetch_assoc($result); + * + * if($encode&& is_array($row)) + * return array_map('to_html', $row); + * return $row; + * } + * $row = $result->fetchRow(DB_FETCHMODE_ASSOC, $rowNum); + * if($encode) + * return array_map('to_html', $row); + * return $row; + * } + */ + + function fetchByAssoc(&$result, $rowNum = -1, $encode=true) + { + //$this->println("ADODB fetchByAssoc ".$rowNum." fetch mode=".$adb->database->$ADODB_FETCH_MODE); + if($result->EOF) + { + $this->println("ADODB fetchByAssoc return null"); + return NULL; + } + if(isset($result) && $rowNum < 0) + { + $row = $this->change_key_case($result->GetRowAssoc(false)); + $result->MoveNext(); + //print_r($row); + //$this->println("ADODB fetchByAssoc r< 0 isarray r=".is_array($row)." r1=".is_array($row[1])); + //$this->println($row); + if($encode&& is_array($row)) + return array_map('to_html', $row); + //$this->println("ADODB fetchByAssoc r< 0 not array r1=".$row[1]); + return $row; + } + + //$this->println("ADODB fetchByAssoc after if ".$rowNum); - function setUserName($name){ - $this->userName = $name; - } + if($this->getRowCount($result) > $rowNum) + { + $result->Move($rowNum); + } + + $this->lastmysqlrow = $rowNum; //srini - think about this + $row = $this->change_key_case($result->GetRowAssoc(false)); + $result->MoveNext(); + //print_r($row); + $this->println($row); + + if($encode&& is_array($row)) + return array_map('to_html', $row); + return $row; + } + +/* ADODB converted + * function getNextRow(&$result, $encode=true) + * { + * if(isset($result)){ + * $row = $result->fetchRow(); + * if($encode&& is_array($row)) + * return array_map('to_html', $row); + * return $row; + * } + * return null; + * } + */ + + function getNextRow(&$result, $encode=true){ + global $log; + + //$this->println("ADODB getNextRow"); + $log->info('getNextRow'); + if(isset($result)){ + $row = $this->change_key_case($result->FetchRow()); + if($row && $encode&& is_array($row)) + return array_map('to_html', $row); + return $row; + } + return null; + } + + function fetch_row(&$result, $encode=true) + { + return $this->getNextRow($result); + } + + function field_name(&$result, $col) + { + return $result->FetchField($col); + } + + function getQueryTime(){ + return $this->query_time; + } + +/* + * function execute($stmt, $data, $dieOnError=false, $msg=''){ + * $this->log->info('Executing:'.$stmt); + * $this->checkConnection(); + * $this->query_time = microtime(); + * $prepared = $this->database->prepare($stmt); + * $result = execute($stmt, $data); + * $this->query_time = microtime() - $this->query_time; + * //$this->log->info('Query Execution Time:'.$this->query_time); + * $this->checkError('Execute Failed:' . $stmt. '::', $dieOnError); + * return $result; + * } + */ + + +/* adodb converted + * function connect($dieOnError = false){ + * $this->println("connect"); + * global $dbconfigoption; + * if($this->dbType == "mysql" && $dbconfigoption['persistent'] == true){ + * $this->database =@mysql_pconnect($this->dbHostName,$this->userName,$this->userPassword); + * @mysql_select_db($this->dbName) or die( "Unable to select database"); + * if(!$this->database){ + * $this->connection = mysql_connect($this->dbHostName,$this->userName,$this->userPassword) or die("Could not connect to server ".$this->dbHostName." as ".$this->userName.".".mysql_error()); + * if($this->connection == false && $dbconfigoption['persistent'] == true){ + * $_SESSION['administrator_error'] = "Severe Performance Degradation: Persistent Database Connections not working. Please set \$dbconfigoption['persistent'] to false in your config.php file"; + * } + * } + * } + * else $this->database = DB::connect($this->getDataSourceName(), $this->dbOptions); + * if($this->checkError('Could Not Connect:', $dieOnError)) + * $this->log->info("connected to db"); + * + * } + */ + + function connect($dieOnError = false) + { + //$this->println("ADODB connect"); + global $dbconfigoption,$dbconfig; + //$this->println("ADODB type=".$this->dbType." host=".$this->dbHostName." dbname=".$this->dbName." user=".$this->userName." password=".$this->userPassword); + +/* + * $driver='mysql'; + * $server='srinivasan'; + * $user='root'; + * $password=''; + * $database='vtigercrm3_2'; + * + * $this->database = ADONewConnection($driver); + * + * #$this->database->debug = true; + * $this->println("ADODB status=".$this->database->PConnect($server, $user, $password, $database)); + */ + +/* + * $this->dbHostName="srinivasan:1521"; + * $this->userName="vt4"; + * $this->userPassword="vt4"; + * $this->dbName="srini"; + * $this->dbType="oci8"; + */ - function setOption($name, $value){ - if(isset($this->dbOptions)) - $this->dbOptions[$name] = $value; - if(isset($this->database)) - $this->database->setOption($name, $value); - } + if(!isset($this->dbType)) + { + $this->println("ADODB Connect : DBType not specified"); + return; + } - function setUserPassword($pass){ - $this->userPassword = $pass; - } + $this->database = ADONewConnection($this->dbType); + //$this->database->debug = true; - function setDatabaseName($db){ - $this->dbName = $db; - } - - function setDatabaseHost($host){ - $this->dbHostName = $host; - } - - function getDataSourceName(){ - return $this->dbType. "://".$this->userName.":".$this->userPassword."@". $this->dbHostName . "/". $this->dbName; - } - - function startTransaction() - { - //$this->println("TRANS Started"); - $this->checkConnection(); - $this->database->StartTrans(); - } - - function completeTransaction() - { - if($this->database->HasFailedTrans()) - $this->println("TRANS Rolled Back"); - else - $this->println("TRANS Commited"); - - $this->database->CompleteTrans(); - $this->println("TRANS Completed"); - } - - /* ADODB converted - function checkError($msg='', $dieOnError=false){ - if($this->dbType == "mysql"){ - if (mysql_errno()){ - if($this->dieOnError || $dieOnError){ - $this->log->fatal("MySQL error ".mysql_errno().": ".mysql_error()); - die ($msg."MySQL error ".mysql_errno().": ".mysql_error()); - - }else{ - $this->log->error("MySQL error ".mysql_errno().": ".mysql_error()); - } - return true; - } - return false; - } - else{ - if(!isset($this->database)){ - $this->log->error("Database Is Not Connected"); - return true; - } - if(DB::isError($this->database)){ - - if($this->dieOnError || $dieOnError){ - $this->log->fatal($msg.$this->database->getMessage()); - die ($msg.$this->database->getMessage()); - }else{ - $this->log->error($msg.$this->database->getMessage()); - } - return true; - } - }return false; - - } - */ - - function checkError($msg='', $dieOnError=false) - { - /*if($this->database->ErrorNo()) - { - if($this->dieOnError || $dieOnError) - { - $this->println("ADODB error ".$this->database->ErrorNo()); - die ($msg."ADODB error ".$this->database->ErrorNo()); - - }else{ - $this->log->error("MySQL error ".mysql_errno().": ".mysql_error()); - } - return true; - }*/ - - if($this->dieOnError || $dieOnError) - { - $this->println("ADODB error ".$msg."->[".$this->database->ErrorNo()."]".$this->database->ErrorMsg()); - die ($msg."ADODB error ".$msg."->".$this->database->ErrorMsg()); - } - else - { - $this->println("ADODB error ".$msg."->[".$this->database->ErrorNo()."]".$this->database->ErrorMsg()); - - } - return false; - } - - function change_key_case($arr) - { - return is_array($arr)?array_change_key_case($arr):$arr; - } - - var $req_flist; - - - /** - * @return void - * @desc checks if a connection exists if it does not it closes the connection - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function checkConnection(){ -global $log; - if(!isset($this->database)) - { - $this->println("TRANS creating new connection"); - /*$flist=get_included_files(); - foreach($flist as $key=>$value) - { - if(!strstr($value,'\\modules') && !strstr($value,'\\data')) - unset($flist[$key]); - - } - $this->println($flist);*/ - $this->connect(false); - } - else - { - // $this->println("checkconnect using old connection"); - /*** Delibrately commented as per Richie's advice(printed frequently)***/ - // $log->debug('checkconnect using old connection'); - } - } - - /* ADODB converted - function query($sql, $dieOnError=false, $msg=''){ - $this->println("query ".$sql); - $this->log->info('Query:' . $sql); - $this->checkConnection(); - $this->query_time = microtime(); - if($this->dbType == "mysql"){ - $result =& mysql_query($sql); - $this->lastmysqlrow = -1; - }else{ - $result =& $this->database->query($sql); - } - $this->query_time = microtime() - $this->query_time; - $this->log->info('Query Execution Time:'.$this->query_time); - $this->checkError($msg.' Query Failed:' . $sql . '::', $dieOnError); - return $result; - } - */ - - function query($sql, $dieOnError=false, $msg='') - { - global $log; - //$this->println("ADODB query ".$sql); - $log->debug('query being executed : '.$sql); - $this->checkConnection(); - $result = & $this->database->Execute($sql); - $this->lastmysqlrow = -1; - if(!$result)$this->checkError($msg.' Query Failed:' . $sql . '::', $dieOnError); - return $result; - } - - - function getEmptyBlob() - { - //if(dbType=="oci8") return 'empty_blob()'; - //else return 'null'; - return 'null'; - } - - function updateBlob($tablename, $colname, $id, $data) - { - $this->println("updateBlob t=".$tablename." c=".$colname." id=".$id); - $this->checkConnection(); - $result = $this->database->UpdateBlob($tablename, $colname, $data, $id); - $this->println("updateBlob t=".$tablename." c=".$colname." id=".$id." status=".$result); - return $result; - } - - function updateBlobFile($tablename, $colname, $id, $filename) - { - $this->println("updateBlobFile t=".$tablename." c=".$colname." id=".$id." f=".$filename); - $this->checkConnection(); - $result = $this->database->UpdateBlobFile($tablename, $colname, $filename, $id); - $this->println("updateBlobFile t=".$tablename." c=".$colname." id=".$id." f=".$filename." status=".$result); - return $result; - } - - /* ADODB converted - function limitQuery($sql,$start,$count, $dieOnError=false, $msg=''){ - if($this->dbType == "mysql") - return $this->query("$sql LIMIT $start,$count", $dieOnError, $msg); - $this->log->info('Limit Query:' . $sql. ' Start: ' .$start . ' count: ' . $count); - $this->lastsql = $sql; - - $this->checkConnection(); - $this->query_time = microtime(); - $result =& $this->database->limitQuery($sql,$start, $count); - $this->query_time = microtime() - $this->query_time; - $this->log->info('Query Execution Time:'.$this->query_time); - $this->checkError($msg.' Query Failed:' . $sql . '::', $dieOnError); - return $result; - } - */ - - function limitQuery($sql,$start,$count, $dieOnError=false, $msg='') - { - global $log; - //$this->println("ADODB limitQuery sql=".$sql." st=".$start." co=".$count); - $log->debug(' limitQuery sql = '.$sql .' st = '.$start .' co = '.$count); - $this->checkConnection(); - $result =& $this->database->SelectLimit($sql,$count,$start); - if(!$result) $this->checkError($msg.' Limit Query Failed:' . $sql . '::', $dieOnError); - return $result; - } - - /* ADODB converted - function getOne($sql, $dieOnError=false, $msg=''){ - $this->log->info('Get One:' . $sql); - $this->checkConnection(); - if($this->dbType == "mysql"){ - $queryresult =& $this->query($sql, $dieOnError, $msg); - $result =& mysql_result($queryresult,0); - }else{ - $result =& $this->database->getOne($sql); - } - $this->checkError($msg.' Get One Failed:' . $sql . '::', $dieOnError); - return $result; - } - */ - - function getOne($sql, $dieOnError=false, $msg='') - { - $this->println("ADODB getOne sql=".$sql); - $this->checkConnection(); - $result =& $this->database->GetOne($sql); - if(!$result) $this->checkError($msg.' Get one Query Failed:' . $sql . '::', $dieOnError); - return $result; - } - - /* ADODB converted - function getFieldsArray(&$result) - { - $field_array = array(); - - if(! isset($result) || empty($result)) - { - return 0; - } - - if($this->dbType == "mysql") - { - $i = 0; - while ($i < mysql_num_fields($result)) - { - $meta = mysql_fetch_field($result, $i); - - if (!$meta) - { - return 0; - } - - array_push($field_array,$meta->name); - - $i++; - } - } - else - { - $arr = tableInfo($result); - foreach ($arr as $index=>$subarr) - { - array_push($field_array,$subarr['name']); - } - - } - - return $field_array; - - } - */ - - function getFieldsArray(&$result) - { - //$this->println("ADODB getFieldsArray"); - $field_array = array(); - if(! isset($result) || empty($result)) - { - return 0; - } - - $i = 0; - $n = $result->FieldCount(); - while ($i < $n) - { - $meta = $result->FetchField($i); - if (!$meta) - { - return 0; - } - array_push($field_array,$meta->name); - $i++; - } - - //$this->println($field_array); - return $field_array; - } - - /* ADODB Converted - function getRowCount(&$result){ - if(isset($result) && !empty($result)) - if($this->dbType == "mysql"){ - return mysql_numrows($result); - }else{ - return $result->numRows(); - } - return 0; - - } - */ - - function getRowCount(&$result){ - global $log; - //$this->println("ADODB getRowCount"); - if(isset($result) && !empty($result)) - $rows= $result->RecordCount(); - //$this->println("ADODB getRowCount rows=".$rows); - //$log->debug('getRowCount rows= '.$rows); - return $rows; - } - - /* ADODB newly added. replacement for mysql_num_rows */ - - function num_rows(&$result) - { - return $this->getRowCount($result); - } - - /* ADODB newly added. replacement form mysql_num_fields */ - - function num_fields(&$result) - { - return $result->FieldCount(); - } - - /* ADODB newly added. replacement for mysql_fetch_array() */ - - function fetch_array(&$result) - { - if($result->EOF) - { - //$this->println("ADODB fetch_array return null"); - return NULL; - } - return $this->change_key_case($result->FetchRow()); - } - - /* ADODB newly added. replacement for mysql_result() */ - - function query_result(&$result, $row, $col=0) - { - //$this->println("ADODB query_result r=".$row." c=".$col); - $result->Move($row); - $rowdata = $this->change_key_case($result->FetchRow()); - //$this->println($rowdata); - $coldata = strip_selected_tags($rowdata[$col],'script'); - //$this->println("ADODB query_result ". $coldata); - return $coldata; - } - - - /* ADODB Converted - function getAffectedRowCount(&$result){ - if($this->dbType == "mysql"){ - return mysql_affected_rows(); - } - else { - return $result->affectedRows(); - } - return 0; - - }*/ - - function getAffectedRowCount(&$result){ - global $log; -// $this->println("ADODB getAffectedRowCount"); - $log->debug('getAffectedRowCount'); - $rows =$this->database->Affected_Rows(); - // $this->println("ADODB getAffectedRowCount rows=".rows); - $log->debug('getAffectedRowCount rows = '.$rows); - return $rows; - } - - - - /* ADODB converted - function requireSingleResult($sql, $dieOnError=false,$msg='', $encode=true){ - $result = $this->query($sql, $dieOnError, $msg); - - if($this->getRowCount($result ) == 1) - return to_html($result, $encode); - $this->log->error('Rows Returned:'. $this->getRowCount($result) .' More than 1 row returned for '. $sql); - return ''; - }*/ - - function requireSingleResult($sql, $dieOnError=false,$msg='', $encode=true){ - $result = $this->query($sql, $dieOnError, $msg); - - /*$row = $this->change_key_case($result->GetRowAssoc(false)); - $this->println("rsr "); - $this->println($row);*/ - if($this->getRowCount($result ) == 1) - //return to_html($result, $encode); // srini - just think $result compatability - return $result; - $this->log->error('Rows Returned:'. $this->getRowCount($result) .' More than 1 row returned for '. $sql); - return ''; - } - - - /* ADODB converted - function fetchByAssoc(&$result, $rowNum = -1, $encode=true){ - if(isset($result) && $rowNum < 0){ - if($this->dbType == "mysql"){ - $row = mysql_fetch_assoc($result); - - if($encode&& is_array($row))return array_map('to_html', $row); - return $row; - } - $row = $result->fetchRow(DB_FETCHMODE_ASSOC); - } - if($this->dbType == "mysql"){ - if($this->getRowCount($result) > $rowNum){ - - mysql_data_seek($result, $rowNum); - } - $this->lastmysqlrow = $rowNum; - - $row = mysql_fetch_assoc($result); - - if($encode&& is_array($row))return array_map('to_html', $row); - return $row; - - } - $row = $result->fetchRow(DB_FETCHMODE_ASSOC, $rowNum); - if($encode)return array_map('to_html', $row); - return $row; - } - */ - - function fetchByAssoc(&$result, $rowNum = -1, $encode=true){ - //$this->println("ADODB fetchByAssoc ".$rowNum." fetch mode=".$adb->database->$ADODB_FETCH_MODE); - if($result->EOF) - { - $this->println("ADODB fetchByAssoc return null"); - return NULL; - } - if(isset($result) && $rowNum < 0) - { - $row = $this->change_key_case($result->GetRowAssoc(false)); - $result->MoveNext(); - //print_r($row); - //$this->println("ADODB fetchByAssoc r< 0 isarray r=".is_array($row)." r1=".is_array($row[1])); - //$this->println($row); - if($encode&& is_array($row)) - return array_map('to_html', $row); - //$this->println("ADODB fetchByAssoc r< 0 not array r1=".$row[1]); - return $row; - } - - //$this->println("ADODB fetchByAssoc after if ".$rowNum); - - if($this->getRowCount($result) > $rowNum) - { - $result->Move($rowNum); - } - - $this->lastmysqlrow = $rowNum; //srini - think about this - $row = $this->change_key_case($result->GetRowAssoc(false)); - $result->MoveNext(); - //print_r($row); - $this->println($row); - - if($encode&& is_array($row))return array_map('to_html', $row); - return $row; - } - - /* ADODB converted - function getNextRow(&$result, $encode=true){ - if(isset($result)){ - $row = $result->fetchRow(); - if($encode&& is_array($row))return array_map('to_html', $row); - return $row; - - } - return null; - } - */ - - function getNextRow(&$result, $encode=true){ - global $log; - - //$this->println("ADODB getNextRow"); - $log->info('getNextRow'); - if(isset($result)){ - $row = $this->change_key_case($result->FetchRow()); - if($row && $encode&& is_array($row))return array_map('to_html', $row); - return $row; - - } - return null; - } - - function fetch_row(&$result, $encode=true) - { - return $this->getNextRow($result); - } - - function field_name(&$result, $col) - { - return $result->FetchField($col); - } - - function getQueryTime(){ - return $this->query_time; - } - /*function execute($stmt, $data, $dieOnError=false, $msg=''){ - $this->log->info('Executing:'.$stmt); - $this->checkConnection(); - $this->query_time = microtime(); - $prepared = $this->database->prepare($stmt); - $result = execute($stmt, $data); - $this->query_time = microtime() - $this->query_time; - //$this->log->info('Query Execution Time:'.$this->query_time); - $this->checkError('Execute Failed:' . $stmt. '::', $dieOnError); - return $result; - }*/ - - - /* adodb converted - function connect($dieOnError = false){ - $this->println("connect"); - global $dbconfigoption; - if($this->dbType == "mysql" && $dbconfigoption['persistent'] == true){ - $this->database =@mysql_pconnect($this->dbHostName,$this->userName,$this->userPassword); - @mysql_select_db($this->dbName) or die( "Unable to select database"); - if(!$this->database){ - $this->connection = mysql_connect($this->dbHostName,$this->userName,$this->userPassword) or die("Could not connect to server ".$this->dbHostName." as ".$this->userName.".".mysql_error()); - if($this->connection == false && $dbconfigoption['persistent'] == true){ - $_SESSION['administrator_error'] = "Severe Performance Degradation: Persistent Database Connections not working. Please set \$dbconfigoption['persistent'] to false in your config.php file"; - } - } - } - else $this->database = DB::connect($this->getDataSourceName(), $this->dbOptions); - if($this->checkError('Could Not Connect:', $dieOnError)) - $this->log->info("connected to db"); - - }*/ - - function connect($dieOnError = false) - { - //$this->println("ADODB connect"); - global $dbconfigoption,$dbconfig; - //$this->println("ADODB type=".$this->dbType." host=".$this->dbHostName." dbname=".$this->dbName." user=".$this->userName." password=".$this->userPassword); - - /*$driver='mysql'; - $server='srinivasan'; - $user='root'; - $password=''; - $database='vtigercrm3_2'; - - $this->database = ADONewConnection($driver); - - #$this->database->debug = true; - $this->println("ADODB status=".$this->database->PConnect($server, $user, $password, $database));*/ - - /*$this->dbHostName="srinivasan:1521"; - $this->userName="vt4"; - $this->userPassword="vt4"; - $this->dbName="srini"; - $this->dbType="oci8";*/ - - if(!isset($this->dbType)) - { - $this->println("ADODB Connect : DBType not specified"); - return; - } - - $this->database = ADONewConnection($this->dbType); - //$this->database->debug = true; - - $this->database->PConnect($this->dbHostName, $this->userName, $this->userPassword, $this->dbName); - $this->database->LogSQL($this->enableSQLlog); - //$this->database->SetFetchMode(ADODB_FETCH_ASSOC); - //$this->println("ADODB type=".$this->dbType." host=".$this->dbHostName." dbname=".$this->dbName." user=".$this->userName." password=".$this->userPassword); - - } + $this->database->PConnect($this->dbHostName, $this->userName, $this->userPassword, $this->dbName); + $this->database->LogSQL($this->enableSQLlog); + //$this->database->SetFetchMode(ADODB_FETCH_ASSOC); + //$this->println("ADODB type=".$this->dbType." host=".$this->dbHostName." dbname=".$this->dbName." user=".$this->userName." password=".$this->userPassword); + } + /* - function PearDatabase(){ - //$this->println("PearDatabase"); - global $currentModule; - $this->log =& LoggerManager::getLogger('PearDatabase_'. $currentModule); - $this->resetSettings(); - - - } - function resetSettings(){ - global $dbconfig, $dbconfigoption; - $this->disconnect(); - $this->setDatabaseType($dbconfig['db_type']); - $this->setUserName($dbconfig['db_username']); - $this->setUserPassword($dbconfig['db_password']); - $this->setDatabaseHost( $dbconfig['db_hostname']); - $this->setDatabaseName($dbconfig['db_name']); - $this->dbOptions = $dbconfigoption; - $this->enableSQLlog = ($dbconfig['log_sql'] == true); - //$this->println("resetSettings log=".$this->enableSQLlog); - //$this->println($dbconfig); - /*if($this->dbType != "mysql"){ - require_once( 'DB.php' ); - }*/ - - - - function PearDatabase($dbtype='',$host='',$dbname='',$username='',$passwd=''){ - //$this->println("PearDatabase"); - global $currentModule; - $this->log =& LoggerManager::getLogger('PearDatabase_'. $currentModule); - $this->resetSettings($dbtype,$host,$dbname,$username,$passwd); - - - } - - + * function PearDatabase(){ + * //$this->println("PearDatabase"); + * global $currentModule; + * $this->log =& LoggerManager::getLogger('PearDatabase_'. $currentModule); + * $this->resetSettings(); + * } + * + * function resetSettings(){ + * global $dbconfig, $dbconfigoption; + * $this->disconnect(); + * $this->setDatabaseType($dbconfig['db_type']); + * $this->setUserName($dbconfig['db_username']); + * $this->setUserPassword($dbconfig['db_password']); + * $this->setDatabaseHost( $dbconfig['db_hostname']); + * $this->setDatabaseName($dbconfig['db_name']); + * $this->dbOptions = $dbconfigoption; + * $this->enableSQLlog = ($dbconfig['log_sql'] == true); + * //$this->println("resetSettings log=".$this->enableSQLlog); + * //$this->println($dbconfig); + * //if($this->dbType != "mysql"){ + * // require_once( 'DB.php' ); + * //} + * } + */ + + function PearDatabase($dbtype='',$host='',$dbname='',$username='',$passwd='') + { + //$this->println("PearDatabase"); + global $currentModule; + $this->log =& LoggerManager::getLogger('PearDatabase_'. $currentModule); + $this->resetSettings($dbtype,$host,$dbname,$username,$passwd); + } + function resetSettings($dbtype,$host,$dbname,$username,$passwd) { - - global $dbconfig, $dbconfigoption; - - if($host == '') - { - $this->disconnect(); - $this->setDatabaseType($dbconfig['db_type']); - $this->setUserName($dbconfig['db_username']); - $this->setUserPassword($dbconfig['db_password']); - $this->setDatabaseHost( $dbconfig['db_hostname']); - $this->setDatabaseName($dbconfig['db_name']); - $this->dbOptions = $dbconfigoption; + global $dbconfig, $dbconfigoption; + + if($host == '') + { + $this->disconnect(); + $this->setDatabaseType($dbconfig['db_type']); + $this->setUserName($dbconfig['db_username']); + $this->setUserPassword($dbconfig['db_password']); + $this->setDatabaseHost( $dbconfig['db_hostname']); + $this->setDatabaseName($dbconfig['db_name']); + $this->dbOptions = $dbconfigoption; if($dbconfig['log_sql']) - $this->enableSQLlog = ($dbconfig['log_sql'] == true); - //$this->println("resetSettings log=".$this->enableSQLlog); - //$this->println($dbconfig); - /*if($this->dbType != "mysql"){ - require_once( 'DB.php' ); - }*/ - } - else - { - - $this->disconnect(); - $this->setDatabaseType($dbtype); - $this->setDatabaseName($dbname); - $this->setUserName($username); - $this->setUserPassword($passwd); - $this->setDatabaseHost( $host); - - } -} - -function quote($string){ + $this->enableSQLlog = ($dbconfig['log_sql'] == true); + //$this->println("resetSettings log=".$this->enableSQLlog); + //$this->println($dbconfig); + /*if($this->dbType != "mysql"){ + require_once( 'DB.php' ); + }*/ + } + else + { + $this->disconnect(); + $this->setDatabaseType($dbtype); + $this->setDatabaseName($dbname); + $this->setUserName($username); + $this->setUserPassword($passwd); + $this->setDatabaseHost( $host); + } + } + + function quote($string){ return $this->database->qstr($string); -} + } /* ADODB converted -function disconnect() { - $this->println("disconnect"); - if(isset($this->database)){ - if($this->dbType == "mysql"){ - mysql_close($this->database); - }else{ - $this->database->disconnect(); - } - unset($this->database); - } - -} -*/ - -function disconnect() { - //$this->println("ADODB disconnect"); - - // srini -- do something - -} - -function setDebug($value) -{ + * function disconnect() { + * $this->println("disconnect"); + * if(isset($this->database)){ + * if($this->dbType == "mysql"){ + * mysql_close($this->database); + * } else { + * $this->database->disconnect(); + * } + * unset($this->database); + * } + * } + */ + + function disconnect() { + $this->println("ADODB disconnect"); + if(isset($this->database)){ + if($this->dbType == "mysql"){ + mysql_close($this->database); + } else { + $this->database->disconnect(); + } + unset($this->database); + } + } + + function setDebug($value) + { $this->database->debug = $value; -} - - -// ADODB newly added methods - - -function createTables($schemaFile, $dbHostName=false, $userName=false, $userPassword=false, $dbName=false, $dbType=false) -{ + } + + + // ADODB newly added methods + function createTables($schemaFile, $dbHostName=false, $userName=false, $userPassword=false, $dbName=false, $dbType=false) + { $this->println("ADODB createTables ".$schemaFile); if($dbHostName!=false) $this->dbHostName=$dbHostName; if($userName!=false) $this->userName=$userPassword; @@ -791,7 +800,6 @@ $this->checkConnection(); $db = $this->database; //$db->debug = true; - //$this->println("ADODB createTables connect status=".$db->Connect($this->dbHostName, $this->userName, $this->userPassword, $this->dbName)); $schema = new adoSchema( $db ); @@ -811,10 +819,10 @@ // needs to return in a decent way $this->println("ADODB createTables ".$schemaFile." status=".$result); return $result; -} - -function createTable($tablename, $flds) -{ + } + + function createTable($tablename, $flds) + { $this->println("ADODB createTable table=".$tablename." flds=".$flds); $this->checkConnection(); //$dict = NewDataDictionary(ADONewConnection($this->dbType)); @@ -823,10 +831,10 @@ $result = $dict->ExecuteSQLArray($sqlarray); $this->println("ADODB createTable table=".$tablename." flds=".$flds." status=".$result); return $result; -} - -function alterTable($tablename, $flds, $oper) -{ + } + + function alterTable($tablename, $flds, $oper) + { $this->println("ADODB alterTableTable table=".$tablename." flds=".$flds." oper=".$oper); //$dict = NewDataDictionary(ADONewConnection($this->dbType)); $this->checkConnection(); @@ -835,11 +843,11 @@ if($oper == 'Add_Column') { - $sqlarray = $dict->AddColumnSQL($tablename, $flds); + $sqlarray = $dict->AddColumnSQL($tablename, $flds); } else if($oper == 'Delete_Column') { - $sqlarray = $dict->DropColumnSQL($tablename, $flds); + $sqlarray = $dict->DropColumnSQL($tablename, $flds); } $this->println("sqlarray"); @@ -850,10 +858,10 @@ $this->println("ADODB alterTableTable table=".$tablename." flds=".$flds." oper=".$oper." status=".$result); return $result; -} - -function getColumnNames($tablename) -{ + } + + function getColumnNames($tablename) + { $this->println("ADODB getColumnNames table=".$tablename); $this->checkConnection(); $adoflds = $this->database->MetaColumns($tablename); @@ -861,83 +869,79 @@ $i=0; foreach($adoflds as $fld) { - $colNames[$i] = $fld->name; - $i++; + $colNames[$i] = $fld->name; + $i++; } return $colNames; -} - -function formatString($tablename,$fldname, $str) -{ + } + + function formatString($tablename,$fldname, $str) + { //$this->println("ADODB formatString table=".$tablename." fldname=".$fldname." str=".$str); $this->checkConnection(); $adoflds = $this->database->MetaColumns($tablename); foreach ( $adoflds as $fld ) { - //$this->println("ADODB formatString adofld =".$fld->name); - if(strcasecmp($fld->name,$fldname)==0) + //$this->println("ADODB formatString adofld =".$fld->name); + if(strcasecmp($fld->name,$fldname)==0) + { + //$this->println("ADODB formatString fldname=".$fldname." fldtype =".$fld->type); + + $fldtype =strtoupper($fld->type); + if(strcmp($fldtype,'CHAR')==0 || strcmp($fldtype,'VARCHAR') == 0 || strcmp($fldtype,'VARCHAR2') == 0 || strcmp($fldtype,'LONGTEXT')==0 || strcmp($fldtype,'TEXT')==0) { - //$this->println("ADODB formatString fldname=".$fldname." fldtype =".$fld->type); - - $fldtype =strtoupper($fld->type); - if(strcmp($fldtype,'CHAR')==0 || strcmp($fldtype,'VARCHAR') == 0 || strcmp($fldtype,'VARCHAR2') == 0 || strcmp($fldtype,'LONGTEXT')==0 || strcmp($fldtype,'TEXT')==0) - { - return $this->database->Quote($str); - //$this->println("ADODB return else normal"); - - } - else if(strcmp($fldtype,'DATE') ==0 || strcmp($fldtype,'TIMESTAMP')==0) - { - return $this->formatDate($str); - } - else - { - return $str; - } + //$this->println("ADODB return else normal"); + return $this->database->Quote($str); } + else if(strcmp($fldtype,'DATE') ==0 || strcmp($fldtype,'TIMESTAMP')==0) + { + return $this->formatDate($str); + } + else + { + return $str; + } + } } $this->println("format String Illegal field name ".$fldname); return $str; -} - -function formatDate($datetime) -{ + } + + function formatDate($datetime) + { $this->checkConnection(); //$db = ADONewConnection($this->dbType); $db = &$this->database; $date = $db->DBTimeStamp($datetime); //if($db->dbType=='mysql') return $this->quote($date); return $date; -} - -function getDBDateString($datecolname) -{ + } + + function getDBDateString($datecolname) + { $this->checkConnection(); $db = &$this->database; $datestr = $db->SQLDate("Y-m-d, H:i:s" ,$datecolname); return $datestr; -} - -function getUniqueID($seqname) -{ + } + + function getUniqueID($seqname) + { $this->checkConnection(); return $this->database->GenID($seqname."_seq",1); -} -function get_tables() -{ - $this->checkConnection(); - $result = & $this->database->MetaTables('TABLES'); - $this->println($result); - return $result; -} - - -} + } + function get_tables() + { + $this->checkConnection(); + $result = & $this->database->MetaTables('TABLES'); + $this->println($result); + return $result; + } +} /* End of class */ $adb = new PearDatabase(); $adb->connect(); - //$adb->database->setFetchMode(ADODB_FETCH_NUM); From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 14:44:31 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 18:44:31 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9149 - /vtigercrm/trunk/include/utils/CommonUtils.php Message-ID: <20060828184431.BFD25708216@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 12:44:24 2006 New Revision: 9149 Log: Support for PostGres DB done Modified: vtigercrm/trunk/include/utils/CommonUtils.php Modified: vtigercrm/trunk/include/utils/CommonUtils.php ============================================================================== --- vtigercrm/trunk/include/utils/CommonUtils.php (original) +++ vtigercrm/trunk/include/utils/CommonUtils.php Mon Aug 28 12:44:24 2006 @@ -960,14 +960,17 @@ if($disp_view == "detail_view") { if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0 || $module == "Users") - { - $sql = "select vtiger_field.* from vtiger_field where vtiger_field.tabid=".$tabid." and vtiger_field.block in $blockid_list and vtiger_field.displaytype in (1,2,4) order by block,sequence"; - } - else - { - $profileList = getCurrentUserProfileList(); - $sql = "select vtiger_field.* from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=".$tabid." and vtiger_field.block in ".$blockid_list." and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList." group by vtiger_field.fieldid order by block,sequence"; - } + { + $sql = "SELECT vtiger_field.* FROM vtiger_field WHERE vtiger_field.tabid=".$tabid." AND vtiger_field.block IN $blockid_list AND vtiger_field.displaytype IN (1,2,4) ORDER BY block,sequence"; + } + else + { + $profileList = getCurrentUserProfileList(); + $sql = "SELECT vtiger_field.* FROM vtiger_field INNER JOIN vtiger_profile2field ON vtiger_profile2field.fieldid=vtiger_field.fieldid INNER JOIN vtiger_def_org_field ON vtiger_def_org_field.fieldid=vtiger_field.fieldid WHERE vtiger_field.tabid=".$tabid." AND vtiger_field.block IN ".$blockid_list." AND vtiger_field.displaytype IN (1,2,4) AND vtiger_profile2field.visible=0 AND vtiger_def_org_field.visible=0 AND vtiger_profile2field.profileid IN ".$profileList." GROUP BY vtiger_field.fieldid ORDER BY block,sequence"; + //Postgres 8 fixes + if( $adb->dbType == "pgsql") + $sql = fixPostgresQuery( $sql, $log, 0); + } $result = $adb->query($sql); $getBlockInfo=getDetailBlockInformation($module,$result,$col_fields,$tabid,$block_label); } @@ -976,26 +979,32 @@ if ($info_type != '') { if($is_admin==true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2]== 0 || $module == 'Users') - { - $sql = "select vtiger_field.* from vtiger_field where vtiger_field.tabid=".$tabid." and vtiger_field.block in ".$blockid_list ." and ".$display_type_check." and info_type = '".$info_type."' order by block,sequence"; - } - else - { - $profileList = getCurrentUserProfileList(); - $sql = "select vtiger_field.* from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=".$tabid." and vtiger_field.block in ".$blockid_list." and ".$display_type_check." and info_type = '".$info_type."' and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList.=" group by vtiger_field.fieldid order by block,sequence"; - } + { + $sql = "SELECT vtiger_field.* FROM vtiger_field WHERE vtiger_field.tabid=".$tabid." AND vtiger_field.block IN ".$blockid_list ." AND ".$display_type_check." AND info_type = '".$info_type."' ORDER BY block,sequence"; + } + else + { + $profileList = getCurrentUserProfileList(); + $sql = "SELECT vtiger_field.* FROM vtiger_field INNER JOIN vtiger_profile2field ON vtiger_profile2field.fieldid=vtiger_field.fieldid INNER JOIN vtiger_def_org_field ON vtiger_def_org_field.fieldid=vtiger_field.fieldid WHERE vtiger_field.tabid=".$tabid." AND vtiger_field.block IN ".$blockid_list." AND ".$display_type_check." AND info_type = '".$info_type."' AND vtiger_profile2field.visible=0 AND vtiger_def_org_field.visible=0 AND vtiger_profile2field.profileid IN ".$profileList.=" GROUP BY vtiger_field.fieldid ORDER BY block,sequence"; + //Postgres 8 fixes + if( $adb->dbType == "pgsql") + $sql = fixPostgresQuery( $sql, $log, 0); + } } else { - if($is_admin==true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0 || $module == 'Users') - { - $sql = "select vtiger_field.* from vtiger_field where vtiger_field.tabid=".$tabid." and vtiger_field.block in ".$blockid_list." and ".$display_type_check." order by block,sequence"; - } - else - { - $profileList = getCurrentUserProfileList(); - $sql = "select vtiger_field.* from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=".$tabid." and vtiger_field.block in ".$blockid_list." and ".$display_type_check." and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList.=" group by vtiger_field.fieldid order by block,sequence"; - } + if($is_admin==true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0 || $module == 'Users') + { + $sql = "SELECT vtiger_field.* FROM vtiger_field WHERE vtiger_field.tabid=".$tabid." AND vtiger_field.block IN ".$blockid_list." AND ".$display_type_check." ORDER BY block,sequence"; + } + else + { + $profileList = getCurrentUserProfileList(); + $sql = "SELECT vtiger_field.* FROM vtiger_field INNER JOIN vtiger_profile2field ON vtiger_profile2field.fieldid=vtiger_field.fieldid INNER JOIN vtiger_def_org_field ON vtiger_def_org_field.fieldid=vtiger_field.fieldid WHERE vtiger_field.tabid=".$tabid." AND vtiger_field.block IN ".$blockid_list." AND ".$display_type_check." AND vtiger_profile2field.visible=0 AND vtiger_def_org_field.visible=0 AND vtiger_profile2field.profileid IN ".$profileList.=" GROUP BY vtiger_field.fieldid ORDER BY block,sequence"; + //Postgres 8 fixes + if( $adb->dbType == "pgsql") + $sql = fixPostgresQuery( $sql, $log, 0); + } } $result = $adb->query($sql); $getBlockInfo=getBlockInformation($module,$result,$col_fields,$tabid,$block_label,$mode); @@ -1790,8 +1799,11 @@ } else { - $profileList = getCurrentUserProfileList(); - $quickcreate_query = "select vtiger_field.* from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=".$tabid." and quickcreate=0 and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList." order by quickcreatesequence"; + $profileList = getCurrentUserProfileList(); + $quickcreate_query = "SELECT vtiger_field.* FROM vtiger_field INNER JOIN vtiger_profile2field ON vtiger_profile2field.fieldid=vtiger_field.fieldid INNER JOIN vtiger_def_org_field ON vtiger_def_org_field.fieldid=vtiger_field.fieldid WHERE vtiger_field.tabid=".$tabid." AND quickcreate=0 AND vtiger_profile2field.visible=0 AND vtiger_def_org_field.visible=0 AND vtiger_profile2field.profileid IN ".$profileList." ORDER BY quickcreatesequence"; + //Postgres 8 fixes + if( $adb->dbType == "pgsql") + $quickcreate_query = fixPostgresQuery( $quickcreate_query, $log, 0); } $category = getParentTab(); From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 14:52:05 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 18:52:05 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9150 - /vtigercrm/trunk/include/utils/EditViewUtils.php Message-ID: <20060828185205.9E31D708226@vtiger.fosslabs.com> 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$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$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'] != '') From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 14:53:06 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 18:53:06 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9151 - /vtigercrm/trunk/include/utils/SearchUtils.php Message-ID: <20060828185306.1F72C70822F@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 12:52:59 2006 New Revision: 9151 Log: Support for PostGres DB done Modified: vtigercrm/trunk/include/utils/SearchUtils.php Modified: vtigercrm/trunk/include/utils/SearchUtils.php ============================================================================== --- vtigercrm/trunk/include/utils/SearchUtils.php (original) +++ vtigercrm/trunk/include/utils/SearchUtils.php Mon Aug 28 12:52:59 2006 @@ -12,6 +12,7 @@ require_once('include/database/PearDatabase.php'); +require_once('include/database/Postgres8.php'); require_once('include/ComboUtil.php'); //new require_once('include/utils/CommonUtils.php'); //new @@ -82,7 +83,9 @@ { $profileList = getCurrentUserProfileList(); //changed to get vtiger_field.fieldname - $query = "select vtiger_profile2field.*,vtiger_field.fieldname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=".$tabid." and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList." and vtiger_field.fieldname in ".$field_list." group by vtiger_field.fieldid"; + $query = "SELECT vtiger_profile2field.*,vtiger_field.fieldname FROM vtiger_field INNER JOIN vtiger_profile2field ON vtiger_profile2field.fieldid=vtiger_field.fieldid INNER JOIN vtiger_def_org_field ON vtiger_def_org_field.fieldid=vtiger_field.fieldid WHERE vtiger_field.tabid=".$tabid." AND vtiger_profile2field.visible=0 AND vtiger_def_org_field.visible=0 AND vtiger_profile2field.profileid IN ".$profileList." AND vtiger_field.fieldname IN ".$field_list." GROUP BY vtiger_field.fieldid"; + if( $adb->dbType == "pgsql") + $query = fixPostgresQuery( $query, $log, 0); $result = $adb->query($query); $field=Array(); for($k=0;$k < $adb->num_rows($result);$k++) From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 14:54:26 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 18:54:26 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9152 - /vtigercrm/trunk/include/utils/UserInfoUtil.php Message-ID: <20060828185426.E4F2F70823A@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 12:54:19 2006 New Revision: 9152 Log: Support for PostGres DB done Modified: vtigercrm/trunk/include/utils/UserInfoUtil.php Modified: vtigercrm/trunk/include/utils/UserInfoUtil.php ============================================================================== --- vtigercrm/trunk/include/utils/UserInfoUtil.php (original) +++ vtigercrm/trunk/include/utils/UserInfoUtil.php Mon Aug 28 12:54:19 2006 @@ -12,6 +12,7 @@ require_once('include/database/PearDatabase.php'); +require_once('include/database/Postgres8.php'); require_once('include/utils/utils.php'); require_once('include/utils/GetUserGroups.php'); include('config.php'); @@ -4580,7 +4581,14 @@ //get tabid $tabid = getTabid($fld_module); - $query="select vtiger_profile2field.* from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=".$tabid." and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in".$profilelist." and vtiger_field.fieldname='".$fieldname."' group by vtiger_field.fieldid"; + + $query="SELECT vtiger_profile2field.* FROM vtiger_field INNER JOIN vtiger_profile2field ON vtiger_profile2field.fieldid=vtiger_field.fieldid INNER JOIN vtiger_def_org_field ON vtiger_def_org_field.fieldid=vtiger_field.fieldid WHERE vtiger_field.tabid=".$tabid." AND vtiger_profile2field.visible=0 AND vtiger_def_org_field.visible=0 AND vtiger_profile2field.profileid in".$profilelist." AND vtiger_field.fieldname='".$fieldname."' GROUP BY vtiger_field.fieldid"; + + //Postgres 8 fixes + if( $adb->dbType == "pgsql") + $query = fixPostgresQuery( $query, $log, 0); + + $result = $adb->query($query); $log->debug("Exiting getFieldVisibilityPermission method ..."); From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 14:55:47 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 18:55:47 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9153 - /vtigercrm/trunk/include/RelatedListView.php Message-ID: <20060828185547.9AD8D70823B@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 12:55:40 2006 New Revision: 9153 Log: Support for PostGres DB done Modified: vtigercrm/trunk/include/RelatedListView.php Modified: vtigercrm/trunk/include/RelatedListView.php ============================================================================== --- vtigercrm/trunk/include/RelatedListView.php (original) +++ vtigercrm/trunk/include/RelatedListView.php Mon Aug 28 12:55:40 2006 @@ -148,7 +148,7 @@ } //Retreiving the no of rows - $count_query = "select count(*) count ".substr($query, stripos($query,'from'),strlen($query)); + $count_query = "select count(*) as count ".substr($query, stripos($query,'from'),strlen($query)); $count_result = $adb->query(substr($count_query, stripos($count_query,'select'),stripos($count_query,'ORDER BY'))); $noofrows = $adb->query_result($count_result,0,"count"); @@ -174,7 +174,10 @@ else $limit_start_rec = $start_rec -1; - $list_result = $adb->query($query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); + if( $adb->dbType == "pgsql") + $list_result = $adb->query($query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); + else + $list_result = $adb->query($query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); //Retreive the List View Table Header if($noofrows == 0) From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 15:04:54 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:04:54 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9154 - /vtigercrm/trunk/install/5createTables.inc.php Message-ID: <20060828190454.DD4FD70823E@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:04:47 2006 New Revision: 9154 Log: Support for PostGres DB done Modified: vtigercrm/trunk/install/5createTables.inc.php Modified: vtigercrm/trunk/install/5createTables.inc.php ============================================================================== --- vtigercrm/trunk/install/5createTables.inc.php (original) +++ vtigercrm/trunk/install/5createTables.inc.php Mon Aug 28 13:04:47 2006 @@ -160,6 +160,78 @@ //$adb->setDebug(true); $success = $adb->createTables("schema/DatabaseSchema.xml"); +//Postgres8 fix - create sequences. +// This should be a part of "createTables" however ... + if( $adb->dbType == "pgsql" ) { + $sequences = array( + "vtiger_leadsource_seq", + "vtiger_accounttype_seq", + "vtiger_industry_seq", + "vtiger_leadstatus_seq", + "vtiger_rating_seq", + "vtiger_licencekeystatus_seq", + "vtiger_opportunity_type_seq", + "vtiger_salutationtype_seq", + "vtiger_sales_stage_seq", + "vtiger_ticketstatus_seq", + "vtiger_ticketpriorities_seq", + "vtiger_ticketseverities_seq", + "vtiger_ticketcategories_seq", + "vtiger_duration_minutes_seq", + "vtiger_eventstatus_seq", + "vtiger_taskstatus_seq", + "vtiger_taskpriority_seq", + "vtiger_manufacturer_seq", + "vtiger_productcategory_seq", + "vtiger_activitytype_seq", + "vtiger_currency_seq", + "vtiger_faqcategories_seq", + "vtiger_usageunit_seq", + "vtiger_glacct_seq", + "vtiger_quotestage_seq", + "vtiger_carrier_seq", + "vtiger_taxclass_seq", + "vtiger_recurringtype_seq", + "vtiger_faqstatus_seq", + "vtiger_invoicestatus_seq", + "vtiger_postatus_seq", + "vtiger_sostatus_seq", + "vtiger_visibility_seq", + "vtiger_campaigntype_seq", + "vtiger_campaignstatus_seq", + "vtiger_expectedresponse_seq", + "vtiger_status_seq", + "vtiger_activity_view_seq", + "vtiger_lead_view_seq", + "vtiger_date_format_seq", + "vtiger_users_seq", + "vtiger_role_seq", + "vtiger_profile_seq", + "vtiger_field_seq", + "vtiger_def_org_share_seq", + "vtiger_datashare_relatedmodules_seq", + "vtiger_relatedlists_seq", + "vtiger_notificationscheduler_seq", + "vtiger_inventorynotification_seq", + "vtiger_currency_info_seq", + "vtiger_emailtemplates_seq", + "vtiger_inventory_tandc_seq", + "vtiger_selectquery_seq", + "vtiger_customview_seq", + "vtiger_crmentity_seq", + "vtiger_seactivityrel_seq", + "vtiger_freetags_seq", + "vtiger_shippingtaxinfo_seq", + "vtiger_inventorytaxinfo_seq" + ); + + foreach ($sequences as $sequence ) { + $log->info( "Creating sequence ".$sequence); + $adb->query( "CREATE SEQUENCE ".$sequence." INCREMENT BY 1 NO MAXVALUE NO MINVALUE CACHE 1;"); + } + } + + // TODO HTML if($success==0) die("Error: Tables not created. Table creation failed.\n"); From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 15:07:13 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:07:13 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9155 - /vtigercrm/trunk/install/4createConfigFile.php Message-ID: <20060828190713.3C182708242@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:07:06 2006 New Revision: 9155 Log: Support for PostGres DB done Modified: vtigercrm/trunk/install/4createConfigFile.php Modified: vtigercrm/trunk/install/4createConfigFile.php ============================================================================== --- vtigercrm/trunk/install/4createConfigFile.php (original) +++ vtigercrm/trunk/install/4createConfigFile.php Mon Aug 28 13:07:06 2006 @@ -47,7 +47,7 @@ $vtiger_version = "5.0 Beta"; $release_date = "31 March 2006"; - +if (isset($_REQUEST['db_type'])) $db_type = $_REQUEST['db_type']; if (isset($_REQUEST['db_hostname'])) { @@ -58,7 +58,11 @@ else { $db_hostname = $_REQUEST['db_hostname']; - $db_port = '3306'; + if($db_type == "pgsql") + $db_port = '5432'; + else + $db_port = '3306'; + } } if (isset($_REQUEST['db_username']))$db_username = $_REQUEST['db_username']; @@ -67,7 +71,7 @@ if (isset($_REQUEST['db_name']))$db_name = $_REQUEST['db_name']; -if (isset($_REQUEST['db_type'])) $db_type = $_REQUEST['db_type']; +//if (isset($_REQUEST['db_type'])) $db_type = $_REQUEST['db_type']; if (isset($_REQUEST['db_drop_tables'])) $db_drop_tables = $_REQUEST['db_drop_tables']; From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 15:09:27 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:09:27 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9157 - /vtigercrm/trunk/modules/Vendors/ListView.php Message-ID: <20060828190927.371D7708252@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:09:20 2006 New Revision: 9157 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/Vendors/ListView.php Modified: vtigercrm/trunk/modules/Vendors/ListView.php ============================================================================== --- vtigercrm/trunk/modules/Vendors/ListView.php (original) +++ vtigercrm/trunk/modules/Vendors/ListView.php Mon Aug 28 13:09:20 2006 @@ -9,11 +9,13 @@ * ********************************************************************************/ require_once('include/database/PearDatabase.php'); +require_once('include/database/Postgres8.php'); require_once('Smarty_setup.php'); require_once('modules/Vendors/Vendor.php'); require_once('include/ListView/ListView.php'); require_once('include/utils/utils.php'); require_once('modules/CustomView/CustomView.php'); +require_once('include/DatabaseUtil.php'); global $app_strings,$mod_strings,$list_max_entries_per_page,$currentModule,$theme; @@ -117,11 +119,14 @@ $tablename = getTableNameForField('Vendors',$order_by); $tablename = (($tablename != '')?($tablename."."):''); + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY '.$tablename.$order_by; + $list_query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder; } //Retreiving the no of rows -$count_result = $adb->query("select count(*) count ".substr($list_query, strpos($list_query,'FROM'),strlen($list_query))); +$count_result = $adb->query( mkCountQuery( $list_query)); $noofrows = $adb->query_result($count_result,0,"count"); //Storing Listview session object @@ -134,6 +139,10 @@ //Retreive the Navigation array $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); +//Postgres 8 fixes + if( $adb->dbType == "pgsql") + $list_query = fixPostgresQuery( $list_query, $log, 0); + // Setting the record count string //modified by rdhital $start_rec = $navigation_array['start']; @@ -146,7 +155,10 @@ else $limit_start_rec = $start_rec -1; -$list_result = $adb->query($list_query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); +if( $adb->dbType == "pgsql") + $list_result = $adb->query($list_query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); +else + $list_result = $adb->query($list_query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); $record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows; From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 15:10:48 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:10:48 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9158 - /vtigercrm/trunk/modules/Potentials/ListView.php Message-ID: <20060828191048.7990570824F@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:10:41 2006 New Revision: 9158 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/Potentials/ListView.php Modified: vtigercrm/trunk/modules/Potentials/ListView.php ============================================================================== --- vtigercrm/trunk/modules/Potentials/ListView.php (original) +++ vtigercrm/trunk/modules/Potentials/ListView.php Mon Aug 28 13:10:41 2006 @@ -22,6 +22,9 @@ require_once('include/ComboUtil.php'); require_once('include/utils/utils.php'); require_once('modules/CustomView/CustomView.php'); +require_once('include/database/Postgres8.php'); +require_once('include/DatabaseUtil.php'); + global $app_strings,$list_max_entries_per_page; @@ -144,12 +147,17 @@ { if($order_by == 'smownerid') { + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY user_name'; $list_query .= ' ORDER BY user_name '.$sorder; } else { $tablename = getTableNameForField('Potentials',$order_by); $tablename = (($tablename != '')?($tablename."."):''); + + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY '.$tablename.$order_by; $list_query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder; } @@ -170,7 +178,7 @@ //Retreiving the no of rows -$count_result = $adb->query("select count(*) count ".substr($list_query, strpos($list_query,'FROM'),strlen($list_query))); +$count_result = $adb->query( mkCountQuery( $list_query)); $noofrows = $adb->query_result($count_result,0,"count"); //Storing Listview session object @@ -183,6 +191,9 @@ //Retreive the Navigation array $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); +//Postgres 8 fixes +if( $adb->dbType == "pgsql") + $list_query = fixPostgresQuery( $list_query, $log, 0); // Setting the record count string @@ -197,7 +208,10 @@ else $limit_start_rec = $start_rec -1; -$list_result = $adb->query($list_query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); +if( $adb->dbType == "pgsql") + $list_result = $adb->query($list_query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); + else + $list_result = $adb->query($list_query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); $record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows; From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 15:11:33 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:11:33 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9159 - /vtigercrm/trunk/modules/Notes/ListView.php Message-ID: <20060828191134.1353370824F@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:11:27 2006 New Revision: 9159 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/Notes/ListView.php Modified: vtigercrm/trunk/modules/Notes/ListView.php ============================================================================== --- vtigercrm/trunk/modules/Notes/ListView.php (original) +++ vtigercrm/trunk/modules/Notes/ListView.php Mon Aug 28 13:11:27 2006 @@ -29,6 +29,8 @@ require_once('include/utils/utils.php'); require_once('include/utils/utils.php'); require_once('modules/CustomView/CustomView.php'); +require_once('include/database/Postgres8.php'); +require_once('include/DatabaseUtil.php'); global $app_strings,$mod_strings,$list_max_entries_per_page; @@ -146,12 +148,15 @@ $tablename = getTableNameForField('Notes',$order_by); $tablename = (($tablename != '')?($tablename."."):''); + if( $adb->dbType == "pgsql") + $query .= ' GROUP BY '.$tablename.$order_by; + $query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder; } //Retreiving the no of rows -$count_result = $adb->query("select count(*) count ".substr($query, strpos($query,'FROM'),strlen($query))); +$count_result = $adb->query( mkCountQuery( $query)); $noofrows = $adb->query_result($count_result,0,"count"); //Storing Listview session object @@ -164,6 +169,11 @@ //Retreive the Navigation array $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); +//Postgres 8 fixes +if( $adb->dbType == "pgsql") + $query = fixPostgresQuery( $query, $log, 0); + + // Setting the record count string //modified by rdhital @@ -177,7 +187,10 @@ else $limit_start_rec = $start_rec -1; -$list_result = $adb->query($query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); + if( $adb->dbType == "pgsql") + $list_result = $adb->query($query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); + else + $list_result = $adb->query($query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); $record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows; From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 15:12:16 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:12:16 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9160 - /vtigercrm/trunk/modules/Leads/ListView.php Message-ID: <20060828191216.7B49770824F@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:12:09 2006 New Revision: 9160 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/Leads/ListView.php Modified: vtigercrm/trunk/modules/Leads/ListView.php ============================================================================== --- vtigercrm/trunk/modules/Leads/ListView.php (original) +++ vtigercrm/trunk/modules/Leads/ListView.php Mon Aug 28 13:12:09 2006 @@ -27,6 +27,9 @@ require_once('include/ComboUtil.php'); require_once('include/utils/utils.php'); require_once('modules/CustomView/CustomView.php'); +require_once('include/database/Postgres8.php'); +require_once('include/DatabaseUtil.php'); + global $app_strings; global $list_max_entries_per_page; @@ -167,12 +170,15 @@ { $tablename = getTableNameForField('Leads',$order_by); $tablename = (($tablename != '')?($tablename."."):''); - + if( $adb->dbType == "pgsql") + $query .= ' GROUP BY '.$tablename.$order_by; + + $query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder; } //Retreiving the no of rows -$count_result = $adb->query("select count(*) count ".substr($query, strpos($query,'FROM'),strlen($query))); +$count_result = $adb->query( mkCountQuery( $query)); $noofrows = $adb->query_result($count_result,0,"count"); //Storing Listview session object @@ -185,6 +191,11 @@ //Retreive the Navigation array $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); + +//Postgres 8 fixes +if( $adb->dbType == "pgsql") + $query = fixPostgresQuery( $query, $log, 0); + //limiting the query if ($start_rec ==0) @@ -192,7 +203,10 @@ else $limit_start_rec = $start_rec -1; -$list_result = $adb->query($query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); + if( $adb->dbType == "pgsql") + $list_result = $adb->query($query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); + else + $list_result = $adb->query($query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); //mass merge for word templates -- *Raj*17/11 @@ -231,7 +245,10 @@ else $limit_start_rec = $start_rec -1; -$list_result = $adb->query($query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); + if( $adb->dbType == "pgsql") + $list_result = $adb->query($query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); + else + $list_result = $adb->query($query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); $record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows; From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 15:13:17 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:13:17 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9161 - /vtigercrm/trunk/modules/Invoice/ListView.php Message-ID: <20060828191317.347C5708252@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:13:10 2006 New Revision: 9161 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/Invoice/ListView.php Modified: vtigercrm/trunk/modules/Invoice/ListView.php ============================================================================== --- vtigercrm/trunk/modules/Invoice/ListView.php (original) +++ vtigercrm/trunk/modules/Invoice/ListView.php Mon Aug 28 13:13:10 2006 @@ -23,7 +23,8 @@ require_once('include/ComboUtil.php'); require_once('include/utils/utils.php'); require_once('modules/CustomView/CustomView.php'); - +require_once('include/database/Postgres8.php'); +require_once('include/DatabaseUtil.php'); global $app_strings,$list_max_entries_per_page,$currentModule,$theme; @@ -129,12 +130,16 @@ { if($order_by == 'smownerid') { + if( $adb->dbType == "pgsql") + $query .= ' GROUP BY user_name'; $query .= ' ORDER BY user_name '.$sorder; } else { $tablename = getTableNameForField('Invoice',$order_by); $tablename = (($tablename != '')?($tablename."."):''); + if( $adb->dbType == "pgsql") + $query .= ' GROUP BY '.$tablename.$order_by; $query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder; } @@ -142,7 +147,7 @@ //Retreiving the no of rows -$count_result = $adb->query("select count(*) count ".substr($query, strpos($query,'FROM'),strlen($query))); +$count_result = $adb->query( mkCountQuery( $query)); $noofrows = $adb->query_result($count_result,0,"count"); //Storing Listview session object @@ -156,6 +161,10 @@ //Retreive the Navigation array $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); + //Postgres 8 fixes + if( $adb->dbType == "pgsql") + $query = fixPostgresQuery( $query, $log, 0); + // Setting the record count string //modified by rdhital @@ -169,7 +178,10 @@ else $limit_start_rec = $start_rec -1; -$list_result = $adb->query($query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); +if( $adb->dbType == "pgsql") + $list_result = $adb->query($query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); +else + $list_result = $adb->query($query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); $record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows; From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 15:13:50 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:13:50 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9162 - /vtigercrm/trunk/modules/Campaigns/ListView.php Message-ID: <20060828191350.A694C708264@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:13:43 2006 New Revision: 9162 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/Campaigns/ListView.php Modified: vtigercrm/trunk/modules/Campaigns/ListView.php ============================================================================== --- vtigercrm/trunk/modules/Campaigns/ListView.php (original) +++ vtigercrm/trunk/modules/Campaigns/ListView.php Mon Aug 28 13:13:43 2006 @@ -18,6 +18,8 @@ require_once('themes/'.$theme.'/layout_utils.php'); require_once('include/utils/utils.php'); require_once('modules/CustomView/CustomView.php'); +require_once('include/database/Postgres8.php'); +require_once('include/DatabaseUtil.php'); global $app_strings,$mod_strings,$current_language; $current_module_strings = return_module_language($current_language, 'Campaigns'); @@ -129,25 +131,31 @@ { if($order_by == 'smownerid') { + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY vtiger_users.user_name'; $list_query .= ' ORDER BY vtiger_users.user_name '.$sorder; } else { $tablename = getTableNameForField('Campaigns',$order_by); $tablename = (($tablename != '')?($tablename."."):''); - + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY '.$tablename.$order_by; + $list_query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder; } } else { - $list_query .= ' order by vtiger_campaign.campaignid DESC'; + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY vtiger_campaign.campaignid'; + $list_query .= ' ORDER BY vtiger_campaign.campaignid DESC'; } //Constructing the list view //Retreiving the no of rows -$count_result = $adb->query("select count(*) count ".substr($list_query, strpos($list_query,'FROM'),strlen($list_query))); +$count_result = $adb->query( mkCountQuery( $list_query)); $noofrows = $adb->query_result($count_result,0,"count"); //Storing Listview session object @@ -167,11 +175,22 @@ $end_rec = $navigation_array['end_val']; //By Raju Ends + + //Postgres 8 fixes + if( $adb->dbType == "pgsql") + $list_query = fixPostgresQuery( $list_query, $log, 0); + + //limiting the query if ($start_rec ==0) $limit_start_rec = 0; else $limit_start_rec = $start_rec -1; + + if( $adb->dbType == "pgsql") + $list_result = $adb->query($list_query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); + else + $list_result = $adb->query($list_query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); $list_result = $adb->query($list_query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 15:14:39 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:14:39 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9163 - /vtigercrm/trunk/modules/SalesOrder/ListView.php Message-ID: <20060828191439.6C8A9708264@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:14:32 2006 New Revision: 9163 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/SalesOrder/ListView.php Modified: vtigercrm/trunk/modules/SalesOrder/ListView.php ============================================================================== --- vtigercrm/trunk/modules/SalesOrder/ListView.php (original) +++ vtigercrm/trunk/modules/SalesOrder/ListView.php Mon Aug 28 13:14:32 2006 @@ -14,7 +14,8 @@ require_once('include/ListView/ListView.php'); require_once('include/utils/utils.php'); require_once('modules/CustomView/CustomView.php'); - +require_once('include/database/Postgres8.php'); +require_once('include/DatabaseUtil.php'); global $app_strings,$mod_strings,$list_max_entries_per_page,$currentModule,$theme; $theme_path="themes/".$theme."/"; @@ -114,20 +115,23 @@ { if($order_by == 'smownerid') { + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY user_name'; $list_query .= ' ORDER BY user_name '.$sorder; } else { $tablename = getTableNameForField('SalesOrder',$order_by); $tablename = (($tablename != '')?($tablename."."):''); - + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY '.$tablename.$order_by; $list_query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder; } } //Retreiving the no of rows -$count_result = $adb->query("select count(*) count ".substr($list_query, strpos($list_query,'FROM'),strlen($list_query))); +$count_result = $adb->query( mkCountQuery( $list_query)); $noofrows = $adb->query_result($count_result,0,"count"); //Storing Listview session object @@ -140,6 +144,11 @@ //Retreive the Navigation array $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); + //Postgres 8 fixes + if( $adb->dbType == "pgsql") + $list_query = fixPostgresQuery( $list_query, $log, 0); + + // Setting the record count string //modified by rdhital @@ -152,8 +161,13 @@ $limit_start_rec = 0; else $limit_start_rec = $start_rec -1; - -$list_result = $adb->query($list_query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); + +if( $adb->dbType == "pgsql") + $list_result = $adb->query($list_query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); +else + $list_result = $adb->query($list_query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); + + $record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows; From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 15:16:10 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:16:10 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9164 - /vtigercrm/trunk/modules/PurchaseOrder/ListView.php Message-ID: <20060828191610.65AA8708264@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:16:03 2006 New Revision: 9164 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/PurchaseOrder/ListView.php Modified: vtigercrm/trunk/modules/PurchaseOrder/ListView.php ============================================================================== --- vtigercrm/trunk/modules/PurchaseOrder/ListView.php (original) +++ vtigercrm/trunk/modules/PurchaseOrder/ListView.php Mon Aug 28 13:16:03 2006 @@ -23,6 +23,9 @@ require_once('include/ComboUtil.php'); require_once('include/utils/utils.php'); require_once('modules/CustomView/CustomView.php'); +require_once('include/database/Postgres8.php'); +require_once('include/DatabaseUtil.php'); + global $app_strings,$list_max_entries_per_page,$currentModule,$theme; @@ -127,19 +130,23 @@ { if($order_by == 'smownerid') { + if( $adb->dbType == "pgsql") + $query .= ' GROUP BY user_name'; $query .= ' ORDER BY user_name '.$sorder; } else { $tablename = getTableNameForField('PurchaseOrder',$order_by); $tablename = (($tablename != '')?($tablename."."):''); + if( $adb->dbType == "pgsql") + $query .= ' GROUP BY '.$tablename.$order_by; $query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder; } } //Retreiving the no of rows -$count_result = $adb->query("select count(*) count ".substr($query, strpos($query,'FROM'),strlen($query))); +$count_result = $adb->query( mkCountQuery( $query)); $noofrows = $adb->query_result($count_result,0,"count"); //Storing Listview session object @@ -152,6 +159,11 @@ //Retreive the Navigation array $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); + //Postgres 8 fixes + if( $adb->dbType == "pgsql") + $query = fixPostgresQuery( $query, $log, 0); + + // Setting the record count string //modified by rdhital @@ -165,7 +177,10 @@ else $limit_start_rec = $start_rec -1; -$list_result = $adb->query($query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); +if( $adb->dbType == "pgsql") + $list_result = $adb->query($query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); +else + $list_result = $adb->query($query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); $record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows; From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 15:34:08 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:34:08 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9165 - /vtigercrm/trunk/modules/HelpDesk/ListView.php Message-ID: <20060828193409.0E38E708264@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:34:02 2006 New Revision: 9165 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/HelpDesk/ListView.php Modified: vtigercrm/trunk/modules/HelpDesk/ListView.php ============================================================================== --- vtigercrm/trunk/modules/HelpDesk/ListView.php (original) +++ vtigercrm/trunk/modules/HelpDesk/ListView.php Mon Aug 28 13:34:02 2006 @@ -23,6 +23,9 @@ require_once('themes/'.$theme.'/layout_utils.php'); require_once('include/utils/utils.php'); require_once('modules/CustomView/CustomView.php'); +require_once('include/database/Postgres8.php'); +require_once('include/DatabaseUtil.php'); + global $app_strings; global $mod_strings; @@ -127,25 +130,31 @@ { if($order_by == 'smownerid') { + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY vtiger_users.user_name'; $list_query .= ' ORDER BY vtiger_users.user_name '.$sorder; } else { $tablename = getTableNameForField('HelpDesk',$order_by); $tablename = (($tablename != '')?($tablename."."):''); - + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY '.$tablename.$order_by; + $list_query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder; } } else { - $list_query .= ' order by vtiger_troubletickets.ticketid DESC'; + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY vtiger_troubletickets.ticketid'; + $list_query .= ' ORDER BY vtiger_troubletickets.ticketid DESC'; } //Constructing the list view //Retreiving the no of rows -$count_result = $adb->query("select count(*) count ".substr($list_query, strpos($list_query,'FROM'),strlen($list_query))); +$count_result = $adb->query( mkCountQuery( $list_query)); $noofrows = $adb->query_result($count_result,0,"count"); //Storing Listview session object @@ -158,6 +167,11 @@ //Retreive the Navigation array $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); + //Postgres 8 fixes + if( $adb->dbType == "pgsql") + $list_query = fixPostgresQuery( $list_query, $log, 0); + + // Setting the record count string //modified by rdhital @@ -171,7 +185,10 @@ else $limit_start_rec = $start_rec -1; -$list_result = $adb->query($list_query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); +if( $adb->dbType == "pgsql") + $list_result = $adb->query($list_query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); +else + $list_result = $adb->query($list_query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); //mass merge for word templates -- *Raj*17/11 while($row = $adb->fetch_array($list_result)) From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 15:35:08 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:35:08 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9166 - /vtigercrm/trunk/modules/PriceBooks/ListView.php Message-ID: <20060828193508.8B777708264@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:35:01 2006 New Revision: 9166 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/PriceBooks/ListView.php Modified: vtigercrm/trunk/modules/PriceBooks/ListView.php ============================================================================== --- vtigercrm/trunk/modules/PriceBooks/ListView.php (original) +++ vtigercrm/trunk/modules/PriceBooks/ListView.php Mon Aug 28 13:35:01 2006 @@ -14,6 +14,8 @@ require_once('include/ListView/ListView.php'); require_once('include/utils/utils.php'); require_once('modules/CustomView/CustomView.php'); +require_once('include/database/Postgres8.php'); +require_once('include/DatabaseUtil.php'); global $app_strings,$mod_strings,$list_max_entries_per_page,$currentModule,$theme; @@ -106,13 +108,14 @@ { $tablename = getTableNameForField('PriceBooks',$order_by); $tablename = (($tablename != '')?($tablename."."):''); - + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY '.$tablename.$order_by; $list_query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder; } //Retreiving the no of rows -$count_result = $adb->query("select count(*) count ".substr($list_query, strpos($list_query,'FROM'),strlen($list_query))); +$count_result = $adb->query( mkCountQuery( $list_query)); $noofrows = $adb->query_result($count_result,0,"count"); //Storing Listview session object @@ -125,6 +128,11 @@ //Retreive the Navigation array $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); + //Postgres 8 fixes + if( $adb->dbType == "pgsql") + $list_query = fixPostgresQuery( $list_query, $log, 0); + + // Setting the record count string //modified by rdhital @@ -138,7 +146,10 @@ else $limit_start_rec = $start_rec -1; -$list_result = $adb->query($list_query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); +if( $adb->dbType == "pgsql") + $list_result = $adb->query($list_query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); +else + $list_result = $adb->query($list_query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); $record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows; From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 15:08:36 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:08:36 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9156 - /vtigercrm/trunk/modules/Accounts/ListView.php Message-ID: <20060828190837.11A3970824C@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:08:30 2006 New Revision: 9156 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/Accounts/ListView.php Modified: vtigercrm/trunk/modules/Accounts/ListView.php ============================================================================== --- vtigercrm/trunk/modules/Accounts/ListView.php (original) +++ vtigercrm/trunk/modules/Accounts/ListView.php Mon Aug 28 13:08:30 2006 @@ -23,6 +23,8 @@ require_once('include/ComboUtil.php'); require_once('include/utils/utils.php'); require_once('modules/CustomView/CustomView.php'); +require_once('include/database/Postgres8.php'); +require_once('include/DatabaseUtil.php'); global $app_strings; global $list_max_entries_per_page; @@ -160,20 +162,24 @@ { if($order_by == 'smownerid') { + if( $adb->dbType == "pgsql") + $query .= ' GROUP BY user_name'; $query .= ' ORDER BY user_name '.$sorder; } else { $tablename = getTableNameForField('Accounts',$order_by); $tablename = (($tablename != '')?($tablename."."):''); - + if( $adb->dbType == "pgsql") + $query .= ' GROUP BY '.$tablename.$order_by; + $query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder; } } //Retreiving the no of rows -$count_result = $adb->query("select count(*) count ".substr($query, strpos($query,'FROM'),strlen($query))); +$count_result = $adb->query( mkCountQuery( $query)); $noofrows = $adb->query_result($count_result,0,"count"); //Storing Listview session object @@ -187,7 +193,9 @@ //Retreive the Navigation array $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); - + //Postgres 8 fixes + if( $adb->dbType == "pgsql") + $query = fixPostgresQuery( $query, $log, 0); // Setting the record count string //modified by rdhital @@ -201,7 +209,10 @@ else $limit_start_rec = $start_rec -1; -$list_result = $adb->query($query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); + if( $adb->dbType == "pgsql") + $list_result = $adb->query($query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); + else + $list_result = $adb->query($query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); //mass merge for word templates -- *Raj*17/11 while($row = $adb->fetch_array($list_result)) From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 15:36:46 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:36:46 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9167 - /vtigercrm/trunk/modules/Users/User.php Message-ID: <20060828193646.3DF5A708252@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:36:39 2006 New Revision: 9167 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/Users/User.php Modified: vtigercrm/trunk/modules/Users/User.php ============================================================================== --- vtigercrm/trunk/modules/Users/User.php (original) +++ vtigercrm/trunk/modules/Users/User.php Mon Aug 28 13:36:39 2006 @@ -656,7 +656,7 @@ */ function saveentity($module) { - global $current_user, $adb;//$adb added by raju for mass mailing + global $current_user;//$adb added by raju for mass mailing $insertion_mode = $this->mode; $this->db->println("TRANS saveentity starts $module"); @@ -692,9 +692,9 @@ if($insertion_mode == 'edit') { $check_query = "select * from ".$table_name." where ".$this->tab_name_index[$table_name]."=".$this->id; - $check_result=$adb->query($check_query); - - $num_rows = $adb->num_rows($check_result); + $check_result=$this->db->query($check_query); + + $num_rows = $this->db->num_rows($check_result); if($num_rows <= 0) { @@ -713,7 +713,7 @@ $column = $this->tab_name_index[$table_name]; if($column == 'id' && $table_name == 'vtiger_users') { - $currentuser_id = $adb->getUniqueID("vtiger_users"); + $currentuser_id = $this->db->getUniqueID("vtiger_users"); $this->id = $currentuser_id; } $value = $this->id; @@ -721,13 +721,13 @@ $sql = "select * from vtiger_field where tabid=".$tabid." and tablename='".$table_name."' and displaytype in (1,3,4)"; } - $result = $adb->query($sql); - $noofrows = $adb->num_rows($result); + $result = $this->db->query($sql); + $noofrows = $this->db->num_rows($result); for($i=0; $i<$noofrows; $i++) { - $fieldname=$adb->query_result($result,$i,"fieldname"); - $columname=$adb->query_result($result,$i,"columnname"); - $uitype=$adb->query_result($result,$i,"uitype"); + $fieldname=$this->db->query_result($result,$i,"fieldname"); + $columname=$this->db->query_result($result,$i,"columnname"); + $uitype=$this->db->query_result($result,$i,"uitype"); if(isset($this->column_fields[$fieldname])) { if($uitype == 56) @@ -769,7 +769,7 @@ $fldvalue = $this->column_fields[$fieldname]; $fldvalue = stripslashes($fldvalue); } - $fldvalue = from_html($adb->formatString($table_name,$columname,$fldvalue),($insertion_mode == 'edit')?true:false); + $fldvalue = from_html($this->db->formatString($table_name,$columname,$fldvalue),($insertion_mode == 'edit')?true:false); @@ -809,14 +809,14 @@ { $sql1 = "update ".$table_name." set ".$update." where ".$this->tab_name_index[$table_name]."=".$this->id; - $adb->query($sql1); + $this->db->query($sql1); } } else { $sql1 = "insert into ".$table_name." (".$column.") values(".$value.")"; - $adb->query($sql1); + $this->db->query($sql1); } } @@ -829,7 +829,7 @@ */ function insertIntoAttachment($id,$module) { - global $log, $adb; + global $log; $log->debug("Entering into insertIntoAttachment($id,$module) method."); foreach($_FILES as $fileindex => $files) @@ -898,7 +898,7 @@ global $log; $log->debug("Entering into uploadAndSaveFile($id,$module,$file_details) method."); - global $adb, $current_user; + global $current_user; global $upload_badext; $date_var = date('YmdHis'); @@ -926,7 +926,7 @@ $filesize = $file_details['size']; $filetmp_name = $file_details['tmp_name']; - $current_id = $adb->getUniqueID("vtiger_crmentity"); + $current_id = $this->db->getUniqueID("vtiger_crmentity"); //get the file path inwhich folder we want to upload the file $upload_file_path = decideFilePath(); @@ -942,23 +942,23 @@ if($save_file == 'true') { - $sql1 = "insert into vtiger_crmentity (crmid,smcreatorid,smownerid,setype,description,createdtime,modifiedtime) values(".$current_id.",".$current_user->id.",".$ownerid.",'".$module." Attachment','".$this->column_fields['description']."',".$adb->formatString("vtiger_crmentity","createdtime",$date_var).",".$adb->formatString("vtiger_crmentity","modifiedtime",$date_var).")"; - $adb->query($sql1); + $sql1 = "insert into vtiger_crmentity (crmid,smcreatorid,smownerid,setype,description,createdtime,modifiedtime) values(".$current_id.",".$current_user->id.",".$ownerid.",'".$module." Attachment','".$this->column_fields['description']."',".$this->db->formatString("vtiger_crmentity","createdtime",$date_var).",".$this->db->formatString("vtiger_crmentity","modifiedtime",$date_var).")"; +- $this->db->query($sql1); $sql2="insert into vtiger_attachments(attachmentsid, name, description, type, path) values(".$current_id.",'".$filename."','".$this->column_fields['description']."','".$filetype."','".$upload_file_path."')"; - $result=$adb->query($sql2); + $result=$this->db->query($sql2); if($id != '') { $delquery = 'delete from vtiger_salesmanattachmentsrel where smid = '.$id; - $adb->query($delquery); + $this->db->query($delquery); } $sql3='insert into vtiger_salesmanattachmentsrel values('.$id.','.$current_id.')'; - $adb->query($sql3); + $this->db->query($sql3); //we should update the imagename in the users table - $adb->query("update vtiger_users set imagename=\"$filename\" where id=$id"); + $this->db->query("update vtiger_users set imagename=\"$filename\" where id=$id"); } else { From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 15:37:22 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:37:22 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9168 - /vtigercrm/trunk/modules/Users/Authenticate.php Message-ID: <20060828193722.DAAB5708272@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:37:15 2006 New Revision: 9168 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/Users/Authenticate.php Modified: vtigercrm/trunk/modules/Users/Authenticate.php ============================================================================== --- vtigercrm/trunk/modules/Users/Authenticate.php (original) +++ vtigercrm/trunk/modules/Users/Authenticate.php Mon Aug 28 13:37:15 2006 @@ -46,9 +46,18 @@ $auditrecord = ''; else $auditrecord = $record; - - $date_var = date('YmdHis'); - $query = "insert into vtiger_audit_trial values(".$adb->getUniqueID('vtiger_audit_trial').",".$focus->id.",'Users','Authenticate','',$date_var)"; + + if( $adb->dbType = "pgsql") + { + $date_var = date('Y-m-d H:i:s'); + $query = "insert into vtiger_audit_trial values(".$adb->getUniqueID('vtiger_audit_trial').",".$focus->id.",'Users','Authenticate','','$date_var')"; + } + else + { + + $date_var = date('YmdHis'); + $query = "insert into vtiger_audit_trial values(".$adb->getUniqueID('vtiger_audit_trial').",".$focus->id.",'Users','Authenticate','',$date_var)"; + } $adb->query($query); } From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 15:38:07 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:38:07 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9169 - /vtigercrm/trunk/modules/Faq/ListView.php Message-ID: <20060828193807.4FEBB708272@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:38:00 2006 New Revision: 9169 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/Faq/ListView.php Modified: vtigercrm/trunk/modules/Faq/ListView.php ============================================================================== --- vtigercrm/trunk/modules/Faq/ListView.php (original) +++ vtigercrm/trunk/modules/Faq/ListView.php Mon Aug 28 13:38:00 2006 @@ -23,6 +23,8 @@ require_once('themes/'.$theme.'/layout_utils.php'); require_once('include/utils/utils.php'); require_once('modules/CustomView/CustomView.php'); +require_once('include/database/Postgres8.php'); +require_once('include/DatabaseUtil.php'); global $app_strings; $current_module_strings = return_module_language($current_language, 'Faq'); @@ -135,7 +137,9 @@ { $tablename = getTableNameForField('Faq',$order_by); $tablename = (($tablename != '')?($tablename."."):''); - + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY '.$tablename.$order_by; + $list_query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder; } //Constructing the list view @@ -149,7 +153,7 @@ $smarty->assign("SINGLE_MOD",'Note'); //Retreiving the no of rows //Retreiving the no of rows -$count_result = $adb->query("select count(*) count ".substr($list_query, strpos($list_query,'FROM'),strlen($list_query))); +$count_result = $adb->query( mkCountQuery( $list_query)); $noofrows = $adb->query_result($count_result,0,"count"); if($viewnamedesc['viewname'] == 'All') @@ -167,6 +171,11 @@ //Retreive the Navigation array $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); + //Postgres 8 fixes + if( $adb->dbType == "pgsql") + $list_query = fixPostgresQuery( $list_query, $log, 0); + + // Setting the record count string //modified by rdhital @@ -180,7 +189,10 @@ else $limit_start_rec = $start_rec -1; -$list_result = $adb->query($list_query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); +if( $adb->dbType == "pgsql") + $list_result = $adb->query($list_query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); +else + $list_result = $adb->query($list_query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); $record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows; From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 15:38:47 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:38:47 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9170 - /vtigercrm/trunk/modules/Contacts/ListView.php Message-ID: <20060828193847.8B5CA708278@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:38:40 2006 New Revision: 9170 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/Contacts/ListView.php Modified: vtigercrm/trunk/modules/Contacts/ListView.php ============================================================================== --- vtigercrm/trunk/modules/Contacts/ListView.php (original) +++ vtigercrm/trunk/modules/Contacts/ListView.php Mon Aug 28 13:38:40 2006 @@ -29,6 +29,8 @@ require_once('include/ComboUtil.php'); require_once('include/utils/utils.php'); require_once('modules/CustomView/CustomView.php'); +require_once('include/database/Postgres8.php'); +require_once('include/DatabaseUtil.php'); global $app_strings; global $list_max_entries_per_page; @@ -158,13 +160,17 @@ { if($order_by == 'smownerid') { + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY user_name'; $list_query .= ' ORDER BY user_name '.$sorder; } else { $tablename = getTableNameForField('Contacts',$order_by); $tablename = (($tablename != '')?($tablename."."):''); - + if( $adb->dbType == "pgsql") + $list_query .= ' GROUP BY '.$tablename.$order_by; + $list_query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder; } } @@ -181,7 +187,7 @@ $smarty->assign("CUSTOMVIEW_OPTION",$customviewcombo_html); $smarty->assign("VIEWID", $viewid); //Retreiving the no of rows -$count_result = $adb->query("select count(*) count ".substr($list_query, strpos($list_query,'FROM'),strlen($list_query))); +$count_result = $adb->query( mkCountQuery( $list_query)); $noofrows = $adb->query_result($count_result,0,"count"); //Storing Listview session object if($_SESSION['lvs'][$currentModule]) @@ -193,6 +199,11 @@ //Retreive the Navigation array $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); +//Postgres 8 fixes + if( $adb->dbType == "pgsql") + $list_query = fixPostgresQuery( $list_query, $log, 0); + + // Setting the record count string //modified by rdhital @@ -206,7 +217,10 @@ else $limit_start_rec = $start_rec -1; -$list_result = $adb->query($list_query. " limit ".$limit_start_rec.",".$list_max_entries_per_page); +if( $adb->dbType == "pgsql") + $list_result = $adb->query($list_query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); +else + $list_result = $adb->query($list_query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); //mass merge for word templates -- *Raj*17/11 while($row = $adb->fetch_array($list_result)) From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 15:42:29 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 19:42:29 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9171 - /vtigercrm/trunk/modules/Calendar/calendarLayout.php Message-ID: <20060828194229.812E7708280@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 13:42:22 2006 New Revision: 9171 Log: Support for PostGres DB done Modified: vtigercrm/trunk/modules/Calendar/calendarLayout.php Modified: vtigercrm/trunk/modules/Calendar/calendarLayout.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/calendarLayout.php (original) +++ vtigercrm/trunk/modules/Calendar/calendarLayout.php Mon Aug 28 13:42:22 2006 @@ -1242,6 +1242,7 @@ */ function getEventList(& $calendar,$start_date,$end_date,$info='') { + global $log; $Entries = Array(); $category = getParentTab(); global $adb,$current_user,$mod_strings,$cal_log; @@ -1269,7 +1270,7 @@ { $pending_query = $query." AND (vtiger_activity.eventstatus = 'Planned') AND vtiger_crmentity.smownerid = ".$current_user->id." - group by vtiger_activity.activityid + GROUP BY vtiger_activity.activityid ORDER BY vtiger_activity.date_start,vtiger_activity.time_start ASC"; $res = $adb->query($pending_query); $pending_rows = $adb->num_rows($res); @@ -1277,7 +1278,9 @@ if(!is_admin($current_user)) $query .= " AND vtiger_crmentity.smownerid in (".$shared_ids.") "; - $query .= "group by vtiger_activity.activityid ORDER BY vtiger_activity.date_start,vtiger_activity.time_start ASC"; + $query .= "GROUP BY vtiger_activity.activityid ORDER BY vtiger_activity.date_start,vtiger_activity.time_start ASC"; + if( $adb->dbType == "pgsql") + $query = fixPostgresQuery( $query, $log, 0); $result = $adb->query($query); $rows = $adb->num_rows($result); if($info != '') @@ -1354,6 +1357,7 @@ */ function getTodoList(& $calendar,$start_date,$end_date,$info='') { + global $log; $Entries = Array(); $category = getParentTab(); global $adb,$current_user,$mod_strings,$cal_log; @@ -1381,6 +1385,8 @@ $pending_query = $query." AND (vtiger_activity.status != 'Completed') AND vtiger_crmentity.smownerid = ".$current_user->id." ORDER BY vtiger_activity.date_start,vtiger_activity.time_start ASC"; + if( $adb->dbType == "pgsql") + $pending_query = fixPostgresQuery( $pending_query, $log, 0); $res = $adb->query($pending_query); $pending_rows = $adb->num_rows($res); } @@ -1388,6 +1394,8 @@ if(!is_admin($current_user)) $query .= " AND vtiger_crmentity.smownerid in (".$shared_ids.")"; $query .= " ORDER BY vtiger_activity.date_start,vtiger_activity.time_start ASC"; + if( $adb->dbType == "pgsql") + $query = fixPostgresQuery( $query, $log, 0); $result = $adb->query($query); $rows = $adb->num_rows($result); From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 16:24:59 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 20:24:59 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9172 - /vtigercrm/trunk/modules/Calendar/Activity.php Message-ID: <20060828202459.C0CB2708293@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 14:24:52 2006 New Revision: 9172 Log: Security Implemented for Outlook --Jeri Modified: vtigercrm/trunk/modules/Calendar/Activity.php Modified: vtigercrm/trunk/modules/Calendar/Activity.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/Activity.php (original) +++ vtigercrm/trunk/modules/Calendar/Activity.php Mon Aug 28 14:24:52 2006 @@ -398,7 +398,7 @@ global $current_user; require_once("modules/Users/User.php"); $seed_user=new User(); - $user_id=$seed_user->retrieve_user_id($user_name); + $user_id=$seed_user->retrieve_user_id($username); $current_user=$seed_user; $current_user->retrieve_entity_info($user_id, 'Users'); require('user_privileges/user_privileges_'.$current_user->id.'.php'); @@ -406,11 +406,11 @@ if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) { - $sql1 = "select tablename,columnname from vtiger_field where tabid=9"; + $sql1 = "select tablename,columnname from vtiger_field where tabid=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder'"; }else { $profileList = getCurrentUserProfileList(); - $sql1 = "select tablename,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=9 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + $sql1 = "select tablename,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder' and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; } $result1 = $adb->query($sql1); for($i=0;$i < $adb->num_rows($result1);$i++) @@ -434,6 +434,7 @@ inner join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid + left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid where vtiger_users.user_name='".$username."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task'"; $log->debug("Exiting get_tasksforol method ..."); return $query; @@ -457,11 +458,11 @@ if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) { - $sql1 = "select tablename,columnname from vtiger_field where tabid=9"; + $sql1 = "select tablename,columnname from vtiger_field where tabid=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder'"; }else { $profileList = getCurrentUserProfileList(); - $sql1 = "select tablename,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=9 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + $sql1 = "select tablename,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder' and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; } $result1 = $adb->query($sql1); for($i=0;$i < $adb->num_rows($result1);$i++) @@ -486,6 +487,7 @@ inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid + left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid where vtiger_users.user_name='".$user_name."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting'"; $log->debug("Exiting get_calendarsforol method ..."); From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 05:04:32 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 09:04:32 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9173 - /vtigercrm/trunk/include/database/Postgres8.php Message-ID: <20060829090432.1D7B37095E9@vtiger.fosslabs.com> Author: richie Date: Tue Aug 29 03:04:18 2006 New Revision: 9173 Log: Support for PostGres DB done Added: vtigercrm/trunk/include/database/Postgres8.php From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 05:16:06 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 09:16:06 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9174 - /vtigercrm/trunk/include/DatabaseUtil.php Message-ID: <20060829091606.BE77672A323@vtiger.fosslabs.com> Author: richie Date: Tue Aug 29 03:15:16 2006 New Revision: 9174 Log: Support for PostGres DB done Added: vtigercrm/trunk/include/DatabaseUtil.php From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 06:42:59 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 10:42:59 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9175 - /vtigercrm/trunk/soap/vtigerolservice.php Message-ID: <20060829104259.67AA672A323@vtiger.fosslabs.com> Author: richie Date: Tue Aug 29 04:42:35 2006 New Revision: 9175 Log: Issue in Outlook Plugin has been fixed--Jeri Modified: vtigercrm/trunk/soap/vtigerolservice.php Modified: vtigercrm/trunk/soap/vtigerolservice.php ============================================================================== --- vtigercrm/trunk/soap/vtigerolservice.php (original) +++ vtigercrm/trunk/soap/vtigerolservice.php Tue Aug 29 04:42:35 2006 @@ -853,7 +853,7 @@ function AddTasks($username,$taskdtls) { - global $current_user; + global $current_user,$adb; require_once('modules/Users/User.php'); require_once('modules/Calendar/Activity.php'); @@ -934,7 +934,7 @@ function UpdateTasks($username,$taskdtls) { - global $current_user; + global $current_user,$adb; require_once('modules/Users/User.php'); require_once('modules/Calendar/Activity.php'); From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 08:07:06 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 12:07:06 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9176 - /vtigercrm/trunk/modules/Calendar/TodoSave.php Message-ID: <20060829120706.809B572A47E@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 29 06:07:02 2006 New Revision: 9176 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/TodoSave.php Modified: vtigercrm/trunk/modules/Calendar/TodoSave.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/TodoSave.php (original) +++ vtigercrm/trunk/modules/Calendar/TodoSave.php Tue Aug 29 06:07:02 2006 @@ -33,12 +33,16 @@ } $focus->column_fields["subject"] = $_REQUEST["task_subject"]; $focus->column_fields["time_start"] = $_REQUEST["task_time_start"]; - $focus->column_fields["assigned_user_id"] = $_REQUEST["assigned_user_id"]; + $focus->column_fields["assigned_user_id"] = $_REQUEST["task_assigned_user_id"]; + $_REQUEST["assigned_group_name"] = $_REQUEST['task_assigned_group_name']; + $_REQUEST['assigntype'] = $_REQUEST['task_assigntype']; $focus->column_fields["taskstatus"] = $_REQUEST["taskstatus"]; $focus->column_fields["date_start"] = $_REQUEST["task_date_start"]; + $focus->column_fields["due_date"] = $_REQUEST["task_due_date"]; $focus->column_fields["taskpriority"] = $_REQUEST["taskpriority"]; + $focus->column_fields["description"] = $_REQUEST["task_description"]; + $focus->column_fields["sendnotification"] = $_REQUEST["task_sendnotification"]; - //echo '
';print_r($focus->column_fields);echo '
'; die; $focus->save($tab_type); header("Location: index.php?action=index&module=Calendar&view=".$_REQUEST['view']."&hour=".$_REQUEST['hour']."&day=".$_REQUEST['day']."&month=".$_REQUEST['month']."&year=".$_REQUEST['year']."&viewOption=".$_REQUEST['viewOption']."&subtab=".$_REQUEST['subtab']."&parenttab=".$_REQUEST['parenttab']); ?> From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 08:40:08 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 12:40:08 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9177 - /vtigercrm/trunk/modules/Calendar/calendarLayout.php Message-ID: <20060829124008.3426C744DA6@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 29 06:40:03 2006 New Revision: 9177 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/calendarLayout.php Modified: vtigercrm/trunk/modules/Calendar/calendarLayout.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/calendarLayout.php (original) +++ vtigercrm/trunk/modules/Calendar/calendarLayout.php Tue Aug 29 06:40:03 2006 @@ -1338,9 +1338,11 @@ else $element['action'] =" "; $element['status'] = $adb->query_result($result,$i,"eventstatus"); - $element['assignedto'] = $adb->query_result($result,$i,"user_name"); - if(empty($element['assignedto'])) - $element['groupname'] = $adb->query_result($result,$i,"groupname"); + $assignedto = $adb->query_result($result,$i,"user_name"); + if(!empty($assignedto)) + $element['assignedto'] = $assignedto; + else + $element['assignedto'] = $adb->query_result($result,$i,"groupname"); $Entries[] = $element; } $cal_log->debug("Exiting getEventList() method..."); @@ -1423,9 +1425,11 @@ $element['action'] ="date_time->hour."\",\"".$calendar['calendar']->date_time->day."\",\"".$calendar['calendar']->date_time->month."\",\"".$calendar['calendar']->date_time->year."\",\"todo\");' src='".$calendar['IMAGE_PATH']."cal_event.jpg' border='0'>"; else $element['action'] =" "; - $element['assignedto'] = $adb->query_result($result,$i,"user_name"); - if(empty($element['assignedto'])) - $element['groupname'] = $adb->query_result($result,$i,"groupname"); + $assignedto = $adb->query_result($result,$i,"user_name"); + if(!empty($assignedto)) + $element['assignedto'] = $assignedto; + else + $element['assignedto'] = $adb->query_result($result,$i,"groupname"); $Entries[] = $element; } $cal_log->debug("Exiting getTodoList() method..."); @@ -1465,8 +1469,16 @@ */ function constructEventListView(& $cal,$entry_list) { - global $mod_strings,$cal_log; + global $mod_strings,$app_strings,$cal_log,$current_user; $cal_log->debug("Entering constructEventListView() method..."); + $format = $cal['calendar']->hour_format; + $date_format = $current_user->date_format; + $hour_startat = convertTime2UserSelectedFmt($format,$cal['calendar']->day_start_hour,false); + $hour_endat = convertTime2UserSelectedFmt($format,($cal['calendar']->day_start_hour+1),false); + $time_arr = getaddEventPopupTime($hour_startat,$hour_endat,$format); + $temp_ts = $cal['calendar']->date_time->ts; + //to get date in user selected date format + $temp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$temp_ts)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$temp_ts)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $temp_ts)):('')))); $list_view = ""; if($cal['view'] == 'day') { @@ -1479,6 +1491,7 @@ $end_datetime = $mod_strings['LBL_APP_END_DATE']; } + //Events listview header labels $header = Array('0'=>'#', '1'=>$start_datetime, '2'=>$end_datetime, @@ -1520,9 +1533,32 @@ } else { - $list_view .="
"; - $list_view .=""; - $list_view .=""; + $list_view .=""; } $list_view .="
-   +   @@ -120,14 +114,18 @@
*'.$mod_strings['LBL_POTENTIAL_NAME'].' - +
*'.$mod_strings['LBL_POTENTIAL_CLOSE_DATE'].' - + + ('.$current_user->date_format.') +
- Create/Edit + {$CMOD.LBL_CREATE_EDIT}
View
Delete
{$CMOD.LBL_VIEW}
{$CMOD.LBL_DELETE}
 
- {if $FIELD_PRIVILEGES[$tabid] neq NULL} - {$CMOD.LBL_SHOW_FIELDS} + {if $FIELD_PRIVILEGES[$tabid] neq NULL || $modulename eq 'Emails'} + {$APP.LBL_EXPAND_COLLAPSE} {/if}
+ {if $FIELD_PRIVILEGES[$tabid] neq ''} {if $modulename eq 'Calendar'} @@ -197,6 +198,7 @@ {/if} + {/if} {foreach item=row_values from=$FIELD_PRIVILEGES[$tabid]} {foreach item=element from=$row_values} Modified: vtigercrm/trunk/Smarty/templates/ProfileDetailView.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/ProfileDetailView.tpl (original) +++ vtigercrm/trunk/Smarty/templates/ProfileDetailView.tpl Mon Aug 21 23:40:13 2006 @@ -170,8 +170,8 @@ {$STANDARD_PRIV[$tabid][2]} @@ -179,6 +179,7 @@ '; - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; $query = "select vtiger_users.user_name,vtiger_crmentity.crmid, vtiger_troubletickets.title, vtiger_contactdetails.contactid, vtiger_troubletickets.parent_id, vtiger_contactdetails.firstname, vtiger_contactdetails.lastname, vtiger_troubletickets.status, vtiger_troubletickets.priority, vtiger_crmentity.smownerid from vtiger_troubletickets inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_troubletickets.ticketid left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_troubletickets.parent_id left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_ticketgrouprelation on vtiger_troubletickets.ticketid=vtiger_ticketgrouprelation.ticketid left join vtiger_groups on vtiger_groups.groupname=vtiger_ticketgrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_contactdetails.contactid=".$id; $log->info("Ticket Related List for Contact Displayed"); @@ -411,7 +421,7 @@ */ function get_quotes($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_quotes(".$id.") method ..."); global $app_strings; require_once('modules/Quotes/Quote.php'); @@ -422,7 +432,10 @@ { $button .= ' '; } - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; $query = "select vtiger_users.user_name,vtiger_crmentity.*, vtiger_quotes.*,vtiger_potential.potentialname,vtiger_contactdetails.lastname from vtiger_quotes inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_quotes.quoteid left outer join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_quotes.contactid left outer join vtiger_potential on vtiger_potential.potentialid=vtiger_quotes.potentialid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_quotegrouprelation on vtiger_quotes.quoteid=vtiger_quotegrouprelation.quoteid left join vtiger_groups on vtiger_groups.groupname=vtiger_quotegrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_contactdetails.contactid=".$id; $log->debug("Exiting get_quotes method ..."); return GetRelatedList('Contacts','Quotes',$focus,$query,$button,$returnset); @@ -434,7 +447,7 @@ */ function get_salesorder($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_salesorder(".$id.") method ..."); require_once('modules/SalesOrder/SalesOrder.php'); global $app_strings; @@ -446,7 +459,10 @@ $button .= ' '; } - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; $query = "select vtiger_users.user_name,vtiger_crmentity.*, vtiger_salesorder.*, vtiger_quotes.subject as quotename, vtiger_account.accountname, vtiger_contactdetails.lastname from vtiger_salesorder inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_salesorder.salesorderid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left outer join vtiger_quotes on vtiger_quotes.quoteid=vtiger_salesorder.quoteid left outer join vtiger_account on vtiger_account.accountid=vtiger_salesorder.accountid left outer join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_salesorder.contactid left join vtiger_sogrouprelation on vtiger_salesorder.salesorderid=vtiger_sogrouprelation.salesorderid left join vtiger_groups on vtiger_groups.groupname=vtiger_sogrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_salesorder.contactid = ".$id; $log->debug("Exiting get_salesorder method ..."); @@ -459,7 +475,7 @@ */ function get_products($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_products(".$id.") method ..."); global $app_strings; require_once('modules/Products/Product.php'); @@ -471,7 +487,10 @@ $button .= ' '; } - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; $query = 'select vtiger_products.productid, vtiger_products.productname, vtiger_products.productcode, vtiger_products.commissionrate, vtiger_products.qty_per_unit, vtiger_products.unit_price, vtiger_crmentity.crmid, vtiger_crmentity.smownerid,vtiger_contactdetails.lastname from vtiger_products inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_products.productid left outer join vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_products.contactid where vtiger_contactdetails.contactid = '.$id.' and vtiger_crmentity.deleted = 0'; $log->debug("Exiting get_products method ..."); @@ -485,7 +504,7 @@ */ function get_purchase_orders($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_purchase_orders(".$id.") method ..."); global $app_strings; require_once('modules/PurchaseOrder/PurchaseOrder.php'); @@ -498,7 +517,10 @@ $button .= ' '; } - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; $query = "select vtiger_users.user_name,vtiger_crmentity.*, vtiger_purchaseorder.*,vtiger_vendor.vendorname,vtiger_contactdetails.lastname from vtiger_purchaseorder inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_purchaseorder.purchaseorderid left outer join vtiger_vendor on vtiger_purchaseorder.vendorid=vtiger_vendor.vendorid left outer join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_purchaseorder.contactid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_pogrouprelation on vtiger_purchaseorder.purchaseorderid=vtiger_pogrouprelation.purchaseorderid left join vtiger_groups on vtiger_groups.groupname=vtiger_pogrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_purchaseorder.contactid=".$id; $log->debug("Exiting get_purchase_orders method ..."); @@ -512,7 +534,7 @@ */ function get_emails($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_emails(".$id.") method ..."); global $mod_strings; @@ -524,7 +546,10 @@ { $button .= ''; } - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; $log->info("Email Related List for Contact Displayed"); @@ -540,12 +565,15 @@ function get_campaigns($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_campaigns(".$id.") method ..."); global $mod_strings; $focus = new Campaign(); - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; $button = ''; $log->info("Campaign Related List for Contact Displayed"); @@ -604,17 +632,17 @@ */ function getColumnNames() { - global $log,$current_user; + global $log, $current_user; $log->debug("Entering getColumnNames() method ..."); require('user_privileges/user_privileges_'.$current_user->id.'.php'); if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) { - $sql1 = "select fieldlabel from vtiger_field where tabid=4 and block <> 75"; + $sql1 = "select fieldlabel from vtiger_field where tabid=4 and block <> 75"; }else { - $profileList = getCurrentUserProfileList(); - $sql1 = "select fieldlabel from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=4 and vtiger_field.block <> 6 and vtiger_field.block <> 75 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; - } + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldlabel from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=4 and vtiger_field.block <> 6 and vtiger_field.block <> 75 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } $result = $this->db->query($sql1); $numRows = $this->db->num_rows($result); for($i=0; $i < $numRows;$i++) Modified: vtigercrm/trunk/modules/Contacts/DetailView.php ============================================================================== --- vtigercrm/trunk/modules/Contacts/DetailView.php (original) +++ vtigercrm/trunk/modules/Contacts/DetailView.php Wed Aug 23 23:16:24 2006 @@ -1,125 +1,135 @@ -id=$_REQUEST['record']; - $focus->retrieve_entity_info($_REQUEST['record'],'Contacts'); - $log->info("Entity info successfully retrieved for Contact DetailView."); - $focus->firstname=$focus->column_fields['firstname']; - $focus->lastname=$focus->column_fields['lastname']; -} -if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') { - $focus->id = ""; -} - -global $theme; -$theme_path="themes/".$theme."/"; -$image_path=$theme_path."images/"; -require_once($theme_path.'layout_utils.php'); - -$log->info("Contact detail view"); - -$smarty = new vtigerCRM_Smarty; -$smarty->assign("MOD", $mod_strings); -$smarty->assign("APP", $app_strings); - -$smarty->assign("THEME", $theme); -$smarty->assign("IMAGE_PATH", $image_path); -$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']); -$smarty->assign("UPDATEINFO",updateInfo($focus->id)); - -if(useInternalMailer() == 1) - $smarty->assign("INT_MAILER","true"); - -$smarty->assign("NAME",$focus->lastname.' '.$focus->firstname); - -$log->info("Detail Block Informations successfully retrieved."); -$smarty->assign("BLOCKS", getBlocks($currentModule,"detail_view",'',$focus->column_fields)); -$smarty->assign("CUSTOMFIELD", $cust_fld); -$smarty->assign("SINGLE_MOD", 'Contact'); -$smarty->assign("REDIR_MOD","contacts"); - -$smarty->assign("ID", $_REQUEST['record']); -if(isPermitted("Contacts","EditView",$_REQUEST['record']) == 'yes') - $smarty->assign("EDIT_DUPLICATE","permitted"); - -if(isPermitted("Contacts","Delete",$_REQUEST['record']) == 'yes') - $smarty->assign("DELETE","permitted"); -if(isPermitted("Emails","EditView",'') == 'yes') -{ - //Added to pass the parents list as hidden for Emails -- 09-11-2005 - $parent_email = getEmailParentsList('Contacts',$_REQUEST['record']); - $smarty->assign("HIDDEN_PARENTS_LIST",$parent_email); - $smarty->assign("SENDMAILBUTTON","permitted"); -} - -if(isPermitted("Contacts","Merge",'') == 'yes') -{ - $smarty->assign("MERGEBUTTON","permitted"); - require_once('include/utils/UserInfoUtil.php'); - $wordTemplateResult = fetchWordTemplateList("Contacts"); - $tempCount = $adb->num_rows($wordTemplateResult); - $tempVal = $adb->fetch_array($wordTemplateResult); - for($templateCount=0;$templateCount<$tempCount;$templateCount++) - { - $optionString[$tempVal["templateid"]]=$tempVal["filename"]; - $tempVal = $adb->fetch_array($wordTemplateResult); - } - $smarty->assign("WORDTEMPLATEOPTIONS",$app_strings['LBL_SELECT_TEMPLATE_TO_MAIL_MERGE']); - $smarty->assign("TOPTIONS",$optionString); -} - -//Security check for related list -$category = getParentTab(); -$smarty->assign("CATEGORY",$category); - -$check_button = Button_Check($module); -$smarty->assign("CHECK", $check_button); - -$tabid = getTabid("Contacts"); -$validationData = getDBValidationData($focus->tab_name,$tabid); -$data = split_validationdataArray($validationData); - -$smarty->assign("VALIDATION_DATA_FIELDNAME",$data['fieldname']); -$smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data['datatype']); -$smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']); - -$smarty->assign("MODULE",$currentModule); -$smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); -$smarty->display("DetailView.tpl"); -?> - +id=$_REQUEST['record']; + $focus->retrieve_entity_info($_REQUEST['record'],'Contacts'); + $log->info("Entity info successfully retrieved for Contact DetailView."); + $focus->firstname=$focus->column_fields['firstname']; + $focus->lastname=$focus->column_fields['lastname']; +} +if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') { + $focus->id = ""; +} + +global $theme; +$theme_path="themes/".$theme."/"; +$image_path=$theme_path."images/"; +require_once($theme_path.'layout_utils.php'); + +$log->info("Contact detail view"); + +$smarty = new vtigerCRM_Smarty; +$smarty->assign("MOD", $mod_strings); +$smarty->assign("APP", $app_strings); + +$smarty->assign("THEME", $theme); +$smarty->assign("IMAGE_PATH", $image_path); +$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']); +$smarty->assign("UPDATEINFO",updateInfo($focus->id)); + +if(useInternalMailer() == 1) + $smarty->assign("INT_MAILER","true"); + +$smarty->assign("NAME",$focus->lastname.' '.$focus->firstname); + +$log->info("Detail Block Informations successfully retrieved."); +$smarty->assign("BLOCKS", getBlocks($currentModule,"detail_view",'',$focus->column_fields)); +$smarty->assign("CUSTOMFIELD", $cust_fld); +$smarty->assign("SINGLE_MOD", 'Contact'); +$smarty->assign("REDIR_MOD","contacts"); + +$smarty->assign("ID", $_REQUEST['record']); +if(isPermitted("Contacts","EditView",$_REQUEST['record']) == 'yes') + $smarty->assign("EDIT_DUPLICATE","permitted"); + +if(isPermitted("Contacts","Delete",$_REQUEST['record']) == 'yes') + $smarty->assign("DELETE","permitted"); +if(isPermitted("Emails","EditView",'') == 'yes') +{ + //Added to pass the parents list as hidden for Emails -- 09-11-2005 + $parent_email = getEmailParentsList('Contacts',$_REQUEST['record']); + $smarty->assign("HIDDEN_PARENTS_LIST",$parent_email); + $smarty->assign("SENDMAILBUTTON","permitted"); +} + +if(isPermitted("Contacts","Merge",'') == 'yes') +{ + $smarty->assign("MERGEBUTTON","permitted"); + require_once('include/utils/UserInfoUtil.php'); + $wordTemplateResult = fetchWordTemplateList("Contacts"); + $tempCount = $adb->num_rows($wordTemplateResult); + $tempVal = $adb->fetch_array($wordTemplateResult); + for($templateCount=0;$templateCount<$tempCount;$templateCount++) + { + $optionString[$tempVal["templateid"]]=$tempVal["filename"]; + $tempVal = $adb->fetch_array($wordTemplateResult); + } + $smarty->assign("WORDTEMPLATEOPTIONS",$app_strings['LBL_SELECT_TEMPLATE_TO_MAIL_MERGE']); + $smarty->assign("TOPTIONS",$optionString); +} + +//Security check for related list +$category = getParentTab(); +$smarty->assign("CATEGORY",$category); + +$check_button = Button_Check($module); +$smarty->assign("CHECK", $check_button); + +$tabid = getTabid("Contacts"); +$validationData = getDBValidationData($focus->tab_name,$tabid); +$data = split_validationdataArray($validationData); + +$smarty->assign("VALIDATION_DATA_FIELDNAME",$data['fieldname']); +$smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data['datatype']); +$smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']); + +$smarty->assign("MODULE",$currentModule); +$smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); + +if($singlepane_view == 'true') +{ + $related_array = getRelatedLists($currentModule,$focus); + $smarty->assign("RELATEDLISTS", $related_array); +} + +$smarty->assign("SinglePane_View", $singlepane_view); + +$smarty->display("DetailView.tpl"); +?> + Modified: vtigercrm/trunk/modules/Contacts/updateRelations.php ============================================================================== --- vtigercrm/trunk/modules/Contacts/updateRelations.php (original) +++ vtigercrm/trunk/modules/Contacts/updateRelations.php Wed Aug 23 23:16:24 2006 @@ -1,38 +1,45 @@ -query($sql); - } - } - header("Location: index.php?action=CallRelatedList&module=Contacts&record=".$_REQUEST["parentid"]); -} -elseif(isset($_REQUEST['entityid']) && $_REQUEST['entityid'] != '') -{ - $sql = "insert into ".$rel_table." values(".$_REQUEST["entityid"].",".$_REQUEST["parid"].")"; - $adb->query($sql); - header("Location: index.php?action=CallRelatedList&module=Contacts&record=".$_REQUEST["parid"]); -} - -?> +query($sql); + } + } + if($singlepane_view == 'true') + header("Location: index.php?action=DetailView&module=Contacts&record=".$_REQUEST["parentid"]); + else + header("Location: index.php?action=CallRelatedList&module=Contacts&record=".$_REQUEST["parentid"]); +} +elseif(isset($_REQUEST['entityid']) && $_REQUEST['entityid'] != '') +{ + $sql = "insert into ".$rel_table." values(".$_REQUEST["entityid"].",".$_REQUEST["parid"].")"; + $adb->query($sql); + if($singlepane_view == 'true') + header("Location: index.php?action=DetailView&module=Contacts&record=".$_REQUEST["parid"]); + else + header("Location: index.php?action=CallRelatedList&module=Contacts&record=".$_REQUEST["parid"]); +} + +?> From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 01:17:46 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:17:46 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9100 - /vtigercrm/trunk/Smarty/templates/ActivityEditView.tpl Message-ID: <20060824051746.796B775E76C@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:17:42 2006 New Revision: 9100 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/Smarty/templates/ActivityEditView.tpl Modified: vtigercrm/trunk/Smarty/templates/ActivityEditView.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/ActivityEditView.tpl (original) +++ vtigercrm/trunk/Smarty/templates/ActivityEditView.tpl Wed Aug 23 23:17:42 2006 @@ -104,13 +104,17 @@ '; $success_query_array[$success_query_count++] = $query; + $migrationlog->debug("Query Success ==> $query"); } else { @@ -3698,11 +3702,13 @@ '; $failure_query_array[$failure_query_count++] = $query; + $migrationlog->debug("Query Failed ==> $query"); + //$migrationlog->debug("Error is ==> ".$conn->ErrorMsg()); } } //Added on 23-12-2005 which is used to populate the vtiger_profile2field and vtiger_def_org_field table entries for the field per tab -//if we enter a vtiger_field in vtiger_field table then we must populate that vtiger_field in these table for security access +//if we enter a field in vtiger_field table then we must populate that field in these table for security access function populateFieldForSecurity($tabid,$fieldid) { global $conn; Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/rename_tables.php ============================================================================== --- vtigercrm/trunk/modules/Migration/ModifyDatabase/rename_tables.php (original) +++ vtigercrm/trunk/modules/Migration/ModifyDatabase/rename_tables.php Mon Aug 28 06:09:50 2006 @@ -10,9 +10,10 @@ ********************************************************************************/ global $conn; +global $migrationlog; $prefix = "vtiger_"; -$conn->println("Inside the file rename_tables.php to rename the table names with prefix vtiger_"); +$migrationlog->debug("Inside the file rename_tables.php to rename the table names with prefix vtiger_"); //Rename all the tables with prefix vtiger_ $tables_list = $conn->get_tables(); @@ -66,5 +67,5 @@ } -$conn->println("End of file rename_tables.php. The table names renamed with prefix vtiger_"); +$migrationlog->debug("End of file rename_tables.php. The table names renamed with prefix vtiger_"); ?> From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 10:04:22 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 14:04:22 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9144 - in /vtigercrm/trunk/Smarty/templates: Inventory/InventoryEditView.tpl salesEditView.tpl Message-ID: <20060828140422.ECEC36B5506@vtiger.fosslabs.com> Author: saraj Date: Mon Aug 28 08:04:18 2006 New Revision: 9144 Log: Removed the more information tab pertaining to related lists from edit view -- ahmed Modified: vtigercrm/trunk/Smarty/templates/Inventory/InventoryEditView.tpl vtigercrm/trunk/Smarty/templates/salesEditView.tpl Modified: vtigercrm/trunk/Smarty/templates/Inventory/InventoryEditView.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/Inventory/InventoryEditView.tpl (original) +++ vtigercrm/trunk/Smarty/templates/Inventory/InventoryEditView.tpl Mon Aug 28 08:04:18 2006 @@ -78,11 +78,6 @@ - - {if $OP_MODE neq 'create_view'} - - {/if} -
{$CMOD.LBL_FIELDS_SELECT_DESELECT} ({$APP.Tasks}){$CMOD.LBL_FIELDS_SELECT_DESELECT}
 
- {if $FIELD_PRIVILEGES[$tabid] neq NULL} - {$CMOD.LBL_SHOW_FIELDS} + {if $FIELD_PRIVILEGES[$tabid] neq NULL || $modulename eq 'Emails'} + {$APP.LBL_EXPAND_COLLAPSE} {/if}
+ {if $FIELD_PRIVILEGES[$tabid] neq ''} {if $modulename eq 'Calendar'} @@ -186,6 +187,7 @@ {/if} + {/if} {foreach item=row_values from=$FIELD_PRIVILEGES[$tabid]} {foreach item=element from=$row_values} From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 06:03:36 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 10:03:36 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9063 - /customerportal/trunk/PortalConfig.php Message-ID: <20060822100336.F371475E0E3@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 22 04:03:33 2006 New Revision: 9063 Log: * Modified the command to configure the path variables Modified: customerportal/trunk/PortalConfig.php Modified: customerportal/trunk/PortalConfig.php ============================================================================== --- customerportal/trunk/PortalConfig.php (original) +++ customerportal/trunk/PortalConfig.php Tue Aug 22 04:03:33 2006 @@ -13,11 +13,13 @@ global $Server_Path; global $Portal_Path; -//This is the vtigerCRM Server Path where contactserialize.php file is located -$Server_Path = ""; //for eg. http://vtiger-server:90 +//This is the vtiger server path ie., the url to access the vtiger server in browser +//Ex. i access my vtiger as http://mickie:90/vtiger/index.php so i will give as http://mickie:90/vtiger +$Server_Path = ""; -//This is the Customer Portal path where CustomerAuthenticate.php file is located -$Authenticate_Path = ""; //for eg. http://your-server/vtiger_customerportal +//This is the customer portal path ie., url to access the customer portal in browser +//Ex. i access my portal as http://mickie:90/customerportal/login.php so i will give as http://mickie:90/customerportal +$Authenticate_Path = ""; //Give a temporary directory path which is used when we upload attachment $upload_dir = '/tmp'; From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 06:18:54 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 10:18:54 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9064 - /vtigercrm/trunk/modules/System/includes/os/class.Linux.inc.php Message-ID: <20060822101854.C193775E354@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 22 04:18:51 2006 New Revision: 9064 Log: file does not exist error fixed Modified: vtigercrm/trunk/modules/System/includes/os/class.Linux.inc.php Modified: vtigercrm/trunk/modules/System/includes/os/class.Linux.inc.php ============================================================================== --- vtigercrm/trunk/modules/System/includes/os/class.Linux.inc.php (original) +++ vtigercrm/trunk/modules/System/includes/os/class.Linux.inc.php Tue Aug 22 04:18:51 2006 @@ -347,7 +347,7 @@ $bufr = execute_program('lsscsi', '-c', false); if( is_null( $bufr )) { - $bufr = rfts( '/proc/scsi/scsi' ); + $bufr = rfts( '/proc/scsi/scsi', 0, 4096, false ); } if ( $bufr != "ERROR" ) { $bufe = explode("\n", $bufr); From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 06:47:28 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 10:47:28 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9065 - /vtigercrm/trunk/modules/Import/ImportStep2.php Message-ID: <20060822104728.EA27B75E5E4@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 22 04:47:24 2006 New Revision: 9065 Log: * Added double quotes with the fieldnames, becuase it did not allow import when we import otherphone first and phone second Modified: vtigercrm/trunk/modules/Import/ImportStep2.php Modified: vtigercrm/trunk/modules/Import/ImportStep2.php ============================================================================== --- vtigercrm/trunk/modules/Import/ImportStep2.php (original) +++ vtigercrm/trunk/modules/Import/ImportStep2.php Tue Aug 22 04:47:24 2006 @@ -375,10 +375,10 @@ if(optionData != -1) { - tmp = seq_string.indexOf(optionData); + tmp = seq_string.indexOf("\""+optionData+"\""); if(tmp == -1) { - seq_string = seq_string + optionData; + seq_string = seq_string + "\""+optionData+"\""; } else { From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 08:17:34 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 12:17:34 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9066 - /vtigercrm/trunk/modules/Users/DefaultDataPopulator.php Message-ID: <20060822121734.52F8F75E5EE@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 22 06:17:30 2006 New Revision: 9066 Log: Field name changed from Part Number to Product Code Modified: vtigercrm/trunk/modules/Users/DefaultDataPopulator.php Modified: vtigercrm/trunk/modules/Users/DefaultDataPopulator.php ============================================================================== --- vtigercrm/trunk/modules/Users/DefaultDataPopulator.php (original) +++ vtigercrm/trunk/modules/Users/DefaultDataPopulator.php Tue Aug 22 06:17:30 2006 @@ -426,7 +426,7 @@ //Block31-36 -- Start $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'productname','vtiger_products',1,'2','productname','Product Name',1,0,0,100,1,31,1,'V~M',1,null,'BAS')"); - $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'productcode','vtiger_products',1,'1','productcode','Part Number',1,0,0,100,2,31,1,'V~O',1,null,'BAS')"); + $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'productcode','vtiger_products',1,'1','productcode','Product Code',1,0,0,100,2,31,1,'V~O',1,null,'BAS')"); $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'discontinued','vtiger_products',1,'56','discontinued','Product Active',1,0,0,100,3,31,1,'V~O',1,null,'BAS')"); $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'manufacturer','vtiger_products',1,'15','manufacturer','Manufacturer',1,0,0,100,4,1,31,'V~O',1,null,'BAS')"); $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'productcategory','vtiger_products',1,'15','productcategory','Product Category',1,0,0,100,4,31,1,'V~O',1,null,'BAS')"); From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 08:39:16 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 12:39:16 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9067 - in /vtigercrm/trunk/pkg/bin: startvTiger.bat startvTiger.sh stopvTiger.bat uninstallvtiger.sh Message-ID: <20060822123916.3F38D75E5F8@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 22 06:39:10 2006 New Revision: 9067 Log: removed rc Modified: vtigercrm/trunk/pkg/bin/startvTiger.bat vtigercrm/trunk/pkg/bin/startvTiger.sh vtigercrm/trunk/pkg/bin/stopvTiger.bat vtigercrm/trunk/pkg/bin/uninstallvtiger.sh Modified: vtigercrm/trunk/pkg/bin/startvTiger.bat ============================================================================== --- vtigercrm/trunk/pkg/bin/startvTiger.bat (original) +++ vtigercrm/trunk/pkg/bin/startvTiger.bat Tue Aug 22 06:39:10 2006 @@ -43,23 +43,23 @@ echo "" echo "making an attempt to kill any existing vtigercrm service" echo "" -bin\apache -k stop -n vtigercrm5_rc -bin\apache -k uninstall -n vtigercrm5_rc +bin\apache -k stop -n vtigercrm5_0 +bin\apache -k uninstall -n vtigercrm5_0 echo "Uninstalling apache service again for confirmation after sleeping for 10 seconds" echo "" %SLEEP_STR% -n 10 127.0.0.1>nul -bin\apache -k stop -n vtigercrm5_rc -bin\apache -k uninstall -n vtigercrm5_rc +bin\apache -k stop -n vtigercrm5_0 +bin\apache -k uninstall -n vtigercrm5_0 echo "" echo "" -echo "Installing vtigercrm5_rc apache service after sleeping for 10 seconds" +echo "Installing vtigercrm5_0 apache service after sleeping for 10 seconds" echo "" %SLEEP_STR% -n 10 127.0.0.1>nul -bin\apache -k install -n vtigercrm5_rc -f conf\httpd.conf +bin\apache -k install -n vtigercrm5_0 -f conf\httpd.conf echo "" -echo "Starting vtigercrm5_rc apache service" +echo "Starting vtigercrm5_0 apache service" echo "" -bin\apache -n vtigercrm5_rc -k start +bin\apache -n vtigercrm5_0 -k start IF ERRORLEVEL 1 goto stopservice goto checkmysql @@ -117,27 +117,27 @@ :checkdatabase echo "" -echo "check to see if vtigercrm5_rc database already exists" +echo "check to see if vtigercrm5_0 database already exists" echo "" -mysql --port=%mysql_port% --user=%mysql_username% --password=%mysql_password% -e "show databases like 'vtigercrm5_rc'" | "%WINDIR%\system32\find.exe" "vtigercrm5_rc" > NUL +mysql --port=%mysql_port% --user=%mysql_username% --password=%mysql_password% -e "show databases like 'vtigercrm5_0'" | "%WINDIR%\system32\find.exe" "vtigercrm5_0" > NUL IF ERRORLEVEL 1 goto dbnotexists echo "" -ECHO "vtigercrm5_rc database exists" +ECHO "vtigercrm5_0 database exists" echo "" goto end :dbnotexists echo "" -ECHO "vtigercrm5_rc database does not exist" +ECHO "vtigercrm5_0 database does not exist" echo "" echo %cd% echo "" -echo "Proceeding to create database vtigercrm5_rc and populate the same" +echo "Proceeding to create database vtigercrm5_0 and populate the same" echo "" -mysql --user=%mysql_username% --password=%mysql_password% --port=%mysql_port% -e "create database if not exists vtigercrm5_rc" +mysql --user=%mysql_username% --password=%mysql_password% --port=%mysql_port% -e "create database if not exists vtigercrm5_0" echo "" -echo "vtigercrm5_rc database created" +echo "vtigercrm5_0 database created" echo "" goto end Modified: vtigercrm/trunk/pkg/bin/startvTiger.sh ============================================================================== --- vtigercrm/trunk/pkg/bin/startvTiger.sh (original) +++ vtigercrm/trunk/pkg/bin/startvTiger.sh Tue Aug 22 06:39:10 2006 @@ -111,20 +111,20 @@ fi echo "" -echo "Checking if the vtigercrm5_rc database already exists" +echo "Checking if the vtigercrm5_0 database already exists" echo "" -echo "select 1" | ./bin/mysql --user=$mysql_username --password=$mysql_password --port=$mysql_port --socket=$mysql_socket -D vtigercrm5_rc >/dev/null +echo "select 1" | ./bin/mysql --user=$mysql_username --password=$mysql_password --port=$mysql_port --socket=$mysql_socket -D vtigercrm5_0 >/dev/null if [ $? -ne 0 ]; then echo "" - echo "Database vtigercrm5_rc does not exist. Creating database vtigercrm5_rc" + echo "Database vtigercrm5_0 does not exist. Creating database vtigercrm5_0" echo "" - ./bin/mysql --user=$mysql_username --password=$mysql_password --port=$mysql_port --socket=$mysql_socket -e "create database if not exists vtigercrm5_rc" + ./bin/mysql --user=$mysql_username --password=$mysql_password --port=$mysql_port --socket=$mysql_socket -e "create database if not exists vtigercrm5_0" fi host=`hostname` echo "*****************************************************************************************************" if [ $apache_bundled == 'false' ];then - echo "Please access the product at http://${host}:/vtigerCRM5_rc/vtigerCRM" + echo "Please access the product at http://${host}:/vtigerCRM5/vtigerCRM" else echo "Please access the product at http://${host}:" echo "*****************************************************************************************************" Modified: vtigercrm/trunk/pkg/bin/stopvTiger.bat ============================================================================== --- vtigercrm/trunk/pkg/bin/stopvTiger.bat (original) +++ vtigercrm/trunk/pkg/bin/stopvTiger.bat Tue Aug 22 06:39:10 2006 @@ -32,13 +32,13 @@ cd /d %apache_dir% rem shut down apache echo "" -echo "stopping vtigercrm5_rc apache service" +echo "stopping vtigercrm5_0 apache service" echo "" -bin\apache -n vtigercrm5_rc -k stop +bin\apache -n vtigercrm5_0 -k stop echo "" -echo "uninstalling vtigercrm5_rc apache service" +echo "uninstalling vtigercrm5_0 apache service" echo "" -bin\apache -k uninstall -n vtigercrm5_rc +bin\apache -k uninstall -n vtigercrm5_0 rem .\bin\ShutdownApache.exe logs\httpd.pid goto StopMySQL Modified: vtigercrm/trunk/pkg/bin/uninstallvtiger.sh ============================================================================== --- vtigercrm/trunk/pkg/bin/uninstallvtiger.sh (original) +++ vtigercrm/trunk/pkg/bin/uninstallvtiger.sh Tue Aug 22 06:39:10 2006 @@ -17,42 +17,42 @@ cd ${PREV_DIR} if [ ${APACHE_STATUS} == "false" ] then - diff conf/httpd.conf conf/vtiger_conf/vtigerCRM5_rc/httpd.conf > /dev/null; + diff conf/httpd.conf conf/vtiger_conf/vtigerCRM5/httpd.conf > /dev/null; if [ $? -eq 0 ] then - cp conf/vtigerCRMBackup/vtigerCRM5_rc/httpd.vtiger.crm.conf conf/httpd.conf + cp conf/vtigerCRMBackup/vtigerCRM5/httpd.vtiger.crm.conf conf/httpd.conf echo "The httpd.conf file successfully reverted" else - echo "The httpd.conf file under apache/conf has been edited since installation. Hence the uninstallation will not revert the httpd.conf file. The original httpd.conf file is present in /conf/vtigerCRMBackup/vtigerCRM5_rc/httpd.vtiger.crm.conf. Kindly revert the same manually" + echo "The httpd.conf file under apache/conf has been edited since installation. Hence the uninstallation will not revert the httpd.conf file. The original httpd.conf file is present in /conf/vtigerCRMBackup/vtigerCRM5/httpd.vtiger.crm.conf. Kindly revert the same manually" fi - diff modules/libphp4.so modules/vtiger_modules/vtigerCRM5_rc/libphp4.so > /dev/null; + diff modules/libphp4.so modules/vtiger_modules/vtigerCRM5/libphp4.so > /dev/null; if [ $? -eq 0 ] then - cp modules/vtigerCRMBackup/vtigerCRM5_rc/libphp4.vtiger.crm.so modules/libphp4.so + cp modules/vtigerCRMBackup/vtigerCRM5/libphp4.vtiger.crm.so modules/libphp4.so echo "The libphp4.so file successfully reverted" else - echo "The libphp4.so file under apache/modules has been edited since installation. Hence the uninstallation will not revert the libphp4.so file. The original libphp4.so file is present in /modules/vtigerCRMBackup/vtigerCRM5_rc/libphp4.vtiger.crm.so. Kindly revert the same manually" + echo "The libphp4.so file under apache/modules has been edited since installation. Hence the uninstallation will not revert the libphp4.so file. The original libphp4.so file is present in /modules/vtigerCRMBackup/vtigerCRM5/libphp4.vtiger.crm.so. Kindly revert the same manually" fi cd - - if [ -d $PWD/vtigerCRM5_rc ]; then + if [ -d $PWD/vtigerCRM5 ]; then echo "Uninstalling vtigerCRM from the system..." - rm -rf ../conf/vtiger_conf/vtigerCRM5_rc - rm -rf ../modules/vtiger_modules/vtigerCRM5_rc - rm -rf vtigerCRM5_rc + rm -rf ../conf/vtiger_conf/vtigerCRM5 + rm -rf ../modules/vtiger_modules/vtigerCRM5 + rm -rf vtigerCRM5 echo "Uninstallation of vtigerCRM completed" cd ${HOME} fi else cd - - if [ -d $PWD/vtigerCRM5_rc ]; then + if [ -d $PWD/vtigerCRM5 ]; then echo "Uninstalling vtigerCRM from the system..." - rm -rf ../conf/vtiger_conf/vtigerCRM5_rc - rm -rf ../modules/vtiger_modules/vtigerCRM5_rc - rm -rf vtigerCRM5_rc + rm -rf ../conf/vtiger_conf/vtigerCRM5 + rm -rf ../modules/vtiger_modules/vtigerCRM5 + rm -rf vtigerCRM5 echo "Uninstallation of vtigerCRM completed" cd ${HOME} fi From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 09:04:39 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 13:04:39 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9068 - in /customerportal/trunk: Tickets/TicketDetail.php index.php Message-ID: <20060822130439.A717A75E5FC@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 22 07:04:35 2006 New Revision: 9068 Log: * Modified to handle the attachments Modified: customerportal/trunk/Tickets/TicketDetail.php customerportal/trunk/index.php Modified: customerportal/trunk/Tickets/TicketDetail.php ============================================================================== --- customerportal/trunk/Tickets/TicketDetail.php (original) +++ customerportal/trunk/Tickets/TicketDetail.php Tue Aug 22 07:04:35 2006 @@ -180,7 +180,7 @@ $list .= ' - + '; } } Modified: customerportal/trunk/index.php ============================================================================== --- customerportal/trunk/index.php (original) +++ customerportal/trunk/index.php Tue Aug 22 07:04:35 2006 @@ -46,6 +46,27 @@ if($_SESSION['customer_id'] != '') { $is_logged = 1; + + //Added to download attachments + if($_REQUEST['downloadfile'] == 'true') + { + $filename = $_REQUEST['filename']; + $fileType = $_REQUEST['filetype']; + $fileid = $_REQUEST['fileid']; + $filesize = $_REQUEST['filesize']; + + $contentname = $fileid.'_filecontents'; + $fileContent = $_SESSION[$contentname]; + + header("Content-type: $fileType"); + header("Content-length: $filesize"); + header("Cache-Control: private"); + header("Content-Disposition: attachment; filename=$filename"); + header("Content-Description: PHP Generated Data"); + echo base64_decode($fileContent); + + exit; + } if($_REQUEST['module'] != '' && $_REQUEST['action'] != '') { $module = $_REQUEST['module']."/"; From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 09:06:21 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 13:06:21 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9069 - /customerportal/trunk/Tickets/downloadfile.php Message-ID: <20060822130621.3FBA975E5FF@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 22 07:06:17 2006 New Revision: 9069 Log: * Removed this file where as we have handle the download attachment in index.php itself Removed: customerportal/trunk/Tickets/downloadfile.php From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 09:11:29 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 13:11:29 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9070 - in /vtigercrm/trunk/pkg/bin: startvTiger.bat startvTiger.sh stopvTiger.bat Message-ID: <20060822131129.54A4175E605@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 22 07:11:24 2006 New Revision: 9070 Log: db name changed Modified: vtigercrm/trunk/pkg/bin/startvTiger.bat vtigercrm/trunk/pkg/bin/startvTiger.sh vtigercrm/trunk/pkg/bin/stopvTiger.bat Modified: vtigercrm/trunk/pkg/bin/startvTiger.bat ============================================================================== --- vtigercrm/trunk/pkg/bin/startvTiger.bat (original) +++ vtigercrm/trunk/pkg/bin/startvTiger.bat Tue Aug 22 07:11:24 2006 @@ -43,23 +43,23 @@ echo "" echo "making an attempt to kill any existing vtigercrm service" echo "" -bin\apache -k stop -n vtigercrm5_0 -bin\apache -k uninstall -n vtigercrm5_0 +bin\apache -k stop -n vtigercrm5 +bin\apache -k uninstall -n vtigercrm5 echo "Uninstalling apache service again for confirmation after sleeping for 10 seconds" echo "" %SLEEP_STR% -n 10 127.0.0.1>nul -bin\apache -k stop -n vtigercrm5_0 -bin\apache -k uninstall -n vtigercrm5_0 +bin\apache -k stop -n vtigercrm5 +bin\apache -k uninstall -n vtigercrm5 echo "" echo "" -echo "Installing vtigercrm5_0 apache service after sleeping for 10 seconds" +echo "Installing vtigercrm5 apache service after sleeping for 10 seconds" echo "" %SLEEP_STR% -n 10 127.0.0.1>nul -bin\apache -k install -n vtigercrm5_0 -f conf\httpd.conf +bin\apache -k install -n vtigercrm5 -f conf\httpd.conf echo "" -echo "Starting vtigercrm5_0 apache service" +echo "Starting vtigercrm5 apache service" echo "" -bin\apache -n vtigercrm5_0 -k start +bin\apache -n vtigercrm5 -k start IF ERRORLEVEL 1 goto stopservice goto checkmysql @@ -117,27 +117,27 @@ :checkdatabase echo "" -echo "check to see if vtigercrm5_0 database already exists" +echo "check to see if vtigercrm5 database already exists" echo "" -mysql --port=%mysql_port% --user=%mysql_username% --password=%mysql_password% -e "show databases like 'vtigercrm5_0'" | "%WINDIR%\system32\find.exe" "vtigercrm5_0" > NUL +mysql --port=%mysql_port% --user=%mysql_username% --password=%mysql_password% -e "show databases like 'vtigercrm5'" | "%WINDIR%\system32\find.exe" "vtigercrm5" > NUL IF ERRORLEVEL 1 goto dbnotexists echo "" -ECHO "vtigercrm5_0 database exists" +ECHO "vtigercrm5 database exists" echo "" goto end :dbnotexists echo "" -ECHO "vtigercrm5_0 database does not exist" +ECHO "vtigercrm5 database does not exist" echo "" echo %cd% echo "" -echo "Proceeding to create database vtigercrm5_0 and populate the same" +echo "Proceeding to create database vtigercrm5 and populate the same" echo "" -mysql --user=%mysql_username% --password=%mysql_password% --port=%mysql_port% -e "create database if not exists vtigercrm5_0" +mysql --user=%mysql_username% --password=%mysql_password% --port=%mysql_port% -e "create database if not exists vtigercrm5" echo "" -echo "vtigercrm5_0 database created" +echo "vtigercrm5 database created" echo "" goto end Modified: vtigercrm/trunk/pkg/bin/startvTiger.sh ============================================================================== --- vtigercrm/trunk/pkg/bin/startvTiger.sh (original) +++ vtigercrm/trunk/pkg/bin/startvTiger.sh Tue Aug 22 07:11:24 2006 @@ -111,14 +111,14 @@ fi echo "" -echo "Checking if the vtigercrm5_0 database already exists" +echo "Checking if the vtigercrm5 database already exists" echo "" -echo "select 1" | ./bin/mysql --user=$mysql_username --password=$mysql_password --port=$mysql_port --socket=$mysql_socket -D vtigercrm5_0 >/dev/null +echo "select 1" | ./bin/mysql --user=$mysql_username --password=$mysql_password --port=$mysql_port --socket=$mysql_socket -D vtigercrm5 >/dev/null if [ $? -ne 0 ]; then echo "" - echo "Database vtigercrm5_0 does not exist. Creating database vtigercrm5_0" + echo "Database vtigercrm5 does not exist. Creating database vtigercrm5" echo "" - ./bin/mysql --user=$mysql_username --password=$mysql_password --port=$mysql_port --socket=$mysql_socket -e "create database if not exists vtigercrm5_0" + ./bin/mysql --user=$mysql_username --password=$mysql_password --port=$mysql_port --socket=$mysql_socket -e "create database if not exists vtigercrm5" fi host=`hostname` Modified: vtigercrm/trunk/pkg/bin/stopvTiger.bat ============================================================================== --- vtigercrm/trunk/pkg/bin/stopvTiger.bat (original) +++ vtigercrm/trunk/pkg/bin/stopvTiger.bat Tue Aug 22 07:11:24 2006 @@ -32,13 +32,13 @@ cd /d %apache_dir% rem shut down apache echo "" -echo "stopping vtigercrm5_0 apache service" +echo "stopping vtigercrm5 apache service" echo "" -bin\apache -n vtigercrm5_0 -k stop +bin\apache -n vtigercrm5 -k stop echo "" -echo "uninstalling vtigercrm5_0 apache service" +echo "uninstalling vtigercrm5 apache service" echo "" -bin\apache -k uninstall -n vtigercrm5_0 +bin\apache -k uninstall -n vtigercrm5 rem .\bin\ShutdownApache.exe logs\httpd.pid goto StopMySQL From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 09:15:07 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 13:15:07 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9071 - /vtigercrm/trunk/install/2setConfig.php Message-ID: <20060822131507.6C17C75E605@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 22 07:15:01 2006 New Revision: 9071 Log: rc removed Modified: vtigercrm/trunk/install/2setConfig.php Modified: vtigercrm/trunk/install/2setConfig.php ============================================================================== --- vtigercrm/trunk/install/2setConfig.php (original) +++ vtigercrm/trunk/install/2setConfig.php Tue Aug 22 07:15:01 2006 @@ -99,7 +99,7 @@ elseif (isset($dbconfig['db_name']) && $dbconfig['db_name']!='_DBC_NAME_') $db_name = $dbconfig['db_name']; else - $db_name = 'vtigercrm5_rc'; + $db_name = 'vtigercrm5'; !isset($_REQUEST['db_drop_tables']) ? $db_drop_tables = "0" : $db_drop_tables = $_REQUEST['db_drop_tables']; if (isset($_REQUEST['host_name'])) $host_name = $_REQUEST['host_name']; @@ -133,7 +133,7 @@ } else { !isset($_REQUEST['db_hostname']) ? $db_hostname = $hostname: $db_hostname = $_REQUEST['db_hostname']; - !isset($_REQUEST['db_name']) ? $db_name = "vtigercrm5_rc" : $db_name = $_REQUEST['db_name']; + !isset($_REQUEST['db_name']) ? $db_name = "vtigercrm5" : $db_name = $_REQUEST['db_name']; !isset($_REQUEST['db_drop_tables']) ? $db_drop_tables = "0" : $db_drop_tables = $_REQUEST['db_drop_tables']; !isset($_REQUEST['host_name']) ? $host_name= $hostname : $host_name= $_REQUEST['host_name']; !isset($_REQUEST['site_URL']) ? $site_URL = $web_root : $site_URL = $_REQUEST['site_URL']; From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 10:19:42 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 14:19:42 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9072 - /vtigercrm/trunk/modules/Products/language/en_us.lang.php Message-ID: <20060822141942.3A7D975E611@vtiger.fosslabs.com> Author: richie Date: Tue Aug 22 08:19:38 2006 New Revision: 9072 Log: * Modified the Product Code to Part Number because the fieldlabel in field table is Part Number Modified: vtigercrm/trunk/modules/Products/language/en_us.lang.php Modified: vtigercrm/trunk/modules/Products/language/en_us.lang.php ============================================================================== --- vtigercrm/trunk/modules/Products/language/en_us.lang.php (original) +++ vtigercrm/trunk/modules/Products/language/en_us.lang.php Tue Aug 22 08:19:38 2006 @@ -94,7 +94,7 @@ //Added for 4GA 'Product Name'=>'Product Name', -'Product Code'=>'Part Number', +'Part Number'=>'Part Number', 'Product Active'=>'Product Active', 'Commission Rate'=>'Commission Rate (%)', 'Qty/Unit'=>'Qty/Unit', From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 10:21:01 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 14:21:01 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9073 - /vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php Message-ID: <20060822142101.F170D75E612@vtiger.fosslabs.com> Author: richie Date: Tue Aug 22 08:20:57 2006 New Revision: 9073 Log: * Reverted the query from Part Number to Product Code because when we do migration in old db the fieldlable will be Product Code which is in where condition Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php ============================================================================== --- vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php (original) +++ vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php Tue Aug 22 08:20:57 2006 @@ -226,7 +226,7 @@ "UPDATE vtiger_field SET quickcreate = 0,quickcreatesequence = 3 WHERE tabid = 13 and fieldlabel = 'Priority'", "UPDATE vtiger_field SET quickcreate = 0,quickcreatesequence = 1 WHERE tabid = 14 and fieldlabel = 'Product Name'", - "UPDATE vtiger_field SET quickcreate = 0,quickcreatesequence = 2 WHERE tabid = 14 and fieldlabel = 'Part Number'", + "UPDATE vtiger_field SET quickcreate = 0,quickcreatesequence = 2 WHERE tabid = 14 and fieldlabel = 'Product Code'", "UPDATE vtiger_field SET quickcreate = 0,quickcreatesequence = 3 WHERE tabid = 14 and fieldlabel = 'Product Category'", "UPDATE vtiger_field SET quickcreate = 0,quickcreatesequence = 1 WHERE tabid = 16 and fieldlabel = 'Subject'", From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 12:46:24 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 16:46:24 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9074 - /vtigercrm/trunk/modules/Calendar/Activity.php Message-ID: <20060822164624.D821B75E621@vtiger.fosslabs.com> Author: richie Date: Tue Aug 22 10:46:17 2006 New Revision: 9074 Log: vtiger_ issue has been fixed --Jeri Modified: vtigercrm/trunk/modules/Calendar/Activity.php Modified: vtigercrm/trunk/modules/Calendar/Activity.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/Activity.php (original) +++ vtigercrm/trunk/modules/Calendar/Activity.php Tue Aug 22 10:46:17 2006 @@ -397,7 +397,7 @@ $log->debug("Entering get_tasksforol(".$username.") method ..."); $query = "select vtiger_activity.subject,vtiger_activity.date_start startdate, vtiger_activity.activityid as taskid,vtiger_activity.status, - vtiger_crmentity.description,vtiger_activity.priority as vtiger_priority,vtiger_activity.due_date as duedate, + vtiger_crmentity.description,vtiger_activity.priority as priority,vtiger_activity.due_date as duedate, vtiger_contactdetails.firstname, vtiger_contactdetails.lastname from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 22 13:39:08 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 22 Aug 2006 17:39:08 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9075 - /vtigercrm/trunk/modules/Reports/ReportRun.php Message-ID: <20060822173909.0FBBB75E61F@vtiger.fosslabs.com> Author: richie Date: Tue Aug 22 11:39:00 2006 New Revision: 9075 Log: vtiger_ issue has been fixed --Jeri Modified: vtigercrm/trunk/modules/Reports/ReportRun.php Modified: vtigercrm/trunk/modules/Reports/ReportRun.php ============================================================================== --- vtigercrm/trunk/modules/Reports/ReportRun.php (original) +++ vtigercrm/trunk/modules/Reports/ReportRun.php Tue Aug 22 11:39:00 2006 @@ -893,7 +893,7 @@ left join vtiger_contactdetails as vtiger_contactdetailsProducts on vtiger_contactdetailsProducts.contactid = vtiger_products.contactid left join vtiger_vendor as vtiger_vendorRel on vtiger_vendorRel.vendorid = vtiger_products.vendor_id left join vtiger_crmentity as vtiger_crmentityRel on vtiger_crmentityRel.crmid = vtiger_seproductsrel.crmid - left join vtiger_account as vtiger_accountRel on vtiger_accountRel.accountid=crmentityRel.crmid + left join vtiger_account as vtiger_accountRel on vtiger_accountRel.accountid=vtiger_crmentityRel.crmid left join vtiger_leaddetails as vtiger_leaddetailsRel on vtiger_leaddetailsRel.leadid = vtiger_crmentityRel.crmid left join vtiger_potential as vtiger_potentialRel on vtiger_potentialRel.potentialid = vtiger_crmentityRel.crmid "; } From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 06:18:08 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 23 Aug 2006 10:18:08 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9076 - /vtigercrm/trunk/modules/Products/language/en_us.lang.php Message-ID: <20060823101808.D002775E6CE@vtiger.fosslabs.com> Author: saraj Date: Wed Aug 23 04:18:05 2006 New Revision: 9076 Log: * Modified the Part Number to Product Code as this entry is reverted as Product Code in field table Modified: vtigercrm/trunk/modules/Products/language/en_us.lang.php Modified: vtigercrm/trunk/modules/Products/language/en_us.lang.php ============================================================================== --- vtigercrm/trunk/modules/Products/language/en_us.lang.php (original) +++ vtigercrm/trunk/modules/Products/language/en_us.lang.php Wed Aug 23 04:18:05 2006 @@ -94,7 +94,7 @@ //Added for 4GA 'Product Name'=>'Product Name', -'Part Number'=>'Part Number', +'Product Code'=>'Part Number', 'Product Active'=>'Product Active', 'Commission Rate'=>'Commission Rate (%)', 'Qty/Unit'=>'Qty/Unit', From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 09:56:27 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 23 Aug 2006 13:56:27 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9077 - /vtigercrm/trunk/soap/wordplugin.php Message-ID: <20060823135627.6718175E6ED@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 07:56:13 2006 New Revision: 9077 Log: Security has been implemented --Jeri Modified: vtigercrm/trunk/soap/wordplugin.php Modified: vtigercrm/trunk/soap/wordplugin.php ============================================================================== --- vtigercrm/trunk/soap/wordplugin.php (original) +++ vtigercrm/trunk/soap/wordplugin.php Wed Aug 23 07:56:13 2006 @@ -1,341 +1,354 @@ -configureWSDL('vtigersoap'); - -$server->wsdl->addComplexType( - 'contact_column_detail', - 'complexType', - 'array', - '', - array( - 'email_address' => array('name'=>'email_address','type'=>'xsd:string'), - 'first_name' => array('name'=>'first_name','type'=>'xsd:string'), - 'last_name' => array('name'=>'last_name','type'=>'xsd:string'), - 'primary_address_city' => array('name'=>'primary_address_city','type'=>'xsd:string'), - 'account_name' => array('name'=>'account_name','type'=>'xsd:string'), - 'id' => array('name'=>'id','type'=>'xsd:string'), - 'salutation' => array('name'=>'salutation','type'=>'xsd:string'), - 'title'=> array('name'=>'title','type'=>'xsd:string'), - 'phone_mobile'=> array('name'=>'phone_mobile','type'=>'xsd:string'), - 'reports_to'=> array('name'=>'reports_to','type'=>'xsd:string'), - 'primary_address_city'=> array('name'=>'primary_address_city','type'=>'xsd:string'), - 'primary_address_street'=> array('name'=>'primary_address_street','type'=>'xsd:string'), - 'primary_address_state'=> array('name'=>'primary_address_state','type'=>'xsd:string'), - 'primary_address_postalcode'=> array('name'=>'primary_address_postalcode','type'=>'xsd:string'), - 'primary_address_country'=> array('name'=>'primary_address_country','type'=>'xsd:string'), - 'alt_address_city'=> array('name'=>'alt_address_city','type'=>'xsd:string'), - 'alt_address_street'=> array('name'=>'alt_address_street','type'=>'xsd:string'), - 'alt_address_state'=> array('name'=>'alt_address_state','type'=>'xsd:string'), - 'alt_address_postalcode'=> array('name'=>'alt_address_postalcode','type'=>'xsd:string'), - 'alt_address_country'=> array('name'=>'alt_address_country','type'=>'xsd:string'), - ) -); - -$server->wsdl->addComplexType( - 'account_column_detail', - 'complexType', - 'array', - '', - array( - 'accountid' => array('name'=>'accountid','type'=>'xsd:string'), - 'accountname' => array('name'=>'accountname','type'=>'xsd:string'), - 'parentid' => array('name'=>'parentid','type'=>'xsd:string'), - 'account_type' => array('name'=>'account_type','type'=>'xsd:string'), - 'industry' => array('name'=>'industry','type'=>'xsd:string'), - 'annualrevenue' => array('name'=>'annualrevenue','type'=>'xsd:string'), - 'rating'=> array('name'=>'rating','type'=>'xsd:string'), - 'ownership' => array('name'=>'ownership','type'=>'xsd:string'), - 'siccode' => array('name'=>'siccode','type'=>'xsd:string'), - 'tickersymbol' => array('name'=>'tickersymbol','type'=>'xsd:string'), - 'phone' => array('name'=>'phone','type'=>'xsd:string'), - 'otherphone' => array('name'=>'otherphone','type'=>'xsd:string'), - 'email1' => array('name'=>'email1','type'=>'xsd:string'), - 'email2' => array('name'=>'email2','type'=>'xsd:string'), - 'website' => array('name'=>'website','type'=>'xsd:string'), - 'fax' => array('name'=>'fax','type'=>'xsd:string'), - //'employees' => array('name'=>'employees','type'=>'xsd:string'), - ) -); - -$server->wsdl->addComplexType( - 'lead_column_detail', - 'complexType', - 'array', - '', - array( - 'id' => array('name'=>'id','type'=>'xsd:string'), - 'date_entered' => array('name'=>'date_entered','type'=>'xsd:string'), - 'date_modified' => array('name'=>'date_modified','type'=>'xsd:string'), - 'modified_user_id' => array('name'=>'modified_user_id','type'=>'xsd:string'), - 'assigned_user_id' => array('name'=>'assigned_user_id','type'=>'xsd:string'), - 'salutation' => array('name'=>'salutation','type'=>'xsd:string'), - 'first_name' => array('name'=>'first_name','type'=>'xsd:string'), - 'last_name' => array('name'=>'last_name','type'=>'xsd:string'), - 'company' => array('name'=>'company','type'=>'xsd:string'), - 'designation' => array('name'=>'designation','type'=>'xsd:string'), - 'lead_source' => array('name'=>'lead_source','type'=>'xsd:string'), - 'industry' => array('name'=>'industry','type'=>'xsd:string'), - 'annual_revenue' => array('name'=>'annual_revenue','type'=>'xsd:string'), - 'license_key' => array('name'=>'license_key','type'=>'xsd:string'), - 'phone' => array('name'=>'phone','type'=>'xsd:string'), - 'mobile' => array('name'=>'mobile','type'=>'xsd:string'), - 'fax' => array('name'=>'fax','type'=>'xsd:string'), - 'email' => array('name'=>'email','type'=>'xsd:string'), - 'yahoo_id' => array('name'=>'yahoo_id','type'=>'xsd:string'), - 'website' => array('name'=>'website','type'=>'xsd:string'), - 'lead_status' => array('name'=>'lead_status','type'=>'xsd:string'), - 'rating' => array('name'=>'rating','type'=>'xsd:string'), - 'employees' => array('name'=>'employees','type'=>'xsd:string'), - 'address_street' => array('name'=>'address_street','type'=>'xsd:string'), - 'address_city' => array('name'=>'address_city','type'=>'xsd:string'), - 'address_state' => array('name'=>'address_state','type'=>'xsd:string'), - 'address_postalcode' => array('name'=>'address_postalcode','type'=>'xsd:string'), - 'address_country' => array('name'=>'address_country','type'=>'xsd:string'), - 'description' => array('name'=>'description','type'=>'xsd:string'), - 'deleted' => array('name'=>'deleted','type'=>'xsd:string'), - 'converted' => array('name'=>'converted','type'=>'xsd:string'), - ) -); - -$server->wsdl->addComplexType( - 'user_column_detail', - 'complexType', - 'array', - '', - array( - 'firstname' => array('name'=>'firstname','type'=>'xsd:string'), - 'lastname' => array('name'=>'lastname','type'=>'xsd:string'), - 'username' => array('name'=>'username','type'=>'xsd:string'), - 'yahooid' => array('name'=>'yahooid','type'=>'xsd:string'), - 'title' => array('name'=>'title','type'=>'xsd:string'), - 'workphone' => array('name'=>'workphone','type'=>'xsd:string'), - 'department' => array('name'=>'department','type'=>'xsd:string'), - 'mobilephone' => array('name'=>'mobilephone','type'=>'xsd:string'), - 'otherphone'=> array('name'=>'otherphone','type'=>'xsd:string'), - 'fax' => array('name'=>'fax','type'=>'xsd:string'), - 'email' => array('name'=>'email','type'=>'xsd:string'), - 'homephone' => array('name'=>'homephone','type'=>'xsd:string'), - 'otheremail' => array('name'=>'otheremail','type'=>'xsd:string'), - 'street' => array('name'=>'street','type'=>'xsd:string'), - 'city' => array('name'=>'city','type'=>'xsd:string'), - 'state' => array('name'=>'state','type'=>'xsd:string'), - 'code' => array('name'=>'code','type'=>'xsd:string'), - 'country' => array('name'=>'country','type'=>'xsd:string'), - ) -); - -$server->wsdl->addComplexType( - 'tickets_list_array', - 'complexType', - 'array', - '', - array( - 'ticketid' => array('name'=>'ticketid','type'=>'xsd:string'), - 'title' => array('name'=>'title','type'=>'xsd:string'), - 'groupname' => array('name'=>'groupname','type'=>'xsd:string'), - 'firstname' => array('name'=>'firstname','type'=>'xsd:string'), - 'lastname' => array('name'=>'lastname','type'=>'xsd:string'), - 'parent_id' => array('name'=>'parent_id','type'=>'xsd:string'), - 'productid' => array('name'=>'productid','type'=>'xsd:string'), - 'productname' => array('name'=>'productname','type'=>'xsd:string'), - 'priority' => array('name'=>'priority','type'=>'xsd:string'), - 'severity' => array('name'=>'severity','type'=>'xsd:string'), - 'status' => array('name'=>'status','type'=>'xsd:string'), - 'category' => array('name'=>'category','type'=>'xsd:string'), - 'description' => array('name'=>'description','type'=>'xsd:string'), - 'solution' => array('name'=>'solution','type'=>'xsd:string'), - 'createdtime' => array('name'=>'createdtime','type'=>'xsd:string'), - 'modifiedtime' => array('name'=>'modifiedtime','type'=>'xsd:string'), - ) -); - -$server->register( - 'get_contacts_columns', - array('user_name'=>'xsd:string','password'=>'xsd:string'), - array('return'=>'tns:contact_column_detail'), - $NAMESPACE); - -$server->register( - 'get_accounts_columns', - array('user_name'=>'xsd:string','password'=>'xsd:string'), - array('return'=>'tns:account_column_detail'), - $NAMESPACE); - -$server->register( - 'get_leads_columns', - array('user_name'=>'xsd:string','password'=>'xsd:string'), - array('return'=>'tns:lead_column_detail'), - $NAMESPACE); - -$server->register( - 'get_user_columns', - array('user_name'=>'xsd:string','password'=>'xsd:string'), - array('return'=>'tns:user_column_detail'), - $NAMESPACE); - -$server->register( - 'get_tickets_columns', - array('user_name'=>'xsd:string','password'=>'xsd:string'), - array('return'=>'tns:tickets_list_array'), - $NAMESPACE); - -$server->register( - 'create_session', - array('user_name'=>'xsd:string','password'=>'xsd:string'), - array('return'=>'xsd:string'), - $NAMESPACE); - -$server->register( - 'end_session', - array('user_name'=>'xsd:string'), - array('return'=>'xsd:string'), - $NAMESPACE); - - -function get_tickets_columns($user_name, $password) -{ - global $current_user; - require_once("modules/Users/User.php"); - $seed_user=new User(); - $user_id=$seed_user->retrieve_user_id($user_name); - $current_user=$seed_user; - $current_user->retrieve_entity_info($user_id, 'Users'); - if(isPermitted("HelpDesk","index") == "yes") - { - require_once('modules/HelpDesk/HelpDesk.php'); - $helpdesk = new HelpDesk(); - return $helpdesk->getColumnNames_Hd(); - } - else - return null; -} - -function get_contacts_columns($user_name, $password) -{ - global $current_user; - require_once("modules/Users/User.php"); - $seed_user=new User(); - $user_id=$seed_user->retrieve_user_id($user_name); - $current_user=$seed_user; - $current_user->retrieve_entity_info($user_id, 'Users'); - if(isPermitted("Contacts","index") == "yes") - { - require_once('modules/Contacts/Contact.php'); - $contact = new Contact(); - return $contact->getColumnNames(); - } - else - return null; - -} - - -function get_accounts_columns($user_name, $password) -{ - global $current_user; - require_once("modules/Users/User.php"); - $seed_user=new User(); - $user_id=$seed_user->retrieve_user_id($user_name); - $current_user=$seed_user; - $current_user->retrieve_entity_info($user_id, 'Users'); - if(isPermitted("Accounts","index") == "yes") - { - require_once('modules/Accounts/Account.php'); - $account = new Account(); - return $account->getColumnNames_Acnt(); - } - else - return null; - -} - - -function get_leads_columns($user_name, $password) -{ - global $current_user; - require_once("modules/Users/User.php"); - $seed_user=new User(); - $user_id=$seed_user->retrieve_user_id($user_name); - $current_user=$seed_user; - $current_user->retrieve_entity_info($user_id, 'Users'); - - if(isPermitted("Leads","index") == "yes") - { - require_once('modules/Leads/Lead.php'); - $lead = new Lead(); - return $lead->getColumnNames_Lead(); - } - else - return null; -} - -function get_user_columns($user_name, $password) -{ - global $current_user; - require_once('modules/Users/User.php'); - $seed_user=new User(); - $user_id=$seed_user->retrieve_user_id($user_name); - $current_user=$seed_user; - $current_user->retrieve_entity_info($user_id, 'Users'); - if(isPermitted("Users","index") == "yes") - { - $user = new User(); - return $user->getColumnNames_User(); - } - else - return null; -} - - -function create_session($user_name, $password) -{ - global $adb; - require_once('modules/Users/User.php'); - $objuser = new User(); - if($password != "" && $user_name != '') - { - $objuser->column_fields['user_name'] = $user_name; - $objuser->load_user($password); - if($objuser->is_authenticated()) - { - return "TempSessionID"; - }else - { - return "false"; - } - }else - { - return "false"; - } -} - -function end_session($user_name) -{ - return "Success"; -} - - - - -$server->service($HTTP_RAW_POST_DATA); -exit(); -?> +configureWSDL('vtigersoap'); + +$server->wsdl->addComplexType( + 'contact_column_detail', + 'complexType', + 'array', + '', + array( + 'email_address' => array('name'=>'email_address','type'=>'xsd:string'), + 'first_name' => array('name'=>'first_name','type'=>'xsd:string'), + 'last_name' => array('name'=>'last_name','type'=>'xsd:string'), + 'primary_address_city' => array('name'=>'primary_address_city','type'=>'xsd:string'), + 'account_name' => array('name'=>'account_name','type'=>'xsd:string'), + 'id' => array('name'=>'id','type'=>'xsd:string'), + 'salutation' => array('name'=>'salutation','type'=>'xsd:string'), + 'title'=> array('name'=>'title','type'=>'xsd:string'), + 'phone_mobile'=> array('name'=>'phone_mobile','type'=>'xsd:string'), + 'reports_to'=> array('name'=>'reports_to','type'=>'xsd:string'), + 'primary_address_city'=> array('name'=>'primary_address_city','type'=>'xsd:string'), + 'primary_address_street'=> array('name'=>'primary_address_street','type'=>'xsd:string'), + 'primary_address_state'=> array('name'=>'primary_address_state','type'=>'xsd:string'), + 'primary_address_postalcode'=> array('name'=>'primary_address_postalcode','type'=>'xsd:string'), + 'primary_address_country'=> array('name'=>'primary_address_country','type'=>'xsd:string'), + 'alt_address_city'=> array('name'=>'alt_address_city','type'=>'xsd:string'), + 'alt_address_street'=> array('name'=>'alt_address_street','type'=>'xsd:string'), + 'alt_address_state'=> array('name'=>'alt_address_state','type'=>'xsd:string'), + 'alt_address_postalcode'=> array('name'=>'alt_address_postalcode','type'=>'xsd:string'), + 'alt_address_country'=> array('name'=>'alt_address_country','type'=>'xsd:string'), + ) +); + +$server->wsdl->addComplexType( + 'account_column_detail', + 'complexType', + 'array', + '', + array( + 'accountid' => array('name'=>'accountid','type'=>'xsd:string'), + 'accountname' => array('name'=>'accountname','type'=>'xsd:string'), + 'parentid' => array('name'=>'parentid','type'=>'xsd:string'), + 'account_type' => array('name'=>'account_type','type'=>'xsd:string'), + 'industry' => array('name'=>'industry','type'=>'xsd:string'), + 'annualrevenue' => array('name'=>'annualrevenue','type'=>'xsd:string'), + 'rating'=> array('name'=>'rating','type'=>'xsd:string'), + 'ownership' => array('name'=>'ownership','type'=>'xsd:string'), + 'siccode' => array('name'=>'siccode','type'=>'xsd:string'), + 'tickersymbol' => array('name'=>'tickersymbol','type'=>'xsd:string'), + 'phone' => array('name'=>'phone','type'=>'xsd:string'), + 'otherphone' => array('name'=>'otherphone','type'=>'xsd:string'), + 'email1' => array('name'=>'email1','type'=>'xsd:string'), + 'email2' => array('name'=>'email2','type'=>'xsd:string'), + 'website' => array('name'=>'website','type'=>'xsd:string'), + 'fax' => array('name'=>'fax','type'=>'xsd:string'), + //'employees' => array('name'=>'employees','type'=>'xsd:string'), + ) +); + +$server->wsdl->addComplexType( + 'lead_column_detail', + 'complexType', + 'array', + '', + array( + 'id' => array('name'=>'id','type'=>'xsd:string'), + 'date_entered' => array('name'=>'date_entered','type'=>'xsd:string'), + 'date_modified' => array('name'=>'date_modified','type'=>'xsd:string'), + 'modified_user_id' => array('name'=>'modified_user_id','type'=>'xsd:string'), + 'assigned_user_id' => array('name'=>'assigned_user_id','type'=>'xsd:string'), + 'salutation' => array('name'=>'salutation','type'=>'xsd:string'), + 'first_name' => array('name'=>'first_name','type'=>'xsd:string'), + 'last_name' => array('name'=>'last_name','type'=>'xsd:string'), + 'company' => array('name'=>'company','type'=>'xsd:string'), + 'designation' => array('name'=>'designation','type'=>'xsd:string'), + 'lead_source' => array('name'=>'lead_source','type'=>'xsd:string'), + 'industry' => array('name'=>'industry','type'=>'xsd:string'), + 'annual_revenue' => array('name'=>'annual_revenue','type'=>'xsd:string'), + 'license_key' => array('name'=>'license_key','type'=>'xsd:string'), + 'phone' => array('name'=>'phone','type'=>'xsd:string'), + 'mobile' => array('name'=>'mobile','type'=>'xsd:string'), + 'fax' => array('name'=>'fax','type'=>'xsd:string'), + 'email' => array('name'=>'email','type'=>'xsd:string'), + 'yahoo_id' => array('name'=>'yahoo_id','type'=>'xsd:string'), + 'website' => array('name'=>'website','type'=>'xsd:string'), + 'lead_status' => array('name'=>'lead_status','type'=>'xsd:string'), + 'rating' => array('name'=>'rating','type'=>'xsd:string'), + 'employees' => array('name'=>'employees','type'=>'xsd:string'), + 'address_street' => array('name'=>'address_street','type'=>'xsd:string'), + 'address_city' => array('name'=>'address_city','type'=>'xsd:string'), + 'address_state' => array('name'=>'address_state','type'=>'xsd:string'), + 'address_postalcode' => array('name'=>'address_postalcode','type'=>'xsd:string'), + 'address_country' => array('name'=>'address_country','type'=>'xsd:string'), + 'description' => array('name'=>'description','type'=>'xsd:string'), + 'deleted' => array('name'=>'deleted','type'=>'xsd:string'), + 'converted' => array('name'=>'converted','type'=>'xsd:string'), + ) +); + +$server->wsdl->addComplexType( + 'user_column_detail', + 'complexType', + 'array', + '', + array( + 'firstname' => array('name'=>'firstname','type'=>'xsd:string'), + 'lastname' => array('name'=>'lastname','type'=>'xsd:string'), + 'username' => array('name'=>'username','type'=>'xsd:string'), + 'yahooid' => array('name'=>'yahooid','type'=>'xsd:string'), + 'title' => array('name'=>'title','type'=>'xsd:string'), + 'workphone' => array('name'=>'workphone','type'=>'xsd:string'), + 'department' => array('name'=>'department','type'=>'xsd:string'), + 'mobilephone' => array('name'=>'mobilephone','type'=>'xsd:string'), + 'otherphone'=> array('name'=>'otherphone','type'=>'xsd:string'), + 'fax' => array('name'=>'fax','type'=>'xsd:string'), + 'email' => array('name'=>'email','type'=>'xsd:string'), + 'homephone' => array('name'=>'homephone','type'=>'xsd:string'), + 'otheremail' => array('name'=>'otheremail','type'=>'xsd:string'), + 'street' => array('name'=>'street','type'=>'xsd:string'), + 'city' => array('name'=>'city','type'=>'xsd:string'), + 'state' => array('name'=>'state','type'=>'xsd:string'), + 'code' => array('name'=>'code','type'=>'xsd:string'), + 'country' => array('name'=>'country','type'=>'xsd:string'), + ) +); + +$server->wsdl->addComplexType( + 'tickets_list_array', + 'complexType', + 'array', + '', + array( + 'ticketid' => array('name'=>'ticketid','type'=>'xsd:string'), + 'title' => array('name'=>'title','type'=>'xsd:string'), + 'groupname' => array('name'=>'groupname','type'=>'xsd:string'), + 'firstname' => array('name'=>'firstname','type'=>'xsd:string'), + 'lastname' => array('name'=>'lastname','type'=>'xsd:string'), + 'parent_id' => array('name'=>'parent_id','type'=>'xsd:string'), + 'productid' => array('name'=>'productid','type'=>'xsd:string'), + 'productname' => array('name'=>'productname','type'=>'xsd:string'), + 'priority' => array('name'=>'priority','type'=>'xsd:string'), + 'severity' => array('name'=>'severity','type'=>'xsd:string'), + 'status' => array('name'=>'status','type'=>'xsd:string'), + 'category' => array('name'=>'category','type'=>'xsd:string'), + 'description' => array('name'=>'description','type'=>'xsd:string'), + 'solution' => array('name'=>'solution','type'=>'xsd:string'), + 'createdtime' => array('name'=>'createdtime','type'=>'xsd:string'), + 'modifiedtime' => array('name'=>'modifiedtime','type'=>'xsd:string'), + ) +); + +$server->register( + 'get_contacts_columns', + array('user_name'=>'xsd:string','password'=>'xsd:string'), + array('return'=>'tns:contact_column_detail'), + $NAMESPACE); + +$server->register( + 'get_accounts_columns', + array('user_name'=>'xsd:string','password'=>'xsd:string'), + array('return'=>'tns:account_column_detail'), + $NAMESPACE); + +$server->register( + 'get_leads_columns', + array('user_name'=>'xsd:string','password'=>'xsd:string'), + array('return'=>'tns:lead_column_detail'), + $NAMESPACE); + +$server->register( + 'get_user_columns', + array('user_name'=>'xsd:string','password'=>'xsd:string'), + array('return'=>'tns:user_column_detail'), + $NAMESPACE); + +$server->register( + 'get_tickets_columns', + array('user_name'=>'xsd:string','password'=>'xsd:string'), + array('return'=>'tns:tickets_list_array'), + $NAMESPACE); + +$server->register( + 'create_session', + array('user_name'=>'xsd:string','password'=>'xsd:string'), + array('return'=>'xsd:string'), + $NAMESPACE); + +$server->register( + 'end_session', + array('user_name'=>'xsd:string'), + array('return'=>'xsd:string'), + $NAMESPACE); + + +function get_tickets_columns($user_name, $password) +{ + global $current_user,$log; + require_once("modules/Users/User.php"); + $seed_user=new User(); + $user_id=$seed_user->retrieve_user_id($user_name); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + if(isPermitted("HelpDesk","index") == "yes") + { + require_once('modules/HelpDesk/HelpDesk.php'); + $helpdesk = new HelpDesk(); + $log->debug($helpdesk->getColumnNames_Hd()); + return $helpdesk->getColumnNames_Hd(); + } + else + { + $return_array = array(); + return $return_array; + } +} + +function get_contacts_columns($user_name, $password) +{ + global $current_user,$log; + require_once("modules/Users/User.php"); + $seed_user=new User(); + $user_id=$seed_user->retrieve_user_id($user_name); + $current_user = $seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + if(isPermitted("Contacts","index") == "yes") + { + require_once('modules/Contacts/Contact.php'); + $contact = new Contact(); + $log->debug($contact->getColumnNames()); + return $contact->getColumnNames(); + } + else + { + $return_array = array(); + return $return_array; + } + +} + + +function get_accounts_columns($user_name, $password) +{ + global $current_user,$log; + require_once("modules/Users/User.php"); + $seed_user=new User(); + $user_id=$seed_user->retrieve_user_id($user_name); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + if(isPermitted("Accounts","index") == "yes") + { + require_once('modules/Accounts/Account.php'); + $account = new Account(); + $log->debug($account->getColumnNames_Acnt()); + return $account->getColumnNames_Acnt(); + } + else + { + $return_array = array(); + return $return_array; + } + +} + + +function get_leads_columns($user_name, $password) +{ + global $current_user,$log; + require_once("modules/Users/User.php"); + $seed_user=new User(); + $user_id=$seed_user->retrieve_user_id($user_name); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + + if(isPermitted("Leads","index") == "yes") + { + require_once('modules/Leads/Lead.php'); + $lead = new Lead(); + $log->debug($lead->getColumnNames_Lead()); + return $lead->getColumnNames_Lead(); + } + else + { + $return_array = array(); + return $return_array; + } + +} + +function get_user_columns($user_name, $password) +{ + global $current_user; + require_once('modules/Users/User.php'); + $seed_user=new User(); + $user_id=$seed_user->retrieve_user_id($user_name); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + $user = new User(); + return $user->getColumnNames_User(); + +} + + +function create_session($user_name, $password) +{ + global $adb; + require_once('modules/Users/User.php'); + $objuser = new User(); + if($password != "" && $user_name != '') + { + $objuser->column_fields['user_name'] = $user_name; + $objuser->load_user($password); + if($objuser->is_authenticated()) + { + return "TempSessionID"; + }else + { + return "false"; + } + }else + { + return "false"; + } +} + +function end_session($user_name) +{ + return "Success"; +} + + + + +$server->service($HTTP_RAW_POST_DATA); +exit(); +?> From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 10:01:35 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 23 Aug 2006 14:01:35 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9078 - in /vtigercrm/trunk/modules: Accounts/Account.php Contacts/Contact.php HelpDesk/HelpDesk.php Leads/Lead.php Message-ID: <20060823140135.0FAFE75E6EF@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 08:00:50 2006 New Revision: 9078 Log: Security implemented for WordPlugin Modified: vtigercrm/trunk/modules/Accounts/Account.php vtigercrm/trunk/modules/Contacts/Contact.php vtigercrm/trunk/modules/HelpDesk/HelpDesk.php vtigercrm/trunk/modules/Leads/Lead.php Modified: vtigercrm/trunk/modules/Accounts/Account.php ============================================================================== --- vtigercrm/trunk/modules/Accounts/Account.php (original) +++ vtigercrm/trunk/modules/Accounts/Account.php Wed Aug 23 08:00:50 2006 @@ -1,743 +1,751 @@ -'crmid','vtiger_account'=>'accountid','vtiger_accountbillads'=>'accountaddressid','vtiger_accountshipads'=>'accountaddressid','vtiger_accountscf'=>'accountid'); - - var $entity_table = "vtiger_crmentity"; - - var $billadr_table = "vtiger_accountbillads"; - - var $object_name = "Accounts"; - // Mike Crowe Mod --------------------------------------------------------added for general search - var $base_table_name = "vtiger_account"; - var $cf_table_name = "vtiger_accountscf"; - - var $new_schema = true; - - var $module_id = "accountid"; - - var $column_fields = Array(); - - var $sortby_fields = Array('accountname','city','website','phone','smownerid'); - - - // This is the list of vtiger_fields that are in the lists. - var $list_fields = Array( - 'Account Name'=>Array('vtiger_account'=>'accountname'), - 'City'=>Array('vtiger_accountbillads'=>'city'), - 'Website'=>Array('vtiger_account'=>'website'), - 'Phone'=>Array('vtiger_account'=> 'phone'), - 'Assigned To'=>Array('vtiger_crmentity'=>'smownerid') - ); - - var $list_fields_name = Array( - 'Account Name'=>'accountname', - 'City'=>'bill_city', - 'Website'=>'website', - 'Phone'=>'phone', - 'Assigned To'=>'assigned_user_id' - ); - var $list_link_field= 'accountname'; - - var $search_fields = Array( - 'Account Name'=>Array('vtiger_account'=>'accountname'), - 'City'=>Array('vtiger_accountbillads'=>'city'), - ); - - var $search_fields_name = Array( - 'Account Name'=>'accountname', - 'City'=>'bill_city', - ); - - // This is the list of vtiger_fields that are required. - var $required_fields = array("accountname"=>1); - - //Added these variables which are used as default order by and sortorder in ListView - var $default_order_by = 'accountname'; - var $default_sort_order = 'ASC'; - - function Account() { - $this->log =LoggerManager::getLogger('account'); - $this->db = new PearDatabase(); - $this->column_fields = getColumnFields('Accounts'); - } - - // Mike Crowe Mod --------------------------------------------------------Default ordering for us - /** - * Function to get sort order - * return string $sorder - sortorder string either 'ASC' or 'DESC' - */ - function getSortOrder() - { - global $log; - $log->debug("Entering getSortOrder() method ..."); - if(isset($_REQUEST['sorder'])) - $sorder = $_REQUEST['sorder']; - else - $sorder = (($_SESSION['ACCOUNTS_SORT_ORDER'] != '')?($_SESSION['ACCOUNTS_SORT_ORDER']):($this->default_sort_order)); - $log->debug("Exiting getSortOrder() method ..."); - return $sorder; - } - /** - * Function to get order by - * return string $order_by - fieldname(eg: 'accountname') - */ - function getOrderBy() - { - global $log; - $log->debug("Entering getOrderBy() method ..."); - if (isset($_REQUEST['order_by'])) - $order_by = $_REQUEST['order_by']; - else - $order_by = (($_SESSION['ACCOUNTS_ORDER_BY'] != '')?($_SESSION['ACCOUNTS_ORDER_BY']):($this->default_order_by)); - $log->debug("Exiting getOrderBy method ..."); - return $order_by; - } - // Mike Crowe Mod -------------------------------------------------------- - - - /** Returns a list of the associated contacts - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function get_contacts($id) - { - global $log; - $log->debug("Entering get_contacts(".$id.") method ..."); - global $mod_strings; - - $focus = new Contact(); - - $button = ''; - if(isPermitted("Contacts",1,"") == 'yes') - { - $button .= ' '; - } - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - //SQL - $query = "SELECT vtiger_contactdetails.*, - vtiger_crmentity.crmid, - vtiger_crmentity.smownerid, - vtiger_users.user_name - FROM vtiger_contactdetails - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_contactdetails.contactid - LEFT JOIN vtiger_contactgrouprelation - ON vtiger_contactdetails.contactid = vtiger_contactgrouprelation.contactid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id - WHERE vtiger_crmentity.deleted = 0 - AND vtiger_contactdetails.accountid = ".$id; - $log->debug("Exiting get_contacts method ..."); - return GetRelatedList('Accounts','Contacts',$focus,$query,$button,$returnset); - } - - /** Returns a list of the associated opportunities - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function get_opportunities($id) - { - global $log; - $log->debug("Entering get_opportunities(".$id.") method ..."); - global $mod_strings; - - $focus = new Potential(); - $button = ''; - - if(isPermitted("Potentials",1,"") == 'yes') - { - $button .= ''; - } - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_potential.potentialid, vtiger_potential.accountid, - vtiger_potential.potentialname, vtiger_potential.sales_stage, - vtiger_potential.potentialtype, vtiger_potential.amount, - vtiger_potential.closingdate, vtiger_potential.potentialtype, - vtiger_users.user_name, - vtiger_crmentity.crmid, vtiger_crmentity.smownerid - FROM vtiger_potential - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_potential.potentialid - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id - LEFT JOIN vtiger_potentialgrouprelation - ON vtiger_potential.potentialid = vtiger_potentialgrouprelation.potentialid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_potentialgrouprelation.groupname - WHERE vtiger_crmentity.deleted = 0 - AND vtiger_potential.accountid = ".$id; - $log->debug("Exiting get_opportunities method ..."); - - return GetRelatedList('Accounts','Potentials',$focus,$query,$button,$returnset); - } - - /** Returns a list of the associated tasks - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function get_activities($id) - { - global $log; - $log->debug("Entering get_activities(".$id.") method ..."); - global $mod_strings; - - $focus = new Activity(); - $button = ''; - if(isPermitted("Calendar",1,"") == 'yes') - { - - $button .= ' '; - $button .= ' '; - } - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_activity.*, - vtiger_seactivityrel.*, - vtiger_crmentity.crmid, vtiger_crmentity.smownerid, - vtiger_crmentity.modifiedtime, - vtiger_users.user_name, - vtiger_recurringevents.recurringtype - FROM vtiger_activity - INNER JOIN vtiger_seactivityrel - ON vtiger_seactivityrel.activityid = vtiger_activity.activityid - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_activity.activityid - LEFT JOIN vtiger_users - ON vtiger_users.id = vtiger_crmentity.smownerid - LEFT OUTER JOIN vtiger_recurringevents - ON vtiger_recurringevents.activityid = vtiger_activity.activityid - LEFT JOIN vtiger_activitygrouprelation - ON vtiger_activitygrouprelation.activityid = vtiger_crmentity.crmid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_activitygrouprelation.groupname - WHERE vtiger_seactivityrel.crmid = ".$id." - AND (activitytype='Task' - OR activitytype='Call' - OR activitytype='Meeting') - AND vtiger_crmentity.deleted = 0 - AND ((vtiger_activity.status IS NOT NULL - AND vtiger_activity.status != 'Completed') - AND (vtiger_activity.status IS NOT NULL - AND vtiger_activity.status != 'Deferred') - OR (vtiger_activity.eventstatus !='' - AND vtiger_activity.eventstatus != 'Held'))"; - $log->debug("Exiting get_activities method ..."); - return GetRelatedList('Accounts','Calendar',$focus,$query,$button,$returnset); - - } - /** - * Function to get Account related Task & Event which have activity type Held, Completed or Deferred. - * @param integer $id - accountid - * returns related Task or Event record in array format - */ - function get_history($id) - { - global $log; - $log->debug("Entering get_history(".$id.") method ..."); - $query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, - vtiger_activity.status, vtiger_activity.eventstatus, - vtiger_activity.activitytype, - vtiger_crmentity.modifiedtime, vtiger_crmentity.createdtime, - vtiger_crmentity.description, - vtiger_users.user_name - FROM vtiger_activity - INNER JOIN vtiger_seactivityrel - ON vtiger_seactivityrel.activityid = vtiger_activity.activityid - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_activity.activityid - LEFT JOIN vtiger_activitygrouprelation - ON vtiger_activitygrouprelation.activityid = vtiger_activity.activityid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_activitygrouprelation.groupname - INNER JOIN vtiger_users - ON vtiger_crmentity.smcreatorid = vtiger_users.id - WHERE (vtiger_activity.activitytype = 'Meeting' - OR vtiger_activity.activitytype = 'Call' - OR vtiger_activity.activitytype = 'Task') - AND (vtiger_activity.status = 'Completed' - OR vtiger_activity.status = 'Deferred' - OR (vtiger_activity.eventstatus = 'Held' - AND vtiger_activity.eventstatus != '')) - AND vtiger_seactivityrel.crmid = ".$id; - //Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php - $log->debug("Exiting get_history method ..."); - return getHistory('Accounts',$query,$id); - } - /** - * Function to get Account related Attachments - * @param integer $id - accountid - * returns related Attachment record in array format - */ - function get_attachments($id) - { - global $log; - $log->debug("Entering get_attachments(".$id.") method ..."); - // Armando L?scher 18.10.2005 -> ?visibleDescription - // Desc: Inserted crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name - // Inserted inner join vtiger_users on crm2.smcreatorid= vtiger_users.id - $query = "SELECT vtiger_notes.title, vtiger_notes.notecontent AS description, - vtiger_notes.filename, vtiger_notes.notesid AS crmid, - 'Notes ' AS ActivityType, - vtiger_attachments.type AS FileType, - crm2.modifiedtime AS lastmodified, crm2.createdtime, - vtiger_seattachmentsrel.attachmentsid, - vtiger_users.user_name - FROM vtiger_notes - INNER JOIN vtiger_senotesrel - ON vtiger_senotesrel.notesid = vtiger_notes.notesid - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_senotesrel.crmid - INNER JOIN vtiger_crmentity crm2 - ON crm2.crmid = vtiger_notes.notesid - AND crm2.deleted = 0 - LEFT JOIN vtiger_seattachmentsrel - ON vtiger_seattachmentsrel.crmid = vtiger_notes.notesid - LEFT JOIN vtiger_attachments - ON vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid - INNER JOIN vtiger_users - ON crm2.smcreatorid = vtiger_users.id - WHERE vtiger_crmentity.crmid = ".$id." - UNION ALL - SELECT vtiger_attachments.description AS title, vtiger_attachments.description, - vtiger_attachments.name AS filename, - vtiger_seattachmentsrel.attachmentsid AS crmid, - 'Attachments' AS ActivityType, - vtiger_attachments.type AS FileType, - crm2.modifiedtime AS lastmodified, crm2.createdtime, - vtiger_attachments.attachmentsid, - vtiger_users.user_name - FROM vtiger_attachments - INNER JOIN vtiger_seattachmentsrel - ON vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_seattachmentsrel.crmid - INNER JOIN vtiger_crmentity crm2 - ON crm2.crmid = vtiger_attachments.attachmentsid - INNER JOIN vtiger_users - ON crm2.smcreatorid = vtiger_users.id - WHERE vtiger_crmentity.crmid = ".$id." - ORDER BY createdtime DESC"; - $log->debug("Exiting get_attachments method ..."); - return getAttachmentsAndNotes('Accounts',$query,$id); - } - /** - * Function to get Account related Quotes - * @param integer $id - accountid - * returns related Quotes record in array format - */ - function get_quotes($id) - { - global $log; - $log->debug("Entering get_quotes(".$id.") method ..."); - global $app_strings; - require_once('modules/Quotes/Quote.php'); - - $focus = new Quote(); - - $button = ''; - if(isPermitted("Quotes",1,"") == 'yes') - { - $button .= ' '; - } - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_users.user_name, - vtiger_groups.groupname, - vtiger_crmentity.*, - vtiger_quotes.*, - vtiger_potential.potentialname, - vtiger_account.accountname - FROM vtiger_quotes - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_quotes.quoteid - LEFT OUTER JOIN vtiger_account - ON vtiger_account.accountid = vtiger_quotes.accountid - LEFT OUTER JOIN vtiger_potential - ON vtiger_potential.potentialid = vtiger_quotes.potentialid - LEFT JOIN vtiger_quotegrouprelation - ON vtiger_quotes.quoteid = vtiger_quotegrouprelation.quoteid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_quotegrouprelation.groupname - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id - WHERE vtiger_crmentity.deleted = 0 - AND vtiger_account.accountid = ".$id; - $log->debug("Exiting get_quotes method ..."); - return GetRelatedList('Accounts','Quotes',$focus,$query,$button,$returnset); - } - /** - * Function to get Account related Invoices - * @param integer $id - accountid - * returns related Invoices record in array format - */ - function get_invoices($id) - { - global $log; - $log->debug("Entering get_invoices(".$id.") method ..."); - global $app_strings; - require_once('modules/Invoice/Invoice.php'); - - $focus = new Invoice(); - - $button = ''; - if(isPermitted("Invoice",1,"") == 'yes') - { - $button .= ' '; - } - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_users.user_name, - vtiger_groups.groupname, - vtiger_crmentity.*, - vtiger_invoice.*, - vtiger_account.accountname, - vtiger_salesorder.subject AS salessubject - FROM vtiger_invoice - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_invoice.invoiceid - LEFT OUTER JOIN vtiger_account - ON vtiger_account.accountid = vtiger_invoice.accountid - LEFT OUTER JOIN vtiger_salesorder - ON vtiger_salesorder.salesorderid = vtiger_invoice.salesorderid - LEFT JOIN vtiger_invoicegrouprelation - ON vtiger_invoice.invoiceid = vtiger_invoicegrouprelation.invoiceid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_invoicegrouprelation.groupname - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id - WHERE vtiger_crmentity.deleted = 0 - AND vtiger_account.accountid = ".$id; - $log->debug("Exiting get_invoices method ..."); - return GetRelatedList('Accounts','Invoice',$focus,$query,$button,$returnset); - } - - /** - * Function to get Account related SalesOrder - * @param integer $id - accountid - * returns related SalesOrder record in array format - */ - function get_salesorder($id) - { - global $log; - $log->debug("Entering get_salesorder(".$id.") method ..."); - require_once('modules/SalesOrder/SalesOrder.php'); - global $app_strings; - - $focus = new SalesOrder(); - - $button = ''; - if(isPermitted("SalesOrder",1,"") == 'yes') - { - $button .= ' '; - } - - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_crmentity.*, - vtiger_salesorder.*, - vtiger_quotes.subject AS quotename, - vtiger_account.accountname, - vtiger_users.user_name, - vtiger_groups.groupname - FROM vtiger_salesorder - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_salesorder.salesorderid - LEFT OUTER JOIN vtiger_quotes - ON vtiger_quotes.quoteid = vtiger_salesorder.quoteid - LEFT OUTER JOIN vtiger_account - ON vtiger_account.accountid = vtiger_salesorder.accountid - LEFT JOIN vtiger_sogrouprelation - ON vtiger_salesorder.salesorderid = vtiger_sogrouprelation.salesorderid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_sogrouprelation.groupname - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id - WHERE vtiger_crmentity.deleted = 0 - AND vtiger_salesorder.accountid = ".$id; - $log->debug("Exiting get_salesorder method ..."); - return GetRelatedList('Accounts','SalesOrder',$focus,$query,$button,$returnset); - } - /** - * Function to get Account related Tickets - * @param integer $id - accountid - * returns related Ticket record in array format - */ - function get_tickets($id) - { - global $log; - $log->debug("Entering get_tickets(".$id.") method ..."); - global $app_strings; - - $focus = new HelpDesk(); - $button = ''; - - $button .= ''; - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_users.user_name, vtiger_users.id, - vtiger_troubletickets.title, vtiger_troubletickets.ticketid AS crmid, - vtiger_troubletickets.status, vtiger_troubletickets.priority, - vtiger_troubletickets.parent_id, - vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime - FROM vtiger_troubletickets - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid - LEFT JOIN vtiger_account - ON vtiger_account.accountid = vtiger_troubletickets.parent_id - LEFT JOIN vtiger_contactdetails - ON vtiger_contactdetails.contactid=vtiger_troubletickets.parent_id - LEFT JOIN vtiger_users - ON vtiger_users.id=vtiger_crmentity.smownerid - LEFT JOIN vtiger_ticketgrouprelation - ON vtiger_troubletickets.ticketid = vtiger_ticketgrouprelation.ticketid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_ticketgrouprelation.groupname - WHERE vtiger_troubletickets.parent_id=".$id." or " ; - - $query .= "vtiger_troubletickets.parent_id in(SELECT vtiger_contactdetails.contactid - FROM vtiger_contactdetails - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_contactdetails.contactid - LEFT JOIN vtiger_contactgrouprelation - ON vtiger_contactdetails.contactid = vtiger_contactgrouprelation.contactid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id - WHERE vtiger_crmentity.deleted = 0 - AND vtiger_contactdetails.accountid = ".$id; - - - //Appending the security parameter - global $current_user; - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); - $tab_id=getTabid('Contacts'); - if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[$tab_id] == 3) - { - $sec_parameter=getListViewSecurityParameter('Contacts'); - $query .= ' '.$sec_parameter; - - } - - $query .= ") "; - - /* - $query .= " UNION ALL - SELECT vtiger_users.user_name, vtiger_users.id, - vtiger_troubletickets.title, vtiger_troubletickets.ticketid AS crmid, - vtiger_troubletickets.status, vtiger_troubletickets.priority, - vtiger_troubletickets.parent_id, - vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime - FROM vtiger_troubletickets - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid - LEFT JOIN vtiger_contactdetails - ON vtiger_contactdetails.contactid = vtiger_troubletickets.parent_id - LEFT JOIN vtiger_account - ON vtiger_account.accountid = vtiger_contactdetails.accountid - LEFT JOIN vtiger_users - ON vtiger_users.id = vtiger_crmentity.smownerid - LEFT JOIN vtiger_ticketgrouprelation - ON vtiger_troubletickets.ticketid = vtiger_ticketgrouprelation.ticketid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_ticketgrouprelation.groupname - WHERE vtiger_account.accountid = ".$id; - */ - $log->debug("Exiting get_tickets method ..."); - return GetRelatedList('Accounts','HelpDesk',$focus,$query,$button,$returnset); - } - /** - * Function to get Account related Products - * @param integer $id - accountid - * returns related Products record in array format - */ - function get_products($id) - { - global $log; - $log->debug("Entering get_products(".$id.") method ..."); - require_once('modules/Products/Product.php'); - global $app_strings; - - $focus = new Product(); - - $button = ''; - - if(isPermitted("Products",1,"") == 'yes') - { - - - $button .= ' '; - } - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_products.productid, vtiger_products.productname, - vtiger_products.productcode, vtiger_products.commissionrate, - vtiger_products.qty_per_unit, vtiger_products.unit_price, - vtiger_crmentity.crmid, vtiger_crmentity.smownerid - FROM vtiger_products - INNER JOIN vtiger_seproductsrel - ON vtiger_products.productid = vtiger_seproductsrel.productid - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_products.productid - INNER JOIN vtiger_account - ON vtiger_account.accountid = vtiger_seproductsrel.crmid - WHERE vtiger_account.accountid = ".$id." - AND vtiger_crmentity.deleted = 0"; - $log->debug("Exiting get_products method ..."); - return GetRelatedList('Accounts','Products',$focus,$query,$button,$returnset); - } - - /** Function to export the account records in CSV Format - * @param reference variable - order by is passed when the query is executed - * @param reference variable - where condition is passed when the query is executed - * Returns Export Accounts Query. - */ - function create_export_query(&$order_by, &$where) - { - global $log; - $log->debug("Entering create_export_query(".$order_by.",".$where.") method ..."); - if($this->checkIfCustomTableExists('vtiger_accountscf')) - { - - $query = $this->constructCustomQueryAddendum('vtiger_accountscf','Accounts') . " - vtiger_account.*, - ".$this->entity_table.".*, - vtiger_accountbillads.city AS billing_city, - vtiger_accountbillads.country AS billing_country, - vtiger_accountbillads.code AS billing_code, - vtiger_accountbillads.state AS billing_state, - vtiger_accountbillads.street AS billing_street, - vtiger_accountshipads.city AS shipping_city, - vtiger_accountshipads.country AS shipping_country, - vtiger_accountshipads.code AS shipping_code, - vtiger_accountshipads.state AS shipping_state, - vtiger_accountshipads.street AS shipping_street, - vtiger_users.user_name, - vtiger_users.status AS user_status - FROM ".$this->entity_table." - INNER JOIN vtiger_account - ON vtiger_crmentity.crmid = vtiger_account.accountid - LEFT JOIN vtiger_accountbillads - ON vtiger_account.accountid = vtiger_accountbillads.accountaddressid - LEFT JOIN vtiger_accountshipads - ON vtiger_account.accountid = vtiger_accountshipads.accountaddressid - LEFT JOIN vtiger_accountscf - ON vtiger_accountscf.accountid = vtiger_account.accountid - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id "; - - } - else - { - $query = "SELECT vtiger_account.*, - ".$this->entity_table.".*, - vtiger_accountbillads.city AS billing_city, - vtiger_accountbillads.country AS billing_country, - vtiger_accountbillads.code AS billing_code, - vtiger_accountbillads.state AS billing_state, - vtiger_accountbillads.street AS billing_street, - vtiger_accountshipads.city AS shipping_city, - vtiger_accountshipads.country AS shipping_country, - vtiger_accountshipads.code AS shipping_code, - vtiger_accountshipads.state AS shipping_state, - vtiger_accountshipads.street AS shipping_street, - vtiger_users.user_name, - vtiger_users.status AS user_status - FROM ".$this->entity_table." - INNER JOIN vtiger_account - ON vtiger_crmentity.crmid = vtiger_account.accountid - LEFT JOIN vtiger_accountbillads - ON vtiger_account.accountid = vtiger_accountbillads.accountaddressid - LEFT JOIN vtiger_accountshipads - ON vtiger_account.accountid = vtiger_accountshipads.accountaddressid - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id "; - } - - $where_auto = " vtiger_users.status = 'Active' - AND vtiger_crmentity.deleted = 0 "; - - if($where != "") - $query .= "WHERE ($where) AND ".$where_auto; - else - $query .= "WHERE ".$where_auto; - - if(!empty($order_by)) - $query .= " ORDER BY $order_by"; - $log->debug("Exiting create_export_query method ..."); - return $query; - } - - /** Function to get the Columnnames of the Account Record - * Used By vtigerCRM Word Plugin - * Returns the Merge Fields for Word Plugin - */ - function getColumnNames_Acnt() - { - global $log; - $log->debug("Entering getColumnNames_Acnt() method ..."); - $sql1 = "SELECT fieldlabel FROM vtiger_field WHERE tabid = 6"; - $result = $this->db->query($sql1); - $numRows = $this->db->num_rows($result); - for($i=0; $i < $numRows;$i++) - { - $custom_fields[$i] = $this->db->query_result($result,$i,"fieldlabel"); - $custom_fields[$i] = ereg_replace(" ","",$custom_fields[$i]); - $custom_fields[$i] = strtoupper($custom_fields[$i]); - } - $mergeflds = $custom_fields; - $log->debug("Exiting getColumnNames_Acnt method ..."); - return $mergeflds; - } - -} - -?> +'crmid','vtiger_account'=>'accountid','vtiger_accountbillads'=>'accountaddressid','vtiger_accountshipads'=>'accountaddressid','vtiger_accountscf'=>'accountid'); + + var $entity_table = "vtiger_crmentity"; + + var $billadr_table = "vtiger_accountbillads"; + + var $object_name = "Accounts"; + // Mike Crowe Mod --------------------------------------------------------added for general search + var $base_table_name = "vtiger_account"; + var $cf_table_name = "vtiger_accountscf"; + + var $new_schema = true; + + var $module_id = "accountid"; + + var $column_fields = Array(); + + var $sortby_fields = Array('accountname','city','website','phone','smownerid'); + + + // This is the list of vtiger_fields that are in the lists. + var $list_fields = Array( + 'Account Name'=>Array('vtiger_account'=>'accountname'), + 'City'=>Array('vtiger_accountbillads'=>'city'), + 'Website'=>Array('vtiger_account'=>'website'), + 'Phone'=>Array('vtiger_account'=> 'phone'), + 'Assigned To'=>Array('vtiger_crmentity'=>'smownerid') + ); + + var $list_fields_name = Array( + 'Account Name'=>'accountname', + 'City'=>'bill_city', + 'Website'=>'website', + 'Phone'=>'phone', + 'Assigned To'=>'assigned_user_id' + ); + var $list_link_field= 'accountname'; + + var $search_fields = Array( + 'Account Name'=>Array('vtiger_account'=>'accountname'), + 'City'=>Array('vtiger_accountbillads'=>'city'), + ); + + var $search_fields_name = Array( + 'Account Name'=>'accountname', + 'City'=>'bill_city', + ); + + // This is the list of vtiger_fields that are required. + var $required_fields = array("accountname"=>1); + + //Added these variables which are used as default order by and sortorder in ListView + var $default_order_by = 'accountname'; + var $default_sort_order = 'ASC'; + + function Account() { + $this->log =LoggerManager::getLogger('account'); + $this->db = new PearDatabase(); + $this->column_fields = getColumnFields('Accounts'); + } + + // Mike Crowe Mod --------------------------------------------------------Default ordering for us + /** + * Function to get sort order + * return string $sorder - sortorder string either 'ASC' or 'DESC' + */ + function getSortOrder() + { + global $log; + $log->debug("Entering getSortOrder() method ..."); + if(isset($_REQUEST['sorder'])) + $sorder = $_REQUEST['sorder']; + else + $sorder = (($_SESSION['ACCOUNTS_SORT_ORDER'] != '')?($_SESSION['ACCOUNTS_SORT_ORDER']):($this->default_sort_order)); + $log->debug("Exiting getSortOrder() method ..."); + return $sorder; + } + /** + * Function to get order by + * return string $order_by - fieldname(eg: 'accountname') + */ + function getOrderBy() + { + global $log; + $log->debug("Entering getOrderBy() method ..."); + if (isset($_REQUEST['order_by'])) + $order_by = $_REQUEST['order_by']; + else + $order_by = (($_SESSION['ACCOUNTS_ORDER_BY'] != '')?($_SESSION['ACCOUNTS_ORDER_BY']):($this->default_order_by)); + $log->debug("Exiting getOrderBy method ..."); + return $order_by; + } + // Mike Crowe Mod -------------------------------------------------------- + + + /** Returns a list of the associated contacts + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function get_contacts($id) + { + global $log; + $log->debug("Entering get_contacts(".$id.") method ..."); + global $mod_strings; + + $focus = new Contact(); + + $button = ''; + if(isPermitted("Contacts",1,"") == 'yes') + { + $button .= ' '; + } + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + //SQL + $query = "SELECT vtiger_contactdetails.*, + vtiger_crmentity.crmid, + vtiger_crmentity.smownerid, + vtiger_users.user_name + FROM vtiger_contactdetails + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_contactdetails.contactid + LEFT JOIN vtiger_contactgrouprelation + ON vtiger_contactdetails.contactid = vtiger_contactgrouprelation.contactid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id + WHERE vtiger_crmentity.deleted = 0 + AND vtiger_contactdetails.accountid = ".$id; + $log->debug("Exiting get_contacts method ..."); + return GetRelatedList('Accounts','Contacts',$focus,$query,$button,$returnset); + } + + /** Returns a list of the associated opportunities + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function get_opportunities($id) + { + global $log; + $log->debug("Entering get_opportunities(".$id.") method ..."); + global $mod_strings; + + $focus = new Potential(); + $button = ''; + + if(isPermitted("Potentials",1,"") == 'yes') + { + $button .= ''; + } + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_potential.potentialid, vtiger_potential.accountid, + vtiger_potential.potentialname, vtiger_potential.sales_stage, + vtiger_potential.potentialtype, vtiger_potential.amount, + vtiger_potential.closingdate, vtiger_potential.potentialtype, + vtiger_users.user_name, + vtiger_crmentity.crmid, vtiger_crmentity.smownerid + FROM vtiger_potential + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_potential.potentialid + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id + LEFT JOIN vtiger_potentialgrouprelation + ON vtiger_potential.potentialid = vtiger_potentialgrouprelation.potentialid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_potentialgrouprelation.groupname + WHERE vtiger_crmentity.deleted = 0 + AND vtiger_potential.accountid = ".$id; + $log->debug("Exiting get_opportunities method ..."); + + return GetRelatedList('Accounts','Potentials',$focus,$query,$button,$returnset); + } + + /** Returns a list of the associated tasks + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function get_activities($id) + { + global $log; + $log->debug("Entering get_activities(".$id.") method ..."); + global $mod_strings; + + $focus = new Activity(); + $button = ''; + if(isPermitted("Calendar",1,"") == 'yes') + { + + $button .= ' '; + $button .= ' '; + } + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_activity.*, + vtiger_seactivityrel.*, + vtiger_crmentity.crmid, vtiger_crmentity.smownerid, + vtiger_crmentity.modifiedtime, + vtiger_users.user_name, + vtiger_recurringevents.recurringtype + FROM vtiger_activity + INNER JOIN vtiger_seactivityrel + ON vtiger_seactivityrel.activityid = vtiger_activity.activityid + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_activity.activityid + LEFT JOIN vtiger_users + ON vtiger_users.id = vtiger_crmentity.smownerid + LEFT OUTER JOIN vtiger_recurringevents + ON vtiger_recurringevents.activityid = vtiger_activity.activityid + LEFT JOIN vtiger_activitygrouprelation + ON vtiger_activitygrouprelation.activityid = vtiger_crmentity.crmid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_activitygrouprelation.groupname + WHERE vtiger_seactivityrel.crmid = ".$id." + AND (activitytype='Task' + OR activitytype='Call' + OR activitytype='Meeting') + AND vtiger_crmentity.deleted = 0 + AND ((vtiger_activity.status IS NOT NULL + AND vtiger_activity.status != 'Completed') + AND (vtiger_activity.status IS NOT NULL + AND vtiger_activity.status != 'Deferred') + OR (vtiger_activity.eventstatus !='' + AND vtiger_activity.eventstatus != 'Held'))"; + $log->debug("Exiting get_activities method ..."); + return GetRelatedList('Accounts','Calendar',$focus,$query,$button,$returnset); + + } + /** + * Function to get Account related Task & Event which have activity type Held, Completed or Deferred. + * @param integer $id - accountid + * returns related Task or Event record in array format + */ + function get_history($id) + { + global $log; + $log->debug("Entering get_history(".$id.") method ..."); + $query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, + vtiger_activity.status, vtiger_activity.eventstatus, + vtiger_activity.activitytype, + vtiger_crmentity.modifiedtime, vtiger_crmentity.createdtime, + vtiger_crmentity.description, + vtiger_users.user_name + FROM vtiger_activity + INNER JOIN vtiger_seactivityrel + ON vtiger_seactivityrel.activityid = vtiger_activity.activityid + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_activity.activityid + LEFT JOIN vtiger_activitygrouprelation + ON vtiger_activitygrouprelation.activityid = vtiger_activity.activityid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_activitygrouprelation.groupname + INNER JOIN vtiger_users + ON vtiger_crmentity.smcreatorid = vtiger_users.id + WHERE (vtiger_activity.activitytype = 'Meeting' + OR vtiger_activity.activitytype = 'Call' + OR vtiger_activity.activitytype = 'Task') + AND (vtiger_activity.status = 'Completed' + OR vtiger_activity.status = 'Deferred' + OR (vtiger_activity.eventstatus = 'Held' + AND vtiger_activity.eventstatus != '')) + AND vtiger_seactivityrel.crmid = ".$id; + //Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php + $log->debug("Exiting get_history method ..."); + return getHistory('Accounts',$query,$id); + } + /** + * Function to get Account related Attachments + * @param integer $id - accountid + * returns related Attachment record in array format + */ + function get_attachments($id) + { + global $log; + $log->debug("Entering get_attachments(".$id.") method ..."); + // Armando L?scher 18.10.2005 -> ?visibleDescription + // Desc: Inserted crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name + // Inserted inner join vtiger_users on crm2.smcreatorid= vtiger_users.id + $query = "SELECT vtiger_notes.title, vtiger_notes.notecontent AS description, + vtiger_notes.filename, vtiger_notes.notesid AS crmid, + 'Notes ' AS ActivityType, + vtiger_attachments.type AS FileType, + crm2.modifiedtime AS lastmodified, crm2.createdtime, + vtiger_seattachmentsrel.attachmentsid, + vtiger_users.user_name + FROM vtiger_notes + INNER JOIN vtiger_senotesrel + ON vtiger_senotesrel.notesid = vtiger_notes.notesid + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_senotesrel.crmid + INNER JOIN vtiger_crmentity crm2 + ON crm2.crmid = vtiger_notes.notesid + AND crm2.deleted = 0 + LEFT JOIN vtiger_seattachmentsrel + ON vtiger_seattachmentsrel.crmid = vtiger_notes.notesid + LEFT JOIN vtiger_attachments + ON vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid + INNER JOIN vtiger_users + ON crm2.smcreatorid = vtiger_users.id + WHERE vtiger_crmentity.crmid = ".$id." + UNION ALL + SELECT vtiger_attachments.description AS title, vtiger_attachments.description, + vtiger_attachments.name AS filename, + vtiger_seattachmentsrel.attachmentsid AS crmid, + 'Attachments' AS ActivityType, + vtiger_attachments.type AS FileType, + crm2.modifiedtime AS lastmodified, crm2.createdtime, + vtiger_attachments.attachmentsid, + vtiger_users.user_name + FROM vtiger_attachments + INNER JOIN vtiger_seattachmentsrel + ON vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_seattachmentsrel.crmid + INNER JOIN vtiger_crmentity crm2 + ON crm2.crmid = vtiger_attachments.attachmentsid + INNER JOIN vtiger_users + ON crm2.smcreatorid = vtiger_users.id + WHERE vtiger_crmentity.crmid = ".$id." + ORDER BY createdtime DESC"; + $log->debug("Exiting get_attachments method ..."); + return getAttachmentsAndNotes('Accounts',$query,$id); + } + /** + * Function to get Account related Quotes + * @param integer $id - accountid + * returns related Quotes record in array format + */ + function get_quotes($id) + { + global $log; + $log->debug("Entering get_quotes(".$id.") method ..."); + global $app_strings; + require_once('modules/Quotes/Quote.php'); + + $focus = new Quote(); + + $button = ''; + if(isPermitted("Quotes",1,"") == 'yes') + { + $button .= ' '; + } + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_users.user_name, + vtiger_groups.groupname, + vtiger_crmentity.*, + vtiger_quotes.*, + vtiger_potential.potentialname, + vtiger_account.accountname + FROM vtiger_quotes + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_quotes.quoteid + LEFT OUTER JOIN vtiger_account + ON vtiger_account.accountid = vtiger_quotes.accountid + LEFT OUTER JOIN vtiger_potential + ON vtiger_potential.potentialid = vtiger_quotes.potentialid + LEFT JOIN vtiger_quotegrouprelation + ON vtiger_quotes.quoteid = vtiger_quotegrouprelation.quoteid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_quotegrouprelation.groupname + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id + WHERE vtiger_crmentity.deleted = 0 + AND vtiger_account.accountid = ".$id; + $log->debug("Exiting get_quotes method ..."); + return GetRelatedList('Accounts','Quotes',$focus,$query,$button,$returnset); + } + /** + * Function to get Account related Invoices + * @param integer $id - accountid + * returns related Invoices record in array format + */ + function get_invoices($id) + { + global $log; + $log->debug("Entering get_invoices(".$id.") method ..."); + global $app_strings; + require_once('modules/Invoice/Invoice.php'); + + $focus = new Invoice(); + + $button = ''; + if(isPermitted("Invoice",1,"") == 'yes') + { + $button .= ' '; + } + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_users.user_name, + vtiger_groups.groupname, + vtiger_crmentity.*, + vtiger_invoice.*, + vtiger_account.accountname, + vtiger_salesorder.subject AS salessubject + FROM vtiger_invoice + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_invoice.invoiceid + LEFT OUTER JOIN vtiger_account + ON vtiger_account.accountid = vtiger_invoice.accountid + LEFT OUTER JOIN vtiger_salesorder + ON vtiger_salesorder.salesorderid = vtiger_invoice.salesorderid + LEFT JOIN vtiger_invoicegrouprelation + ON vtiger_invoice.invoiceid = vtiger_invoicegrouprelation.invoiceid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_invoicegrouprelation.groupname + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id + WHERE vtiger_crmentity.deleted = 0 + AND vtiger_account.accountid = ".$id; + $log->debug("Exiting get_invoices method ..."); + return GetRelatedList('Accounts','Invoice',$focus,$query,$button,$returnset); + } + + /** + * Function to get Account related SalesOrder + * @param integer $id - accountid + * returns related SalesOrder record in array format + */ + function get_salesorder($id) + { + global $log; + $log->debug("Entering get_salesorder(".$id.") method ..."); + require_once('modules/SalesOrder/SalesOrder.php'); + global $app_strings; + + $focus = new SalesOrder(); + + $button = ''; + if(isPermitted("SalesOrder",1,"") == 'yes') + { + $button .= ' '; + } + + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_crmentity.*, + vtiger_salesorder.*, + vtiger_quotes.subject AS quotename, + vtiger_account.accountname, + vtiger_users.user_name, + vtiger_groups.groupname + FROM vtiger_salesorder + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_salesorder.salesorderid + LEFT OUTER JOIN vtiger_quotes + ON vtiger_quotes.quoteid = vtiger_salesorder.quoteid + LEFT OUTER JOIN vtiger_account + ON vtiger_account.accountid = vtiger_salesorder.accountid + LEFT JOIN vtiger_sogrouprelation + ON vtiger_salesorder.salesorderid = vtiger_sogrouprelation.salesorderid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_sogrouprelation.groupname + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id + WHERE vtiger_crmentity.deleted = 0 + AND vtiger_salesorder.accountid = ".$id; + $log->debug("Exiting get_salesorder method ..."); + return GetRelatedList('Accounts','SalesOrder',$focus,$query,$button,$returnset); + } + /** + * Function to get Account related Tickets + * @param integer $id - accountid + * returns related Ticket record in array format + */ + function get_tickets($id) + { + global $log; + $log->debug("Entering get_tickets(".$id.") method ..."); + global $app_strings; + + $focus = new HelpDesk(); + $button = ''; + + $button .= ''; + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_users.user_name, vtiger_users.id, + vtiger_troubletickets.title, vtiger_troubletickets.ticketid AS crmid, + vtiger_troubletickets.status, vtiger_troubletickets.priority, + vtiger_troubletickets.parent_id, + vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime + FROM vtiger_troubletickets + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid + LEFT JOIN vtiger_account + ON vtiger_account.accountid = vtiger_troubletickets.parent_id + LEFT JOIN vtiger_contactdetails + ON vtiger_contactdetails.contactid=vtiger_troubletickets.parent_id + LEFT JOIN vtiger_users + ON vtiger_users.id=vtiger_crmentity.smownerid + LEFT JOIN vtiger_ticketgrouprelation + ON vtiger_troubletickets.ticketid = vtiger_ticketgrouprelation.ticketid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_ticketgrouprelation.groupname + WHERE vtiger_troubletickets.parent_id=".$id." or " ; + + $query .= "vtiger_troubletickets.parent_id in(SELECT vtiger_contactdetails.contactid + FROM vtiger_contactdetails + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_contactdetails.contactid + LEFT JOIN vtiger_contactgrouprelation + ON vtiger_contactdetails.contactid = vtiger_contactgrouprelation.contactid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id + WHERE vtiger_crmentity.deleted = 0 + AND vtiger_contactdetails.accountid = ".$id; + + + //Appending the security parameter + global $current_user; + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + $tab_id=getTabid('Contacts'); + if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[$tab_id] == 3) + { + $sec_parameter=getListViewSecurityParameter('Contacts'); + $query .= ' '.$sec_parameter; + + } + + $query .= ") "; + + /* + $query .= " UNION ALL + SELECT vtiger_users.user_name, vtiger_users.id, + vtiger_troubletickets.title, vtiger_troubletickets.ticketid AS crmid, + vtiger_troubletickets.status, vtiger_troubletickets.priority, + vtiger_troubletickets.parent_id, + vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime + FROM vtiger_troubletickets + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid + LEFT JOIN vtiger_contactdetails + ON vtiger_contactdetails.contactid = vtiger_troubletickets.parent_id + LEFT JOIN vtiger_account + ON vtiger_account.accountid = vtiger_contactdetails.accountid + LEFT JOIN vtiger_users + ON vtiger_users.id = vtiger_crmentity.smownerid + LEFT JOIN vtiger_ticketgrouprelation + ON vtiger_troubletickets.ticketid = vtiger_ticketgrouprelation.ticketid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_ticketgrouprelation.groupname + WHERE vtiger_account.accountid = ".$id; + */ + $log->debug("Exiting get_tickets method ..."); + return GetRelatedList('Accounts','HelpDesk',$focus,$query,$button,$returnset); + } + /** + * Function to get Account related Products + * @param integer $id - accountid + * returns related Products record in array format + */ + function get_products($id) + { + global $log; + $log->debug("Entering get_products(".$id.") method ..."); + require_once('modules/Products/Product.php'); + global $app_strings; + + $focus = new Product(); + + $button = ''; + + if(isPermitted("Products",1,"") == 'yes') + { + + + $button .= ' '; + } + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_products.productid, vtiger_products.productname, + vtiger_products.productcode, vtiger_products.commissionrate, + vtiger_products.qty_per_unit, vtiger_products.unit_price, + vtiger_crmentity.crmid, vtiger_crmentity.smownerid + FROM vtiger_products + INNER JOIN vtiger_seproductsrel + ON vtiger_products.productid = vtiger_seproductsrel.productid + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_products.productid + INNER JOIN vtiger_account + ON vtiger_account.accountid = vtiger_seproductsrel.crmid + WHERE vtiger_account.accountid = ".$id." + AND vtiger_crmentity.deleted = 0"; + $log->debug("Exiting get_products method ..."); + return GetRelatedList('Accounts','Products',$focus,$query,$button,$returnset); + } + + /** Function to export the account records in CSV Format + * @param reference variable - order by is passed when the query is executed + * @param reference variable - where condition is passed when the query is executed + * Returns Export Accounts Query. + */ + function create_export_query(&$order_by, &$where) + { + global $log; + $log->debug("Entering create_export_query(".$order_by.",".$where.") method ..."); + if($this->checkIfCustomTableExists('vtiger_accountscf')) + { + + $query = $this->constructCustomQueryAddendum('vtiger_accountscf','Accounts') . " + vtiger_account.*, + ".$this->entity_table.".*, + vtiger_accountbillads.city AS billing_city, + vtiger_accountbillads.country AS billing_country, + vtiger_accountbillads.code AS billing_code, + vtiger_accountbillads.state AS billing_state, + vtiger_accountbillads.street AS billing_street, + vtiger_accountshipads.city AS shipping_city, + vtiger_accountshipads.country AS shipping_country, + vtiger_accountshipads.code AS shipping_code, + vtiger_accountshipads.state AS shipping_state, + vtiger_accountshipads.street AS shipping_street, + vtiger_users.user_name, + vtiger_users.status AS user_status + FROM ".$this->entity_table." + INNER JOIN vtiger_account + ON vtiger_crmentity.crmid = vtiger_account.accountid + LEFT JOIN vtiger_accountbillads + ON vtiger_account.accountid = vtiger_accountbillads.accountaddressid + LEFT JOIN vtiger_accountshipads + ON vtiger_account.accountid = vtiger_accountshipads.accountaddressid + LEFT JOIN vtiger_accountscf + ON vtiger_accountscf.accountid = vtiger_account.accountid + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id "; + + } + else + { + $query = "SELECT vtiger_account.*, + ".$this->entity_table.".*, + vtiger_accountbillads.city AS billing_city, + vtiger_accountbillads.country AS billing_country, + vtiger_accountbillads.code AS billing_code, + vtiger_accountbillads.state AS billing_state, + vtiger_accountbillads.street AS billing_street, + vtiger_accountshipads.city AS shipping_city, + vtiger_accountshipads.country AS shipping_country, + vtiger_accountshipads.code AS shipping_code, + vtiger_accountshipads.state AS shipping_state, + vtiger_accountshipads.street AS shipping_street, + vtiger_users.user_name, + vtiger_users.status AS user_status + FROM ".$this->entity_table." + INNER JOIN vtiger_account + ON vtiger_crmentity.crmid = vtiger_account.accountid + LEFT JOIN vtiger_accountbillads + ON vtiger_account.accountid = vtiger_accountbillads.accountaddressid + LEFT JOIN vtiger_accountshipads + ON vtiger_account.accountid = vtiger_accountshipads.accountaddressid + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id "; + } + + $where_auto = " vtiger_users.status = 'Active' + AND vtiger_crmentity.deleted = 0 "; + + if($where != "") + $query .= "WHERE ($where) AND ".$where_auto; + else + $query .= "WHERE ".$where_auto; + + if(!empty($order_by)) + $query .= " ORDER BY $order_by"; + $log->debug("Exiting create_export_query method ..."); + return $query; + } + + /** Function to get the Columnnames of the Account Record + * Used By vtigerCRM Word Plugin + * Returns the Merge Fields for Word Plugin + */ + function getColumnNames_Acnt() + { + global $log,$current_user; + $log->debug("Entering getColumnNames_Acnt() method ..."); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "SELECT fieldlabel FROM vtiger_field WHERE tabid = 6"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldlabel from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=6 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result = $this->db->query($sql1); + $numRows = $this->db->num_rows($result); + for($i=0; $i < $numRows;$i++) + { + $custom_fields[$i] = $this->db->query_result($result,$i,"fieldlabel"); + $custom_fields[$i] = ereg_replace(" ","",$custom_fields[$i]); + $custom_fields[$i] = strtoupper($custom_fields[$i]); + } + $mergeflds = $custom_fields; + $log->debug("Exiting getColumnNames_Acnt method ..."); + return $mergeflds; + } + +} + +?> Modified: vtigercrm/trunk/modules/Contacts/Contact.php ============================================================================== --- vtigercrm/trunk/modules/Contacts/Contact.php (original) +++ vtigercrm/trunk/modules/Contacts/Contact.php Wed Aug 23 08:00:50 2006 @@ -604,9 +604,17 @@ */ function getColumnNames() { - global $log; + global $log,$current_user; $log->debug("Entering getColumnNames() method ..."); - $sql1 = "select fieldlabel from vtiger_field where tabid=4 and block <> 6 and block <> 75"; + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select fieldlabel from vtiger_field where tabid=4 and block <> 75"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldlabel from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=4 and vtiger_field.block <> 6 and vtiger_field.block <> 75 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } $result = $this->db->query($sql1); $numRows = $this->db->num_rows($result); for($i=0; $i < $numRows;$i++) Modified: vtigercrm/trunk/modules/HelpDesk/HelpDesk.php ============================================================================== --- vtigercrm/trunk/modules/HelpDesk/HelpDesk.php (original) +++ vtigercrm/trunk/modules/HelpDesk/HelpDesk.php Wed Aug 23 08:00:50 2006 @@ -1,462 +1,470 @@ -'crmid','vtiger_troubletickets'=>'ticketid','vtiger_seticketsrel'=>'ticketid','vtiger_ticketcf'=>'ticketid','vtiger_ticketcomments'=>'ticketid','vtiger_attachments'=>'attachmentsid'); - var $column_fields = Array(); - - var $sortby_fields = Array('title','status','priority','crmid','firstname','smownerid'); - - var $list_fields = Array( - 'Ticket ID'=>Array('crmentity'=>'crmid'), - 'Subject'=>Array('troubletickets'=>'title'), - 'Related to'=>Array('troubletickets'=>'parent_id'), - 'Status'=>Array('troubletickets'=>'status'), - 'Priority'=>Array('troubletickets'=>'priority'), - 'Assigned To'=>Array('crmentity','smownerid') - ); - - var $list_fields_name = Array( - 'Ticket ID'=>'', - 'Subject'=>'ticket_title', - 'Related to'=>'parent_id', - 'Status'=>'ticketstatus', - 'Priority'=>'ticketpriorities', - 'Assigned To'=>'assigned_user_id' - ); - - var $list_link_field= 'ticket_title'; - - var $range_fields = Array( - 'ticketid', - 'title', - 'firstname', - 'lastname', - 'parent_id', - 'productid', - 'productname', - 'priority', - 'severity', - 'status', - 'category', - 'description', - 'solution', - 'modifiedtime', - 'createdtime' - ); - - //Added these variables which are used as default order by and sortorder in ListView - var $default_order_by = 'crmid'; - var $default_sort_order = 'DESC'; - - /** Constructor which will set the column_fields in this object - */ - function HelpDesk() - { - $this->log =LoggerManager::getLogger('helpdesk'); - $this->log->debug("Entering HelpDesk() method ..."); - $this->db = new PearDatabase(); - $this->column_fields = getColumnFields('HelpDesk'); - $this->log->debug("Exiting HelpDesk method ..."); - } - - /** Function used to get the sort order for HelpDesk listview - * @return string $sorder - first check the $_REQUEST['sorder'] if request value is empty then check in the $_SESSION['HELPDESK_SORT_ORDER'] if this session value is empty then default sort order will be returned. - */ - function getSortOrder() - { - global $log; - $log->debug("Entering getSortOrder() method ..."); - if(isset($_REQUEST['sorder'])) - $sorder = $_REQUEST['sorder']; - else - $sorder = (($_SESSION['HELPDESK_SORT_ORDER'] != '')?($_SESSION['HELPDESK_SORT_ORDER']):($this->default_sort_order)); - $log->debug("Exiting getSortOrder() method ..."); - return $sorder; - } - - /** Function used to get the order by value for HelpDesk listview - * @return string $order_by - first check the $_REQUEST['order_by'] if request value is empty then check in the $_SESSION['HELPDESK_ORDER_BY'] if this session value is empty then default order by will be returned. - */ - function getOrderBy() - { - global $log; - $log->debug("Entering getOrderBy() method ..."); - if (isset($_REQUEST['order_by'])) - $order_by = $_REQUEST['order_by']; - else - $order_by = (($_SESSION['HELPDESK_ORDER_BY'] != '')?($_SESSION['HELPDESK_ORDER_BY']):($this->default_order_by)); - $log->debug("Exiting getOrderBy method ..."); - return $order_by; - } - - /** Function to form the query to get the list of activities - * @param int $id - ticket id - * @return array - return an array which will be returned from the function GetRelatedList - **/ - function get_activities($id) - { - global $log; - $log->debug("Entering get_activities(".$id.") method ..."); - global $mod_strings; - global $app_strings; - require_once('modules/Calendar/Activity.php'); - $focus = new Activity(); - - $button = ''; - - $returnset = '&return_module=HelpDesk&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_activity.*, vtiger_crmentity.crmid, vtiger_recurringevents.recurringtype, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_users.user_name from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.crmid=".$id." and (activitytype='Task' or activitytype='Call' or activitytype='Meeting') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held')"; - $log->debug("Exiting get_activities method ..."); - - return GetRelatedList('HelpDesk','Calendar',$focus,$query,$button,$returnset); - } - - /** Function to get the Ticket History information as in array format - * @param int $ticketid - ticket id - * @return array - return an array with title and the ticket history informations in the following format - array( - header=>array('0'=>'title'), - entries=>array('0'=>'info1','1'=>'info2',etc.,) - ) - */ - function get_ticket_history($ticketid) - { - global $log, $adb; - $log->debug("Entering into get_ticket_history($ticketid) method ..."); - - $query="select title,update_log from vtiger_troubletickets where ticketid=".$ticketid; - $result=$adb->query($query); - $update_log = $adb->query_result($result,0,"update_log"); - - $splitval = split('--//--',trim($update_log,'--//--')); - - $header[] = $adb->query_result($result,0,"title"); - - $return_value = Array('header'=>$header,'entries'=>$splitval); - - $log->debug("Exiting from get_ticket_history($ticketid) method ..."); - - return $return_value; - } - - /** Function to form the query to get the list of attachments and notes - * @param int $id - ticket id - * @return array - return an array which will be returned from the function getAttachmentsAndNotes - **/ - function get_attachments($id) - { - global $log; - $log->debug("Entering get_attachments(".$id.") method ..."); - $query = "select vtiger_notes.title,'Notes ' ActivityType, vtiger_notes.filename, - vtiger_attachments.type FileType,crm2.modifiedtime lastmodified, - vtiger_seattachmentsrel.attachmentsid attachmentsid, vtiger_notes.notesid crmid, - crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name - from vtiger_notes - inner join vtiger_senotesrel on vtiger_senotesrel.notesid= vtiger_notes.notesid - inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_senotesrel.crmid - inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_notes.notesid and crm2.deleted=0 - left join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid =vtiger_notes.notesid - left join vtiger_attachments on vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid - inner join vtiger_users on crm2.smcreatorid= vtiger_users.id - where vtiger_crmentity.crmid=".$id; - - $query .= ' union all '; - - $query .= "select vtiger_attachments.description title ,'Attachments' ActivityType, - vtiger_attachments.name filename, vtiger_attachments.type FileType,crm2.modifiedtime lastmodified, - vtiger_attachments.attachmentsid attachmentsid, vtiger_seattachmentsrel.attachmentsid crmid, - crm2.createdtime, vtiger_attachments.description, vtiger_users.user_name - from vtiger_attachments - inner join vtiger_seattachmentsrel on vtiger_seattachmentsrel.attachmentsid= vtiger_attachments.attachmentsid - inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_seattachmentsrel.crmid - inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_attachments.attachmentsid - left join vtiger_users on crm2.smcreatorid= vtiger_users.id - where vtiger_crmentity.crmid=".$id; - $log->debug("Exiting get_attachments method ..."); - return getAttachmentsAndNotes('HelpDesk',$query,$id); - } - - /** Function to get the ticket comments as a array - * @param int $ticketid - ticketid - * @return array $output - array( - [$i][comments] => comments - [$i][owner] => name of the user or customer who made the comment - [$i][createdtime] => the comment created time - ) - where $i = 0,1,..n which are all made for the ticket - **/ - function get_ticket_comments_list($ticketid) - { - global $log; - $log->debug("Entering get_ticket_comments_list(".$ticketid.") method ..."); - $sql = "select * from vtiger_ticketcomments where ticketid=".$ticketid." order by createdtime DESC"; - $result = $this->db->query($sql); - $noofrows = $this->db->num_rows($result); - for($i=0;$i<$noofrows;$i++) - { - $ownerid = $this->db->query_result($result,$i,"ownerid"); - $ownertype = $this->db->query_result($result,$i,"ownertype"); - if($ownertype == 'user') - $name = getUserName($ownerid); - elseif($ownertype == 'customer') - { - $sql1 = 'select * from vtiger_portalinfo where id='.$ownerid; - $name = $this->db->query_result($this->db->query($sql1),0,'user_name'); - } - - $output[$i]['comments'] = nl2br($this->db->query_result($result,$i,"comments")); - $output[$i]['owner'] = $name; - $output[$i]['createdtime'] = $this->db->query_result($result,$i,"createdtime"); - } - $log->debug("Exiting get_ticket_comments_list method ..."); - return $output; - } - - /** Function to form the query which will give the list of tickets based on customername and id ie., contactname and contactid - * @param string $user_name - name of the customer ie., contact name - * @param int $id - contact id - * @return array - return an array which will be returned from the function process_list_query - **/ - function get_user_tickets_list($user_name,$id,$where='',$match='') - { - global $log; - $log->debug("Entering get_user_tickets_list(".$user_name.",".$id.",".$where.",".$match.") method ..."); - - $this->db->println("where ==> ".$where); - - $query = "select vtiger_crmentity.crmid, vtiger_troubletickets.*, vtiger_crmentity.smownerid, vtiger_crmentity.createdtime, vtiger_crmentity.modifiedtime, vtiger_contactdetails.firstname, vtiger_contactdetails.lastname, vtiger_products.productid, vtiger_products.productname, vtiger_ticketcf.* from vtiger_troubletickets inner join vtiger_ticketcf on vtiger_ticketcf.ticketid = vtiger_troubletickets.ticketid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_troubletickets.ticketid left join vtiger_contactdetails on vtiger_troubletickets.parent_id=vtiger_contactdetails.contactid left join vtiger_products on vtiger_products.productid = vtiger_troubletickets.product_id left join vtiger_users on vtiger_crmentity.smownerid=vtiger_users.id where vtiger_crmentity.deleted=0 and vtiger_contactdetails.email='".$user_name."' and vtiger_troubletickets.parent_id = '".$id."'"; - - if(trim($where) != '') - { - if($match == 'all' || $match == '') - { - $join = " and "; - } - elseif($match == 'any') - { - $join = " or "; - } - $where = explode("&&&",$where); - $count = count($where); - $count --; - $where_conditions = ""; - foreach($where as $key => $value) - { - $this->db->println('key : '.$key.'...........value : '.$value); - $val = explode(" = ",$value); - $this->db->println('val0 : '.$val[0].'...........val1 : '.$val[1]); - if($val[0] == 'vtiger_troubletickets.title') - { - $where_conditions .= $val[0]." ".$val[1]; - if($count != $key) $where_conditions .= $join; - } - elseif($val[1] != '' && $val[1] != 'Any') - { - $where_conditions .= $val[0]." = ".$val[1]; - if($count != $key) $where_conditions .= $join; - } - } - if($where_conditions != '') - $where_conditions = " and ( ".$where_conditions." ) "; - - $query .= $where_conditions; - $this->db->println("where condition for customer portal tickets search : ".$where_conditions); - } - - $query .= " order by vtiger_crmentity.crmid desc"; - $log->debug("Exiting get_user_tickets_list method ..."); - return $this->process_list_query($query); - } - - /** Function to process the list query and return the result with number of rows - * @param string $query - query - * @return array $response - array( list => array( - $i => array(key => val) - ), - row_count => '', - next_offset => '', - previous_offset =>'' - ) - where $i=0,1,..n & key = ticketid, title, firstname, ..etc(range_fields) & val = value of the key from db retrieved row - **/ - function process_list_query($query) - { - global $log; - $log->debug("Entering process_list_query(".$query.") method ..."); - - $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); - $list = Array(); - $rows_found = $this->db->getRowCount($result); - if($rows_found != 0) - { - $ticket = Array(); - for($index = 0 , $row = $this->db->fetchByAssoc($result, $index); $row && $index <$rows_found;$index++, $row = $this->db->fetchByAssoc($result, $index)) - { - foreach($this->range_fields as $columnName) - { - if (isset($row[$columnName])) - { - $ticket[$columnName] = $row[$columnName]; - } - else - { - $ticket[$columnName] = ""; - } - } - $list[] = $ticket; - } - } - - $response = Array(); - $response['list'] = $list; - $response['row_count'] = $rows_found; - $response['next_offset'] = $next_offset; - $response['previous_offset'] = $previous_offset; - - $log->debug("Exiting process_list_query method ..."); - return $response; - } - - /** Function to get the HelpDesk field labels in caps letters without space - * @return array $mergeflds - array( key => val ) where key=0,1,2..n & val = ASSIGNEDTO,RELATEDTO, .,etc - **/ - function getColumnNames_Hd() - { - global $log; - $log->debug("Entering getColumnNames_Hd() method ..."); - $sql1 = "select fieldlabel from vtiger_field where tabid=13 and block <> 6 "; - $result = $this->db->query($sql1); - $numRows = $this->db->num_rows($result); - for($i=0; $i < $numRows;$i++) - { - $custom_fields[$i] = $this->db->query_result($result,$i,"fieldlabel"); - $custom_fields[$i] = ereg_replace(" ","",$custom_fields[$i]); - $custom_fields[$i] = strtoupper($custom_fields[$i]); - } - $mergeflds = $custom_fields; - $log->debug("Exiting getColumnNames_Hd method ..."); - return $mergeflds; - } - - /** Function to get the list of comments for the given ticket id - * @param int $ticketid - Ticket id - * @return list $list - return the list of comments and comment informations as a html output where as these comments and comments informations will be formed in div tag. - **/ - function getCommentInformation($ticketid) - { - global $log; - $log->debug("Entering getCommentInformation(".$ticketid.") method ..."); - global $adb; - global $mod_strings; - $sql = "select * from vtiger_ticketcomments where ticketid=".$ticketid; - $result = $adb->query($sql); - $noofrows = $adb->num_rows($result); - - if($noofrows == 0) - { - $log->debug("Exiting getCommentInformation method ..."); - return ''; - } - - $list .= '
'; - for($i=0;$i<$noofrows;$i++) - { - if($adb->query_result($result,$i,'comments') != '') - { - //this div is to display the comment - $list .= '
'; - $list .= make_clickable(nl2br($adb->query_result($result,$i,'comments'))); - - $list .= '
'; - - //this div is to display the author and time - $list .= '
'; - $list .= $mod_strings['LBL_AUTHOR'].' : '; - - if($adb->query_result($result,$i,'ownertype') == 'user') - $list .= getUserName($adb->query_result($result,$i,'ownerid')); - else - $list .= $this->getCustomerName($ticketid); - - $list .= ' on '.$adb->query_result($result,$i,'createdtime').'  '; - - $list .= '
'; - } - } - $list .= '
'; - - $log->debug("Exiting getCommentInformation method ..."); - return $list; - } - - /** Function to get the Customer Name who has made comment to the ticket from the customer portal - * @param int $id - Ticket id - * @return string $customername - The contact name - **/ - function getCustomerName($id) - { - global $log; - $log->debug("Entering getCustomerName(".$id.") method ..."); - global $adb; - $sql = "select * from vtiger_portalinfo inner join vtiger_troubletickets on vtiger_troubletickets.parent_id = vtiger_portalinfo.id where vtiger_troubletickets.ticketid=".$id; - $result = $adb->query($sql); - $customername = $adb->query_result($result,0,'user_name'); - $log->debug("Exiting getCustomerName method ..."); - return $customername; - } - - /** Function used to get the Activity History - * @param int $id - ticket id to which we want to display the activity history - * @return array - return an array which will be returned from the function getHistory - */ - function get_history($id) - { - global $log; - $log->debug("Entering get_history(".$id.") method ..."); - $query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.status, vtiger_activity.eventstatus, - vtiger_activity.activitytype, vtiger_troubletickets.ticketid, vtiger_troubletickets.title, vtiger_crmentity.modifiedtime, - vtiger_crmentity.createdtime, vtiger_crmentity.description, vtiger_users.user_name - from vtiger_activity - inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid= vtiger_activity.activityid - inner join vtiger_troubletickets on vtiger_troubletickets.ticketid = vtiger_seactivityrel.crmid - inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid - left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid - left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname - inner join vtiger_users on vtiger_crmentity.smcreatorid= vtiger_users.id - where (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') - and (vtiger_activity.status = 'Completed' or vtiger_activity.status = 'Deferred' or (vtiger_activity.eventstatus = 'Held' and vtiger_activity.eventstatus != '')) - and vtiger_seactivityrel.crmid=".$id; - //Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php - $log->debug("Entering get_history method ..."); - return getHistory('HelpDesk',$query,$id); - } - - - -} -?> +'crmid','vtiger_troubletickets'=>'ticketid','vtiger_seticketsrel'=>'ticketid','vtiger_ticketcf'=>'ticketid','vtiger_ticketcomments'=>'ticketid','vtiger_attachments'=>'attachmentsid'); + var $column_fields = Array(); + + var $sortby_fields = Array('title','status','priority','crmid','firstname','smownerid'); + + var $list_fields = Array( + 'Ticket ID'=>Array('crmentity'=>'crmid'), + 'Subject'=>Array('troubletickets'=>'title'), + 'Related to'=>Array('troubletickets'=>'parent_id'), + 'Status'=>Array('troubletickets'=>'status'), + 'Priority'=>Array('troubletickets'=>'priority'), + 'Assigned To'=>Array('crmentity','smownerid') + ); + + var $list_fields_name = Array( + 'Ticket ID'=>'', + 'Subject'=>'ticket_title', + 'Related to'=>'parent_id', + 'Status'=>'ticketstatus', + 'Priority'=>'ticketpriorities', + 'Assigned To'=>'assigned_user_id' + ); + + var $list_link_field= 'ticket_title'; + + var $range_fields = Array( + 'ticketid', + 'title', + 'firstname', + 'lastname', + 'parent_id', + 'productid', + 'productname', + 'priority', + 'severity', + 'status', + 'category', + 'description', + 'solution', + 'modifiedtime', + 'createdtime' + ); + + //Added these variables which are used as default order by and sortorder in ListView + var $default_order_by = 'crmid'; + var $default_sort_order = 'DESC'; + + /** Constructor which will set the column_fields in this object + */ + function HelpDesk() + { + $this->log =LoggerManager::getLogger('helpdesk'); + $this->log->debug("Entering HelpDesk() method ..."); + $this->db = new PearDatabase(); + $this->column_fields = getColumnFields('HelpDesk'); + $this->log->debug("Exiting HelpDesk method ..."); + } + + /** Function used to get the sort order for HelpDesk listview + * @return string $sorder - first check the $_REQUEST['sorder'] if request value is empty then check in the $_SESSION['HELPDESK_SORT_ORDER'] if this session value is empty then default sort order will be returned. + */ + function getSortOrder() + { + global $log; + $log->debug("Entering getSortOrder() method ..."); + if(isset($_REQUEST['sorder'])) + $sorder = $_REQUEST['sorder']; + else + $sorder = (($_SESSION['HELPDESK_SORT_ORDER'] != '')?($_SESSION['HELPDESK_SORT_ORDER']):($this->default_sort_order)); + $log->debug("Exiting getSortOrder() method ..."); + return $sorder; + } + + /** Function used to get the order by value for HelpDesk listview + * @return string $order_by - first check the $_REQUEST['order_by'] if request value is empty then check in the $_SESSION['HELPDESK_ORDER_BY'] if this session value is empty then default order by will be returned. + */ + function getOrderBy() + { + global $log; + $log->debug("Entering getOrderBy() method ..."); + if (isset($_REQUEST['order_by'])) + $order_by = $_REQUEST['order_by']; + else + $order_by = (($_SESSION['HELPDESK_ORDER_BY'] != '')?($_SESSION['HELPDESK_ORDER_BY']):($this->default_order_by)); + $log->debug("Exiting getOrderBy method ..."); + return $order_by; + } + + /** Function to form the query to get the list of activities + * @param int $id - ticket id + * @return array - return an array which will be returned from the function GetRelatedList + **/ + function get_activities($id) + { + global $log; + $log->debug("Entering get_activities(".$id.") method ..."); + global $mod_strings; + global $app_strings; + require_once('modules/Calendar/Activity.php'); + $focus = new Activity(); + + $button = ''; + + $returnset = '&return_module=HelpDesk&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_activity.*, vtiger_crmentity.crmid, vtiger_recurringevents.recurringtype, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_users.user_name from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.crmid=".$id." and (activitytype='Task' or activitytype='Call' or activitytype='Meeting') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held')"; + $log->debug("Exiting get_activities method ..."); + + return GetRelatedList('HelpDesk','Calendar',$focus,$query,$button,$returnset); + } + + /** Function to get the Ticket History information as in array format + * @param int $ticketid - ticket id + * @return array - return an array with title and the ticket history informations in the following format + array( + header=>array('0'=>'title'), + entries=>array('0'=>'info1','1'=>'info2',etc.,) + ) + */ + function get_ticket_history($ticketid) + { + global $log, $adb; + $log->debug("Entering into get_ticket_history($ticketid) method ..."); + + $query="select title,update_log from vtiger_troubletickets where ticketid=".$ticketid; + $result=$adb->query($query); + $update_log = $adb->query_result($result,0,"update_log"); + + $splitval = split('--//--',trim($update_log,'--//--')); + + $header[] = $adb->query_result($result,0,"title"); + + $return_value = Array('header'=>$header,'entries'=>$splitval); + + $log->debug("Exiting from get_ticket_history($ticketid) method ..."); + + return $return_value; + } + + /** Function to form the query to get the list of attachments and notes + * @param int $id - ticket id + * @return array - return an array which will be returned from the function getAttachmentsAndNotes + **/ + function get_attachments($id) + { + global $log; + $log->debug("Entering get_attachments(".$id.") method ..."); + $query = "select vtiger_notes.title,'Notes ' ActivityType, vtiger_notes.filename, + vtiger_attachments.type FileType,crm2.modifiedtime lastmodified, + vtiger_seattachmentsrel.attachmentsid attachmentsid, vtiger_notes.notesid crmid, + crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name + from vtiger_notes + inner join vtiger_senotesrel on vtiger_senotesrel.notesid= vtiger_notes.notesid + inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_senotesrel.crmid + inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_notes.notesid and crm2.deleted=0 + left join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid =vtiger_notes.notesid + left join vtiger_attachments on vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid + inner join vtiger_users on crm2.smcreatorid= vtiger_users.id + where vtiger_crmentity.crmid=".$id; + + $query .= ' union all '; + + $query .= "select vtiger_attachments.description title ,'Attachments' ActivityType, + vtiger_attachments.name filename, vtiger_attachments.type FileType,crm2.modifiedtime lastmodified, + vtiger_attachments.attachmentsid attachmentsid, vtiger_seattachmentsrel.attachmentsid crmid, + crm2.createdtime, vtiger_attachments.description, vtiger_users.user_name + from vtiger_attachments + inner join vtiger_seattachmentsrel on vtiger_seattachmentsrel.attachmentsid= vtiger_attachments.attachmentsid + inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_seattachmentsrel.crmid + inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_attachments.attachmentsid + left join vtiger_users on crm2.smcreatorid= vtiger_users.id + where vtiger_crmentity.crmid=".$id; + $log->debug("Exiting get_attachments method ..."); + return getAttachmentsAndNotes('HelpDesk',$query,$id); + } + + /** Function to get the ticket comments as a array + * @param int $ticketid - ticketid + * @return array $output - array( + [$i][comments] => comments + [$i][owner] => name of the user or customer who made the comment + [$i][createdtime] => the comment created time + ) + where $i = 0,1,..n which are all made for the ticket + **/ + function get_ticket_comments_list($ticketid) + { + global $log; + $log->debug("Entering get_ticket_comments_list(".$ticketid.") method ..."); + $sql = "select * from vtiger_ticketcomments where ticketid=".$ticketid." order by createdtime DESC"; + $result = $this->db->query($sql); + $noofrows = $this->db->num_rows($result); + for($i=0;$i<$noofrows;$i++) + { + $ownerid = $this->db->query_result($result,$i,"ownerid"); + $ownertype = $this->db->query_result($result,$i,"ownertype"); + if($ownertype == 'user') + $name = getUserName($ownerid); + elseif($ownertype == 'customer') + { + $sql1 = 'select * from vtiger_portalinfo where id='.$ownerid; + $name = $this->db->query_result($this->db->query($sql1),0,'user_name'); + } + + $output[$i]['comments'] = nl2br($this->db->query_result($result,$i,"comments")); + $output[$i]['owner'] = $name; + $output[$i]['createdtime'] = $this->db->query_result($result,$i,"createdtime"); + } + $log->debug("Exiting get_ticket_comments_list method ..."); + return $output; + } + + /** Function to form the query which will give the list of tickets based on customername and id ie., contactname and contactid + * @param string $user_name - name of the customer ie., contact name + * @param int $id - contact id + * @return array - return an array which will be returned from the function process_list_query + **/ + function get_user_tickets_list($user_name,$id,$where='',$match='') + { + global $log; + $log->debug("Entering get_user_tickets_list(".$user_name.",".$id.",".$where.",".$match.") method ..."); + + $this->db->println("where ==> ".$where); + + $query = "select vtiger_crmentity.crmid, vtiger_troubletickets.*, vtiger_crmentity.smownerid, vtiger_crmentity.createdtime, vtiger_crmentity.modifiedtime, vtiger_contactdetails.firstname, vtiger_contactdetails.lastname, vtiger_products.productid, vtiger_products.productname, vtiger_ticketcf.* from vtiger_troubletickets inner join vtiger_ticketcf on vtiger_ticketcf.ticketid = vtiger_troubletickets.ticketid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_troubletickets.ticketid left join vtiger_contactdetails on vtiger_troubletickets.parent_id=vtiger_contactdetails.contactid left join vtiger_products on vtiger_products.productid = vtiger_troubletickets.product_id left join vtiger_users on vtiger_crmentity.smownerid=vtiger_users.id where vtiger_crmentity.deleted=0 and vtiger_contactdetails.email='".$user_name."' and vtiger_troubletickets.parent_id = '".$id."'"; + + if(trim($where) != '') + { + if($match == 'all' || $match == '') + { + $join = " and "; + } + elseif($match == 'any') + { + $join = " or "; + } + $where = explode("&&&",$where); + $count = count($where); + $count --; + $where_conditions = ""; + foreach($where as $key => $value) + { + $this->db->println('key : '.$key.'...........value : '.$value); + $val = explode(" = ",$value); + $this->db->println('val0 : '.$val[0].'...........val1 : '.$val[1]); + if($val[0] == 'vtiger_troubletickets.title') + { + $where_conditions .= $val[0]." ".$val[1]; + if($count != $key) $where_conditions .= $join; + } + elseif($val[1] != '' && $val[1] != 'Any') + { + $where_conditions .= $val[0]." = ".$val[1]; + if($count != $key) $where_conditions .= $join; + } + } + if($where_conditions != '') + $where_conditions = " and ( ".$where_conditions." ) "; + + $query .= $where_conditions; + $this->db->println("where condition for customer portal tickets search : ".$where_conditions); + } + + $query .= " order by vtiger_crmentity.crmid desc"; + $log->debug("Exiting get_user_tickets_list method ..."); + return $this->process_list_query($query); + } + + /** Function to process the list query and return the result with number of rows + * @param string $query - query + * @return array $response - array( list => array( + $i => array(key => val) + ), + row_count => '', + next_offset => '', + previous_offset =>'' + ) + where $i=0,1,..n & key = ticketid, title, firstname, ..etc(range_fields) & val = value of the key from db retrieved row + **/ + function process_list_query($query) + { + global $log; + $log->debug("Entering process_list_query(".$query.") method ..."); + + $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); + $list = Array(); + $rows_found = $this->db->getRowCount($result); + if($rows_found != 0) + { + $ticket = Array(); + for($index = 0 , $row = $this->db->fetchByAssoc($result, $index); $row && $index <$rows_found;$index++, $row = $this->db->fetchByAssoc($result, $index)) + { + foreach($this->range_fields as $columnName) + { + if (isset($row[$columnName])) + { + $ticket[$columnName] = $row[$columnName]; + } + else + { + $ticket[$columnName] = ""; + } + } + $list[] = $ticket; + } + } + + $response = Array(); + $response['list'] = $list; + $response['row_count'] = $rows_found; + $response['next_offset'] = $next_offset; + $response['previous_offset'] = $previous_offset; + + $log->debug("Exiting process_list_query method ..."); + return $response; + } + + /** Function to get the HelpDesk field labels in caps letters without space + * @return array $mergeflds - array( key => val ) where key=0,1,2..n & val = ASSIGNEDTO,RELATEDTO, .,etc + **/ + function getColumnNames_Hd() + { + global $log,$current_user; + $log->debug("Entering getColumnNames_Hd() method ..."); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select fieldlabel from vtiger_field where tabid=13 and block <> 30 "; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldlabel from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=13 and vtiger_field.block <> 30 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result = $this->db->query($sql1); + $numRows = $this->db->num_rows($result); + for($i=0; $i < $numRows;$i++) + { + $custom_fields[$i] = $this->db->query_result($result,$i,"fieldlabel"); + $custom_fields[$i] = ereg_replace(" ","",$custom_fields[$i]); + $custom_fields[$i] = strtoupper($custom_fields[$i]); + } + $mergeflds = $custom_fields; + $log->debug("Exiting getColumnNames_Hd method ..."); + return $mergeflds; + } + + /** Function to get the list of comments for the given ticket id + * @param int $ticketid - Ticket id + * @return list $list - return the list of comments and comment informations as a html output where as these comments and comments informations will be formed in div tag. + **/ + function getCommentInformation($ticketid) + { + global $log; + $log->debug("Entering getCommentInformation(".$ticketid.") method ..."); + global $adb; + global $mod_strings; + $sql = "select * from vtiger_ticketcomments where ticketid=".$ticketid; + $result = $adb->query($sql); + $noofrows = $adb->num_rows($result); + + if($noofrows == 0) + { + $log->debug("Exiting getCommentInformation method ..."); + return ''; + } + + $list .= '
'; + for($i=0;$i<$noofrows;$i++) + { + if($adb->query_result($result,$i,'comments') != '') + { + //this div is to display the comment + $list .= '
'; + $list .= make_clickable(nl2br($adb->query_result($result,$i,'comments'))); + + $list .= '
'; + + //this div is to display the author and time + $list .= '
'; + $list .= $mod_strings['LBL_AUTHOR'].' : '; + + if($adb->query_result($result,$i,'ownertype') == 'user') + $list .= getUserName($adb->query_result($result,$i,'ownerid')); + else + $list .= $this->getCustomerName($ticketid); + + $list .= ' on '.$adb->query_result($result,$i,'createdtime').'  '; + + $list .= '
'; + } + } + $list .= '
'; + + $log->debug("Exiting getCommentInformation method ..."); + return $list; + } + + /** Function to get the Customer Name who has made comment to the ticket from the customer portal + * @param int $id - Ticket id + * @return string $customername - The contact name + **/ + function getCustomerName($id) + { + global $log; + $log->debug("Entering getCustomerName(".$id.") method ..."); + global $adb; + $sql = "select * from vtiger_portalinfo inner join vtiger_troubletickets on vtiger_troubletickets.parent_id = vtiger_portalinfo.id where vtiger_troubletickets.ticketid=".$id; + $result = $adb->query($sql); + $customername = $adb->query_result($result,0,'user_name'); + $log->debug("Exiting getCustomerName method ..."); + return $customername; + } + + /** Function used to get the Activity History + * @param int $id - ticket id to which we want to display the activity history + * @return array - return an array which will be returned from the function getHistory + */ + function get_history($id) + { + global $log; + $log->debug("Entering get_history(".$id.") method ..."); + $query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.status, vtiger_activity.eventstatus, + vtiger_activity.activitytype, vtiger_troubletickets.ticketid, vtiger_troubletickets.title, vtiger_crmentity.modifiedtime, + vtiger_crmentity.createdtime, vtiger_crmentity.description, vtiger_users.user_name + from vtiger_activity + inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid= vtiger_activity.activityid + inner join vtiger_troubletickets on vtiger_troubletickets.ticketid = vtiger_seactivityrel.crmid + inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid + left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid + left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname + inner join vtiger_users on vtiger_crmentity.smcreatorid= vtiger_users.id + where (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') + and (vtiger_activity.status = 'Completed' or vtiger_activity.status = 'Deferred' or (vtiger_activity.eventstatus = 'Held' and vtiger_activity.eventstatus != '')) + and vtiger_seactivityrel.crmid=".$id; + //Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php + $log->debug("Entering get_history method ..."); + return getHistory('HelpDesk',$query,$id); + } + + + +} +?> Modified: vtigercrm/trunk/modules/Leads/Lead.php ============================================================================== --- vtigercrm/trunk/modules/Leads/Lead.php (original) +++ vtigercrm/trunk/modules/Leads/Lead.php Wed Aug 23 08:00:50 2006 @@ -382,9 +382,17 @@ */ function getColumnNames_Lead() { - global $log; + global $log,$current_user; $log->debug("Entering getColumnNames_Lead() method ..."); - $sql1 = "select fieldlabel from vtiger_field where tabid=7"; + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select fieldlabel from vtiger_field where tabid=7"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldlabel from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=7 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } $result = $this->db->query($sql1); $numRows = $this->db->num_rows($result); for($i=0; $i < $numRows;$i++) From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 13:01:26 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 23 Aug 2006 17:01:26 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9079 - in /wordintegration/trunk/client/source: frmvtigerTempate.frm modGeneral.bas vtigerCRMWordPlugin.vbw Message-ID: <20060823170126.3F34675E6E5@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 11:01:15 2006 New Revision: 9079 Log: Security for wordPlugin has been integrated --Jeri Modified: wordintegration/trunk/client/source/frmvtigerTempate.frm wordintegration/trunk/client/source/modGeneral.bas wordintegration/trunk/client/source/vtigerCRMWordPlugin.vbw Modified: wordintegration/trunk/client/source/frmvtigerTempate.frm ============================================================================== Binary files - no diff available. Modified: wordintegration/trunk/client/source/modGeneral.bas ============================================================================== Binary files - no diff available. Modified: wordintegration/trunk/client/source/vtigerCRMWordPlugin.vbw ============================================================================== Binary files - no diff available. From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 23 13:05:02 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 23 Aug 2006 17:05:02 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9080 - in /wordintegration/trunk/client/bin/Language: deutsch.ini portuguese.ini Message-ID: <20060823170502.B4ED875E6E5@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 11:04:48 2006 New Revision: 9080 Log: Deutch and portuguese language pack added --Jeri Added: wordintegration/trunk/client/bin/Language/deutsch.ini wordintegration/trunk/client/bin/Language/portuguese.ini From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 00:29:14 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 04:29:14 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9082 - /vtigercrm/trunk/include/utils/ListViewUtils.php Message-ID: <20060824042914.65AD875E73D@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 22:29:10 2006 New Revision: 9082 Log: changes made to reduce the no. of currency query --Minnie Modified: vtigercrm/trunk/include/utils/ListViewUtils.php Modified: vtigercrm/trunk/include/utils/ListViewUtils.php ============================================================================== --- vtigercrm/trunk/include/utils/ListViewUtils.php (original) +++ vtigercrm/trunk/include/utils/ListViewUtils.php Wed Aug 23 22:29:10 2006 @@ -156,8 +156,7 @@ //added to display vtiger_currency symbol in listview header if($lbl_name =='Amount') { - $currencyid=fetchCurrency($current_user->id); - $rate_symbol=getCurrencySymbolandCRate($currencyid); + $rate_symbol=getCurrencySymbolandCRate($user_info['currency_id']); $curr_symbol = $rate_symbol['symbol']; $lbl_name .=': (in '.$curr_symbol.')'; } @@ -187,8 +186,7 @@ //added to display vtiger_currency symbol in related listview header if($name =='Amount' && $relatedlist !='' ) { - $currencyid=fetchCurrency($current_user->id); - $rate_symbol=getCurrencySymbolandCRate($currencyid); + $rate_symbol=getCurrencySymbolandCRate($user_info['currency_id']); $curr_symbol = $rate_symbol['symbol']; $name .=': (in '.$curr_symbol.')'; } @@ -979,9 +977,7 @@ global $log; $log->debug("Entering getValue(".$field_result.",". $list_result.",".$fieldname.",".$focus.",".$module.",".$entity_id.",".$list_result_count.",".$mode.",".$popuptype.",".$returnset.",".$viewid.") method ..."); global $adb,$current_user; - $currencyid=fetchCurrency($current_user->id); - $rate_symbol=getCurrencySymbolandCRate($currencyid); - $rate = $rate_symbol['rate']; + require('user_privileges/user_privileges_'.$current_user->id.'.php'); $tabname = getParentTab(); $uicolarr=$field_result[$fieldname]; foreach($uicolarr as $key=>$value) @@ -1022,6 +1018,8 @@ } elseif($uitype == 71 || $uitype == 72) { + $rate_symbol=getCurrencySymbolandCRate($user_info['currency_id']); + $rate = $rate_symbol['rate']; if($temp_val != '' && $temp_val != 0) { //changes made to remove vtiger_currency symbol infront of each vtiger_potential amount $value = convertFromDollar($temp_val,$rate); @@ -1343,7 +1341,8 @@ $tax_str .= $tax_details[$tax_count]['taxname'].'='.$tax_details[$tax_count]['percentage'].','; } $tax_str = trim($tax_str,','); - + $rate_symbol=getCurrencySymbolandCRate($user_info['currency_id']); + $rate = $rate_symbol['rate']; $unitprice=$adb->query_result($list_result,$list_result_count,'unit_price'); $unitprice = convertFromDollar($unitprice,$rate); $qty_stock=$adb->query_result($list_result,$list_result_count,'qtyinstock'); @@ -1362,7 +1361,8 @@ $tax_str .= $tax_details[$tax_count]['taxname'].'='.$tax_details[$tax_count]['percentage'].','; } $tax_str = trim($tax_str,','); - + $rate_symbol=getCurrencySymbolandCRate($user_info['currency_id']); + $rate = $rate_symbol['rate']; $unitprice=$adb->query_result($list_result,$list_result_count,'unit_price'); $unitprice = convertFromDollar($unitprice,$rate); $value = ''.$temp_val.''; @@ -1541,6 +1541,8 @@ } elseif($fieldname == 'hdnGrandTotal' || $fieldname == 'expectedroi' || $fieldname == 'actualroi' || $fieldname == 'actualcost' || $fieldname == 'budgetcost' || $fieldname == 'expectedrevenue') { + $rate_symbol=getCurrencySymbolandCRate($user_info['currency_id']); + $rate = $rate_symbol['rate']; $value = convertFromDollar($temp_val,$rate); } else From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 00:39:56 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 04:39:56 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9083 - /vtigercrm/trunk/include/utils/EditViewUtils.php Message-ID: <20060824043956.31E7975E73D@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 22:39:52 2006 New Revision: 9083 Log: changes made to reduce the no. of currency query --Minnie 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 Wed Aug 23 22:39:52 2006 @@ -58,11 +58,6 @@ $custfld = ''; $ui_type[]= $uitype; $editview_fldname[] = $fieldname; - - $currencyid=fetchCurrency($current_user->id); - $rate_symbol = getCurrencySymbolandCRate($currencyid); - $rate = $rate_symbol['rate']; - $currency= $rate_symbol['symbol']; if($generatedtype == 2) $mod_strings[$fieldlabel] = $fieldlabel; @@ -983,6 +978,9 @@ elseif($uitype == 71 || $uitype == 72) { + $rate_symbol = getCurrencySymbolandCRate($user_info['currency_id']); + $rate = $rate_symbol['rate']; + $currency= $rate_symbol['symbol']; $editview_label[]=$mod_strings[$fieldlabel].': ('.$currency.')'; if($value!='') $fieldvalue[] = convertFromDollar($value,$rate); From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 00:42:23 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 04:42:23 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9084 - /vtigercrm/trunk/include/utils/ListViewUtils.php Message-ID: <20060824044223.C288375E74E@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 22:42:09 2006 New Revision: 9084 Log: Updated ListviewUtils to get the sorting of header proper for singlepane view -- ahmed Modified: vtigercrm/trunk/include/utils/ListViewUtils.php Modified: vtigercrm/trunk/include/utils/ListViewUtils.php ============================================================================== --- vtigercrm/trunk/include/utils/ListViewUtils.php (original) +++ vtigercrm/trunk/include/utils/ListViewUtils.php Wed Aug 23 22:42:09 2006 @@ -23,6 +23,7 @@ require_once('include/database/PearDatabase.php'); require_once('include/ComboUtil.php'); //new require_once('include/utils/CommonUtils.php'); //new +require_once('user_privileges/default_module_view.php'); //new /**This function is used to get the list view header values in a list view *Param $focus - module object @@ -36,7 +37,7 @@ */ function getListViewHeader($focus, $module,$sort_qry='',$sorder='',$order_by='',$relatedlist='',$oCv='',$relatedmodule='') { - global $log; + global $log, $singlepane_view; $log->debug("Entering getListViewHeader(".$focus.",". $module.",".$sort_qry.",".$sorder.",".$order_by.",".$relatedlist.",".$oCv.") method ..."); global $adb; global $theme; @@ -161,7 +162,10 @@ $lbl_name .=': (in '.$curr_symbol.')'; } if($relatedlist !='' && $relatedlist != 'global') - $name = "".$lbl_name." ".$arrow.""; + if($singlepane_view == 'true') + $name = "".$lbl_name." ".$arrow.""; + else + $name = "".$lbl_name." ".$arrow.""; elseif($module == 'Users' && $name == 'User Name') $name = "".$mod_strings['LBL_LIST_USER_NAME_ROLE']." ".$arrow.""; elseif($relatedlist == "global") @@ -2738,14 +2742,18 @@ */ //Temp function to be be deleted -function getRelatedTableHeaderNavigation($navigation_array, $url_qry,$module='',$action_val='CallRelatedList',$viewid='') +function getRelatedTableHeaderNavigation($navigation_array, $url_qry,$module='',$action_val='',$viewid='') { - global $log; + global $log, $singlepane_view; $log->debug("Entering getTableHeaderNavigation(".$navigation_array.",". $url_qry.",".$module.",".$action_val.",".$viewid.") method ..."); global $theme; $theme_path="themes/".$theme."/"; $image_path=$theme_path."images/"; $output = ' -
{$CMOD.LBL_FIELDS_SELECT_DESELECT} ({$APP.Tasks}){$CMOD.LBL_FIELDS_SELECT_DESELECT}
'.$attachments_title.''.ltrim($filename,$ticketid.'_').''.ltrim($filename,$ticketid.'_').'
  '; + if($singlepane_view == 'true') + $action_val = 'DetailView'; + else + $action_val = 'CallRelatedList'; if(($navigation_array['prev']) != 0) { $output .= ' '; From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 00:44:29 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 04:44:29 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9085 - /vtigercrm/trunk/user_privileges/default_module_view.php Message-ID: <20060824044429.4D7CA75E74E@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 22:44:19 2006 New Revision: 9085 Log: Added a new file default_module_view.php for writing the status of detail view (Singlepane/Multi) -- Ahmed Added: vtigercrm/trunk/user_privileges/default_module_view.php From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 00:47:06 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 04:47:06 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9086 - /vtigercrm/trunk/Smarty/templates/Inventory/InventoryDetailView.tpl Message-ID: <20060824044706.EB7B475E73D@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 22:46:49 2006 New Revision: 9086 Log: Updated InventoryDetailView.tpl for single pane view for Inventory modules -- Ahmed Modified: vtigercrm/trunk/Smarty/templates/Inventory/InventoryDetailView.tpl Modified: vtigercrm/trunk/Smarty/templates/Inventory/InventoryDetailView.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/Inventory/InventoryDetailView.tpl (original) +++ vtigercrm/trunk/Smarty/templates/Inventory/InventoryDetailView.tpl Wed Aug 23 22:46:49 2006 @@ -49,14 +49,8 @@ - - - - + {if $SinglePane_View eq 'false'} + + {/if}
  - - {include file='DetailViewHidden.tpl'} -
- {include file='Buttons_List1.tpl'} @@ -90,8 +84,9 @@
  {$MOD[$SINGLE_MOD]} {$APP.LBL_INFORMATION}  {$APP.LBL_MORE} {$APP.LBL_INFORMATION}{$APP.LBL_MORE} {$APP.LBL_INFORMATION} 
@@ -112,6 +107,8 @@ + + {include file='DetailViewHidden.tpl'} {strip} @@ -219,6 +216,7 @@
+ {if $SinglePane_View eq 'false'} {strip} @@ -251,6 +249,15 @@ {/strip}
+{/if} + + + +
+ {if $SinglePane_View eq 'true'} + {include file= 'RelatedListNew.tpl'} + {/if} +
@@ -310,7 +317,6 @@
+query($cvObj->getModifiedCvListQuery($_REQUEST["cvid"],$listquery,$_REQUEST["list_type"])); + +if($_REQUEST["list_type"] == "Leads") + $reltable = "vtiger_campaignleadrel"; +elseif($_REQUEST["list_type"] == "Contacts") + $reltable = "vtiger_campaigncontrel"; + +while($row=$adb->fetch_array($rs)) { + $adb->query("INSERT INTO ".$reltable." VALUES('".$_REQUEST["return_id"]."','".$row["crmid"]."')"); +} + +if ($singlepane_view == 'true') +{ +?> + + + + Modified: vtigercrm/trunk/modules/Campaigns/updateRelations.php ============================================================================== --- vtigercrm/trunk/modules/Campaigns/updateRelations.php (original) +++ vtigercrm/trunk/modules/Campaigns/updateRelations.php Wed Aug 23 23:10:05 2006 @@ -1,53 +1,61 @@ -query($sql); - $sql = "update ".$mod_table." set campaignid = ".$_REQUEST["parentid"]." where ".$mod_field." = ".$id; - $adb->query($sql); - } - } - header("Location: index.php?action=CallRelatedList&module=Campaigns&record=".$_REQUEST["parentid"]); -} -elseif(isset($_REQUEST['entityid']) && $_REQUEST['entityid'] != '') -{ - $sql = "insert into ".$rel_table." values(".$_REQUEST["parid"].",".$_REQUEST["entityid"].")"; - $adb->query($sql); - $sql = "update ".$mod_table." set campaignid = ".$_REQUEST["parid"]." where ".$mod_field." = ".$_REQUEST["entityid"]; - $adb->query($sql); - header("Location: index.php?action=CallRelatedList&module=Campaigns&record=".$_REQUEST["parid"]); -} - -?> +query($sql); + $sql = "update ".$mod_table." set campaignid = ".$_REQUEST["parentid"]." where ".$mod_field." = ".$id; + $adb->query($sql); + } + } + if($singlepane_view == 'true') + header("Location: index.php?action=DetailView&module=Campaigns&record=".$_REQUEST["parentid"]); + else + header("Location: index.php?action=CallRelatedList&module=Campaigns&record=".$_REQUEST["parentid"]); +} +elseif(isset($_REQUEST['entityid']) && $_REQUEST['entityid'] != '') +{ + $sql = "insert into ".$rel_table." values(".$_REQUEST["parid"].",".$_REQUEST["entityid"].")"; + $adb->query($sql); + $sql = "update ".$mod_table." set campaignid = ".$_REQUEST["parid"]." where ".$mod_field." = ".$_REQUEST["entityid"]; + $adb->query($sql); + + if($singlepane_view == 'true') + header("Location: index.php?action=DetailView&module=Campaigns&record=".$_REQUEST["parid"]); + else + header("Location: index.php?action=CallRelatedList&module=Campaigns&record=".$_REQUEST["parid"]); +} + +?> From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 01:11:16 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:11:16 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9097 - /vtigercrm/trunk/modules/Potentials/Charts.php Message-ID: <20060824051116.A2B7375E76C@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:11:13 2006 New Revision: 9097 Log: changes made to fix the dashboard issue --Minnie Modified: vtigercrm/trunk/modules/Potentials/Charts.php Modified: vtigercrm/trunk/modules/Potentials/Charts.php ============================================================================== --- vtigercrm/trunk/modules/Potentials/Charts.php (original) +++ vtigercrm/trunk/modules/Potentials/Charts.php Wed Aug 23 23:11:13 2006 @@ -127,7 +127,7 @@ } if (isset($record->column_fields['amount'])) { // Strip all non numbers from this string. - $amount = ereg_replace('[^0-9]', '', $record->column_fields['amount']); + $amount = ereg_replace('[^0-9]', '', floor($record->column_fields['amount'])); $sum[$month][$sales_stage] = $sum[$month][$sales_stage] + $amount; if (isset($count[$month][$sales_stage])) { $count[$month][$sales_stage]++; @@ -261,10 +261,10 @@ $gbplot->setBackground(Image_Graph::factory('gradient', array(IMAGE_GRAPH_GRAD_VERTICAL, 'white', '#E5E5E5'))); // Setup title - //$titlestr = $current_module_strings['LBL_TOTAL_PIPELINE'].$curr_symbol.$total.$app_strings['LBL_THOUSANDS_SYMBOL']; - $titlestr = $current_module_strings['LBL_TOTAL_PIPELINE'].$curr_symbol.$total; - - $title->setText($titleStr); + $titlestr = $current_module_strings['LBL_TOTAL_PIPELINE'].$curr_symbol.$total.$app_strings['LBL_THOUSANDS_SYMBOL']; + //$titlestr = $current_module_strings['LBL_TOTAL_PIPELINE'].$curr_symbol.$total; + + $title->setText($titlestr); // Create the xaxis labels $array_data =& Image_Graph::factory('Image_Graph_DataPreprocessor_Array', @@ -323,7 +323,7 @@ $marker->setFontSize(8); $gbplot->setMarker($marker); - //$subtitle .= $current_module_strings['LBL_OPP_SIZE'].$curr_symbol.$current_module_strings['LBL_OPP_SIZE_VALUE']; + $subtitle .= $current_module_strings['LBL_OPP_SIZE'].$curr_symbol.$current_module_strings['LBL_OPP_SIZE_VALUE']; $footer->setText($subtitle); $footer->setAlignment(IMAGE_GRAPH_ALIGN_TOP_RIGHT); @@ -471,7 +471,7 @@ } if (isset($record->column_fields['amount'])) { // Strip all non numbers from this string. - $amount = ereg_replace('[^0-9]', '', $record->column_fields['amount']); + $amount = ereg_replace('[^0-9]', '', floor($record->column_fields['amount'])); $sum[$lead_source][$sales_stage] = $sum[$lead_source][$sales_stage] + $amount; if (isset($count[$lead_source][$sales_stage])) { $count[$lead_source][$sales_stage]++; @@ -602,8 +602,8 @@ $gbplot->setBackground(Image_Graph::factory('gradient', array(IMAGE_GRAPH_GRAD_HORIZONTAL, 'white', '#E5E5E5'))); // Setup title - //$titlestr = $current_module_strings['LBL_ALL_OPPORTUNITIES'].$curr_symbol.$total.$app_strings['LBL_THOUSANDS_SYMBOL']; - $titlestr = $current_module_strings['LBL_ALL_OPPORTUNITIES'].$curr_symbol.$total; + $titlestr = $current_module_strings['LBL_ALL_OPPORTUNITIES'].$curr_symbol.$total.$app_strings['LBL_THOUSANDS_SYMBOL']; + //$titlestr = $current_module_strings['LBL_ALL_OPPORTUNITIES'].$curr_symbol.$total; $title->setText($titlestr); // Create the xaxis labels @@ -655,7 +655,7 @@ $gbplot->setMarker($marker); // Finally setup the title - //$subtitle = $current_module_strings['LBL_OPP_SIZE'].$curr_symbol.$current_module_strings['LBL_OPP_SIZE_VALUE']; + $subtitle = $current_module_strings['LBL_OPP_SIZE'].$curr_symbol.$current_module_strings['LBL_OPP_SIZE_VALUE']; $footer->setText($subtitle); $footer->setAlignment(IMAGE_GRAPH_ALIGN_TOP_RIGHT); @@ -793,7 +793,7 @@ } if (isset($record->column_fields['amount'])) { // Strip all non numbers from this string. - $amount = ereg_replace('[^0-9]', '', $record->column_fields['amount']); + $amount = ereg_replace('[^0-9]', '', floor($record->column_fields['amount'])); $sum[$record->column_fields['sales_stage']][$record->column_fields['assigned_user_id']] = $sum[$record->column_fields['sales_stage']][$record->column_fields['assigned_user_id']] + $amount; if (isset($count[$record->column_fields['sales_stage']][$record->column_fields['assigned_user_id']])) { $count[$record->column_fields['sales_stage']][$record->column_fields['assigned_user_id']]++; @@ -915,8 +915,8 @@ $font->setColor($font_color); // Setup title - //$titlestr = $current_module_strings['LBL_TOTAL_PIPELINE'].$curr_symbol.$total.$app_strings['LBL_THOUSANDS_SYMBOL']; - $titlestr = $current_module_strings['LBL_TOTAL_PIPELINE'].$curr_symbol.$total; + $titlestr = $current_module_strings['LBL_TOTAL_PIPELINE'].$curr_symbol.$total.$app_strings['LBL_THOUSANDS_SYMBOL']; + //$titlestr = $current_module_strings['LBL_TOTAL_PIPELINE'].$curr_symbol.$total; $title->setText($titlestr); // Create the xaxis labels @@ -972,7 +972,7 @@ // Finally setup the title - //$subtitle .= $current_module_strings['LBL_OPP_SIZE'].$curr_symbol.$current_module_strings['LBL_OPP_SIZE_VALUE']; + $subtitle .= $current_module_strings['LBL_OPP_SIZE'].$curr_symbol.$current_module_strings['LBL_OPP_SIZE_VALUE']; $footer->setText($subtitle); $footer->setAlignment(IMAGE_GRAPH_ALIGN_TOP_RIGHT); @@ -1069,7 +1069,7 @@ if (!isset($sum[$record->column_fields['leadsource']])) $sum[$record->column_fields['leadsource']] = 0; if (isset($record->column_fields['amount']) && isset($record->column_fields['leadsource'])) { // Strip all non numbers from this string. - $amount = ereg_replace('[^0-9]', '', $record->column_fields['amount']); + $amount = ereg_replace('[^0-9]', '', floor($record->column_fields['amount'])); $sum[$record->column_fields['leadsource']] = $sum[$record->column_fields['leadsource']] + ($amount/1000); if (isset($count[$record->column_fields['leadsource']])) $count[$record->column_fields['leadsource']]++; else $count[$record->column_fields['leadsource']] = 1; @@ -1174,10 +1174,10 @@ $gbplot->setFillStyle($fills); // Setup title -// $titlestr = $current_module_strings['LBL_TOTAL_PIPELINE'].$curr_symbol.$total.$app_strings['LBL_THOUSANDS_SYMBOL']; - $titlestr = $current_module_strings['LBL_TOTAL_PIPELINE'].$curr_symbol.$total; - -$title->setText($titlestr); + $titlestr = $current_module_strings['LBL_TOTAL_PIPELINE'].$curr_symbol.$total.$app_strings['LBL_THOUSANDS_SYMBOL']; + //$titlestr = $current_module_strings['LBL_TOTAL_PIPELINE'].$curr_symbol.$total; + + $title->setText($titlestr); // format the data values $valueproc =& Image_Graph::factory('Image_Graph_DataPreprocessor_Formatted', $curr_symbol."%d"); @@ -1198,7 +1198,7 @@ $legend_box->setFillColor('#F5F5F5'); $legend_box->showShadow(); - //$subtitle = $current_module_strings['LBL_OPP_SIZE'].$curr_symbol.$current_module_strings['LBL_OPP_SIZE_VALUE']; + $subtitle = $current_module_strings['LBL_OPP_SIZE'].$curr_symbol.$current_module_strings['LBL_OPP_SIZE_VALUE']; $footer->setText($subtitle); $footer->setAlignment(IMAGE_GRAPH_ALIGN_TOP_LEFT); From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 01:13:59 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:13:59 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9098 - /vtigercrm/trunk/modules/Calendar/EditView.php Message-ID: <20060824051359.ECB0475E76C@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:13:56 2006 New Revision: 9098 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/EditView.php Modified: vtigercrm/trunk/modules/Calendar/EditView.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/EditView.php (original) +++ vtigercrm/trunk/modules/Calendar/EditView.php Wed Aug 23 23:13:56 2006 @@ -37,8 +37,6 @@ $focus = new Activity(); $smarty = new vtigerCRM_Smarty(); $activity_mode = $_REQUEST['activity_mode']; -if(isset($_REQUEST['activitytype']) && $_REQUEST['activitytype'] != '') - $activitytype = $_REQUEST['activitytype']; if($activity_mode == 'Task') { $tab_type = 'Calendar'; @@ -179,7 +177,6 @@ $smarty->assign("fldlabel_sel",$fldlabel_sel); $smarty->assign("OP_MODE",$disp_view); $smarty->assign("ACTIVITY_MODE",$activity_mode); -$smarty->assign("ACTIVITY_TYPE",$activitytype); $smarty->assign("HOURFORMAT",$format); $smarty->assign("USERSLIST",$userDetails); $smarty->assign("USEREMAILID",$to_email); From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 01:16:49 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:16:49 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9099 - in /vtigercrm/trunk/modules/Contacts: CallRelatedList.php Contact.php DetailView.php updateRelations.php Message-ID: <20060824051649.8A89875E76C@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:16:24 2006 New Revision: 9099 Log: Updated the single pane view feature for detailview in Contacts Modules -- ahmed Modified: vtigercrm/trunk/modules/Contacts/CallRelatedList.php vtigercrm/trunk/modules/Contacts/Contact.php vtigercrm/trunk/modules/Contacts/DetailView.php vtigercrm/trunk/modules/Contacts/updateRelations.php Modified: vtigercrm/trunk/modules/Contacts/CallRelatedList.php ============================================================================== --- vtigercrm/trunk/modules/Contacts/CallRelatedList.php (original) +++ vtigercrm/trunk/modules/Contacts/CallRelatedList.php Wed Aug 23 23:16:24 2006 @@ -56,13 +56,12 @@ $category = getparenttab(); $smarty->assign("CATEGORY",$category); -$smarty->assign("id",$focus->id); +$smarty->assign("ID",$focus->id); $smarty->assign("NAME",$focus->name); $related_array = getRelatedLists($currentModule,$focus); $smarty->assign("RELATEDLISTS", $related_array); $smarty->assign("MODULE",$currentmodule); $smarty->assign("SINGLE_MOD",$app_strings['Contact']); -$smarty->assign("ID",$record ); $smarty->assign("UPDATEINFO",updateInfo($focus->id)); $smarty->assign("MOD",$mod_strings); $smarty->assign("APP",$app_strings); Modified: vtigercrm/trunk/modules/Contacts/Contact.php ============================================================================== --- vtigercrm/trunk/modules/Contacts/Contact.php (original) +++ vtigercrm/trunk/modules/Contacts/Contact.php Wed Aug 23 23:16:24 2006 @@ -31,6 +31,7 @@ require_once('modules/Notes/Note.php'); require_once('modules/Emails/Email.php'); require_once('modules/HelpDesk/HelpDesk.php'); +require_once('user_privileges/default_module_view.php'); // Contact is used to store customer information. @@ -267,7 +268,7 @@ */ function get_opportunities($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_opportunities(".$id.") method ..."); global $mod_strings; @@ -279,7 +280,10 @@ $button .= ' '; } - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; $log->info("Potential Related List for Contact Displayed"); @@ -298,7 +302,7 @@ */ function get_activities($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_activities(".$id.") method ..."); global $mod_strings; @@ -311,7 +315,10 @@ $button .= ' '; $button .= ' '; } - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; $log->info("Activity Related List for Contact Displayed"); @@ -355,13 +362,16 @@ */ function get_tickets($id) { - global $log; + global $log, $singlepane_view; global $app_strings; $log->debug("Entering get_tickets(".$id.") method ..."); $focus = new HelpDesk(); $button = '
  - {if $ACTIVITY_TYPE eq 'Meeting'} - {assign var='meetcheck' value='checked'} - {assign var='callcheck' value=''} - {else} - {assign var='meetcheck' value=''} - {assign var='callcheck' value='checked'} - {/if} + {foreach key=tyeparrkey item=typearr from=$ACTIVITYDATA.activitytype} + {foreach key=sel_value item=value from=$typearr} + {if $value eq 'selected' && $sel_value eq 'Meeting'} + {assign var='meetcheck' value='checked'} + {assign var='callcheck' value=''} + {else} + {assign var='meetcheck' value=''} + {assign var='callcheck' value='checked'} + {/if} + {/foreach} + {/foreach} From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 01:21:42 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:21:42 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9101 - in /vtigercrm/trunk/modules/HelpDesk: CallRelatedList.php DetailView.php HelpDesk.php Message-ID: <20060824052142.A06D875E76C@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:21:26 2006 New Revision: 9101 Log: Updated the single pane view feature for detailview in HelpDesk Module -- ahmed Modified: vtigercrm/trunk/modules/HelpDesk/CallRelatedList.php vtigercrm/trunk/modules/HelpDesk/DetailView.php vtigercrm/trunk/modules/HelpDesk/HelpDesk.php Modified: vtigercrm/trunk/modules/HelpDesk/CallRelatedList.php ============================================================================== --- vtigercrm/trunk/modules/HelpDesk/CallRelatedList.php (original) +++ vtigercrm/trunk/modules/HelpDesk/CallRelatedList.php Wed Aug 23 23:21:26 2006 @@ -50,8 +50,7 @@ $category = getParentTab(); $smarty->assign("CATEGORY",$category); -$smarty->assign("id",$focus->id); -$smarty->assign("ID",$RECORD ); +$smarty->assign("ID",$focus->id); $smarty->assign("MODULE",$currentmodule); $smarty->assign("SINGLE_MOD",$app_strings['Ticket']); $smarty->assign("UPDATEINFO",updateInfo($focus->id)); Modified: vtigercrm/trunk/modules/HelpDesk/DetailView.php ============================================================================== --- vtigercrm/trunk/modules/HelpDesk/DetailView.php (original) +++ vtigercrm/trunk/modules/HelpDesk/DetailView.php Wed Aug 23 23:21:26 2006 @@ -1,109 +1,119 @@ -retrieve_entity_info($_REQUEST['record'],"HelpDesk"); - $focus->name=$focus->column_fields['ticket_title']; -} - -if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') -{ - $focus->id = ""; -} - -//Added code for Error display in sending mail to assigned to user when ticket is created or updated. -if($_REQUEST['mail_error'] != '') -{ - require_once("modules/Emails/mail.php"); - echo parseEmailErrorString($_REQUEST['mail_error']); -} - -global $app_strings; -global $mod_strings; -global $currentModule; - -global $theme; -$theme_path="themes/".$theme."/"; -$image_path=$theme_path."images/"; -require_once($theme_path.'layout_utils.php'); - -$smarty = new vtigerCRM_Smarty; -$smarty->assign("MOD", $mod_strings); -$smarty->assign("APP", $app_strings); - -if (isset($focus->name)) $smarty->assign("NAME", $focus->name); -else $smarty->assign("NAME", ""); -$smarty->assign("BLOCKS", getBlocks($currentModule,"detail_view",'',$focus->column_fields)); -$smarty->assign("TICKETID", $_REQUEST['record']); - -$smarty->assign("CUSTOMFIELD", $cust_fld); -$smarty->assign("SINGLE_MOD", 'HelpDesk'); -$category = getParentTab(); -$smarty->assign("CATEGORY",$category); -$smarty->assign("UPDATEINFO",updateInfo($_REQUEST['record'])); - -if(isPermitted("HelpDesk","EditView",$_REQUEST['record']) == 'yes') - $smarty->assign("EDIT_DUPLICATE","permitted"); - -if(isPermitted("HelpDesk","Delete",$_REQUEST['record']) == 'yes') - $smarty->assign("DELETE","permitted"); - -//Added button for Convert the ticket to FAQ -if(isPermitted("Faq","EditView",'') == 'yes') - $smarty->assign("CONVERTASFAQ","permitted"); - -$smarty->assign("IMAGE_PATH", $image_path); -$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']); -$smarty->assign("ID", $_REQUEST['record']); -if(isPermitted("HelpDesk","Merge",'') == 'yes') -{ - $smarty->assign("MERGEBUTTON","permitted"); - require_once('include/utils/UserInfoUtil.php'); - $wordTemplateResult = fetchWordTemplateList("HelpDesk"); - $tempCount = $adb->num_rows($wordTemplateResult); - $tempVal = $adb->fetch_array($wordTemplateResult); - for($templateCount=0;$templateCount<$tempCount;$templateCount++) - { - $optionString[$tempVal["templateid"]]=$tempVal["filename"]; - $tempVal = $adb->fetch_array($wordTemplateResult); - } - $smarty->assign("WORDTEMPLATEOPTIONS",$app_strings['LBL_SELECT_TEMPLATE_TO_MAIL_MERGE']); - $smarty->assign("TOPTIONS",$optionString); -} - -$check_button = Button_Check($module); -$smarty->assign("CHECK", $check_button); - -$tabid = getTabid("HelpDesk"); -$validationData = getDBValidationData($focus->tab_name,$tabid); -$data = split_validationdataArray($validationData); -$smarty->assign("VALIDATION_DATA_FIELDNAME",$data['fieldname']); -$smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data['datatype']); -$smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']); - -//Added to display the ticket comments information -$smarty->assign("COMMENT_BLOCK",$focus->getCommentInformation($_REQUEST['record'])); - -$smarty->assign("MODULE",$currentModule); -$smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); -$smarty->display("DetailView.tpl"); -$focus->id = $_REQUEST['record']; - - -?> +retrieve_entity_info($_REQUEST['record'],"HelpDesk"); + $focus->name=$focus->column_fields['ticket_title']; +} + +if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') +{ + $focus->id = ""; +} + +//Added code for Error display in sending mail to assigned to user when ticket is created or updated. +if($_REQUEST['mail_error'] != '') +{ + require_once("modules/Emails/mail.php"); + echo parseEmailErrorString($_REQUEST['mail_error']); +} + +global $app_strings; +global $mod_strings; +global $currentModule, $singlepane_view; + +global $theme; +$theme_path="themes/".$theme."/"; +$image_path=$theme_path."images/"; +require_once($theme_path.'layout_utils.php'); + +$smarty = new vtigerCRM_Smarty; +$smarty->assign("MOD", $mod_strings); +$smarty->assign("APP", $app_strings); + +$focus->id = $_REQUEST['record']; +if (isset($focus->name)) $smarty->assign("NAME", $focus->name); +else $smarty->assign("NAME", ""); +$smarty->assign("BLOCKS", getBlocks($currentModule,"detail_view",'',$focus->column_fields)); +$smarty->assign("TICKETID", $_REQUEST['record']); + +$smarty->assign("CUSTOMFIELD", $cust_fld); +$smarty->assign("SINGLE_MOD", 'HelpDesk'); +$category = getParentTab(); +$smarty->assign("CATEGORY",$category); +$smarty->assign("UPDATEINFO",updateInfo($_REQUEST['record'])); + +if(isPermitted("HelpDesk","EditView",$_REQUEST['record']) == 'yes') + $smarty->assign("EDIT_DUPLICATE","permitted"); + +if(isPermitted("HelpDesk","Delete",$_REQUEST['record']) == 'yes') + $smarty->assign("DELETE","permitted"); + +//Added button for Convert the ticket to FAQ +if(isPermitted("Faq","EditView",'') == 'yes') + $smarty->assign("CONVERTASFAQ","permitted"); + +$smarty->assign("IMAGE_PATH", $image_path); +$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']); +$smarty->assign("ID", $_REQUEST['record']); +if(isPermitted("HelpDesk","Merge",'') == 'yes') +{ + $smarty->assign("MERGEBUTTON","permitted"); + require_once('include/utils/UserInfoUtil.php'); + $wordTemplateResult = fetchWordTemplateList("HelpDesk"); + $tempCount = $adb->num_rows($wordTemplateResult); + $tempVal = $adb->fetch_array($wordTemplateResult); + for($templateCount=0;$templateCount<$tempCount;$templateCount++) + { + $optionString[$tempVal["templateid"]]=$tempVal["filename"]; + $tempVal = $adb->fetch_array($wordTemplateResult); + } + $smarty->assign("WORDTEMPLATEOPTIONS",$app_strings['LBL_SELECT_TEMPLATE_TO_MAIL_MERGE']); + $smarty->assign("TOPTIONS",$optionString); +} + +$check_button = Button_Check($module); +$smarty->assign("CHECK", $check_button); + +$tabid = getTabid("HelpDesk"); +$validationData = getDBValidationData($focus->tab_name,$tabid); +$data = split_validationdataArray($validationData); +$smarty->assign("VALIDATION_DATA_FIELDNAME",$data['fieldname']); +$smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data['datatype']); +$smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']); + +//Added to display the ticket comments information +$smarty->assign("COMMENT_BLOCK",$focus->getCommentInformation($_REQUEST['record'])); + +$smarty->assign("MODULE",$currentModule); +$smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); + +if($singlepane_view == 'true') +{ + $related_array = getRelatedLists($currentModule,$focus); + $smarty->assign("RELATEDLISTS", $related_array); +} + +$smarty->assign("SinglePane_View", $singlepane_view); + +$smarty->display("DetailView.tpl"); + + +?> Modified: vtigercrm/trunk/modules/HelpDesk/HelpDesk.php ============================================================================== --- vtigercrm/trunk/modules/HelpDesk/HelpDesk.php (original) +++ vtigercrm/trunk/modules/HelpDesk/HelpDesk.php Wed Aug 23 23:21:26 2006 @@ -18,7 +18,7 @@ require_once('data/SugarBean.php'); require_once('data/CRMEntity.php'); require_once('include/utils/utils.php'); - +require_once('user_privileges/default_module_view.php'); class HelpDesk extends CRMEntity { var $log; @@ -119,7 +119,7 @@ **/ function get_activities($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_activities(".$id.") method ..."); global $mod_strings; global $app_strings; @@ -128,7 +128,10 @@ $button = ''; - $returnset = '&return_module=HelpDesk&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=HelpDesk&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=HelpDesk&return_action=CallRelatedList&return_id='.$id; $query = "SELECT vtiger_activity.*, vtiger_crmentity.crmid, vtiger_recurringevents.recurringtype, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_users.user_name from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.crmid=".$id." and (activitytype='Task' or activitytype='Call' or activitytype='Meeting') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held')"; $log->debug("Exiting get_activities method ..."); @@ -350,14 +353,14 @@ global $log,$current_user; $log->debug("Entering getColumnNames_Hd() method ..."); require('user_privileges/user_privileges_'.$current_user->id.'.php'); - if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) - { - $sql1 = "select fieldlabel from vtiger_field where tabid=13 and block <> 30 "; + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select fieldlabel from vtiger_field where tabid=13 and block <> 30 "; }else { - $profileList = getCurrentUserProfileList(); - $sql1 = "select fieldlabel from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=13 and vtiger_field.block <> 30 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; - } + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldlabel from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=13 and vtiger_field.block <> 30 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } $result = $this->db->query($sql1); $numRows = $this->db->num_rows($result); for($i=0; $i < $numRows;$i++) From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 01:23:05 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:23:05 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9102 - in /vtigercrm/trunk/modules/Invoice: CallRelatedList.php DetailView.php Invoice.php Message-ID: <20060824052305.05F4575E76C@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:22:53 2006 New Revision: 9102 Log: Updated the single pane view feature for detailview in Invoice Module -- ahmed Modified: vtigercrm/trunk/modules/Invoice/CallRelatedList.php vtigercrm/trunk/modules/Invoice/DetailView.php vtigercrm/trunk/modules/Invoice/Invoice.php Modified: vtigercrm/trunk/modules/Invoice/CallRelatedList.php ============================================================================== --- vtigercrm/trunk/modules/Invoice/CallRelatedList.php (original) +++ vtigercrm/trunk/modules/Invoice/CallRelatedList.php Wed Aug 23 23:22:53 2006 @@ -44,8 +44,7 @@ $smarty->assign("OP_MODE",$_REQUEST['mode']); } -$smarty->assign("id",$focus->id); -$smarty->assign("ID",$RECORD ); +$smarty->assign("ID",$focus->id); $smarty->assign("MODULE",$currentmodule); $smarty->assign("SINGLE_MOD",$app_strings['Invoice']); $smarty->assign("UPDATEINFO",updateInfo($focus->id)); Modified: vtigercrm/trunk/modules/Invoice/DetailView.php ============================================================================== --- vtigercrm/trunk/modules/Invoice/DetailView.php (original) +++ vtigercrm/trunk/modules/Invoice/DetailView.php Wed Aug 23 23:22:53 2006 @@ -26,7 +26,8 @@ require_once('include/CustomFieldUtil.php'); require_once('include/database/PearDatabase.php'); require_once('include/utils/utils.php'); -global $mod_strings,$app_strings,$currentModule,$theme; +require_once('user_privileges/default_module_view.php'); +global $mod_strings,$app_strings,$currentModule,$theme,$singlepane_view; $focus = new Invoice(); if(isset($_REQUEST['record']) && isset($_REQUEST['record'])) { @@ -88,6 +89,15 @@ $smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data['datatype']); $smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); + +if($singlepane_view == 'true') +{ + $related_array = getRelatedLists($currentModule,$focus); + $smarty->assign("RELATEDLISTS", $related_array); +} + +$smarty->assign("SinglePane_View", $singlepane_view); + $smarty->display("Inventory/InventoryDetailView.tpl"); ?> Modified: vtigercrm/trunk/modules/Invoice/Invoice.php ============================================================================== --- vtigercrm/trunk/modules/Invoice/Invoice.php (original) +++ vtigercrm/trunk/modules/Invoice/Invoice.php Wed Aug 23 23:22:53 2006 @@ -27,6 +27,7 @@ require_once('data/SugarBean.php'); require_once('data/CRMEntity.php'); require_once('include/utils/utils.php'); +require_once('user_privileges/default_module_view.php'); // Account is used to store vtiger_account information. class Invoice extends CRMEntity { @@ -151,7 +152,7 @@ */ function get_activities($id) { - global $log; + global $log,$singlepane_view; $log->debug("Entering get_activities(".$id.") method ..."); global $app_strings; require_once('modules/Calendar/Activity.php'); @@ -159,7 +160,10 @@ $button = ''; - $returnset = '&return_module=Invoice&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Invoice&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Invoice&return_action=CallRelatedList&return_id='.$id; $query = "SELECT vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid, vtiger_activity.*,vtiger_seactivityrel.*,vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_users.user_name from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_cntactivityrel.contactid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.crmid=".$id." and activitytype='Task' and vtiger_crmentity.deleted=0 and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Completed') and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Deferred')"; $log->debug("Exiting get_activities method ..."); From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 01:27:31 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:27:31 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9103 - in /vtigercrm/trunk/modules/Leads: CallRelatedList.php DetailView.php Lead.php updateRelations.php Message-ID: <20060824052731.B0D5175E76C@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:27:04 2006 New Revision: 9103 Log: Updated the single pane view feature for detailview in Leads Module -- ahmed Modified: vtigercrm/trunk/modules/Leads/CallRelatedList.php vtigercrm/trunk/modules/Leads/DetailView.php vtigercrm/trunk/modules/Leads/Lead.php vtigercrm/trunk/modules/Leads/updateRelations.php Modified: vtigercrm/trunk/modules/Leads/CallRelatedList.php ============================================================================== --- vtigercrm/trunk/modules/Leads/CallRelatedList.php (original) +++ vtigercrm/trunk/modules/Leads/CallRelatedList.php Wed Aug 23 23:27:04 2006 @@ -55,14 +55,13 @@ $parent_email = getEmailParentsList('Leads',$focus->id); $smarty->assign("HIDDEN_PARENTS_LIST",$parent_email); -$smarty->assign("id",$focus->id); +$smarty->assign("ID",$focus->id); $smarty->assign("NAME",$focus->lastname.' '.$focus->firstname); $related_array = getRelatedLists($currentModule,$focus); $smarty->assign("RELATEDLISTS", $related_array); $smarty->assign("SINGLE_MOD",$app_strings['Lead']); $smarty->assign("REDIR_MOD","leads"); $smarty->assign("MODULE", $currentmodule); -$smarty->assign("ID",$RECORD ); $smarty->assign("UPDATEINFO",updateInfo($focus->id)); $smarty->assign("MOD",$mod_strings); $smarty->assign("APP",$app_strings); Modified: vtigercrm/trunk/modules/Leads/DetailView.php ============================================================================== --- vtigercrm/trunk/modules/Leads/DetailView.php (original) +++ vtigercrm/trunk/modules/Leads/DetailView.php Wed Aug 23 23:27:04 2006 @@ -19,10 +19,11 @@ require_once('include/CustomFieldUtil.php'); require_once('include/utils/utils.php'); require_once('include/utils/UserInfoUtil.php'); +require_once('user_privileges/default_module_view.php'); global $mod_strings; global $app_strings; -global $currentModule; +global $currentModule, $singlepane_view; global $log; $focus = new Lead(); @@ -123,6 +124,15 @@ $smarty->assign("MODULE", $currentModule); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); + +if($singlepane_view == 'true') +{ + $related_array = getRelatedLists($currentModule,$focus); + $smarty->assign("RELATEDLISTS", $related_array); +} + +$smarty->assign("SinglePane_View", $singlepane_view); + $smarty->display("DetailView.tpl"); ?> Modified: vtigercrm/trunk/modules/Leads/Lead.php ============================================================================== --- vtigercrm/trunk/modules/Leads/Lead.php (original) +++ vtigercrm/trunk/modules/Leads/Lead.php Wed Aug 23 23:27:04 2006 @@ -24,6 +24,7 @@ require_once('modules/Emails/Email.php'); require_once('include/ComboUtil.php'); require_once('include/utils/utils.php'); +require_once('user_privileges/default_module_view.php'); class Lead extends CRMEntity { var $log; @@ -193,7 +194,7 @@ */ function get_activities($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_activities(".$id.") method ..."); global $app_strings; @@ -205,7 +206,10 @@ $button .= ' '; $button .= ' '; } - $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Leads&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; // First, get the list of IDs. @@ -220,13 +224,17 @@ */ function get_campaigns($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_campaigns(".$id.") method ..."); global $mod_strings; $focus = new Campaign(); $button = ''; - $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Leads&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; + $log->info("Campaign Related List for Lead Displayed"); $query = "SELECT vtiger_users.user_name, vtiger_campaign.campaignid, vtiger_campaign.campaignname, vtiger_campaign.campaigntype, vtiger_campaign.campaignstatus, vtiger_campaign.expectedrevenue, vtiger_campaign.closingdate, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_campaign inner join vtiger_campaignleadrel on vtiger_campaignleadrel.campaignid=vtiger_campaign.campaignid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_campaign.campaignid left join vtiger_campaigngrouprelation on vtiger_campaign.campaignid=vtiger_campaigngrouprelation.campaignid left join vtiger_groups on vtiger_groups.groupname=vtiger_campaigngrouprelation.groupname left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid where vtiger_campaignleadrel.leadid=".$id." and vtiger_crmentity.deleted=0"; @@ -242,7 +250,7 @@ */ function get_emails($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_emails(".$id.") method ..."); global $mod_strings; require_once('include/RelatedListView.php'); @@ -256,7 +264,10 @@ $button .= ' '; } - $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Leads&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; $query ="select vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.semodule, vtiger_activity.activitytype, vtiger_activity.date_start, vtiger_activity.status, vtiger_activity.priority, vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.modifiedtime, vtiger_users.user_name from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where vtiger_activity.activitytype='Emails' and vtiger_crmentity.deleted=0 and vtiger_seactivityrel.crmid=".$id; $log->debug("Exiting get_emails method ..."); @@ -342,7 +353,7 @@ */ function get_products($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_products(".$id.") method ..."); require_once('modules/Products/Product.php'); global $mod_strings; @@ -356,7 +367,10 @@ { $button .= ' '; } - $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Leads&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; $query = 'select vtiger_products.productid, vtiger_products.productname, vtiger_products.productcode, vtiger_products.commissionrate, vtiger_products.qty_per_unit, vtiger_products.unit_price, vtiger_crmentity.crmid, vtiger_crmentity.smownerid from vtiger_products inner join vtiger_seproductsrel on vtiger_products.productid = vtiger_seproductsrel.productid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_products.productid inner join vtiger_leaddetails on vtiger_leaddetails.leadid = vtiger_seproductsrel.crmid where vtiger_leaddetails.leadid = '.$id.' and vtiger_crmentity.deleted = 0'; $log->debug("Exiting get_products method ..."); @@ -387,12 +401,12 @@ require('user_privileges/user_privileges_'.$current_user->id.'.php'); if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) { - $sql1 = "select fieldlabel from vtiger_field where tabid=7"; - }else - { - $profileList = getCurrentUserProfileList(); - $sql1 = "select fieldlabel from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=7 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; - } + $sql1 = "select fieldlabel from vtiger_field where tabid=7"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldlabel from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=7 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } $result = $this->db->query($sql1); $numRows = $this->db->num_rows($result); for($i=0; $i < $numRows;$i++) Modified: vtigercrm/trunk/modules/Leads/updateRelations.php ============================================================================== --- vtigercrm/trunk/modules/Leads/updateRelations.php (original) +++ vtigercrm/trunk/modules/Leads/updateRelations.php Wed Aug 23 23:27:04 2006 @@ -1,38 +1,46 @@ -query($sql); - } - } - header("Location: index.php?action=CallRelatedList&module=Leads&record=".$_REQUEST["parentid"]); -} -elseif(isset($_REQUEST['entityid']) && $_REQUEST['entityid'] != '') -{ - $sql = "insert into ".$rel_table." values(".$_REQUEST["entityid"].",".$_REQUEST["parid"].")"; - $adb->query($sql); - header("Location: index.php?action=CallRelatedList&module=Leads&record=".$_REQUEST["parid"]); -} - -?> +query($sql); + } + } + if($singlepane_view == 'true') + header("Location: index.php?action=DetailView&module=Leads&record=".$_REQUEST["parentid"]); + else + header("Location: index.php?action=CallRelatedList&module=Leads&record=".$_REQUEST["parentid"]); +} +elseif(isset($_REQUEST['entityid']) && $_REQUEST['entityid'] != '') +{ + $sql = "insert into ".$rel_table." values(".$_REQUEST["entityid"].",".$_REQUEST["parid"].")"; + $adb->query($sql); + + if($singlepane_view == 'true') + header("Location: index.php?action=DetailView&module=Leads&record=".$_REQUEST["parid"]); + else + header("Location: index.php?action=CallRelatedList&module=Leads&record=".$_REQUEST["parid"]); +} + +?> From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 01:29:35 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:29:35 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9104 - /vtigercrm/trunk/modules/Dashboard/HomepageDB.php Message-ID: <20060824052935.3743F75E784@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:29:30 2006 New Revision: 9104 Log: changes made to fix the dashboard issue --Minnie Modified: vtigercrm/trunk/modules/Dashboard/HomepageDB.php Modified: vtigercrm/trunk/modules/Dashboard/HomepageDB.php ============================================================================== --- vtigercrm/trunk/modules/Dashboard/HomepageDB.php (original) +++ vtigercrm/trunk/modules/Dashboard/HomepageDB.php Wed Aug 23 23:29:30 2006 @@ -19,7 +19,8 @@ //if($is_admin) // $homepagedb_query = "select vtiger_crmentity.* from vtiger_crmentity where vtiger_crmentity.setype in ('Accounts','Contacts','Leads','Potentials','Quotes','Invoice','PurchaseOrder','SalesOrder','Activities','HelpDesk','Campaigns') and vtiger_crmentity.deleted=0"; //else - $homepagedb_query = "select vtiger_crmentity.* from vtiger_crmentity where vtiger_crmentity.setype in ('Accounts','Contacts','Leads','Potentials','Quotes','Invoice','PurchaseOrder','SalesOrder','Calendar','HelpDesk','Campaigns') and vtiger_crmentity.deleted=0 and vtiger_crmentity.smownerid=".$current_user->id; + $homepagedb_query = "select * from vtiger_crmentity se left join vtiger_leaddetails le on le.leadid=se.crmid where se.deleted=0 and (le.converted=0 or le.converted is null) and setype in ('Accounts','Contacts','Leads','Potentials','Quotes','Invoice','PurchaseOrder', 'SalesOrder','Calendar','HelpDesk','Campaigns') and se.deleted=0 and se.smownerid=".$current_user->id; + //$homepagedb_query = "select vtiger_crmentity.* from vtiger_crmentity where vtiger_crmentity.setype in ('Accounts','Contacts','Leads','Potentials','Quotes','Invoice','PurchaseOrder','SalesOrder','Calendar','HelpDesk','Campaigns') and vtiger_crmentity.deleted=0 and vtiger_crmentity.smownerid=".$current_user->id; $graph_by="setype"; $graph_title=$mod_strings['recordsforuser'].' '.$current_user->user_name; $module="Home"; From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 01:29:41 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:29:41 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9105 - in /vtigercrm/trunk/modules/Potentials: CallRelatedList.php DetailView.php Opportunity.php updateRelations.php Message-ID: <20060824052941.F1A0B75E757@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:29:28 2006 New Revision: 9105 Log: Updated the single pane view feature for detailview in Potentials Module -- ahmed Modified: vtigercrm/trunk/modules/Potentials/CallRelatedList.php vtigercrm/trunk/modules/Potentials/DetailView.php vtigercrm/trunk/modules/Potentials/Opportunity.php vtigercrm/trunk/modules/Potentials/updateRelations.php Modified: vtigercrm/trunk/modules/Potentials/CallRelatedList.php ============================================================================== --- vtigercrm/trunk/modules/Potentials/CallRelatedList.php (original) +++ vtigercrm/trunk/modules/Potentials/CallRelatedList.php Wed Aug 23 23:29:28 2006 @@ -46,8 +46,7 @@ $category = getParentTab(); $smarty->assign("CATEGORY",$category); $smarty->assign("UPDATEINFO",updateInfo($focus->id)); -$smarty->assign("id",$focus->id); -$smarty->assign("ID",$RECORD ); +$smarty->assign("ID",$focus->id); $smarty->assign("MODULE",$currentModule); $smarty->assign("SINGLE_MOD",$app_strings['Potential']); $smarty->assign("MOD",$mod_strings); Modified: vtigercrm/trunk/modules/Potentials/DetailView.php ============================================================================== --- vtigercrm/trunk/modules/Potentials/DetailView.php (original) +++ vtigercrm/trunk/modules/Potentials/DetailView.php Wed Aug 23 23:29:28 2006 @@ -25,10 +25,11 @@ require_once('modules/Potentials/Opportunity.php'); require_once('include/CustomFieldUtil.php'); require_once('include/utils/utils.php'); +require_once('user_privileges/default_module_view.php'); global $mod_strings; global $app_strings; -global $currentModule; +global $currentModule, $singlepane_view; $focus = new Potential(); $smarty = new vtigerCRM_Smarty; @@ -92,5 +93,14 @@ $smarty->assign("CONVERTMODE",'potentoinvoice'); $smarty->assign("MODULE","Potentials"); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); + +if($singlepane_view == 'true') +{ + $related_array = getRelatedLists($currentModule,$focus); + $smarty->assign("RELATEDLISTS", $related_array); +} + +$smarty->assign("SinglePane_View", $singlepane_view); + $smarty->display("DetailView.tpl"); ?> Modified: vtigercrm/trunk/modules/Potentials/Opportunity.php ============================================================================== --- vtigercrm/trunk/modules/Potentials/Opportunity.php (original) +++ vtigercrm/trunk/modules/Potentials/Opportunity.php Wed Aug 23 23:29:28 2006 @@ -1,491 +1,507 @@ -'crmid','vtiger_potential'=>'potentialid','vtiger_potentialscf'=>'potentialid'); - - var $column_fields = Array(); - - var $sortby_fields = Array('potentialname','amount','closingdate','smownerid'); - - - // This is the list of vtiger_fields that are in the lists. - var $list_fields = Array( - 'Potential'=>Array('potential'=>'potentialname'), - 'Account Name'=>Array('account'=>'accountname'), - 'Sales Stage'=>Array('potential'=>'sales_stage'), - 'Amount'=>Array('potential'=>'amount'), - 'Expected Close'=>Array('potential'=>'closingdate'), - 'Assigned To'=>Array('crmentity','smownerid') - ); - - var $list_fields_name = Array( - 'Potential'=>'potentialname', - 'Account Name'=>'accountid', - 'Sales Stage'=>'sales_stage', - 'Amount'=>'amount', - 'Expected Close'=>'closingdate', - 'Assigned To'=>'assigned_user_id'); - - var $list_link_field= 'potentialname'; - - var $search_fields = Array( - 'Potential'=>Array('potential'=>'potentialname'), - 'Account Name'=>Array('potential'=>'accountid'), - 'Expected Close'=>Array('potential'=>'closedate') - ); - - var $search_fields_name = Array( - 'Potential'=>'potentialname', - 'Account Name'=>'account_id', - 'Expected Close'=>'closingdate' - ); - - var $required_fields = array( - "potentialname"=>1, - "account_id"=>1, - "closingdate"=>1, - "sales_stage"=>1, - "amount"=>1 - ); - - //Added these variables which are used as default order by and sortorder in ListView - var $default_order_by = 'potentialname'; - var $default_sort_order = 'ASC'; - - function Potential() { - $this->log = LoggerManager::getLogger('potential'); - $this->db = new PearDatabase(); - $this->column_fields = getColumnFields('Potentials'); - } - - var $new_schema = true; - - /** - * Function to get sort order - * return string $sorder - sortorder string either 'ASC' or 'DESC' - */ - function getSortOrder() - { - global $log; - $log->debug("Entering getSortOrder() method ..."); - if(isset($_REQUEST['sorder'])) - $sorder = $_REQUEST['sorder']; - else - $sorder = (($_SESSION['POTENTIALS_SORT_ORDER'] != '')?($_SESSION['POTENTIALS_SORT_ORDER']):($this->default_sort_order)); - $log->debug("Exiting getSortOrder() method ..."); - return $sorder; - } - - /** - * Function to get order by - * return string $order_by - fieldname(eg: 'Potentialname') - */ - function getOrderBy() - { - global $log; - $log->debug("Entering getOrderBy() method ..."); - if (isset($_REQUEST['order_by'])) - $order_by = $_REQUEST['order_by']; - else - $order_by = (($_SESSION['POTENTIALS_ORDER_BY'] != '')?($_SESSION['POTENTIALS_ORDER_BY']):($this->default_order_by)); - $log->debug("Exiting getOrderBy method ..."); - return $order_by; - } - - /** Function to create list query - * @param reference variable - order by is passed when the query is executed - * @param reference variable - where condition is passed when the query is executed - * Returns Query. - */ - function create_list_query($order_by, $where) - { - global $log; - $log->debug("Entering create_list_query(".$order_by.",". $where.") method ..."); - // Determine if the vtiger_account name is present in the where clause. - $account_required = ereg("accounts\.name", $where); - - if($account_required) - { - $query = "SELECT vtiger_potential.potentialid, vtiger_potential.potentialname, vtiger_potential.dateclosed FROM vtiger_potential, vtiger_account "; - $where_auto = "account.accountid = vtiger_potential.accountid AND vtiger_crmentity.deleted=0 "; - } - else - { - $query = 'SELECT potentialid, potentialname, smcreatorid, closingdate FROM vtiger_potential inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_potential.potentialid '; - $where_auto = 'AND vtiger_crmentity.deleted=0'; - } - - if($where != "") - $query .= "where $where ".$where_auto; - else - $query .= "where ".$where_auto; - - if($order_by != "") - $query .= " ORDER BY vtiger_potential.$order_by"; - else - $query .= " ORDER BY vtiger_potential.potentialname"; - - - - $log->debug("Exiting create_list_query method ..."); - return $query; - } - - /** Function to export the Opportunities records in CSV Format - * @param reference variable - order by is passed when the query is executed - * @param reference variable - where condition is passed when the query is executed - * Returns Export Potentials Query. - */ - function create_export_query($order_by, $where) - { - global $log; - $log->debug("Entering create_export_query(".$order_by.",". $where.") method ..."); - - if($this->checkIfCustomTableExists('vtiger_potentialscf')) - { - $query = $this->constructCustomQueryAddendum('vtiger_potentialscf','Potentials') ." - vtiger_potential.*, - vtiger_account.accountname account_name, - vtiger_users.user_name assigned_user_name - FROM vtiger_potential - INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid=vtiger_potential.potentialid - LEFT JOIN vtiger_account on vtiger_potential.accountid=vtiger_account.accountid - left join vtiger_potentialscf on vtiger_potentialscf.potentialid=vtiger_potential.potentialid - left join vtiger_users on vtiger_crmentity.smownerid=vtiger_users.id - where vtiger_crmentity.deleted=0 "; - } - else - { - $query = "SELECT - vtiger_potential.*, - vtiger_account.accountname account_name, - vtiger_users.user_name assigned_user_name - FROM vtiger_potential - inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_potential.potentialid - LEFT JOIN vtiger_users ON vtiger_crmentity.smownerid=vtiger_users.id - LEFT JOIN vtiger_account on vtiger_potential.accountid=vtiger_account.accountid - LEFT JOIN vtiger_potentialscf on vtiger_potentialscf.potentialid=vtiger_potential.potentialid - where vtiger_crmentity.deleted=0 "; - } - - $log->debug("Exiting create_export_query method ..."); - return $query; - - } - - - - /** Returns a list of the associated contacts - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function get_contacts($id) - { - global $log; - $log->debug("Entering get_contacts(".$id.") method ..."); - global $app_strings; - - $focus = new Contact(); - - $button = ''; - - if(isPermitted("Contacts",3,"") == 'yes') - { - - $button .= ' '; - } - $returnset = '&return_module=Potentials&return_action=CallRelatedList&return_id='.$id; - - $query = 'select vtiger_contactdetails.accountid, vtiger_users.user_name,vtiger_groups.groupname,vtiger_potential.potentialid, vtiger_potential.potentialname, vtiger_contactdetails.contactid, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.title, vtiger_contactdetails.department, vtiger_contactdetails.email, vtiger_contactdetails.phone, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_potential inner join vtiger_contpotentialrel on vtiger_contpotentialrel.potentialid = vtiger_potential.potentialid inner join vtiger_contactdetails on vtiger_contpotentialrel.contactid = vtiger_contactdetails.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid left join vtiger_contactgrouprelation on vtiger_contactdetails.contactid=vtiger_contactgrouprelation.contactid left join vtiger_groups on vtiger_groups.groupname=vtiger_contactgrouprelation.groupname left join vtiger_users on vtiger_crmentity.smownerid=vtiger_users.id where vtiger_potential.potentialid = '.$id.' and vtiger_crmentity.deleted=0'; - - $log->debug("Exiting get_contacts method ..."); - return GetRelatedList('Potentials','Contacts',$focus,$query,$button,$returnset); - } - - /** Returns a list of the associated calls - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function get_activities($id) - { - global $log; - $log->debug("Entering get_activities(".$id.") method ..."); - global $mod_strings; - - $focus = new Activity(); - - $button = ''; - - if(isPermitted("Calendar",1,"") == 'yes') - { - - $button .= ' '; - $button .= ' '; - } - $returnset = '&return_module=Potentials&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_activity.*,vtiger_seactivityrel.*,vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_users.user_name, vtiger_recurringevents.recurringtype from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_potential on vtiger_potential.potentialid=vtiger_seactivityrel.crmid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid where vtiger_seactivityrel.crmid=".$id." and (activitytype='Task' or activitytype='Call' or activitytype='Meeting') and vtiger_crmentity.deleted=0 and ((vtiger_activity.status is not NULL && vtiger_activity.status != 'Completed') and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Deferred') or (vtiger_activity.eventstatus != '' && vtiger_activity.eventstatus != 'Held'))"; - $log->debug("Exiting get_activities method ..."); - return GetRelatedList('Potentials','Calendar',$focus,$query,$button,$returnset); - - } - - /** - * Function to get Contact related Products - * @param integer $id - contactid - * returns related Products record in array format - */ - function get_products($id) - { - global $log; - $log->debug("Entering get_products(".$id.") method ..."); - require_once('modules/Products/Product.php'); - global $app_strings; - - $focus = new Product(); - - $button = ''; - - if(isPermitted("Products",1,"") == 'yes') - { - - - $button .= ' '; - } - if(isPermitted("Products",3,"") == 'yes') - { - $button .= ' '; - } - $returnset = '&return_module=Potentials&return_action=CallRelatedList&return_id='.$id; - - $query = 'select vtiger_products.productid, vtiger_products.productname, vtiger_products.productcode, vtiger_products.commissionrate, vtiger_products.qty_per_unit, vtiger_products.unit_price, vtiger_crmentity.crmid, vtiger_crmentity.smownerid from vtiger_products inner join vtiger_seproductsrel on vtiger_products.productid = vtiger_seproductsrel.productid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_products.productid inner join vtiger_potential on vtiger_potential.potentialid = vtiger_seproductsrel.crmid where vtiger_potential.potentialid = '.$id.' and vtiger_crmentity.deleted = 0'; - $log->debug("Exiting get_products method ..."); - return GetRelatedList('Potentials','Products',$focus,$query,$button,$returnset); - } - - /** Function used to get the Sales Stage history of the Potential - * @param $id - potentialid - * return $return_data - array with header and the entries in format Array('header'=>$header,'entries'=>$entries_list) where as $header and $entries_list are array which contains all the column values of an row - */ - function get_stage_history($id) - { - global $log; - $log->debug("Entering get_stage_history(".$id.") method ..."); - - global $adb; - global $mod_strings; - global $app_strings; - - $query = 'select vtiger_potstagehistory.*, vtiger_potential.potentialname from vtiger_potstagehistory inner join vtiger_potential on vtiger_potential.potentialid = vtiger_potstagehistory.potentialid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_potential.potentialid where vtiger_crmentity.deleted = 0 and vtiger_potential.potentialid = '.$id; - $result=$adb->query($query); - $noofrows = $adb->num_rows($result); - - $header[] = $app_strings['LBL_AMOUNT']; - $header[] = $app_strings['LBL_SALES_STAGE']; - $header[] = $app_strings['LBL_PROBABILITY']; - $header[] = $app_strings['LBL_CLOSE_DATE']; - $header[] = $app_strings['LBL_LAST_MODIFIED']; - - while($row = $adb->fetch_array($result)) - { - $entries = Array(); - - $entries[] = $row['amount']; - $entries[] = $row['stage']; - $entries[] = $row['probability']; - $entries[] = getDisplayDate($row['closedate']); - $entries[] = getDisplayDate($row['lastmodified']); - - $entries_list[] = $entries; - } - - $return_data = Array('header'=>$header,'entries'=>$entries_list); - - $log->debug("Exiting get_stage_history method ..."); - - return $return_data; - } - - /** - * Function to get Potential related Task & Event which have activity type Held, Completed or Deferred. - * @param integer $id - * returns related Task or Event record in array format - */ - function get_history($id) - { - global $log; - $log->debug("Entering get_history(".$id.") method ..."); - $query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.status, - vtiger_activity.eventstatus, vtiger_activity.activitytype, vtiger_crmentity.modifiedtime, - vtiger_crmentity.createdtime, vtiger_crmentity.description, vtiger_users.user_name - from vtiger_activity - inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid - inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid - left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid - left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname - inner join vtiger_users on vtiger_crmentity.smcreatorid= vtiger_users.id - where (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') - and (vtiger_activity.status = 'Completed' or vtiger_activity.status = 'Deferred' or (vtiger_activity.eventstatus = 'Held' and vtiger_activity.eventstatus != '')) - and vtiger_seactivityrel.crmid=".$id; - //Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php - - $log->debug("Exiting get_history method ..."); - return getHistory('Potentials',$query,$id); - } - - /** - * Function to get Potential related Attachments - * @param integer $id - * returns related Attachment record in array format - */ - function get_attachments($id) - { - global $log; - $log->debug("Entering get_attachments(".$id.") method ..."); - // Armando L?scher 18.10.2005 -> ?visibleDescription - // Desc: Inserted crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name - // Inserted inner join vtiger_users on crm2.smcreatorid= vtiger_users.id - $query = "select vtiger_notes.title,'Notes ' ActivityType, vtiger_notes.filename, - vtiger_attachments.type FileType, crm2.modifiedtime lastmodified, - vtiger_seattachmentsrel.attachmentsid, vtiger_notes.notesid crmid, - crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name - from vtiger_notes - inner join vtiger_senotesrel on vtiger_senotesrel.notesid= vtiger_notes.notesid - inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_senotesrel.crmid - inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_notes.notesid and crm2.deleted=0 - left join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid =vtiger_notes.notesid - left join vtiger_attachments on vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid - inner join vtiger_users on crm2.smcreatorid= vtiger_users.id - where vtiger_crmentity.crmid=".$id; - $query .= ' union all '; - // Armando L?scher 18.10.2005 -> ?visibleDescription - // Desc: Inserted crm2.createdtime, vtiger_attachments.description, vtiger_users.user_name - // Inserted inner join vtiger_users on crm2.smcreatorid= vtiger_users.id - // Inserted order by createdtime desc - $query .= "select vtiger_attachments.description title ,'Attachments' ActivityType, - vtiger_attachments.name filename, vtiger_attachments.type FileType,crm2.modifiedtime lastmodified, - vtiger_attachments.attachmentsid, vtiger_seattachmentsrel.attachmentsid crmid, - crm2.createdtime, vtiger_attachments.description, vtiger_users.user_name - from vtiger_attachments - inner join vtiger_seattachmentsrel on vtiger_seattachmentsrel.attachmentsid= vtiger_attachments.attachmentsid - inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_seattachmentsrel.crmid - inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_attachments.attachmentsid - inner join vtiger_users on crm2.smcreatorid= vtiger_users.id - where vtiger_crmentity.crmid=".$id." - order by createdtime desc"; - - $log->debug("Exiting get_attachments method ..."); - return getAttachmentsAndNotes('Potentials',$query,$id); - } - - /** - * Function to get Potential related Quotes - * @param integer $id - potentialid - * returns related Quotes record in array format - */ - function get_quotes($id) - { - global $log; - $log->debug("Entering get_quotes(".$id.") method ..."); - global $app_strings; - require_once('modules/Quotes/Quote.php'); - - if($this->column_fields['account_id']!='') - $focus = new Quote(); - - $button = ''; - if(isPermitted("Quotes",1,"") == 'yes') - { - $button .= ' '; - } - $returnset = '&return_module=Potentials&return_action=CallRelatedList&return_id='.$id; - - - $query = "select vtiger_crmentity.*, vtiger_quotes.*, vtiger_potential.potentialname, vtiger_users.user_name from vtiger_quotes inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_quotes.quoteid left outer join vtiger_potential on vtiger_potential.potentialid=vtiger_quotes.potentialid left join vtiger_quotegrouprelation on vtiger_quotes.quoteid=vtiger_quotegrouprelation.quoteid left join vtiger_groups on vtiger_groups.groupname=vtiger_quotegrouprelation.groupname left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where vtiger_crmentity.deleted=0 and vtiger_potential.potentialid=".$id; - $log->debug("Exiting get_quotes method ..."); - return GetRelatedList('Potentials','Quotes',$focus,$query,$button,$returnset); - } - - /** - * Function to get Potential related SalesOrder - * @param integer $id - potentialid - * returns related SalesOrder record in array format - */ - function get_salesorder($id) - { - global $log; - $log->debug("Entering get_salesorder(".$id.") method ..."); - require_once('modules/SalesOrder/SalesOrder.php'); - global $mod_strings; - global $app_strings; - - $focus = new SalesOrder(); - - $button = ''; - if(isPermitted("SalesOrder",1,"") == 'yes') - { - $button .= ' '; - } - - $returnset = '&return_module=Potentials&return_action=CallRelatedList&return_id='.$id; - - - $query = "select vtiger_crmentity.*, vtiger_salesorder.*, vtiger_quotes.subject as quotename, vtiger_account.accountname, vtiger_potential.potentialname from vtiger_salesorder inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_salesorder.salesorderid left outer join vtiger_quotes on vtiger_quotes.quoteid=vtiger_salesorder.quoteid left outer join vtiger_account on vtiger_account.accountid=vtiger_salesorder.accountid left outer join vtiger_potential on vtiger_potential.potentialid=vtiger_salesorder.potentialid left join vtiger_sogrouprelation on vtiger_salesorder.salesorderid=vtiger_sogrouprelation.salesorderid left join vtiger_groups on vtiger_groups.groupname=vtiger_sogrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_potential.potentialid = ".$id; - $log->debug("Exiting get_salesorder method ..."); - return GetRelatedList('Potentials','SalesOrder',$focus,$query,$button,$returnset); - - } - - - - -} - - - -?> +'crmid','vtiger_potential'=>'potentialid','vtiger_potentialscf'=>'potentialid'); + + var $column_fields = Array(); + + var $sortby_fields = Array('potentialname','amount','closingdate','smownerid'); + + + // This is the list of vtiger_fields that are in the lists. + var $list_fields = Array( + 'Potential'=>Array('potential'=>'potentialname'), + 'Account Name'=>Array('account'=>'accountname'), + 'Sales Stage'=>Array('potential'=>'sales_stage'), + 'Amount'=>Array('potential'=>'amount'), + 'Expected Close'=>Array('potential'=>'closingdate'), + 'Assigned To'=>Array('crmentity','smownerid') + ); + + var $list_fields_name = Array( + 'Potential'=>'potentialname', + 'Account Name'=>'accountid', + 'Sales Stage'=>'sales_stage', + 'Amount'=>'amount', + 'Expected Close'=>'closingdate', + 'Assigned To'=>'assigned_user_id'); + + var $list_link_field= 'potentialname'; + + var $search_fields = Array( + 'Potential'=>Array('potential'=>'potentialname'), + 'Account Name'=>Array('potential'=>'accountid'), + 'Expected Close'=>Array('potential'=>'closedate') + ); + + var $search_fields_name = Array( + 'Potential'=>'potentialname', + 'Account Name'=>'account_id', + 'Expected Close'=>'closingdate' + ); + + var $required_fields = array( + "potentialname"=>1, + "account_id"=>1, + "closingdate"=>1, + "sales_stage"=>1, + "amount"=>1 + ); + + //Added these variables which are used as default order by and sortorder in ListView + var $default_order_by = 'potentialname'; + var $default_sort_order = 'ASC'; + + function Potential() { + $this->log = LoggerManager::getLogger('potential'); + $this->db = new PearDatabase(); + $this->column_fields = getColumnFields('Potentials'); + } + + var $new_schema = true; + + /** + * Function to get sort order + * return string $sorder - sortorder string either 'ASC' or 'DESC' + */ + function getSortOrder() + { + global $log; + $log->debug("Entering getSortOrder() method ..."); + if(isset($_REQUEST['sorder'])) + $sorder = $_REQUEST['sorder']; + else + $sorder = (($_SESSION['POTENTIALS_SORT_ORDER'] != '')?($_SESSION['POTENTIALS_SORT_ORDER']):($this->default_sort_order)); + $log->debug("Exiting getSortOrder() method ..."); + return $sorder; + } + + /** + * Function to get order by + * return string $order_by - fieldname(eg: 'Potentialname') + */ + function getOrderBy() + { + global $log; + $log->debug("Entering getOrderBy() method ..."); + if (isset($_REQUEST['order_by'])) + $order_by = $_REQUEST['order_by']; + else + $order_by = (($_SESSION['POTENTIALS_ORDER_BY'] != '')?($_SESSION['POTENTIALS_ORDER_BY']):($this->default_order_by)); + $log->debug("Exiting getOrderBy method ..."); + return $order_by; + } + + /** Function to create list query + * @param reference variable - order by is passed when the query is executed + * @param reference variable - where condition is passed when the query is executed + * Returns Query. + */ + function create_list_query($order_by, $where) + { + global $log; + $log->debug("Entering create_list_query(".$order_by.",". $where.") method ..."); + // Determine if the vtiger_account name is present in the where clause. + $account_required = ereg("accounts\.name", $where); + + if($account_required) + { + $query = "SELECT vtiger_potential.potentialid, vtiger_potential.potentialname, vtiger_potential.dateclosed FROM vtiger_potential, vtiger_account "; + $where_auto = "account.accountid = vtiger_potential.accountid AND vtiger_crmentity.deleted=0 "; + } + else + { + $query = 'SELECT potentialid, potentialname, smcreatorid, closingdate FROM vtiger_potential inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_potential.potentialid '; + $where_auto = 'AND vtiger_crmentity.deleted=0'; + } + + if($where != "") + $query .= "where $where ".$where_auto; + else + $query .= "where ".$where_auto; + + if($order_by != "") + $query .= " ORDER BY vtiger_potential.$order_by"; + else + $query .= " ORDER BY vtiger_potential.potentialname"; + + + + $log->debug("Exiting create_list_query method ..."); + return $query; + } + + /** Function to export the Opportunities records in CSV Format + * @param reference variable - order by is passed when the query is executed + * @param reference variable - where condition is passed when the query is executed + * Returns Export Potentials Query. + */ + function create_export_query($order_by, $where) + { + global $log; + $log->debug("Entering create_export_query(".$order_by.",". $where.") method ..."); + + if($this->checkIfCustomTableExists('vtiger_potentialscf')) + { + $query = $this->constructCustomQueryAddendum('vtiger_potentialscf','Potentials') ." + vtiger_potential.*, + vtiger_account.accountname account_name, + vtiger_users.user_name assigned_user_name + FROM vtiger_potential + INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid=vtiger_potential.potentialid + LEFT JOIN vtiger_account on vtiger_potential.accountid=vtiger_account.accountid + left join vtiger_potentialscf on vtiger_potentialscf.potentialid=vtiger_potential.potentialid + left join vtiger_users on vtiger_crmentity.smownerid=vtiger_users.id + where vtiger_crmentity.deleted=0 "; + } + else + { + $query = "SELECT + vtiger_potential.*, + vtiger_account.accountname account_name, + vtiger_users.user_name assigned_user_name + FROM vtiger_potential + inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_potential.potentialid + LEFT JOIN vtiger_users ON vtiger_crmentity.smownerid=vtiger_users.id + LEFT JOIN vtiger_account on vtiger_potential.accountid=vtiger_account.accountid + LEFT JOIN vtiger_potentialscf on vtiger_potentialscf.potentialid=vtiger_potential.potentialid + where vtiger_crmentity.deleted=0 "; + } + + $log->debug("Exiting create_export_query method ..."); + return $query; + + } + + + + /** Returns a list of the associated contacts + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function get_contacts($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_contacts(".$id.") method ..."); + global $app_strings; + + $focus = new Contact(); + + $button = ''; + + if(isPermitted("Contacts",3,"") == 'yes') + { + + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Potentials&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Potentials&return_action=CallRelatedList&return_id='.$id; + + $query = 'select vtiger_contactdetails.accountid, vtiger_users.user_name,vtiger_groups.groupname,vtiger_potential.potentialid, vtiger_potential.potentialname, vtiger_contactdetails.contactid, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.title, vtiger_contactdetails.department, vtiger_contactdetails.email, vtiger_contactdetails.phone, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_potential inner join vtiger_contpotentialrel on vtiger_contpotentialrel.potentialid = vtiger_potential.potentialid inner join vtiger_contactdetails on vtiger_contpotentialrel.contactid = vtiger_contactdetails.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid left join vtiger_contactgrouprelation on vtiger_contactdetails.contactid=vtiger_contactgrouprelation.contactid left join vtiger_groups on vtiger_groups.groupname=vtiger_contactgrouprelation.groupname left join vtiger_users on vtiger_crmentity.smownerid=vtiger_users.id where vtiger_potential.potentialid = '.$id.' and vtiger_crmentity.deleted=0'; + + $log->debug("Exiting get_contacts method ..."); + return GetRelatedList('Potentials','Contacts',$focus,$query,$button,$returnset); + } + + /** Returns a list of the associated calls + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function get_activities($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_activities(".$id.") method ..."); + global $mod_strings; + + $focus = new Activity(); + + $button = ''; + + if(isPermitted("Calendar",1,"") == 'yes') + { + + $button .= ' '; + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Potentials&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Potentials&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_activity.*,vtiger_seactivityrel.*,vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_users.user_name, vtiger_recurringevents.recurringtype from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_potential on vtiger_potential.potentialid=vtiger_seactivityrel.crmid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid where vtiger_seactivityrel.crmid=".$id." and (activitytype='Task' or activitytype='Call' or activitytype='Meeting') and vtiger_crmentity.deleted=0 and ((vtiger_activity.status is not NULL && vtiger_activity.status != 'Completed') and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Deferred') or (vtiger_activity.eventstatus != '' && vtiger_activity.eventstatus != 'Held'))"; + $log->debug("Exiting get_activities method ..."); + return GetRelatedList('Potentials','Calendar',$focus,$query,$button,$returnset); + + } + + /** + * Function to get Contact related Products + * @param integer $id - contactid + * returns related Products record in array format + */ + function get_products($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_products(".$id.") method ..."); + require_once('modules/Products/Product.php'); + global $app_strings; + + $focus = new Product(); + + $button = ''; + + if(isPermitted("Products",1,"") == 'yes') + { + + + $button .= ' '; + } + if(isPermitted("Products",3,"") == 'yes') + { + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Potentials&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Potentials&return_action=CallRelatedList&return_id='.$id; + + $query = 'select vtiger_products.productid, vtiger_products.productname, vtiger_products.productcode, vtiger_products.commissionrate, vtiger_products.qty_per_unit, vtiger_products.unit_price, vtiger_crmentity.crmid, vtiger_crmentity.smownerid from vtiger_products inner join vtiger_seproductsrel on vtiger_products.productid = vtiger_seproductsrel.productid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_products.productid inner join vtiger_potential on vtiger_potential.potentialid = vtiger_seproductsrel.crmid where vtiger_potential.potentialid = '.$id.' and vtiger_crmentity.deleted = 0'; + $log->debug("Exiting get_products method ..."); + return GetRelatedList('Potentials','Products',$focus,$query,$button,$returnset); + } + + /** Function used to get the Sales Stage history of the Potential + * @param $id - potentialid + * return $return_data - array with header and the entries in format Array('header'=>$header,'entries'=>$entries_list) where as $header and $entries_list are array which contains all the column values of an row + */ + function get_stage_history($id) + { + global $log; + $log->debug("Entering get_stage_history(".$id.") method ..."); + + global $adb; + global $mod_strings; + global $app_strings; + + $query = 'select vtiger_potstagehistory.*, vtiger_potential.potentialname from vtiger_potstagehistory inner join vtiger_potential on vtiger_potential.potentialid = vtiger_potstagehistory.potentialid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_potential.potentialid where vtiger_crmentity.deleted = 0 and vtiger_potential.potentialid = '.$id; + $result=$adb->query($query); + $noofrows = $adb->num_rows($result); + + $header[] = $app_strings['LBL_AMOUNT']; + $header[] = $app_strings['LBL_SALES_STAGE']; + $header[] = $app_strings['LBL_PROBABILITY']; + $header[] = $app_strings['LBL_CLOSE_DATE']; + $header[] = $app_strings['LBL_LAST_MODIFIED']; + + while($row = $adb->fetch_array($result)) + { + $entries = Array(); + + $entries[] = $row['amount']; + $entries[] = $row['stage']; + $entries[] = $row['probability']; + $entries[] = getDisplayDate($row['closedate']); + $entries[] = getDisplayDate($row['lastmodified']); + + $entries_list[] = $entries; + } + + $return_data = Array('header'=>$header,'entries'=>$entries_list); + + $log->debug("Exiting get_stage_history method ..."); + + return $return_data; + } + + /** + * Function to get Potential related Task & Event which have activity type Held, Completed or Deferred. + * @param integer $id + * returns related Task or Event record in array format + */ + function get_history($id) + { + global $log; + $log->debug("Entering get_history(".$id.") method ..."); + $query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.status, + vtiger_activity.eventstatus, vtiger_activity.activitytype, vtiger_crmentity.modifiedtime, + vtiger_crmentity.createdtime, vtiger_crmentity.description, vtiger_users.user_name + from vtiger_activity + inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid + inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid + left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid + left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname + inner join vtiger_users on vtiger_crmentity.smcreatorid= vtiger_users.id + where (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') + and (vtiger_activity.status = 'Completed' or vtiger_activity.status = 'Deferred' or (vtiger_activity.eventstatus = 'Held' and vtiger_activity.eventstatus != '')) + and vtiger_seactivityrel.crmid=".$id; + //Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php + + $log->debug("Exiting get_history method ..."); + return getHistory('Potentials',$query,$id); + } + + /** + * Function to get Potential related Attachments + * @param integer $id + * returns related Attachment record in array format + */ + function get_attachments($id) + { + global $log; + $log->debug("Entering get_attachments(".$id.") method ..."); + // Armando L?scher 18.10.2005 -> ?visibleDescription + // Desc: Inserted crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name + // Inserted inner join vtiger_users on crm2.smcreatorid= vtiger_users.id + $query = "select vtiger_notes.title,'Notes ' ActivityType, vtiger_notes.filename, + vtiger_attachments.type FileType, crm2.modifiedtime lastmodified, + vtiger_seattachmentsrel.attachmentsid, vtiger_notes.notesid crmid, + crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name + from vtiger_notes + inner join vtiger_senotesrel on vtiger_senotesrel.notesid= vtiger_notes.notesid + inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_senotesrel.crmid + inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_notes.notesid and crm2.deleted=0 + left join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid =vtiger_notes.notesid + left join vtiger_attachments on vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid + inner join vtiger_users on crm2.smcreatorid= vtiger_users.id + where vtiger_crmentity.crmid=".$id; + $query .= ' union all '; + // Armando L?scher 18.10.2005 -> ?visibleDescription + // Desc: Inserted crm2.createdtime, vtiger_attachments.description, vtiger_users.user_name + // Inserted inner join vtiger_users on crm2.smcreatorid= vtiger_users.id + // Inserted order by createdtime desc + $query .= "select vtiger_attachments.description title ,'Attachments' ActivityType, + vtiger_attachments.name filename, vtiger_attachments.type FileType,crm2.modifiedtime lastmodified, + vtiger_attachments.attachmentsid, vtiger_seattachmentsrel.attachmentsid crmid, + crm2.createdtime, vtiger_attachments.description, vtiger_users.user_name + from vtiger_attachments + inner join vtiger_seattachmentsrel on vtiger_seattachmentsrel.attachmentsid= vtiger_attachments.attachmentsid + inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_seattachmentsrel.crmid + inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_attachments.attachmentsid + inner join vtiger_users on crm2.smcreatorid= vtiger_users.id + where vtiger_crmentity.crmid=".$id." + order by createdtime desc"; + + $log->debug("Exiting get_attachments method ..."); + return getAttachmentsAndNotes('Potentials',$query,$id); + } + + /** + * Function to get Potential related Quotes + * @param integer $id - potentialid + * returns related Quotes record in array format + */ + function get_quotes($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_quotes(".$id.") method ..."); + global $app_strings; + require_once('modules/Quotes/Quote.php'); + + if($this->column_fields['account_id']!='') + $focus = new Quote(); + + $button = ''; + if(isPermitted("Quotes",1,"") == 'yes') + { + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Potentials&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Potentials&return_action=CallRelatedList&return_id='.$id; + + + $query = "select vtiger_crmentity.*, vtiger_quotes.*, vtiger_potential.potentialname, vtiger_users.user_name from vtiger_quotes inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_quotes.quoteid left outer join vtiger_potential on vtiger_potential.potentialid=vtiger_quotes.potentialid left join vtiger_quotegrouprelation on vtiger_quotes.quoteid=vtiger_quotegrouprelation.quoteid left join vtiger_groups on vtiger_groups.groupname=vtiger_quotegrouprelation.groupname left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where vtiger_crmentity.deleted=0 and vtiger_potential.potentialid=".$id; + $log->debug("Exiting get_quotes method ..."); + return GetRelatedList('Potentials','Quotes',$focus,$query,$button,$returnset); + } + + /** + * Function to get Potential related SalesOrder + * @param integer $id - potentialid + * returns related SalesOrder record in array format + */ + function get_salesorder($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_salesorder(".$id.") method ..."); + require_once('modules/SalesOrder/SalesOrder.php'); + global $mod_strings; + global $app_strings; + + $focus = new SalesOrder(); + + $button = ''; + if(isPermitted("SalesOrder",1,"") == 'yes') + { + $button .= ' '; + } + + if($singlepane_view == 'true') + $returnset = '&return_module=Potentials&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Potentials&return_action=CallRelatedList&return_id='.$id; + + + $query = "select vtiger_crmentity.*, vtiger_salesorder.*, vtiger_quotes.subject as quotename, vtiger_account.accountname, vtiger_potential.potentialname from vtiger_salesorder inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_salesorder.salesorderid left outer join vtiger_quotes on vtiger_quotes.quoteid=vtiger_salesorder.quoteid left outer join vtiger_account on vtiger_account.accountid=vtiger_salesorder.accountid left outer join vtiger_potential on vtiger_potential.potentialid=vtiger_salesorder.potentialid left join vtiger_sogrouprelation on vtiger_salesorder.salesorderid=vtiger_sogrouprelation.salesorderid left join vtiger_groups on vtiger_groups.groupname=vtiger_sogrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_potential.potentialid = ".$id; + $log->debug("Exiting get_salesorder method ..."); + return GetRelatedList('Potentials','SalesOrder',$focus,$query,$button,$returnset); + + } + + + + +} + + + +?> Modified: vtigercrm/trunk/modules/Potentials/updateRelations.php ============================================================================== --- vtigercrm/trunk/modules/Potentials/updateRelations.php (original) +++ vtigercrm/trunk/modules/Potentials/updateRelations.php Wed Aug 23 23:29:28 2006 @@ -1,41 +1,48 @@ -query($sql); - $sql = "insert into vtiger_seproductsrel values (". $_REQUEST["parentid"] .",".$id.")"; - $adb->query($sql); - } - } - header("Location: index.php?action=CallRelatedList&module=Potentials&record=".$_REQUEST["parentid"]); -} -elseif(isset($_REQUEST['entityid']) && $_REQUEST['entityid'] != '') -{ - $sql = "insert into vtiger_contpotentialrel values (". $_REQUEST["entityid"] .",".$_REQUEST["parid"] .")"; - $adb->query($sql); - $sql = "insert into vtiger_seproductsrel values (". $_REQUEST["parid"] .",".$_REQUEST["entityid"] .")"; - $adb->query($sql); - header("Location: index.php?action=CallRelatedList&module=Potentials&record=".$_REQUEST["parid"]); -} - -?> +query($sql); + $sql = "insert into vtiger_seproductsrel values (". $_REQUEST["parentid"] .",".$id.")"; + $adb->query($sql); + } + } + if($singlepane_view == 'true') + header("Location: index.php?action=DetailView&module=Potentials&record=".$_REQUEST["parentid"]); + else + header("Location: index.php?action=CallRelatedList&module=Potentials&record=".$_REQUEST["parentid"]); +} +elseif(isset($_REQUEST['entityid']) && $_REQUEST['entityid'] != '') +{ + $sql = "insert into vtiger_contpotentialrel values (". $_REQUEST["entityid"] .",".$_REQUEST["parid"] .")"; + $adb->query($sql); + $sql = "insert into vtiger_seproductsrel values (". $_REQUEST["parid"] .",".$_REQUEST["entityid"] .")"; + $adb->query($sql); + if($singlepane_view == 'true') + header("Location: index.php?action=DetailView&module=Potentials&record=".$_REQUEST["parid"]); + else + header("Location: index.php?action=CallRelatedList&module=Potentials&record=".$_REQUEST["parid"]); +} + +?> From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 01:31:16 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:31:16 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9106 - in /vtigercrm/trunk/modules/PriceBooks: CallRelatedList.php DetailView.php PriceBook.php Message-ID: <20060824053116.840B075E76C@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:30:51 2006 New Revision: 9106 Log: Updated the single pane view feature for detailview in PriceBooks Module -- ahmed Modified: vtigercrm/trunk/modules/PriceBooks/CallRelatedList.php vtigercrm/trunk/modules/PriceBooks/DetailView.php vtigercrm/trunk/modules/PriceBooks/PriceBook.php Modified: vtigercrm/trunk/modules/PriceBooks/CallRelatedList.php ============================================================================== --- vtigercrm/trunk/modules/PriceBooks/CallRelatedList.php (original) +++ vtigercrm/trunk/modules/PriceBooks/CallRelatedList.php Wed Aug 23 23:30:51 2006 @@ -50,8 +50,7 @@ if(isset($_REQUEST['mode']) && $_REQUEST['mode'] != ' ') { $smarty->assign("OP_MODE",$_REQUEST['mode']); } -$smarty->assign("id",$focus->id); -$smarty->assign("ID",$RECORD ); +$smarty->assign("ID",$focus->id); $smarty->assign("MODULE",$currentmodule); $smarty->assign("RELATEDLISTS", $related_array); $smarty->assign("SINGLE_MOD",$app_strings['PriceBook']); Modified: vtigercrm/trunk/modules/PriceBooks/DetailView.php ============================================================================== --- vtigercrm/trunk/modules/PriceBooks/DetailView.php (original) +++ vtigercrm/trunk/modules/PriceBooks/DetailView.php Wed Aug 23 23:30:51 2006 @@ -12,6 +12,7 @@ require_once('Smarty_setup.php'); require_once('modules/PriceBooks/PriceBook.php'); require_once('include/utils/utils.php'); +require_once('user_privileges/default_module_view.php'); $focus = new PriceBook(); @@ -27,7 +28,7 @@ $focus->id = ""; } -global $app_strings,$mod_strings,$theme,$currentModule; +global $app_strings,$mod_strings,$theme,$currentModule,$singlepane_view; $theme_path="themes/".$theme."/"; $image_path=$theme_path."images/"; @@ -73,5 +74,14 @@ $smarty->assign("MODULE", $currentModule); $smarty->assign("SINGLE_MOD", 'PriceBook'); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); + +if($singlepane_view == 'true') +{ + $related_array = getRelatedLists($currentModule,$focus); + $smarty->assign("RELATEDLISTS", $related_array); +} + +$smarty->assign("SinglePane_View", $singlepane_view); + $smarty->display("Inventory/InventoryDetailView.tpl"); ?> Modified: vtigercrm/trunk/modules/PriceBooks/PriceBook.php ============================================================================== --- vtigercrm/trunk/modules/PriceBooks/PriceBook.php (original) +++ vtigercrm/trunk/modules/PriceBooks/PriceBook.php Wed Aug 23 23:30:51 2006 @@ -15,7 +15,7 @@ require_once('data/SugarBean.php'); require_once('data/CRMEntity.php'); require_once('include/utils/utils.php'); - +require_once('user_privileges/default_module_view.php'); class PriceBook extends CRMEntity { var $log; @@ -95,7 +95,7 @@ **/ function get_pricebook_products($id) { - global $log; + global $log,$singlepane_view; $log->debug("Entering get_pricebook_products(".$id.") method ..."); global $app_strings; require_once('modules/Products/Product.php'); @@ -103,7 +103,10 @@ $button = ''; - $returnset = '&return_module=PriceBooks&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=PriceBooks&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=PriceBooks&return_action=CallRelatedList&return_id='.$id; $query = 'select vtiger_products.productid, vtiger_products.productname, vtiger_products.productcode, vtiger_products.commissionrate, vtiger_products.qty_per_unit, vtiger_products.unit_price, vtiger_crmentity.crmid, vtiger_crmentity.smownerid,vtiger_pricebookproductrel.listprice from vtiger_products inner join vtiger_pricebookproductrel on vtiger_products.productid = vtiger_pricebookproductrel.productid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_products.productid inner join vtiger_pricebook on vtiger_pricebook.pricebookid = vtiger_pricebookproductrel.pricebookid where vtiger_pricebook.pricebookid = '.$id.' and vtiger_crmentity.deleted = 0'; $log->debug("Exiting get_pricebook_products method ..."); From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 01:33:23 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:33:23 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9107 - in /vtigercrm/trunk/modules/Products: CallRelatedList.php DetailView.php Product.php addPbProductRelToDB.php Message-ID: <20060824053323.0F8D375E76C@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:33:09 2006 New Revision: 9107 Log: Updated the single pane view feature for detailview in Products Module -- ahmed Modified: vtigercrm/trunk/modules/Products/CallRelatedList.php vtigercrm/trunk/modules/Products/DetailView.php vtigercrm/trunk/modules/Products/Product.php vtigercrm/trunk/modules/Products/addPbProductRelToDB.php Modified: vtigercrm/trunk/modules/Products/CallRelatedList.php ============================================================================== --- vtigercrm/trunk/modules/Products/CallRelatedList.php (original) +++ vtigercrm/trunk/modules/Products/CallRelatedList.php Wed Aug 23 23:33:09 2006 @@ -46,8 +46,7 @@ $category = getParentTab(); $smarty->assign("CATEGORY",$category); -$smarty->assign("id",$focus->id); -$smarty->assign("ID",$RECORD ); +$smarty->assign("ID",$focus->id); $smarty->assign("MODULE",$currentmodule); $smarty->assign("UPDATEINFO",updateInfo($focus->id)); $smarty->assign("SINGLE_MOD",$app_strings['Product']); Modified: vtigercrm/trunk/modules/Products/DetailView.php ============================================================================== --- vtigercrm/trunk/modules/Products/DetailView.php (original) +++ vtigercrm/trunk/modules/Products/DetailView.php Wed Aug 23 23:33:09 2006 @@ -12,6 +12,7 @@ require_once('Smarty_setup.php'); require_once('modules/Products/Product.php'); require_once('include/utils/utils.php'); +require_once('user_privileges/default_module_view.php'); $focus = new Product(); @@ -32,7 +33,7 @@ $focus->id = ""; } -global $app_strings,$currentModule; +global $app_strings,$currentModule,$singlepane_view; global $mod_strings; global $theme; @@ -89,6 +90,14 @@ //Security check for related list $smarty->assign("MODULE", $currentModule); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); + +if($singlepane_view == 'true') +{ + $related_array = getRelatedLists($currentModule,$focus); + $smarty->assign("RELATEDLISTS", $related_array); +} + +$smarty->assign("SinglePane_View", $singlepane_view); $smarty->display("Inventory/InventoryDetailView.tpl"); ?> Modified: vtigercrm/trunk/modules/Products/Product.php ============================================================================== --- vtigercrm/trunk/modules/Products/Product.php (original) +++ vtigercrm/trunk/modules/Products/Product.php Wed Aug 23 23:33:09 2006 @@ -16,6 +16,7 @@ require_once('data/CRMEntity.php'); require_once('include/utils/utils.php'); require_once('include/RelatedListView.php'); +require_once('user_privileges/default_module_view.php'); class Product extends CRMEntity { var $log; @@ -197,7 +198,7 @@ */ function get_tickets($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_tickets(".$id.") method ..."); global $mod_strings; require_once('modules/HelpDesk/HelpDesk.php'); @@ -205,7 +206,10 @@ $button = ''; - $returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Products&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id; $query = "SELECT vtiger_users.user_name, vtiger_users.id, vtiger_products.productid, vtiger_products.productname, @@ -237,7 +241,7 @@ */ function get_activities($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_activities(".$id.") method ..."); global $app_strings; @@ -248,7 +252,10 @@ $button = ''; - $returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Products&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id; $query = "SELECT vtiger_contactdetails.lastname, @@ -291,14 +298,17 @@ */ function get_quotes($id) { - global $log; + global $log, $singlepane_view; $log->debug("Entering get_quotes(".$id.") method ..."); global $app_strings; require_once('modules/Quotes/Quote.php'); $focus = new Quote(); $button = ''; - $returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Products&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id; $query = "SELECT vtiger_crmentity.*, @@ -331,7 +341,7 @@ */ function get_purchase_orders($id) { - global $log; + global $log,$singlepane_view; $log->debug("Entering get_purchase_orders(".$id.") method ..."); global $app_strings; require_once('modules/PurchaseOrder/PurchaseOrder.php'); @@ -339,7 +349,10 @@ $button = ''; - $returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Products&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id; $query = "SELECT vtiger_crmentity.*, vtiger_purchaseorder.*, @@ -368,7 +381,7 @@ */ function get_salesorder($id) { - global $log; + global $log,$singlepane_view; $log->debug("Entering get_salesorder(".$id.") method ..."); global $app_strings; require_once('modules/SalesOrder/SalesOrder.php'); @@ -376,7 +389,10 @@ $focus = new SalesOrder(); $button = ''; - $returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Products&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id; $query = "SELECT vtiger_crmentity.*, vtiger_salesorder.*, @@ -407,14 +423,17 @@ */ function get_invoices($id) { - global $log; + global $log,$singlepane_view; $log->debug("Entering get_invoices(".$id.") method ..."); global $app_strings; require_once('modules/Invoice/Invoice.php'); $focus = new Invoice(); $button = ''; - $returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Products&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id; $query = "SELECT vtiger_crmentity.*, @@ -444,13 +463,16 @@ */ function get_product_pricebooks($id) { - global $log; + global $log,$singlepane_view; $log->debug("Entering get_product_pricebooks(".$id.") method ..."); global $mod_strings; require_once('modules/PriceBooks/PriceBook.php'); $focus = new PriceBook(); $button = ''; - $returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Products&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id; $query = "SELECT vtiger_crmentity.crmid, Modified: vtigercrm/trunk/modules/Products/addPbProductRelToDB.php ============================================================================== --- vtigercrm/trunk/modules/Products/addPbProductRelToDB.php (original) +++ vtigercrm/trunk/modules/Products/addPbProductRelToDB.php Wed Aug 23 23:33:09 2006 @@ -11,9 +11,10 @@ * ********************************************************************************/ -global $adb; +require_once('include/database/PearDatabase.php'); +require_once('user_privileges/default_module_view.php'); +global $adb,$singlepane_view; global $log; -require_once('include/database/PearDatabase.php'); $idlist = $_POST['idlist']; $returnmodule=$_REQUEST['return_module']; $pricebook_id=$_REQUEST['pricebook_id']; @@ -33,7 +34,10 @@ $adb->query($query); } } - header("Location: index.php?module=PriceBooks&action=CallRelatedList&record=".$pricebook_id); + if($singlepane_view == 'true') + header("Location: index.php?module=PriceBooks&action=DetailView&record=".$pricebook_id); + else + header("Location: index.php?module=PriceBooks&action=CallRelatedList&record=".$pricebook_id); } elseif(isset($_REQUEST['product_id']) && $_REQUEST['product_id']!='') { @@ -50,7 +54,10 @@ $adb->query($query); } } - header("Location: index.php?module=Products&action=CallRelatedList&record=".$productid); + if($singlepane_view == 'true') + header("Location: index.php?module=Products&action=DetailView&record=".$productid); + else + header("Location: index.php?module=Products&action=CallRelatedList&record=".$productid); } ?> From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 01:34:55 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:34:55 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9108 - in /vtigercrm/trunk/modules/PurchaseOrder: CallRelatedList.php DetailView.php PurchaseOrder.php Message-ID: <20060824053455.EB30D75E76C@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:34:33 2006 New Revision: 9108 Log: Updated the single pane view feature for detailview in PurchaseOrders Module -- ahmed Modified: vtigercrm/trunk/modules/PurchaseOrder/CallRelatedList.php vtigercrm/trunk/modules/PurchaseOrder/DetailView.php vtigercrm/trunk/modules/PurchaseOrder/PurchaseOrder.php Modified: vtigercrm/trunk/modules/PurchaseOrder/CallRelatedList.php ============================================================================== --- vtigercrm/trunk/modules/PurchaseOrder/CallRelatedList.php (original) +++ vtigercrm/trunk/modules/PurchaseOrder/CallRelatedList.php Wed Aug 23 23:34:33 2006 @@ -40,8 +40,7 @@ if(isset($_REQUEST['mode']) && $_REQUEST['mode'] != ' ') { $smarty->assign("OP_MODE",$_REQUEST['mode']); } -$smarty->assign("id",$focus->id); -$smarty->assign("ID",$RECORD ); +$smarty->assign("ID",$focus->id); $smarty->assign("MODULE",$currentmodule); $smarty->assign("SINGLE_MOD",$app_strings['PurchaseOrder']); $smarty->assign("UPDATEINFO",updateInfo($focus->id)); Modified: vtigercrm/trunk/modules/PurchaseOrder/DetailView.php ============================================================================== --- vtigercrm/trunk/modules/PurchaseOrder/DetailView.php (original) +++ vtigercrm/trunk/modules/PurchaseOrder/DetailView.php Wed Aug 23 23:34:33 2006 @@ -26,7 +26,8 @@ require_once('include/CustomFieldUtil.php'); require_once('include/database/PearDatabase.php'); require_once('include/utils/utils.php'); -global $mod_strings,$app_strings,$theme,$currentModule; +require_once('user_privileges/default_module_view.php'); +global $mod_strings,$app_strings,$theme,$currentModule,$singlepane_view; $focus = new Order(); @@ -90,6 +91,15 @@ $check_button = Button_Check($module); $smarty->assign("CHECK", $check_button); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); + +if($singlepane_view == 'true') +{ + $related_array = getRelatedLists($currentModule,$focus); + $smarty->assign("RELATEDLISTS", $related_array); +} + +$smarty->assign("SinglePane_View", $singlepane_view); + $smarty->display("Inventory/InventoryDetailView.tpl"); Modified: vtigercrm/trunk/modules/PurchaseOrder/PurchaseOrder.php ============================================================================== --- vtigercrm/trunk/modules/PurchaseOrder/PurchaseOrder.php (original) +++ vtigercrm/trunk/modules/PurchaseOrder/PurchaseOrder.php Wed Aug 23 23:34:33 2006 @@ -27,6 +27,7 @@ require_once('data/SugarBean.php'); require_once('data/CRMEntity.php'); require_once('include/utils/utils.php'); +require_once('user_privileges/default_module_view.php'); // Account is used to store vtiger_account information. class Order extends CRMEntity { @@ -135,7 +136,7 @@ */ function get_activities($id) { - global $log; + global $log,$singlepane_view; $log->debug("Entering get_activities(".$id.") method ..."); global $app_strings; require_once('modules/Calendar/Activity.php'); @@ -143,7 +144,10 @@ $button = ''; - $returnset = '&return_module=PurchaseOrder&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=PurchaseOrder&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=PurchaseOrder&return_action=CallRelatedList&return_id='.$id; $query = "SELECT vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid,vtiger_activity.*,vtiger_seactivityrel.*,vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_users.user_name from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_cntactivityrel.contactid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.crmid=".$id." and activitytype='Task' and vtiger_crmentity.deleted=0 and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Completed') and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Deferred') "; $log->debug("Exiting get_activities method ..."); From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 01:36:38 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:36:38 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9109 - in /vtigercrm/trunk/modules/Quotes: CallRelatedList.php DetailView.php Quote.php Message-ID: <20060824053638.CA94975E76C@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:36:01 2006 New Revision: 9109 Log: Updated the single pane view feature for detailview in Quotes Module -- ahmed Modified: vtigercrm/trunk/modules/Quotes/CallRelatedList.php vtigercrm/trunk/modules/Quotes/DetailView.php vtigercrm/trunk/modules/Quotes/Quote.php Modified: vtigercrm/trunk/modules/Quotes/CallRelatedList.php ============================================================================== --- vtigercrm/trunk/modules/Quotes/CallRelatedList.php (original) +++ vtigercrm/trunk/modules/Quotes/CallRelatedList.php Wed Aug 23 23:36:01 2006 @@ -40,8 +40,7 @@ if(isset($_REQUEST['mode']) && $_REQUEST['mode'] != ' ') { $smarty->assign("OP_MODE",$_REQUEST['mode']); } -$smarty->assign("id",$focus->id); -$smarty->assign("ID",$RECORD ); +$smarty->assign("ID",$focus->id); $smarty->assign("MODULE",$currentmodule); $smarty->assign("SINGLE_MOD",$app_strings['Quote']); $smarty->assign("UPDATEINFO",updateInfo($focus->id)); Modified: vtigercrm/trunk/modules/Quotes/DetailView.php ============================================================================== --- vtigercrm/trunk/modules/Quotes/DetailView.php (original) +++ vtigercrm/trunk/modules/Quotes/DetailView.php Wed Aug 23 23:36:01 2006 @@ -26,7 +26,8 @@ require_once('include/CustomFieldUtil.php'); require_once('include/database/PearDatabase.php'); require_once('include/utils/utils.php'); -global $mod_strings,$app_strings,$currentModule,$theme; +require_once('user_privileges/default_module_view.php'); +global $mod_strings,$app_strings,$currentModule,$theme,$singlepane_view; $focus = new Quote(); if(isset($_REQUEST['record']) && isset($_REQUEST['record'])) { @@ -99,6 +100,15 @@ $smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data['datatype']); $smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); + +if($singlepane_view == 'true') +{ + $related_array = getRelatedLists($currentModule,$focus); + $smarty->assign("RELATEDLISTS", $related_array); +} + +$smarty->assign("SinglePane_View", $singlepane_view); + $smarty->display("Inventory/InventoryDetailView.tpl"); ?> Modified: vtigercrm/trunk/modules/Quotes/Quote.php ============================================================================== --- vtigercrm/trunk/modules/Quotes/Quote.php (original) +++ vtigercrm/trunk/modules/Quotes/Quote.php Wed Aug 23 23:36:01 2006 @@ -28,6 +28,8 @@ require_once('data/CRMEntity.php'); require_once('include/utils/utils.php'); require_once('include/RelatedListView.php'); +require_once('user_privileges/default_module_view.php'); + // Account is used to store vtiger_account information. class Quote extends CRMEntity { var $log; @@ -141,14 +143,17 @@ */ function get_salesorder($id) { - global $log; + global $log,$singlepane_view; $log->debug("Entering get_salesorder(".$id.") method ..."); require_once('modules/SalesOrder/SalesOrder.php'); $focus = new SalesOrder(); $button = ''; - $returnset = '&return_module=Quotes&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Quotes&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Quotes&return_action=CallRelatedList&return_id='.$id; $query = "select vtiger_crmentity.*, vtiger_salesorder.*, vtiger_quotes.subject as quotename, vtiger_account.accountname from vtiger_salesorder inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_salesorder.salesorderid left outer join vtiger_quotes on vtiger_quotes.quoteid=vtiger_salesorder.quoteid left outer join vtiger_account on vtiger_account.accountid=vtiger_salesorder.accountid left join vtiger_sogrouprelation on vtiger_salesorder.salesorderid=vtiger_sogrouprelation.salesorderid left join vtiger_groups on vtiger_groups.groupname=vtiger_sogrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_salesorder.quoteid = ".$id; $log->debug("Exiting get_salesorder method ..."); @@ -161,7 +166,7 @@ */ function get_activities($id) { - global $log; + global $log,$singlepane_view; $log->debug("Entering get_activities(".$id.") method ..."); global $app_strings; require_once('modules/Calendar/Activity.php'); @@ -169,7 +174,10 @@ $button = ''; - $returnset = '&return_module=Quotes&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Quotes&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Quotes&return_action=CallRelatedList&return_id='.$id; $query = "SELECT vtiger_contactdetails.contactid, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_activity.*,vtiger_seactivityrel.*,vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_users.user_name,vtiger_recurringevents.recurringtype from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_cntactivityrel.contactid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.crmid=".$id." and activitytype='Task' and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Completed') and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Deferred')"; $log->debug("Exiting get_activities method ..."); From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 01:39:54 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:39:54 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9110 - in /vtigercrm/trunk/modules/SalesOrder: CallRelatedList.php DetailView.php SalesOrder.php Message-ID: <20060824053954.91BAD75E76C@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:38:40 2006 New Revision: 9110 Log: Updated the single pane view feature for detailview in SalesOrders Module -- ahmed Modified: vtigercrm/trunk/modules/SalesOrder/CallRelatedList.php vtigercrm/trunk/modules/SalesOrder/DetailView.php vtigercrm/trunk/modules/SalesOrder/SalesOrder.php Modified: vtigercrm/trunk/modules/SalesOrder/CallRelatedList.php ============================================================================== --- vtigercrm/trunk/modules/SalesOrder/CallRelatedList.php (original) +++ vtigercrm/trunk/modules/SalesOrder/CallRelatedList.php Wed Aug 23 23:38:40 2006 @@ -40,8 +40,7 @@ $category = getParentTab(); $smarty->assign("CATEGORY",$category); $smarty->assign("UPDATEINFO",updateInfo($focus->id)); -$smarty->assign("id",$focus->id); -$smarty->assign("ID",$RECORD ); +$smarty->assign("ID",$focus->id); $smarty->assign("MODULE",$currentmodule); $smarty->assign("SINGLE_MOD",$app_strings['SalesOrder']); $smarty->assign("MOD",$mod_strings); Modified: vtigercrm/trunk/modules/SalesOrder/DetailView.php ============================================================================== --- vtigercrm/trunk/modules/SalesOrder/DetailView.php (original) +++ vtigercrm/trunk/modules/SalesOrder/DetailView.php Wed Aug 23 23:38:40 2006 @@ -26,7 +26,8 @@ require_once('include/CustomFieldUtil.php'); require_once('include/database/PearDatabase.php'); require_once('include/utils/utils.php'); -global $mod_strings,$app_strings,$theme,$currentModule; +require_once('user_privileges/default_module_view.php'); +global $mod_strings,$app_strings,$theme,$currentModule,$singlepane_view; $focus = new SalesOrder(); @@ -96,6 +97,15 @@ $check_button = Button_Check($module); $smarty->assign("CHECK", $check_button); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); + +if($singlepane_view == 'true') +{ + $related_array = getRelatedLists($currentModule,$focus); + $smarty->assign("RELATEDLISTS", $related_array); +} + +$smarty->assign("SinglePane_View", $singlepane_view); + $smarty->display("Inventory/InventoryDetailView.tpl"); ?> Modified: vtigercrm/trunk/modules/SalesOrder/SalesOrder.php ============================================================================== --- vtigercrm/trunk/modules/SalesOrder/SalesOrder.php (original) +++ vtigercrm/trunk/modules/SalesOrder/SalesOrder.php Wed Aug 23 23:38:40 2006 @@ -27,6 +27,7 @@ require_once('data/SugarBean.php'); require_once('data/CRMEntity.php'); require_once('include/utils/utils.php'); +require_once('user_privileges/default_module_view.php'); // Account is used to store vtiger_account information. class SalesOrder extends CRMEntity { @@ -142,7 +143,7 @@ */ function get_activities($id) { - global $log; + global $log,$singlepane_view; $log->debug("Entering get_activities(".$id.") method ..."); global $app_strings; require_once('modules/Calendar/Activity.php'); @@ -150,7 +151,10 @@ $button = ''; - $returnset = '&return_module=SalesOrder&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=SalesOrder&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=SalesOrder&return_action=CallRelatedList&return_id='.$id; $query = "SELECT vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid, vtiger_activity.*,vtiger_seactivityrel.*,vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_users.user_name from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_cntactivityrel.contactid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.crmid=".$id." and activitytype='Task' and vtiger_crmentity.deleted=0 and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Completed') and (vtiger_activity.status is not NULL && vtiger_activity.status !='Deferred')"; $log->debug("Exiting get_activities method ..."); @@ -231,14 +235,17 @@ */ function get_invoices($id) { - global $log; + global $log,$singlepane_view; $log->debug("Entering get_invoices(".$id.") method ..."); require_once('modules/Invoice/Invoice.php'); $focus = new Invoice(); $button = ''; - $returnset = '&return_module=SalesOrder&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=SalesOrder&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=SalesOrder&return_action=CallRelatedList&return_id='.$id; $query = "select vtiger_crmentity.*, vtiger_invoice.*, vtiger_account.accountname, vtiger_salesorder.subject as salessubject from vtiger_invoice inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_invoice.invoiceid left outer join vtiger_account on vtiger_account.accountid=vtiger_invoice.accountid inner join vtiger_salesorder on vtiger_salesorder.salesorderid=vtiger_invoice.salesorderid left join vtiger_invoicegrouprelation on vtiger_invoice.invoiceid=vtiger_invoicegrouprelation.invoiceid left join vtiger_groups on vtiger_groups.groupname=vtiger_invoicegrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_salesorder.salesorderid=".$id; From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 01:41:37 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:41:37 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9111 - in /vtigercrm/trunk/modules/Vendors: CallRelatedList.php DetailView.php Vendor.php updateRelations.php Message-ID: <20060824054137.F2B0675E78B@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:41:16 2006 New Revision: 9111 Log: Updated the single pane view feature for detailview in Vendors Module -- ahmed Modified: vtigercrm/trunk/modules/Vendors/CallRelatedList.php vtigercrm/trunk/modules/Vendors/DetailView.php vtigercrm/trunk/modules/Vendors/Vendor.php vtigercrm/trunk/modules/Vendors/updateRelations.php Modified: vtigercrm/trunk/modules/Vendors/CallRelatedList.php ============================================================================== --- vtigercrm/trunk/modules/Vendors/CallRelatedList.php (original) +++ vtigercrm/trunk/modules/Vendors/CallRelatedList.php Wed Aug 23 23:41:16 2006 @@ -51,8 +51,7 @@ if(isset($focus->name)) $smarty->assign("UPDATEINFO",updateInfo($focus->id)); $smarty->assign("NAME", $focus->name); -$smarty->assign("id",$focus->id); -$smarty->assign("ID",$RECORD ); +$smarty->assign("ID",$focus->id); $smarty->assign("MODULE",$currentmodule); $smarty->assign("SINGLE_MOD",$app_strings['Vendor']); $smarty->assign("RELATEDLISTS", $related_array); Modified: vtigercrm/trunk/modules/Vendors/DetailView.php ============================================================================== --- vtigercrm/trunk/modules/Vendors/DetailView.php (original) +++ vtigercrm/trunk/modules/Vendors/DetailView.php Wed Aug 23 23:41:16 2006 @@ -12,6 +12,7 @@ require_once('Smarty_setup.php'); require_once('modules/Vendors/Vendor.php'); require_once('include/utils/utils.php'); +require_once('user_privileges/default_module_view.php'); $focus = new Vendor(); @@ -27,7 +28,7 @@ $focus->id = ""; } -global $app_strings,$mod_strings,$theme,$currentModule; +global $app_strings,$mod_strings,$theme,$currentModule,$singlepane_view; $theme_path="themes/".$theme."/"; $image_path=$theme_path."images/"; @@ -69,6 +70,15 @@ $smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data['datatype']); $smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); + +if($singlepane_view == 'true') +{ + $related_array = getRelatedLists($currentModule,$focus); + $smarty->assign("RELATEDLISTS", $related_array); +} + +$smarty->assign("SinglePane_View", $singlepane_view); + $smarty->display("Inventory/InventoryDetailView.tpl"); ?> Modified: vtigercrm/trunk/modules/Vendors/Vendor.php ============================================================================== --- vtigercrm/trunk/modules/Vendors/Vendor.php (original) +++ vtigercrm/trunk/modules/Vendors/Vendor.php Wed Aug 23 23:41:16 2006 @@ -16,6 +16,7 @@ require_once('data/CRMEntity.php'); require_once('include/utils/utils.php'); require_once('include/RelatedListView.php'); +require_once('user_privileges/default_module_view.php'); class Vendor extends CRMEntity { var $log; @@ -71,7 +72,7 @@ */ function get_products($id) { - global $log; + global $log,$singlepane_view; $log->debug("Entering get_products(".$id.") method ..."); global $app_strings; require_once('modules/Products/Product.php'); @@ -79,7 +80,10 @@ $button = ''; - $returnset = '&return_module=Vendors&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Vendors&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Vendors&return_action=CallRelatedList&return_id='.$id; $query = 'select vtiger_products.productid, vtiger_products.productname, vtiger_products.productcode, vtiger_products.commissionrate, vtiger_products.qty_per_unit, vtiger_products.unit_price, vtiger_crmentity.crmid, vtiger_crmentity.smownerid,vtiger_vendor.vendorname from vtiger_products inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_products.productid left outer join vtiger_vendor on vtiger_vendor.vendorid = vtiger_products.vendor_id where vtiger_vendor.vendorid = '.$id.' and vtiger_crmentity.deleted = 0'; $log->debug("Exiting get_products method ..."); @@ -92,7 +96,7 @@ */ function get_purchase_orders($id) { - global $log; + global $log,$singlepane_view; $log->debug("Entering get_purchase_orders(".$id.") method ..."); global $app_strings; require_once('modules/PurchaseOrder/PurchaseOrder.php'); @@ -100,7 +104,10 @@ $button = ''; - $returnset = '&return_module=Vendors&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Vendors&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Vendors&return_action=CallRelatedList&return_id='.$id; $query = "select vtiger_users.user_name,vtiger_groups.groupname,vtiger_crmentity.*, vtiger_purchaseorder.*,vtiger_vendor.vendorname from vtiger_purchaseorder inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_purchaseorder.purchaseorderid left outer join vtiger_vendor on vtiger_purchaseorder.vendorid=vtiger_vendor.vendorid left join vtiger_pogrouprelation on vtiger_purchaseorder.purchaseorderid=vtiger_pogrouprelation.purchaseorderid left join vtiger_groups on vtiger_groups.groupname=vtiger_pogrouprelation.groupname left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where vtiger_crmentity.deleted=0 and vtiger_purchaseorder.vendorid=".$id; $log->debug("Exiting get_purchase_orders method ..."); @@ -113,14 +120,17 @@ */ function get_contacts($id) { - global $log; + global $log,$singlepane_view; $log->debug("Entering get_contacts(".$id.") method ..."); global $app_strings; require_once('modules/Contacts/Contact.php'); $focus = new Contact(); $button = ''; - $returnset = '&return_module=Vendors&return_action=CallRelatedList&return_id='.$id; + if($singlepane_view == 'true') + $returnset = '&return_module=Vendors&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Vendors&return_action=CallRelatedList&return_id='.$id; $query = 'SELECT vtiger_users.user_name,vtiger_groups.groupname,vtiger_contactdetails.*, vtiger_crmentity.crmid, vtiger_crmentity.smownerid,vtiger_vendorcontactrel.vendorid from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid inner join vtiger_vendorcontactrel on vtiger_vendorcontactrel.contactid=vtiger_contactdetails.contactid left join vtiger_contactgrouprelation on vtiger_contactdetails.contactid=vtiger_contactgrouprelation.contactid left join vtiger_groups on vtiger_groups.groupname=vtiger_contactgrouprelation.groupname left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where vtiger_crmentity.deleted=0 and vtiger_vendorcontactrel.vendorid = '.$id; $log->debug("Exiting get_contacts method ..."); Modified: vtigercrm/trunk/modules/Vendors/updateRelations.php ============================================================================== --- vtigercrm/trunk/modules/Vendors/updateRelations.php (original) +++ vtigercrm/trunk/modules/Vendors/updateRelations.php Wed Aug 23 23:41:16 2006 @@ -10,7 +10,9 @@ ********************************************************************************/ require_once('include/database/PearDatabase.php'); -global $adb; +require_once('user_privileges/default_module_view.php'); +global $adb, $singlepane_view; + $idlist = $_REQUEST['idlist']; if(isset($_REQUEST['idlist']) && $_REQUEST['idlist'] != '') @@ -27,6 +29,9 @@ $adb->query($sql); } } + if($singlepane_view == 'true') + header("Location: index.php?action=DetailView&module=Vendors&record=".$_REQUEST["parentid"]); + else header("Location: index.php?action=CallRelatedList&module=Vendors&record=".$_REQUEST["parentid"]); } @@ -37,7 +42,10 @@ $adb->query($sql); $sql = "insert into vtiger_seproductsrel values (". $_REQUEST["parid"] .",".$_REQUEST["entityid"] .")"; $adb->query($sql); - header("Location:index.php?action=CallRelatedList&module=Vendors&record=".$_REQUEST["parid"]); + if($singlepane_view == 'true') + header("Location: index.php?action=DetailView&module=Vendors&record=".$_REQUEST["parid"]); + else + header("Location:index.php?action=CallRelatedList&module=Vendors&record=".$_REQUEST["parid"]); } From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 01:46:01 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:46:01 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9112 - /vtigercrm/trunk/modules/Settings/language/en_us.lang.php Message-ID: <20060824054601.37B4875E792@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:45:52 2006 New Revision: 9112 Log: Lang strings updated -- ahmed Modified: vtigercrm/trunk/modules/Settings/language/en_us.lang.php Modified: vtigercrm/trunk/modules/Settings/language/en_us.lang.php ============================================================================== --- vtigercrm/trunk/modules/Settings/language/en_us.lang.php (original) +++ vtigercrm/trunk/modules/Settings/language/en_us.lang.php Wed Aug 23 23:45:52 2006 @@ -713,6 +713,7 @@ 'LBL_DEFAULT_MODULE_VIEW_DESC'=>'Set Default Detail View for All Modules', 'LBL_ENABLE_SINGLEPANE_VIEW'=>'Enable Singlepane View', +'LBL_CLEAR_DATA'=>'Clear Data', ); From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 01:47:45 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:47:45 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9113 - /vtigercrm/trunk/Smarty/templates/Settings/BackupServer.tpl Message-ID: <20060824054745.A1D8975E792@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:47:32 2006 New Revision: 9113 Log: Updated BackupServer.tpl for adding a feature to clear existing data -- ahmed Modified: vtigercrm/trunk/Smarty/templates/Settings/BackupServer.tpl Modified: vtigercrm/trunk/Smarty/templates/Settings/BackupServer.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/Settings/BackupServer.tpl (original) +++ vtigercrm/trunk/Smarty/templates/Settings/BackupServer.tpl Wed Aug 23 23:47:32 2006 @@ -46,7 +46,8 @@ {if $BKP_SERVER_MODE neq 'edit'} {else}
{$APP.Call} {$APP.Meeting}
{$MOD.LBL_BACKUP_SERVER_SETTINGS} ({$MOD.LBL_FTP})
{$ERROR_MSG}
- +   + @@ -57,61 +58,9 @@
- {if $BKP_SERVER_MODE eq 'edit'} - - -
- - - - - - - - - - - - - -
*{$MOD.LBL_SERVER_ADDRESS} - -
*{$MOD.LBL_USERNAME} - -
*{$MOD.LBL_PASWRD} - -
- {else} - - - - -
- - - - - - - - - - - - -
{$MOD.LBL_SERVER_ADDRESS} {$FTPSERVER} 
{$MOD.LBL_USERNAME}{$FTPUSER} 
{$MOD.LBL_PASWRD} - {if $FTPPASSWORD neq ''} - ****** - {/if}  -
- - {/if} -
- - - - -
{$MOD.LBL_SCROLL}
+
+ {include file="Settings/BackupServerContents.tpl"} +
@@ -141,5 +90,18 @@ return true; } + +function clearBackupServer() +{ +new Ajax.Request('index.php', + {queue: {position: 'end', scope: 'command'}, + method: 'post', + postBody: 'module=Settings&action=SettingsAjax&ajax=true&file=BackupServerConfig&opmode=del', + onComplete: function(response) { + $("BackupServerContents").innerHTML=response.responseText; + } + } + ); +} {/literal} From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 01:49:22 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:49:22 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9114 - /vtigercrm/trunk/Smarty/templates/Settings/BackupServerContents.tpl Message-ID: <20060824054922.9BB8F75E78B@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:48:45 2006 New Revision: 9114 Log: Added a new file for clear exising backup server data -- ahmed Added: vtigercrm/trunk/Smarty/templates/Settings/BackupServerContents.tpl From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 01:53:01 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 05:53:01 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9115 - /vtigercrm/trunk/modules/Settings/BackupServerConfig.php Message-ID: <20060824055301.2AEAD75E792@vtiger.fosslabs.com> Author: richie Date: Wed Aug 23 23:52:51 2006 New Revision: 9115 Log: Updated BackupServerConfig.php for adding a feature to clear existing data -- ahmed Modified: vtigercrm/trunk/modules/Settings/BackupServerConfig.php Modified: vtigercrm/trunk/modules/Settings/BackupServerConfig.php ============================================================================== --- vtigercrm/trunk/modules/Settings/BackupServerConfig.php (original) +++ vtigercrm/trunk/modules/Settings/BackupServerConfig.php Wed Aug 23 23:52:51 2006 @@ -1,53 +1,62 @@ -assign("ERROR_MSG",''.$_REQUEST["error"].''); -} -$sql="select * from vtiger_systems where server_type = 'backup'"; -$result = $adb->query($sql); -$server = $adb->query_result($result,0,'server'); -$server_username = $adb->query_result($result,0,'server_username'); -$server_password = $adb->query_result($result,0,'server_password'); - -if(isset($_REQUEST['bkp_server_mode']) && $_REQUEST['bkp_server_mode'] != '') - $smarty->assign("BKP_SERVER_MODE",$_REQUEST['bkp_server_mode']); -else - $smarty->assign("BKP_SERVER_MODE",'view'); - -if (isset($server)) - $smarty->assign("FTPSERVER",$server); -if (isset($server_username)) - $smarty->assign("FTPUSER",$server_username); -if (isset($server_password)) - $smarty->assign("FTPPASSWORD",$server_password); - - -$smarty->assign("MOD", return_module_language($current_language,'Settings')); -$smarty->assign("IMAGE_PATH",$image_path); -$smarty->assign("APP", $app_strings); -$smarty->assign("CMOD", $mod_strings); -$smarty->display("Settings/BackupServer.tpl"); -?> +query($sql_del); +} + +$smarty = new vtigerCRM_Smarty; +if($_REQUEST['error'] != '') +{ + $smarty->assign("ERROR_MSG",''.$_REQUEST["error"].''); +} +$sql="select * from vtiger_systems where server_type = 'backup'"; +$result = $adb->query($sql); +$server = $adb->query_result($result,0,'server'); +$server_username = $adb->query_result($result,0,'server_username'); +$server_password = $adb->query_result($result,0,'server_password'); + +if(isset($_REQUEST['bkp_server_mode']) && $_REQUEST['bkp_server_mode'] != '') + $smarty->assign("BKP_SERVER_MODE",$_REQUEST['bkp_server_mode']); +else + $smarty->assign("BKP_SERVER_MODE",'view'); + +if (isset($server)) + $smarty->assign("FTPSERVER",$server); +if (isset($server_username)) + $smarty->assign("FTPUSER",$server_username); +if (isset($server_password)) + $smarty->assign("FTPPASSWORD",$server_password); + + +$smarty->assign("MOD", return_module_language($current_language,'Settings')); +$smarty->assign("IMAGE_PATH",$image_path); +$smarty->assign("APP", $app_strings); +$smarty->assign("CMOD", $mod_strings); + +if($_REQUEST['ajax'] == 'true') + $smarty->display("Settings/BackupServerContents.tpl"); +else + $smarty->display("Settings/BackupServer.tpl"); +?> From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 03:28:02 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 07:28:02 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9116 - /vtigercrm/trunk/user_privileges/default_module_view.php Message-ID: <20060824072802.6531075E792@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 24 01:27:58 2006 New Revision: 9116 Log: By Default Single Pane View is Disabled - Ahmed Modified: vtigercrm/trunk/user_privileges/default_module_view.php Modified: vtigercrm/trunk/user_privileges/default_module_view.php ============================================================================== --- vtigercrm/trunk/user_privileges/default_module_view.php (original) +++ vtigercrm/trunk/user_privileges/default_module_view.php Thu Aug 24 01:27:58 2006 @@ -9,6 +9,6 @@ * ********************************************************************************/ -$singlepane_view = 'true'; +$singlepane_view = 'false'; ?> From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 04:32:03 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 08:32:03 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9117 - /vtigercrm/trunk/include/ComboStrings.php Message-ID: <20060824083203.D7E6175E790@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 24 02:32:00 2006 New Revision: 9117 Log: Removed the term Caton from usage unit list -- Ahmed Modified: vtigercrm/trunk/include/ComboStrings.php Modified: vtigercrm/trunk/include/ComboStrings.php ============================================================================== --- vtigercrm/trunk/include/ComboStrings.php (original) +++ vtigercrm/trunk/include/ComboStrings.php Thu Aug 24 02:32:00 2006 @@ -190,8 +190,7 @@ 'usageunit_dom' => Array('Box'=>'Box', 'Carton'=>'Carton', - 'Caton'=>'Caton', - 'Dozen'=>'Dazon', + 'Dozen'=>'Dozen', 'Each'=>'Each', 'Hours'=>'Hours', 'Impressions'=>'Impressions', From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 05:48:06 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 09:48:06 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9118 - in /wordintegration/trunk/client/source: modLang.bas vtigerCRMWordPlugin.vbw Message-ID: <20060824094807.6F70775E7B7@vtiger.fosslabs.com> Author: richie Date: Thu Aug 24 03:47:51 2006 New Revision: 9118 Log: New Languages added --Jeri Modified: wordintegration/trunk/client/source/modLang.bas wordintegration/trunk/client/source/vtigerCRMWordPlugin.vbw Modified: wordintegration/trunk/client/source/modLang.bas ============================================================================== Binary files - no diff available. Modified: wordintegration/trunk/client/source/vtigerCRMWordPlugin.vbw ============================================================================== Binary files - no diff available. From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 06:15:51 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 10:15:51 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9119 - /vtigercrm/trunk/pkg/apache/conf/lin_httpd.conf Message-ID: <20060824101551.BE72575E7C0@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 24 04:15:48 2006 New Revision: 9119 Log: directory name removed, this will appended in the variable Modified: vtigercrm/trunk/pkg/apache/conf/lin_httpd.conf Modified: vtigercrm/trunk/pkg/apache/conf/lin_httpd.conf ============================================================================== --- vtigercrm/trunk/pkg/apache/conf/lin_httpd.conf (original) +++ vtigercrm/trunk/pkg/apache/conf/lin_httpd.conf Thu Aug 24 04:15:48 2006 @@ -25,8 +25,8 @@ # of the server's control files begin with "/" (or "drive:/" for Win32), the # server will use that explicit path. If the filenames do *not* begin # with "/", the value of ServerRoot is prepended -- so "logs/foo.log" -# with ServerRoot set to "VTIGERCRM/vtigerCRM5_rc/apache" will be interpreted by the -# server as "VTIGERCRM/vtigerCRM5_rc/apache/logs/foo.log". +# with ServerRoot set to "VTIGERCRM/apache" will be interpreted by the +# server as "VTIGERCRM/apache/logs/foo.log". # ### Section 1: Global Environment @@ -47,7 +47,7 @@ # # Do NOT add a slash at the end of the directory path. # -ServerRoot "VTIGERCRM/vtigerCRM5_rc/apache" +ServerRoot "VTIGERCRM/apache" #refer http://www.faqs.org/docs/securing/chap29sec245.html MinSpareServers 16 MaxSpareServers 64 @@ -311,7 +311,7 @@ # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # -DocumentRoot "VTIGERCRM/vtigerCRM5_rc/apache/htdocs/vtigerCRM" +DocumentRoot "VTIGERCRM/apache/htdocs/vtigerCRM" # # Each directory to which Apache has access can be configured with respect @@ -336,7 +336,7 @@ # # This should be changed to whatever you set DocumentRoot to. # - + # # Possible values for the Options directive are "None", "All", @@ -554,9 +554,9 @@ # We include the /icons/ alias for FancyIndexed directory listings. If you # do not use FancyIndexing, you may comment this out. # -Alias /icons/ "VTIGERCRM/vtigerCRM5_rc/apache/icons/" - - +Alias /icons/ "VTIGERCRM/apache/icons/" + + Options Indexes MultiViews AllowOverride None Order allow,deny @@ -568,9 +568,9 @@ # the manual, even if you choose to move your DocumentRoot. You may comment # this out if you do not care for the documentation. # -AliasMatch ^/manual(?:/(?:de|en|es|fr|ja|ko|ru))?(/.*)?$ "VTIGERCRM/vtigerCRM5_rc/apache/manual$1" - - +AliasMatch ^/manual(?:/(?:de|en|es|fr|ja|ko|ru))?(/.*)?$ "VTIGERCRM/apache/manual$1" + + Options Indexes AllowOverride None Order allow,deny @@ -592,7 +592,7 @@ # The same rules about trailing "/" apply to ScriptAlias directives as to # Alias. # -ScriptAlias /cgi-bin/ "VTIGERCRM/vtigerCRM5_rc/apache/cgi-bin/" +ScriptAlias /cgi-bin/ "VTIGERCRM/apache/cgi-bin/" # @@ -603,10 +603,10 @@ # -# "VTIGERCRM/vtigerCRM5_rc/apache/cgi-bin" should be changed to whatever your ScriptAliased +# "VTIGERCRM/apache/cgi-bin" should be changed to whatever your ScriptAliased # CGI directory exists, if you have that configured. # - + AllowOverride None Options None Order allow,deny @@ -922,7 +922,7 @@ # Alias /error/include/ "/your/include/path/" # # which allows you to create your own set of files by starting with the -# VTIGERCRM/vtigerCRM5_rc/apache/error/include/ files and copying them to /your/include/path/, +# VTIGERCRM/apache/error/include/ files and copying them to /your/include/path/, # even on a per-VirtualHost basis. The default include files will display # your Apache version number and your ServerAdmin email address regardless # of the setting of ServerSignature. @@ -930,9 +930,9 @@ # The internationalized error documents require mod_alias, mod_include # and mod_negotiation. To activate them, uncomment the following 30 lines. -# Alias /error/ "VTIGERCRM/vtigerCRM5_rc/apache/error/" -# -# +# Alias /error/ "VTIGERCRM/apache/error/" +# +# # AllowOverride None # Options IncludesNoExec # AddOutputFilter Includes html From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 06:25:03 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 10:25:03 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9120 - /vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php Message-ID: <20060824102503.CB6DB75E7BE@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 24 04:24:59 2006 New Revision: 9120 Log: * Modified to handle the sequence number in inventory product details Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php ============================================================================== --- vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php (original) +++ vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php Thu Aug 24 04:24:59 2006 @@ -3429,17 +3429,26 @@ { $res = $conn->query("select * from $tablename order by $idname"); $count = $conn->num_rows($res); + + $id = $oldid = 0; + $seqno = 0; + for($i=0;$i<$count;$i++) { + $oldid = $id; $id = $conn->query_result($res,$i,$idname); + + //for every new PO/SO/Quotes/Invoice entity we should set the sequence start value as 1 + if($id != $oldid) + $seqno = 1; + $productid = $conn->query_result($res,$i,'productid'); $quantity = $conn->query_result($res,$i,'quantity'); $listprice = $conn->query_result($res,$i,'listprice'); - // DG 15 Aug 2006 - // Support sequence_no - $seqno = $conn->query_result($res, $i, 'sequence_no'); + $query1 = "insert into vtiger_inventoryproductrel(id,productid,sequence_no,quantity,listprice) values($id, $productid,$seqno, $quantity, $listprice)"; Execute($query1); + $seqno++; } } From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 06:26:46 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 10:26:46 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9121 - /vtigercrm/trunk/modules/Migration/Migration.php Message-ID: <20060824102646.D03B175E7BE@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 24 04:26:43 2006 New Revision: 9121 Log: * Modified to handle the dump file size ie., if the dump taken is not valid file then skip migration and go to step1 Modified: vtigercrm/trunk/modules/Migration/Migration.php Modified: vtigercrm/trunk/modules/Migration/Migration.php ============================================================================== --- vtigercrm/trunk/modules/Migration/Migration.php (original) +++ vtigercrm/trunk/modules/Migration/Migration.php Thu Aug 24 04:26:43 2006 @@ -91,7 +91,7 @@ */ function takeDatabaseDump($host_name,$mysql_port,$mysql_username,$mysql_password,$dbname) { - $this->conn->println("Inside the function takeDatabaseDump. Going to take the old database dump..."); + $this->conn->println("Inside the function takeDatabaseDump. Going to take the specified database dump..."); $dump_filename = 'dump_'.$dbname.'.txt'; if($mysql_password != '') @@ -322,6 +322,18 @@ //Take the dump of the old Database $this->conn->println("Going to take the old Database Dump."); $dump_file = $this->takeDatabaseDump($old_host_name,$old_mysql_port,$old_mysql_username,$old_mysql_password,$old_dbname); + + //check the file size is greater than 10000 bytes (~app) and if yes then continue else goto step1 + if(is_file($dump_file) && filesize($dump_file) > 10000) + { + $_SESSION['migration_log'] .= "Source database dump taken successfully."; + } + else + { + echo '
The Source database dump taken may not contain all values. So please use other option.'; + include("modules/Migration/MigrationStep1.php"); + exit; + } } elseif($option == 'dumpsource') { @@ -334,6 +346,19 @@ //This is to take dump of the new database for backup purpose $this->conn->println("Going to take the current Database Dump."); $new_dump_file = $this->takeDatabaseDump($new_host_name,$new_mysql_port,$new_mysql_username,$new_mysql_password,$new_dbname); + + //check the file size is greater than 10000 bytes (~app) and if yes then continue else goto step1 + if(is_file($new_dump_file) && filesize($new_dump_file) > 10000) + { + $_SESSION['migration_log'] .= "Current database dump taken successfully."; + } + else + { + $_SESSION['migration_log'] .= '
The Current database dump taken may not contain all values. So may not be reload the current database if any problem occurs in migration. If the migration not completed please rename the install.php and install folder and run the install.php'; + //include("modules/Migration/MigrationStep1.php"); + //exit; + } + } From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 06:34:45 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 10:34:45 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9122 - /vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50.php Message-ID: <20060824103445.BEDB075E7C3@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 24 04:34:40 2006 New Revision: 9122 Log: * Added file which contains the database modification from 42Patch2 to 5.0 because old file 42P2_to_50Alpha.php will be deleted Added: vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50.php From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 06:36:07 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 10:36:07 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9123 - /vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php Message-ID: <20060824103607.6E0FC75E7C3@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 24 04:36:03 2006 New Revision: 9123 Log: * Removed this file becuase we have renamed this file without Alpha and checkedin Removed: vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50Alpha.php From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 06:36:58 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 10:36:58 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9124 - /vtigercrm/trunk/modules/Migration/ModifyDatabase/MigrationInfo.php Message-ID: <20060824103658.1991C75E7C3@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 24 04:36:54 2006 New Revision: 9124 Log: * Changed the filename from 42P2_to_50Alpha.php to 42P2_to_50.php becuase we have renamed that filename Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/MigrationInfo.php Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/MigrationInfo.php ============================================================================== --- vtigercrm/trunk/modules/Migration/ModifyDatabase/MigrationInfo.php (original) +++ vtigercrm/trunk/modules/Migration/ModifyDatabase/MigrationInfo.php Thu Aug 24 04:36:54 2006 @@ -212,7 +212,7 @@ //Now all the queries will be placed inside the above div tag in tr tag - include("modules/Migration/ModifyDatabase/42P2_to_50Alpha.php"); + include("modules/Migration/ModifyDatabase/42P2_to_50.php"); ?> From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 07:50:09 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 11:50:09 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9125 - /vtigercrm/trunk/soap/vtigerolservice.php Message-ID: <20060824115009.F214D75E7D5@vtiger.fosslabs.com> Author: richie Date: Thu Aug 24 05:49:47 2006 New Revision: 9125 Log: Security Implemented for OutLook Plugin --jeri Modified: vtigercrm/trunk/soap/vtigerolservice.php Modified: vtigercrm/trunk/soap/vtigerolservice.php ============================================================================== --- vtigercrm/trunk/soap/vtigerolservice.php (original) +++ vtigercrm/trunk/soap/vtigerolservice.php Thu Aug 24 05:49:47 2006 @@ -161,6 +161,26 @@ $NAMESPACE); $server->register( + 'CheckEmailPermission', + array('username'=>'xsd:string'), + array('return'=>'xsd:string'), + $NAMESPACE); + +$server->register( + 'CheckContactPermission', + array('username'=>'xsd:string'), + array('return'=>'xsd:string'), + $NAMESPACE); + +$server->register( + 'CheckActivityPermission', + array('username'=>'xsd:string'), + array('return'=>'xsd:string'), + $NAMESPACE); + + + +$server->register( 'SearchContactsByEmail', array('username'=>'xsd:string','emailaddress'=>'xsd:string'), array('return'=>'tns:contactdetails'), @@ -175,8 +195,8 @@ $server->register( 'AddEmailAttachment', array('emailid'=>'xsd:string','filedata'=>'xsd:string', - 'filename'=>'xsd:string','filesize'=>'xsd:string','filetype'=>'xsd:string', - 'username'=>'xsd:string'), + 'filename'=>'xsd:string','filesize'=>'xsd:string','filetype'=>'xsd:string', + 'username'=>'xsd:string'), array('return'=>'xsd:string'), $NAMESPACE); @@ -351,7 +371,7 @@ $return_access = "TRUE"; }else { - $return_access = "FALSE"; + $return_access = "FALSE"; } }else { @@ -360,6 +380,60 @@ } $objuser = $objuser; return $return_access; +} + +function CheckEmailPermission($username) +{ + global $current_user,$log; + require_once("modules/Users/User.php"); + $seed_user=new User(); + $user_id=$seed_user->retrieve_user_id($username); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + + if(isPermitted("Emails","EditView") == "yes") + { + return "allowed"; + }else + { + return "denied"; + } +} + +function CheckContactPermission($username) +{ + global $current_user; + require_once("modules/Users/User.php"); + $seed_user=new User(); + $user_id=$seed_user->retrieve_user_id($username); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + + if(isPermitted("Contacts","EditView") == "yes") + { + return "allowed"; + }else + { + return "denied"; + } +} + +function CheckActivityPermission($username) +{ + global $current_user; + require_once("modules/Users/User.php"); + $seed_user=new User(); + $user_id=$seed_user->retrieve_user_id($username); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + + if(isPermitted("Calendar","EditView") == "yes") + { + return "allowed"; + }else + { + return "denied"; + } } function AddEmailAttachment($emailid,$filedata,$filename,$filesize,$filetype,$username) @@ -751,6 +825,9 @@ foreach($taskdtls as $taskrow) { + + + //Currently only 3 status avail Note ************************************************ if(isset($taskrow)) { if($taskrow["status"] == "0") From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 07:52:17 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 11:52:17 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9126 - in /vtigercrmoutlook/trunk/vtigercrmoladdin/source: clsExplWrap.cls vtigeroladdin.vbp vtigeroladdin.vbw Message-ID: <20060824115217.517B575E7D5@vtiger.fosslabs.com> Author: richie Date: Thu Aug 24 05:51:35 2006 New Revision: 9126 Log: Security Implemented for OutLook Plugin --jeri Modified: vtigercrmoutlook/trunk/vtigercrmoladdin/source/clsExplWrap.cls vtigercrmoutlook/trunk/vtigercrmoladdin/source/vtigeroladdin.vbp vtigercrmoutlook/trunk/vtigercrmoladdin/source/vtigeroladdin.vbw Modified: vtigercrmoutlook/trunk/vtigercrmoladdin/source/clsExplWrap.cls ============================================================================== --- vtigercrmoutlook/trunk/vtigercrmoladdin/source/clsExplWrap.cls (original) +++ vtigercrmoutlook/trunk/vtigercrmoladdin/source/clsExplWrap.cls Thu Aug 24 05:51:35 2006 @@ -131,10 +131,31 @@ Exit Sub Else If gsLoginSuccess = True Then + Dim oPSoap As New PocketSOAP.CoEnvelope + Dim oXMLHttp As New MSXML.XMLHTTPRequest + Dim oXMLDoc As New MSXML.DOMDocument + Dim oXMLDocElmnt As MSXML.IXMLDOMElement + If objFolder.DefaultItemType = olMailItem And Trim(sGetPathAsString(objFolder)) <> "Personal Folders" Then - objEmailButton.Enabled = True - objEmailButton.Enabled = True - objEmailMenu.Enabled = True + 'Added to integrate Security for Emails + oPSoap.MethodName = "CheckEmailPermission" + + oPSoap.Parameters.Create "username", gsVtUserId + + oXMLHttp.Open "POST", gsVtUrl, False + oXMLHttp.setRequestHeader "SOAPAction", "vtigerolservice" + oXMLHttp.setRequestHeader "Content-Type", "text/xml" + oXMLHttp.send oPSoap.Serialize + oXMLDoc.loadXML (oXMLHttp.responseText) + Set oXMLDocElmnt = oXMLDoc.documentElement + If oXMLDocElmnt.selectSingleNode("//ns1:CheckEmailPermissionResponse/return").nodeTypedValue <> "denied" Then + objEmailButton.Enabled = True + objEmailMenu.Enabled = True + Else + objEmailButton.Enabled = False + objEmailMenu.Enabled = False + End If + objSCButton.Enabled = False objSCMenu.Enabled = False objSyncTaskButton.Enabled = False @@ -143,34 +164,88 @@ objSyncClndrMenu.Enabled = False ElseIf Trim(sGetPathAsString(objFolder)) = Trim(gsCntsSyncFolder) Then gsCntsSyncFolderId = objFolder.EntryID - objEmailButton.Enabled = False - objEmailMenu.Enabled = False - objSCButton.Enabled = True - objSCMenu.Enabled = True + + 'Added to integrate Security for Contacts + oPSoap.MethodName = "CheckContactPermission" + + oPSoap.Parameters.Create "username", gsVtUserId + + oXMLHttp.Open "POST", gsVtUrl, False + oXMLHttp.setRequestHeader "SOAPAction", "vtigerolservice" + oXMLHttp.setRequestHeader "Content-Type", "text/xml" + oXMLHttp.send oPSoap.Serialize + oXMLDoc.loadXML (oXMLHttp.responseText) + Set oXMLDocElmnt = oXMLDoc.documentElement + If oXMLDocElmnt.selectSingleNode("//ns1:CheckContactPermissionResponse/return").nodeTypedValue <> "denied" Then + objSCButton.Enabled = True + objSCMenu.Enabled = True + Else + objSCButton.Enabled = False + objSCMenu.Enabled = False + End If + + + objEmailButton.Enabled = False + objEmailMenu.Enabled = False objSyncTaskButton.Enabled = False objSyncTaskMenu.Enabled = False objSyncClndrButton.Enabled = False objSyncClndrMenu.Enabled = False ElseIf Trim(sGetPathAsString(objFolder)) = Trim(gsTaskSyncFolder) Then gsTaskSyncFolderId = objFolder.EntryID - objEmailButton.Enabled = False - objEmailMenu.Enabled = False - objSCButton.Enabled = False - objSCMenu.Enabled = False - objSyncTaskButton.Enabled = True - objSyncTaskMenu.Enabled = True + + 'Added to integrate Security for Activity + oPSoap.MethodName = "CheckActivityPermission" + + oPSoap.Parameters.Create "username", gsVtUserId + + oXMLHttp.Open "POST", gsVtUrl, False + oXMLHttp.setRequestHeader "SOAPAction", "vtigerolservice" + oXMLHttp.setRequestHeader "Content-Type", "text/xml" + oXMLHttp.send oPSoap.Serialize + oXMLDoc.loadXML (oXMLHttp.responseText) + Set oXMLDocElmnt = oXMLDoc.documentElement + If oXMLDocElmnt.selectSingleNode("//ns1:CheckActivityPermissionResponse/return").nodeTypedValue <> "denied" Then + objSyncTaskButton.Enabled = True + objSyncTaskMenu.Enabled = True + Else + objSyncTaskButton.Enabled = False + objSyncTaskMenu.Enabled = False + End If + objEmailButton.Enabled = False + objEmailMenu.Enabled = False + objSCButton.Enabled = False + objSCMenu.Enabled = False objSyncClndrButton.Enabled = False objSyncClndrMenu.Enabled = False ElseIf Trim(sGetPathAsString(objFolder)) = Trim(gsClndrSyncFolder) Then gsClndrSyncFolderId = objFolder.EntryID - objEmailButton.Enabled = False - objEmailMenu.Enabled = False - objSCButton.Enabled = False - objSCMenu.Enabled = False - objSyncTaskButton.Enabled = False - objSyncTaskMenu.Enabled = False - objSyncClndrButton.Enabled = True - objSyncClndrMenu.Enabled = True + + 'Added to integrate Security for Calendar + oPSoap.MethodName = "CheckActivityPermission" + + oPSoap.Parameters.Create "username", gsVtUserId + + oXMLHttp.Open "POST", gsVtUrl, False + oXMLHttp.setRequestHeader "SOAPAction", "vtigerolservice" + oXMLHttp.setRequestHeader "Content-Type", "text/xml" + oXMLHttp.send oPSoap.Serialize + oXMLDoc.loadXML (oXMLHttp.responseText) + Set oXMLDocElmnt = oXMLDoc.documentElement + If oXMLDocElmnt.selectSingleNode("//ns1:CheckActivityPermissionResponse/return").nodeTypedValue <> "denied" Then + objSyncClndrButton.Enabled = True + objSyncClndrMenu.Enabled = True + Else + objSyncClndrButton.Enabled = False + objSyncClndrMenu.Enabled = False + End If + + objEmailButton.Enabled = False + objEmailMenu.Enabled = False + objSCButton.Enabled = False + objSCMenu.Enabled = False + objSyncTaskButton.Enabled = False + objSyncTaskMenu.Enabled = False Else objEmailButton.Enabled = False objEmailMenu.Enabled = False Modified: vtigercrmoutlook/trunk/vtigercrmoladdin/source/vtigeroladdin.vbp ============================================================================== Binary files - no diff available. Modified: vtigercrmoutlook/trunk/vtigercrmoladdin/source/vtigeroladdin.vbw ============================================================================== Binary files - no diff available. From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 08:46:20 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 12:46:20 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9127 - /vtigercrm/tags/vtigercrm-4.2.4/modules/Leads/LeadConvertToEntities.php Message-ID: <20060824124620.9305A75E7E7@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 24 06:46:15 2006 New Revision: 9127 Log: removed extra quote Modified: vtigercrm/tags/vtigercrm-4.2.4/modules/Leads/LeadConvertToEntities.php Modified: vtigercrm/tags/vtigercrm-4.2.4/modules/Leads/LeadConvertToEntities.php ============================================================================== --- vtigercrm/tags/vtigercrm-4.2.4/modules/Leads/LeadConvertToEntities.php (original) +++ vtigercrm/tags/vtigercrm-4.2.4/modules/Leads/LeadConvertToEntities.php Thu Aug 24 06:46:15 2006 @@ -279,7 +279,7 @@ $adb->query($sql_insert_contact); -$sql_insert_contactsubdetails = "INSERT INTO contactsubdetails (contactsubscriptionid,homephone,otherphone,leadsource) VALUES (".$contact_id.",'','','".$adb->quote($row['leadsource'])."')"; +$sql_insert_contactsubdetails = "INSERT INTO contactsubdetails (contactsubscriptionid,homephone,otherphone,leadsource) VALUES (".$contact_id.",'','',".$adb->quote($row['leadsource']).")"; $adb->query($sql_insert_contactsubdetails); From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 09:52:39 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 13:52:39 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9128 - /vtigercrm/trunk/modules/Dashboard/HomepageDB.php Message-ID: <20060824135239.2DBC575E7EF@vtiger.fosslabs.com> Author: richie Date: Thu Aug 24 07:52:34 2006 New Revision: 9128 Log: changes made to fix the DashBoard related issue --Minnie Modified: vtigercrm/trunk/modules/Dashboard/HomepageDB.php Modified: vtigercrm/trunk/modules/Dashboard/HomepageDB.php ============================================================================== --- vtigercrm/trunk/modules/Dashboard/HomepageDB.php (original) +++ vtigercrm/trunk/modules/Dashboard/HomepageDB.php Thu Aug 24 07:52:34 2006 @@ -19,8 +19,7 @@ //if($is_admin) // $homepagedb_query = "select vtiger_crmentity.* from vtiger_crmentity where vtiger_crmentity.setype in ('Accounts','Contacts','Leads','Potentials','Quotes','Invoice','PurchaseOrder','SalesOrder','Activities','HelpDesk','Campaigns') and vtiger_crmentity.deleted=0"; //else - $homepagedb_query = "select * from vtiger_crmentity se left join vtiger_leaddetails le on le.leadid=se.crmid where se.deleted=0 and (le.converted=0 or le.converted is null) and setype in ('Accounts','Contacts','Leads','Potentials','Quotes','Invoice','PurchaseOrder', 'SalesOrder','Calendar','HelpDesk','Campaigns') and se.deleted=0 and se.smownerid=".$current_user->id; - //$homepagedb_query = "select vtiger_crmentity.* from vtiger_crmentity where vtiger_crmentity.setype in ('Accounts','Contacts','Leads','Potentials','Quotes','Invoice','PurchaseOrder','SalesOrder','Calendar','HelpDesk','Campaigns') and vtiger_crmentity.deleted=0 and vtiger_crmentity.smownerid=".$current_user->id; + $homepagedb_query = "select * from vtiger_crmentity se left join vtiger_leaddetails le on le.leadid=se.crmid left join vtiger_activity act on act.activityid=se.crmid where se.deleted=0 and (le.converted=0 or le.converted is null) and ((act.status!='Completed' and act.status!='Deferred') or act.status is null) and ((act.eventstatus!='Held' and act.eventstatus!='Not Held') or act.eventstatus is null) and setype in ('Accounts','Contacts','Leads','Potentials','Quotes','Invoice','PurchaseOrder', 'SalesOrder','Calendar','HelpDesk','Campaigns') and se.deleted=0 and se.smownerid=".$current_user->id; $graph_by="setype"; $graph_title=$mod_strings['recordsforuser'].' '.$current_user->user_name; $module="Home"; From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 09:57:09 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 13:57:09 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9129 - /vtigercrm/trunk/modules/Dashboard/Entity_charts.php Message-ID: <20060824135709.0B83C75E7F4@vtiger.fosslabs.com> Author: richie Date: Thu Aug 24 07:57:06 2006 New Revision: 9129 Log: changes made to fix the DashBoard related issue --Minnie Modified: vtigercrm/trunk/modules/Dashboard/Entity_charts.php Modified: vtigercrm/trunk/modules/Dashboard/Entity_charts.php ============================================================================== --- vtigercrm/trunk/modules/Dashboard/Entity_charts.php (original) +++ vtigercrm/trunk/modules/Dashboard/Entity_charts.php Thu Aug 24 07:57:06 2006 @@ -278,13 +278,13 @@ } //added to get valid url in dashbord for tickets by team - if($graph_for == "ticketgroupname") $graph_for = "smownerid"; + if($graph_for == "ticketgroupname" || $graph_for == "groupname") $graph_for = "smownerid"; if($graph_for == "accountid") $graph_for = "account_id"; if($module == "Home") - $link_val="index.php?module=".$name."&action=ListView&search_field=assigned_user_id&searchtype=BasicSearch&query=true&type=entchar&search_text=".$current_user->user_name; + $link_val="index.php?module=".$name."&action=ListView&from_homepagedb=true&search_field=assigned_user_id&searchtype=BasicSearch&query=true&type=entchar&search_text=".$current_user->user_name; else - $link_val="index.php?module=".$module."&action=index&search_text=".$name."&search_field=".$graph_for."&searchtype=BasicSearch&query=true&type=entchar"; + $link_val="index.php?module=".$module."&action=index&from_dashboard=true&search_text=".$name."&search_field=".$graph_for."&searchtype=BasicSearch&query=true&type=entchar"; if($graph_for == "account_id") $graph_for = "accountid"; From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 09:59:37 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 13:59:37 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9130 - /vtigercrm/trunk/modules/Calendar/ListView.php Message-ID: <20060824135937.9697A75E7F4@vtiger.fosslabs.com> Author: richie Date: Thu Aug 24 07:59:34 2006 New Revision: 9130 Log: changes made to fix the DashBoard related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/ListView.php Modified: vtigercrm/trunk/modules/Calendar/ListView.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/ListView.php (original) +++ vtigercrm/trunk/modules/Calendar/ListView.php Thu Aug 24 07:59:34 2006 @@ -122,7 +122,10 @@ if(isset($where) && $where != '') { - $list_query .= " AND " .$where; + if(isset($_REQUEST['from_homepagedb']) && $_REQUEST['from_homepagedb'] == 'true') + $list_query .= " and ((vtiger_activity.status!='Completed' and vtiger_activity.status!='Deferred') or vtiger_activity.status is null) and ((vtiger_activity.eventstatus!='Held' and vtiger_activity.eventstatus!='Not Held') or vtiger_activity.eventstatus is null) AND ".$where; + else + $list_query .= " AND " .$where; } $list_query .= ' group by vtiger_activity.activityid'; From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 10:02:04 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 14:02:04 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9131 - /vtigercrm/trunk/modules/Potentials/ListView.php Message-ID: <20060824140204.4CE4675E7F4@vtiger.fosslabs.com> Author: richie Date: Thu Aug 24 08:02:00 2006 New Revision: 9131 Log: changes made to fix the DashBoard related issue --Minnie Modified: vtigercrm/trunk/modules/Potentials/ListView.php Modified: vtigercrm/trunk/modules/Potentials/ListView.php ============================================================================== --- vtigercrm/trunk/modules/Potentials/ListView.php (original) +++ vtigercrm/trunk/modules/Potentials/ListView.php Thu Aug 24 08:02:00 2006 @@ -134,7 +134,10 @@ if(isset($where) && $where != '') { - $list_query .= " AND ".$where; + if(isset($_REQUEST['from_dashboard']) && $_REQUEST['from_dashboard'] == 'true') + $list_query .= " AND vtiger_potential.sales_stage = 'Closed Won' AND ".$where; + else + $list_query .= " AND ".$where; } if(isset($order_by) && $order_by != '') From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 10:05:34 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 14:05:34 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9132 - /vtigercrm/trunk/include/utils/RecurringType.php Message-ID: <20060824140534.EE59C75E7F4@vtiger.fosslabs.com> Author: richie Date: Thu Aug 24 08:05:30 2006 New Revision: 9132 Log: changes made to fix the recurring event issue --Minnie Modified: vtigercrm/trunk/include/utils/RecurringType.php Modified: vtigercrm/trunk/include/utils/RecurringType.php ============================================================================== --- vtigercrm/trunk/include/utils/RecurringType.php (original) +++ vtigercrm/trunk/include/utils/RecurringType.php Thu Aug 24 08:05:30 2006 @@ -155,7 +155,6 @@ } elseif($this->recur_type == 'Monthly') { - $recurringDates[] = $tempdate; $st_date = explode("-",$tempdate); $date_arr = Array( 'day' => $st_date[2], @@ -248,6 +247,7 @@ $tempdateObj = new DateTime($date_arr,true); } $tempdate = $tempdateObj->get_formatted_date(); + $recurringDates[] = $tempdate; } elseif($this->recur_type == 'Yearly') { From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 10:11:31 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 14:11:31 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9133 - in /vtigercrm/trunk/modules/Migration/ModifyDatabase: 42P2_to_50.php rename_tables.php Message-ID: <20060824141131.A831575E7F4@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 24 08:11:25 2006 New Revision: 9133 Log: * Modified to handle the reports and customview changes for the moduels Calendar and PurchaseOrder Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50.php vtigercrm/trunk/modules/Migration/ModifyDatabase/rename_tables.php Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50.php ============================================================================== --- vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50.php (original) +++ vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50.php Thu Aug 24 08:11:25 2006 @@ -3551,6 +3551,64 @@ //audit trial table Execute("create table vtiger_audit_trial(auditid int(19) NOT NULL, userid int(19) default NULL, module varchar(255) default NULL, action varchar(255) default NULL, recordid varchar(20) default NULL, actiondate datetime default NULL, PRIMARY KEY (auditid)) ENGINE=InnoDB"); +//Added after 5 rc release +Execute("alter table vtiger_account modify siccode varchar(50)"); +Execute("update vtiger_field set typeofdata='V~O' where fieldname='siccode' and columnname='siccode' and tabid=6"); +Execute("alter table vtiger_inventoryproductrel add column sequence_no int(4) not null default 1 after productid"); + +//changes made for CustomView and Reports - Activities changed to Calendar -- Starts +//Added to change the entitytype from Activities to Calendar for customview +Execute("update vtiger_customview set entitytype='Calendar' where entitytype='Activities'"); + +//Added to change the primarymodule from Activities to Calendar for Reports +Execute("update vtiger_reportmodules set primarymodule='Calendar' where primarymodule='Activities'"); +Execute("update vtiger_reportmodules set primarymodule='PurchaseOrder' where primarymodule='Orders'"); +Execute("update vtiger_reportmodules set secondarymodules='PurchaseOrder' where secondarymodules='Orders'"); + +//we should change the Activities to Calendar in columnname values in customview and report related tables +$prefix = "vtiger_"; +$change_cols_array = Array( + "cvcolumnlist"=>"columnname", + "cvstdfilter"=>"columnname", + "cvadvfilter"=>"columnname", + "selectcolumn"=>"columnname", + "relcriteria"=>"columnname", + "reportsortcol"=>"columnname", + "reportdatefilter"=>"datecolumnname", + "reportsummary"=>"columnname", + ); + +//This is to change Activities to Calendar +foreach($change_cols_array as $tablename => $columnname) +{ + $result = $conn->query("select $columnname from $prefix$tablename where $columnname like \"%Activities%\""); + + while($row = $conn->fetch_row($result)) + { + if($row[$columnname] !='' && $row[$columnname] != 'none') + { + Execute("update $prefix$tablename set $columnname=\"".str_replace("Activities","Calendar",$row[$columnname])."\" where $columnname=\"$row[$columnname]\""); + } + } +} + +//This is to change the Orders to PurchaseOrder +foreach($change_cols_array as $tablename => $columnname) +{ + $result1 = $conn->query("select $columnname from $prefix$tablename where $columnname like \"%Orders%\""); + + while($row1 = $conn->fetch_row($result1)) + { + if($row1[$columnname] !='' && $row1[$columnname] != 'none') + { + Execute("update $prefix$tablename set $columnname=\"".str_replace("Orders","PurchaseOrder",$row1[$columnname])."\" where $columnname=\"$row1[$columnname]\""); + } + } +} +//changes made for CustomView and Reports - Activities changed to Calendar -- Ends + + + Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/rename_tables.php ============================================================================== --- vtigercrm/trunk/modules/Migration/ModifyDatabase/rename_tables.php (original) +++ vtigercrm/trunk/modules/Migration/ModifyDatabase/rename_tables.php Thu Aug 24 08:11:25 2006 @@ -45,7 +45,15 @@ { if((!strstr($row[$columnname],$prefix)) && $row[$columnname] !='' && $row[$columnname] != 'none') { - $queries_list .= "update $prefix$tablename set $columnname=\"$prefix$row[$columnname]\" where $columnname=\"$row[$columnname]\"&&##"; + //for reportsummary we should add prefix in second value ie., after first :(semicolon) + if($tablename == 'reportsummary') + { + $queries_list .= "update $prefix$tablename set $columnname=\"".str_replace("cb:","cb:$prefix",$row[$columnname])."\" where $columnname=\"$row[$columnname]\"&&##"; + } + else + { + $queries_list .= "update $prefix$tablename set $columnname=\"$prefix$row[$columnname]\" where $columnname=\"$row[$columnname]\"&&##"; + } } } } From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 10:27:33 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 14:27:33 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9134 - /vtigercrm/trunk/Smarty/templates/CurrencyEditView.tpl Message-ID: <20060824142733.7A7A175E6E9@vtiger.fosslabs.com> Author: richie Date: Thu Aug 24 08:27:29 2006 New Revision: 9134 Log: changes made to fix the currency related issue --Minnie Modified: vtigercrm/trunk/Smarty/templates/CurrencyEditView.tpl Modified: vtigercrm/trunk/Smarty/templates/CurrencyEditView.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/CurrencyEditView.tpl (original) +++ vtigercrm/trunk/Smarty/templates/CurrencyEditView.tpl Thu Aug 24 08:27:29 2006 @@ -128,7 +128,13 @@ if (!emptyCheck("currency_symbol","Currency Symbol","text")) return false if (!emptyCheck("conversion_rate","Conversion Rate","text")) return false if (!emptyCheck("currency_status","Currency Status","text")) return false - return true; + if(isNaN(getObj("conversion_rate").value) || eval(getObj("conversion_rate") +.value) == 0) + { + alert("Enter valid Conversion Rate") + return false + } + return true; } From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 24 11:01:09 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 24 Aug 2006 15:01:09 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9135 - /vtigercrm/trunk/modules/Migration/ModifyDatabase/MigrationInfo.php Message-ID: <20060824150109.6847A75E808@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 24 09:01:05 2006 New Revision: 9135 Log: * Changed the information Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/MigrationInfo.php Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/MigrationInfo.php ============================================================================== --- vtigercrm/trunk/modules/Migration/ModifyDatabase/MigrationInfo.php (original) +++ vtigercrm/trunk/modules/Migration/ModifyDatabase/MigrationInfo.php Thu Aug 24 09:01:05 2006 @@ -199,7 +199,7 @@ From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 25 07:07:58 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Fri, 25 Aug 2006 11:07:58 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9136 - in /vtigercrm/trunk: Smarty/templates/MigrationStep1.tpl modules/Migration/MigrationCheck.php modules/Migration/MigrationStep1.php Message-ID: <20060825110758.BFD0675E88E@vtiger.fosslabs.com> Author: saraj Date: Fri Aug 25 05:07:51 2006 New Revision: 9136 Log: * Added changes to avoid to get the MySQL server path for the option 3 and added check user_privileges folder write permission Modified: vtigercrm/trunk/Smarty/templates/MigrationStep1.tpl vtigercrm/trunk/modules/Migration/MigrationCheck.php vtigercrm/trunk/modules/Migration/MigrationStep1.php Modified: vtigercrm/trunk/Smarty/templates/MigrationStep1.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/MigrationStep1.tpl (original) +++ vtigercrm/trunk/Smarty/templates/MigrationStep1.tpl Fri Aug 25 05:07:51 2006 @@ -264,6 +264,18 @@ document.getElementById('mnuTab1').style.display = 'none'; document.getElementById('mnuTab2').style.display = 'block'; {rdelim} + + //show/hide MySQL server path + if(document.getElementById('getmysqlpath').value == 1 && document.getElementById('mnuTab2').style.display == 'none') + {ldelim} + //show MySQL server path + document.getElementById('mnuTab3').style.display = 'block'; + {rdelim} + else + {ldelim} + //hide MySQL server path + document.getElementById('mnuTab3').style.display = 'none'; + {rdelim} {rdelim} //function to validate the input values based on the radio option selected @@ -343,7 +355,7 @@ //this is added to check whether the getmysql path is true and the user has entered the path or not if(error != true) {ldelim} - if(document.getElementById("getmysqlpath").value == 1 && trim(formname.server_mysql_path.value) == '') + if(document.getElementById("getmysqlpath").value == 1 && trim(formname.server_mysql_path.value) == '' && document.getElementById("alter_db_details").checked != true) {ldelim} //alert(document.getElementById("getmysqlpath").value+" Enter the mysql path"); error_msg = "Please enter the Correct MySQL Path"; Modified: vtigercrm/trunk/modules/Migration/MigrationCheck.php ============================================================================== --- vtigercrm/trunk/modules/Migration/MigrationCheck.php (original) +++ vtigercrm/trunk/modules/Migration/MigrationCheck.php Fri Aug 25 05:07:51 2006 @@ -20,6 +20,14 @@ $new_mysql_password = $dbconfig['db_password']; $new_dbname = $dbconfig['db_name']; +//this is to check whether the user_privileges folder has write permission +if(!is_writable($root_directory."user_privileges/")) +{ + echo "
Please give read/write permission to user_privileges folder."; + include("modules/Migration/MigrationStep1.php"); + exit; +} + //this is to check whether the mysql path is needed and has been entered or not if($_REQUEST['getmysqlpath'] == 1 && $_REQUEST['server_mysql_path'] != '') { @@ -40,7 +48,7 @@ $migration_log .='MySQL Dump file has found in ==> '.$server_mysql_path; } - if(!$mysql_path_found) + if(!$mysql_path_found && $_REQUEST['migration_option'] != 'alter_db_details') { //header("Location: index.php?module=Migration&action=MigrationStep1&parenttab=Settings"); echo '
MySQL dump file is not exist in the specified MySQL Server Path'; Modified: vtigercrm/trunk/modules/Migration/MigrationStep1.php ============================================================================== --- vtigercrm/trunk/modules/Migration/MigrationStep1.php (original) +++ vtigercrm/trunk/modules/Migration/MigrationStep1.php Fri Aug 25 05:07:51 2006 @@ -41,6 +41,11 @@ else { $getmysqlpath = 1; + + if($_REQUEST['migration_option'] == 'alter_db_details') + $showmysqlpath = 'none'; + else + $showmysqlpath = 'block'; } @@ -69,6 +74,7 @@ //Based on this $getmysqlpath variable we should get the mysql path from the user $smarty->assign("GET_MYSQL_PATH",$getmysqlpath); +$smarty->assign("SHOW_MYSQL_PATH",$showmysqlpath); //this is to set the entered values when we could not proceed the migration and return to step1 if($_REQUEST['migration_option'] != '') From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 25 07:22:28 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Fri, 25 Aug 2006 11:22:28 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9137 - /thunderbirdextn/trunk/chrome/vtiger/content/vtiger/addtovtiger.js Message-ID: <20060825112228.6727F75E912@vtiger.fosslabs.com> Author: richie Date: Fri Aug 25 05:22:11 2006 New Revision: 9137 Log: Issue in Thunderbird Plugin has been fixed--Jeri Modified: thunderbirdextn/trunk/chrome/vtiger/content/vtiger/addtovtiger.js Modified: thunderbirdextn/trunk/chrome/vtiger/content/vtiger/addtovtiger.js ============================================================================== Binary files - no diff available. From vtigercrm-commits at vtiger.fosslabs.com Fri Aug 25 14:49:59 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Fri, 25 Aug 2006 18:49:59 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9138 - in /vtigercrm/trunk: install/2setConfig.php install/3confirmConfig.php install/4createConfigFile.php install/5createTables.inc.php install/5createTables.php modules/Users/DefaultDataPopulator.php Message-ID: <20060825184959.460A675E951@vtiger.fosslabs.com> Author: saraj Date: Fri Aug 25 12:49:50 2006 New Revision: 9138 Log: Selecting Master currency option provided Modified: vtigercrm/trunk/install/2setConfig.php vtigercrm/trunk/install/3confirmConfig.php vtigercrm/trunk/install/4createConfigFile.php vtigercrm/trunk/install/5createTables.inc.php vtigercrm/trunk/install/5createTables.php vtigercrm/trunk/modules/Users/DefaultDataPopulator.php Modified: vtigercrm/trunk/install/2setConfig.php ============================================================================== --- vtigercrm/trunk/install/2setConfig.php (original) +++ vtigercrm/trunk/install/2setConfig.php Fri Aug 25 12:49:50 2006 @@ -130,6 +130,10 @@ if (isset($_REQUEST['admin_password'])) $admin_password = $_REQUEST['admin_password']; + + if (isset($_REQUEST['currency'])) + $currency = $_REQUEST['currency']; + } else { !isset($_REQUEST['db_hostname']) ? $db_hostname = $hostname: $db_hostname = $_REQUEST['db_hostname']; @@ -424,7 +428,40 @@ + + + + + + + + Modified: vtigercrm/trunk/install/3confirmConfig.php ============================================================================== --- vtigercrm/trunk/install/3confirmConfig.php (original) +++ vtigercrm/trunk/install/3confirmConfig.php Fri Aug 25 12:49:50 2006 @@ -25,7 +25,7 @@ if (isset($_REQUEST['site_URL'])) $site_URL= $_REQUEST['site_URL']; if (isset($_REQUEST['admin_email'])) $admin_email= $_REQUEST['admin_email']; if (isset($_REQUEST['admin_password'])) $admin_password = $_REQUEST['admin_password']; -if (isset($_REQUEST['admin_email'])) $admin_email = $_REQUEST['admin_email']; +if (isset($_REQUEST['currency'])) $currency = $_REQUEST['currency']; if (isset($_REQUEST['cache_dir'])) $cache_dir= $_REQUEST['cache_dir']; if (isset($_REQUEST['mail_server'])) $mail_server= $_REQUEST['mail_server']; if (isset($_REQUEST['mail_server_username'])) $mail_server_username= $_REQUEST['mail_server_username']; @@ -234,6 +234,10 @@ + + + +
-
Note : Please note that for each query the "Object" string will be displayed at the starting of the line if the query executed successfully. If the query fails then "Object" will not be displayed. we can find out the failed queries based on these Object display. +
These following queries are executed to modify the 4.2.3/4.2 Patch2 database to 5.0 database.
Email* ">
Master Currency*
Note: The default password is 'admin'. You can change the password if necessary now or else you can change it later after logging-in.
Admin Password
Master Currency


@@ -252,6 +256,7 @@ " /> " /> " /> + " /> @@ -286,6 +291,7 @@ " /> " /> " /> + " /> Modified: vtigercrm/trunk/install/4createConfigFile.php ============================================================================== --- vtigercrm/trunk/install/4createConfigFile.php (original) +++ vtigercrm/trunk/install/4createConfigFile.php Fri Aug 25 12:49:50 2006 @@ -80,6 +80,8 @@ if (isset($_REQUEST['admin_email'])) $admin_email = $_REQUEST['admin_email']; if (isset($_REQUEST['admin_password'])) $admin_password = $_REQUEST['admin_password']; + +if (isset($_REQUEST['currency'])) $currency = $_REQUEST['currency']; if (isset($_REQUEST['mail_server'])) $mail_server = $_REQUEST['mail_server']; @@ -438,6 +440,7 @@ " /> " /> " /> + " /> Modified: vtigercrm/trunk/install/5createTables.inc.php ============================================================================== --- vtigercrm/trunk/install/5createTables.inc.php (original) +++ vtigercrm/trunk/install/5createTables.inc.php Fri Aug 25 12:49:50 2006 @@ -198,6 +198,24 @@ $db->getUniqueID("vtiger_seactivityrel"); $db->getUniqueID("vtiger_freetags"); +//Master currency population +$currencies = array('Euro'=>array('name'=>'Euro','symbol'=>'&euro','code'=>'EUR'), + 'United States Dollar'=>array('name'=>'United States Dollar','symbol'=>'$','code'=>'USD'), + 'United Kingdom Pounds'=>array('name'=>'United Kingdom Pounds','symbol'=>'£','code'=>'GBP'), + 'Canada Dollars'=>array('name'=>'Canada Dollars','symbol'=>'$','code'=>'CAD'), + 'Australia Dollars'=>array('name'=>'Australia Dollars','symbol'=>'$','code'=>'AUD'), + 'Japan Yen'=>array('name'=>'Japan Yen','symbol'=>'¥','code'=>'JPY'), + 'Indian Rupee'=>array('name'=>'Indian Rupee','symbol'=>'₨','code'=>'INR'), + 'New Zealand Dollars'=>array('name'=>'New Zealand Dollars','symbol'=>'$','code'=>''), + 'South Africa Rand'=>array('name'=>'South Africa Rand','symbol'=>'R','code'=>'ZAR'), + ); + +$symbol = $currencies[$sel_currency]['symbol']; +$code = $currencies[$sel_currency]['code']; + +//Insert into vtiger_currency vtiger_table + $db->query("insert into vtiger_currency_info values(".$db->getUniqueID("vtiger_currency_info").",'$sel_currency','$code','$symbol',1,'Active','-11')"); + // populate the db with seed data if ($db_populate) { //eecho ("Populate seed data into $db_name"); Modified: vtigercrm/trunk/install/5createTables.php ============================================================================== --- vtigercrm/trunk/install/5createTables.php (original) +++ vtigercrm/trunk/install/5createTables.php Fri Aug 25 12:49:50 2006 @@ -24,6 +24,7 @@ if (isset($_REQUEST['db_populate'])) $db_populate = $_REQUEST['db_populate']; if (isset($_REQUEST['admin_email'])) $admin_email = $_REQUEST['admin_email']; if (isset($_REQUEST['admin_password'])) $admin_password = $_REQUEST['admin_password']; +if (isset($_REQUEST['currency'])) $sel_currency = $_REQUEST['currency']; ?> Modified: vtigercrm/trunk/modules/Users/DefaultDataPopulator.php ============================================================================== --- vtigercrm/trunk/modules/Users/DefaultDataPopulator.php (original) +++ vtigercrm/trunk/modules/Users/DefaultDataPopulator.php Fri Aug 25 12:49:50 2006 @@ -1893,12 +1893,6 @@ $this->db->query("insert into vtiger_inventorynotification(notificationid,notificationname,notificationsubject,notificationbody,label) values (".$this->db->getUniqueID("vtiger_inventorynotification").",'SalesOrderNotification','Sales Order generated for {PRODUCTNAME}','".$so_body." ','SalesOrderNotificationDescription')"); - //Insert into vtiger_currency vtiger_table - $this->db->query("insert into vtiger_currency_info values(".$this->db->getUniqueID("vtiger_currency_info").",'U.S Dollar','USD','$',1,'Active','-11')"); - - - - //insert into email template vtiger_table $body=' From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 04:08:18 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 08:08:18 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9139 - /vtigercrm/trunk/modules/Calendar/Activity.php Message-ID: <20060828080819.2054772A0E2@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 02:08:07 2006 New Revision: 9139 Log: Security implemented for Outlook Plugin --Jeri Modified: vtigercrm/trunk/modules/Calendar/Activity.php Modified: vtigercrm/trunk/modules/Calendar/Activity.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/Activity.php (original) +++ vtigercrm/trunk/modules/Calendar/Activity.php Mon Aug 28 02:08:07 2006 @@ -1,435 +1,497 @@ -'crmid','vtiger_activity'=>'activityid','vtiger_seactivityrel'=>'activityid','vtiger_cntactivityrel'=>'activityid','vtiger_salesmanactivityrel'=>'activityid','vtiger_activity_reminder'=>'activity_id','vtiger_recurringevents'=>'activityid'); - - var $column_fields = Array(); - var $sortby_fields = Array('subject','due_date','date_start','smownerid','activitytype'); //Sorting is added for due date and start date - - // This is used to retrieve related vtiger_fields from form posts. - var $additional_column_fields = Array('assigned_user_name', 'assigned_user_id', 'contactname', 'contact_phone', 'contact_email', 'parent_name'); - - // This is the list of vtiger_fields that are in the lists. - var $list_fields = Array( - 'Close'=>Array('activity'=>'status'), - 'Type'=>Array('activity'=>'activitytype'), - 'Subject'=>Array('activity'=>'subject'), - 'Contact Name'=>Array('contactdetails'=>'lastname'), - 'Related to'=>Array('seactivityrel'=>'activityid'), - 'Start Date'=>Array('activity'=>'date_start'), - 'End Date'=>Array('activity'=>'due_date'), - 'Recurring Type'=>Array('recurringevents'=>'recurringtype'), - 'Assigned To'=>Array('crmentity'=>'smownerid') - ); - - var $range_fields = Array( - 'name', - 'date_modified', - 'start_date', - 'id', - 'status', - 'date_due', - 'time_start', - 'description', - 'contact_name', - 'priority', - 'duehours', - 'dueminutes', - 'location' - ); - - - var $list_fields_name = Array( - 'Close'=>'status', - 'Type'=>'activitytype', - 'Subject'=>'subject', - 'Contact Name'=>'lastname', - 'Related to'=>'activityid', - 'Start Date'=>'date_start', - 'End Date'=>'due_date', - 'Recurring Type'=>'recurringtype', - 'Assigned To'=>'assigned_user_id'); - - var $list_link_field= 'subject'; - - //Added these variables which are used as default order by and sortorder in ListView - var $default_order_by = 'due_date'; - var $default_sort_order = 'ASC'; - - function Activity() { - $this->log = LoggerManager::getLogger('Calendar'); - $this->db = new PearDatabase(); - $this->column_fields = getColumnFields('Calendar'); - } - - var $new_schema = true; - - - // Mike Crowe Mod --------------------------------------------------------Default ordering for us - /** - * Function to get sort order - * return string $sorder - sortorder string either 'ASC' or 'DESC' - */ - function getSortOrder() - { - global $log; $log->debug("Entering getSortOrder() method ..."); - if(isset($_REQUEST['sorder'])) - $sorder = $_REQUEST['sorder']; - else - $sorder = (($_SESSION['ACTIVITIES_SORT_ORDER'] != '')?($_SESSION['ACTIVITIES_SORT_ORDER']):($this->default_sort_order)); - $log->debug("Exiting getSortOrder method ..."); - return $sorder; - } - - /** - * Function to get order by - * return string $order_by - fieldname(eg: 'subject') - */ - function getOrderBy() - { - global $log; - $log->debug("Entering getOrderBy() method ..."); - if (isset($_REQUEST['order_by'])) - $order_by = $_REQUEST['order_by']; - else - $order_by = (($_SESSION['ACTIVITIES_ORDER_BY'] != '')?($_SESSION['ACTIVITIES_ORDER_BY']):($this->default_order_by)); - $log->debug("Exiting getOrderBy method ..."); - return $order_by; - } - // Mike Crowe Mod -------------------------------------------------------- - - - -//Function Call for Related List -- Start - /** - * Function to get Activity related Contacts - * @param integer $id - activityid - * returns related Contacts record in array format - */ - function get_contacts($id) - { - global $log; - $log->debug("Entering get_contacts(".$id.") method ..."); - global $app_strings; - - $focus = new Contact(); - - $button = ''; - - $returnset = '&return_module=Calendar&return_action=CallRelatedList&activity_mode=Events&return_id='.$id; - - $query = 'select vtiger_users.user_name,vtiger_contactdetails.accountid,vtiger_contactdetails.contactid, vtiger_contactdetails.firstname,vtiger_contactdetails.lastname, vtiger_contactdetails.department, vtiger_contactdetails.title, vtiger_contactdetails.email, vtiger_contactdetails.phone, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_contactdetails inner join vtiger_cntactivityrel on vtiger_cntactivityrel.contactid=vtiger_contactdetails.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid where vtiger_cntactivityrel.activityid='.$id.' and vtiger_crmentity.deleted=0'; - $log->debug("Exiting get_contacts method ..."); - return GetRelatedList('Calendar','Contacts',$focus,$query,$button,$returnset); - } - - /** - * Function to get Activity related Users - * @param integer $id - activityid - * returns related Users record in array format - */ - - function get_users($id) - { - global $log; - $log->debug("Entering get_contacts(".$id.") method ..."); - global $app_strings; - - $focus = new User(); - - $button = ''; - - $returnset = '&return_module=Calendar&return_action=CallRelatedList&return_id='.$id; - - $query = 'SELECT vtiger_users.id, vtiger_users.first_name,vtiger_users.last_name, vtiger_users.user_name, vtiger_users.email1, vtiger_users.email2, vtiger_users.status, vtiger_users.is_admin, vtiger_user2role.roleid, vtiger_users.yahoo_id, vtiger_users.phone_home, vtiger_users.phone_work, vtiger_users.phone_mobile, vtiger_users.phone_other, vtiger_users.phone_fax,vtiger_activity.date_start,vtiger_activity.due_date,vtiger_activity.time_start,vtiger_activity.duration_hours,vtiger_activity.duration_minutes from vtiger_users inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.smid=vtiger_users.id inner join vtiger_activity on vtiger_activity.activityid=vtiger_salesmanactivityrel.activityid inner join vtiger_user2role on vtiger_user2role.userid=vtiger_users.id where vtiger_activity.activityid='.$id; - $log->debug("Exiting get_users method ..."); - return GetRelatedList('Calendar','Users',$focus,$query,$button,$returnset); - - - } - - /** - * Function to get activities for given criteria - * @param string $criteria - query string - * returns activity records in array format($list) or null value - */ - function get_full_list($criteria) - { - global $log; - $log->debug("Entering get_full_list(".$criteria.") method ..."); - $query = "select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 ".$criteria; - $result =& $this->db->query($query); - - if($this->db->getRowCount($result) > 0){ - - // We have some data. - while ($row = $this->db->fetchByAssoc($result)) { - foreach($this->list_fields_name as $field) - { - if (isset($row[$field])) { - $this->$field = $row[$field]; - } - else { - $this->$field = ''; - } - } - $list[] = $this; - } - } - if (isset($list)) - { - $log->debug("Exiting get_full_list method ..."); - return $list; - } - else - { - $log->debug("Exiting get_full_list method ..."); - return null; - } - - } - - -//calendarsync - /** - * Function to get meeting count - * @param string $user_name - User Name - * return integer $row["count(*)"] - count - */ - function getCount_Meeting($user_name) - { - global $log; - $log->debug("Entering getCount_Meeting(".$user_name.") method ..."); - $query = "select count(*) from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting'"; - - $result = $this->db->query($query,true,"Error retrieving contacts count"); - $rows_found = $this->db->getRowCount($result); - $row = $this->db->fetchByAssoc($result, 0); - $log->debug("Exiting getCount_Meeting method ..."); - return $row["count(*)"]; - } - - function get_calendars($user_name,$from_index,$offset) - { - global $log; - $log->debug("Entering get_calendars(".$user_name.",".$from_index.",".$offset.") method ..."); - $query = "select vtiger_activity.location as location,vtiger_activity.duration_hours as duehours, vtiger_activity.duration_minutes as dueminutes,vtiger_activity.time_start as time_start, vtiger_activity.subject as name,vtiger_crmentity.modifiedtime as date_modified, vtiger_activity.date_start start_date,vtiger_activity.activityid as id,vtiger_activity.status as status, vtiger_crmentity.description as description, vtiger_activity.priority as vtiger_priority, vtiger_activity.due_date as date_due ,vtiger_contactdetails.firstname cfn, vtiger_contactdetails.lastname cln from vtiger_activity inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting' limit " .$from_index ."," .$offset; - $log->debug("Exiting get_calendars method ..."); - return $this->process_list_query1($query); - } -//calendarsync - /** - * Function to get task count - * @param string $user_name - User Name - * return integer $row["count(*)"] - count - */ - function getCount($user_name) - { - global $log; - $log->debug("Entering getCount(".$user_name.") method ..."); - $query = "select count(*) from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task'"; - - $result = $this->db->query($query,true,"Error retrieving contacts count"); - $rows_found = $this->db->getRowCount($result); - $row = $this->db->fetchByAssoc($result, 0); - - $log->debug("Exiting getCount method ..."); - return $row["count(*)"]; - } - - /** - * Function to get list of task for user with given limit - * @param string $user_name - User Name - * @param string $from_index - query string - * @param string $offset - query string - * returns tasks in array format - */ - function get_tasks($user_name,$from_index,$offset) - { - global $log; - $log->debug("Entering get_tasks(".$user_name.",".$from_index.",".$offset.") method ..."); - $query = "select vtiger_activity.subject as name,vtiger_crmentity.modifiedtime as date_modified, vtiger_activity.date_start start_date,vtiger_activity.activityid as id,vtiger_activity.status as status, vtiger_crmentity.description as description, vtiger_activity.priority as priority, vtiger_activity.due_date as date_due ,vtiger_contactdetails.firstname cfn, vtiger_contactdetails.lastname cln from vtiger_activity inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task' limit " .$from_index ."," .$offset; - $log->debug("Exiting get_tasks method ..."); - return $this->process_list_query1($query); - - } - - /** - * Function to process the activity list query - * @param string $query - query string - * return array $response - activity lists - */ - function process_list_query1($query) - { - global $log; - $log->debug("Entering process_list_query1(".$query.") method ..."); - $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); - $list = Array(); - $rows_found = $this->db->getRowCount($result); - if($rows_found != 0) - { - $task = Array(); - for($index = 0 , $row = $this->db->fetchByAssoc($result, $index); $row && $index <$rows_found;$index++, $row = $this->db->fetchByAssoc($result, $index)) - - { - foreach($this->range_fields as $columnName) - { - if (isset($row[$columnName])) { - - $task[$columnName] = $row[$columnName]; - } - else - { - $task[$columnName] = ""; - } - } - - $task[contact_name] = return_name($row, 'cfn', 'cln'); - - $list[] = $task; - } - } - - $response = Array(); - $response['list'] = $list; - $response['row_count'] = $rows_found; - $response['next_offset'] = $next_offset; - $response['previous_offset'] = $previous_offset; - - - $log->debug("Exiting process_list_query1 method ..."); - return $response; - } - - /** - * Function to get reminder for activity - * @param integer $activity_id - activity id - * @param string $reminder_time - reminder time - * @param integer $reminder_sent - 0 or 1 - * @param integer $recurid - recuring eventid - * @param string $remindermode - string like 'edit' - */ - function activity_reminder($activity_id,$reminder_time,$reminder_sent=0,$recurid,$remindermode='') - { - global $log; - $log->debug("Entering vtiger_activity_reminder(".$activity_id.",".$reminder_time.",".$reminder_sent.",".$recurid.",".$remindermode.") method ..."); - //Check for vtiger_activityid already present in the reminder_table - $query_exist = "SELECT activity_id FROM ".$this->reminder_table." WHERE activity_id = ".$activity_id; - $result_exist = $this->db->query($query_exist); - - if($remindermode == 'edit') - { - if($this->db->num_rows($result_exist) == 1) - { - $query = "UPDATE ".$this->reminder_table." SET"; - $query .=" reminder_sent = ".$reminder_sent.","; - $query .=" reminder_time = ".$reminder_time." WHERE activity_id =".$activity_id; - } - else - { - $query = "INSERT INTO ".$this->reminder_table." VALUES (".$activity_id.",".$reminder_time.",0,'".$recurid."')"; - } - } - elseif(($remindermode == 'delete') && ($this->db->num_rows($result_exist) == 1)) - { - $query = "DELETE FROM ".$this->reminder_table." WHERE activity_id = ".$activity_id; - } - else - { - $query = "INSERT INTO ".$this->reminder_table." VALUES (".$activity_id.",".$reminder_time.",0,'".$recurid."')"; - } - $this->db->query($query,true,"Error in processing vtiger_table $this->reminder_table"); - $log->debug("Exiting vtiger_activity_reminder method ..."); - } - -//Used for vtigerCRM Outlook Add-In -/** - * Function to get tasks to display in outlookplugin - * @param string $username - User name - * return string $query - sql query - */ -function get_tasksforol($username) -{ - global $log; - $log->debug("Entering get_tasksforol(".$username.") method ..."); - $query = "select vtiger_activity.subject,vtiger_activity.date_start startdate, - vtiger_activity.activityid as taskid,vtiger_activity.status, - vtiger_crmentity.description,vtiger_activity.priority as priority,vtiger_activity.due_date as duedate, - vtiger_contactdetails.firstname, vtiger_contactdetails.lastname - from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid - inner join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid - left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid - left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid - where vtiger_users.user_name='".$username."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task'"; - $log->debug("Exiting get_tasksforol method ..."); - return $query; -} - -/** - * Function to get calendar query for outlookplugin - * @param string $username - User name * return string $query - sql query */ -function get_calendarsforol($user_name) -{ - global $log; - $log->debug("Entering get_calendarsforol(".$user_name.") method ..."); - $query = "select vtiger_activity.location, vtiger_activity.duration_hours as duehours, - vtiger_activity.duration_minutes as dueminutes,vtiger_activity.time_start as startime, - vtiger_activity.subject,vtiger_activity.date_start as startdate,vtiger_activity.activityid as clndrid, - vtiger_crmentity.description,vtiger_activity.due_date as duedate , - vtiger_contactdetails.firstname, vtiger_contactdetails.lastname from vtiger_activity - inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid - inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid - left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid - left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid - inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid - where vtiger_users.user_name='".$user_name."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting'"; - $log->debug("Exiting get_calendarsforol method ..."); - return $query; -} -//End - -} -?> +'crmid','vtiger_activity'=>'activityid','vtiger_seactivityrel'=>'activityid','vtiger_cntactivityrel'=>'activityid','vtiger_salesmanactivityrel'=>'activityid','vtiger_activity_reminder'=>'activity_id','vtiger_recurringevents'=>'activityid'); + + var $column_fields = Array(); + var $sortby_fields = Array('subject','due_date','date_start','smownerid','activitytype'); //Sorting is added for due date and start date + + // This is used to retrieve related vtiger_fields from form posts. + var $additional_column_fields = Array('assigned_user_name', 'assigned_user_id', 'contactname', 'contact_phone', 'contact_email', 'parent_name'); + + // This is the list of vtiger_fields that are in the lists. + var $list_fields = Array( + 'Close'=>Array('activity'=>'status'), + 'Type'=>Array('activity'=>'activitytype'), + 'Subject'=>Array('activity'=>'subject'), + 'Contact Name'=>Array('contactdetails'=>'lastname'), + 'Related to'=>Array('seactivityrel'=>'activityid'), + 'Start Date'=>Array('activity'=>'date_start'), + 'End Date'=>Array('activity'=>'due_date'), + 'Recurring Type'=>Array('recurringevents'=>'recurringtype'), + 'Assigned To'=>Array('crmentity'=>'smownerid') + ); + + var $range_fields = Array( + 'name', + 'date_modified', + 'start_date', + 'id', + 'status', + 'date_due', + 'time_start', + 'description', + 'contact_name', + 'priority', + 'duehours', + 'dueminutes', + 'location' + ); + + + var $list_fields_name = Array( + 'Close'=>'status', + 'Type'=>'activitytype', + 'Subject'=>'subject', + 'Contact Name'=>'lastname', + 'Related to'=>'activityid', + 'Start Date'=>'date_start', + 'End Date'=>'due_date', + 'Recurring Type'=>'recurringtype', + 'Assigned To'=>'assigned_user_id'); + + var $list_link_field= 'subject'; + + //Added these variables which are used as default order by and sortorder in ListView + var $default_order_by = 'due_date'; + var $default_sort_order = 'ASC'; + + function Activity() { + $this->log = LoggerManager::getLogger('Calendar'); + $this->db = new PearDatabase(); + $this->column_fields = getColumnFields('Calendar'); + } + + var $new_schema = true; + + + // Mike Crowe Mod --------------------------------------------------------Default ordering for us + /** + * Function to get sort order + * return string $sorder - sortorder string either 'ASC' or 'DESC' + */ + function getSortOrder() + { + global $log; $log->debug("Entering getSortOrder() method ..."); + if(isset($_REQUEST['sorder'])) + $sorder = $_REQUEST['sorder']; + else + $sorder = (($_SESSION['ACTIVITIES_SORT_ORDER'] != '')?($_SESSION['ACTIVITIES_SORT_ORDER']):($this->default_sort_order)); + $log->debug("Exiting getSortOrder method ..."); + return $sorder; + } + + /** + * Function to get order by + * return string $order_by - fieldname(eg: 'subject') + */ + function getOrderBy() + { + global $log; + $log->debug("Entering getOrderBy() method ..."); + if (isset($_REQUEST['order_by'])) + $order_by = $_REQUEST['order_by']; + else + $order_by = (($_SESSION['ACTIVITIES_ORDER_BY'] != '')?($_SESSION['ACTIVITIES_ORDER_BY']):($this->default_order_by)); + $log->debug("Exiting getOrderBy method ..."); + return $order_by; + } + // Mike Crowe Mod -------------------------------------------------------- + + + +//Function Call for Related List -- Start + /** + * Function to get Activity related Contacts + * @param integer $id - activityid + * returns related Contacts record in array format + */ + function get_contacts($id) + { + global $log; + $log->debug("Entering get_contacts(".$id.") method ..."); + global $app_strings; + + $focus = new Contact(); + + $button = ''; + + $returnset = '&return_module=Calendar&return_action=CallRelatedList&activity_mode=Events&return_id='.$id; + + $query = 'select vtiger_users.user_name,vtiger_contactdetails.accountid,vtiger_contactdetails.contactid, vtiger_contactdetails.firstname,vtiger_contactdetails.lastname, vtiger_contactdetails.department, vtiger_contactdetails.title, vtiger_contactdetails.email, vtiger_contactdetails.phone, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_contactdetails inner join vtiger_cntactivityrel on vtiger_cntactivityrel.contactid=vtiger_contactdetails.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid where vtiger_cntactivityrel.activityid='.$id.' and vtiger_crmentity.deleted=0'; + $log->debug("Exiting get_contacts method ..."); + return GetRelatedList('Calendar','Contacts',$focus,$query,$button,$returnset); + } + + /** + * Function to get Activity related Users + * @param integer $id - activityid + * returns related Users record in array format + */ + + function get_users($id) + { + global $log; + $log->debug("Entering get_contacts(".$id.") method ..."); + global $app_strings; + + $focus = new User(); + + $button = ''; + + $returnset = '&return_module=Calendar&return_action=CallRelatedList&return_id='.$id; + + $query = 'SELECT vtiger_users.id, vtiger_users.first_name,vtiger_users.last_name, vtiger_users.user_name, vtiger_users.email1, vtiger_users.email2, vtiger_users.status, vtiger_users.is_admin, vtiger_user2role.roleid, vtiger_users.yahoo_id, vtiger_users.phone_home, vtiger_users.phone_work, vtiger_users.phone_mobile, vtiger_users.phone_other, vtiger_users.phone_fax,vtiger_activity.date_start,vtiger_activity.due_date,vtiger_activity.time_start,vtiger_activity.duration_hours,vtiger_activity.duration_minutes from vtiger_users inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.smid=vtiger_users.id inner join vtiger_activity on vtiger_activity.activityid=vtiger_salesmanactivityrel.activityid inner join vtiger_user2role on vtiger_user2role.userid=vtiger_users.id where vtiger_activity.activityid='.$id; + $log->debug("Exiting get_users method ..."); + return GetRelatedList('Calendar','Users',$focus,$query,$button,$returnset); + + + } + + /** + * Function to get activities for given criteria + * @param string $criteria - query string + * returns activity records in array format($list) or null value + */ + function get_full_list($criteria) + { + global $log; + $log->debug("Entering get_full_list(".$criteria.") method ..."); + $query = "select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 ".$criteria; + $result =& $this->db->query($query); + + if($this->db->getRowCount($result) > 0){ + + // We have some data. + while ($row = $this->db->fetchByAssoc($result)) { + foreach($this->list_fields_name as $field) + { + if (isset($row[$field])) { + $this->$field = $row[$field]; + } + else { + $this->$field = ''; + } + } + $list[] = $this; + } + } + if (isset($list)) + { + $log->debug("Exiting get_full_list method ..."); + return $list; + } + else + { + $log->debug("Exiting get_full_list method ..."); + return null; + } + + } + + +//calendarsync + /** + * Function to get meeting count + * @param string $user_name - User Name + * return integer $row["count(*)"] - count + */ + function getCount_Meeting($user_name) + { + global $log; + $log->debug("Entering getCount_Meeting(".$user_name.") method ..."); + $query = "select count(*) from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting'"; + + $result = $this->db->query($query,true,"Error retrieving contacts count"); + $rows_found = $this->db->getRowCount($result); + $row = $this->db->fetchByAssoc($result, 0); + $log->debug("Exiting getCount_Meeting method ..."); + return $row["count(*)"]; + } + + function get_calendars($user_name,$from_index,$offset) + { + global $log; + $log->debug("Entering get_calendars(".$user_name.",".$from_index.",".$offset.") method ..."); + $query = "select vtiger_activity.location as location,vtiger_activity.duration_hours as duehours, vtiger_activity.duration_minutes as dueminutes,vtiger_activity.time_start as time_start, vtiger_activity.subject as name,vtiger_crmentity.modifiedtime as date_modified, vtiger_activity.date_start start_date,vtiger_activity.activityid as id,vtiger_activity.status as status, vtiger_crmentity.description as description, vtiger_activity.priority as vtiger_priority, vtiger_activity.due_date as date_due ,vtiger_contactdetails.firstname cfn, vtiger_contactdetails.lastname cln from vtiger_activity inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting' limit " .$from_index ."," .$offset; + $log->debug("Exiting get_calendars method ..."); + return $this->process_list_query1($query); + } +//calendarsync + /** + * Function to get task count + * @param string $user_name - User Name + * return integer $row["count(*)"] - count + */ + function getCount($user_name) + { + global $log; + $log->debug("Entering getCount(".$user_name.") method ..."); + $query = "select count(*) from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task'"; + + $result = $this->db->query($query,true,"Error retrieving contacts count"); + $rows_found = $this->db->getRowCount($result); + $row = $this->db->fetchByAssoc($result, 0); + + $log->debug("Exiting getCount method ..."); + return $row["count(*)"]; + } + + /** + * Function to get list of task for user with given limit + * @param string $user_name - User Name + * @param string $from_index - query string + * @param string $offset - query string + * returns tasks in array format + */ + function get_tasks($user_name,$from_index,$offset) + { + global $log; + $log->debug("Entering get_tasks(".$user_name.",".$from_index.",".$offset.") method ..."); + $query = "select vtiger_activity.subject as name,vtiger_crmentity.modifiedtime as date_modified, vtiger_activity.date_start start_date,vtiger_activity.activityid as id,vtiger_activity.status as status, vtiger_crmentity.description as description, vtiger_activity.priority as priority, vtiger_activity.due_date as date_due ,vtiger_contactdetails.firstname cfn, vtiger_contactdetails.lastname cln from vtiger_activity inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task' limit " .$from_index ."," .$offset; + $log->debug("Exiting get_tasks method ..."); + return $this->process_list_query1($query); + + } + + /** + * Function to process the activity list query + * @param string $query - query string + * return array $response - activity lists + */ + function process_list_query1($query) + { + global $log; + $log->debug("Entering process_list_query1(".$query.") method ..."); + $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); + $list = Array(); + $rows_found = $this->db->getRowCount($result); + if($rows_found != 0) + { + $task = Array(); + for($index = 0 , $row = $this->db->fetchByAssoc($result, $index); $row && $index <$rows_found;$index++, $row = $this->db->fetchByAssoc($result, $index)) + + { + foreach($this->range_fields as $columnName) + { + if (isset($row[$columnName])) { + + $task[$columnName] = $row[$columnName]; + } + else + { + $task[$columnName] = ""; + } + } + + $task[contact_name] = return_name($row, 'cfn', 'cln'); + + $list[] = $task; + } + } + + $response = Array(); + $response['list'] = $list; + $response['row_count'] = $rows_found; + $response['next_offset'] = $next_offset; + $response['previous_offset'] = $previous_offset; + + + $log->debug("Exiting process_list_query1 method ..."); + return $response; + } + + /** + * Function to get reminder for activity + * @param integer $activity_id - activity id + * @param string $reminder_time - reminder time + * @param integer $reminder_sent - 0 or 1 + * @param integer $recurid - recuring eventid + * @param string $remindermode - string like 'edit' + */ + function activity_reminder($activity_id,$reminder_time,$reminder_sent=0,$recurid,$remindermode='') + { + global $log; + $log->debug("Entering vtiger_activity_reminder(".$activity_id.",".$reminder_time.",".$reminder_sent.",".$recurid.",".$remindermode.") method ..."); + //Check for vtiger_activityid already present in the reminder_table + $query_exist = "SELECT activity_id FROM ".$this->reminder_table." WHERE activity_id = ".$activity_id; + $result_exist = $this->db->query($query_exist); + + if($remindermode == 'edit') + { + if($this->db->num_rows($result_exist) == 1) + { + $query = "UPDATE ".$this->reminder_table." SET"; + $query .=" reminder_sent = ".$reminder_sent.","; + $query .=" reminder_time = ".$reminder_time." WHERE activity_id =".$activity_id; + } + else + { + $query = "INSERT INTO ".$this->reminder_table." VALUES (".$activity_id.",".$reminder_time.",0,'".$recurid."')"; + } + } + elseif(($remindermode == 'delete') && ($this->db->num_rows($result_exist) == 1)) + { + $query = "DELETE FROM ".$this->reminder_table." WHERE activity_id = ".$activity_id; + } + else + { + $query = "INSERT INTO ".$this->reminder_table." VALUES (".$activity_id.",".$reminder_time.",0,'".$recurid."')"; + } + $this->db->query($query,true,"Error in processing vtiger_table $this->reminder_table"); + $log->debug("Exiting vtiger_activity_reminder method ..."); + } + +//Used for vtigerCRM Outlook Add-In +/** + * Function to get tasks to display in outlookplugin + * @param string $username - User name + * return string $query - sql query + */ +function get_tasksforol($username) +{ + global $log,$adb; + $log->debug("Entering get_tasksforol(".$username.") method ..."); + global $current_user; + require_once("modules/Users/User.php"); + $seed_user=new User(); + $user_id=$seed_user->retrieve_user_id($user_name); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select tablename,columnname from vtiger_field where tabid=9"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select tablename,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=9 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $adb->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_lists[] = $adb->query_result($result1,$i,'tablename'); + $permitted_lists[] = $adb->query_result($result1,$i,'columnname'); + /*if($adb->query_result($result1,$i,'columnname') == "parentid") + { + $permitted_lists[] = 'vtiger_account'; + $permitted_lists[] = 'accountname'; + }*/ + } + $permitted_lists = array_chunk($permitted_lists,2); + $column_table_lists = array(); + for($i=0;$i < count($permitted_lists);$i++) + { + $column_table_lists[] = implode(".",$permitted_lists[$i]); + } + + $query = "select vtiger_activity.activityid as taskid, ".implode(',',$column_table_lists)." from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid + inner join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid + left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid + left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid + where vtiger_users.user_name='".$username."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task'"; + $log->debug("Exiting get_tasksforol method ..."); + return $query; +} + +/** + * Function to get calendar query for outlookplugin + * @param string $username - User name * return string $query - sql query */ +function get_calendarsforol($user_name) +{ + global $log,$adb; + $log->debug("Entering get_calendarsforol(".$user_name.") method ..."); + global $current_user; + require_once("modules/Users/User.php"); + $seed_user=new User(); + $user_id=$seed_user->retrieve_user_id($user_name); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select tablename,columnname from vtiger_field where tabid=9"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select tablename,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=9 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $adb->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_lists[] = $adb->query_result($result1,$i,'tablename'); + $permitted_lists[] = $adb->query_result($result1,$i,'columnname'); + /*if($adb->query_result($result1,$i,'columnname') == "parentid") + { + $permitted_lists[] = 'vtiger_account'; + $permitted_lists[] = 'accountname'; + }*/ + } + $permitted_lists = array_chunk($permitted_lists,2); + $column_table_lists = array(); + for($i=0;$i < count($permitted_lists);$i++) + { + $column_table_lists[] = implode(".",$permitted_lists[$i]); + } + + $query = "select vtiger_activity.activityid as clndrid, ".implode(',',$column_table_lists)." from vtiger_activity + inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid + inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid + left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid + left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid + inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid + where vtiger_users.user_name='".$user_name."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting'"; + $log->debug("Exiting get_calendarsforol method ..."); + return $query; +} +//End + +} +?> From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 04:29:30 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 08:29:30 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9140 - /vtigercrm/trunk/modules/Contacts/Contact.php Message-ID: <20060828082930.6E8D372A0E2@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 02:29:16 2006 New Revision: 9140 Log: Security Implemented for Outlook Plugin --Jeri Modified: vtigercrm/trunk/modules/Contacts/Contact.php Modified: vtigercrm/trunk/modules/Contacts/Contact.php ============================================================================== --- vtigercrm/trunk/modules/Contacts/Contact.php (original) +++ vtigercrm/trunk/modules/Contacts/Contact.php Mon Aug 28 02:29:16 2006 @@ -240,8 +240,7 @@ { $contact[$columnName] = ""; } - } - + } // TODO OPTIMIZE THE QUERY ACCOUNT NAME AND ID are set separetly for every vtiger_contactdetails and hence // vtiger_account query goes for ecery single vtiger_account row @@ -258,6 +257,69 @@ $log->debug("Exiting process_list_query1 method ..."); return $response; + } + + + /** Function to process list query for Plugin with Security Parameters for a given query + * @param $query + * Returns the results of query in array format + */ + function plugin_process_list_query($query) + { + global $log,$adb,$current_user; + $log->debug("Entering process_list_query1(".$query.") method ..."); + $permitted_field_lists = Array(); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select columnname from vtiger_field where tabid=4 and block <> 75"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=4 and vtiger_field.block <> 6 and vtiger_field.block <> 75 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $this->db->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_field_lists[] = $adb->query_result($result1,$i,'columnname'); + } + + $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); + $list = Array(); + $rows_found = $this->db->getRowCount($result); + if($rows_found != 0) + { + for($index = 0 , $row = $this->db->fetchByAssoc($result, $index); $row && $index <$rows_found;$index++, $row = $this->db->fetchByAssoc($result, $index)) + { + $contact = Array(); + foreach($permitted_field_lists as $columnName) + { + if ($columnName == "lastname" || $columnName == "firstname" || $columnName == "email") + { + $contact[$columnName] = $row[$columnName]; + } + else + { + $contact[$columnName] = ""; + } + } + if(in_array("accountid",$permitted_field_lists)) + { + $contact[accountname] = $row[accountname]; + $contact[account_id] = $row[accountid]; + } + $contact[contactid] = $row[contactid]; + $list[] = $contact; + } + } + + $response = Array(); + $response['list'] = $list; + $response['row_count'] = $rows_found; + $response['next_offset'] = $next_offset; + $response['previous_offset'] = $previous_offset; + $log->debug("Exiting process_list_query1 method ..."); + return $response; } @@ -637,12 +699,12 @@ require('user_privileges/user_privileges_'.$current_user->id.'.php'); if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) { - $sql1 = "select fieldlabel from vtiger_field where tabid=4 and block <> 75"; + $sql1 = "select fieldlabel from vtiger_field where tabid=4 and block <> 75"; }else { - $profileList = getCurrentUserProfileList(); - $sql1 = "select fieldlabel from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=4 and vtiger_field.block <> 6 and vtiger_field.block <> 75 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; - } + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldlabel from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=4 and vtiger_field.block <> 6 and vtiger_field.block <> 75 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } $result = $this->db->query($sql1); $numRows = $this->db->num_rows($result); for($i=0; $i < $numRows;$i++) @@ -665,55 +727,96 @@ function get_searchbyemailid($username,$emailaddress) { global $log; + global $current_user; + require_once("modules/Users/User.php"); + $seed_user=new User(); + $user_id=$seed_user->retrieve_user_id($username); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); $log->debug("Entering get_searchbyemailid(".$username.",".$emailaddress.") method ..."); - $query = "select vtiger_contactdetails.lastname as last_name,vtiger_contactdetails.firstname as first_name, - vtiger_contactdetails.contactid as id, vtiger_contactdetails.salutation as salutation, - vtiger_contactdetails.email as email1,vtiger_contactdetails.title as title, - vtiger_contactdetails.mobile as phone_mobile,vtiger_account.accountname as account_name, - vtiger_account.accountid as vtiger_account_id from vtiger_contactdetails + $query = "select vtiger_contactdetails.lastname,vtiger_contactdetails.firstname, + vtiger_contactdetails.contactid, vtiger_contactdetails.salutation, + vtiger_contactdetails.email,vtiger_contactdetails.title, + vtiger_contactdetails.mobile,vtiger_account.accountname, + vtiger_account.accountid as accountid from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_account on vtiger_account.accountid=vtiger_contactdetails.accountid - left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid - where user_name='" .$username ."' and vtiger_crmentity.deleted=0 and vtiger_contactdetails.email like '%".$emailaddress."%'"; - + left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid + LEFT JOIN vtiger_contactgrouprelation ON vtiger_contactdetails.contactid = vtiger_contactgrouprelation.contactid + LEFT JOIN vtiger_groups ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname + where vtiger_crmentity.deleted=0 and vtiger_contactdetails.email like '%".$emailaddress."%'"; + $tab_id = getTabid("Contacts"); + if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[$tab_id] == 3) + { + $sec_parameter=getListViewSecurityParameter("Contacts"); + $query .= $sec_parameter; + + } $log->debug("Exiting get_searchbyemailid method ..."); - return $this->process_list_query1($query); + return $this->plugin_process_list_query($query); } /** Function to get the Contacts associated with the particular User Name. * @param varchar $user_name - User Name * Returns query */ + function get_contactsforol($user_name) { - global $log; + global $log,$adb; + global $current_user; + require_once("modules/Users/User.php"); + $seed_user=new User(); + $user_id=$seed_user->retrieve_user_id($user_name); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select tablename,columnname from vtiger_field where tabid=4 and block <> 75 and block <> 6 and vtiger_field.block <> 5"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select tablename,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=4 and vtiger_field.block <> 75 and vtiger_field.block <> 6 and vtiger_field.block <> 5 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $adb->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_lists[] = $adb->query_result($result1,$i,'tablename'); + $permitted_lists[] = $adb->query_result($result1,$i,'columnname'); + if($adb->query_result($result1,$i,'columnname') == "accountid") + { + $permitted_lists[] = 'vtiger_account'; + $permitted_lists[] = 'accountname'; + } + } + $permitted_lists = array_chunk($permitted_lists,2); + $column_table_lists = array(); + for($i=0;$i < count($permitted_lists);$i++) + { + $column_table_lists[] = implode(".",$permitted_lists[$i]); + } + $log->debug("Entering get_contactsforol(".$user_name.") method ..."); - $query = "select vtiger_contactdetails.department department, vtiger_contactdetails.phone, - vtiger_contactdetails.fax, vtiger_contactsubdetails.assistant assistant_name, - vtiger_contactsubdetails.assistantphone, - vtiger_contactsubdetails.otherphone, vtiger_contactsubdetails.homephone, - vtiger_contactsubdetails.birthday birthdate, vtiger_contactdetails.lastname last_name, - vtiger_contactdetails.firstname first_name,vtiger_contactdetails.contactid as id, - vtiger_contactdetails.salutation, vtiger_contactdetails.email, - vtiger_contactdetails.title,vtiger_contactdetails.mobile, - vtiger_account.accountname as account_name,vtiger_account.accountid as account_id, - vtiger_contactaddress.mailingcity, vtiger_contactaddress.mailingstreet, - vtiger_contactaddress.mailingcountry, vtiger_contactaddress.mailingstate, - vtiger_contactaddress.mailingzip, vtiger_contactaddress.othercity, - vtiger_contactaddress.otherstreet, vtiger_contactaddress.othercountry, - vtiger_contactaddress.otherstate, vtiger_contactaddress.otherzip - from vtiger_contactdetails + $query = "select vtiger_contactdetails.contactid as id, ".implode(',',$column_table_lists)." from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_account on vtiger_account.accountid=vtiger_contactdetails.accountid left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid - left join vtiger_contactsubdetails on vtiger_contactsubdetails.contactsubscriptionid = vtiger_contactdetails.contactid - where vtiger_users.user_name='" .$user_name ."' and vtiger_crmentity.deleted=0"; - - $log->debug("Exiting get_contactsforol method ..."); + left join vtiger_contactsubdetails on vtiger_contactsubdetails.contactsubscriptionid = vtiger_contactdetails.contactid + LEFT JOIN vtiger_contactgrouprelation ON vtiger_contactdetails.contactid = vtiger_contactgrouprelation.contactid + LEFT JOIN vtiger_groups ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname + where vtiger_crmentity.deleted=0 and vtiger_users.user_name='".$user_name."'"; + $log->debug("Exiting get_contactsforol method ..."); return $query; } + + //End } From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 04:30:32 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 08:30:32 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9141 - in /vtigercrm/trunk/soap: thunderbirdplugin.php vtigerolservice.php Message-ID: <20060828083033.770F975EC75@vtiger.fosslabs.com> Author: richie Date: Mon Aug 28 02:30:11 2006 New Revision: 9141 Log: Security Implemented for Outlook and Thunderbird Plugin --Jeri Modified: vtigercrm/trunk/soap/thunderbirdplugin.php vtigercrm/trunk/soap/vtigerolservice.php Modified: vtigercrm/trunk/soap/thunderbirdplugin.php ============================================================================== --- vtigercrm/trunk/soap/thunderbirdplugin.php (original) +++ vtigercrm/trunk/soap/thunderbirdplugin.php Mon Aug 28 02:30:11 2006 @@ -1,382 +1,395 @@ -configureWSDL('vtigersoap'); - -$server->register( - 'create_session', - array('user_name'=>'xsd:string','password'=>'xsd:string'), - array('return'=>'xsd:string'), - $NAMESPACE); - -$server->register( - 'end_session', - array('user_name'=>'xsd:string'), - array('return'=>'xsd:string'), - $NAMESPACE); - -$server->register( - 'SearchContactsByEmail', - array('username'=>'xsd:string','emailaddress'=>'xsd:string'), - array('return'=>'tns:contactdetails'), - $NAMESPACE); - -$server->register( - 'GetContacts', - array('username'=>'xsd:string'), - array('return'=>'tns:contactdetails'), - $NAMESPACE); - -$server->register( - 'AddContact', - array('user_name'=>'xsd:string', - 'first_name'=>'xsd:string', - 'last_name'=>'xsd:string', - 'email_address'=>'xsd:string', - 'account_name'=>'xsd:string', - 'salutation'=>'xsd:string', - 'title'=>'xsd:string', - 'phone_mobile'=>'xsd:string', - 'reports_to'=>'xsd:string', - 'primary_address_street'=>'xsd:string', - 'primary_address_city'=>'xsd:string', - 'primary_address_state'=>'xsd:string' , - 'primary_address_postalcode'=>'xsd:string', - 'primary_address_country'=>'xsd:string', - 'alt_address_city'=>'xsd:string', - 'alt_address_street'=>'xsd:string', - 'alt_address_state'=>'xsd:string', - 'alt_address_postalcode'=>'xsd:string', - 'alt_address_country'=>'xsd:string', - 'office_phone'=>'xsd:string', - 'home_phone'=>'xsd:string', - 'fax'=>'xsd:string', - 'department'=>'xsd:string', - 'description'=>'xsd:string'), - array('return'=>'xsd:string'), - $NAMESPACE); - - -$server->register( - 'track_email', - array('user_name'=>'xsd:string', 'contact_ids'=>'xsd:string', 'date_sent'=>'xsd:date', 'email_subject'=>'xsd:string', 'email_body'=>'xsd:string'), - array('return'=>'xsd:string'), - $NAMESPACE); - -$server->wsdl->addComplexType( - 'contactdetail', - 'complexType', - 'struct', - 'all', - '', - array( - 'id' => array('name'=>'id','type'=>'xsd:string'), - 'firstname' => array('name'=>'firstname','type'=>'xsd:string'), - 'lastname' => array('name'=>'lastname','type'=>'xsd:string'), - 'emailaddress' => array('name'=>'emailaddress','type'=>'xsd:string'), - 'accountname' => array('name'=>'accountname','type'=>'xsd:string'), - 'middlename' => array('name'=>'middlename','type'=>'xsd:string'), - 'birthdate'=> array('name'=>'birthdate','type'=>'xsd:string'), - 'jobtitle'=> array('name'=>'jobtitle','type'=>'xsd:string'), - 'department'=> array('name'=>'department','type'=>'xsd:string'), - 'title' => array('name'=>'title','type'=>'xsd:string'), - 'officephone'=> array('name'=>'officephone','type'=>'xsd:string'), - 'homephone'=> array('name'=>'homephone','type'=>'xsd:string'), - 'otherphone'=> array('name'=>'otherphone','type'=>'xsd:string'), - 'fax'=> array('name'=>'fax','type'=>'xsd:string'), - 'mobile'=> array('name'=>'mobile','type'=>'xsd:string'), - 'asstname'=> array('name'=>'asstname','type'=>'xsd:string'), - 'asstphone'=> array('name'=>'asstphone','type'=>'xsd:string'), - 'reportsto'=> array('name'=>'reportsto','type'=>'xsd:string'), - 'mailingstreet'=> array('name'=>'mailingstreet','type'=>'xsd:string'), - 'mailingcity'=> array('name'=>'mailingcity','type'=>'xsd:string'), - 'mailingstate'=> array('name'=>'mailingstate','type'=>'xsd:string'), - 'mailingzip'=> array('name'=>'mailingzip','type'=>'xsd:string'), - 'mailingcountry'=> array('name'=>'mailingcountry','type'=>'xsd:string'), - 'otherstreet'=> array('name'=>'otherstreet','type'=>'xsd:string'), - 'othercity'=> array('name'=>'othercity','type'=>'xsd:string'), - 'otherstate'=> array('name'=>'otherstate','type'=>'xsd:string'), - 'otherzip'=> array('name'=>'otherzip','type'=>'xsd:string'), - 'othercountry'=> array('name'=>'othercountry','type'=>'xsd:string'), - 'description'=> array('name'=>'description','type'=>'xsd:string'), - 'category'=> array('name'=>'category','type'=>'xsd:string'), - ) -); - -$server->wsdl->addComplexType( - 'contactdetails', - 'complexType', - 'array', - '', - 'SOAP-ENC:Array', - array(), - array( - array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:contactdetail[]') - ), - 'tns:contactdetail' -); - - -function SearchContactsByEmail($username,$emailaddress) -{ - require_once('modules/Contacts/Contact.php'); - - $seed_contact = new Contact(); - $output_list = Array(); - - $response = $seed_contact->get_searchbyemailid($username,$emailaddress); - $contactList = $response['list']; - - // create a return array of names and email addresses. - foreach($contactList as $contact) - { - $output_list[] = Array( - "id" => $contact[id], - "firstname" => $contact[first_name], - "lastname" => $contact[last_name], - "emailaddress" => $contact[email1], - "accountname" => $contact[account_name], - ); - } - - //to remove an erroneous compiler warning - $seed_contact = $seed_contact; - return $output_list; -} - -function track_email($user_name, $contact_ids, $date_sent, $email_subject, $email_body) -{ - global $adb; - require_once('modules/Users/User.php'); - require_once('modules/Emails/Email.php'); - - $seed_user = new User(); - $user_id = $seed_user->retrieve_user_id($user_name); - - $email = new Email(); - //$log->debug($msgdtls['contactid']); - $emailbody = str_replace("'", "''", $email_body); - $emailsubject = str_replace("'", "''",$email_subject); - $datesent = getDisplayDate($date_sent); - - $email->column_fields[subject] = $emailsubject; - $email->column_fields[assigned_user_id] = $user_id; - $email->column_fields[date_start] = $datesent; - $email->column_fields[description] = htmlentities($emailbody); - $email->column_fields[activitytype] = 'Emails'; - $email->save("Emails"); - - $email->set_emails_contact_invitee_relationship($email->id,$contact_ids); - $email->set_emails_se_invitee_relationship($email->id,$contact_ids); - $email->set_emails_user_invitee_relationship($email->id,$user_id); - $sql = "select email from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid where vtiger_crmentity.deleted =0 and vtiger_contactdetails.contactid='".$contact_ids."'"; - $result = $adb->query($sql); - $camodulerow = $adb->fetch_array($result); - if(isset($camodulerow)) - { - $emailid = $camodulerow["email"]; - $query = 'insert into vtiger_emaildetails values ('.$email->id.',"","'.$emailid.'","","","","'.$contact_ids."@77|".'","OUTLOOK")'; - $adb->query($query); - } - return $email->id; -} - - -function GetContacts($username) -{ - global $adb; - global $log; - require_once('modules/Contacts/Contact.php'); - - $seed_contact = new Contact(); - $output_list = Array(); - - $query = $seed_contact->get_contactsforol($username); - $result = $adb->query($query); - - while($contact = $adb->fetch_array($result)) - { - if($contact["birthdate"] == "0000-00-00") - { - $contact["birthdate"] = ""; - } - if($contact["salutation"] == "--None--") - { - $contact["salutation"] = ""; - } - - $namelist = explode(" ", $contact["last_name"]); - if(isset($namelist)) - { - if(count($namelist) >= 2) - { - $contact["last_name"] = $namelist[count($namelist)-1]; - for($i=0; $i $contact["id"], - "title" => $contact["salutation"], - "firstname" => $contact["first_name"], - "middlename" => trim($middlename), - "lastname" => trim($contact["last_name"]), - "birthdate" => $contact["birthdate"], - "emailaddress" => $contact["email"], - "jobtitle" => $contact["title"], - "department" => $contact["department"], - "accountname" => $contact["account_name"], - "officephone" => $contact["phone"], - "homephone" => $contact["homephone"], - "otherphone" => $contact["otherphone"], - "fax" => $contact["fax"], - "mobile" => $contact["mobile"], - "asstname" => $contact["assistant_name"], - "asstphone" => $contact["assistantphone"], - "reportsto" => $contact["reports_to_name"], - "mailingstreet" => $contact["mailingstreet"], - "mailingcity" => $contact["mailingcity"], - "mailingstate" => $contact["mailingstate"], - "mailingzip" => $contact["mailingzip"], - "mailingcountry" => $contact["mailingcountry"], - "otherstreet" => $contact["otherstreet"], - "othercity" => $contact["othercity"], - "otherstate" => $contact["otherstate"], - "otherzip" => $contact["otherzip"], - "othercountry" => $contact["othercountry"], - "description" => "", - "category" => "", - ); - } - $log->debug("*******************"); - $log->fatal($output_list); - - //to remove an erroneous compiler warning - $seed_contact = $seed_contact; - return $output_list; -} - -function retrieve_account_id($account_name,$user_id) -{ - - if($account_name=="") - { - return null; - } - - $query = "select vtiger_account.accountname accountname,vtiger_account.accountid accountid from vtiger_account inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_account.accountid where vtiger_crmentity.deleted=0 and vtiger_account.accountname='" .$account_name."'"; - - - $db = new PearDatabase(); - $result= $db->query($query) or die ("Not able to execute insert"); - - $rows_count = $db->getRowCount($result); - if($rows_count==0) - { - require_once('modules/Accounts/Account.php'); - $account = new Account(); - $account->column_fields[accountname] = $account_name; - $account->column_fields[assigned_user_id]=$user_id; - //$account->saveentity("Accounts"); - $account->save("Accounts"); - //mysql_close(); - return $account->id; - } - else if ($rows_count==1) - { - $row = $db->fetchByAssoc($result, 0); - //mysql_close(); - return $row["accountid"]; - } - else - { - $row = $db->fetchByAssoc($result, 0); - //mysql_close(); - return $row["accountid"]; - } - -} - -function AddContact($user_name, $first_name, $last_name, $email_address ,$account_name , $salutation , $title, $phone_mobile, $reports_to,$primary_address_street,$primary_address_city,$primary_address_state,$primary_address_postalcode,$primary_address_country,$alt_address_city,$alt_address_street,$alt_address_state,$alt_address_postalcode,$alt_address_country,$office_phone="",$home_phone="",$fax="",$department="",$description="") -{ - global $adb; - global $current_user; - require_once('modules/Users/User.php'); - require_once('modules/Contacts/Contact.php'); - - $seed_user = new User(); - $user_id = $seed_user->retrieve_user_id($user_name); - $current_user = $seed_user; - $current_user->retrieve_entity_info($user_id,"Users"); - - $contact = new Contact(); - $contact->column_fields[firstname]=$first_name; - $contact->column_fields[lastname]=$last_name; - $contact->column_fields[birthday]= getDisplayDate("0000-00-00"); - $contact->column_fields[email]=$email_address; - $contact->column_fields[title]=$title; - $contact->column_fields[department]=$department; - $contact->column_fields[account_id]= retrieve_account_id($account_name,$user_id); - $contact->column_fields[phone]= $office_phone; - $contact->column_fields[homephone]= $home_phone; - $contact->column_fields[fax]= $fax; - $contact->column_fields[mobile]=$phone_mobile; - $contact->column_fields[mailingstreet]=$primary_address_street; - $contact->column_fields[mailingcity]=$primary_address_city; - $contact->column_fields[mailingstate]=$primary_address_state; - $contact->column_fields[mailingzip]=$primary_address_postalcode; - $contact->column_fields[mailingcountry]=$primary_address_country; - $contact->column_fields[otherstreet]=$alt_address_street; - $contact->column_fields[othercity]=$alt_address_city; - $contact->column_fields[otherstate]=$alt_address_state; - $contact->column_fields[otherzip]=$alt_address_postalcode; - $contact->column_fields[othercountry]=$alt_address_country; - $contact->column_fields[assigned_user_id]=$user_id; - $contact->column_fields[description]= ""; - $contact->save("Contacts"); - - $contact = $contact; - return $contact->id; -} - -function create_session($user_name, $password) -{ - return "TempSessionID"; -} - -function end_session($user_name) -{ - return "Success"; -} - - -$server->service($HTTP_RAW_POST_DATA); -exit(); -?> +configureWSDL('vtigersoap'); + +$server->register( + 'create_session', + array('user_name'=>'xsd:string','password'=>'xsd:string'), + array('return'=>'xsd:string'), + $NAMESPACE); + +$server->register( + 'end_session', + array('user_name'=>'xsd:string'), + array('return'=>'xsd:string'), + $NAMESPACE); + +$server->register( + 'SearchContactsByEmail', + array('username'=>'xsd:string','emailaddress'=>'xsd:string'), + array('return'=>'tns:contactdetails'), + $NAMESPACE); + +$server->register( + 'GetContacts', + array('username'=>'xsd:string'), + array('return'=>'tns:contactdetails'), + $NAMESPACE); + +$server->register( + 'AddContact', + array('user_name'=>'xsd:string', + 'first_name'=>'xsd:string', + 'last_name'=>'xsd:string', + 'email_address'=>'xsd:string', + 'account_name'=>'xsd:string', + 'salutation'=>'xsd:string', + 'title'=>'xsd:string', + 'phone_mobile'=>'xsd:string', + 'reports_to'=>'xsd:string', + 'primary_address_street'=>'xsd:string', + 'primary_address_city'=>'xsd:string', + 'primary_address_state'=>'xsd:string' , + 'primary_address_postalcode'=>'xsd:string', + 'primary_address_country'=>'xsd:string', + 'alt_address_city'=>'xsd:string', + 'alt_address_street'=>'xsd:string', + 'alt_address_state'=>'xsd:string', + 'alt_address_postalcode'=>'xsd:string', + 'alt_address_country'=>'xsd:string', + 'office_phone'=>'xsd:string', + 'home_phone'=>'xsd:string', + 'fax'=>'xsd:string', + 'department'=>'xsd:string', + 'description'=>'xsd:string'), + array('return'=>'xsd:string'), + $NAMESPACE); + + +$server->register( + 'track_email', + array('user_name'=>'xsd:string', 'contact_ids'=>'xsd:string', 'date_sent'=>'xsd:date', 'email_subject'=>'xsd:string', 'email_body'=>'xsd:string'), + array('return'=>'xsd:string'), + $NAMESPACE); + +$server->wsdl->addComplexType( + 'contactdetail', + 'complexType', + 'struct', + 'all', + '', + array( + 'id' => array('name'=>'id','type'=>'xsd:string'), + 'firstname' => array('name'=>'firstname','type'=>'xsd:string'), + 'lastname' => array('name'=>'lastname','type'=>'xsd:string'), + 'emailaddress' => array('name'=>'emailaddress','type'=>'xsd:string'), + 'accountname' => array('name'=>'accountname','type'=>'xsd:string'), + 'middlename' => array('name'=>'middlename','type'=>'xsd:string'), + 'birthdate'=> array('name'=>'birthdate','type'=>'xsd:string'), + 'jobtitle'=> array('name'=>'jobtitle','type'=>'xsd:string'), + 'department'=> array('name'=>'department','type'=>'xsd:string'), + 'title' => array('name'=>'title','type'=>'xsd:string'), + 'officephone'=> array('name'=>'officephone','type'=>'xsd:string'), + 'homephone'=> array('name'=>'homephone','type'=>'xsd:string'), + 'otherphone'=> array('name'=>'otherphone','type'=>'xsd:string'), + 'fax'=> array('name'=>'fax','type'=>'xsd:string'), + 'mobile'=> array('name'=>'mobile','type'=>'xsd:string'), + 'asstname'=> array('name'=>'asstname','type'=>'xsd:string'), + 'asstphone'=> array('name'=>'asstphone','type'=>'xsd:string'), + 'reportsto'=> array('name'=>'reportsto','type'=>'xsd:string'), + 'mailingstreet'=> array('name'=>'mailingstreet','type'=>'xsd:string'), + 'mailingcity'=> array('name'=>'mailingcity','type'=>'xsd:string'), + 'mailingstate'=> array('name'=>'mailingstate','type'=>'xsd:string'), + 'mailingzip'=> array('name'=>'mailingzip','type'=>'xsd:string'), + 'mailingcountry'=> array('name'=>'mailingcountry','type'=>'xsd:string'), + 'otherstreet'=> array('name'=>'otherstreet','type'=>'xsd:string'), + 'othercity'=> array('name'=>'othercity','type'=>'xsd:string'), + 'otherstate'=> array('name'=>'otherstate','type'=>'xsd:string'), + 'otherzip'=> array('name'=>'otherzip','type'=>'xsd:string'), + 'othercountry'=> array('name'=>'othercountry','type'=>'xsd:string'), + 'description'=> array('name'=>'description','type'=>'xsd:string'), + 'category'=> array('name'=>'category','type'=>'xsd:string'), + ) +); + +$server->wsdl->addComplexType( + 'contactdetails', + 'complexType', + 'array', + '', + 'SOAP-ENC:Array', + array(), + array( + array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:contactdetail[]') + ), + 'tns:contactdetail' +); + + +function SearchContactsByEmail($username,$emailaddress) +{ + require_once('modules/Contacts/Contact.php'); + + $seed_contact = new Contact(); + $output_list = Array(); + + $response = $seed_contact->get_searchbyemailid($username,$emailaddress); + $contactList = $response['list']; + + // create a return array of names and email addresses. + foreach($contactList as $contact) + { + $output_list[] = Array( + "id" => $contact[contactid], + "firstname" => $contact[firstname], + "lastname" => $contact[lastname], + "emailaddress" => $contact[email], + "accountname" => $contact[accountname], + ); + } + + //to remove an erroneous compiler warning + $seed_contact = $seed_contact; + return $output_list; +} + +function track_email($user_name, $contact_ids, $date_sent, $email_subject, $email_body) +{ + global $adb; + require_once('modules/Users/User.php'); + require_once('modules/Emails/Email.php'); + + $seed_user = new User(); + $user_id = $seed_user->retrieve_user_id($user_name); + + $email = new Email(); + //$log->debug($msgdtls['contactid']); + $emailbody = str_replace("'", "''", $email_body); + $emailsubject = str_replace("'", "''",$email_subject); + $datesent = getDisplayDate($date_sent); + + $email->column_fields[subject] = $emailsubject; + $email->column_fields[assigned_user_id] = $user_id; + $email->column_fields[date_start] = $datesent; + $email->column_fields[description] = htmlentities($emailbody); + $email->column_fields[activitytype] = 'Emails'; + $email->save("Emails"); + + $email->set_emails_contact_invitee_relationship($email->id,$contact_ids); + $email->set_emails_se_invitee_relationship($email->id,$contact_ids); + $email->set_emails_user_invitee_relationship($email->id,$user_id); + $sql = "select email from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid where vtiger_crmentity.deleted =0 and vtiger_contactdetails.contactid='".$contact_ids."'"; + $result = $adb->query($sql); + $camodulerow = $adb->fetch_array($result); + if(isset($camodulerow)) + { + $emailid = $camodulerow["email"]; + $query = 'insert into vtiger_emaildetails values ('.$email->id.',"","'.$emailid.'","","","","'.$contact_ids."@77|".'","OUTLOOK")'; + $adb->query($query); + } + return $email->id; +} + + +function GetContacts($username) +{ + global $adb; + global $log; + require_once('modules/Contacts/Contact.php'); + + $seed_contact = new Contact(); + $output_list = Array(); + + $query = $seed_contact->get_contactsforol($username); + $result = $adb->query($query); + + while($contact = $adb->fetch_array($result)) + { + if($contact["birthdate"] == "0000-00-00") + { + $contact["birthdate"] = ""; + } + if($contact["salutation"] == "--None--") + { + $contact["salutation"] = ""; + } + + $namelist = explode(" ", $contact["lastname"]); + if(isset($namelist)) + { + if(count($namelist) >= 2) + { + $contact["lastname"] = $namelist[count($namelist)-1]; + for($i=0; $i $contact["id"], + "title" => $contact["salutation"], + "firstname" => $contact["firstname"], + "middlename" => trim($middlename), + "lastname" => trim($contact["lastname"]), + "birthdate" => $contact["birthday"], + "emailaddress" => $contact["email"], + "jobtitle" => $contact["title"], + "department" => $contact["department"], + "accountname" => $contact["accountname"], + "officephone" => $contact["phone"], + "homephone" => $contact["homephone"], + "otherphone" => $contact["otherphone"], + "fax" => $contact["fax"], + "mobile" => $contact["mobile"], + "asstname" => $contact["assistant"], + "asstphone" => $contact["assistantphone"], + "reportsto" => $contact["reports_to_name"], + "mailingstreet" => $contact["mailingstreet"], + "mailingcity" => $contact["mailingcity"], + "mailingstate" => $contact["mailingstate"], + "mailingzip" => $contact["mailingzip"], + "mailingcountry" => $contact["mailingcountry"], + "otherstreet" => $contact["otherstreet"], + "othercity" => $contact["othercity"], + "otherstate" => $contact["otherstate"], + "otherzip" => $contact["otherzip"], + "othercountry" => $contact["othercountry"], + "description" => "", + "category" => "", + ); + } + //to remove an erroneous compiler warning + $seed_contact = $seed_contact; + return $output_list; +} + +function retrieve_account_id($account_name,$user_id) +{ + + if($account_name=="") + { + return null; + } + + $query = "select vtiger_account.accountname accountname,vtiger_account.accountid accountid from vtiger_account inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_account.accountid where vtiger_crmentity.deleted=0 and vtiger_account.accountname='" .$account_name."'"; + + + $db = new PearDatabase(); + $result= $db->query($query) or die ("Not able to execute insert"); + + $rows_count = $db->getRowCount($result); + if($rows_count==0) + { + require_once('modules/Accounts/Account.php'); + $account = new Account(); + $account->column_fields[accountname] = $account_name; + $account->column_fields[assigned_user_id]=$user_id; + //$account->saveentity("Accounts"); + $account->save("Accounts"); + //mysql_close(); + return $account->id; + } + else if ($rows_count==1) + { + $row = $db->fetchByAssoc($result, 0); + //mysql_close(); + return $row["accountid"]; + } + else + { + $row = $db->fetchByAssoc($result, 0); + //mysql_close(); + return $row["accountid"]; + } + +} + +function AddContact($user_name, $first_name, $last_name, $email_address ,$account_name , $salutation , $title, $phone_mobile, $reports_to,$primary_address_street,$primary_address_city,$primary_address_state,$primary_address_postalcode,$primary_address_country,$alt_address_city,$alt_address_street,$alt_address_state,$alt_address_postalcode,$alt_address_country,$office_phone="",$home_phone="",$fax="",$department="",$description="") +{ + global $adb; + global $current_user; + require_once('modules/Users/User.php'); + require_once('modules/Contacts/Contact.php'); + + $seed_user = new User(); + $user_id = $seed_user->retrieve_user_id($user_name); + $current_user = $seed_user; + $current_user->retrieve_entity_info($user_id,"Users"); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select fieldname,columnname from vtiger_field where tabid=4 and block <> 75 and block <> 6 and block <> 5"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldname,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=4 and vtiger_field.block <> 75 and vtiger_field.block <> 6 and vtiger_field.block <> 5 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $adb->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_lists[] = $adb->query_result($result1,$i,'fieldname'); + } + + $contact = new Contact(); + $contact->column_fields[firstname]=in_array('salutation',$permitted_lists) ? $first_name : ""; + $contact->column_fields[lastname]=in_array('lastname',$permitted_lists) ? $last_name : ""; + $contact->column_fields[birthday]=in_array('birthday',$permitted_lists) ? getDisplayDate("0000-00-00") : ""; + $contact->column_fields[email]=in_array('email',$permitted_lists) ? $email_address : ""; + $contact->column_fields[title]=in_array('title',$permitted_lists) ? $title : ""; + $contact->column_fields[department]=in_array('department',$permitted_lists) ? $department : ""; + $contact->column_fields[account_id]=in_array('account_id',$permitted_lists) ? retrieve_account_id($account_name,$user_id) : ""; + $contact->column_fields[phone]=in_array('phone',$permitted_lists) ? $office_phone : ""; + $contact->column_fields[homephone]=in_array('homephone',$permitted_lists) ? $home_phone : ""; + $contact->column_fields[fax]=in_array('fax',$permitted_lists) ? $fax : ""; + $contact->column_fields[mobile]=in_array('mobile',$permitted_lists) ? $phone_mobile : ""; + $contact->column_fields[mailingstreet]=in_array('mailingstreet',$permitted_lists) ? $primary_address_street : ""; + $contact->column_fields[mailingcity]=in_array('mailingcity',$permitted_lists) ? $primary_address_city : ""; + $contact->column_fields[mailingstate]=in_array('mailingstate',$permitted_lists) ? $primary_address_state : ""; + $contact->column_fields[mailingzip]=in_array('mailingzip',$permitted_lists) ? $primary_address_postalcode : ""; + $contact->column_fields[mailingcountry]=in_array('mailingcountry',$permitted_lists) ? $primary_address_country : ""; + $contact->column_fields[otherstreet]=in_array('otherstreet',$permitted_lists) ? $alt_address_street : ""; + $contact->column_fields[othercity]=in_array('othercity',$permitted_lists) ? $alt_address_city : ""; + $contact->column_fields[otherstate]=in_array('otherstate',$permitted_lists) ? $alt_address_state : ""; + $contact->column_fields[otherzip]=in_array('otherzip',$permitted_lists) ? $alt_address_postalcode : ""; + $contact->column_fields[othercountry]=in_array('othercountry',$permitted_lists) ? $alt_address_country : ""; + $contact->column_fields[assigned_user_id]=in_array('assigned_user_id',$permitted_lists) ? $user_id : ""; + $contact->column_fields[description]= ""; + $contact->save("Contacts"); + + $contact = $contact; + return $contact->id; +} + +function create_session($user_name, $password) +{ + return "TempSessionID"; +} + +function end_session($user_name) +{ + return "Success"; +} + + +$server->service($HTTP_RAW_POST_DATA); +exit(); +?> Modified: vtigercrm/trunk/soap/vtigerolservice.php ============================================================================== --- vtigercrm/trunk/soap/vtigerolservice.php (original) +++ vtigercrm/trunk/soap/vtigerolservice.php Mon Aug 28 02:30:11 2006 @@ -292,11 +292,11 @@ foreach($contactList as $contact) { $output_list[] = Array( - "id" => $contact[id], - "firstname" => $contact[first_name], - "lastname" => $contact[last_name], - "accountname" => $contact[account_name], - "emailaddress" => $contact[email1], + "id" => $contact[contactid], + "firstname" => $contact[firstname], + "lastname" => $contact[lastname], + "accountname" => $contact[accountname], + "emailaddress" => $contact[email], ); } @@ -316,35 +316,35 @@ foreach($msgdtls as $msgdtl) { - if(isset($msgdtl)) - { - $email = new Email(); - //$log->debug($msgdtls['contactid']); - $email_body = str_replace("'", "''", $msgdtl['body']); - $email_subject = str_replace("'", "''",$msgdtl['subject']); - $date_sent = getDisplayDate($msgdtl['datesent']); - - $email->column_fields[subject] = $email_subject; - $email->column_fields[assigned_user_id] = $user_id; - $email->column_fields[date_start] = $date_sent; - $email->column_fields[description] = htmlentities($email_body); - $email->column_fields[activitytype] = 'Emails'; - $email->plugin_save = true; - $email->save("Emails"); - - $email->set_emails_contact_invitee_relationship($email->id,$contactid); - $email->set_emails_se_invitee_relationship($email->id,$contactid); - $email->set_emails_user_invitee_relationship($email->id,$user_id); - $sql = "select email from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid where vtiger_crmentity.deleted =0 and vtiger_contactdetails.contactid='".$contactid."'"; - $result = $adb->query($sql); - $camodulerow = $adb->fetch_array($result); - if(isset($camodulerow)) - { - $emailid = $camodulerow["email"]; - $query = 'insert into vtiger_emaildetails values ('.$email->id.',"","'.$emailid.'","","","","'.$contactid."@77|".'","OUTLOOK")'; - $adb->query($query); - } - return $email->id; + if(isset($msgdtl)) + { + $email = new Email(); + //$log->debug($msgdtls['contactid']); + $email_body = str_replace("'", "''", $msgdtl['body']); + $email_subject = str_replace("'", "''",$msgdtl['subject']); + $date_sent = getDisplayDate($msgdtl['datesent']); + + $email->column_fields[subject] = $email_subject; + $email->column_fields[assigned_user_id] = $user_id; + $email->column_fields[date_start] = $date_sent; + $email->column_fields[description] = htmlentities($email_body); + $email->column_fields[activitytype] = 'Emails'; + $email->plugin_save = true; + $email->save("Emails"); + + $email->set_emails_contact_invitee_relationship($email->id,$contactid); + $email->set_emails_se_invitee_relationship($email->id,$contactid); + $email->set_emails_user_invitee_relationship($email->id,$user_id); + $sql = "select email from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid where vtiger_crmentity.deleted =0 and vtiger_contactdetails.contactid='".$contactid."'"; + $result = $adb->query($sql); + $camodulerow = $adb->fetch_array($result); + if(isset($camodulerow)) + { + $emailid = $camodulerow["email"]; + $query = 'insert into vtiger_emaildetails values ('.$email->id.',"","'.$emailid.'","","","","'.$contactid."@77|".'","OUTLOOK")'; + $adb->query($query); + } + return $email->id; } else { @@ -409,7 +409,7 @@ $current_user=$seed_user; $current_user->retrieve_entity_info($user_id, 'Users'); - if(isPermitted("Contacts","EditView") == "yes") + if(isPermitted("Contacts","Delete") == "yes") { return "allowed"; }else @@ -427,7 +427,7 @@ $current_user=$seed_user; $current_user->retrieve_entity_info($user_id, 'Users'); - if(isPermitted("Calendar","EditView") == "yes") + if(isPermitted("Calendar","Delete") == "yes") { return "allowed"; }else @@ -502,12 +502,12 @@ $contact["salutation"] = ""; } - $namelist = explode(" ", $contact["last_name"]); + $namelist = explode(" ", $contact["lastname"]); if(isset($namelist)) { if(count($namelist) >= 2) { - $contact["last_name"] = $namelist[count($namelist)-1]; + $contact["lastname"] = $namelist[count($namelist)-1]; for($i=0; $i $contact["id"], "title" => $contact["salutation"], - "firstname" => $contact["first_name"], + "firstname" => $contact["firstname"], "middlename" => trim($middlename), - "lastname" => trim($contact["last_name"]), - "birthdate" => $contact["birthdate"], + "lastname" => trim($contact["lastname"]), + "birthdate" => $contact["birthday"], "emailaddress" => $contact["email"], "jobtitle" => $contact["title"], "department" => $contact["department"], - "accountname" => $contact["account_name"], + "accountname" => $contact["accountname"], "officephone" => $contact["phone"], "homephone" => $contact["homephone"], "otherphone" => $contact["otherphone"], "fax" => $contact["fax"], "mobile" => $contact["mobile"], - "asstname" => $contact["assistant_name"], + "asstname" => $contact["assistant"], "asstphone" => $contact["assistantphone"], "reportsto" => $contact["reports_to_name"], "mailingstreet" => $contact["mailingstreet"], @@ -550,7 +550,7 @@ "othercountry" => $contact["othercountry"], "description" => "", "category" => "", - ); + ); } //to remove an erroneous compiler warning @@ -572,48 +572,69 @@ $contact = new Contact(); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select fieldname,columnname from vtiger_field where tabid=4 and block <> 75 and block <> 6 and block <> 5"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldname,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=4 and vtiger_field.block <> 75 and vtiger_field.block <> 6 and vtiger_field.block <> 5 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $adb->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_lists[] = $adb->query_result($result1,$i,'fieldname'); + } + foreach($cntdtls as $cntrow) { if(isset($cntrow)) { - $contact->column_fields[salutation]=$cntrow["title"]; - $contact->column_fields[firstname]=$cntrow["firstname"]; - - if($cntrow["middlename"] != "") - { - $contact->column_fields[lastname]=$cntrow["middlename"]." ".$cntrow["lastname"]; - }else - { - $contact->column_fields[lastname]=$cntrow["lastname"]; - } - - $contact->column_fields[birthday]= getDisplayDate($cntrow["birthdate"]); - $contact->column_fields[email]=$cntrow["emailaddress"]; - $contact->column_fields[title]=$cntrow["jobtitle"]; - $contact->column_fields[department]=$cntrow["department"]; - $contact->column_fields[account_id]= retrieve_account_id($cntrow["accountname"],$user_id); - $contact->column_fields[phone]= $cntrow["officephone"]; - $contact->column_fields[homephone]= $cntrow["homephone"]; - $contact->column_fields[otherphone]= $cntrow["otherphone"]; - $contact->column_fields[fax]= $cntrow["fax"]; - $contact->column_fields[mobile]=$cntrow["mobile"]; - $contact->column_fields[assistant]= $cntrow["asstname"]; - $contact->column_fields[assistantphone]= $cntrow["asstphone"]; - //$contact->column_fields[reports_to_id] =retrievereportsto($reportsto,$user_id,$account_id);// NOT FIXED IN SAVEENTITY.PHP - $contact->column_fields[mailingstreet]=$cntrow["mailingstreet"]; - $contact->column_fields[mailingcity]=$cntrow["mailingcity"]; - $contact->column_fields[mailingstate]=$cntrow["mailingstate"]; - $contact->column_fields[mailingzip]=$cntrow["mailingzip"]; - $contact->column_fields[mailingcountry]=$cntrow["mailingcountry"]; - $contact->column_fields[otherstreet]=$cntrow["otherstreet"]; - $contact->column_fields[othercity]=$cntrow["othercity"]; - $contact->column_fields[otherstate]=$cntrow["otherstate"]; - $contact->column_fields[otherzip]=$cntrow["otherzip"]; - $contact->column_fields[othercountry]=$cntrow["othercountry"]; - $contact->column_fields[assigned_user_id]=$user_id; - $contact->column_fields[description]= $cntrow["description"]; - $contact->save("Contacts"); - } + $contact->column_fields[salutation]=in_array('salutation',$permitted_lists) ? $cntrow["title"] : ""; + $contact->column_fields[firstname]=in_array('firstname',$permitted_lists) ? $cntrow["firstname"] : ""; + + if($cntrow["middlename"] != "") + { + $contact->column_fields[lastname]=$cntrow["middlename"]." ".$cntrow["lastname"]; + }elseif($cntrow["middlename"] != "") + { + $contact->column_fields[lastname]=$cntrow["lastname"]; + }else + { + $contact->column_fields[lastname]=$cntrow["firstname"]." ".$cntrow["middlename"]." ".$cntrow["lastname"]; + } + + $contact->column_fields[birthday]= in_array('birthday',$permitted_lists) ? getDisplayDate($cntrow["birthdate"]) : ""; + $contact->column_fields[email]=in_array('email',$permitted_lists) ? $cntrow["emailaddress"] : ""; + $contact->column_fields[title]=in_array('title',$permitted_lists) ? $cntrow["jobtitle"] : ""; + $contact->column_fields[department]=in_array('department',$permitted_lists) ? $cntrow["department"] : ""; + $contact->column_fields[account_id]= in_array('account_id',$permitted_lists) ? retrieve_account_id($cntrow["accountname"],$user_id) : ""; + $contact->column_fields[phone]= in_array('phone',$permitted_lists) ? $cntrow["officephone"] : ""; + $contact->column_fields[homephone]= in_array('homephone',$permitted_lists) ? $cntrow["homephone"] : ""; + $contact->column_fields[otherphone]= in_array('otherphone',$permitted_lists) ? $cntrow["otherphone"] : ""; + $contact->column_fields[fax]= in_array('fax',$permitted_lists) ? $cntrow["fax"] : ""; + $contact->column_fields[mobile]=in_array('mobile',$permitted_lists) ? $cntrow["mobile"] : ""; + $contact->column_fields[assistant]= in_array('assistant',$permitted_lists) ? $cntrow["asstname"] : ""; + $contact->column_fields[assistantphone]= in_array('assistantphone',$permitted_lists) ? $cntrow["asstphone"] : ""; + //$contact->column_fields[reports_to_id] =retrievereportsto($reportsto,$user_id,$account_id);// NOT FIXED IN SAVEENTITY.PHP + $contact->column_fields[mailingstreet]=in_array('mailingstreet',$permitted_lists) ? $cntrow["mailingstreet"] : ""; + $contact->column_fields[mailingcity]=in_array('mailingcity',$permitted_lists) ? $cntrow["mailingcity"] : ""; + $contact->column_fields[mailingstate]=in_array('mailingstate',$permitted_lists) ? $cntrow["mailingstate"] : ""; + $contact->column_fields[mailingzip]=in_array('mailingzip',$permitted_lists) ? $cntrow["mailingzip"] : ""; + $contact->column_fields[mailingcountry]=in_array('mailingcountry',$permitted_lists) ? $cntrow["mailingcountry"] : ""; + $contact->column_fields[otherstreet]=in_array('otherstreet',$permitted_lists) ? $cntrow["otherstreet"] : ""; + $contact->column_fields[othercity]=in_array('othercity',$permitted_lists) ? $cntrow["othercity"] : ""; + $contact->column_fields[otherstate]=in_array('otherstate',$permitted_lists) ? $cntrow["otherstate"] : ""; + $contact->column_fields[otherzip]=in_array('otherzip',$permitted_lists) ? $cntrow["otherzip"] : ""; + $contact->column_fields[othercountry]=in_array('othercountry',$permitted_lists) ? $cntrow["othercountry"] : ""; + $contact->column_fields[assigned_user_id]=in_array('assigned_user_id',$permitted_lists) ? $user_id : ""; + $contact->column_fields[description]= in_array('description',$permitted_lists) ? $cntrow["description"] : ""; + $contact->save("Contacts"); + + } } $contact = $contact; return $contact->id; @@ -632,46 +653,66 @@ $current_user->retrieve_entity_info($user_id,"Users"); $contact = new Contact(); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select fieldname,columnname from vtiger_field where tabid=4 and block <> 75 and block <> 6 and block <> 5"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldname,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=4 and vtiger_field.block <> 75 and vtiger_field.block <> 6 and vtiger_field.block <> 5 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $adb->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_lists[] = $adb->query_result($result1,$i,'fieldname'); + } foreach($cntdtls as $cntrow) { if(isset($cntrow)) { $contact->retrieve_entity_info($cntrow["id"],"Contacts"); - $contact->column_fields[salutation]=$cntrow["title"]; - $contact->column_fields[firstname]=$cntrow["firstname"]; + $contact->column_fields[salutation]=in_array('salutation',$permitted_lists) ? $cntrow["title"] : ""; + $contact->column_fields[firstname]=in_array('firstname',$permitted_lists) ? $cntrow["firstname"] : ""; if($cntrow["middlename"] != "") { $contact->column_fields[lastname]=$cntrow["middlename"]." ".$cntrow["lastname"]; + }elseif($cntrow["lastname"] != "") + { + $contact->column_fields[lastname]=$cntrow["lastname"]; }else { - $contact->column_fields[lastname]=$cntrow["lastname"]; - } - $contact->column_fields[birthday]= getDisplayDate($cntrow["birthdate"]); - $contact->column_fields[email]=$cntrow["emailaddress"]; - $contact->column_fields[title]=$cntrow["jobtitle"]; - $contact->column_fields[department]=$cntrow["department"]; - $contact->column_fields[account_id]= retrieve_account_id($cntrow["accountname"],$user_id); - $contact->column_fields[phone]= $cntrow["officephone"]; - $contact->column_fields[homephone]= $cntrow["homephone"]; - $contact->column_fields[otherphone]= $cntrow["otherphone"]; - $contact->column_fields[fax]= $cntrow["fax"]; - $contact->column_fields[mobile]=$cntrow["mobile"]; - $contact->column_fields[assistant]= $cntrow["asstname"]; - $contact->column_fields[assistantphone]= $cntrow["asstphone"]; + $contact->column_fields[lastname]=$cntrow["firstname"]." ".$cntrow["middlename"]." ".$cntrow["lastname"]; + } + + $contact->column_fields[birthday]= in_array('birthday',$permitted_lists) ? getDisplayDate($cntrow["birthdate"]) : ""; + $contact->column_fields[email]= in_array('email',$permitted_lists) ? $cntrow["emailaddress"] : ""; + $contact->column_fields[title]= in_array('title',$permitted_lists) ? $cntrow["jobtitle"] : ""; + $contact->column_fields[department]= in_array('department',$permitted_lists) ? $cntrow["department"] : ""; + $contact->column_fields[account_id]= in_array('account_id',$permitted_lists) ? retrieve_account_id($cntrow["accountname"],$user_id) : ""; + $contact->column_fields[phone]= in_array('phone',$permitted_lists) ? $cntrow["officephone"] : ""; + $contact->column_fields[homephone]= in_array('homephone',$permitted_lists) ? $cntrow["homephone"] : ""; + $contact->column_fields[otherphone]= in_array('otherphone',$permitted_lists) ? $cntrow["otherphone"] : ""; + $contact->column_fields[fax]= in_array('fax',$permitted_lists) ? $cntrow["fax"] : ""; + $contact->column_fields[mobile]= in_array('mobile',$permitted_lists) ? $cntrow["mobile"] : ""; + $contact->column_fields[assistant]= in_array('assistant',$permitted_lists) ? $cntrow["asstname"] : ""; + $contact->column_fields[assistantphone]= in_array('assistantphone',$permitted_lists) ? $cntrow["asstphone"] : ""; //$contact->column_fields[reports_to_id] =retrievereportsto($reportsto,$user_id,$account_id);// NOT FIXED IN SAVEENTITY.PHP - $contact->column_fields[mailingstreet]=$cntrow["mailingstreet"]; - $contact->column_fields[mailingcity]=$cntrow["mailingcity"]; - $contact->column_fields[mailingstate]=$cntrow["mailingstate"]; - $contact->column_fields[mailingzip]=$cntrow["mailingzip"]; - $contact->column_fields[mailingcountry]=$cntrow["mailingcountry"]; - $contact->column_fields[otherstreet]=$cntrow["otherstreet"]; - $contact->column_fields[othercity]=$cntrow["othercity"]; - $contact->column_fields[otherstate]=$cntrow["otherstate"]; - $contact->column_fields[otherzip]=$cntrow["otherzip"]; - $contact->column_fields[othercountry]=$cntrow["othercountry"]; - $contact->column_fields[assigned_user_id]=$user_id; - $contact->column_fields[description]= $cntrow["description"]; + $contact->column_fields[mailingstreet]= in_array('mailingstreet',$permitted_lists) ? $cntrow["mailingstreet"] : ""; + $contact->column_fields[mailingcity]= in_array('mailingcity',$permitted_lists) ? $cntrow["mailingcity"] : ""; + $contact->column_fields[mailingstate]= in_array('mailingstate',$permitted_lists) ? $cntrow["mailingstate"] : ""; + $contact->column_fields[mailingzip]= in_array('mailingzip',$permitted_lists) ? $cntrow["mailingzip"] : ""; + $contact->column_fields[mailingcountry]= in_array('mailingcountry',$permitted_lists) ? $cntrow["mailingcountry"] : ""; + $contact->column_fields[otherstreet]= in_array('otherstreet',$permitted_lists) ? $cntrow["otherstreet"] : ""; + $contact->column_fields[othercity]= in_array('othercity',$permitted_lists) ? $cntrow["othercity"] : ""; + $contact->column_fields[otherstate]= in_array('otherstate',$permitted_lists) ? $cntrow["otherstate"] : ""; + $contact->column_fields[otherzip]= in_array('otherzip',$permitted_lists) ? $cntrow["otherzip"] : ""; + $contact->column_fields[othercountry]= in_array('othercountry',$permitted_lists) ? $cntrow["othercountry"] : ""; + $contact->column_fields[assigned_user_id]= in_array('assigned_user_id',$permitted_lists) ? $user_id : ""; + $contact->column_fields[description]= in_array('description',$permitted_lists) ? $cntrow["description"] : ""; $contact->id = $cntrow["id"]; $contact->mode = "edit"; $contact->save("Contacts"); @@ -743,7 +784,7 @@ function GetTasks($username) { - global $adb; + global $adb,$log; require_once('modules/Calendar/Activity.php'); $seed_task = new Activity(); @@ -754,11 +795,11 @@ while($task = $adb->fetch_array($result)) { - if($task["startdate"] == "0000-00-00" || $task["startdate"] == NULL) + if($task["date_start"] == "0000-00-00" || $task["date_start"] == NULL) { $task["startdate"] = ""; } - if($task["duedate"] == "0000-00-00" || $task["duedate"] == NULL) + if($task["due_date"] == "0000-00-00" || $task["due_date"] == NULL) { $task["duedate"] = ""; } @@ -821,15 +862,30 @@ $current_user = $seed_user; $current_user->retrieve_entity_info($user_id,"Users"); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select fieldname,columnname from vtiger_field where tabid=9"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldname,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=9 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $adb->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_lists[] = $adb->query_result($result1,$i,'fieldname'); + } + $task = new Activity(); foreach($taskdtls as $taskrow) { - - //Currently only 3 status avail Note ************************************************ - if(isset($taskrow)) - { + if(isset($taskrow)) + { if($taskrow["status"] == "0") { $taskrow["status"] = "Not Started"; @@ -861,17 +917,17 @@ $taskrow["priority"] = "Medium"; } - $task->column_fields[subject] = $taskrow["subject"]; - $task->column_fields[date_start]=getDisplayDate($taskrow["startdate"]); - $task->column_fields[due_date]=getDisplayDate($taskrow["duedate"]); - $task->column_fields[taskstatus]=$taskrow["status"]; - $task->column_fields[taskpriority]=$taskrow["priority"]; - $task->column_fields[description]=$taskrow["description"]; + $task->column_fields[subject] = in_array('subject',$permitted_lists) ? $taskrow["subject"] : ""; + $task->column_fields[date_start]= in_array('date_start',$permitted_lists) ? getDisplayDate($taskrow["startdate"]) : ""; + $task->column_fields[due_date]= in_array('due_date',$permitted_lists) ? getDisplayDate($taskrow["duedate"]) : ""; + $task->column_fields[taskstatus]= in_array('taskstatus',$permitted_lists) ? $taskrow["status"] : ""; + $task->column_fields[taskpriority]= in_array('taskpriority',$permitted_lists) ? $taskrow["priority"] : ""; + $task->column_fields[description]= in_array('description',$permitted_lists) ? $taskrow["description"] : ""; $task->column_fields[activitytype]="Task"; //$task->column_fields[contact_id]= retrievereportsto($contact_name,$user_id,null); - $task->column_fields[assigned_user_id]=$user_id; + $task->column_fields[assigned_user_id]=in_array('assigned_user_id',$permitted_lists) ? $user_id : ""; $task->save("Calendar"); - } + } } return $task->id; } @@ -887,6 +943,23 @@ $current_user = $seed_user; $current_user->retrieve_entity_info($user_id,"Users"); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select fieldname,columnname from vtiger_field where tabid=9"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldname,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=9 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $adb->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_lists[] = $adb->query_result($result1,$i,'fieldname'); + } + $task = new Activity(); foreach($taskdtls as $taskrow) @@ -913,24 +986,24 @@ $taskrow["status"] = "Not Started"; } - if($taskrow["priority"] == "2") - { - $taskrow["priority"] = "High"; - }else if($taskrow["priority"] == "0") - { - $taskrow["priority"] = "Low"; - }else if($taskrow["priority"] == "1") - { - $taskrow["priority"] = "Medium"; - } - + if($taskrow["priority"] == "2") + { + $taskrow["priority"] = "High"; + }else if($taskrow["priority"] == "0") + { + $taskrow["priority"] = "Low"; + }else if($taskrow["priority"] == "1") + { + $taskrow["priority"] = "Medium"; + } + $task->retrieve_entity_info($taskrow["id"],"Calendar"); - $task->column_fields[subject] = $taskrow["subject"]; - $task->column_fields[date_start] = getDisplayDate($taskrow["startdate"]); - $task->column_fields[due_date] = getDisplayDate($taskrow["duedate"]); - $task->column_fields[taskstatus] = $taskrow["status"]; - $task->column_fields[taskpriority] = $taskrow["priority"]; - $task->column_fields[description] = $taskrow["description"]; + $task->column_fields[subject] = in_array('subject',$permitted_lists) ? $taskrow["subject"] : ""; + $task->column_fields[date_start] = in_array('date_start',$permitted_lists) ? getDisplayDate($taskrow["startdate"]) : ""; + $task->column_fields[due_date] = in_array('due_date',$permitted_lists) ? getDisplayDate($taskrow["duedate"]) : ""; + $task->column_fields[taskstatus] = in_array('taskstatus',$permitted_lists) ? $taskrow["status"] : ""; + $task->column_fields[taskpriority] = in_array('taskpriority',$permitted_lists) ? $taskrow["priority"] : ""; + $task->column_fields[description] = in_array('description',$permitted_lists) ? $taskrow["description"] : ""; $task->column_fields[activitytype] = "Task"; //$task->column_fields[contact_id]= retrievereportsto($contact_name,$user_id,null); $task->column_fields[assigned_user_id] = $user_id; @@ -963,7 +1036,7 @@ function GetClndr($username) { - global $adb; + global $adb,$log; require_once('modules/Calendar/Activity.php'); $seed_clndr = new Activity(); @@ -974,34 +1047,34 @@ while($clndr = $adb->fetch_array($result)) { - if($clndr["startdate"] == "0000-00-00" || $clndr["startdate"] == NULL) + if($clndr["date_start"] == "0000-00-00" || $clndr["date_start"] == NULL) { - $clndr["startdate"] = ""; + $clndr["date_start"] = ""; } - if($clndr["duedate"] == "0000-00-00" || $clndr["duedate"] == NULL) + if($clndr["due_date"] == "0000-00-00" || $clndr["due_date"] == NULL) { - $clndr["duedate"] = ""; + $clndr["due_date"] = ""; } //this seperates the $$clndr["startdate"] into an array - YYYY-MM-DD - $expldstartdate = explode("-", $clndr["startdate"]); - $expldtimestart = explode(":", $clndr["startime"]); - - $expldduedate = explode("-", $clndr["duedate"]); + $expldstartdate = explode("-", $clndr["date_start"]); + $expldtimestart = explode(":", $clndr["time_start"]); + + $expldduedate = explode("-", $clndr["due_date"]); //this makes a timestamp out of the exploded date this number is in seconds $startdtm = mktime($expldtimestart[0], $expldtimestart[1], 0, $expldstartdate[1], $expldstartdate[2], $expldstartdate[0]); - $duedtm = mktime($expldtimestart[0]+$clndr["duehours"], $expldtimestart[1]+$clndr["dueminutes"], 0, $expldduedate[1], $expldduedate[2], $expldduedate[0]); - - $clndr["startdate"] = date("Y-m-d H:i:s", $startdtm); - $clndr["duedate"] = date("Y-m-d H:i:s", $duedtm); + $duedtm = mktime($expldtimestart[0]+$clndr["duration_hours"], $expldtimestart[1]+$clndr["duration_minutes"], 0, $expldduedate[1], $expldduedate[2], $expldduedate[0]); + + $clndr["date_start"] = date("Y-m-d H:i:s", $startdtm); + $clndr["due_date"] = date("Y-m-d H:i:s", $duedtm); $output_list[] = Array( "id" => $clndr["clndrid"], "subject" => $clndr["subject"], - "startdate" => $clndr["startdate"], - "duedate" => $clndr["duedate"], + "startdate" => $clndr["date_start"], + "duedate" => $clndr["due_date"], "location" => $clndr["location"], "description" => $clndr["description"], "contactname" => $clndr["firstname"]." ".$clndr["lastname"], @@ -1014,7 +1087,7 @@ function AddClndr($username,$clndrdtls) { - global $current_user; + global $current_user,$adb; require_once('modules/Users/User.php'); require_once('modules/Calendar/Activity.php'); @@ -1023,6 +1096,23 @@ $current_user = $seed_user; $current_user->retrieve_entity_info($user_id,"Users"); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select fieldname,columnname from vtiger_field where tabid=16"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldname,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=16 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $adb->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_lists[] = $adb->query_result($result1,$i,'fieldname'); + } + $clndr = new Activity(); foreach($clndrdtls as $clndrow) @@ -1044,16 +1134,16 @@ $stimeduemin = sprintf('%02d',$diff['minutes']); } - $clndr->column_fields[subject] = $clndrow["subject"]; - $clndr->column_fields[date_start]=getDisplayDate(trim($astartdtm[0])); - $clndr->column_fields[due_date]=getDisplayDate(trim($aduedtm[0])); - $clndr->column_fields[time_start]=$stimestart; - $clndr->column_fields[duration_hours]=$stimeduehr; - $clndr->column_fields[duration_minutes]=$stimeduemin; - $clndr->column_fields[location]=$clndrow["location"]; - $clndr->column_fields[description]=$clndrow["description"]; + $clndr->column_fields[subject] = in_array('subject',$permitted_lists) ? $clndrow["subject"] : ""; + $clndr->column_fields[date_start]= in_array('date_start',$permitted_lists) ? getDisplayDate(trim($astartdtm[0])) : ""; + $clndr->column_fields[due_date]= in_array('due_date',$permitted_lists) ? getDisplayDate(trim($aduedtm[0])) : ""; + $clndr->column_fields[time_start]= in_array('time_start',$permitted_lists) ? $stimestart : ""; + $clndr->column_fields[duration_hours]= in_array('duration_hours',$permitted_lists) ? $stimeduehr : ""; + $clndr->column_fields[duration_minutes]= in_array('duration_minutes',$permitted_lists) ? $stimeduemin : ""; + $clndr->column_fields[location]= in_array('location',$permitted_lists) ? $clndrow["location"] : ""; + $clndr->column_fields[description]= in_array('description',$permitted_lists) ? $clndrow["description"] : ""; $clndr->column_fields[activitytype]="Meeting"; - $clndr->column_fields[assigned_user_id]=$user_id; + $clndr->column_fields[assigned_user_id]= in_array('assigned_user_id',$permitted_lists) ? $user_id : ""; $clndr->save("Calendar"); } } @@ -1063,7 +1153,7 @@ function UpdateClndr($username,$clndrdtls) { global $current_user; - global $adb; + global $adb,$log; require_once('modules/Users/User.php'); require_once('modules/Calendar/Activity.php'); @@ -1071,6 +1161,23 @@ $user_id = $seed_user->retrieve_user_id($username); $current_user = $seed_user; $current_user->retrieve_entity_info($user_id,"Users"); + + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select fieldname,columnname from vtiger_field where tabid=16"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldname,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=16 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $adb->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_lists[] = $adb->query_result($result1,$i,'fieldname'); + } $clndr = new Activity(); @@ -1094,16 +1201,16 @@ } $clndr->retrieve_entity_info($clndrow["id"],"Calendar"); - $clndr->column_fields[subject] = $clndrow["subject"]; - $clndr->column_fields[date_start]=getDisplayDate(trim($astartdtm[0])); - $clndr->column_fields[due_date]=getDisplayDate(trim($aduedtm[0])); - $clndr->column_fields[time_start]=$stimestart; - $clndr->column_fields[duration_hours]=$stimeduehr; - $clndr->column_fields[duration_minutes]=$stimeduemin; - $clndr->column_fields[location]=$clndrow["location"]; - $clndr->column_fields[description]=$clndrow["description"]; + $clndr->column_fields[subject] = in_array('subject',$permitted_lists) ? $clndrow["subject"] : ""; + $clndr->column_fields[date_start]= in_array('date_start',$permitted_lists) ? getDisplayDate(trim($astartdtm[0])) : ""; + $clndr->column_fields[due_date]= in_array('due_date',$permitted_lists) ? getDisplayDate(trim($aduedtm[0])) : ""; + $clndr->column_fields[time_start]= in_array('time_start',$permitted_lists) ? $stimestart : ""; + $clndr->column_fields[duration_hours]= in_array('duration_hours',$permitted_lists) ? $stimeduehr : ""; + $clndr->column_fields[duration_minutes]= in_array('duration_minutes',$permitted_lists) ? $stimeduemin : ""; + $clndr->column_fields[location]= in_array('location',$permitted_lists) ? $clndrow["location"] : ""; + $clndr->column_fields[description]= in_array('description',$permitted_lists) ? $clndrow["description"] : ""; $clndr->column_fields[activitytype]="Meeting"; - $clndr->column_fields[assigned_user_id]=$user_id; + $clndr->column_fields[assigned_user_id]= in_array('assigned_user_id',$permitted_lists) ? $user_id : ""; $clndr->id = $clndrow["id"]; $clndr->mode="edit"; $clndr->save("Calendar"); From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 08:09:15 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 12:09:15 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9142 - in /vtigercrm/trunk/modules: Settings/BackupServerConfig.php Users/Logout.php Message-ID: <20060828120916.6109C6B520C@vtiger.fosslabs.com> Author: saraj Date: Mon Aug 28 06:09:11 2006 New Revision: 9142 Log: backup server filename changed Modified: vtigercrm/trunk/modules/Settings/BackupServerConfig.php vtigercrm/trunk/modules/Users/Logout.php Modified: vtigercrm/trunk/modules/Settings/BackupServerConfig.php ============================================================================== --- vtigercrm/trunk/modules/Settings/BackupServerConfig.php (original) +++ vtigercrm/trunk/modules/Settings/BackupServerConfig.php Mon Aug 28 06:09:11 2006 @@ -29,7 +29,7 @@ $smarty = new vtigerCRM_Smarty; if($_REQUEST['error'] != '') { - $smarty->assign("ERROR_MSG",''.$_REQUEST["error"].''); + $smarty->assign("ERROR_MSG",''.$_REQUEST["error"].''); } $sql="select * from vtiger_systems where server_type = 'backup'"; $result = $adb->query($sql); Modified: vtigercrm/trunk/modules/Users/Logout.php ============================================================================== --- vtigercrm/trunk/modules/Users/Logout.php (original) +++ vtigercrm/trunk/modules/Users/Logout.php Mon Aug 28 06:09:11 2006 @@ -42,7 +42,7 @@ //Taking the Backup of DB - $currenttime=date("Ymd_his"); + $currenttime=date("Ymd_His"); if($ftpserver != '' && $ftpuser != '' && $ftppassword != '') { $backupFileName="backup_".$currenttime.".sql"; save_structure($backupFileName, $root_directory); From vtigercrm-commits at vtiger.fosslabs.com Mon Aug 28 08:09:59 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 28 Aug 2006 12:09:59 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9143 - in /vtigercrm/trunk: log4php.properties log4php_1.properties modules/Migration/Migration.php modules/Migration/MigrationCheck.php modules/Migration/ModifyDatabase/42P2_to_50.php modules/Migration/ModifyDatabase/rename_tables.php Message-ID: <20060828120959.461296B51E4@vtiger.fosslabs.com> Author: saraj Date: Mon Aug 28 06:09:50 2006 New Revision: 9143 Log: * Modified to handle the migration logs seperately Modified: vtigercrm/trunk/log4php.properties vtigercrm/trunk/log4php_1.properties vtigercrm/trunk/modules/Migration/Migration.php vtigercrm/trunk/modules/Migration/MigrationCheck.php vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50.php vtigercrm/trunk/modules/Migration/ModifyDatabase/rename_tables.php Modified: vtigercrm/trunk/log4php.properties ============================================================================== --- vtigercrm/trunk/log4php.properties (original) +++ vtigercrm/trunk/log4php.properties Mon Aug 28 06:09:50 2006 @@ -24,3 +24,12 @@ log4php.appender.A1.layout.ContextPrinting="true" log4php.appender.A1.layout.DateFormat="%c" log4php.appender.A1.File=logs/vtigercrm.log + +log4php.logger.MIGRATION=DEBUG,A4 +log4php.appender.A4=LoggerAppenderRollingFile +log4php.appender.A4.MaxFileSize=3MB +log4php.appender.A4.MaxBackupIndex=10 +log4php.appender.A4.layout=LoggerLayoutTTCC +log4php.appender.A4.layout.ContextPrinting="true" +log4php.appender.A4.layout.DateFormat="%c" +log4php.appender.A4.File=logs/migration.log Modified: vtigercrm/trunk/log4php_1.properties ============================================================================== Binary files - no diff available. Modified: vtigercrm/trunk/modules/Migration/Migration.php ============================================================================== --- vtigercrm/trunk/modules/Migration/Migration.php (original) +++ vtigercrm/trunk/modules/Migration/Migration.php Mon Aug 28 06:09:50 2006 @@ -40,9 +40,12 @@ */ function Migration($old='',$new='') { + global $migrationlog; + $migrationlog->debug("Inside the constructor Migration."); + $this->oldconn = $old; $this->conn = $new; - $this->conn->println("Database Object has been created."); + $migrationlog->debug("Database Object has been created."); } /** function used to set the Old database parameters in the migration object properties @@ -55,12 +58,16 @@ */ function setOldDatabaseParams($hostname,$mysql_port,$mysql_username,$mysql_password,$dbname) { + global $migrationlog; + $migrationlog->debug("Inside the function setOldDatabaseParams($hostname,$mysql_port,$mysql_username,$mysql_password,$dbname)"); + $this->old_hostname = $hostname; $this->old_mysql_port = $mysql_port; $this->old_mysql_username = $mysql_username; $this->old_mysql_password = $mysql_password; $this->old_dbname = $dbname; - $this->conn->println("Old Database Parameters has been set."); + + $migrationlog->debug("Old Database Parameters has been set."); } /** function used to set the Current ie., new 5.0 database parameters in the migration object properties @@ -73,12 +80,16 @@ */ function setNewDatabaseParams($hostname,$mysql_port,$mysql_username,$mysql_password,$dbname) { + global $migrationlog; + $migrationlog->debug("Inside the function setNewDatabaseParams($hostname,$mysql_port,$mysql_username,$mysql_password,$dbname)"); + $this->new_hostname = $hostname; $this->new_mysql_port = $mysql_port; $this->new_mysql_username = $mysql_username; $this->new_mysql_password = $mysql_password; $this->new_dbname = $dbname; - $this->conn->println("New Database Parameters has been set."); + + $migrationlog->debug("New Database Parameters has been set."); } /** function used to take the database dump @@ -91,7 +102,9 @@ */ function takeDatabaseDump($host_name,$mysql_port,$mysql_username,$mysql_password,$dbname) { - $this->conn->println("Inside the function takeDatabaseDump. Going to take the specified database dump..."); + global $migrationlog; + $migrationlog->debug("Inside the function takeDatabaseDump($host_name,$mysql_port,$mysql_username,$mysql_password,$dbname). Going to take the specified database dump..."); + $dump_filename = 'dump_'.$dbname.'.txt'; if($mysql_password != '') @@ -110,7 +123,8 @@ $server_mysql_path = $_SESSION['set_server_mysql_path']; $dump_str = "mysqldump -u".$mysql_username.$password_str." -h ".$host_name." --port=".$mysql_port." ".$dbname." >> ".$dump_filename; - + $migrationlog->debug("Server path set. Dump string to execute ==> $dump_str"); + chdir ($server_mysql_path); exec("echo 'set FOREIGN_KEY_CHECKS = 0;' > ".$dump_filename); @@ -122,12 +136,15 @@ } else { + $migrationlog->debug("Dump string to execute ==> mysqldump -u".$mysql_username." -h ".$host_name.$password_str." --port=".$mysql_port." ".$dbname." >> ".$dump_filename); + exec("echo 'set FOREIGN_KEY_CHECKS = 0;' > ".$dump_filename); exec("mysqldump -u".$mysql_username." -h ".$host_name.$password_str." --port=".$mysql_port." ".$dbname." >> ".$dump_filename); exec("echo 'set FOREIGN_KEY_CHECKS = 1;' >> ".$dump_filename); } $_SESSION['migration_log'] .= '
'.$dbname.' Database Dump has been taken and the file is ==> '.$dump_filename; + $migrationlog->debug("
$dbname Database Dump has been taken and the file is ==> $dump_filename"); return $dump_filename; } @@ -139,10 +156,12 @@ */ function dropDatabase($conn,$dbname) { - $this->conn->println("Inside the function dropDatabase. Going to drop the new database..."); + global $migrationlog; + $migrationlog->debug("Inside the function dropDatabase($conn,$dbname). Going to drop the database - $dbname"); $sql = "drop database ".$dbname; $conn->query($sql); + $migrationlog->debug("Database ($dbname) has been dropped."); $_SESSION['migration_log'] .= '
'.$dbname.' Database has been dropped.'; } @@ -153,12 +172,15 @@ */ function createDatabase($conn,$dbname) { - $this->conn->println("Inside the function createDatabase. Going to create the new database..."); + global $migrationlog; + $migrationlog->debug("Inside the function createDatabase($conn, $dbname). Going to create the database - $dbname"); + $sql = "create database ".$dbname; $conn->query($sql); $_SESSION['migration_log'] .= '
'.$dbname.' Database has been created.'; - + $migrationlog->debug("Database ($dbname) has been dropped."); + //Added to avoid the No Database Selected error when execute the queries $conn->connect(); } @@ -174,8 +196,9 @@ */ function applyDumpData($host_name,$mysql_port,$mysql_username,$mysql_password,$dbname,$dumpfile) { - $this->conn->println("Inside the function applyDumpData."); - $this->conn->println("hostname=$host_name&port=$mysql_port&username=$mysql_username&password=$mysql_password& dump file = $dumpfile"); + global $migrationlog; + $migrationlog->debug("Inside the function applyDumpData($host_name,$mysql_port,$mysql_username,$mysql_password,$dbname,$dumpfile)."); + if($mysql_password != '') { $password_str = " --password=".$mysql_password; @@ -190,8 +213,9 @@ { $current_working_dir = getcwd(); $server_mysql_path = $_SESSION['set_server_mysql_path']; - + $dump_str = "mysql --user=".$mysql_username.$password_str." -h ".$host_name." --force --port=".$mysql_port." ".$dbname." < ".$dumpfile; + $migrationlog->debug("MySQL server path set. Dump string to apply ==> $dump_str"); //exec("path = $server_mysql_path"); chdir ($server_mysql_path); @@ -203,9 +227,11 @@ else { exec("mysql --user=".$mysql_username." -h ".$host_name." --force --port=".$mysql_port.$password_str." ".$dbname." < ".$dumpfile); + $migrationlog->debug("Dump string to apply ==> mysql --user=$mysql_username -h $host_name --force --port=$mysql_port $password_str $dbname < $dumpfile"); } $_SESSION['migration_log'] .= '
Database Dump has been applied to the '.$dbname.' Database from '.$dumpfile.''; + $migrationlog->debug("
Database Dump has been applied to the $dbname database from $dumpfile "); } @@ -229,11 +255,12 @@ */ function getTablesCountInNewDatabase() { - $this->conn->println("Inside the function getTablesCountInNewDatabase"); + global $migrationlog; + $migrationlog->debug("Inside the function getTablesCountInNewDatabase()"); $newconn = @mysql_connect($this->new_hostname.':'.$this->new_mysql_port,$this->new_mysql_username,$this->new_mysql_password); $tables = @mysql_num_rows(mysql_list_tables($this->new_dbname,$newconn)); - $this->conn->println("Number of Tables in New Database = ".$tables); + $migrationlog->debug("Number of Tables in New Database = $tables"); return $tables; } @@ -242,11 +269,12 @@ */ function getTablesCountInOldDatabase() { - $this->conn->println("Inside the function getTablesCountInOldDatabase"); + global $migrationlog; + $migrationlog->debug("Inside the function getTablesCountInOldDatabase()"); $oldconn = @mysql_connect($this->old_hostname.':'.$this->old_mysql_port,$this->old_mysql_username,$this->old_mysql_password); $tables = @mysql_num_rows(mysql_list_tables($this->old_dbname,$oldconn)); - $this->conn->println("Number of Tables in Old Database = ".$tables); + $migrationlog->debug("Number of Tables in Old Database = $tables"); return $tables; } @@ -256,8 +284,9 @@ */ function modifyDatabase($conn) { - $this->conn->println("Inside the function modifyDatabase"); - $conn->println("\n\n\nMickie ---- Starts"); + global $migrationlog; + $migrationlog->debug("Inside the function modifyDatabase($conn)"); + $migrationlog->debug("\n\n\nMickie ---- Starts"); $_SESSION['migration_log'] .= "
The current database is going to be modified by executing the following queries...
"; @@ -273,7 +302,7 @@ //Handle Here -- Mickie include("modules/Migration/ModifyDatabase/MigrationInfo.php"); - $conn->println("Mickie ---- Ends\n\n\n"); + $migrationlog->debug("Mickie ---- Ends\n\n\n"); } /** function used to run the migration process based on the option selected and values given @@ -297,10 +326,10 @@ //Step : 3 => Put the dump into the New Database //Step : 4 => Modify the new database with the new changes - + global $migrationlog; global $conn; - $this->conn->println("Database Migration from Old Database to the Current Database Starts."); - $this->conn->println("Migration Option = $option"); + $migrationlog->debug("Database Migration from Old Database to the Current Database Starts."); + $migrationlog->debug("Migration Option = $option"); //Set the old database parameters $old_host_name = $this->old_hostname; @@ -320,7 +349,7 @@ if($option == 'dbsource') { //Take the dump of the old Database - $this->conn->println("Going to take the old Database Dump."); + $migrationlog->debug("Going to take the old Database Dump."); $dump_file = $this->takeDatabaseDump($old_host_name,$old_mysql_port,$old_mysql_username,$old_mysql_password,$old_dbname); //check the file size is greater than 10000 bytes (~app) and if yes then continue else goto step1 @@ -344,7 +373,7 @@ if($old_dbname != $new_dbname) { //This is to take dump of the new database for backup purpose - $this->conn->println("Going to take the current Database Dump."); + $migrationlog->debug("Going to take the current Database Dump."); $new_dump_file = $this->takeDatabaseDump($new_host_name,$new_mysql_port,$new_mysql_username,$new_mysql_password,$new_dbname); //check the file size is greater than 10000 bytes (~app) and if yes then continue else goto step1 @@ -371,15 +400,15 @@ { $_SESSION['migration_log'] .= '
Databases are different. So drop the Current Database and create. Also apply the dump of Old Database'; //Drop the current(latest) Database - $this->conn->println("Going to Drop the current Database"); + $migrationlog->debug("Going to Drop the current Database"); $this->dropDatabase($conn,$new_dbname); //Create the new current(latest) Database - $this->conn->println("Going to Create the current Database"); + $migrationlog->debug("Going to Create the current Database"); $this->createDatabase($conn,$new_dbname); //Apply the dump of the old database to the current database - $this->conn->println("Going to apply the old database dump to the new database."); + $migrationlog->debug("Going to apply the old database dump to the new database."); $this->applyDumpData($new_host_name,$new_mysql_port,$new_mysql_username,$new_mysql_password,$new_dbname,$dump_file); //get the number of tables in new database @@ -391,7 +420,7 @@ //if tables are missing after apply the dump, then alert the user and quit if(($new_tables_count != $old_tables_count && $option == 'dbsource') || ($new_tables_count < 180 && $option == 'dumpsource')) { - $this->conn->println("New Database tables not equal to Old Database tables count. Reload the current database again and quit."); + $migrationlog->debug("New Database tables not equal to Old Database tables count. Reload the current database again and quit."); $continue_process = 0; $msg = "The dump may not be applied correctly. Tables exist in 4.2.3 database : $old_tables_count. Tables exist in current database after apply the dump : $new_tables_count"; @@ -406,25 +435,25 @@ if($continue_process == 1) { //Modify the database which is now as old database setup - $this->conn->println("Going to modify the current database which is now as old database setup"); + $migrationlog->debug("Going to modify the current database which is now as old database setup"); $this->modifyDatabase($conn); - $this->conn->println("Database Modifications Ends......"); - $this->conn->println("Database Migration from Old Database to the Current Database has been Finished."); + $migrationlog->debug("Database Modifications Ends......"); + $migrationlog->debug("Database Migration from Old Database to the Current Database has been Finished."); } else { //Drop the current(latest) Database - $this->conn->println("Going to Restore the current Database"); - $this->conn->println("Going to Drop the current Database"); + $migrationlog->debug("Problem in migration. so going to Restore the current Database"); + $migrationlog->debug("Going to Drop the current Database"); $this->dropDatabase($conn,$new_dbname); //Create the new current(latest) Database - $this->conn->println("Going to Create the current Database"); + $migrationlog->debug("Going to Create the current Database"); $this->createDatabase($conn,$new_dbname); //Reload the new db dump and quit - $this->conn->println("Going to apply the new backup db dump"); + $migrationlog->debug("Going to apply the new backup db dump"); $this->applyDumpData($new_host_name,$new_mysql_port,$new_mysql_username,$new_mysql_password,$new_dbname,$new_dump_file); //Return to Step1 Modified: vtigercrm/trunk/modules/Migration/MigrationCheck.php ============================================================================== --- vtigercrm/trunk/modules/Migration/MigrationCheck.php (original) +++ vtigercrm/trunk/modules/Migration/MigrationCheck.php Mon Aug 28 06:09:50 2006 @@ -13,6 +13,9 @@ include("config.inc.php"); $migration_log = ''; +//Added for Migration Log +$migrationlog =& LoggerManager::getLogger('MIGRATION'); + //new database values get from the current vtigerCRM's config.php global $dbconfig; $new_host_name = $dbconfig['db_hostname']; @@ -56,8 +59,11 @@ exit; } } +$migrationlog->debug("$migration_log"); //echo '
Proceed with migration'; + +$migrationlog->debug("Migration Option - ".$_REQUEST['migration_option']); include("modules/Migration/Migration.php"); if($_REQUEST['migration_option'] == 'db_details') { @@ -69,6 +75,12 @@ $old_mysql_password = $_REQUEST['old_mysql_password']; $old_dbname = $_REQUEST['old_dbname']; + $migrationlog->debug("old host name = ".$old_host_name); + $migrationlog->debug("old MySQL port = ".$old_mysql_port); + $migrationlog->debug("old MySQL username = ".$old_mysql_username); + $migrationlog->debug("old MySQL password = ".$old_mysql_password); + $migrationlog->debug("old db name = ".$old_dbname); + //make a connection with the old database $oldconn = @mysql_connect($old_host_name.":".$old_mysql_port,$old_mysql_username,$old_mysql_password); @@ -88,6 +100,7 @@ else { $migration_log .= ' Database Servers can be connected. Can proceed with migration'; + $migrationlog->debug("Database Servers can be connected. continue1 = 1"); $continue1 = 1; } @@ -109,6 +122,7 @@ else { $migration_log .= '
Required databases exist'; + $migrationlog->debug("Required databases exist. continue2 = 1"); $continue2 = 1; } } @@ -133,6 +147,7 @@ else { $migration_log .= '
Tables exist in both the Databases'; + $migrationlog->debug("Tables exist in the database. continue3 = 1"); $continue3 = 1; } } @@ -162,17 +177,21 @@ if($continue1 == 1 && $continue2 == 1 && $continue3 == 1 && $continue4 == 1) { + $migrationlog->debug("Going to migrate..."); + $new_host = explode(":",$new_host_name); $conn = new PearDatabase("mysql",$new_host_name,$new_dbname,$new_mysql_username,$new_mysql_password); $conn->connect(); - $conn->println("MICKIE ==> Option = DB details. From the given DB details we will migrate."); + $migrationlog->debug("MICKIE ==> Option = DB details. From the given DB details we will migrate."); @session_unregister('migration_log'); $_SESSION['migration_log'] = $migration_log; if($conn) { + $migrationlog->debug("Pear Database object created. Going to create migration object."); + $obj = new Migration('',$conn); $obj->setOldDatabaseParams($old_host_name,$old_mysql_port,$old_mysql_username,$old_mysql_password,$old_dbname); $obj->setNewDatabaseParams($new_host[0],$new_host[1],$new_mysql_username,$new_mysql_password,$new_dbname); @@ -196,7 +215,8 @@ { $old_dump_details = $_FILES['old_dump_filename']; $old_dump_filename = $old_dump_details['name']; - + $migrationlog->debug("Dump file name ==> $old_dump_filename"); + //MySQL Dump file details has given if($old_dump_details['size'] != 0 && is_file($old_dump_details['tmp_name'])) { @@ -217,6 +237,7 @@ $invalid_dump = 1; $errormessage = "Please enter a valid Dump file."; } + $migrationlog->debug("Dump file error no = ".$old_dump_details['error']); } if($gotostep1 == 1) @@ -249,12 +270,14 @@ $conn = new PearDatabase("mysql",$new_host_name,$new_dbname,$new_mysql_username,$new_mysql_password); $conn->connect(); - $conn->println("MICKIE ==> Option = Dump File. Selected Dump File will be applied to the new database"); + $migrationlog->debug("MICKIE ==> Option = Dump File. Selected Dump File will be applied to the new database"); @session_unregister('migration_log'); $_SESSION['migration_log'] = $migration_log; if($conn) { + $migrationlog->debug("Pear Database object created. Going to create migration object."); + $obj = new Migration('',$conn); $new_host = explode(":",$new_host_name); @@ -276,6 +299,12 @@ $old_mysql_password = $_REQUEST['alter_old_mysql_password']; $old_dbname = $_REQUEST['alter_old_dbname']; + $migrationlog->debug("old host name = ".$old_host_name); + $migrationlog->debug("old MySQL port = ".$old_mysql_port); + $migrationlog->debug("old MySQL username = ".$old_mysql_username); + $migrationlog->debug("old MySQL password = ".$old_mysql_password); + $migrationlog->debug("old db name = ".$old_dbname); + //make a connection with the old database $oldconn = @mysql_connect($old_host_name.":".$old_mysql_port,$old_mysql_username,$old_mysql_password); @@ -287,6 +316,7 @@ else { $migration_log .= ' Database Server can be connected. Can proceed with migration'; + $migrationlog->debug("Database server connected. continue1 = 1"); $continue1 = 1; } @@ -303,6 +333,7 @@ else { $migration_log .= '
Required database exist'; + $migrationlog->debug("Database exist. continue2 = 1"); $continue2 = 1; } } @@ -320,6 +351,7 @@ else { $migration_log .= '
Tables exist in the Database'; + $migrationlog->debug("Tables exist. continue3 = 1"); $continue3 = 1; } } @@ -334,12 +366,14 @@ $conn = new PearDatabase("mysql",$old_host_name.":".$old_mysql_port,$old_dbname,$old_mysql_username,$old_mysql_password); $conn->connect(); - $conn->println("MICKIE ==> Option = Alter DB details. From the given DB details we will migrate."); + $migrationlog->debug("MICKIE ==> Option = Alter DB details. From the given DB details we will migrate."); @session_unregister('migration_log'); $_SESSION['migration_log'] = $migration_log; if($conn) { + $migrationlog->debug("Database object created. Going to create Migration object"); + $obj = new Migration('',$conn); $obj->setOldDatabaseParams($old_host_name,$old_mysql_port,$old_mysql_username,$old_mysql_password,$old_dbname); //$obj->migrate($same_databases,'dbsource'); Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50.php ============================================================================== --- vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50.php (original) +++ vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50.php Mon Aug 28 06:09:50 2006 @@ -13,20 +13,21 @@ global $conn; +global $migrationlog; global $query_count, $success_query_count, $failure_query_count; global $success_query_array, $failure_query_array; //Added to put prefix vtiger_ in some of the columns in tables which are used for CV and Reports and field -- 23-06-06 -$conn->println("Going to rename the table names with prefix vtiger_"); +$migrationlog->debug("Going to rename the table names with prefix vtiger_"); include("modules/Migration/ModifyDatabase/rename_tables.php"); -$conn->println("Renaming the table names with prefix vtiger_ has been finished"); - - - - - - -$conn->println("Database Modifications for 4.2 Patch2 ==> 5.0(Alpha) Dev 3 Starts here."); +$migrationlog->debug("Renaming the table names with prefix vtiger_ has been finished"); + + + + + + +$migrationlog->debug("Database Modifications for 4.2 Patch2 ==> 5.0(Alpha) Dev 3 Starts here."); @@ -841,7 +842,7 @@ -$conn->println("Database Modifications for 5.0(Alpha) Dev 3 ==> 5.0 Alpha starts here."); +$migrationlog->debug("Database Modifications for 5.0(Alpha) Dev 3 ==> 5.0 Alpha starts here."); //echo "

Database Modifications for 5.0(Alpha) Dev3 ==> 5.0 Alpha starts here.....
"; $alter_query_array6 = Array( "ALTER TABLE vtiger_users ADD column activity_view VARCHAR(25) DEFAULT 'Today' AFTER homeorder", @@ -2650,11 +2651,11 @@ } } -$conn->println("Database Modifications for 5.0(Alpha) Dev 3 ==> 5.0 Alpha (5) ends here."); +$migrationlog->debug("Database Modifications for 5.0(Alpha) Dev 3 ==> 5.0 Alpha (5) ends here."); /************************* The following changes have been made after 5.0 Alpha 5 *************************/ -$conn->println("Database Modifications after 5.0(Alpha 5) starts here."); +$migrationlog->debug("Database Modifications after 5.0(Alpha 5) starts here."); //Added on 22-04-06 - to add the Notify Owner vtiger_field in Contacts and Accounts @@ -2783,7 +2784,7 @@ mkdir($filepath."$year/$month/$week"); $filepath = $filepath.$year."/".$month."/".$week."/"; - $conn->println("File Path = $filepath"); + $migrationlog->debug("File Path = $filepath"); //upto this added to set the file path based on attachment created time //In this file name (attachmentid_filename) the file will be stored in the harddisk @@ -3676,8 +3677,10 @@ function Execute($query) { global $conn, $query_count, $success_query_count, $failure_query_count, $success_query_array, $failure_query_array; - + global $migrationlog; + $status = $conn->query($query); + $query_count++; if(is_object($status)) { @@ -3688,6 +3691,7 @@
'.$query.'
'.$query.'
  {$MOD[$SINGLE_MOD]} {$APP.LBL_INFORMATION}  {$APP.LBL_MORE} {$APP.LBL_INFORMATION} 
Modified: vtigercrm/trunk/Smarty/templates/salesEditView.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/salesEditView.tpl (original) +++ vtigercrm/trunk/Smarty/templates/salesEditView.tpl Mon Aug 28 08:04:18 2006 @@ -73,20 +73,9 @@ - - {if $MODULE eq 'Notes' || $MODULE eq 'Faq'} - - - {else} - - {if $OP_MODE neq 'create_view'} - - {/if} - - {/if}
 {$APP[$SINGLE_MOD]} {$APP.LBL_INFORMATION} {$APP[$SINGLE_MOD]} {$APP.LBL_INFORMATION}  {$APP.LBL_MORE} {$APP.LBL_INFORMATION} 
".$mod_strings['LBL_NONE_SCHEDULED']."
+ "; + $list_view .="
+ + + + + + "; + //checking permission for Create/Edit Operation + if(isPermitted("Calendar","EditView") == "yes") + { + $list_view .=""; + } + else + { + $list_view .=""; + } + $list_view .=" +
+ ".$app_strings['LBL_NO']." ".$app_strings['Events']." ".$app_strings['LBL_FOUND']." !
".$app_strings['LBL_YOU_CAN_CREATE']." ".$app_strings['LBL_AN']." ".$app_strings['Event']." ".$app_strings['LBL_NOW'].". ".$app_strings['LBL_CLICK_THE_LINK']." :
+   -".$app_strings['LBL_CREATE']." ".$app_strings['LBL_A']." ".$app_strings['Meeting']."
+   -".$app_strings['LBL_CREATE']." ".$app_strings['LBL_A']." ".$app_strings['Call']."
+
".$app_strings['LBL_YOU_ARE_NOT_ALLOWED_TO_CREATE']." ".$app_strings['LBL_AN']." ".$app_strings['Event']."
+
"; + $list_view .="
"; $cal_log->debug("Exiting constructEventListView() method..."); @@ -1546,8 +1582,10 @@ $hour_endat = convertTime2UserSelectedFmt($format,($cal['calendar']->day_start_hour+1),false); $time_arr = getaddEventPopupTime($hour_startat,$hour_endat,$format); $temp_ts = $cal['calendar']->date_time->ts; + //to get date in user selected date format $temp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$temp_ts)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$temp_ts)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $temp_ts)):('')))); $list_view = ""; + //labels of listview header $header = Array('0'=>'#', '1'=>$mod_strings['LBL_TIME'], '2'=>$mod_strings['LBL_TODO'], @@ -1564,6 +1602,7 @@ ); $list_view .=""; + //checking permission for Create/Edit Operation if(isPermitted("Calendar","EditView") == "yes") { $list_view .=" @@ -1603,9 +1642,31 @@ } else { - $list_view .=""; - $list_view .=""; - $list_view .=""; + $list_view .=""; } $list_view .="
 
".$mod_strings['LBL_NONE_SCHEDULED']."
"; + $list_view .="
+ + + + + + "; + //checking permission for Create/Edit Operation + if(isPermitted("Calendar","EditView") == "yes") + { + $list_view .=""; + } + else + { + $list_view .=""; + } + + $list_view .=" +
+ ".$app_strings['LBL_NO']." ".$app_strings['Todo']."s ".$app_strings['LBL_FOUND']." !
".$app_strings['LBL_YOU_CAN_CREATE']." ".$app_strings['LBL_A']." ".$app_strings['Todo']." ".$app_strings['LBL_NOW'].". ".$app_strings['LBL_CLICK_THE_LINK']." :
+   -".$app_strings['LBL_CREATE']." ".$app_strings['LBL_A']." ".$app_strings['Todo']." +
".$app_strings['LBL_YOU_ARE_NOT_ALLOWED_TO_CREATE']." ".$app_strings['LBL_A']." ".$app_strings['Todo']."
+
"; + $list_view .="

"; $cal_log->debug("Exiting constructTodoListView() method..."); From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 08:59:55 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 12:59:55 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9178 - /vtigercrm/trunk/modules/Products/Product.php Message-ID: <20060829125955.AC20E745F27@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 29 06:59:52 2006 New Revision: 9178 Log: * Modified the date format in export query form alphabetical to numerical only Modified: vtigercrm/trunk/modules/Products/Product.php Modified: vtigercrm/trunk/modules/Products/Product.php ============================================================================== --- vtigercrm/trunk/modules/Products/Product.php (original) +++ vtigercrm/trunk/modules/Products/Product.php Tue Aug 29 06:59:52 2006 @@ -531,8 +531,8 @@ vtiger_products.unit_price AS unit_price, vtiger_products.weight AS weight, vtiger_products.pack_size AS pack_size, - DATE_FORMAT(vtiger_products.start_date, '%Y-%M-%D') AS start_date, - DATE_FORMAT(vtiger_products.expiry_date, '%Y-%M-%D') AS expiry_date, + DATE_FORMAT(vtiger_products.start_date, '%Y-%m-%d') AS start_date, + DATE_FORMAT(vtiger_products.expiry_date, '%Y-%m-%d') AS expiry_date, vtiger_products.cost_factor AS cost_factor, vtiger_products.commissionrate AS commissionrate, vtiger_products.commissionmethod AS commissionmethod, @@ -571,8 +571,8 @@ vtiger_products.unit_price AS unit_price, vtiger_products.weight AS weight, vtiger_products.pack_size AS pack_size, - DATE_FORMAT(vtiger_products.start_date, '%Y-%M-%D') AS start_date, - DATE_FORMAT(vtiger_products.expiry_date, '%Y-%M-%D') AS expiry_date, + DATE_FORMAT(vtiger_products.start_date, '%Y-%m-%d') AS start_date, + DATE_FORMAT(vtiger_products.expiry_date, '%Y-%m-%d') AS expiry_date, vtiger_products.cost_factor AS cost_factor, vtiger_products.commissionrate AS commissionrate, vtiger_products.commissionmethod AS commissionmethod, From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 09:12:56 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 13:12:56 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9179 - /customerportal/trunk/Tickets/TicketDetail.php Message-ID: <20060829131256.2B70474609F@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 29 07:12:52 2006 New Revision: 9179 Log: * Corrected the attachment spelling Modified: customerportal/trunk/Tickets/TicketDetail.php Modified: customerportal/trunk/Tickets/TicketDetail.php ============================================================================== --- customerportal/trunk/Tickets/TicketDetail.php (original) +++ customerportal/trunk/Tickets/TicketDetail.php Tue Aug 29 07:12:52 2006 @@ -153,7 +153,7 @@
 
Attachemnts
Attachments
+ +
- - - - + +
: + + + + - - - - - - - - - -
@@ -172,24 +240,46 @@
:
-
- - + + + + + + + + + + + + +
   
+ + + + + + + + + + + + +
+ +
  +
+
+
+
+
+ + - - - - -
- +
-
- +
hour_format,'start');?> @@ -205,7 +295,7 @@
- +
hour_format,'end');?> @@ -221,21 +311,15 @@
-
-  :  -
- - - -
- - +
+ + + +
+ + - - + +
@@ -251,8 +335,8 @@
@@ -499,15 +583,12 @@
- -
+ + - - - - -
@@ -612,12 +693,9 @@ - - - @@ -629,35 +707,64 @@
- - + + - - + + - - - - - - - - - +
:
: - hour_format,'start'); ?> -
  -  Set date.. - + + + + + + + + + + + + +
 : 

- + + + +
+ + + + +
+ + + + +
hour_format,'start'); ?>
+ Set date.. + +
+ + + +
+ Set date.. + +
+
 
- - - - - - - - + +
@@ -678,7 +785,7 @@
- +
From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 09:21:18 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 13:21:18 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9182 - in /vtigercrm/trunk/install: 2setConfig.php 3confirmConfig.php 4createConfigFile.php 5createTables.inc.php 5createTables.php Message-ID: <20060829132118.81B6974609D@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 29 07:21:11 2006 New Revision: 9182 Log: changes made to have user defined currency configuration Modified: vtigercrm/trunk/install/2setConfig.php vtigercrm/trunk/install/3confirmConfig.php vtigercrm/trunk/install/4createConfigFile.php vtigercrm/trunk/install/5createTables.inc.php vtigercrm/trunk/install/5createTables.php Modified: vtigercrm/trunk/install/2setConfig.php ============================================================================== --- vtigercrm/trunk/install/2setConfig.php (original) +++ vtigercrm/trunk/install/2setConfig.php Tue Aug 29 07:21:11 2006 @@ -131,9 +131,15 @@ if (isset($_REQUEST['admin_password'])) $admin_password = $_REQUEST['admin_password']; - if (isset($_REQUEST['currency'])) - $currency = $_REQUEST['currency']; + if (isset($_REQUEST['currency_name'])) + $currency_name = $_REQUEST['currency_name']; + if (isset($_REQUEST['currency_symbol'])) + $currency_symbol = $_REQUEST['currency_symbol']; + + if (isset($_REQUEST['currency_code'])) + $currency_code = $_REQUEST['currency_code']; + } else { !isset($_REQUEST['db_hostname']) ? $db_hostname = $hostname: $db_hostname = $_REQUEST['db_hostname']; @@ -243,8 +249,25 @@ if (trim(form.cache_dir.value) =='') { isError = true; errorMessage += "\n temp directory path"; - form.root_directory.focus(); + form.cache_dir.focus(); } + if (trim(form.currency_name.value) =='') { + isError = true; + errorMessage += "\n currency name"; + form.currency_name.focus(); + } + if (trim(form.currency_symbol.value) =='') { + isError = true; + errorMessage += "\n currency symbol"; + form.currency_symbol.focus(); + } + if (trim(form.currency_code.value) =='') { + isError = true; + errorMessage += "\n currency code"; + form.currency_code.focus(); + } + + if(document.getElementById('check_createdb').checked == true) { if (trim(form.root_user.value) =='') { @@ -430,40 +453,27 @@
">
Master Currency*
Note: The default password is 'admin'. You can change the password if necessary now or else you can change it later after logging-in.
+ +

+ + + + + + + + + + + + + + + +
Currency Configuration
Name*">
Symbol*">
Code*">
Modified: vtigercrm/trunk/install/3confirmConfig.php ============================================================================== --- vtigercrm/trunk/install/3confirmConfig.php (original) +++ vtigercrm/trunk/install/3confirmConfig.php Tue Aug 29 07:21:11 2006 @@ -25,7 +25,9 @@ if (isset($_REQUEST['site_URL'])) $site_URL= $_REQUEST['site_URL']; if (isset($_REQUEST['admin_email'])) $admin_email= $_REQUEST['admin_email']; if (isset($_REQUEST['admin_password'])) $admin_password = $_REQUEST['admin_password']; -if (isset($_REQUEST['currency'])) $currency = $_REQUEST['currency']; +if (isset($_REQUEST['currency_name'])) $currency_name = $_REQUEST['currency_name']; +if (isset($_REQUEST['currency_symbol'])) $currency_symbol = $_REQUEST['currency_symbol']; +if (isset($_REQUEST['currency_code'])) $currency_code = $_REQUEST['currency_code']; if (isset($_REQUEST['cache_dir'])) $cache_dir= $_REQUEST['cache_dir']; if (isset($_REQUEST['mail_server'])) $mail_server= $_REQUEST['mail_server']; if (isset($_REQUEST['mail_server_username'])) $mail_server_username= $_REQUEST['mail_server_username']; @@ -226,19 +228,42 @@ Cache Path - - Admin Username + + + + + + + - + - - - -
Admin Configuration
Username admin
Admin PasswordPassword
Master Currency
+ Email + + + + + + + + + + + + + + + + + + + +
Currency Configuration
Name
Symbol
Code
+

@@ -256,7 +281,9 @@ " /> " /> " /> - " /> + " /> + " /> + " /> @@ -291,7 +318,9 @@ " /> " /> " /> - " /> + " /> + " /> + " /> Modified: vtigercrm/trunk/install/4createConfigFile.php ============================================================================== --- vtigercrm/trunk/install/4createConfigFile.php (original) +++ vtigercrm/trunk/install/4createConfigFile.php Tue Aug 29 07:21:11 2006 @@ -47,7 +47,7 @@ $vtiger_version = "5.0 Beta"; $release_date = "31 March 2006"; -if (isset($_REQUEST['db_type'])) $db_type = $_REQUEST['db_type']; + if (isset($_REQUEST['db_hostname'])) { @@ -59,10 +59,9 @@ { $db_hostname = $_REQUEST['db_hostname']; if($db_type == "pgsql") - $db_port = '5432'; - else - $db_port = '3306'; - + $db_port = '5432'; + else + $db_port = '3306'; } } if (isset($_REQUEST['db_username']))$db_username = $_REQUEST['db_username']; @@ -71,7 +70,7 @@ if (isset($_REQUEST['db_name']))$db_name = $_REQUEST['db_name']; -//if (isset($_REQUEST['db_type'])) $db_type = $_REQUEST['db_type']; +if (isset($_REQUEST['db_type'])) $db_type = $_REQUEST['db_type']; if (isset($_REQUEST['db_drop_tables'])) $db_drop_tables = $_REQUEST['db_drop_tables']; @@ -85,7 +84,11 @@ if (isset($_REQUEST['admin_password'])) $admin_password = $_REQUEST['admin_password']; -if (isset($_REQUEST['currency'])) $currency = $_REQUEST['currency']; +if (isset($_REQUEST['currency_name'])) $currency_name = $_REQUEST['currency_name']; + +if (isset($_REQUEST['currency_code'])) $currency_code = $_REQUEST['currency_code']; + +if (isset($_REQUEST['currency_symbol'])) $currency_symbol = $_REQUEST['currency_symbol']; if (isset($_REQUEST['mail_server'])) $mail_server = $_REQUEST['mail_server']; @@ -444,7 +447,9 @@ " /> " /> " /> - " /> + " /> + " /> + " /> Modified: vtigercrm/trunk/install/5createTables.inc.php ============================================================================== --- vtigercrm/trunk/install/5createTables.inc.php (original) +++ vtigercrm/trunk/install/5createTables.inc.php Tue Aug 29 07:21:11 2006 @@ -271,22 +271,8 @@ $db->getUniqueID("vtiger_freetags"); //Master currency population -$currencies = array('Euro'=>array('name'=>'Euro','symbol'=>'&euro','code'=>'EUR'), - 'United States Dollar'=>array('name'=>'United States Dollar','symbol'=>'$','code'=>'USD'), - 'United Kingdom Pounds'=>array('name'=>'United Kingdom Pounds','symbol'=>'£','code'=>'GBP'), - 'Canada Dollars'=>array('name'=>'Canada Dollars','symbol'=>'$','code'=>'CAD'), - 'Australia Dollars'=>array('name'=>'Australia Dollars','symbol'=>'$','code'=>'AUD'), - 'Japan Yen'=>array('name'=>'Japan Yen','symbol'=>'¥','code'=>'JPY'), - 'Indian Rupee'=>array('name'=>'Indian Rupee','symbol'=>'₨','code'=>'INR'), - 'New Zealand Dollars'=>array('name'=>'New Zealand Dollars','symbol'=>'$','code'=>''), - 'South Africa Rand'=>array('name'=>'South Africa Rand','symbol'=>'R','code'=>'ZAR'), - ); - -$symbol = $currencies[$sel_currency]['symbol']; -$code = $currencies[$sel_currency]['code']; - //Insert into vtiger_currency vtiger_table - $db->query("insert into vtiger_currency_info values(".$db->getUniqueID("vtiger_currency_info").",'$sel_currency','$code','$symbol',1,'Active','-11')"); + $db->query("insert into vtiger_currency_info values(".$db->getUniqueID("vtiger_currency_info").",'$currency_name','$currency_code','$currency_symbol',1,'Active','-11')"); // populate the db with seed data if ($db_populate) { Modified: vtigercrm/trunk/install/5createTables.php ============================================================================== --- vtigercrm/trunk/install/5createTables.php (original) +++ vtigercrm/trunk/install/5createTables.php Tue Aug 29 07:21:11 2006 @@ -24,7 +24,9 @@ if (isset($_REQUEST['db_populate'])) $db_populate = $_REQUEST['db_populate']; if (isset($_REQUEST['admin_email'])) $admin_email = $_REQUEST['admin_email']; if (isset($_REQUEST['admin_password'])) $admin_password = $_REQUEST['admin_password']; -if (isset($_REQUEST['currency'])) $sel_currency = $_REQUEST['currency']; +if (isset($_REQUEST['currency_name'])) $currency_name = $_REQUEST['currency_name']; +if (isset($_REQUEST['currency_code'])) $currency_code = $_REQUEST['currency_code']; +if (isset($_REQUEST['currency_symbol'])) $currency_symbol = $_REQUEST['currency_symbol']; ?> From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 09:30:21 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 13:30:21 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9183 - /vtigercrm/trunk/modules/Calendar/CalendarCommon.php Message-ID: <20060829133021.362BF72A465@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 29 07:30:18 2006 New Revision: 9183 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/CalendarCommon.php Modified: vtigercrm/trunk/modules/Calendar/CalendarCommon.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/CalendarCommon.php (original) +++ vtigercrm/trunk/modules/Calendar/CalendarCommon.php Tue Aug 29 07:30:18 2006 @@ -11,11 +11,12 @@ //Code Added by Minnie -Starts require_once('include/database/PearDatabase.php'); -global $mod_strings; +global $mod_strings,$current_user; global $theme; $theme_path="themes/".$theme."/"; $image_path=$theme_path."images/"; - +require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); +require('user_privileges/user_privileges_'.$current_user->id.'.php'); /** * To get the lists of sharedids * @param $id -- The user id :: Type integer @@ -246,5 +247,71 @@ return $combo; } +/** + *Function to construct HTML select combo box + *@param $fieldname -- the field name :: Type string + *@param $tablename -- The table name :: Type string + *constructs html select combo box for combo field + *and returns it in string format. + */ + +function getActFieldCombo($fieldname,$tablename) +{ + global $adb, $mod_strings; + $combo = ''; + $combo .= ''; + return $combo; +} + +/*Fuction to get value for Assigned To field + *returns values of Assigned To field in array format +*/ +function getAssignedTo() +{ + global $current_user,$noof_group_rows,$adb; + $assigned_user_id = $current_user->id; + if($is_admin==false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[getTabid('Calendar')] == 3 or $defaultOrgSharingPermission[getTabid('Calendar')] == 0)) + { + $result=get_current_user_access_groups('Calendar'); + } + else + { + $result = get_group_options(); + } + $nameArray = $adb->fetch_array($result); + global $current_user; + if($is_admin==false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[getTabid($module_name)] == 3 or $defaultOrgSharingPermission[getTabid($module_name)] == 0)) + { + $users_combo = get_select_options_array(get_user_array(FALSE, "Active", $assigned_user_id,'private'), $assigned_user_id); + } + else + { + $users_combo = get_select_options_array(get_user_array(FALSE, "Active", $assigned_user_id), $assigned_user_id); + } + if($noof_group_rows!=0) + { + do + { + $groupname=$nameArray["groupname"]; + $group_option[] = array($groupname=>$selected); + + }while($nameArray = $adb->fetch_array($result)); + } + $fieldvalue[]=$users_combo; + $fieldvalue[] = $group_option; + return $fieldvalue; +} + //Code Added by Minnie -Ends ?> From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 09:39:28 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 13:39:28 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9184 - /vtigercrm/trunk/modules/Calendar/DetailView.php Message-ID: <20060829133928.2C0C374609F@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 29 07:39:24 2006 New Revision: 9184 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/DetailView.php Modified: vtigercrm/trunk/modules/Calendar/DetailView.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/DetailView.php (original) +++ vtigercrm/trunk/modules/Calendar/DetailView.php Tue Aug 29 07:39:24 2006 @@ -128,37 +128,30 @@ $data['endmin'] = $time_arr['endmin']; $data['endfmt'] = $time_arr['endfmt']; $data['record'] = $focus->id; +if(isset($finaldata['sendnotification']) && $finaldata['sendnotification'] == 'yes') + $data['sendnotification'] = 'Yes'; +else + $data['sendnotification'] = 'No'; +$data['subject'] = $finaldata['subject']; +$data['date_start'] = $stdate; +$data['due_date'] = $enddate; +$data['assigned_user_id'] = $finaldata['assigned_user_id']; +$data['taskpriority'] = $finaldata['taskpriority']; +$data['modifiedtime'] = $finaldata['modifiedtime']; +$data['createdtime'] = $finaldata['createdtime']; +$data['parent_name'] = $finaldata['parent_id']; +$data['description'] = $finaldata['description']; if($activity_mode == 'Task') { - $data['task_subject'] = $finaldata['subject']; - $data['task_date_start'] = $stdate; - $data['assigned_user_id'] = $finaldata['assigned_user_id']; $data['taskstatus'] = $finaldata['taskstatus']; - $data['priority'] = $finaldata['taskpriority']; $data['activitytype'] = $activity_mode; - $data['modifiedtime'] = $finaldata['modifiedtime']; - $data['createdtime'] = $finaldata['createdtime']; - $data['parent_name'] = $finaldata['parent_id']; $data['contact_id'] = $finaldata['contact_id']; - if(isset($finaldata['sendnotification']) && $finaldata['sendnotification'] == 'yes') - $data['sendnotification'] = 'Yes'; - else - $data['sendnotification'] = 'No'; } elseif($activity_mode == 'Events') { - $data['subject'] = $finaldata['subject']; - $data['date_start'] = $stdate; - $data['due_date'] = $enddate; $data['visibility'] = $finaldata['visibility']; - $data['assigned_user_id'] = $finaldata['assigned_user_id']; $data['eventstatus'] = $finaldata['eventstatus']; - $data['priority'] = $finaldata['taskpriority']; - $data['sendnotification'] = $finaldata['sendnotification']; $data['activitytype'] = $finaldata['activitytype']; - $data['modifiedtime'] = $finaldata['modifiedtime']; - $data['createdtime'] = $finaldata['createdtime']; - $data['parent_name'] = $finaldata['parent_id']; //Calculating reminder time $rem_days = 0; $rem_hrs = 0; From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 09:50:26 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 13:50:26 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9185 - /vtigercrm/trunk/modules/Calendar/script.js Message-ID: <20060829135026.8515B6B54F9@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 29 07:50:22 2006 New Revision: 9185 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/script.js Modified: vtigercrm/trunk/modules/Calendar/script.js ============================================================================== --- vtigercrm/trunk/modules/Calendar/script.js (original) +++ vtigercrm/trunk/modules/Calendar/script.js Tue Aug 29 07:50:22 2006 @@ -969,3 +969,21 @@ function doNothing() { } + +/** This is Javascript Function which is used to toogle between + * assigntype user and group/team select options while assigning owner to Task. + */ +function toggleTaskAssignType(currType) +{ + if (currType=="U") + { + getObj("task_assign_user").style.display="block" + getObj("task_assign_team").style.display="none" + } + else + { + getObj("task_assign_user").style.display="none" + getObj("task_assign_team").style.display="block" + } +} + From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 09:52:49 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 13:52:49 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9186 - /vtigercrm/trunk/Smarty/templates/EditViewHidden.tpl Message-ID: <20060829135249.8E7B3746280@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 29 07:52:45 2006 New Revision: 9186 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/Smarty/templates/EditViewHidden.tpl Modified: vtigercrm/trunk/Smarty/templates/EditViewHidden.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/EditViewHidden.tpl (original) +++ vtigercrm/trunk/Smarty/templates/EditViewHidden.tpl Tue Aug 29 07:52:45 2006 @@ -42,14 +42,6 @@ - {foreach key=key_one item=arr from=$ACTIVITYDATA.assigned_user_id} - {foreach key=sel_value item=keyvalue from=$arr} - {if $keyvalue eq "selected"} - - - {/if} - {/foreach} - {/foreach} {elseif $MODULE eq 'PurchaseOrder' || $MODULE eq 'SalesOrder' || $MODULE eq 'Invoice' || $MODULE eq 'Quotes'} From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 09:56:03 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 13:56:03 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9187 - /vtigercrm/trunk/Smarty/templates/ActivityEditView.tpl Message-ID: <20060829135603.D4E0A746280@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 29 07:55:59 2006 New Revision: 9187 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/Smarty/templates/ActivityEditView.tpl Modified: vtigercrm/trunk/Smarty/templates/ActivityEditView.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/ActivityEditView.tpl (original) +++ vtigercrm/trunk/Smarty/templates/ActivityEditView.tpl Tue Aug 29 07:55:59 2006 @@ -85,23 +85,12 @@ {if $ACTIVITY_MODE neq 'Task'} - {if $OP_MODE eq 'edit_view'} - {foreach item=arr from=$ACTIVITYDATA.eventstatus} - {foreach key=sel_value item=value from=$arr} - {if $value eq 'selected'} - - {/if} - {/foreach} - {/foreach} - {else} - - {/if} -
+
- - +
{$MOD.LBL_EVENTTYPE} : + {$MOD.LBL_EVENTTYPE} {foreach key=tyeparrkey item=typearr from=$ACTIVITYDATA.activitytype} @@ -122,32 +111,125 @@ - - + + - - - + + + + +
{$MOD.LBL_EVENTNAME} :{$MOD.LBL_EVENTNAME}    + {foreach key=key_one item=arr from=$ACTIVITYDATA.visibility} + {foreach key=sel_value item=value from=$arr} + {if $value eq 'selected' && $sel_value eq 'Public'} + {assign var="visiblecheck" value="checked"} + {else} + {assign var="visiblecheck" value=""} + {/if} + {/foreach} + {/foreach} + {$MOD.LBL_PUBLIC} +
- {foreach key=key_one item=arr from=$ACTIVITYDATA.visibility} - {foreach key=sel_value item=value from=$arr} - {if $value eq 'selected' && $sel_value eq 'Public'} - {assign var="visiblecheck" value="checked"} - {else} - {assign var="visiblecheck" value=""} - {/if} - {/foreach} - {/foreach} - - {$MOD.LBL_PUBLIC}
{$LABEL.description}
+ + + + + + + + + + + + + +
{$LABEL.eventstatus}{$LABEL.assigned_user_id}
+ + + {assign var=check value=1} + {foreach key=key_one item=arr from=$ACTIVITYDATA.assigned_user_id} + {foreach key=sel_value item=value from=$arr} + {if $value ne ''} + {assign var=check value=$check*0} + {else} + {assign var=check value=$check*1} + {/if} + {/foreach} + {/foreach} + + {if $check eq 0} + {assign var=select_user value='checked'} + {assign var=style_user value='display:block'} + {assign var=style_group value='display:none'} + {else} + {assign var=select_group value='checked'} + {assign var=style_user value='display:none'} + {assign var=style_group value='display:block'} + {/if} +  {$APP.LBL_USER} + {if $secondvalue.assigned_user_id neq ''} +  {$APP.LBL_GROUP} + {/if} + + + + + {if $secondvalue.assigned_user_id neq ''} + + + + {/if} +
 {$LABEL.sendnotification} +
{$LABEL.taskpriority} +
+ +
+
-
- +
+
- - - +
- +
-
- +
{$MOD.LBL_EVENTSTAT}
{$STARTHOUR}
@@ -167,7 +249,7 @@
- +
@@ -189,30 +271,11 @@
{$MOD.LBL_EVENTEDAT}
{$ENDHOUR}
-
- {$LABEL.taskpriority} :  - -

- +
@@ -485,65 +548,153 @@
{else} - {if $OP_MODE eq 'edit_view'} - {foreach item=arr from=$ACTIVITYDATA.taskstatus} - {foreach key=sel_value item=value from=$arr} - {if $value eq 'selected'} - - {/if} - {/foreach} - {/foreach} - {else} - - {/if} - +
- - + + - - + + - - - - - - -
{$MOD.LBL_TODO} :{$MOD.LBL_TODO}
{$MOD.LBL_TODODATETIME} :{$STARTHOUR}{$LABEL.description}
  - {foreach key=date_value item=time_value from=$ACTIVITYDATA.date_start} - {assign var=date_val value="$date_value"} - {assign var=time_val value="$time_value"} - {/foreach} -  Set date.. - {foreach key=date_fmt item=date_str from=$secondvalue.date_start} - {assign var=date_vl value="$date_fmt"} - {/foreach} - + + + + + + + + + + + + +
{$LABEL.taskstatus}{$LABEL.taskpriority}{$LABEL.assigned_user_id}
+ + + + + {assign var=check value=1} + {foreach key=key_one item=arr from=$ACTIVITYDATA.assigned_user_id} + {foreach key=sel_value item=value from=$arr} + {if $value ne ''} + {assign var=check value=$check*0} + {else} + {assign var=check value=$check*1} + {/if} + {/foreach} + {/foreach} + {if $check eq 0} + {assign var=select_user value='checked'} + {assign var=style_user value='display:block'} + {assign var=style_group value='display:none'} + {else} + {assign var=select_group value='checked'} + {assign var=style_user value='display:none'} + {assign var=style_group value='display:block'} + {/if} +  User + {if $secondvalue.assigned_user_id neq ''} +  Group + {/if} + + + + {if $secondvalue.assigned_user_id neq ''} + + + + {/if} +
{$LABEL.taskpriority} :  - -
-
- + +

+ + + +
+ + + + +
+ + + + +
{$MOD.LBL_TODODATETIME}
{$STARTHOUR}
+ {foreach key=date_value item=time_value from=$ACTIVITYDATA.date_start} + {assign var=date_val value="$date_value"} + {assign var=time_val value="$time_value"} + {/foreach} + Set date.. + {foreach key=date_fmt item=date_str from=$secondvalue.date_start} + {assign var=date_vl value="$date_fmt"} + {/foreach} + +
+ + + +
{$LABEL.due_date}
+ {foreach key=date_value item=time_value from=$ACTIVITYDATA.due_date} + {assign var=date_val value="$date_value"} + {assign var=time_val value="$time_value"} + {/foreach} + Set date.. + {foreach key=date_fmt item=date_str from=$secondvalue.due_date} + {assign var=date_vl value="$date_fmt"} + {/foreach} + +
+
 
+
From vtigercrm-commits at vtiger.fosslabs.com Tue Aug 29 09:56:35 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 29 Aug 2006 13:56:35 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9188 - /vtigercrm/trunk/Smarty/templates/ActivityDetailView.tpl Message-ID: <20060829135635.B987F74609F@vtiger.fosslabs.com> Author: saraj Date: Tue Aug 29 07:56:31 2006 New Revision: 9188 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/Smarty/templates/ActivityDetailView.tpl Modified: vtigercrm/trunk/Smarty/templates/ActivityDetailView.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/ActivityDetailView.tpl (original) +++ vtigercrm/trunk/Smarty/templates/ActivityDetailView.tpl Tue Aug 29 07:56:31 2006 @@ -106,58 +106,77 @@
{/foreach} {if $ACTIVITYDATA.activitytype neq 'Task'} - +
- - + + + + - - + + + + - - - -
{$MOD.LBL_EVENTTYPE} :{$ACTIVITYDATA.activitytype}{$MOD.LBL_EVENTTYPE}{$ACTIVITYDATA.activitytype}  
{$MOD.LBL_EVENTNAME} :{$ACTIVITYDATA.subject}{$MOD.LBL_EVENTNAME}{$ACTIVITYDATA.subject}{$LABEL.visibility}{$ACTIVITYDATA.visibility}
{$LABEL.visibility} :{$ACTIVITYDATA.visibility}
- - - - - - - + + + + + + + + + + + +
{$LABEL.createdtime} :{$ACTIVITYDATA.createdtime}{$LABEL.modifiedtime} :{$ACTIVITYDATA.modifiedtime}
{$LABEL.description}{$ACTIVITYDATA.description}
+ + + + + + + + + + + + + + + + + +
{$LABEL.eventstatus}{$LABEL.assigned_user_id}
{$ACTIVITYDATA.eventstatus}{$ACTIVITYDATA.assigned_user_id}
{$LABEL.taskpriority}{$LABEL.sendnotification}
{$ACTIVITYDATA.taskpriority}{$ACTIVITYDATA.sendnotification}
+
{$LABEL.createdtime}{$ACTIVITYDATA.createdtime}{$LABEL.modifiedtime}{$ACTIVITYDATA.modifiedtime}
-
- - - +
+
+ + + +
- - - - - - +
- - - + - + - -
{$MOD.LBL_EVENTSTAT}
{$ACTIVITYDATA.starthr}:{$ACTIVITYDATA.startmin}{$ACTIVITYDATA.startfmt}
+ + + -
{$MOD.LBL_EVENTSTAT}
{$ACTIVITYDATA.starthr}:{$ACTIVITYDATA.startmin}{$ACTIVITYDATA.startfmt}
{$ACTIVITYDATA.date_start}
-
- - - +
{$MOD.LBL_EVENTEDAT}
{$ACTIVITYDATA.endhr}:{$ACTIVITYDATA.endmin}{$ACTIVITYDATA.endfmt}
+ + + -
{$MOD.LBL_EVENTEDAT}
{$ACTIVITYDATA.endhr}:{$ACTIVITYDATA.endmin}{$ACTIVITYDATA.endfmt}
{$ACTIVITYDATA.due_date}
-
-
{$MOD.Priority} : {$ACTIVITYDATA.priority}
+
+

- +
@@ -182,8 +201,8 @@
- - + + -
{$MOD.LBL_USERS} : + {$MOD.LBL_USERS} {foreach item=username key=userid from=$INVITEDUSERS} {$username.3}
{/foreach} @@ -195,12 +214,12 @@
From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 30 02:41:34 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 30 Aug 2006 06:41:34 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9197 - /vtigercrm/trunk/soap/vtigerolservice.php Message-ID: <20060830064134.EF4067467D3@vtiger.fosslabs.com> Author: richie Date: Wed Aug 30 00:41:23 2006 New Revision: 9197 Log: Issue in Outlook Plugin has been fixed --Jeri Modified: vtigercrm/trunk/soap/vtigerolservice.php Modified: vtigercrm/trunk/soap/vtigerolservice.php ============================================================================== --- vtigercrm/trunk/soap/vtigerolservice.php (original) +++ vtigercrm/trunk/soap/vtigerolservice.php Wed Aug 30 00:41:23 2006 @@ -503,6 +503,7 @@ } $namelist = explode(" ", $contact["lastname"]); + $middlename = ""; if(isset($namelist)) { if(count($namelist) >= 2) @@ -510,7 +511,8 @@ $contact["lastname"] = $namelist[count($namelist)-1]; for($i=0; $icolumn_fields[description]= in_array('description',$permitted_lists) ? $taskrow["description"] : ""; $task->column_fields[activitytype]="Task"; //$task->column_fields[contact_id]= retrievereportsto($contact_name,$user_id,null); - $task->column_fields[assigned_user_id]=in_array('assigned_user_id',$permitted_lists) ? $user_id : ""; + $task->column_fields[assigned_user_id]= in_array('assigned_user_id',$permitted_lists) ? $user_id : ""; $task->save("Calendar"); } } @@ -1006,7 +1008,7 @@ $task->column_fields[description] = in_array('description',$permitted_lists) ? $taskrow["description"] : ""; $task->column_fields[activitytype] = "Task"; //$task->column_fields[contact_id]= retrievereportsto($contact_name,$user_id,null); - $task->column_fields[assigned_user_id] = $user_id; + $task->column_fields[assigned_user_id] = in_array('assigned_user_id',$permitted_lists) ? $user_id : ""; $task->id = $taskrow["id"]; $task->mode="edit"; From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 30 06:07:15 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 30 Aug 2006 10:07:15 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9198 - /vtigercrm/trunk/modules/Calendar/calendarLayout.php Message-ID: <20060830100716.1ADFA746805@vtiger.fosslabs.com> Author: saraj Date: Wed Aug 30 04:07:12 2006 New Revision: 9198 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/calendarLayout.php Modified: vtigercrm/trunk/modules/Calendar/calendarLayout.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/calendarLayout.php (original) +++ vtigercrm/trunk/modules/Calendar/calendarLayout.php Wed Aug 30 04:07:12 2006 @@ -127,17 +127,18 @@ $minical .= " - "; + "; $minical .= ""; $minical .= ""; //To display days in week + $minical .= ''; for ($i = 0; $i < 7; $i ++) { $weekdays_row = $cal['calendar']->month_array[$cal['calendar']->slices[$i]]; $weekday = $weekdays_row->start_time->getdayofWeek_inshort(); - $minical .= ''; + $minical .= ''; } $minical .= ""; $event_class = ''; @@ -149,6 +150,8 @@ { $cal['slice'] = $cal['calendar']->month_array[$cal['calendar']->slices[$count]]; $class = dateCheck($cal['slice']->start_time->get_formatted_date()); + if($count%7 == 0) + $minical .= ""; //To differentiate day having events from other days if(count($cal['slice']->activities) != 0 && ($cal['slice']->start_time->get_formatted_date() == $cal['slice']->activities[0]->start_time->get_formatted_date())) { @@ -163,14 +166,18 @@ $class = 'class="'.$class.'"'; else $class = $event_class; - $minical .= ""; } - $monthview_layout .= ''; + else + { + $minical .= ""; + } $count++; } $minical .= ''; @@ -876,7 +883,7 @@ if ($cal['slice']->start_time->getMonth() == $cal['calendar']->date_time->getMonth()) { $monthview_layout .= ''; for($w=0;$w<7;$w++) { - $yearview_layout .= ''; + $yearview_layout .= ''; } $yearview_layout .= ''; list($_3rdyear,$_3rdmonth,$_3rddate) = explode("-",$cal['calendar']->month_day_slices[$count][35]); From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 30 08:53:06 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 30 Aug 2006 12:53:06 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9199 - in /vtigercrm/trunk: data/CRMEntity.php modules/HelpDesk/DetailViewAjax.php modules/HelpDesk/HelpDesk.php modules/HelpDesk/Save.php Message-ID: <20060830125306.C3DA7746862@vtiger.fosslabs.com> Author: saraj Date: Wed Aug 30 06:52:59 2006 New Revision: 9199 Log: * Removed the ticket history update code from common function and added as seperate, now when we create or update ticket then the history will be updated seperately and not inside the saveentity function Modified: vtigercrm/trunk/data/CRMEntity.php vtigercrm/trunk/modules/HelpDesk/DetailViewAjax.php vtigercrm/trunk/modules/HelpDesk/HelpDesk.php vtigercrm/trunk/modules/HelpDesk/Save.php Modified: vtigercrm/trunk/data/CRMEntity.php ============================================================================== --- vtigercrm/trunk/data/CRMEntity.php (original) +++ vtigercrm/trunk/data/CRMEntity.php Wed Aug 30 06:52:59 2006 @@ -494,64 +494,7 @@ $adb->query($sql_qry); } - //code added by richie starts - - /** Function to get the update ticket history for the specified ticketid - * @param $id -- $ticketid:: Type Integer - */ - function constructUpdateLog($id) - { - global $adb; - global $current_user; - $ticketid = $id; - //Updating History - $tktresult = $adb->query("select * from vtiger_troubletickets where ticketid='".$ticketid."'"); - $crmresult = $adb->query("select * from vtiger_crmentity where crmid='".$ticketid."'"); - $updatelog = $adb->query_result($tktresult,0,"update_log"); - $old_user_id = $adb->query_result($crmresult,0,"smownerid"); - $old_status = $adb->query_result($tktresult,0,"status"); - $old_priority = $adb->query_result($tktresult,0,"priority"); - $old_severity = $adb->query_result($tktresult,0,"severity"); - $old_category = $adb->query_result($tktresult,0,"category"); - if($_REQUEST['old_smownerid'] != $old_user_id && $old_user_id != 0) - { - $user_name = getUserName($this->column_fields['assigned_user_id']); - $updatelog .= ' Transferred to '.$user_name.'\.'; - } - elseif($old_user_id == 0) - { - $group_info = getGroupName($ticketid,'HelpDesk'); - $group_name = $group_info[0]; - if($group_name != $_REQUEST['assigned_group_name']) - $updatelog .= ' Transferred to group '.$_REQUEST['assigned_group_name'].'\.'; - } - if($old_status != $this->column_fields['ticketstatus']) - { - $updatelog .= ' Status Changed to '.$this->column_fields['ticketstatus'].'\.'; - } - if($old_priority != $this->column_fields['ticketpriorities']) - { - $updatelog .= ' Priority Changed to '.$this->column_fields['ticketpriorities'].'\.'; - } - if($old_severity != $this->column_fields['ticketseverities']) - { - $updatelog .= ' Severity Changed to '.$this->column_fields['ticketseverities'].'\.'; - } - if($old_category != $this->column_fields['ticketcategories']) - { - $updatelog .= ' Category Changed to '.$this->column_fields['ticketcategories'].'\.'; - } - if($_REQUEST['old_smownerid'] != $old_user_id || $old_status != $this->column_fields['ticketstatus'] || $old_priority != $this->column_fields['ticketpriorities'] || $old_severity != $this->column_fields['ticketseverities'] || $old_category != $this->column_fields['ticketcategories'] || $old_userid == 0) - { - $updatelog .= ' -- '.date("l dS F Y h:i:s A").' by '.$current_user->user_name.'--//--'; - } - else - { - $update_log .= '--//--'; - } - - return $updatelog; - } + /** Function to insert values in the specifed table for the specified module * @param $table_name -- table name:: Type varchar * @param $module -- module:: Type varchar @@ -560,7 +503,7 @@ { global $log; global $current_user; - $log->info("function insertIntoCrmEntity ".$module.' vtiger_table name ' .$table_name); + $log->info("function insertIntoEntityTable ".$module.' vtiger_table name ' .$table_name); global $adb; $insertion_mode = $this->mode; @@ -667,6 +610,12 @@ $fldvalue = getDBInsertDateValue($this->column_fields[$fieldname]); } } + elseif($uitype == 7) + { + //strip out the spaces and commas in numbers if given ie., in amounts there may be , + $fldvalue = str_replace(",","",$this->column_fields[$fieldname]);//trim($this->column_fields[$fieldname],","); + + } else { $fldvalue = $this->column_fields[$fieldname]; @@ -684,14 +633,6 @@ if($fldvalue=='') $fldvalue ="NULL"; if($insertion_mode == 'edit') { - //code by richie starts - if(($table_name == "vtiger_troubletickets") && ($columname == "update_log")) - { - $fldvalue = $this->constructUpdateLog($this->id); - $fldvalue = from_html($adb->formatString($table_name,$columname,$fldvalue),($insertion_mode == 'edit')?true:false); - } - //code by richie ends - if($table_name == 'vtiger_notes' && $columname == 'filename' && $_FILES['filename']['name'] == '') { $fldvalue = $this->getOldFileName($this->id); @@ -715,32 +656,6 @@ } else { - //code by richie starts - if(($table_name == "vtiger_troubletickets") && ($columname == "update_log")) - { - global $current_user; - $fldvalue = date("l dS F Y h:i:s A").' by '.$current_user->user_name; - if($_REQUEST['assigned_group_name'] != '' && $_REQUEST['assigntype'] == 'T') - { - $group_name = $_REQUEST['assigned_group_name']; - } - elseif($this->column_fields['assigned_user_id'] != '') - { - $tkt_ownerid = $this->column_fields['assigned_user_id']; - } - else - { - $tkt_ownerid = $current_user->id; - } - if($group_name != '') - $tkt_ownername = $group_name; - else - $tkt_ownername = getUserName($tkt_ownerid); - $fldvalue = " Ticket created. Assigned to ".$tkt_ownername." -- ".$fldvalue."--//--"; - $fldvalue = from_html($adb->formatString($table_name,$columname,$fldvalue),($insertion_mode == 'edit')?true:false); - //echo ' updatevalue is ............. ' .$fldvalue; - } - //code by richie ends $column .= ", ".$columname; $value .= ", ".$fldvalue.""; } Modified: vtigercrm/trunk/modules/HelpDesk/DetailViewAjax.php ============================================================================== --- vtigercrm/trunk/modules/HelpDesk/DetailViewAjax.php (original) +++ vtigercrm/trunk/modules/HelpDesk/DetailViewAjax.php Wed Aug 30 06:52:59 2006 @@ -36,7 +36,19 @@ $modObj->column_fields[$fieldname] = $fieldvalue; $modObj->id = $crmid; $modObj->mode = "edit"; + + //Added to construct the update log for Ticket history + $assigned_group_name = $_REQUEST['assigned_group_name']; + $assigntype = $_REQUEST['assigntype']; + + $fldvalue = $modObj->constructUpdateLog(&$modObj, $modObj->mode, $assigned_group_name, $assigntype); + $fldvalue = from_html($adb->formatString('vtiger_troubletickets','update_log',$fldvalue),($modObj->mode == 'edit')?true:false); + $modObj->save("HelpDesk"); + + //update the log information for ticket history + $adb->query("update vtiger_troubletickets set update_log=$fldvalue where ticketid=".$modObj->id); + if($modObj->id != "") { echo ":#:SUCCESS"; Modified: vtigercrm/trunk/modules/HelpDesk/HelpDesk.php ============================================================================== --- vtigercrm/trunk/modules/HelpDesk/HelpDesk.php (original) +++ vtigercrm/trunk/modules/HelpDesk/HelpDesk.php Wed Aug 30 06:52:59 2006 @@ -467,6 +467,89 @@ return getHistory('HelpDesk',$query,$id); } + /** Function to get the update ticket history for the specified ticketid + * @param $id -- $ticketid:: Type Integer + */ + function constructUpdateLog($focus, $mode, $assigned_group_name, $assigntype) + { + global $adb; + global $current_user; + + if($mode != 'edit')//this will be updated when we create new ticket + { + $updatelog = " Ticket created. Assigned to "; + + if($assigned_group_name != '' && $assigntype == 'T') + { + $updatelog .= " group ".$assigned_group_name; + } + elseif($focus->column_fields['assigned_user_id'] != '') + { + $updatelog .= " user ".getUserName($focus->column_fields['assigned_user_id']); + } + else + { + $updatelog .= " user ".getUserName($current_user->id); + } + + $fldvalue = date("l dS F Y h:i:s A").' by '.$current_user->user_name; + $updatelog .= " -- ".$fldvalue."--//--"; + } + else + { + $ticketid = $focus->id; + + //First retrieve the existing information + $tktresult = $adb->query("select * from vtiger_troubletickets where ticketid='".$ticketid."'"); + $crmresult = $adb->query("select * from vtiger_crmentity where crmid='".$ticketid."'"); + + $updatelog = $adb->query_result($tktresult,0,"update_log"); + + $old_user_id = $adb->query_result($crmresult,0,"smownerid"); + $old_status = $adb->query_result($tktresult,0,"status"); + $old_priority = $adb->query_result($tktresult,0,"priority"); + $old_severity = $adb->query_result($tktresult,0,"severity"); + $old_category = $adb->query_result($tktresult,0,"category"); + + //Assigned to change log + if($assigned_group_name != '' && $assigntype == 'T') + { + $group_info = getGroupName($ticketid,'HelpDesk'); + $group_name = $group_info[0]; + if($group_name != $assigned_group_name) + $updatelog .= ' Transferred to group '.$assigned_group_name.'\.'; + } + elseif($focus->column_fields['assigned_user_id'] != $old_user_id) + { + $user_name = getUserName($focus->column_fields['assigned_user_id']); + $updatelog .= ' Transferred to user '.$user_name.'\.'; + } + //Status change log + if($old_status != $focus->column_fields['ticketstatus']) + { + $updatelog .= ' Status Changed to '.$focus->column_fields['ticketstatus'].'\.'; + } + //Priority change log + if($old_priority != $focus->column_fields['ticketpriorities']) + { + $updatelog .= ' Priority Changed to '.$focus->column_fields['ticketpriorities'].'\.'; + } + //Severity change log + if($old_severity != $focus->column_fields['ticketseverities']) + { + $updatelog .= ' Severity Changed to '.$focus->column_fields['ticketseverities'].'\.'; + } + //Category change log + if($old_category != $focus->column_fields['ticketcategories']) + { + $updatelog .= ' Category Changed to '.$focus->column_fields['ticketcategories'].'\.'; + } + + $updatelog .= ' -- '.date("l dS F Y h:i:s A").' by '.$current_user->user_name.'--//--'; + } + return $updatelog; + } + } Modified: vtigercrm/trunk/modules/HelpDesk/Save.php ============================================================================== --- vtigercrm/trunk/modules/HelpDesk/Save.php (original) +++ vtigercrm/trunk/modules/HelpDesk/Save.php Wed Aug 30 06:52:59 2006 @@ -29,7 +29,17 @@ setObjectValuesFromRequest(&$focus); +global $adb; +//Added to update the ticket history +//Before save we have to construct the update log. +$mode = $_REQUEST['mode']; +$fldvalue = $focus->constructUpdateLog(&$focus, $mode, $_REQUEST['assigned_group_name'], $_REQUEST['assigntype']); +$fldvalue = from_html($adb->formatString('vtiger_troubletickets','update_log',$fldvalue),($mode == 'edit')?true:false); + $focus->save("HelpDesk"); + +//After save the record, we should update the log +$adb->query("update vtiger_troubletickets set update_log=$fldvalue where ticketid=".$focus->id); //Added to retrieve the existing attachment of the ticket and save it for the new duplicated ticket if($_FILES['filename']['name'] == '' && $_REQUEST['mode'] != 'edit' && $_REQUEST['old_id'] != '') @@ -213,4 +223,5 @@ $log->debug("Exiting getTicketComments method ..."); return $commentlist; } + ?> From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 30 08:57:54 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 30 Aug 2006 12:57:54 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9200 - in /wordintegration/trunk: package/ resources/ resources/images/ resources/supportingdlls/ resources/supportingdlls/vb6runtime/ Message-ID: <20060830125754.3069D746839@vtiger.fosslabs.com> Author: richie Date: Wed Aug 30 06:49:51 2006 New Revision: 9200 Log: Files added to SVN --Jeri Added: wordintegration/trunk/package/ wordintegration/trunk/package/ACKNOWLEDGMENT.txt wordintegration/trunk/package/LICENSE_AGREEMENT.txt wordintegration/trunk/package/MSXML_3.0_LICENSE.txt wordintegration/trunk/package/PocketSOAP_LICENSE.txt wordintegration/trunk/package/VISUAL_STUDIO_LICENSE.txt wordintegration/trunk/resources/ wordintegration/trunk/resources/images/ wordintegration/trunk/resources/images/config.gif (with props) wordintegration/trunk/resources/images/vtiger.ico (with props) wordintegration/trunk/resources/images/vtiger.jpg (with props) wordintegration/trunk/resources/supportingdlls/ wordintegration/trunk/resources/supportingdlls/pSOAP32.dll (with props) wordintegration/trunk/resources/supportingdlls/pocketHTTP.dll (with props) wordintegration/trunk/resources/supportingdlls/psDime.dll (with props) wordintegration/trunk/resources/supportingdlls/psProxy.dll (with props) wordintegration/trunk/resources/supportingdlls/vb6runtime/ wordintegration/trunk/resources/supportingdlls/vb6runtime/ASYCFILT.DLL (with props) wordintegration/trunk/resources/supportingdlls/vb6runtime/COMCAT.DLL (with props) wordintegration/trunk/resources/supportingdlls/vb6runtime/MSVBVM60.DLL (with props) wordintegration/trunk/resources/supportingdlls/vb6runtime/OLEAUT32.DLL (with props) wordintegration/trunk/resources/supportingdlls/vb6runtime/OLEPRO32.DLL (with props) wordintegration/trunk/resources/supportingdlls/vb6runtime/STDOLE2.TLB (with props) wordintegration/trunk/resources/supportingdlls/vb6runtime/msxml3.dll (with props) From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 30 10:46:08 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 30 Aug 2006 14:46:08 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9201 - in /wordintegration/trunk/client/bin/Language: deutsch.ini english.ini french.ini german.ini portuguese.ini Message-ID: <20060830144608.CE9D174684C@vtiger.fosslabs.com> Author: richie Date: Wed Aug 30 08:45:41 2006 New Revision: 9201 Log: version changed --Jeri Modified: wordintegration/trunk/client/bin/Language/deutsch.ini wordintegration/trunk/client/bin/Language/english.ini wordintegration/trunk/client/bin/Language/french.ini wordintegration/trunk/client/bin/Language/german.ini wordintegration/trunk/client/bin/Language/portuguese.ini Modified: wordintegration/trunk/client/bin/Language/deutsch.ini ============================================================================== --- wordintegration/trunk/client/bin/Language/deutsch.ini (original) +++ wordintegration/trunk/client/bin/Language/deutsch.ini Wed Aug 30 08:45:41 2006 @@ -1,7 +1,7 @@ [vtigerCRM_Common] CompanyName=vtiger.com ProductName=vtiger Office Plug-in -ProductVersion=5.0 beta +ProductVersion=5.0.0 ProductSite=www.vtiger.com ProductLanguage=Deutsch @@ -36,7 +36,7 @@ Frame1_Label1=vtiger Benutzername: Frame1_Label2=vtiger Passwort: Frame1_Label3=vtiger URL: -Frame1_Label4=(z.B.: http://localhost/) +Frame1_Label4=(z.B.: http://en.vtiger.com/) Frame2=Proxy Einstellungen um vtiger via Internet zu erreichen Frame2_Label1=IP-Adresse: Frame2_Label2=Port: Modified: wordintegration/trunk/client/bin/Language/english.ini ============================================================================== Binary files - no diff available. Modified: wordintegration/trunk/client/bin/Language/french.ini ============================================================================== --- wordintegration/trunk/client/bin/Language/french.ini (original) +++ wordintegration/trunk/client/bin/Language/french.ini Wed Aug 30 08:45:41 2006 @@ -1,7 +1,7 @@ [vtigerCRM_Common] CompanyName=vtiger.com ProductName=vtiger Office Plug-in -ProductVersion=5.0 beta +ProductVersion=5.0.0 ProductSite=www.vtiger.com ProductLanguage=French @@ -36,7 +36,7 @@ Frame1_Label1=Nom d'utilisateur: Frame1_Label2=Mot de passe: Frame1_Label3=URL vTiger: -Frame1_Label4=(E.g.,http://localhost/) +Frame1_Label4=(E.g.,http://en.vtiger.com/) Frame2=Configurer Proxy pour acc?der ? vtiger CRM via Internet Frame2_Label1=Adresse: Frame2_Label2=Port: Modified: wordintegration/trunk/client/bin/Language/german.ini ============================================================================== Binary files - no diff available. Modified: wordintegration/trunk/client/bin/Language/portuguese.ini ============================================================================== --- wordintegration/trunk/client/bin/Language/portuguese.ini (original) +++ wordintegration/trunk/client/bin/Language/portuguese.ini Wed Aug 30 08:45:41 2006 @@ -1,7 +1,7 @@ [vtigerCRM_Common] CompanyName=vtiger.com ProductName=vtiger Office Plug-in -ProductVersion=5.0 beta +ProductVersion=5.0.0 ProductSite=www.vtiger.com ProductLanguage=Portugu?s @@ -36,7 +36,7 @@ Frame1_Label1=Utilizador vtiger: Frame1_Label2=Palavra chave vtiger: Frame1_Label3=URL do vtiger: -Frame1_Label4=(Exemplo: http://localhost/) +Frame1_Label4=(Exemplo: http://en.vtiger.com/) Frame2=Configure o proxy para aceder ao vtiger CRM Frame2_Label1=Endere?o: Frame2_Label2=Porta: From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 30 10:46:12 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 30 Aug 2006 14:46:12 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9202 - /wordintegration/trunk/client/source/frmConf.frm Message-ID: <20060830144612.EC2B4746841@vtiger.fosslabs.com> Author: richie Date: Wed Aug 30 08:45:52 2006 New Revision: 9202 Log: Demo URL modified --Jeri Modified: wordintegration/trunk/client/source/frmConf.frm Modified: wordintegration/trunk/client/source/frmConf.frm ============================================================================== Binary files - no diff available. From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 30 10:50:53 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 30 Aug 2006 14:50:53 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9203 - in /vtigercrmoutlook/trunk/vtigercrmoladdin/source: frmAbout.frm frmLogin.frm Message-ID: <20060830145053.BB17474684F@vtiger.fosslabs.com> Author: richie Date: Wed Aug 30 08:50:41 2006 New Revision: 9203 Log: version and demo url has been changed --Jeri Modified: vtigercrmoutlook/trunk/vtigercrmoladdin/source/frmAbout.frm vtigercrmoutlook/trunk/vtigercrmoladdin/source/frmLogin.frm Modified: vtigercrmoutlook/trunk/vtigercrmoladdin/source/frmAbout.frm ============================================================================== Binary files - no diff available. Modified: vtigercrmoutlook/trunk/vtigercrmoladdin/source/frmLogin.frm ============================================================================== Binary files - no diff available. From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 30 11:28:15 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 30 Aug 2006 15:28:15 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9204 - /vtigercrm/trunk/include/js/general.js Message-ID: <20060830152815.E849472A31A@vtiger.fosslabs.com> Author: richie Date: Wed Aug 30 09:27:55 2006 New Revision: 9204 Log: line breaks checked in trim function --Jeri Modified: vtigercrm/trunk/include/js/general.js Modified: vtigercrm/trunk/include/js/general.js ============================================================================== --- vtigercrm/trunk/include/js/general.js (original) +++ vtigercrm/trunk/include/js/general.js Wed Aug 30 09:27:55 2006 @@ -1421,11 +1421,11 @@ function trim(s) { - while (s.substring(0,1) == " ") + while (s.substring(0,1) == " " || s.substring(0,1) == "\n") { s = s.substring(1, s.length); } - while (s.substring(s.length-1, s.length) == ' ') { + while (s.substring(s.length-1, s.length) == " " || s.substring(s.length-1,s.length) == "\n") { s = s.substring(0,s.length-1); } return s; From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 30 11:29:10 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 30 Aug 2006 15:29:10 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9205 - /vtigercrm/trunk/modules/Users/DefaultDataPopulator.php Message-ID: <20060830152910.6391472A31A@vtiger.fosslabs.com> Author: richie Date: Wed Aug 30 09:29:02 2006 New Revision: 9205 Log: Sales Stage UI type changed back to 16 from 111 --Jeri Modified: vtigercrm/trunk/modules/Users/DefaultDataPopulator.php Modified: vtigercrm/trunk/modules/Users/DefaultDataPopulator.php ============================================================================== --- vtigercrm/trunk/modules/Users/DefaultDataPopulator.php (original) +++ vtigercrm/trunk/modules/Users/DefaultDataPopulator.php Wed Aug 30 09:29:02 2006 @@ -350,7 +350,7 @@ $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'potentialtype','vtiger_potential',1,'15','opportunity_type','Type',1,0,0,100,6,1,1,'V~O',1,null,'BAS')"); $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'nextstep','vtiger_potential',1,'1','nextstep','Next Step',1,0,0,100,7,1,1,'V~O',1,null,'BAS')"); $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'leadsource','vtiger_potential',1,'15','leadsource','Lead Source',1,0,0,100,8,1,1,'V~O',1,null,'BAS')"); - $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'sales_stage','vtiger_potential',1,'111','sales_stage','Sales Stage',1,0,0,100,9,1,1,'V~O',0,4,'BAS')"); + $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'sales_stage','vtiger_potential',1,'16','sales_stage','Sales Stage',1,0,0,100,9,1,1,'V~O',0,4,'BAS')"); $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'smownerid','vtiger_crmentity',1,'53','assigned_user_id','Assigned To',1,0,0,100,10,1,1,'V~M',1,null,'BAS')"); $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'probability','vtiger_potential',1,'9','probability','Probability',1,0,0,100,11,1,1,'N~O',1,null,'BAS')"); $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'campaignid','vtiger_potential',1,'58','campaignid','Campaign Source',1,0,0,100,12,1,1,'N~O',1,null,'BAS')"); From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 30 11:31:09 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 30 Aug 2006 15:31:09 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9206 - /vtigercrm/trunk/Smarty/templates/DetailViewFields.tpl Message-ID: <20060830153109.B13997467BA@vtiger.fosslabs.com> Author: richie Date: Wed Aug 30 09:30:52 2006 New Revision: 9206 Log: UI Type 111 added --Jeri Modified: vtigercrm/trunk/Smarty/templates/DetailViewFields.tpl Modified: vtigercrm/trunk/Smarty/templates/DetailViewFields.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/DetailViewFields.tpl (original) +++ vtigercrm/trunk/Smarty/templates/DetailViewFields.tpl Wed Aug 30 09:30:52 2006 @@ -25,7 +25,7 @@ {elseif $keyid eq '13'} - {elseif $keyid eq '15' || $keyid eq '16'} + {elseif $keyid eq '15' || $keyid eq '16' || $keyid eq '111'} {elseif $keyid eq '17'} From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 30 11:34:43 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 30 Aug 2006 15:34:43 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9207 - in /vtigercrm/trunk/Smarty/templates/Settings: EditPickList.tpl PickList.tpl PickListContents.tpl Message-ID: <20060830153443.D263A7467BA@vtiger.fosslabs.com> Author: richie Date: Wed Aug 30 09:34:31 2006 New Revision: 9207 Log: Edit allowed for newly added Picklist values and validation integrated --Jeri Modified: vtigercrm/trunk/Smarty/templates/Settings/EditPickList.tpl vtigercrm/trunk/Smarty/templates/Settings/PickList.tpl vtigercrm/trunk/Smarty/templates/Settings/PickListContents.tpl Modified: vtigercrm/trunk/Smarty/templates/Settings/EditPickList.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/Settings/EditPickList.tpl (original) +++ vtigercrm/trunk/Smarty/templates/Settings/EditPickList.tpl Wed Aug 30 09:34:31 2006 @@ -43,7 +43,11 @@
 ".get_previous_cal($cal)." "; - $minical .= "date_time->get_date_str()."&parenttab=".$category."'>".display_date($cal['view'],$cal['calendar']->date_time)." ".get_next_cal($cal)."".get_previous_cal($cal)." "; + $minical .= "date_time->get_date_str()."&parenttab=".$category."'>".display_date($cal['view'],$cal['calendar']->date_time)." ".get_next_cal($cal)."
Week'.$weekday.''.$weekday.'
start_time->get_date_str()."&parenttab=".$category."'>".$cal['slice']->start_time->week.""; - $minical .= "getView()."&".$cal['slice']->start_time->get_date_str()."&parenttab=".$category."'>"; + //To display month dates if ($cal['slice']->start_time->getMonth() == $cal['calendar']->date_time->getMonth()) { - $minical .= $cal['slice']->start_time->get_Date(); + $minical .= ""; + $minical .= "getView()."".$cal['slice']->start_time->get_date_str()."&parenttab=".$category."'>"; + $minical .= $cal['slice']->start_time->get_Date()."
'; - $monthview_layout .= ''; + $monthview_layout .= ''; $monthview_layout .= $cal['slice']->start_time->get_Date(); $monthview_layout .= ''; $monthview_layout .= '
'.$mod_strings['cal_weekdays_short'][$w].''.$mod_strings['cal_weekdays_short'][$w].'
 {$keyval}  {$keyval}
Modified: vtigercrm/trunk/Smarty/templates/Settings/PickList.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/Settings/PickList.tpl (original) +++ vtigercrm/trunk/Smarty/templates/Settings/PickList.tpl Wed Aug 30 09:34:31 2006 @@ -168,7 +168,7 @@ {/literal} Modified: vtigercrm/trunk/Smarty/templates/Settings/PickListContents.tpl ============================================================================== --- vtigercrm/trunk/Smarty/templates/Settings/PickListContents.tpl (original) +++ vtigercrm/trunk/Smarty/templates/Settings/PickListContents.tpl Wed Aug 30 09:34:31 2006 @@ -30,11 +30,7 @@ {/if} {else} From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 30 11:51:44 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 30 Aug 2006 15:51:44 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9208 - /vtigercrm/trunk/include/utils/ListViewUtils.php Message-ID: <20060830155144.B831F74685C@vtiger.fosslabs.com> Author: richie Date: Wed Aug 30 09:51:32 2006 New Revision: 9208 Log: lablel issue in custom field has been fixed --Jeri Modified: vtigercrm/trunk/include/utils/ListViewUtils.php Modified: vtigercrm/trunk/include/utils/ListViewUtils.php ============================================================================== --- vtigercrm/trunk/include/utils/ListViewUtils.php (original) +++ vtigercrm/trunk/include/utils/ListViewUtils.php Wed Aug 30 09:51:32 2006 @@ -150,9 +150,12 @@ { $lbl_name = $app_strings[$name]; } - else + elseif($mod_strings[$name]) { $lbl_name = $mod_strings[$name]; + }else + { + $lbl_name = $name; } //added to display vtiger_currency symbol in listview header if($lbl_name =='Amount') From vtigercrm-commits at vtiger.fosslabs.com Wed Aug 30 14:28:27 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 30 Aug 2006 18:28:27 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9209 - /vtigercrm/trunk/soap/vtigerolservice.php Message-ID: <20060830182827.A531F746824@vtiger.fosslabs.com> Author: richie Date: Wed Aug 30 12:28:17 2006 New Revision: 9209 Log: Issue in Plugin has been fixed --Jeri Modified: vtigercrm/trunk/soap/vtigerolservice.php Modified: vtigercrm/trunk/soap/vtigerolservice.php ============================================================================== --- vtigercrm/trunk/soap/vtigerolservice.php (original) +++ vtigercrm/trunk/soap/vtigerolservice.php Wed Aug 30 12:28:17 2006 @@ -601,13 +601,13 @@ if($cntrow["middlename"] != "") { $contact->column_fields[lastname]=$cntrow["middlename"]." ".$cntrow["lastname"]; - }elseif($cntrow["middlename"] != "") + }elseif($cntrow["lastname"] != "") { $contact->column_fields[lastname]=$cntrow["lastname"]; }else { $contact->column_fields[lastname]=$cntrow["firstname"]." ".$cntrow["middlename"]." ".$cntrow["lastname"]; - } + } $contact->column_fields[birthday]= in_array('birthday',$permitted_lists) ? getDisplayDate($cntrow["birthdate"]) : ""; $contact->column_fields[email]=in_array('email',$permitted_lists) ? $cntrow["emailaddress"] : ""; @@ -688,7 +688,7 @@ }else { $contact->column_fields[lastname]=$cntrow["firstname"]." ".$cntrow["middlename"]." ".$cntrow["lastname"]; - } + } $contact->column_fields[birthday]= in_array('birthday',$permitted_lists) ? getDisplayDate($cntrow["birthdate"]) : ""; $contact->column_fields[email]= in_array('email',$permitted_lists) ? $cntrow["emailaddress"] : ""; From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 31 02:42:06 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 31 Aug 2006 06:42:06 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9210 - /vtigercrm/trunk/modules/Settings/EditComboField.php Message-ID: <20060831064206.1E46A7468B8@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 31 00:42:02 2006 New Revision: 9210 Log: Added empty check for picklist values -- ahmed Modified: vtigercrm/trunk/modules/Settings/EditComboField.php Modified: vtigercrm/trunk/modules/Settings/EditComboField.php ============================================================================== --- vtigercrm/trunk/modules/Settings/EditComboField.php (original) +++ vtigercrm/trunk/modules/Settings/EditComboField.php Thu Aug 31 00:42:02 2006 @@ -83,6 +83,10 @@ $query = 'select fieldlabel from vtiger_tab inner join vtiger_field on vtiger_tab.tabid=vtiger_field.tabid where vtiger_tab.name="'.$moduleName.'" and fieldname="'.$tableName.'"'; $fieldlabel = $adb->query_result($adb->query($query),0,'fieldlabel'); +if($nonedit_fldVal == '') + $smarty->assign("EDITABLE_MODE","edit"); + else + $smarty->assign("EDITABLE_MODE","nonedit"); $smarty->assign("NON_EDITABLE_ENTRIES", $nonedit_fldVal); $smarty->assign("ENTRIES",$fldVal); $smarty->assign("MODULE",$moduleName); From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 31 03:30:32 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 31 Aug 2006 07:30:32 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9211 - /vtigercrm/trunk/pkg/php/php.ini Message-ID: <20060831073032.B64BC7468CB@vtiger.fosslabs.com> Author: richie Date: Thu Aug 31 01:30:22 2006 New Revision: 9211 Log: MySQl Socket path added --Jeri Modified: vtigercrm/trunk/pkg/php/php.ini Modified: vtigercrm/trunk/pkg/php/php.ini ============================================================================== --- vtigercrm/trunk/pkg/php/php.ini (original) +++ vtigercrm/trunk/pkg/php/php.ini Thu Aug 31 01:30:22 2006 @@ -656,7 +656,7 @@ ; Default socket name for local MySQL connects. If empty, uses the built-in ; MySQL defaults. -mysql.default_socket = +mysql.default_socket = MYSQLSOCKET ; Default host for mysql_connect() (doesn't apply in safe mode). mysql.default_host = From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 31 03:45:02 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 31 Aug 2006 07:45:02 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9212 - in /vtigertoolbar/trunk/firefox/chrome/content: vtiger_loginconfig.xul vtigercrm_toolbar.js vtigertoolbar.xul Message-ID: <20060831074502.2FED07468CB@vtiger.fosslabs.com> Author: richie Date: Thu Aug 31 01:44:47 2006 New Revision: 9212 Log: Logout options given and security implemented for Firefox toolbar --Jeri Modified: vtigertoolbar/trunk/firefox/chrome/content/vtiger_loginconfig.xul vtigertoolbar/trunk/firefox/chrome/content/vtigercrm_toolbar.js vtigertoolbar/trunk/firefox/chrome/content/vtigertoolbar.xul Modified: vtigertoolbar/trunk/firefox/chrome/content/vtiger_loginconfig.xul ============================================================================== Binary files - no diff available. Modified: vtigertoolbar/trunk/firefox/chrome/content/vtigercrm_toolbar.js ============================================================================== Binary files - no diff available. Modified: vtigertoolbar/trunk/firefox/chrome/content/vtigertoolbar.xul ============================================================================== Binary files - no diff available. From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 31 03:48:24 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 31 Aug 2006 07:48:24 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9213 - /thunderbirdextn/trunk/install.rdf Message-ID: <20060831074824.CC3337468CB@vtiger.fosslabs.com> Author: richie Date: Thu Aug 31 01:48:16 2006 New Revision: 9213 Log: Version changed --Jeri Modified: thunderbirdextn/trunk/install.rdf Modified: thunderbirdextn/trunk/install.rdf ============================================================================== Binary files - no diff available. From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 31 03:49:55 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 31 Aug 2006 07:49:55 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9214 - in /thunderbirdextn/trunk/chrome/vtiger/content/vtiger: addtovtiger.js vtiger-settings.xul Message-ID: <20060831074955.6A0607468CB@vtiger.fosslabs.com> Author: richie Date: Thu Aug 31 01:49:46 2006 New Revision: 9214 Log: Demo url Changed --Jeri Modified: thunderbirdextn/trunk/chrome/vtiger/content/vtiger/addtovtiger.js thunderbirdextn/trunk/chrome/vtiger/content/vtiger/vtiger-settings.xul Modified: thunderbirdextn/trunk/chrome/vtiger/content/vtiger/addtovtiger.js ============================================================================== Binary files - no diff available. Modified: thunderbirdextn/trunk/chrome/vtiger/content/vtiger/vtiger-settings.xul ============================================================================== Binary files - no diff available. From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 31 06:23:31 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 31 Aug 2006 10:23:31 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9215 - /vtigercrm/trunk/modules/Calendar/calendarLayout.php Message-ID: <20060831102331.945377468E8@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 31 04:23:27 2006 New Revision: 9215 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/calendarLayout.php Modified: vtigercrm/trunk/modules/Calendar/calendarLayout.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/calendarLayout.php (original) +++ vtigercrm/trunk/modules/Calendar/calendarLayout.php Thu Aug 31 04:23:27 2006 @@ -574,11 +574,11 @@ "; $list_view .="
+ {if $NON_EDITABLE_ENTRIES neq ''} + {else} + + {/if}
{$picklistfields.fieldlabel} - {if $picklistfields.fieldname neq 'eventstatus' && $picklistfields.fieldname neq 'taskstatus'} - - {else} -   - {/if} +  
-
+ - +
"; @@ -636,13 +636,13 @@ $list_view .="
"; //To get Todos listView $list_view .= constructTodoListView($todo_list,$cal,$subtab); - $list_view .="
+ $list_view .=" - + @@ -701,7 +701,10 @@ } else { - $hour = $i; + if($i == 0) + $hour = 12; + else + $hour = $i; $sub_str = 'am'; } @@ -718,10 +721,20 @@ $hour_endat = convertTime2UserSelectedFmt($format,$y,false); $time_arr = getaddEventPopupTime($hour_startat,$hour_endat,$format); $temp_ts = $cal['calendar']->date_time->ts; - $temp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$temp_ts)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$temp_ts)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $temp_ts)):('')))); + $sttemp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$temp_ts)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$temp_ts)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $temp_ts)):('')))); + if($i != 23) + { + $endtemp_date = $sttemp_date; + } + else + { + $addday = $temp_ts + (1 * 24 * 60 * 60); + $endtemp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$addday)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$addday)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $addday)):('')))); + } + $js_string = ""; if(isPermitted("Calendar","EditView") == "yes") - $js_string = 'onClick="gshow(\'addEvent\',\'call\',\''.$temp_date.'\',\''.$temp_date.'\',\''.$time_arr['starthour'].'\',\''.$time_arr['startmin'].'\',\''.$time_arr['startfmt'].'\',\''.$time_arr['endhour'].'\',\''.$time_arr['endmin'].'\',\''.$time_arr['endfmt'].'\',\'hourview\',\'event\')"'; + $js_string = 'onClick="gshow(\'addEvent\',\'call\',\''.$sttemp_date.'\',\''.$endtemp_date.'\',\''.$time_arr['starthour'].'\',\''.$time_arr['startmin'].'\',\''.$time_arr['startfmt'].'\',\''.$time_arr['endhour'].'\',\''.$time_arr['endmin'].'\',\''.$time_arr['endfmt'].'\',\'hourview\',\'event\')"'; $dayview_layout .= ' '.$hour.''.$sub_str.''; //To display events in Dayview @@ -796,7 +809,10 @@ } else { - $hour = $i; + if($i == 0) + $hour = 12; + else + $hour = $i; $sub_str = 'am'; } @@ -816,12 +832,19 @@ for ($column=0;$column<=6;$column++) { $temp_ts = $cal['calendar']->week_array[$cal['calendar']->slices[$column]]->start_time->ts; - $temp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$temp_ts)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$temp_ts)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $temp_ts)):('')))); - - $weekview_layout .= ''; - $weekview_layout .= ''; @@ -1131,7 +1162,7 @@ { for($i=0;$iweek_slice[$slice]->start_time->hour.'_'.$i; + $arrow_img_name = 'weekevent'.$cal['calendar']->week_slice[$slice]->start_time->get_formatted_date().'_'.$i; $id = $act[$i]->record; $subject = $act[$i]->subject; if(strlen($subject)>25) @@ -1141,7 +1172,7 @@ $duration_min = $act[$i]->duration_minute; $start_time = $act[$i]->start_time->hour.':'.$act[$i]->start_time->minute; $end_time = $act[$i]->end_time->hour.':'.$act[$i]->end_time->minute; - $st_end_time = convertStEdTime2UserSelectedFmt($format,$start_time,$duration_hour,$duration_min); + //$st_end_time = convertStEdTime2UserSelectedFmt($format,$start_time,$duration_hour,$duration_min); //$start_hour = $st_end_time['starttime']; //$end_hour = $st_end_time['endtime']; $value = getaddEventPopupTime($start_time,$end_time,$format); @@ -1149,18 +1180,25 @@ $end_hour = $value['endhour'] .':'.$value['endmin'].''.$value['endfmt']; $account_name = $act[$i]->accountname; $eventstatus = $act[$i]->eventstatus; + $user = $act[$i]->owner; + $priority = $act[$i]->priority; $image = $cal['IMAGE_PATH'].''.$act[$i]->image_name; $color = $act[$i]->color; - $eventlayer .='
+ if(isPermitted("Calendar","EditView") == "yes") + $javacript_str = 'onMouseOver="cal_show(\''.$arrow_img_name.'\');" onMouseOut="fnHide_Event(\''.$arrow_img_name.'\');"'; + $action_str = ''; + + $eventlayer .='
- + +
'.$start_hour.' - '.$end_hour.'
  '.$subject.'
'.$action_str.'('.$user.' | '.$eventstatus.' | '.$priority.')

'; } @@ -1209,7 +1247,7 @@ $format = $cal['calendar']->hour_format; $duration_hour = $act[$i]->duration_hour; $duration_min = $act[$i]->duration_minute; - $st_end_time = convertStEdTime2UserSelectedFmt($format,$start_time,$duration_hour,$duration_min); + //$st_end_time = convertStEdTime2UserSelectedFmt($format,$start_time,$duration_hour,$duration_min); //$start_hour = $st_end_time['starttime']; //$end_hour = $st_end_time['endtime']; $value = getaddEventPopupTime($start_time,$end_time,$format); @@ -1307,7 +1345,7 @@ $start_time = $adb->query_result($result,$i,"time_start"); $end_time = $adb->query_result($result,$i,"time_end"); $format = $calendar['calendar']->hour_format; - $st_end_time = convertStEdTime2UserSelectedFmt($format,$start_time,$duration_hour,$duration_min); + //$st_end_time = convertStEdTime2UserSelectedFmt($format,$start_time,$duration_hour,$duration_min); $value = getaddEventPopupTime($start_time,$end_time,$format); $start_hour = $value['starthour'].':'.$value['startmin'].''.$value['startfmt']; $end_hour = $value['endhour'] .':'.$value['endmin'].''.$value['endfmt']; @@ -1420,8 +1458,9 @@ $more_link = ""; $start_time = $adb->query_result($result,$i,"time_start"); $format = $calendar['calendar']->hour_format; - $st_end_time = convertStEdTime2UserSelectedFmt($format,$start_time); - $element['starttime'] = $st_end_time['starttime']; + //$st_end_time = convertStEdTime2UserSelectedFmt($format,$start_time); + $value = getaddEventPopupTime($start_time,$start_time,$format); + $element['starttime'] = $value['starthour'].':'.$value['startmin'].''.$value['startfmt']; $id = $adb->query_result($result,$i,"activityid"); $subject = $adb->query_result($result,$i,"subject"); $status = $adb->query_result($result,$i,"status"); @@ -1486,6 +1525,13 @@ $temp_ts = $cal['calendar']->date_time->ts; //to get date in user selected date format $temp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$temp_ts)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$temp_ts)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $temp_ts)):('')))); + if($cal['calendar']->day_start_hour != 23) + $endtemp_date = $temp_date; + else + { + $endtemp_ts = $temp_ts + (1 * 24 * 60 * 60); + $endtemp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$endtemp_ts)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$endtemp_ts)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $endtemp_ts)):('')))); + } $list_view = ""; if($cal['view'] == 'day') { @@ -1508,21 +1554,21 @@ '6'=>$mod_strings['LBL_STATUS'], '7'=>$mod_strings['LBL_ASSINGEDTO'], ); - $header_width = Array('0'=>'5', - '1'=>'10', - '2'=>'10', - '3'=>'10', - '4'=>'30', - '5'=>'10', - '6'=>'10', - '7'=>'15' + $header_width = Array('0'=>'5%', + '1'=>'10%', + '2'=>'10%', + '3'=>'10%', + '4'=>'28%', + '5'=>'10%', + '6'=>'10%', + '7'=>'15%' ); $list_view .=""; $header_rows = count($header); for($i=0;$i<$header_rows;$i++) { - $list_view .=""; + $list_view .=""; } $list_view .=""; $rows = count($entry_list); @@ -1533,7 +1579,7 @@ $list_view .=""; foreach($entry_list[$i] as $key=>$entry) { - $list_view .=""; + $list_view .=""; } $list_view .=""; } @@ -1554,8 +1600,8 @@ if(isPermitted("Calendar","EditView") == "yes") { $list_view .=""; } else @@ -1591,6 +1637,13 @@ $temp_ts = $cal['calendar']->date_time->ts; //to get date in user selected date format $temp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$temp_ts)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$temp_ts)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $temp_ts)):('')))); + if($cal['calendar']->day_start_hour != 23) + $endtemp_date = $temp_date; + else + { + $endtemp_ts = $temp_ts + (1 * 24 * 60 * 60); + $endtemp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$endtemp_ts)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$endtemp_ts)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $endtemp_ts)):('')))); + } $list_view = ""; //labels of listview header $header = Array('0'=>'#', @@ -1602,7 +1655,7 @@ ); $header_width = Array('0'=>'5%', '1'=>'10%', - '2'=>'50%', + '2'=>'48%', '3'=>'10%', '4'=>'10%', '5'=>'15%', @@ -1613,7 +1666,7 @@ if(isPermitted("Calendar","EditView") == "yes") { $list_view .=" - "; } @@ -1631,7 +1684,7 @@ $header_rows = count($header); for($i=0;$i<$header_rows;$i++) { - $list_view .=""; + $list_view .=""; } $list_view .=""; $rows = count($todo_list); From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 31 06:24:05 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 31 Aug 2006 10:24:05 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9216 - /vtigercrm/trunk/modules/Calendar/script.js Message-ID: <20060831102405.252DF7468E8@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 31 04:24:01 2006 New Revision: 9216 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/script.js Modified: vtigercrm/trunk/modules/Calendar/script.js ============================================================================== --- vtigercrm/trunk/modules/Calendar/script.js (original) +++ vtigercrm/trunk/modules/Calendar/script.js Thu Aug 31 04:24:01 2006 @@ -210,7 +210,10 @@ } else { - starthour = starthour; + if(starthour == '12') + starthour = 0; + else + starthour = starthour; startmin = startmin; } } @@ -226,7 +229,10 @@ } else { - endhour = endhour; + if(endhour == '12') + endhour = 0; + else + endhour = endhour; endmin = endmin; } } @@ -326,7 +332,10 @@ } else { - starthour = starthour; + if(starthour == '12') + starthour = 0; + else + starthour = starthour; startmin = startmin; } } @@ -342,7 +351,10 @@ } else { - endhour = endhour; + if(endhour == '12') + endhour == 0; + else + endhour = endhour; endmin = endmin; } } @@ -419,12 +431,19 @@ { if(startformat == 'pm') { - starthour = eval(starthour) + 12; + if(starthour == '12') + starthour = 12; + else + starthour = eval(starthour) + 12; + startmin = startmin; } else { - starthour = starthour; + if(starthour == '12') + starthour = 0; + else + starthour = starthour; startmin = startmin; } } @@ -450,12 +469,18 @@ { if(startformat == 'pm') { - starthour = eval(starthour) + 12; + if(starthour == '12') + starthour = 12; + else + starthour = eval(starthour) + 12; startmin = startmin; } else { - starthour = starthour; + if(starthour == '12') + starthour = 0; + else + starthour = starthour; startmin = startmin; } } From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 31 06:24:52 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 31 Aug 2006 10:24:52 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9217 - /vtigercrm/trunk/modules/Calendar/Save.php Message-ID: <20060831102452.F28D37468E8@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 31 04:24:49 2006 New Revision: 9217 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/Save.php Modified: vtigercrm/trunk/modules/Calendar/Save.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/Save.php (original) +++ vtigercrm/trunk/modules/Calendar/Save.php Thu Aug 31 04:24:49 2006 @@ -112,14 +112,15 @@ $adb->query($sql); } } -if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] == "Contacts") -{ - if(isset($_REQUEST['return_id']) && $_REQUEST['return_id'] != "") - { - $sql = "insert into vtiger_cntactivityrel values (".$_REQUEST['return_id'].",".$focus->id.")"; - $adb->query($sql); - } -} +if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] == "Contacts" && $_REQUEST['activity_mode'] == 'Events') +{ + if(isset($_REQUEST['return_id']) && $_REQUEST['return_id'] != "") + { + $sql = "insert into vtiger_cntactivityrel values (".$_REQUEST['return_id'].",".$focus->id.")"; + $adb->query($sql); + } +} + $activemode = ""; if($activity_mode != '') $activemode = "&activity_mode=".$activity_mode; From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 31 06:25:36 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 31 Aug 2006 10:25:36 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9218 - /vtigercrm/trunk/modules/Calendar/TodoSave.php Message-ID: <20060831102536.32B167468C2@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 31 04:25:32 2006 New Revision: 9218 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/TodoSave.php Modified: vtigercrm/trunk/modules/Calendar/TodoSave.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/TodoSave.php (original) +++ vtigercrm/trunk/modules/Calendar/TodoSave.php Thu Aug 31 04:25:32 2006 @@ -40,8 +40,11 @@ $focus->column_fields["date_start"] = $_REQUEST["task_date_start"]; $focus->column_fields["due_date"] = $_REQUEST["task_due_date"]; $focus->column_fields["taskpriority"] = $_REQUEST["taskpriority"]; + $focus->column_fields["parent_id"] = $_REQUEST["task_parent_id"]; + $focus->column_fields["contact_id"] = $_REQUEST["task_contact_id"]; $focus->column_fields["description"] = $_REQUEST["task_description"]; - $focus->column_fields["sendnotification"] = $_REQUEST["task_sendnotification"]; + if(isset($_REQUEST['task_sendnotification']) && $_REQUEST['task_sendnotification'] != null) + $focus->column_fields["sendnotification"] = $_REQUEST["task_sendnotification"]; $focus->save($tab_type); header("Location: index.php?action=index&module=Calendar&view=".$_REQUEST['view']."&hour=".$_REQUEST['hour']."&day=".$_REQUEST['day']."&month=".$_REQUEST['month']."&year=".$_REQUEST['year']."&viewOption=".$_REQUEST['viewOption']."&subtab=".$_REQUEST['subtab']."&parenttab=".$_REQUEST['parenttab']); From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 31 06:26:29 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 31 Aug 2006 10:26:29 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9219 - /vtigercrm/trunk/modules/Calendar/addEventUI.php Message-ID: <20060831102629.77D5C7468C2@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 31 04:26:25 2006 New Revision: 9219 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/addEventUI.php Modified: vtigercrm/trunk/modules/Calendar/addEventUI.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/addEventUI.php (original) +++ vtigercrm/trunk/modules/Calendar/addEventUI.php Thu Aug 31 04:26:25 2006 @@ -177,30 +177,10 @@ - -
- - - - - '; -?>
".$header[$i]."".$header[$i]."
".$entry."".$entry."
".$app_strings['LBL_YOU_CAN_CREATE']." ".$app_strings['LBL_AN']." ".$app_strings['Event']." ".$app_strings['LBL_NOW'].". ".$app_strings['LBL_CLICK_THE_LINK']." :
-   -".$app_strings['LBL_CREATE']." ".$app_strings['LBL_A']." ".$app_strings['Meeting']."
-   -".$app_strings['LBL_CREATE']." ".$app_strings['LBL_A']." ".$app_strings['Call']."
+   -".$app_strings['LBL_CREATE']." ".$app_strings['LBL_A']." ".$app_strings['Meeting']."
+   -".$app_strings['LBL_CREATE']." ".$app_strings['LBL_A']." ".$app_strings['Call']."
+ ".$mod_strings['LBL_ADD']." ".$header[$i]."".$header[$i]."
- +
@@ -598,39 +578,12 @@ - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - @@ -862,9 +775,6 @@ var fielddatatype = new Array('V~M','D~M~time_start','T~O','V~O'); -
From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 31 06:27:07 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 31 Aug 2006 10:27:07 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9220 - /vtigercrm/trunk/modules/Calendar/Appointment.php Message-ID: <20060831102707.A00EA7468B8@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 31 04:27:03 2006 New Revision: 9220 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/Appointment.php Modified: vtigercrm/trunk/modules/Calendar/Appointment.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/Appointment.php (original) +++ vtigercrm/trunk/modules/Calendar/Appointment.php Thu Aug 31 04:27:03 2006 @@ -28,6 +28,7 @@ var $ownerid; var $assignedto; var $eventstatus; + var $priority; var $activity_type; var $description; var $record; @@ -133,6 +134,7 @@ //$this->account_name = $act_array["accountname"]; //$this->account_id = $act_array["accountid"]; $this->eventstatus = $act_array["eventstatus"]; + $this->priority = $act_array["priority"]; $this->subject = $act_array["subject"]; $this->activity_type = $act_array["activitytype"]; $this->duration_hour = $act_array["duration_hours"]; From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 31 06:27:40 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 31 Aug 2006 10:27:40 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9221 - /vtigercrm/trunk/modules/Calendar/Activity.php Message-ID: <20060831102741.0BC597468C2@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 31 04:27:37 2006 New Revision: 9221 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/Activity.php Modified: vtigercrm/trunk/modules/Calendar/Activity.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/Activity.php (original) +++ vtigercrm/trunk/modules/Calendar/Activity.php Thu Aug 31 04:27:37 2006 @@ -57,7 +57,6 @@ 'Close'=>Array('activity'=>'status'), 'Type'=>Array('activity'=>'activitytype'), 'Subject'=>Array('activity'=>'subject'), - 'Contact Name'=>Array('contactdetails'=>'lastname'), 'Related to'=>Array('seactivityrel'=>'activityid'), 'Start Date'=>Array('activity'=>'date_start'), 'End Date'=>Array('activity'=>'due_date'), From vtigercrm-commits at vtiger.fosslabs.com Thu Aug 31 06:28:14 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 31 Aug 2006 10:28:14 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9222 - /vtigercrm/trunk/modules/Calendar/CalendarCommon.php Message-ID: <20060831102814.498F27468C2@vtiger.fosslabs.com> Author: saraj Date: Thu Aug 31 04:28:10 2006 New Revision: 9222 Log: changes made to fix the calendar related issue --Minnie Modified: vtigercrm/trunk/modules/Calendar/CalendarCommon.php Modified: vtigercrm/trunk/modules/Calendar/CalendarCommon.php ============================================================================== --- vtigercrm/trunk/modules/Calendar/CalendarCommon.php (original) +++ vtigercrm/trunk/modules/Calendar/CalendarCommon.php Thu Aug 31 04:28:10 2006 @@ -98,40 +98,51 @@ $hr = $sthr+0; if($hr <= 11) { + if($hr == 0) + $sthr = 12; $timearr['starthour'] = $sthr; $timearr['startfmt'] = 'am'; } else { - if($hr == 12) - $sthr = $hr; - else - $sthr = $hr - 12; + if($hr == 12) $sthr = $hr; + else $sthr = $hr - 12; + if($sthr <= 9 && strlen(trim($sthr)) < 2) - { $hrvalue= '0'.$sthr; - }else $hrvalue=$sthr; + else $hrvalue=$sthr; + $timearr['starthour'] = $hrvalue; $timearr['startfmt'] = 'pm'; } - $ehr = $edhr+0; - if($ehr <= 11) + $edhr = $edhr+0; + if($edhr <= 11) { - $timearr['endhour'] = $edhr; + if($edhr == 0) + $edhr = 12; + + if($edhr <= 9 && strlen(trim($edhr)) < 2) + $edhr = '0'.$edhr; + $timearr['endhour'] = $edhr; $timearr['endfmt'] = 'am'; } else { + $fmt = 'pm'; if($edhr == 12) $edhr = $edhr; else + { $edhr = $edhr - 12; + if($edhr == 12) + $fmt = 'am'; + } if($edhr <= 9 && strlen(trim($edhr)) < 2) - { $hrvalue= '0'.$edhr; - }else $hrvalue=$edhr; + else $hrvalue=$edhr; + $timearr['endhour'] = $hrvalue; - $timearr['endfmt'] = 'pm'; + $timearr['endfmt'] = $fmt; } $timearr['startmin'] = $stmin; $timearr['endmin'] = $edmin; @@ -139,6 +150,10 @@ } if($format == '24') { + if($edhr <= 9 && strlen(trim($edhr)) < 2) + $edhr = '0'.$edhr; + if($sthr <= 9 && strlen(trim($sthr)) < 2) + $sthr = '0'.$sthr; $timearr['starthour'] = $sthr; $timearr['startmin'] = $stmin; $timearr['startfmt'] = ''; @@ -162,19 +177,27 @@ if($format == 'am/pm') { $combo .= ' '; $combo .= 'Hr '; $combo .= 'start_hour != ''){?> checked onClick="enableCalstarttime();">