Differences
This shows you the differences between two versions of the page.
|
en:modifications:store-mailconverter-attachments-only-once [2015/01/15 10:29] swarnat created |
en:modifications:store-mailconverter-attachments-only-once [2015/01/15 10:30] (current) swarnat |
||
|---|---|---|---|
| Line 44: | Line 44: | ||
| ** replace these lines with ** | ** replace these lines with ** | ||
| <code php> | <code php> | ||
| - | if(!isset($this->_notesId[$filename])) { | + | if(!isset($this->_notesId[$filename])) { |
| - | // Create document record | + | // Create document record |
| - | $document = new Documents(); | + | $document = new Documents(); |
| - | $document->column_fields['notes_title'] = $filename; | + | $document->column_fields['notes_title'] = $filename; |
| - | $document->column_fields['filename'] = $filename; | + | $document->column_fields['filename'] = $filename; |
| - | $document->column_fields['filesize'] = mb_strlen($filecontent, '8bit'); | + | $document->column_fields['filesize'] = mb_strlen($filecontent, '8bit'); |
| - | $document->column_fields['filestatus'] = 1; | + | $document->column_fields['filestatus'] = 1; |
| - | $document->column_fields['filelocationtype'] = 'I'; | + | $document->column_fields['filelocationtype'] = 'I'; |
| - | $document->column_fields['folderid'] = 1; // Default Folder | + | $document->column_fields['folderid'] = 1; // Default Folder |
| - | $document->column_fields['assigned_user_id'] = $userid; | + | $document->column_fields['assigned_user_id'] = $userid; |
| - | $document->save('Documents'); | + | $document->save('Documents'); |
| + | |||
| + | $this->_notesId[$filename] = $document->id; | ||
| + | } else { | ||
| + | $document = CRMEntity::getInstance('Documents'); | ||
| + | $document->retrieve_entity_info($this->_notesId, 'Documents'); | ||
| + | $document->id = $this->_notesId[$filename]; | ||
| + | } | ||
| - | $this->_notesId[$filename] = $document->id; | ||
| - | } else { | ||
| - | $document = CRMEntity::getInstance('Documents'); | ||
| - | $document->retrieve_entity_info($this->_notesId, 'Documents'); | ||
| - | $document->id = $this->_notesId[$filename]; | ||
| - | } | ||
| </code> | </code> | ||