[Vtigercrm-commits] [vtiger development] #6213: Relate Documents to Accounts using a field

vtiger development vtiger-tickets at trac.vtiger.com
Wed Aug 5 08:22:10 EDT 2009


#6213: Relate Documents to Accounts using a field
--------------------------+-------------------------------------------------
  Reporter:  glenn.l      |       Owner:  developer                  
      Type:  enhancement  |      Status:  new                        
  Priority:  unassigned   |   Milestone:  5.1.1                      
 Component:  vtigercrm    |     Version:  5.1.0                      
Resolution:               |    Keywords:  vtlib, relatedto, documents
--------------------------+-------------------------------------------------
Comment (by glenn.l):

 All the above can be removed because i found a much simpler way to achieve
 the same result.

 This can be done by adding the following code after the ADD command to the
 get_attachments API in CRMEntity.php


 {{{
 $button .= '<input type="hidden" name="relatedto" value="'.$id.'">';
 $button .= '<input type="hidden" name="related_to_type"
 value="'.$this_module.'">';
 }}}

 But to pass from relatedto field to vtiger_senotesrel the following code
 is still needed as mentioned above


 {{{
 $relatedto = $adb->query("SELECT relatedto FROM vtiger_notes WHERE
 notesid= $this->id");
 }}}

 {{{

 if(isset($relatedto) && $relatedto != '')
                 {
                         $Updatenotesrel = $adb->pquery("INSERT INTO
 vtiger_senotesrel (crmid, notesid) ".
                                 " SELECT vtiger_notes.relatedto,
 vtiger_notes.notesid FROM vtiger_notes".
                                 " WHERE vtiger_notes.notesid = $this->id
 and vtiger_notes.relatedto !=0 and vtiger_notes.relatedto IS NOT NULL");
                 }

 }}}

 With these few lines of code you will now have full two way sync of
 relatedlists from vtiger_notes.relatedto to vtiger_senotesrel

 I suggest this information should be used to improve related lists in the
 future.

-- 
Ticket URL: <http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/6213#comment:5>
vtiger development <http://trac.vtiger.com/>
vtigerCRM




More information about the vtigercrm-commits mailing list