*/ function getCreateEventUrl() { $calendarModuleModel = Vtiger_Module_Model::getInstance('Calendar'); return $calendarModuleModel->getCreateEventRecordUrl().'&contact_id='.$this->getId(); } /** * Function returns the url for create todo * @return */ function getCreateTaskUrl() { $calendarModuleModel = Vtiger_Module_Model::getInstance('Calendar'); return $calendarModuleModel->getCreateTaskRecordUrl().'&contact_id='.$this->getId(); } /** * Function to get List of Fields which are related from Contacts to Inventory Record * @return */ public function getInventoryMappingFields() { return array( array('parentField'=>'account_id', 'inventoryField'=>'account_id', 'defaultValue'=>''), //Billing Address Fields array('parentField'=>'mailingcity', 'inventoryField'=>'bill_city', 'defaultValue'=>''), array('parentField'=>'mailingstreet', 'inventoryField'=>'bill_street', 'defaultValue'=>''), array('parentField'=>'mailingstate', 'inventoryField'=>'bill_state', 'defaultValue'=>''), array('parentField'=>'mailingzip', 'inventoryField'=>'bill_code', 'defaultValue'=>''), array('parentField'=>'mailingcountry', 'inventoryField'=>'bill_country', 'defaultValue'=>''), array('parentField'=>'mailingpobox', 'inventoryField'=>'bill_pobox', 'defaultValue'=>''), //Shipping Address Fields array('parentField'=>'otherstreet', 'inventoryField'=>'ship_street', 'defaultValue'=>''), array('parentField'=>'othercity', 'inventoryField'=>'ship_city', 'defaultValue'=>''), array('parentField'=>'otherstate', 'inventoryField'=>'ship_state', 'defaultValue'=>''), array('parentField'=>'otherzip', 'inventoryField'=>'ship_code', 'defaultValue'=>''), array('parentField'=>'othercountry', 'inventoryField'=>'ship_country', 'defaultValue'=>''), array('parentField'=>'otherpobox', 'inventoryField'=>'ship_pobox', 'defaultValue'=>'') ); } /** * Function to get Image Details * @return Image Details List */ public function getImageDetails() { $db = PearDatabase::getInstance(); $imageDetails = array(); $recordId = $this->getId(); if ($recordId) { $sql = "SELECT vtiger_attachments.*, vtiger_crmentity.setype FROM vtiger_attachments INNER JOIN vtiger_seattachmentsrel ON vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_attachments.attachmentsid WHERE vtiger_crmentity.setype = 'Contacts Image' and vtiger_seattachmentsrel.crmid = ?"; $result = $db->pquery($sql, array($recordId)); $imageId = $db->query_result($result, 0, 'attachmentsid'); $imagePath = $db->query_result($result, 0, 'path'); $imageName = $db->query_result($result, 0, 'name'); //decode_html - added to handle UTF-8 characters in file names $imageOriginalName = decode_html($imageName); if(!empty($imageName)){ $imageDetails[] = array( 'id' => $imageId, 'orgname' => $imageOriginalName, 'path' => $imagePath.$imageId, 'name' => $imageName ); } } return $imageDetails; } }