[Vtigercrm-commits] [vtiger-commits] r10808 - in /vtigercrm/branches/5.0.3: include/language/en_us.lang.php include/utils/DetailViewUtils.php include/utils/EditViewUtils.php modules/Quotes/Quotes.php modules/Users/DefaultDataPopulator.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Sat Apr 28 06:17:46 EDT 2007
Author: richie
Date: Sat Apr 28 04:17:32 2007
New Revision: 10808
Log:
patch for Add attachments to Quotes integrated. Fixes #3087 --minnie
Modified:
vtigercrm/branches/5.0.3/include/language/en_us.lang.php
vtigercrm/branches/5.0.3/include/utils/DetailViewUtils.php
vtigercrm/branches/5.0.3/include/utils/EditViewUtils.php
vtigercrm/branches/5.0.3/modules/Quotes/Quotes.php
vtigercrm/branches/5.0.3/modules/Users/DefaultDataPopulator.php
Modified: vtigercrm/branches/5.0.3/include/language/en_us.lang.php
==============================================================================
--- vtigercrm/branches/5.0.3/include/language/en_us.lang.php (original)
+++ vtigercrm/branches/5.0.3/include/language/en_us.lang.php Sat Apr 28 04:17:32 2007
@@ -489,6 +489,7 @@
'LBL_SORDER_NAME' => 'Sales Order',
'COMBO_INVOICES' => 'Invoice',
'LBL_INVOICE_NAME' => 'Invoice',
+'LBL_QUOTES_NAME' => 'Quote',
'LBL_HELPDESK_NAME' => 'Trouble Ticket',
'LBL_CAMPAIGN_NAME' => 'Campaign Name',
'LBL_NEW_INVOICE_BUTTON_TITLE' => 'New Invoice [Alt+I]',
Modified: vtigercrm/branches/5.0.3/include/utils/DetailViewUtils.php
==============================================================================
--- vtigercrm/branches/5.0.3/include/utils/DetailViewUtils.php (original)
+++ vtigercrm/branches/5.0.3/include/utils/DetailViewUtils.php Sat Apr 28 04:17:32 2007
@@ -558,6 +558,15 @@
$invoicename= $adb->query_result($result,0,"subject");
$label_fld[] ='<a href="index.php?module='.$parent_module.'&action=DetailView&record='.$value.'">'.$invoicename.'</a>';
+ }
+ elseif($parent_module == "Quotes")
+ {
+ $label_fld[] = $app_strings['LBL_QUOTES_NAME'];
+ $sql = "select * from vtiger_quotes where quoteid=".$value;
+ $result = $adb->query($sql);
+ $quotename= $adb->query_result($result,0,"subject");
+
+ $label_fld[] ='<a href="index.php?module='.$parent_module.'&action=DetailView&record='.$value.'">'.$quotename.'</a>';
}
elseif($parent_module == "HelpDesk")
{
Modified: vtigercrm/branches/5.0.3/include/utils/EditViewUtils.php
==============================================================================
--- vtigercrm/branches/5.0.3/include/utils/EditViewUtils.php (original)
+++ vtigercrm/branches/5.0.3/include/utils/EditViewUtils.php Sat Apr 28 04:17:32 2007
@@ -627,7 +627,13 @@
$result = $adb->query($sql);
$parent_name= $adb->query_result($result,0,"subject");
$invoice_selected = "selected";
-
+ }
+ elseif($parent_module == "Quotes")
+ {
+ $sql = "select * from vtiger_quotes where quoteid=".$value;
+ $result = $adb->query($sql);
+ $parent_name= $adb->query_result($result,0,"subject");
+ $quote_selected = "selected";
}
@@ -638,7 +644,8 @@
$app_strings['COMBO_PRODUCTS'],
$app_strings['COMBO_INVOICES'],
$app_strings['COMBO_PORDER'],
- $app_strings['COMBO_SORDER']
+ $app_strings['COMBO_SORDER'],
+ $app_strings['COMBO_QUOTES']
);
$editview_label[] = array($lead_selected,
$account_selected,
@@ -646,9 +653,10 @@
$product_selected,
$invoice_selected,
$porder_selected,
- $sorder_selected
+ $sorder_selected,
+ $quote_selected
);
- $editview_label[] = array("Leads&action=Popup","Accounts&action=Popup","Potentials&action=Popup","Products&action=Popup","Invoice&action=Popup","PurchaseOrder&action=Popup","SalesOrder&action=Popup");
+ $editview_label[] = array("Leads&action=Popup","Accounts&action=Popup","Potentials&action=Popup","Products&action=Popup","Invoice&action=Popup","PurchaseOrder&action=Popup","SalesOrder&action=Popup","Quotes&action=Popup");
$fieldvalue[] =$parent_name;
$fieldvalue[] =$value;
Modified: vtigercrm/branches/5.0.3/modules/Quotes/Quotes.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Quotes/Quotes.php (original)
+++ vtigercrm/branches/5.0.3/modules/Quotes/Quotes.php Sat Apr 28 04:17:32 2007
@@ -116,7 +116,7 @@
if($_REQUEST['action'] != 'QuotesAjax' && $_REQUEST['ajxaction'] != 'DETAILVIEW')
{
//Based on the total Number of rows we will save the product relationship with this entity
- saveInventoryProductDetails(&$this, 'Quotes');
+ saveInventoryProductDetails($this, 'Quotes');
}
}
@@ -236,6 +236,46 @@
return getHistory('Quotes',$query,$id);
}
+ /** function used to get the attachments which are related to the invoice
+ * @param int $id - invoice id to which we want to retrieve the attachments and notes
+ * @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 ' as ActivityType, vtiger_notes.filename,
+ vtiger_attachments.type as FileType,crm2.modifiedtime as lastmodified,
+ vtiger_seattachmentsrel.attachmentsid as attachmentsid, vtiger_notes.notesid as crmid,
+ crm2.createdtime, vtiger_notes.notecontent as 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 as title ,'Attachments' as ActivityType,
+ vtiger_attachments.name as filename, vtiger_attachments.type as FileType, crm2.modifiedtime as lastmodified,
+ vtiger_attachments.attachmentsid as attachmentsid, vtiger_seattachmentsrel.attachmentsid as 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;
+
+ $log->debug("Exiting get_attachments method ...");
+ return getAttachmentsAndNotes('Quotes',$query,$id);
+ }
+
+
/** Function used to get the Quote Stage history of the Quotes
* @param $id - quote id
Modified: vtigercrm/branches/5.0.3/modules/Users/DefaultDataPopulator.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Users/DefaultDataPopulator.php (original)
+++ vtigercrm/branches/5.0.3/modules/Users/DefaultDataPopulator.php Sat Apr 28 04:17:32 2007
@@ -1794,9 +1794,11 @@
$this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Quotes").",9,'get_activities',2,'Activities',0)");
- $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Quotes").",9,'get_history',3,'Activity History',0)");
-
- $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Quotes").",0,'get_quotestagehistory',4,'Quote Stage History',0)");
+ $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Quotes").",0,'get_attachments',3,'Attachments',0)");
+
+ $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Quotes").",9,'get_history',4,'Activity History',0)");
+
+ $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Quotes").",0,'get_quotestagehistory',5,'Quote Stage History',0)");
// Inserting Purchase order Related Lists
More information about the vtigercrm-commits
mailing list