[Vtigercrm-commits] [vtiger development] #6213: Relate Documents to Accounts using a field
vtiger development
vtiger-tickets at trac.vtiger.com
Fri Jul 31 04:10:27 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
Keywords: vtlib, relatedto, documents |
-----------------------------------------+----------------------------------
Functionally that was in 5.04 has since been lost in 5.10 which allowed
users to relate a document to a single record be it an account, contact or
other.
I suggest that the user should have the choice of being able to link a
document to one record using a field using uitype 10(can be created using
vtlib)
Some of the code required to do this is as follows
Allows Select Document Button to update relatedto field stored in the
document table (Field has to be created prior)
{{{
/* Add to - updateRelations.php in Selected Module folder (eg Accounts)
/*
$adb->pquery ("UPDATE vtiger_notes SET vtiger_notes.relatedto = ? where
vtiger_notes.notesid = ?",array
($forCRMRecord,$id));
}}}
When click add Document update relatedto field stored in the document
table for that record
{{{
/* Documents.php in Documents Folder
/*
function updatenotes($id)
{
global $adb;
$updateQuery = "UPDATE vtiger_notes SET
vtiger_notes.relatedto = (Select
vtiger_senotesrel.crmid from vtiger_senotesrel where
vtiger_senotesrel.notesid = ? AND
vtiger_senotesrel.notesid = ?)".
" WHERE EXISTS (SELECT vtiger_senotesrel.crmid FROM
vtiger_senotesrel WHERE
vtiger_senotesrel.notesid = ? AND vtiger_notes.notesid = ?)";
$dbresult =
$adb->pquery($updateQuery,array($id,$id,$id,$id));
}
}}}
{{{
/* Add after $this->insertintonotesrel($relid,$this->id);
$this->updatenotes($this->id,$this->id);
}}}
I understand this is not an elegant solution, but it is the begining to
getting a proper solution for relating documents to accounts, which in my
opinion is not only greatly missed but is still greatly required by alot
of people
--
Ticket URL: <http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/6213>
vtiger development <http://trac.vtiger.com/>
vtigerCRM
More information about the vtigercrm-commits
mailing list