* @static
*/
static $_exportableFields = NULL;
+
+ /**
+ * class constructor
+ *
+ * @access public
+ * @return \CRM_Contact_DAO_Contact
+ */
+ /**
+ *
+ */
function __construct() {
parent::__construct();
}
return $contactID;
}
+ /**
+ * @param $params
+ * @param $fields
+ * @param null $contactID
+ * @param null $ufGroupId
+ * @param null $ctype
+ * @param bool $skipCustom
+ *
+ * @return array
+ */
static function formatProfileContactParams(
&$params,
&$fields,
*
*/
class CRM_Contact_BAO_Contact_Optimizer {
+ /**
+ * @param $newValues
+ * @param $oldValues
+ */
static function edit( &$newValues, &$oldValues ) {
// still need to do more work on this
// CRM-10192
self::website( $newValues, $oldValues );
}
+ /**
+ * @param $newValues
+ * @param $oldValues
+ */
static function website( &$newValues, &$oldValues ) {
$oldWebsiteValues = CRM_Utils_Array::value( 'website', $oldValues );
$newWebsiteValues = CRM_Utils_Array::value( 'website', $newValues );
unset( $newValues['website'] );
}
+ /**
+ * @param $newValues
+ * @param $oldValues
+ */
static function email( &$newValues, &$oldValues ) {
$oldEmailValues = CRM_Utils_Array::value( 'email', $oldValues );
$newEmailValues = CRM_Utils_Array::value( 'email', $newValues );
return (bool) CRM_Core_DAO::singleValueQuery($sql, $params);
}
+ /**
+ * @param string $contactAlias
+ * @param null $contactID
+ *
+ * @return array
+ */
static function cacheClause($contactAlias = 'contact_a', $contactID = NULL) {
if (CRM_Core_Permission::check('view all contacts') ||
CRM_Core_Permission::check('edit all contacts')
}
+ /**
+ * @param $contactID
+ * @param $form
+ * @param bool $redirect
+ *
+ * @return bool
+ */
static function validateOnlyChecksum($contactID, &$form, $redirect = TRUE) {
// check if this is of the format cs=XXX
if (!CRM_Contact_BAO_Contact_Utils::validChecksum($contactID,
return TRUE;
}
+ /**
+ * @param bool $checkSumValidationResult
+ * @param null $form
+ */
static function initChecksumAuthSrc($checkSumValidationResult = FALSE, $form = NULL) {
$session = CRM_Core_Session::singleton();
if ($checkSumValidationResult && $form && CRM_Utils_Request::retrieve('cs', 'String', $form, FALSE)) {
}
}
+ /**
+ * @param $contactID
+ * @param $form
+ * @param bool $redirect
+ *
+ * @return bool
+ */
static function validateChecksumContact($contactID, &$form, $redirect = TRUE) {
if (!self::allow($contactID, CRM_Core_Permission::EDIT)) {
// check if this is of the format cs=XXX
CRM_Contact_BAO_GroupContactCache::remove();
}
+ /**
+ * @param $params
+ *
+ * @throws Exception
+ */
public static function updateGreeting($params) {
$contactType = $params['ct'];
$greeting = $params['gt'];
return NULL;
}
+ /**
+ * @param $contactType
+ *
+ * @return bool
+ */
static function isActive($contactType) {
$contact = self::contactTypeInfo(FALSE);
$active = array_key_exists($contactType, $contact) ? TRUE : FALSE;
return array_keys(self::basicTypeInfo($all));
}
+ /**
+ * @param bool $all
+ * @param string $key
+ *
+ * @return array
+ */
static function basicTypePairs($all = FALSE, $key = 'name') {
$subtypes = self::basicTypeInfo($all);
);
}
+ /**
+ * @param $typeName
+ *
+ * @return mixed
+ */
static function getLabel($typeName) {
$types = self::contactTypeInfo(TRUE);
return TRUE;
}
+ /**
+ * @param $contactType
+ * @param null $contactId
+ *
+ * @return bool
+ */
static function hasCustomData($contactType, $contactId = NULL) {
$subTypeClause = '';
return $clause;
}
+ /**
+ * @return string
+ */
public function __toString() {
return $this->title;
}
return $groupsReturn;
}
+ /**
+ * @param $params
+ *
+ * @return null|string
+ */
static function getGroupCount(&$params) {
$whereClause = self::whereClause($params, FALSE);
$query = "SELECT COUNT(*) FROM civicrm_group groups";
return $links;
}
+ /**
+ * @param $whereClause
+ * @param $whereParams
+ *
+ * @return string
+ */
function pagerAtoZ($whereClause, $whereParams) {
$query = "
SELECT DISTINCT UPPER(LEFT(groups.title, 1)) as sort_name
}
}
+ /**
+ * @param $contactID
+ * @param $groupID
+ *
+ * @return bool
+ */
static function isContactInGroup($contactID, $groupID) {
if (!CRM_Utils_Rule::positiveInteger($contactID) ||
!CRM_Utils_Rule::positiveInteger($groupID)
}
}
+ /**
+ * @param $groupID
+ */
static function add($groupID) {
// first delete the current cache
self::remove($groupID);
}
}
+ /**
+ * @param $groupID
+ * @param $values
+ */
static function store(&$groupID, &$values) {
$processed = FALSE;
$lock->release();
}
+ /**
+ * @return int
+ */
static function smartGroupCacheTimeout() {
$config = CRM_Core_Config::singleton();
$this->_styleIndent = $styleIndent;
}
+ /**
+ * @param $sortOrder
+ */
function setSortOrder($sortOrder) {
switch ($sortOrder) {
case 'ASC':
}
}
+ /**
+ * @return string
+ */
function getSortOrder() {
return self::$_sortOrder;
}
+ /**
+ * @return int
+ */
function getCurrentNestingLevel() {
return count($this->_parentStack);
}
return $this->_current;
}
+ /**
+ * @return string
+ */
function key() {
$group = &$this->_current;
$ids = array();
return $key;
}
+ /**
+ * @return CRM_Contact_BAO_Group|null
+ */
function next() {
$currentGroup = &$this->_current;
$childGroup = $this->_getNextChildGroup($currentGroup);
return $nextGroup;
}
+ /**
+ * @return bool
+ */
function valid() {
if ($this->_current) {
return TRUE;
}
}
+ /**
+ * @param null $group
+ *
+ * @return CRM_Contact_BAO_Group|null
+ */
function _getNextParentlessGroup(&$group = NULL) {
$lastParentlessGroup = $this->_lastParentlessGroup;
$nextGroup = new CRM_Contact_BAO_Group();
return NULL;
}
+ /**
+ * @param $parentGroup
+ * @param null $group
+ *
+ * @return CRM_Contact_BAO_Group|null
+ */
function _getNextChildGroup(&$parentGroup, &$group = NULL) {
$children = self::getChildGroupIds($parentGroup->id);
if (count($children) > 0) {
return NULL;
}
+ /**
+ * @param $group
+ *
+ * @return CRM_Contact_BAO_Group|null
+ */
function _getNextSiblingGroup(&$group) {
$parentGroup = end($this->_parentStack);
if ($parentGroup) {
return $potentialChildGroupIds;
}
+ /**
+ * @param $contactId
+ * @param $parentGroupId
+ *
+ * @return array
+ */
static function getContainingGroups($contactId, $parentGroupId) {
$groups = CRM_Contact_BAO_Group::getGroups();
$containingGroups = array();
CRM_Core_BAO_Cache::setItem($tree, 'contact groups', 'nestable tree hierarchy');
}
+ /**
+ * @param $tree
+ *
+ * @return bool
+ */
static function checkCyclicGraph(&$tree) {
// lets keep this simple, we should probably use a graph algoritm here at some stage
return FALSE;
}
+ /**
+ * @param $tree
+ * @param $id
+ *
+ * @return bool
+ */
static function isCyclic(&$tree, $id) {
$parents = $children = array();
self::getAll($parent, $tree, $id, 'parents');
return FALSE;
}
+ /**
+ * @param $id
+ * @param $groups
+ *
+ * @return array
+ */
static function getPotentialCandidates($id, &$groups) {
$tree = CRM_Core_BAO_Cache::getItem('contact groups', 'nestable tree hierarchy');
return array_keys($potential);
}
+ /**
+ * @param $potential
+ * @param $tree
+ * @param $id
+ * @param $token
+ */
static function invalidate(&$potential, &$tree, $id, $token) {
unset($potential[$id]);
}
}
+ /**
+ * @param $all
+ * @param $tree
+ * @param $id
+ * @param $token
+ */
static function getAll(&$all, &$tree, $id, $token) {
// if seen before, dont do anything
if (isset($all[$id])) {
}
}
+ /**
+ * @return string
+ */
static function json() {
$tree = CRM_Core_BAO_Cache::getItem('contact groups', 'nestable tree hierarchy');
return FALSE;
}
+ /**
+ * @param $groupID
+ * @param $defaults
+ */
static function retrieve($groupID, &$defaults) {
$dao = new CRM_Contact_DAO_GroupOrganization();
$dao->group_id = $groupID;
);
}
+ /**
+ * @param $latitude
+ * @param $longitude
+ * @param $distance
+ * @param string $tablePrefix
+ *
+ * @return string
+ */
static function where($latitude, $longitude, $distance, $tablePrefix = 'civicrm_address') {
self::initialize();
return $where;
}
+ /**
+ * @param $query
+ * @param $values
+ *
+ * @throws Exception
+ */
static function process(&$query, &$values) {
list($name, $op, $distance, $grouping, $wildcard) = $values;
return;
}
+ /**
+ * @param $input
+ */
static function fixInputParams(&$input) {
foreach ($input as $param) {
if (CRM_Utils_Array::value('0', $param) == 'prox_distance') {
// redirect to activity select clause
if (
- (substr($name, 0, 9) == 'activity_') ||
+ (substr($name, 0, 9) == 'activity_') ||
($name == 'parent_id')
) {
CRM_Activity_BAO_Query::select($this);
return array($select, $from, $where, $having);
}
+ /**
+ * @param $name
+ * @param $grouping
+ *
+ * @return null
+ */
function &getWhereValues($name, $grouping) {
$result = NULL;
foreach ($this->_params as $values) {
return $result;
}
+ /**
+ * @param $relative
+ * @param $from
+ * @param $to
+ */
static function fixDateValues($relative, &$from, &$to) {
if ($relative) {
list($from, $to) = CRM_Utils_Date::getFromTo($relative, $from, $to);
}
}
+ /**
+ * @param $formValues
+ * @param int $wildcard
+ * @param bool $useEquals
+ *
+ * @return array
+ */
static function convertFormValues(&$formValues, $wildcard = 0, $useEquals = FALSE) {
$params = array();
if (empty($formValues)) {
return $params;
}
+ /**
+ * @param $id
+ * @param $values
+ * @param int $wildcard
+ * @param bool $useEquals
+ *
+ * @return array|null
+ */
static function &fixWhereValues($id, &$values, $wildcard = 0, $useEquals = FALSE) {
// skip a few search variables
static $skipWhere = NULL;
return $result;
}
+ /**
+ * @param $values
+ */
function whereClauseSingle(&$values) {
// do not process custom fields or prefixed contact ids or component params
if (CRM_Core_BAO_CustomField::getKeyID($values[0]) ||
return implode(' AND ', $andClauses);
}
+ /**
+ * @param $values
+ *
+ * @throws Exception
+ */
function restWhere(&$values) {
$name = CRM_Utils_Array::value(0, $values);
$op = CRM_Utils_Array::value(1, $values);
}
+ /**
+ * @param $where
+ * @param $locType
+ *
+ * @return array
+ * @throws Exception
+ */
static function getLocationTableName(&$where, &$locType) {
if (isset($locType[1]) && is_numeric($locType[1])) {
list($tbName, $fldName) = explode(".", $where);
return $this->_tables;
}
+ /**
+ * @return array
+ */
function whereTables() {
return $this->_whereTables;
}
$this->includeContactSubTypes($value, $grouping);
}
+ /**
+ * @param $value
+ * @param $grouping
+ */
function includeContactSubTypes($value, $grouping) {
$clause = array();
/*
* Function translates selection of group type into a list of groups
*/
+ /**
+ * @param $value
+ *
+ * @return array
+ */
function getGroupsFromTypeCriteria($value){
$groupIds = array();
foreach ($value as $groupTypeValue) {
$this->_qill[$grouping][] = $label . " $op - '$n'";
}
+ /**
+ * @param $name
+ * @param $op
+ * @param $grouping
+ *
+ * @return bool
+ */
function nameNullOrEmptyOp($name, $op, $grouping) {
switch ( $op ) {
case 'IS NULL':
}
}
+ /**
+ * @param $values
+ * @param bool $fromStateProvince
+ *
+ * @return array
+ */
function country(&$values, $fromStateProvince = TRUE) {
list($name, $op, $value, $grouping, $wildcard) = $values;
$this->_qill[$grouping][] = ts('Modified by') . ": $name";
}
+ /**
+ * @param $values
+ */
function modifiedDates($values) {
$this->_useDistinct = TRUE;
self::$_openedPanes[ts('Change Log')] = TRUE;
}
+ /**
+ * @param $values
+ */
function demographics(&$values) {
list($name, $op, $value, $grouping, $wildcard) = $values;
self::$_openedPanes[ts('Demographics')] = TRUE;
}
+ /**
+ * @param $values
+ */
function privacy(&$values) {
list($name, $op, $value, $grouping, $wildcard) = $values;
//fixed for profile search listing CRM-4633
$this->_qill[$grouping][] = "$title $op $value";
}
+ /**
+ * @param $values
+ */
function privacyOptions($values) {
list($name, $op, $value, $grouping, $wildcard) = $values;
$this->_qill[$grouping][] = implode($operator, $qill);
}
+ /**
+ * @param $values
+ */
function preferredCommunication(&$values) {
list($name, $op, $value, $grouping, $wildcard) = $values;
}
}
+ /**
+ * @param $val
+ */
function setSkipPermission($val) {
$this->_skipPermission = $val;
}
+ /**
+ * @param null $context
+ *
+ * @return array
+ */
function &summaryContribution($context = NULL) {
list($innerselect, $from, $where, $having) = $this->query(TRUE);
return self::$_defaultHierReturnProperties;
}
+ /**
+ * @param $values
+ * @param $tableName
+ * @param $fieldName
+ * @param $dbFieldName
+ * @param $fieldTitle
+ * @param bool $appendTimeStamp
+ */
function dateQueryBuilder(
&$values, $tableName, $fieldName,
$dbFieldName, $fieldTitle,
}
}
+ /**
+ * @param $values
+ * @param $tableName
+ * @param $fieldName
+ * @param $dbFieldName
+ * @param $fieldTitle
+ * @param null $options
+ */
function numberRangeBuilder(&$values,
$tableName, $fieldName,
$dbFieldName, $fieldTitle,
}
}
+ /**
+ * @param bool $reset
+ *
+ * @return array
+ */
function openedSearchPanes($reset = FALSE) {
if (!$reset || empty($this->_whereTables)) {
return self::$_openedPanes;
return self::$_openedPanes;
}
+ /**
+ * @param $operator
+ */
function setOperator($operator) {
$validOperators = array('AND', 'OR');
if (!in_array($operator, $validOperators)) {
$this->_operator = $operator;
}
+ /**
+ * @return string
+ */
function getOperator() {
return $this->_operator;
}
+ /**
+ * @param $from
+ * @param $where
+ * @param $having
+ */
function filterRelatedContacts(&$from, &$where, &$having) {
static $_rTypeProcessed = NULL;
static $_rTypeFrom = NULL;
$having = NULL;
}
+ /**
+ * @param $op
+ *
+ * @return bool
+ */
static function caseImportant( $op ) {
return
in_array($op, array('LIKE', 'IS NULL', 'IS NOT NULL', 'IS EMPTY', 'IS NOT EMPTY')) ? FALSE : TRUE;
}
+ /**
+ * @param $returnProperties
+ * @param $prefix
+ *
+ * @return bool
+ */
static function componentPresent( &$returnProperties, $prefix ) {
foreach ($returnProperties as $name => $dontCare ) {
if (substr($name, 0, strlen($prefix)) == $prefix) {
return $this->_queryObjects;
}
+ /**
+ * @return array
+ */
public function &getFields() {
$extFields = array();
foreach (self::getSearchQueryObjects() as $obj) {
return $extFields;
}
+ /**
+ * @param $apiEntities
+ * @param $fieldOptions
+ */
public function alterSearchBuilderOptions(&$apiEntities, &$fieldOptions) {
foreach (self::getSearchQueryObjects() as $obj) {
$obj->alterSearchBuilderOptions($apiEntities, $fieldOptions);
}
}
+ /**
+ * @param $query
+ * @param $fnName
+ */
public function alterSearchQuery(&$query, $fnName) {
foreach (self::getSearchQueryObjects() as $obj) {
$obj->$fnName($query);
}
}
+ /**
+ * @param $fieldName
+ * @param $mode
+ * @param $side
+ *
+ * @return string
+ */
public function buildSearchfrom($fieldName, $mode, $side) {
$from = '';
foreach (self::getSearchQueryObjects() as $obj) {
return $from;
}
+ /**
+ * @param $tables
+ */
public function setTableDependency(&$tables) {
foreach (self::getSearchQueryObjects() as $obj) {
$obj->setTableDependency($tables);
}
}
+ /**
+ * @param $panes
+ */
public function registerAdvancedSearchPane(&$panes) {
foreach (self::getSearchQueryObjects() as $obj) {
$obj->registerAdvancedSearchPane($panes);
}
}
+ /**
+ * @param $panes
+ */
public function getPanesMapper(&$panes) {
foreach (self::getSearchQueryObjects() as $obj) {
$obj->getPanesMapper($panes);
}
}
+ /**
+ * @param $form
+ * @param $type
+ */
public function buildAdvancedSearchPaneForm(&$form, $type) {
foreach (self::getSearchQueryObjects() as $obj) {
$obj->buildAdvancedSearchPaneForm($form, $type);
}
}
+ /**
+ * @param $paneTemplatePathArray
+ * @param $type
+ */
public function setAdvancedSearchPaneTemplatePath(&$paneTemplatePathArray, $type) {
foreach (self::getSearchQueryObjects() as $obj) {
$obj->setAdvancedSearchPaneTemplatePath($paneTemplatePathArray, $type);
abstract class CRM_Contact_BAO_Query_Interface {
abstract public function &getFields();
+
+ /**
+ * @param $fieldName
+ * @param $mode
+ * @param $side
+ *
+ * @return mixed
+ */
abstract public function from($fieldName, $mode, $side);
+ /**
+ * @param $query
+ *
+ * @return null
+ */
public function select(&$query) {
return NULL;
}
+ /**
+ * @param $query
+ *
+ * @return null
+ */
public function where(&$query) {
return NULL;
}
+ /**
+ * @param $tables
+ *
+ * @return null
+ */
public function setTableDependency(&$tables) {
return NULL;
}
+ /**
+ * @param $panes
+ *
+ * @return null
+ */
public function registerAdvancedSearchPane(&$panes) {
return NULL;
}
+ /**
+ * @param $form
+ * @param $type
+ *
+ * @return null
+ */
public function buildAdvancedSearchPaneForm(&$form, $type) {
return NULL;
}
+ /**
+ * @param $paneTemplatePathArray
+ * @param $type
+ *
+ * @return null
+ */
public function setAdvancedSearchPaneTemplatePath(&$paneTemplatePathArray, $type) {
return NULL;
}
*/
public function alterSearchBuilderOptions(&$apiEntities, &$fieldOptions) {
}
-}
\ No newline at end of file
+}
return $relationshipType;
}
+ /**
+ * @param $id
+ * @param $action
+ *
+ * @return CRM_Contact_DAO_Relationship
+ */
static function clearCurrentEmployer($id, $action) {
$relationship = new CRM_Contact_DAO_Relationship();
$relationship->id = $id;
return $result;
}
+ /**
+ * @param $id
+ *
+ * @return array
+ */
static function getSearchParams($id) {
$fv = self::getFormValues($id);
//check if the saved seach has mapping id
return NULL;
}
+ /**
+ * @param $id
+ *
+ * @return string
+ */
static function contactIDsSQL($id) {
$params = self::getSearchParams($id);
if ($params && !empty($params['customSearchID'])) {
}
}
+ /**
+ * @param $id
+ *
+ * @return array
+ */
static function fromWhereEmail($id) {
$params = self::getSearchParams($id);
*/
class CRM_Contact_BAO_SearchCustom {
+ /**
+ * @param $csID
+ * @param null $ssID
+ * @param null $gID
+ *
+ * @return array
+ * @throws Exception
+ */
static function details($csID, $ssID = NULL, $gID = NULL) {
$error = array(NULL, NULL, NULL);
return array($customSearchID, $customSearchClass, $formValues);
}
+ /**
+ * @param $csID
+ * @param $ssID
+ *
+ * @return mixed
+ * @throws Exception
+ */
static function customClass($csID, $ssID) {
list($customSearchID, $customSearchClass, $formValues) = self::details($csID, $ssID);
return $customClass;
}
+ /**
+ * @param $csID
+ * @param $ssID
+ *
+ * @return mixed
+ */
static function contactIDSQL($csID, $ssID) {
$customClass = self::customClass($csID, $ssID);
return $customClass->contactIDs();
}
+ /**
+ * @param $args
+ *
+ * @return array
+ */
static function &buildFormValues($args) {
$args = trim($args);
return $formValues;
}
+ /**
+ * @param $csID
+ * @param $ssID
+ *
+ * @return array
+ */
static function fromWhereEmail($csID, $ssID) {
$customClass = self::customClass($csID, $ssID);
* BAO object for crm_email table
*/
class CRM_Contact_BAO_SubscriptionHistory extends CRM_Contact_DAO_SubscriptionHistory {
+ /**
+ * class constructor
+ *
+ * @access public
+ * @return \CRM_Contact_DAO_SubscriptionHistory
+ */
+ /**
+ *
+ */
function __construct() {
parent::__construct();
}
$this->addActions();
}
+ /**
+ * @return mixed
+ */
public function selectorName() {
return $this->get('selectorName');
}
<?php
+/**
+ * Class CRM_Contact_DAO_Factory
+ */
class CRM_Contact_DAO_Factory {
static $_classes = array(
static $_suffix = '.php';
+ /**
+ * @param $className
+ *
+ * @return mixed
+ */
static function &create($className) {
$type = CRM_Utils_Array::value($className, self::$_classes);
if (!$type) {
}
}
+ /**
+ * Use the form name to create the tpl file name
+ *
+ * @return string
+ * @access public
+ */
+ /**
+ * @return string
+ */
function getTemplateFileName() {
if ($this->_contactSubType) {
$templateFile = "CRM/Contact/Form/Edit/SubType/{$this->_contactSubType}.tpl";
return empty($errors) ? TRUE : $errors;
}
+ /**
+ * This function sets the default values for the form. MobileProvider that in edit/view mode
+ * the default values are retrieved from the database
+ *
+ * @access public
+ *
+ * @return array
+ */
+ /**
+ * @return array
+ */
function setDefaultValues() {
return $this->_defaults;
}
* @access public
* @return void
*/
+ /**
+ * This virtual function is used to set the default values of
+ * various form elements
+ *
+ * access public
+ *
+ * @return array reference to the array of default values
+ *
+ */
+ /**
+ * @return array
+ */
function setDefaultValues() {
$defaults = array();
$params = array();
return empty($errors) ? TRUE : $errors;
}
+ /**
+ * @param $form
+ * @param $countryElementName
+ * @param $stateElementName
+ * @param $countyElementName
+ * @param $countryDefaultValue
+ * @param null $stateDefaultValue
+ */
static function fixStateSelect(&$form,
$countryElementName,
$stateElementName,
}
+ /**
+ * @param $form
+ * @param $groupTree
+ */
static function storeRequiredCustomDataInfo(&$form, $groupTree) {
if (CRM_Utils_System::getClassName($form) == 'CRM_Contact_Form_Contact') {
$requireOmission = NULL;
}
}
+ /**
+ * @param $fields
+ * @param $files
+ * @param null $contactID
+ *
+ * @return array|bool
+ */
static function formRule($fields, $files, $contactID = NULL) {
$errors = array();
$primaryID = CRM_Contact_Form_Contact::formRule($fields, $errors, $contactID);
*/
require_once 'api/api.php';
+
+/**
+ * Class CRM_Contact_Form_Merge
+ */
class CRM_Contact_Form_Merge extends CRM_Core_Form {
// the id of the contact that tere's a duplicate for; this one will
// possibly inherit some of $_oid's properties and remain in the system
$this->assign('userContextURL', $session->readUserContext());
}
+ /**
+ * This virtual function is used to set the default values of
+ * various form elements
+ *
+ * access public
+ *
+ * @return array reference to the array of default values
+ *
+ */
+ /**
+ * @return array
+ */
function setDefaultValues() {
return array('deleteOther' => 1);
}
$this->addFormRule(array('CRM_Contact_Form_Merge', 'formRule'), $this);
}
+ /**
+ * @param $fields
+ * @param $files
+ * @param $self
+ *
+ * @return array
+ */
static function formRule($fields, $files, $self) {
$errors = array();
$link = CRM_Utils_System::href(ts('Flip between the original and duplicate contacts.'),
}
}
+ /**
+ * @param $form
+ */
static function postProcess($form) {
$params = $form->_params;
if (!empty($form->_honor_block_is_active) && !empty($params['soft_credit_type_id'])) {
return self::$_validContext;
}
+ /**
+ * @param $context
+ *
+ * @return bool
+ */
static function isSearchContext($context) {
$searchContext = CRM_Utils_Array::value($context, self::validContext());
return $searchContext ? TRUE : FALSE;
}
}
+ /**
+ * @param int $mode
+ *
+ * @return mixed
+ */
static function getModeValue($mode = 1) {
self::setModeValues();
return self::$_modeValues[$mode];
}
+ /**
+ * @return array
+ */
static function getModeSelect() {
self::setModeValues();
$controller->moveFromSessionToTemplate();
}
+ /**
+ * @return array
+ */
function &getFormValues() {
return $this->_formValues;
}
}
}
+ /**
+ * @return null
+ */
function &returnProperties() {
return CRM_Core_DAO::$_nullObject;
}
}
}
+ /**
+ * Use the form name to create the tpl file name
+ *
+ * @return string
+ * @access public
+ */
+ /**
+ * @return string
+ */
function getTemplateFileName() {
if (!$this->_searchPane) {
return parent::getTemplateFileName();
$this->_formValues['contact_tags'][$value] = 1;
}
}
-
+
// CRM-13848
$financialType = CRM_Utils_Array::value('financial_type_id', $this->_formValues);
if ($financialType && is_array($financialType)) {
$this->_formValues['financial_type_id'][$typeID] = 1;
}
}
-
+
$taglist = CRM_Utils_Array::value('contact_taglist', $this->_formValues);
if ($taglist && is_array($taglist)) {
parent::preProcess();
}
+ /**
+ * @return array
+ */
function &getFormValues() {
return $this->_formValues;
}
return TRUE;
}
+ /**
+ * Return a descriptive name for the page, used in wizard header
+ *
+ * @return string
+ * @access public
+ */
+ /**
+ * @return string
+ */
function getTitle() {
return ts('Find Contacts');
}
public function normalizeFormValues() {}
+ /**
+ * @param $formValues
+ *
+ * @return array
+ */
public function &convertFormValues(&$formValues) {
return CRM_Core_BAO_Mapping::formattedFields($formValues);
}
+ /**
+ * @return array
+ */
public function &returnProperties() {
return CRM_Core_BAO_Mapping::returnProperties($this->_formValues);
}
parent::postProcess();
}
+ /**
+ * @return array
+ */
static function fields() {
$fields = array_merge(
CRM_Contact_BAO_Contact::exportableFields('All', FALSE, TRUE),
}
+ /**
+ * @param $form
+ */
static function location(&$form) {
// Build location criteria based on _submitValues if
// available; otherwise, use $form->_formValues.
}
}
+ /**
+ * @param $form
+ */
static function activity(&$form) {
$form->add('hidden', 'hidden_activity', 1);
CRM_Activity_BAO_Query::buildSearchForm($form);
}
+ /**
+ * @param $form
+ */
static function changeLog(&$form) {
$form->add('hidden', 'hidden_changeLog', 1);
CRM_Core_Form_Date::buildDateRange($form, 'log_date', 1, '_low', '_high', ts('From'), FALSE, FALSE);
}
+ /**
+ * @param $form
+ */
static function task(&$form) {
$form->add('hidden', 'hidden_task', 1);
}
+ /**
+ * @param $form
+ */
static function relationship(&$form) {
$form->add('hidden', 'hidden_relationship', 1);
}
}
+ /**
+ * @param $form
+ */
static function demographics(&$form) {
$form->add('hidden', 'hidden_demographics', 1);
// radio button for gender
$form->addYesNo( 'is_deceased', ts('Deceased'), TRUE);
}
+ /**
+ * @param $form
+ */
static function notes(&$form) {
$form->add('hidden', 'hidden_notes', 1);
//TODO: validate for only one state if prox_distance isset
}
+ /**
+ * @param $form
+ */
static function CiviCase(&$form) {
//Looks like obsolete code, since CiviCase is a component, but might be used by HRD
$form->add('hidden', 'hidden_CiviCase', 1);
}
}
+ /**
+ * This virtual function is used to set the default values of
+ * various form elements
+ *
+ * access public
+ *
+ * @return array reference to the array of default values
+ *
+ */
+ /**
+ * @return array
+ */
function setDefaultValues() {
if (method_exists($this->_customSearchClass, 'setDefaultValues')) {
return $this->_customClass->setDefaultValues();
parent::buildQuickForm();
}
+ /**
+ * Use the form name to create the tpl file name
+ *
+ * @return string
+ * @access public
+ */
+ /**
+ * @return string
+ */
function getTemplateFileName() {
$ext = CRM_Extension_System::singleton()->getMapper();
parent::postProcess();
}
+ /**
+ * Return a descriptive name for the page, used in wizard header
+ *
+ * @return string
+ * @access public
+ */
+ /**
+ * @return string
+ */
public function getTitle() {
return ts('Custom Search');
}
+ /**
+ * @param $components
+ *
+ * @return bool
+ */
function isPermissioned($components) {
if (empty($components)) {
return TRUE;
protected $_formValues;
+ /**
+ * @param $formValues
+ */
+ /**
+ * @param $formValues
+ */
function __construct(&$formValues) {
$this->_formValues = $formValues;
//end custom fields
}
+ /**
+ * @param $form
+ */
function buildForm(&$form) {
/**
// Alters the date display in the Activity Date Column. We do this after we already have
// the result so that sorting on the date column stays pertinent to the numeric date value
+ /**
+ * @param $row
+ */
function alterRow(&$row) {
$row['activity_date'] = CRM_Utils_Date::customFormat($row['activity_date'], '%B %E%f, %Y %l:%M %P');
}
// Regular JOIN statements here to limit results to contacts who have activities.
+ /**
+ * @return string
+ */
function from() {
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
* WHERE clause is an array built from any required JOINS plus conditional filters based on search criteria field values
*
*/
+ /**
+ * @param bool $includeContactIDs
+ *
+ * @return string
+ */
function where($includeContactIDs = FALSE) {
$clauses = array();
return $dao->N;
}
+ /**
+ * @param int $offset
+ * @param int $rowcount
+ * @param null $sort
+ *
+ * @return string
+ */
function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) {
return $this->all($offset, $rowcount, $sort, FALSE, TRUE);
}
+ /**
+ * @return array
+ */
function &columns() {
return $this->_columns;
}
+ /**
+ * @param $title
+ */
function setTitle($title) {
if ($title) {
CRM_Utils_System::setTitle($title);
}
}
+ /**
+ * @return null
+ */
function summary() {
return NULL;
}
protected $_stateID;
+ /**
+ * @param $formValues
+ */
function __construct(&$formValues) {
$this->_formValues = &$formValues;
}
+ /**
+ * @return null|string
+ */
function count() {
return CRM_Core_DAO::singleValueQuery($this->sql('count(distinct contact_a.id) as total'));
}
+ /**
+ * @return null
+ */
function summary() {
return NULL;
}
+ /**
+ * @param int $offset
+ * @param int $rowcount
+ * @param null $sort
+ * @param bool $returnSQL
+ *
+ * @return string
+ */
function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = FALSE) {
$sql = $this->sql(
'contact_a.id as contact_id',
return CRM_Core_DAO::composeQuery($sql, CRM_Core_DAO::$_nullArray);
}
+ /**
+ * @param $selectClause
+ * @param int $offset
+ * @param int $rowcount
+ * @param null $sort
+ * @param bool $includeContactIDs
+ * @param null $groupBy
+ *
+ * @return string
+ */
function sql(
$selectClause,
$offset = 0,
return $sql;
}
+ /**
+ * @return null
+ */
function templateFile() {
return NULL;
}
return $this->_columns;
}
+ /**
+ * @param $sql
+ * @param $formValues
+ */
static function includeContactIDs(&$sql, &$formValues) {
$contactIDs = array();
foreach ($formValues as $id => $value) {
}
}
+ /**
+ * @param $sql
+ * @param $offset
+ * @param $rowcount
+ * @param $sort
+ */
function addSortOffset(&$sql, $offset, $rowcount, $sort) {
if (!empty($sort)) {
if (is_string($sort)) {
}
}
+ /**
+ * @param $sql
+ * @param bool $onlyWhere
+ *
+ * @throws Exception
+ */
function validateUserSQL(&$sql, $onlyWhere = FALSE) {
$includeStrings = array('contact_a');
$excludeStrings = array('insert', 'delete', 'update');
}
}
+ /**
+ * @param $where
+ * @param $params
+ *
+ * @return string
+ */
function whereClause(&$where, &$params) {
return CRM_Core_DAO::composeQuery($where, $params, TRUE);
}
// override this method to define the contact query object
// used for creating $sql
+ /**
+ * @return null
+ */
function getQueryObj() {
return NULL;
}
protected $_query;
+ /**
+ * @param $formValues
+ */
+ /**
+ * @param $formValues
+ */
function __construct(&$formValues) {
parent::__construct($formValues);
return;
}
+ /**
+ * @param $form
+ */
function buildForm(&$form) {
//@todo FIXME - using the CRM_Core_DAO::VALUE_SEPARATOR creates invalid html - if you can find the form
// this is loaded onto then replace with something like '__' & test
$form->assign('elements', array('sort_name', 'contact_type', 'group', 'tag'));
}
+ /**
+ * @return CRM_Contact_DAO_Contact
+ */
function count() {
return $this->_query->searchQuery(0, 0, NULL, TRUE);
}
+ /**
+ * @param int $offset
+ * @param int $rowCount
+ * @param null $sort
+ * @param bool $includeContactIDs
+ * @param bool $justIDs
+ *
+ * @return CRM_Contact_DAO_Contact
+ */
function all(
$offset = 0,
$rowCount = 0,
);
}
+ /**
+ * @return string
+ */
function from() {
return $this->_query->_fromClause;
}
+ /**
+ * @param bool $includeContactIDs
+ *
+ * @return string|void
+ */
function where($includeContactIDs = FALSE) {
if ($whereClause = $this->_query->whereClause()) {
return $whereClause;
return ' (1) ';
}
+ /**
+ * @return string
+ */
function templateFile() {
return 'CRM/Contact/Form/Search/Basic.tpl';
}
+ /**
+ * @return CRM_Contact_BAO_Query
+ */
function getQueryObj() {
return $this->_query;
}
protected $_formValues;
public $_permissionedComponent;
+ /**
+ * @param $formValues
+ */
function __construct(&$formValues) {
$this->_formValues = $formValues;
$this->_permissionedComponent = 'CiviContribute';
}
}
+ /**
+ * @param $form
+ */
function buildForm(&$form) {
foreach ($this->_amounts as $name => $title) {
return $dao->N;
}
+ /**
+ * @param int $offset
+ * @param int $rowcount
+ * @param null $sort
+ *
+ * @return string
+ */
function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) {
return $this->all($offset, $rowcount, $sort, FALSE, TRUE);
}
+ /**
+ * @param int $offset
+ * @param int $rowcount
+ * @param null $sort
+ * @param bool $includeContactIDs
+ * @param bool $justIDs
+ *
+ * @return string
+ */
function all(
$offset = 0,
$rowcount = 0,
return $sql;
}
+ /**
+ * @return string
+ */
function select() {
if ($this->start_date_2 || $this->end_date_2) {
return "
}
}
+ /**
+ * @return null|string
+ */
function from() {
$from = NULL;
if ($this->start_date_2 || $this->end_date_2) {
return $from;
}
+ /**
+ * @param bool $includeContactIDs
+ *
+ * @return string
+ */
function where($includeContactIDs = FALSE) {
$clauses = array();
return implode(' AND ', $clauses);
}
+ /**
+ * @param bool $includeContactIDs
+ *
+ * @return string
+ */
function having($includeContactIDs = FALSE) {
$clauses = array();
$min = CRM_Utils_Array::value('min_amount', $this->_formValues);
return implode(' AND ', $clauses);
}
+ /**
+ * @return array
+ */
function &columns() {
return $this->_columns;
}
+ /**
+ * @return string
+ */
function templateFile() {
return 'CRM/Contact/Form/Search/Custom/ContribSYBNT.tpl';
}
+ /**
+ * @return null
+ */
function summary() {
return NULL;
}
+ /**
+ * @param $title
+ */
function setTitle($title) {
if ($title) {
CRM_Utils_System::setTitle($title);
protected $_formValues;
public $_permissionedComponent;
+ /**
+ * @param $formValues
+ */
function __construct(&$formValues) {
$this->_formValues = $formValues;
/**
$this->_permissionedComponent = 'CiviContribute';
}
+ /**
+ * @param $form
+ */
function buildForm(&$form) {
/**
return $sql;
}
+ /**
+ * @return string
+ */
function from() {
return "
civicrm_contribution AS contrib,
* WHERE clause is an array built from any required JOINS plus conditional filters based on search criteria field values
*
*/
+ /**
+ * @param bool $includeContactIDs
+ *
+ * @return string
+ */
function where($includeContactIDs = FALSE) {
$clauses = array();
return implode(' AND ', $clauses);
}
+ /**
+ * @param bool $includeContactIDs
+ *
+ * @return string
+ */
function having($includeContactIDs = FALSE) {
$clauses = array();
$min = CRM_Utils_Array::value('min_amount', $this->_formValues);
return $dao->N;
}
+ /**
+ * @param int $offset
+ * @param int $rowcount
+ * @param null $sort
+ *
+ * @return string
+ */
function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) {
return $this->all($offset, $rowcount, $sort, FALSE, TRUE);
}
+ /**
+ * @return array
+ */
function &columns() {
return $this->_columns;
}
+ /**
+ * @param $title
+ */
function setTitle($title) {
if ($title) {
CRM_Utils_System::setTitle($title);
}
}
+ /**
+ * @return null
+ */
function summary() {
return NULL;
}
protected $_debug = 0;
+ /**
+ * @param $formValues
+ */
function __construct(&$formValues) {
parent::__construct($formValues);
);
}
+ /**
+ * @param $form
+ */
function buildForm(&$form) {
$form->addDate('start_date', ts('Start Date'), FALSE, array('formatType' => 'custom'));
$form->addDate('end_date', ts('End Date'), FALSE, array('formatType' => 'custom'));
$form->assign('elements', array('start_date', 'end_date', 'includeGroups', 'excludeGroups'));
}
+ /**
+ * @return null
+ */
function summary() {
return NULL;
}
+ /**
+ * @param int $offset
+ * @param int $rowcount
+ * @param null $sort
+ * @param bool $includeContactIDs
+ * @param bool $justIDs
+ *
+ * @return string
+ */
function all($offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
);
}
+ /**
+ * @return string
+ */
function from() {
//define table name
$randomNum = md5(uniqid());
return $from;
}
+ /**
+ * @param bool $includeContactIDs
+ *
+ * @return string
+ */
function where($includeContactIDs = FALSE) {
return '(1)';
}
+ /**
+ * @return string
+ */
function templateFile() {
return 'CRM/Contact/Form/Search/Custom.tpl';
}
+ /**
+ * @param $title
+ */
function setTitle($title) {
if ($title) {
CRM_Utils_System::setTitle($title);
protected $_formValues;
+ /**
+ * @param $formValues
+ */
function __construct(&$formValues) {
$this->_formValues = $formValues;
);
}
+ /**
+ * @param $form
+ */
function buildForm(&$form) {
/**
/*
* Set search form field defaults here.
*/
+ /**
+ * @return array
+ */
function setDefaultValues() {
// Setting default search state to California
return array(
return $sql;
}
+ /**
+ * @return string
+ */
function from() {
return "
civicrm_relationship cR,
* WHERE clause is an array built from any required JOINS plus conditional filters based on search criteria field values
*
*/
+ /**
+ * @param bool $includeContactIDs
+ *
+ * @return string
+ */
function where($includeContactIDs = FALSE) {
$clauses = array();
return implode(' AND ', $clauses);
}
+ /**
+ * @param bool $includeContactIDs
+ *
+ * @return string
+ */
function having($includeContactIDs = FALSE) {
$clauses = array();
return implode(' AND ', $clauses);
return $dao->N;
}
+ /**
+ * @param int $offset
+ * @param int $rowcount
+ * @param null $sort
+ *
+ * @return string
+ */
function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) {
return $this->all($offset, $rowcount, $sort);
}
+ /**
+ * @return array
+ */
function &columns() {
return $this->_columns;
}
+ /**
+ * @param $title
+ */
function setTitle($title) {
if ($title) {
CRM_Utils_System::setTitle($title);
}
}
+ /**
+ * @return null
+ */
function summary() {
return NULL;
}
protected $_formValues;
public $_permissionedComponent;
+ /**
+ * @param $formValues
+ */
function __construct(&$formValues) {
$this->_formValues = $formValues;
$this->_permissionedComponent = array('CiviContribute', 'CiviEvent');
);
}
+ /**
+ * @param $form
+ */
function buildForm(&$form) {
/**
return $sql;
}
+ /**
+ * @return string
+ */
function from() {
return "
civicrm_participant_payment
* WHERE clause is an array built from any required JOINS plus conditional filters based on search criteria field values
*
*/
+ /**
+ * @param bool $includeContactIDs
+ *
+ * @return string
+ */
function where($includeContactIDs = FALSE) {
$clauses = array();
/* This function does a query to get totals for some of the search result columns and returns a totals array. */
+ /**
+ * @return array
+ */
function summary() {
$totalSelect = "
SUM(civicrm_contribution.total_amount) as payment_amount,COUNT(civicrm_participant.id) as participant_count,
return $dao->N;
}
+ /**
+ * @param int $offset
+ * @param int $rowcount
+ * @param null $sort
+ *
+ * @return string
+ */
function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) {
return $this->all($offset, $rowcount, $sort);
}
+ /**
+ * @return array
+ */
function &columns() {
return $this->_columns;
}
+ /**
+ * @param $title
+ */
function setTitle($title) {
if ($title) {
CRM_Utils_System::setTitle($title);
protected $_foundRows = array();
+ /**
+ * @param $formValues
+ */
function __construct(&$formValues) {
$this->_text = CRM_Utils_Array::value('text', $formValues);
$this->_table = CRM_Utils_Array::value('table', $formValues);
CRM_Core_DAO::executeQuery($sql, $params);
}
+ /**
+ * @param $tables
+ * @param $extends
+ */
function fillCustomInfo(&$tables, $extends) {
$sql = "
SELECT cg.table_name, cf.column_name
}
}
+ /**
+ * @param $tables
+ */
function runQueries(&$tables) {
$sql = "TRUNCATE {$this->_entityIDTableName}";
CRM_Core_DAO::executeQuery($sql);
$this->runQueries($tables);
}
+ /**
+ * @param $form
+ */
function buildForm(&$form) {
$config = CRM_Core_Config::singleton();
$this->setTitle(ts('Full-text Search'));
}
+ /**
+ * @return array
+ */
function &columns() {
$this->_columns = array(
ts('Contact Id') => 'contact_id',
return $this->_columns;
}
+ /**
+ * @return array
+ */
function summary() {
$this->initialize();
return $summary;
}
+ /**
+ * @return null|string
+ */
function count() {
$this->initialize();
}
}
+ /**
+ * @param int $offset
+ * @param int $rowcount
+ * @param null $sort
+ * @param bool $returnSQL
+ *
+ * @return null|string
+ */
function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = FALSE) {
$this->initialize();
}
}
+ /**
+ * @param int $offset
+ * @param int $rowcount
+ * @param null $sort
+ * @param bool $includeContactIDs
+ * @param bool $justIDs
+ *
+ * @return string
+ */
function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE) {
$this->initialize();
return $sql;
}
+ /**
+ * @return null
+ */
function from() {
return NULL;
}
+ /**
+ * @param bool $includeContactIDs
+ *
+ * @return null
+ */
function where($includeContactIDs = FALSE) {
return NULL;
}
+ /**
+ * @return string
+ */
function templateFile() {
return 'CRM/Contact/Form/Search/Custom/FullText.tpl';
}
+ /**
+ * @return array
+ */
function setDefaultValues() {
return array();
}
+ /**
+ * @param $row
+ */
function alterRow(&$row) {
}
+ /**
+ * @param $title
+ */
function setTitle($title) {
if ($title) {
CRM_Utils_System::setTitle($title);
protected $_aclFrom = NULL;
protected $_aclWhere = NULL;
+ /**
+ * @param $formValues
+ */
function __construct(&$formValues) {
$this->_formValues = $formValues;
$this->_columns = array(
// in other parts after the object is destroyed
}
+ /**
+ * @param $form
+ */
function buildForm(&$form) {
$this->setTitle(ts('Include / Exclude Search'));
/*
* Set search form field defaults here.
*/
+ /**
+ * @return array
+ */
function setDefaultValues() {
$defaults = array( 'andOr' => '1' );
return $defaults;
}
+ /**
+ * @param int $offset
+ * @param int $rowcount
+ * @param null $sort
+ * @param bool $includeContactIDs
+ * @param bool $justIDs
+ *
+ * @return string
+ */
function all(
$offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
return $sql;
}
+ /**
+ * @return string
+ * @throws Exception
+ */
function from() {
$iGroups = $xGroups = $iTags = $xTags = 0;
return $from;
}
+ /**
+ * @param bool $includeContactIDs
+ *
+ * @return string
+ */
function where($includeContactIDs = FALSE) {
if ($includeContactIDs) {
$contactIDs = array();
/*
* Functions below generally don't need to be modified
*/
+ /**
+ * @return mixed
+ */
function count() {
$sql = $this->all();
return $dao->N;
}
+ /**
+ * @param int $offset
+ * @param int $rowcount
+ * @param null $sort
+ * @param bool $returnSQL
+ *
+ * @return string
+ */
function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = FALSE) {
return $this->all($offset, $rowcount, $sort, FALSE, TRUE);
}
+ /**
+ * @return array
+ */
function &columns() {
return $this->_columns;
}
+ /**
+ * @return null
+ */
function summary() {
return NULL;
}
+ /**
+ * @return string
+ */
function templateFile() {
return 'CRM/Contact/Form/Search/Custom.tpl';
}
+ /**
+ * @param $title
+ */
function setTitle($title) {
if ($title) {
CRM_Utils_System::setTitle($title);
}
}
+ /**
+ * @param string $tableAlias
+ */
function buildACLClause($tableAlias = 'contact') {
list($this->_aclFrom, $this->_aclWhere) = CRM_Contact_BAO_Contact_Permission::cacheClause($tableAlias);
}
protected $_tables;
protected $_options;
+ /**
+ * @param $formValues
+ */
function __construct(&$formValues) {
parent::__construct($formValues);
}
}
+ /**
+ * @param $form
+ */
function buildForm(&$form) {
/**
}
}
+ /**
+ * @return null
+ */
function summary() {
return NULL;
}
+ /**
+ * @param int $offset
+ * @param int $rowcount
+ * @param null $sort
+ * @param bool $includeContactIDs
+ * @param bool $justIDs
+ *
+ * @return string
+ */
function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE) {
//redirect if custom group not select in search criteria
if (empty($this->_formValues['custom_group'])) {
);
}
+ /**
+ * @return string
+ */
function from() {
$from = "FROM civicrm_contact contact_a";
$customFrom = array();
return $from;
}
+ /**
+ * @param bool $includeContactIDs
+ *
+ * @return string
+ */
function where($includeContactIDs = FALSE) {
$count = 1;
$clause = array();
return $this->whereClause($where, $params);
}
+ /**
+ * @return string
+ */
function templateFile() {
return 'CRM/Contact/Form/Search/Custom/MultipleValues.tpl';
}
+ /**
+ * @return array
+ */
function setDefaultValues() {
return array();
}
+ /**
+ * @param $row
+ */
function alterRow(&$row) {
foreach ($this->_options as $fieldID => $values) {
$customVal = $valueSeparatedArray = array();
}
}
+ /**
+ * @param $title
+ */
function setTitle($title) {
CRM_Utils_System::setTitle($title);
}
*
*/
class CRM_Contact_Form_Search_Custom_PostalMailing extends CRM_Contact_Form_Search_Custom_Base implements CRM_Contact_Form_Search_Interface {
+ /**
+ * @param $formValues
+ */
function __construct(&$formValues) {
parent::__construct($formValues);
);
}
+ /**
+ * @param $form
+ */
function buildForm(&$form) {
$groups = array('' => ts('- select group -')) + CRM_Core_PseudoConstant::allGroup();
$form->addElement('select', 'group_id', ts('Group'), $groups);
$form->assign('elements', array('group_id'));
}
+ /**
+ * @param int $offset
+ * @param int $rowcount
+ * @param null $sort
+ * @param bool $includeContactIDs
+ * @param bool $justIDs
+ *
+ * @return string
+ */
function all($offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
);
}
+ /**
+ * @return string
+ */
function from() {
return "
FROM civicrm_group_contact as cgc,
";
}
+ /**
+ * @param bool $includeContactIDs
+ *
+ * @return string
+ */
function where($includeContactIDs = FALSE) {
$params = array();
return $this->whereClause($where, $params);
}
+ /**
+ * @return string
+ */
function templateFile() {
return 'CRM/Contact/Form/Search/Custom.tpl';
}
protected $_tableName = NULL;
public $_permissionedComponent;
+ /**
+ * @param $formValues
+ */
function __construct(&$formValues) {
parent::__construct($formValues);
}
}
+ /**
+ * @param null $eventID
+ *
+ * @return Object
+ */
function priceSetDAO($eventID = NULL) {
// get all the events that have a price set associated with it
return $dao;
}
+ /**
+ * @param $form
+ *
+ * @throws Exception
+ */
function buildForm(&$form) {
$dao = $this->priceSetDAO();
}
}
+ /**
+ * @return null
+ */
function summary() {
return NULL;
}
+ /**
+ * @param int $offset
+ * @param int $rowcount
+ * @param null $sort
+ * @param bool $includeContactIDs
+ * @param bool $justIDs
+ *
+ * @return string
+ */
function all($offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
);
}
+ /**
+ * @return string
+ */
function from() {
return "
FROM civicrm_contact contact_a
";
}
+ /**
+ * @param bool $includeContactIDs
+ *
+ * @return string
+ */
function where($includeContactIDs = FALSE) {
return ' ( 1 ) ';
}
+ /**
+ * @return string
+ */
function templateFile() {
return 'CRM/Contact/Form/Search/Custom.tpl';
}
+ /**
+ * @return array
+ */
function setDefaultValues() {
return array();
}
+ /**
+ * @param $row
+ */
function alterRow(&$row) {}
+ /**
+ * @param $title
+ */
function setTitle($title) {
if ($title) {
CRM_Utils_System::setTitle($title);
protected $_longitude = NULL;
protected $_distance = NULL;
+ /**
+ * @param $formValues
+ *
+ * @throws Exception
+ */
function __construct(&$formValues) {
parent::__construct($formValues);
);
}
+ /**
+ * @param $form
+ */
function buildForm(&$form) {
$config = CRM_Core_Config::singleton();
));
}
+ /**
+ * @param int $offset
+ * @param int $rowcount
+ * @param null $sort
+ * @param bool $includeContactIDs
+ * @param bool $justIDs
+ *
+ * @return string
+ */
function all($offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
);
}
+ /**
+ * @return string
+ */
function from() {
$f = "
FROM civicrm_contact contact_a
return $f;
}
+ /**
+ * @param bool $includeContactIDs
+ *
+ * @return string
+ */
function where($includeContactIDs = FALSE) {
$params = array();
$clause = array();
return $this->whereClause($where, $params);
}
+ /**
+ * @return string
+ */
function templateFile() {
return 'CRM/Contact/Form/Search/Custom/Proximity.tpl';
}
+ /**
+ * @return array|null
+ */
function setDefaultValues() {
$config = CRM_Core_Config::singleton();
$countryDefault = $config->defaultContactCountry;
return NULL;
}
+ /**
+ * @param $row
+ */
function alterRow(&$row) {}
+ /**
+ * @param $title
+ */
function setTitle($title) {
if ($title) {
CRM_Utils_System::setTitle($title);
protected $_debug = 0;
+ /**
+ * @param $formValues
+ */
function __construct(&$formValues) {
parent::__construct($formValues);
}
}
+ /**
+ * @param $form
+ */
function buildForm(&$form) {
$form->add('text',
'segmentSize',
$form->assign('elements', array('segmentSize', 'includeGroups', 'excludeGroups'));
}
+ /**
+ * @return null
+ */
function summary() {
return NULL;
}
+ /**
+ * @param int $offset
+ * @param int $rowcount
+ * @param null $sort
+ * @param bool $includeContactIDs
+ * @param bool $justIDs
+ *
+ * @return string
+ */
function all($offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
);
}
+ /**
+ * @return string
+ */
function from() {
//define table name
$randomNum = md5(uniqid());
return $from;
}
+ /**
+ * @param bool $includeContactIDs
+ *
+ * @return string
+ */
function where($includeContactIDs = FALSE) {
return '(1)';
}
+ /**
+ * @return string
+ */
function templateFile() {
return 'CRM/Contact/Form/Search/Custom.tpl';
}
+ /**
+ * @param $title
+ */
function setTitle($title) {
if ($title) {
CRM_Utils_System::setTitle($title);
*
*/
class CRM_Contact_Form_Search_Custom_Sample extends CRM_Contact_Form_Search_Custom_Base implements CRM_Contact_Form_Search_Interface {
+ /**
+ * @param $formValues
+ */
function __construct(&$formValues) {
parent::__construct($formValues);
);
}
+ /**
+ * @param $form
+ */
function buildForm(&$form) {
$form->add('text',
$form->assign('elements', array('household_name', 'state_province_id'));
}
+ /**
+ * @return array
+ */
function summary() {
$summary = array(
'summary' => 'This is a summary',
return $summary;
}
+ /**
+ * @param int $offset
+ * @param int $rowcount
+ * @param null $sort
+ * @param bool $includeContactIDs
+ * @param bool $justIDs
+ *
+ * @return string
+ */
function all($offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
);
}
+ /**
+ * @return string
+ */
function from() {
return "
FROM civicrm_contact contact_a
";
}
+ /**
+ * @param bool $includeContactIDs
+ *
+ * @return string
+ */
function where($includeContactIDs = FALSE) {
$params = array();
$where = "contact_a.contact_type = 'Household'";
return $this->whereClause($where, $params);
}
+ /**
+ * @return string
+ */
function templateFile() {
return 'CRM/Contact/Form/Search/Custom.tpl';
}
+ /**
+ * @return array
+ */
function setDefaultValues() {
return array(
'household_name' => '',
);
}
+ /**
+ * @param $row
+ */
function alterRow(&$row) {
$row['sort_name'] .= ' ( altered )';
}
+ /**
+ * @param $title
+ */
function setTitle($title) {
if ($title) {
CRM_Utils_System::setTitle($title);
protected $_formValues;
public $_permissionedComponent;
+ /**
+ * @param $formValues
+ */
function __construct(&$formValues) {
$this->_formValues = $formValues;
$this->_permissionedComponent = 'CiviContribute';
);
}
+ /**
+ * @param $form
+ */
function buildForm(&$form) {
/**
return $sql;
}
+ /**
+ * @return string
+ */
function from() {
return "
civicrm_contribution,
* WHERE clause is an array built from any required JOINS plus conditional filters based on search criteria field values
*
*/
+ /**
+ * @param bool $includeContactIDs
+ *
+ * @return string
+ */
function where($includeContactIDs = FALSE) {
$clauses = array();
return $dao->N;
}
+ /**
+ * @param int $offset
+ * @param int $rowcount
+ * @param null $sort
+ *
+ * @return string
+ */
function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) {
return $this->all($offset, $rowcount, $sort, FALSE, TRUE);
}
+ /**
+ * @return array
+ */
function &columns() {
return $this->_columns;
}
+ /**
+ * @param $title
+ */
function setTitle($title) {
if ($title) {
CRM_Utils_System::setTitle($title);
}
}
+ /**
+ * @return null
+ */
function summary() {
return NULL;
}
*
*/
class CRM_Contact_Form_Search_Custom_ZipCodeRange extends CRM_Contact_Form_Search_Custom_Base implements CRM_Contact_Form_Search_Interface {
+ /**
+ * @param $formValues
+ */
function __construct(&$formValues) {
parent::__construct($formValues);
);
}
+ /**
+ * @param $form
+ */
function buildForm(&$form) {
$form->add('text',
'postal_code_low',
$form->assign('elements', array('postal_code_low', 'postal_code_high'));
}
+ /**
+ * @return array
+ */
function summary() {
$summary = array();
return $summary;
}
+ /**
+ * @param int $offset
+ * @param int $rowcount
+ * @param null $sort
+ * @param bool $includeContactIDs
+ * @param bool $justIDs
+ *
+ * @return string
+ */
function all($offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
);
}
+ /**
+ * @return string
+ */
function from() {
return "
FROM civicrm_contact contact_a
";
}
+ /**
+ * @param bool $includeContactIDs
+ *
+ * @return string
+ */
function where($includeContactIDs = FALSE) {
$params = array();
return $this->whereClause($where, $params);
}
+ /**
+ * @return array
+ */
function setDefaultValues() {
return array();
}
+ /**
+ * @return string
+ */
function templateFile() {
return 'CRM/Contact/Form/Search/Custom.tpl';
}
+ /**
+ * @param $title
+ */
function setTitle($title) {
if ($title) {
CRM_Utils_System::setTitle($title);
self::preProcessCommon($this);
}
+ /**
+ * @param $form
+ * @param bool $useTable
+ */
static function preProcessCommon(&$form, $useTable = FALSE) {
$form->_contactIds = array();
$this->addFormRule(array('CRM_Contact_Form_Task_AddToTag', 'formRule'));
}
+ /**
+ * @param $form
+ * @param $rule
+ *
+ * @return array
+ */
static function formRule($form, $rule) {
$errors = array();
if (empty($form['tag']) && empty($form['contact_taglist'])) {
return $defaults;
}
+ /**
+ * @param $form
+ * @param $rule
+ *
+ * @return array
+ */
static function formRule($form, $rule) {
$errors = array();
if (empty($form['pref']) && empty($form['contact_taglist'])) {
public $_allContactDetails = array();
public $_toContactEmails = array();
+ /**
+ * @param $form
+ */
static function preProcessFromAddress(&$form) {
$form->_single = FALSE;
$className = CRM_Utils_System::getClassName($form);
return $returnProperties;
}
+ /**
+ * @param $rows
+ */
function mergeSameAddress(&$rows) {
$uniqueAddress = array();
foreach (array_keys($rows) as $rowID) {
}
}
+ /**
+ * @param $rows
+ *
+ * @return array
+ */
function mergeSameHousehold(&$rows) {
# group selected contacts by type
$individuals = array();
$this->assign('skipLocationType', TRUE);
}
+ /**
+ * Use the form name to create the tpl file name
+ *
+ * @return string
+ * @access public
+ */
+ /**
+ * @return string
+ */
function getTemplateFileName() {
return 'CRM/Contact/Form/Task/Map.tpl';
}
$this->assign('single', $this->_single);
}
+ /**
+ * This function sets the default values for the form. Relationship that in edit/view action
+ * the default values are retrieved from the database
+ *
+ * @access public
+ *
+ * @return void
+ */
+ /**
+ *
+ */
function setDefaultValues() {
$defaults = array();
if (isset($this->_activityId)) {
CRM_Utils_System::setTitle('Create Printable Letters (PDF)');
}
+ /**
+ * @param $form
+ * @param $cid
+ */
static function preProcessSingle(&$form, $cid) {
$form->_contactIds = array($cid);
// put contact display name in title for single contact mode
CRM_Utils_System::civiExit(1);
}
+ /**
+ * @param $form
+ * @param $html_message
+ * @param $contactIds
+ *
+ * @throws CRM_Core_Exception
+ */
static function createActivities($form, $html_message, $contactIds) {
//Added for CRM-12682: Add activity subject and campaign fields
$formValues = $form->controller->exportValues($form->getName());
}
}
+ /**
+ * @param $message
+ */
static function formatMessage(&$message) {
$newLineOperators = array(
'p' => array(
$this->addFormRule(array('CRM_Contact_Form_Task_RemoveFromTag', 'formRule'));
}
+ /**
+ * @param $form
+ * @param $rule
+ *
+ * @return array
+ */
static function formRule($form, $rule) {
$errors = array();
if (empty($form['tag']) && empty($form['contact_taglist'])) {
public $_toContactPhone = array();
+ /**
+ * @param $form
+ */
static function preProcessProvider(&$form) {
$form->_single = FALSE;
$className = CRM_Utils_System::getClassName($form);
<?php
+
+/**
+ * Class CRM_Contact_Form_Task_Unhold
+ */
class CRM_Contact_Form_Task_Unhold extends CRM_Contact_Form_Task {
/**
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
+
+/**
+ * Class CRM_Contact_Import_Field
+ */
class CRM_Contact_Import_Field {
/**#@+
*/
public $_relatedContactPhoneType;
+ /**
+ * @param $name
+ * @param $title
+ * @param int $type
+ * @param string $columnPattern
+ * @param string $dataPattern
+ * @param null $hasLocationType
+ * @param null $phoneType
+ * @param null $related
+ * @param null $relatedContactType
+ * @param null $relatedContactDetails
+ * @param null $relatedContactLocType
+ * @param null $relatedContactPhoneType
+ */
function __construct($name, $title, $type = CRM_Utils_Type::T_INT, $columnPattern = '//', $dataPattern = '//', $hasLocationType = NULL, $phoneType = NULL, $related = NULL, $relatedContactType = NULL, $relatedContactDetails = NULL, $relatedContactLocType = NULL, $relatedContactPhoneType = NULL) {
$this->_name = $name;
$this->_title = $title;
$this->_value = $value;
}
+ /**
+ * @return bool
+ */
function validate() {
// echo $this->_value."===========<br>";
$message = '';
);
}
+ /**
+ * This virtual function is used to set the default values of
+ * various form elements
+ *
+ * access public
+ *
+ * @return array reference to the array of default values
+ *
+ */
+ /**
+ * @return array
+ */
function setDefaultValues() {
$config = CRM_Core_Config::singleton();
$defaults = array(
return $defaults;
}
+ /**
+ * @return array
+ * @throws Exception
+ */
private function _getDataSources() {
// Open the data source dir and scan it for class files
$config = CRM_Core_Config::singleton();
protected $_parser;
+ /**
+ * @param null $tableName
+ * @param null $createSql
+ * @param bool $createTable
+ *
+ * @throws Exception
+ */
public function __construct($tableName = NULL, $createSql = NULL, $createTable = FALSE) {
$dao = new CRM_Core_DAO();
$db = $dao->getDatabaseConnection();
foreach ($properties as $property) $this->{"_$property"} = array();
}
+ /**
+ * @return null|string
+ */
public function getTableName() {
return $this->_tableName;
}
+ /**
+ * @param bool $dropIfComplete
+ *
+ * @return bool
+ * @throws Exception
+ */
public function isComplete($dropIfComplete = TRUE) {
if (!$this->_statusFieldName) {
CRM_Core_Error::fatal("Could not get name of the import status field");
return TRUE;
}
+ /**
+ * @param $params
+ */
public function setJobParams(&$params) {
foreach ($params as $param => $value) {
$fldName = "_$param";
}
}
+ /**
+ * @param $form
+ * @param int $timeout
+ */
public function runImport(&$form, $timeout = 55) {
$mapper = $this->_mapper;
$mapperFields = array();
}
}
+ /**
+ * @param $form
+ */
public function setFormVariables($form) {
$this->_parser->set($form, CRM_Import_Parser::MODE_IMPORT);
}
+ /**
+ * @param $contactIds
+ * @param $newGroupName
+ * @param $newGroupDesc
+ *
+ * @return array|bool
+ */
private function _addImportedContactsToNewGroup($contactIds,
$newGroupName, $newGroupDesc
) {
return FALSE;
}
+ /**
+ * @param $contactIds
+ * @param $newTagName
+ * @param $newTagDesc
+ *
+ * @return array|bool
+ */
private function _tagImportedContactsWithNewTag($contactIds,
$newTagName, $newTagDesc
) {
return FALSE;
}
+ /**
+ * @return array
+ */
public static function getIncompleteImportTables() {
$dao = new CRM_Core_DAO();
$database = $dao->database();
* via a form post) and asynchronously (i.e. by the workflow system)
*/
class CRM_Contact_Import_Importer {
+ /**
+ *
+ */
public function __construct() {
// may not need this
}
+ /**
+ * @param int $timeout
+ */
public function runIncompleteImportJobs($timeout = 55) {
$startTime = time();
$incompleteImportTables = CRM_Contact_Import_ImportJob::getIncompleteImportTables();
*/
public $_dedupeRuleGroupID = NULL;
+ /**
+ * @param $tableName
+ * @param $mapper
+ * @param int $mode
+ * @param int $contactType
+ * @param string $primaryKeyName
+ * @param string $statusFieldName
+ * @param int $onDuplicate
+ * @param null $statusID
+ * @param null $totalRowCount
+ * @param bool $doGeocodeAddress
+ * @param int $timeout
+ * @param null $contactSubType
+ * @param null $dedupeRuleGroupID
+ *
+ * @return mixed
+ */
function run($tableName,
&$mapper,
$mode = self::MODE_PREVIEW,
}
}
+ /**
+ * @param $elements
+ */
function setActiveFieldLocationTypes($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_hasLocationType = $elements[$i];
}
}
+ /**
+ * @param $elements
+ */
+ /**
+ * @param $elements
+ */
function setActiveFieldPhoneTypes($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_phoneType = $elements[$i];
}
}
+ /**
+ * @param $elements
+ */
function setActiveFieldWebsiteTypes($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_websiteType = $elements[$i];
}
}
+ /**
+ * @param $elements
+ */
function setActiveFieldRelated($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_related = $elements[$i];
}
}
+ /**
+ * @param $elements
+ */
function setActiveFieldRelatedContactType($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_relatedContactType = $elements[$i];
}
}
+ /**
+ * @param $elements
+ */
function setActiveFieldRelatedContactDetails($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_relatedContactDetails = $elements[$i];
}
}
+ /**
+ * @param $elements
+ */
function setActiveFieldRelatedContactLocType($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_relatedContactLocType = $elements[$i];
}
}
+ /**
+ * @param $elements
+ */
function setActiveFieldRelatedContactPhoneType($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_relatedContactPhoneType = $elements[$i];
}
}
+ /**
+ * @param $elements
+ */
function setActiveFieldRelatedContactWebsiteType($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_relatedContactWebsiteType = $elements[$i];
return $params;
}
+ /**
+ * @return array
+ */
function getColumnPatterns() {
$values = array();
foreach ($this->_fields as $name => $field) {
return $values;
}
+ /**
+ * @param $name
+ * @param $title
+ * @param int $type
+ * @param string $headerPattern
+ * @param string $dataPattern
+ * @param bool $hasLocationType
+ */
function addField($name, $title, $type = CRM_Utils_Type::T_INT,
$headerPattern = '//', $dataPattern = '//',
$hasLocationType = FALSE
return $returnCode;
}
+ /**
+ * @param $relKey
+ * @param $params
+ *
+ * @return bool
+ */
function checkRelatedContactFields($relKey, $params) {
//avoid blank contact creation.
$allowToCreate = FALSE;
}
//end of function
+ /**
+ * @param null $action
+ * @param null $output
+ *
+ * @return array
+ */
function &getColHeads($action = NULL, $output = NULL) {
$colHeads = self::_getColumnHeaders();
$colHeads[] = array('desc' => ts('Actions'), 'name' => ts('Action'));
return $rows;
}
+ /**
+ * @param $sort
+ *
+ * @return string
+ */
function buildPrevNextCache($sort) {
$cacheKey = 'civicrm search ' . $this->_key;
return $cacheKey;
}
+ /**
+ * @param $rows
+ */
function addActions(&$rows) {
$config = CRM_Core_Config::singleton();
}
}
+ /**
+ * @param $rows
+ */
function removeActions(&$rows) {
foreach ($rows as $rid => & $rValue) {
unset($rValue['contact_type']);
return self::$_columnHeaders;
}
+ /**
+ * @return CRM_Contact_BAO_Query
+ */
function &getQuery() {
return $this->_query;
}
+ /**
+ * @return CRM_Contact_DAO_Contact
+ */
function alphabetQuery() {
return $this->_query->searchQuery(NULL, NULL, NULL, FALSE, FALSE, TRUE);
}
+ /**
+ * @param $params
+ * @param $action
+ * @param $sortID
+ * @param null $displayRelationshipType
+ * @param string $queryOperator
+ *
+ * @return CRM_Contact_DAO_Contact
+ */
function contactIDQuery($params, $action, $sortID, $displayRelationshipType = NULL, $queryOperator = 'AND') {
$sortOrder = &$this->getSortOrder($this->_action);
$sort = new CRM_Utils_Sort($sortOrder, $sortID);
return $value;
}
+ /**
+ * @param $returnProperties
+ *
+ * @return array
+ */
function &makeProperties(&$returnProperties) {
$properties = array();
foreach ($returnProperties as $name => $value) {
*
*/
class CRM_Contact_Selector_Controller extends CRM_Core_Selector_Controller {
+ /**
+ * default function for qill, if needed to be implemented, we
+ * expect the subclass to do it
+ *
+ * @return string the status message
+ * @access public
+ */
+ /**
+ * @return string
+ */
function getQill() {
return $this->_object->getQILL();
}
return NULL;
}
+ /**
+ * @return mixed
+ */
public function getSummary() {
return $this->_search->summary();
}
return ts('CiviCRM Custom Search');
}
+ /**
+ * @return null
+ */
function alphabetQuery() {
return NULL;
}
+ /**
+ * @param $params
+ * @param $action
+ * @param $sortID
+ * @param null $displayRelationshipType
+ * @param string $queryOperator
+ *
+ * @return Object
+ */
function &contactIDQuery($params, $action, $sortID, $displayRelationshipType = NULL, $queryOperator = 'AND') {
$params = array();
$sql = $this->_search->contactIDs($params);
return CRM_Core_DAO::executeQuery($sql, $params);
}
+ /**
+ * @param $rows
+ */
function addActions(&$rows) {
$links = self::links();
}
}
+ /**
+ * @param $rows
+ */
function removeActions(&$rows) {
foreach ($rows as $rid => & $rValue) {
unset($rValue['action']);
return $tasks;
}
+ /**
+ * @param $value
+ *
+ * @return array
+ */
static function getTask($value) {
self::initTasks();