*/ public static function getAdvancedFilterOptions() { return array( 'is' => 'is', 'contains' => 'contains', 'does not contain' => 'does not contain', 'starts with' => 'starts with', 'ends with' => 'ends with', 'has changed' => 'has changed', 'has changed to' => 'has changed to', 'is empty' => 'is empty', 'is not empty' => 'is not empty', 'less than' => 'less than', 'greater than' => 'greater than', 'does not equal' => 'does not equal', 'less than or equal to' => 'less than or equal to', 'greater than or equal to' => 'greater than or equal to', 'has changed' => 'has changed', 'before' => 'before', 'after' => 'after', 'between' => 'between', 'is added' => 'is added', ); } /** * Function to get the advanced filter option names by Field type * @return */ public static function getAdvancedFilterOpsByFieldType() { return array( 'string' => array('is', 'contains', 'does not contain', 'starts with', 'ends with', 'has changed', 'is empty', 'is not empty'), 'salutation' => array('is', 'contains', 'does not contain', 'starts with', 'ends with', 'has changed', 'is empty', 'is not empty'), 'text' => array('is', 'contains', 'does not contain', 'starts with', 'ends with', 'has changed', 'is empty', 'is not empty'), 'url' => array('is', 'contains', 'does not contain', 'starts with', 'ends with', 'has changed', 'is empty', 'is not empty'), 'email' => array('is', 'contains', 'does not contain', 'starts with', 'ends with', 'has changed', 'is empty', 'is not empty'), 'phone' => array('is', 'contains', 'does not contain', 'starts with', 'ends with', 'has changed', 'is empty', 'is not empty'), 'integer' => array('equal to', 'less than', 'greater than', 'does not equal', 'less than or equal to', 'greater than or equal to', 'has changed'), 'double' => array('equal to', 'less than', 'greater than', 'does not equal', 'less than or equal to', 'greater than or equal to', 'has changed'), 'currency' => array('equal to', 'less than', 'greater than', 'does not equal', 'less than or equal to', 'greater than or equal to', 'has changed', 'is not empty'), 'picklist' => array('is', 'is not', 'has changed', 'has changed to', 'starts with', 'ends with', 'contains', 'does not contain', 'is empty', 'is not empty'), 'multipicklist' => array('is', 'is not', 'has changed', 'has changed to'), 'datetime' => array('is', 'is not', 'has changed','less than hours before', 'less than hours later', 'more than hours before', 'more than hours later', 'is not empty'), 'time' => array('is', 'is not', 'has changed', 'is not empty'), 'date' => array('is', 'is not', 'has changed', 'between', 'before', 'after', 'is today', 'less than days ago', 'more than days ago', 'in less than', 'in more than', 'days ago', 'days later', 'is not empty'), 'boolean' => array('is', 'is not', 'has changed'), 'reference' => array('has changed'), 'owner' => array('has changed','is','is not'), 'recurrence' => array('is', 'is not', 'has changed'), 'comment' => array('is added'), 'image' => array('is', 'is not', 'contains', 'does not contain', 'starts with', 'ends with', 'is empty', 'is not empty'), 'percentage' => array('equal to', 'less than', 'greater than', 'does not equal', 'less than or equal to', 'greater than or equal to', 'has changed', 'is not empty'), ); } /** * Function to get comment field which will useful in creating conditions * @param $moduleModel * @return */ public static function getCommentFieldForFilterConditions($moduleModel) { $commentField = new Vtiger_Field_Model(); $commentField->set('name', '_VT_add_comment'); $commentField->set('label', 'Comment'); $commentField->setModule($moduleModel); $commentField->fieldDataType = 'comment'; return $commentField; } /** * Function to get comment fields list which are useful in tasks * @param $moduleModel * @return list of Field models */ public static function getCommentFieldsListForTasks($moduleModel) { $commentsFieldsInfo = array('lastComment' => 'Last Comment', 'last5Comments' => 'Last 5 Comments', 'allComments' => 'All Comments'); $commentFieldModelsList = array(); foreach ($commentsFieldsInfo as $fieldName => $fieldLabel) { $commentField = new Vtiger_Field_Model(); $commentField->setModule($moduleModel); $commentField->set('name', $fieldName); $commentField->set('label', $fieldLabel); $commentFieldModelsList[$fieldName] = $commentField; } return $commentFieldModelsList; } }