diff --git a/data/CRMEntity.php b/data/CRMEntity.php index d57d536f320e39c48de80e55594e92e3a725a48f..36cfc5f929134a4026d6b9a9700adce6879e8357 100644 --- a/data/CRMEntity.php +++ b/data/CRMEntity.php @@ -600,7 +600,7 @@ class CRMEntity { $fldvalue = decode_html($this->column_fields[$fieldname]); } } elseif ($uitype == 8) { - $this->column_fields[$fieldname] = rtrim($this->column_fields[$fieldname], ','); + $this->column_fields[$fieldname] = isset($this->column_fields[$fieldname]) ? rtrim($this->column_fields[$fieldname], ',') : ''; $ids = explode(',', $this->column_fields[$fieldname]); $json = new Zend_Json(); $fldvalue = $json->encode($ids); diff --git a/modules/Emails/Emails.php b/modules/Emails/Emails.php index 3663836f036d827a98a6cfc1df4a74fb7dae0848..d9cc7645dd0fa97ef0c66465db952e14fada7ff6 100644 --- a/modules/Emails/Emails.php +++ b/modules/Emails/Emails.php @@ -65,6 +65,8 @@ class Emails extends CRMEntity { // Refers to vtiger_field.fieldname values. var $mandatory_fields = Array('subject', 'assigned_user_id'); + public $moduleName; + /** This function will set the columnfields for Email module */ function __construct() { diff --git a/modules/HelpDesk/HelpDesk.php b/modules/HelpDesk/HelpDesk.php index 324584655ecbc47abe2a30cebd39e0425898e803..86a71b05253a5e8ed092ea13c93dc77d5ca77f37 100644 --- a/modules/HelpDesk/HelpDesk.php +++ b/modules/HelpDesk/HelpDesk.php @@ -96,6 +96,8 @@ class HelpDesk extends CRMEntity { // For Alphabetical search var $def_basicsearch_col = 'ticket_title'; + public $moduleName; + //var $groupTable = Array('vtiger_ticketgrouprelation','ticketid'); /** Constructor which will set the column_fields in this object diff --git a/modules/Settings/MailConverter/handlers/MailRecord.php b/modules/Settings/MailConverter/handlers/MailRecord.php index c708905f23018d3fe7f5eaf73baefd05ceb56031..06d810da94bba20c6b06a92ca1a65057b6cb0029 100644 --- a/modules/Settings/MailConverter/handlers/MailRecord.php +++ b/modules/Settings/MailConverter/handlers/MailRecord.php @@ -219,9 +219,12 @@ class Vtiger_MailRecord { $this->_from = $this->__getEmailIdList($mailheader->from); $this->_fromname = self::__mime_decode($mailheader->from[0]->personal); - $this->_to = $this->__getEmailIdList($mailheader->to); - $this->_cc = $this->__getEmailIdList($mailheader->cc); - $this->_bcc = $this->__getEmailIdList($mailheader->bcc); + + if(!property_exists($mailheader,'to') && !property_exists($mailheader,'cc') && !property_exists($mailheader,'bcc')){ + $this->_to = $this->__getEmailIdList($mailheader->to); + $this->_cc = $this->__getEmailIdList($mailheader->cc); + $this->_bcc = $this->__getEmailIdList($mailheader->bcc); + } $this->_date = $mailheader->udate; @@ -291,14 +294,14 @@ class Vtiger_MailRecord { if ($p->parameters) { foreach ($p->parameters as $x) $params[ strtolower( $x->attribute ) ] = $x->value; } - if ($p->dparameters) { + if (property_exists($p,'dparameters') && $p->dparameters) { foreach ($p->dparameters as $x) $params[ strtolower( $x->attribute ) ] = $x->value; } // ATTACHMENT // Any part with a filename is an attachment, // so an attached text file (type 0) is not mistaken as the message. - if ($params['filename'] || $params['name']) { + if ((isset($params['filename']) && $params['filename']) || (isset($params['name']) && $params['name'])) { // filename may be given as 'Filename' or 'Name' or both $filename = ($params['filename'])? $params['filename'] : $params['name']; // filename may be encoded, so see imap_mime_header_decode() @@ -327,7 +330,7 @@ class Vtiger_MailRecord { } // SUBPART RECURSION - if ($p->parts) { + if (property_exists($p,'parts') && $p->parts) { foreach ($p->parts as $partno0=>$p2) $this->__getpart($imap,$messageid,$p2,$partno.'.'.($partno0+1)); // 1.2, 1.2.1, etc. } diff --git a/modules/Settings/MailConverter/handlers/MailScanner.php b/modules/Settings/MailConverter/handlers/MailScanner.php index 37c6f8c97a5bf0f1996b68b1db7f622ab204374c..96b42ce4330775cacaec44af01d2dc2ff793c292 100644 --- a/modules/Settings/MailConverter/handlers/MailScanner.php +++ b/modules/Settings/MailConverter/handlers/MailScanner.php @@ -244,7 +244,7 @@ class Vtiger_MailScanner { */ function LookupContact($email) { global $adb; - if($this->_cachedContactIds[$email]) { + if(isset($this->_cachedContactIds[$email]) && $this->_cachedContactIds[$email]) { $this->log("Reusing Cached Contact Id for email: $email"); return $this->_cachedContactIds[$email]; } @@ -296,7 +296,7 @@ class Vtiger_MailScanner { */ function LookupAccount($email) { global $adb; - if($this->_cachedAccountIds[$email]) { + if(isset($this->_cachedAccountIds[$email]) && $this->_cachedAccountIds[$email]) { $this->log("Reusing Cached Account Id for email: $email"); return $this->_cachedAccountIds[$email]; } @@ -393,7 +393,7 @@ class Vtiger_MailScanner { $contactid = $this->LookupContact($email); $contact_focus = false; if($contactid) { - if($this->_cachedContacts[$contactid]) { + if(isset($this->_cachedContacts[$contactid]) && $this->_cachedContacts[$contactid]) { $contact_focus = $this->_cachedContacts[$contactid]; $this->log("Reusing Cached Contact [" . $contact_focus->column_fields["lastname"] . '-' . $contact_focus->column_fields["firstname"] . "]"); diff --git a/modules/Settings/MailConverter/handlers/MailScannerAction.php b/modules/Settings/MailConverter/handlers/MailScannerAction.php index b799ae10f4640878b5278361e454abd38258aa53..6885aa121c8b0d2f6147082575042d22385f715f 100644 --- a/modules/Settings/MailConverter/handlers/MailScannerAction.php +++ b/modules/Settings/MailConverter/handlers/MailScannerAction.php @@ -447,7 +447,7 @@ class Vtiger_MailScannerAction { $focus->column_fields["email_flag"] = 'MAILSCANNER'; $from=$mailrecord->_from[0]; - $to = $mailrecord->_to[0]; + $to = isset($mailrecord->_to[0]) ? $mailrecord->_to[0] : ''; $cc = (!empty($mailrecord->_cc))? implode(',', $mailrecord->_cc) : ''; $bcc= (!empty($mailrecord->_bcc))? implode(',', $mailrecord->_bcc) : ''; $flag=''; // 'SENT'/'SAVED' diff --git a/modules/Settings/MailConverter/models/RuleRecord.php b/modules/Settings/MailConverter/models/RuleRecord.php index 2a6f178415f978a21a70998844ab5bc165f02a72..9a8bbf56acd3d6423fe135803ed7da606444454b 100644 --- a/modules/Settings/MailConverter/models/RuleRecord.php +++ b/modules/Settings/MailConverter/models/RuleRecord.php @@ -156,7 +156,7 @@ class Settings_MailConverter_RuleRecord_Model extends Settings_Vtiger_Record_Mod $actions = $this->getActions(); $actionModel = ''; if ($actions) { - $actionModel = reset($this->getActions()); + $actionModel = reset($actions); $actionId = $actionModel->actionid; } //Svaing the Action info