* bit manipulation operations so we can perform multiple
* actions on the same object if needed
*
- * @var array $_names type of variable name to action constant
+ * @var array
*
*/
- static $_names = [
+ public static $_names = [
'add' => self::ADD,
'update' => self::UPDATE,
'view' => self::VIEW,
*
* @var array
*/
- static $_description;
+ public static $_description;
/**
* Called by the request object to translate a string into a mask.
/**
* Fields that are required for a valid block.
+ * @var array
*/
- static $requiredBlockFields = [
+ public static $requiredBlockFields = [
'email' => ['email'],
'phone' => ['phone'],
'im' => ['name'],
/**
* @var array ($cacheKey => $cacheValue)
*/
- static $_cache = NULL;
+ public static $_cache = NULL;
/**
* Retrieve an item from the DB cache.
* @param bool $session
* @param bool $table
* @param bool $prevNext
+ * @param bool $expired
*/
public static function cleanup($session = FALSE, $table = FALSE, $prevNext = FALSE, $expired = FALSE) {
// clean up the session cache every $cacheCleanUpNumber probabilistically
* @return string
* SQL condition.
*/
- static private function whereListHas($column, $value, $delimiter = CRM_Core_DAO::VALUE_SEPARATOR) {
+ private static function whereListHas($column, $value, $delimiter = CRM_Core_DAO::VALUE_SEPARATOR) {
// ?
$bareValue = trim($value, $delimiter);
$escapedValue = CRM_Utils_Type::escape("%{$delimiter}{$bareValue}{$delimiter}%", 'String', FALSE);
* @return bool
* does this entity have data in this custom table
*/
- static public function customGroupDataExistsForEntity($entityID, $table, $getCount = FALSE) {
+ public static function customGroupDataExistsForEntity($entityID, $table, $getCount = FALSE) {
$query = "
SELECT count(id)
FROM $table
* @param array $singleFieldTablesWithEntityData
* Array of tables in which this entity has data.
*/
- static public function buildEntityTreeSingleFields(&$groupTree, $entityID, $entitySingleSelectClauses, $singleFieldTablesWithEntityData) {
+ public static function buildEntityTreeSingleFields(&$groupTree, $entityID, $entitySingleSelectClauses, $singleFieldTablesWithEntityData) {
$select = implode(', ', $entitySingleSelectClauses);
$fromSQL = " (SELECT $entityID as entity_id ) as first ";
foreach ($singleFieldTablesWithEntityData as $table) {
* @param string|int $singleRecord
* holds 'new' or id if view/edit/copy form for a single record is being loaded.
*/
- static public function buildEntityTreeMultipleFields(&$groupTree, $entityID, $entityMultipleSelectClauses, $multipleFieldTablesWithEntityData, $singleRecord = NULL) {
+ public static function buildEntityTreeMultipleFields(&$groupTree, $entityID, $entityMultipleSelectClauses, $multipleFieldTablesWithEntityData, $singleRecord = NULL) {
foreach ($entityMultipleSelectClauses as $table => $selectClauses) {
$select = implode(',', $selectClauses);
$query = "
* @param string|int $singleRecord
* holds 'new' OR id if view/edit/copy form for a single record is being loaded.
*/
- static public function buildTreeEntityDataFromQuery(&$groupTree, $query, $includedTables, $singleRecord = NULL) {
+ public static function buildTreeEntityDataFromQuery(&$groupTree, $query, $includedTables, $singleRecord = NULL) {
$dao = CRM_Core_DAO::executeQuery($query);
while ($dao->fetch()) {
foreach ($groupTree as $groupID => $group) {
* @param string|int $singleRecord
* holds 'new' or id if loading view/edit/copy for a single record.
*/
- static public function buildCustomFieldData($dao, &$groupTree, $table, $groupID, $fieldID, $singleRecord = NULL) {
+ public static function buildCustomFieldData($dao, &$groupTree, $table, $groupID, $fieldID, $singleRecord = NULL) {
$column = $groupTree[$groupID]['fields'][$fieldID]['column_name'];
$idName = "{$table}_id";
$fieldName = "{$table}_{$column}";
* -rp = rowcount
* -page= offset
*/
- static public function getOptionListSelector(&$params) {
+ public static function getOptionListSelector(&$params) {
$options = [];
$field = CRM_Core_BAO_CustomField::getFieldObject($params['fid']);
public $_qill;
/**
- * @deprecated
* No longer needed due to CRM-17646 refactoring, but still used in some places
*
* @var array
+ * @deprecated
*/
public $_options;
*
* @var array
*/
- static $extendsMap = [
+ public static $extendsMap = [
'Contact' => 'civicrm_contact',
'Individual' => 'civicrm_contact',
'Household' => 'civicrm_contact',
}
}
-
/**
* @param array $formValues
* @return null
* Class contains Contact dashboard related functions.
*/
class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard {
+
/**
* Add Dashboard.
*
* the default dashlets.
*
* @return array
- * Array of dashboard_id's
+ * Array of dashboard_id's
* @throws \CiviCRM_API3_Exception
*/
public static function initializeDashlets() {
/**
* Cache for the current domain object.
+ * @var object
*/
- static $_domain = NULL;
+ public static $_domain = NULL;
/**
* Cache for a domain's location array
+ * @var array
*/
private $_location = NULL;
/**
* @param bool $skipFatal
- *
+ * @param bool $returnString
* @return array
* name & email for domain
* @throws Exception
*/
class CRM_Core_BAO_File extends CRM_Core_DAO_File {
- static $_signableFields = ['entityTable', 'entityID', 'fileID'];
+ public static $_signableFields = ['entityTable', 'entityID', 'fileID'];
/**
* Takes an associative array and creates a File object.
return [NULL, NULL];
}
-
/**
* @param $data
* @param int $fileTypeID
self::deleteEntityFile($params['entityTable'], $params['entityID'], NULL, $params['fileID']);
}
-
/**
* Display paper icon for a file attachment -- CRM-13624
*
*
* @param int $entityId entity id the file is attached to
* @param int $fileId file ID
+ * @param int $genTs
+ * @param int $life
* @return string
*/
public static function generateFileHash($entityId = NULL, $fileId = NULL, $genTs = NULL, $life = NULL) {
*
* @return \CRM_Financial_DAO_FinancialTrxn
*/
+
/**
*/
public function __construct() {
* @param bool $newTrxn
* @param string $whereClause
* Additional where parameters
+ * @param int $fromAccountID
*
* @return array
* array of category id's the contact belongs to.
* Make a copy of a Job.
*
* @param int $id The job id to copy.
- *
+ * @param array $params
* @return CRM_Core_DAO
*/
public static function copy($id, $params = []) {
/**
* Static holder for the Label Formats Option Group ID.
+ * @var int
*/
private static $_gid = NULL;
/**
* Label Format fields stored in the 'value' field of the Option Value table.
+ * @var array
*/
private static $optionValueFields = [
'paper-size' => [
/**
* Add ordering fields to Label Format list.
*
- * @param array (reference) $list List of Label Formats
+ * @param array $list List of Label Formats
* @param string $returnURL
* URL of page calling this function.
*
*
* @param string $field
* Name of a label format field.
- * @param array (reference) $values associative array of name/value pairs containing
+ * @param array $values associative array of name/value pairs containing
* label format field selections
*
* @param null $default
/**
* Save the Label Format in the DB.
*
- * @param array (reference) $values associative array of name/value pairs
+ * @param array $values associative array of name/value pairs
* @param int $id
* Id of the database record (null = new record).
* @param string $groupName
/**
* Location block element array.
+ * @var array
*/
- static $blocks = ['phone', 'email', 'im', 'openid', 'address'];
+ public static $blocks = ['phone', 'email', 'im', 'openid', 'address'];
/**
* Create various elements of location block.
}
foreach ([
- 'phone',
- 'email',
- 'im',
- 'address',
- ] as $loc) {
+ 'phone',
+ 'email',
+ 'im',
+ 'address',
+ ] as $loc) {
$locBlock["{$loc}_id"] = !empty($location["$loc"][0]) ? $location["$loc"][0]->id : NULL;
$locBlock["{$loc}_2_id"] = !empty($location["$loc"][1]) ? $location["$loc"][1]->id : NULL;
}
$nonPrimaryBlockIds = CRM_Contact_BAO_Contact::getLocBlockIds($contactId, ['is_primary' => 0]);
foreach ([
- 'Email',
- 'IM',
- 'Phone',
- 'Address',
- 'OpenID',
- ] as $block) {
+ 'Email',
+ 'IM',
+ 'Phone',
+ 'Address',
+ 'OpenID',
+ ] as $block) {
$name = strtolower($block);
if (array_key_exists($name, $primaryLocBlockIds) &&
!CRM_Utils_System::isNull($primaryLocBlockIds[$name])
/**
* Static holder for the default LT.
+ * @var int
*/
- static $_defaultLocationType = NULL;
- static $_billingLocationType = NULL;
+ public static $_defaultLocationType = NULL;
+ public static $_billingLocationType = NULL;
/**
* Class constructor.
* BAO object for crm_log table
*/
class CRM_Core_BAO_Log extends CRM_Core_DAO_Log {
- static $_processed = NULL;
+ public static $_processed = NULL;
/**
* @param int $id
//we need to unset groups, tags, notes for component export
if ($exportMode != CRM_Export_Form_Select::CONTACT_EXPORT) {
foreach ([
- 'groups',
- 'tags',
- 'notes',
- ] as $value) {
+ 'groups',
+ 'tags',
+ 'notes',
+ ] as $value) {
unset($fields['Individual'][$value]);
unset($fields['Household'][$value]);
unset($fields['Organization'][$value]);
return $groupTitle;
}
-
/**
* Function returns all Custom group Names.
*
$smarty = CRM_Core_Smarty::singleton();
foreach ([
- 'text',
- 'html',
- ] as $elem) {
+ 'text',
+ 'html',
+ ] as $elem) {
$$elem = $smarty->fetch("string:{$$elem}");
}
}
else {
CRM_Core_Error::fatal(ts('No such message template: option group %1, option value %2.', [
- 1 => $params['groupName'],
- 2 => $params['valueName'],
- ]));
+ 1 => $params['groupName'],
+ 2 => $params['valueName'],
+ ]));
}
}
*
* @return bool|\CRM_Core_DAO
*/
- static public function createOrUpdateTopLevelReportsNavItem($domain_id) {
+ public static function createOrUpdateTopLevelReportsNavItem($domain_id) {
$id = NULL;
$dao = new CRM_Core_BAO_Navigation();
* If True then do not match with a url that has a different parent
* (This is because for top level items there is a risk of 'stealing' rows that normally
* live under 'Contact' and intentionally duplicate the report examples.)
- *
+ * @param bool $useWildcard
* @return \CRM_Core_DAO_Navigation
*/
protected static function createOrUpdateReportNavItem($name, $url, $url_params, $parent_id, $permission,
'name' => 'CiviCRM Home',
'url' => 'civicrm/dashboard?reset=1',
'weight' => 1,
- ]
+ ],
],
[
'attributes' => [
'name' => 'Hide Menu',
'url' => '#hidemenu',
'weight' => 2,
- ]
+ ],
],
[
'attributes' => [
'name' => 'Log out',
'url' => 'civicrm/logout?reset=1',
'weight' => 3,
- ]
+ ],
],
];
return;
* (reference) an assoc array of name/value pairs.
* @param array $ids
* (deprecated) associated array with note id - preferably set $params['id'].
- * @return null|object $note
+ * @return null|object
* $note CRM_Core_BAO_Note object
* @throws \CRM_Exception
*/
/**
* Static holder for the Paper Size Option Group ID.
+ * @var int
*/
private static $_gid = NULL;
/**
* Paper Size fields stored in the 'value' field of the Option Value table.
+ * @var array
*/
private static $optionValueFields = [
'metric' => [
/**
* Add ordering fields to Paper Size list.
*
- * @param array (reference) $list List of Paper Sizes
+ * @param array $list List of Paper Sizes
* @param string $returnURL
* URL of page calling this function.
*
*
* @param string $field
* Name of a Paper Size field.
- * @param array (reference) $values associative array of name/value pairs containing
+ * @param array $values associative array of name/value pairs containing
* Paper Size field selections
*
* @param null $default
/**
* Save the Paper Size in the DB.
*
- * @param array (reference) $values associative array of name/value pairs
+ * @param array $values associative array of name/value pairs
* @param int $id
* Id of the database record (null = new record).
*/
/**
* Static holder for the PDF Page Formats Option Group ID.
+ * @var int
*/
private static $_gid = NULL;
/**
* PDF Page Format fields stored in the 'value' field of the Option Value table.
+ * @var array
*/
private static $optionValueFields = [
'paper_size' => [
/**
* Add ordering fields to Page Format list.
*
- * @param array (reference) $list List of PDF Page Formats
+ * @param array $list List of PDF Page Formats
* @param string $returnURL
* URL of page calling this function.
*/
*
* @param string $field
* Name of a PDF Page Format field.
- * @param array (reference) $values associative array of name/value pairs containing
+ * @param array $values associative array of name/value pairs containing
* PDF Page Format field selections
*
* @param null $default
/**
* Static holder for the default LT.
+ * @var string
*/
- static $_defaultPreferencesDate = NULL;
+ public static $_defaultPreferencesDate = NULL;
/**
* Class constructor.
if (isset($cacheKey)) {
$sql .= " AND cacheKey LIKE %4";
- $params[4] = ["{$cacheKey}%", 'String']; // used % to address any row with conflict-cacheKey e.g "merge Individual_8_0_conflicts"
+ // used % to address any row with conflict-cacheKey e.g "merge Individual_8_0_conflicts"
+ $params[4] = ["{$cacheKey}%", 'String'];
}
CRM_Core_DAO::executeQuery($sql, $params);
if (!empty($select)) {
$extraData = [];
foreach ($select as $sfield) {
- $extraData[$sfield] = $dao->$sfield;
+ $extraData[$sfield] = $dao->$sfield;
}
$main[$count] = [
'prevnext_id' => $dao->id,
CRM_Core_DAO::executeQuery($sql, $params);
}
-
/**
* Get the selections.
*
public static $status = NULL;
- static $_recurringEntityHelper
+ public static $_recurringEntityHelper
= [
'civicrm_event' => [
'helper_class' => 'CRM_Event_DAO_Event',
],
];
- static $_dateColumns
+ public static $_dateColumns
= [
'civicrm_event' => [
'dateColumns' => ['start_date'],
],
];
- static $_tableDAOMapper
+ public static $_tableDAOMapper
= [
'civicrm_event' => 'CRM_Event_DAO_Event',
'civicrm_price_set_entity' => 'CRM_Price_DAO_PriceSetEntity',
'civicrm_activity_contact' => 'CRM_Activity_DAO_ActivityContact',
];
- static $_updateSkipFields
+ public static $_updateSkipFields
= [
'civicrm_event' => ['start_date', 'end_date'],
'civicrm_tell_friend' => ['entity_id'],
'civicrm_activity' => ['activity_date_time'],
];
- static $_linkedEntitiesInfo
+ public static $_linkedEntitiesInfo
= [
'civicrm_tell_friend' => [
'entity_id_col' => 'entity_id',
* @return array
* an array of child ids
*/
- static public function getEntitiesForParent($parentId, $entityTable, $includeParent = TRUE, $mode = 3, $initiatorId = NULL) {
+ public static function getEntitiesForParent($parentId, $entityTable, $includeParent = TRUE, $mode = 3, $initiatorId = NULL) {
$entities = [];
if (empty($parentId) || empty($entityTable)) {
return $entities;
$recurringEntityID = CRM_Core_DAO::singleValueQuery("SELECT id FROM civicrm_recurring_entity WHERE entity_id = %3 AND entity_table = %2", $queryParams);
if ($recurringEntityID) {
$query .= $includeParent ? " AND id >= %4" : " AND id > %4";
- $query .= " ORDER BY id ASC"; // FIXME: change to order by dates
+ // FIXME: change to order by dates
+ $query .= " ORDER BY id ASC";
$queryParams[4] = [$recurringEntityID, 'Integer'];
}
else {
* @return array
* array of connected ids
*/
- static public function getEntitiesFor($entityId, $entityTable, $includeParent = TRUE, $mode = 3) {
+ public static function getEntitiesFor($entityId, $entityTable, $includeParent = TRUE, $mode = 3) {
$parentId = self::getParentFor($entityId, $entityTable);
if ($parentId) {
return self::getEntitiesForParent($parentId, $entityTable, $includeParent, $mode, $entityId);
* @return int
* unsigned $parentId Parent ID
*/
- static public function getParentFor($entityId, $entityTable, $includeParent = TRUE) {
+ public static function getParentFor($entityId, $entityTable, $includeParent = TRUE) {
if (empty($entityId) || empty($entityTable)) {
return NULL;
}
* @param $entityTable
* @return array|null
*/
- static public function getPositionAndCount($entityId, $entityTable) {
+ public static function getPositionAndCount($entityId, $entityTable) {
$position = $count = 0;
$query = "
*
* @return object
*/
- static public function copyCreateEntity($entityTable, $fromCriteria, $newParams, $createRecurringEntity = TRUE) {
+ public static function copyCreateEntity($entityTable, $fromCriteria, $newParams, $createRecurringEntity = TRUE) {
$daoName = self::$_tableDAOMapper[$entityTable];
if (!$daoName) {
CRM_Core_Error::fatal("DAO Mapper missing for $entityTable.");
* @param object $event
* An object of /Civi/Core/DAO/Event/PostUpdate containing dao object that was just updated.
*/
- static public function triggerUpdate($event) {
+ public static function triggerUpdate($event) {
// if DB version is earlier than 4.6 skip any processing
static $currentVer = NULL;
if (!$currentVer) {
* @param object $event
* An object of /Civi/Core/DAO/Event/PostUpdate containing dao object that was just inserted.
*/
- static public function triggerInsert($event) {
+ public static function triggerInsert($event) {
$obj =& $event->object;
if (!array_key_exists($obj->__table, self::$_linkedEntitiesInfo)) {
return;
* @param object $event
* An object of /Civi/Core/DAO/Event/PostUpdate containing dao object that was just deleted.
*/
- static public function triggerDelete($event) {
+ public static function triggerDelete($event) {
$obj =& $event->object;
// if DB version is earlier than 4.6 skip any processing
* @return bool|\CRM_Core_DAO_RecurringEntity
* @throws \Exception
*/
- static public function delEntity($entityId, $entityTable, $isDelLinkedEntities = FALSE) {
+ public static function delEntity($entityId, $entityTable, $isDelLinkedEntities = FALSE) {
if (empty($entityId) || empty($entityTable)) {
return FALSE;
}
*
* @return object
*/
- static public function getScheduleReminderDetailsById($scheduleReminderId) {
+ public static function getScheduleReminderDetailsById($scheduleReminderId) {
$query = "SELECT *
FROM civicrm_action_schedule WHERE 1";
if ($scheduleReminderId) {
return $r;
}
-
/**
* This function gets time difference between the two datetime object.
*
* @return object
* DateTime object which contain time difference
*/
- static public function getInterval($startDate, $endDate) {
+ public static function getInterval($startDate, $endDate) {
if ($startDate && $endDate) {
$startDate = new DateTime($startDate);
$endDate = new DateTime($endDate);
$seriesEventRecords = CRM_Core_BAO_RecurringEntity::getEntitiesFor($entityId, $entityTable);
foreach ($seriesEventRecords as $event) {
//Step-2: Save price set in other series events
- if (CRM_Price_BAO_PriceSet::removeFrom($event['table'], $event['id'])) {//Remove existing priceset
+ //Remove existing priceset
+ if (CRM_Price_BAO_PriceSet::removeFrom($event['table'], $event['id'])) {
CRM_Core_BAO_Discount::del($event['id'], $event['table']);
}
- CRM_Price_BAO_PriceSet::addTo($event['table'], $event['id'], $priceSet); //Add new price set
+ //Add new price set
+ CRM_Price_BAO_PriceSet::addTo($event['table'], $event['id'], $priceSet);
}
}
foreach ($seriesEventRecords as $event) {
//Step-2: Save price set in other series events
if ($entityId < $event["id"]) {
- if (CRM_Price_BAO_PriceSet::removeFrom($event['table'], $event['id'])) {//Remove existing priceset
+ //Remove existing priceset
+ if (CRM_Price_BAO_PriceSet::removeFrom($event['table'], $event['id'])) {
CRM_Core_BAO_Discount::del($event['id'], $event['table']);
}
- CRM_Price_BAO_PriceSet::addTo($event['table'], $event['id'], $priceSet); //Add new price set
+ //Add new price set
+ CRM_Price_BAO_PriceSet::addTo($event['table'], $event['id'], $priceSet);
}
}
}
$query = "SELECT name, id FROM civicrm_tag
WHERE is_tagset=1 AND parent_id IS NULL and used_for LIKE %1";
$dao = CRM_Core_DAO::executeQuery($query, [
- 1 => [
- '%' . $entityTable . '%',
- 'String',
- ],
- ], TRUE, NULL, FALSE, FALSE);
+ 1 => [
+ '%' . $entityTable . '%',
+ 'String',
+ ],
+ ], TRUE, NULL, FALSE, FALSE);
while ($dao->fetch()) {
$tagSets[$dao->id] = $dao->name;
}
*
* @param string $searchString
*
- * @return array $childTagIDs
+ * @return array
* associated array of child tags in Array('Parent Tag ID' => Array('Child Tag 1', ...)) format
*/
public static function getChildTags($searchString = NULL) {
// only fetch those tags which has child tags
$dao = CRM_Utils_SQL_Select::from('civicrm_tag parent')
- ->join('child', 'INNER JOIN civicrm_tag child ON child.parent_id = parent.id ')
- ->select('parent.id as parent_id, GROUP_CONCAT(child.id) as child_id')
- ->where($whereClauses)
- ->groupBy('parent.id')
- ->execute();
+ ->join('child', 'INNER JOIN civicrm_tag child ON child.parent_id = parent.id ')
+ ->select('parent.id as parent_id, GROUP_CONCAT(child.id) as child_id')
+ ->where($whereClauses)
+ ->groupBy('parent.id')
+ ->execute();
while ($dao->fetch()) {
$childTagIDs[$dao->parent_id] = (array) explode(',', $dao->child_id);
$parentID = $dao->parent_id;
/**
* Batch entry fields.
+ * @var array
*/
private static $_contriBatchEntryFields = NULL;
private static $_memberBatchEntryFields = NULL;
return $ufField;
}
-
/**
* Fetch object based on array of properties.
*
*
* @var string
*/
- static $_matchFields = NULL;
+ public static $_matchFields = NULL;
/**
* Fetch object based on array of properties.
$query .= " AND $permissionClause ";
}
- if ($orderProfiles AND count($profileIds) > 1) {
+ if ($orderProfiles and count($profileIds) > 1) {
$query .= " ORDER BY FIELD( g.id, {$gids} )";
}
$group = CRM_Core_DAO::executeQuery($query, $params);
$addressCustom = FALSE;
if (in_array($permissionType, array(
- CRM_Core_Permission::CREATE,
- CRM_Core_Permission::EDIT,
- )) &&
+ CRM_Core_Permission::CREATE,
+ CRM_Core_Permission::EDIT,
+ )) &&
in_array($field->field_name, array_keys($addressCustomFields))
) {
$addressCustom = TRUE;
$form->addChainSelect($name, array('label' => $title, 'required' => $required));
$config = CRM_Core_Config::singleton();
if (!in_array($mode, array(
- CRM_Profile_Form::MODE_EDIT,
- CRM_Profile_Form::MODE_SEARCH,
- )) &&
+ CRM_Profile_Form::MODE_EDIT,
+ CRM_Profile_Form::MODE_SEARCH,
+ )) &&
$config->defaultContactStateProvince
) {
$defaultValues[$name] = $config->defaultContactStateProvince;
$form->add('select', $name, $title, array('' => ts('- select -')) + CRM_Core_PseudoConstant::country(), $required, $selectAttributes);
$config = CRM_Core_Config::singleton();
if (!in_array($mode, array(
- CRM_Profile_Form::MODE_EDIT,
- CRM_Profile_Form::MODE_SEARCH,
- )) &&
+ CRM_Profile_Form::MODE_EDIT,
+ CRM_Profile_Form::MODE_SEARCH,
+ )) &&
$config->defaultContactCountry
) {
$defaultValues[$name] = $config->defaultContactCountry;
$profileType = CRM_Core_BAO_UFField::getProfileType($gId, TRUE, FALSE, TRUE);
if (empty($profileType) || in_array($profileType, array(
- 'Contact',
- 'Contribution',
- 'Participant',
- 'Membership',
- ))
+ 'Contact',
+ 'Contribution',
+ 'Participant',
+ 'Membership',
+ ))
) {
$profileType = 'Individual';
}
$contributionStatuses = CRM_Contribute_PseudoConstant::contributionStatus();
$statusName = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name');
foreach (array(
- 'In Progress',
- 'Overdue',
- 'Refunded',
- ) as $suppress) {
+ 'In Progress',
+ 'Overdue',
+ 'Refunded',
+ ) as $suppress) {
unset($contributionStatuses[CRM_Utils_Array::key($suppress, $statusName)]);
}
* @param array $values
* @param CRM_Core_Smarty $template
*/
- static public function profileDisplay($gid, $values, $template) {
+ public static function profileDisplay($gid, $values, $template) {
$groupTitle = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $gid, 'title');
$template->assign('grouptitle', $groupTitle);
if (count($values)) {
return $dao;
}
-
/**
* Given a UF user object, make sure there is a contact
* object for this user. If the user has new values, we need
return $wordReplacement;
}
-
/**
* Save the values of a WordReplacement.
*
/**
* Template file names for the above blocks.
+ * @var array
*/
- static $_properties = NULL;
+ public static $_properties = NULL;
/**
* Class constructor.
* Generate configuration files
*/
class CRM_Core_CodeGen_Config extends CRM_Core_CodeGen_BaseTask {
+
public function run() {
$this->setupCms();
}
* Generate language files and classes
*/
class CRM_Core_CodeGen_I18n extends CRM_Core_CodeGen_BaseTask {
+
public function run() {
$this->generateInstallLangs();
$this->generateSchemaStructure();
* Class CRM_Core_CodeGen_Main
*/
class CRM_Core_CodeGen_Main {
- var $buildVersion;
- var $db_version;
- var $cms; // drupal, joomla, wordpress
+ public $buildVersion;
+ public $db_version;
+ /**
+ * drupal, joomla, wordpress
+ * @var string
+ */
+ public $cms;
- var $CoreDAOCodePath;
- var $sqlCodePath;
- var $phpCodePath;
- var $tplCodePath;
- var $schemaPath; // ex: schema/Schema.xml
+ public $CoreDAOCodePath;
+ public $sqlCodePath;
+ public $phpCodePath;
+ public $tplCodePath;
+ /**
+ * ex: schema/Schema.xml
+ * @var string
+ */
+ public $schemaPath;
/**
* Definitions of all tables.
* @var array
* Ex: $tables['civicrm_address_format']['className'] = 'CRM_Core_DAO_AddressFormat';
*/
- var $tables;
+ public $tables;
/**
* @var array
* Ex: $database['tableAttributes_modern'] = "ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci";
*/
- var $database;
+ public $database;
/**
* @var string|NULL path in which to store a marker that indicates the last execution of
* GenCode. If a matching marker already exists, GenCode doesn't run.
*/
- var $digestPath;
+ public $digestPath;
/**
* @var string|NULL a digest of the inputs to the code-generator (eg the properties and source files)
*/
- var $sourceDigest;
+ public $sourceDigest;
/**
* @param $CoreDAOCodePath
* @param $schemaPath
* @param string $buildVersion
* Which version of the schema to build.
+ * @param bool $verbose
*/
public function parse($schemaPath, $buildVersion, $verbose = TRUE) {
$this->buildVersion = $buildVersion;
* Generate files used during testing.
*/
class CRM_Core_CodeGen_Test extends CRM_Core_CodeGen_BaseTask {
+
public function run() {
$this->generateCiviTestTruncate();
}
* Class CRM_Core_CodeGen_Util_File
*/
class CRM_Core_CodeGen_Util_File {
+
/**
* @param $dir
* @param int $perm
* Class CRM_Core_CodeGen_Util_Xml
*/
class CRM_Core_CodeGen_Util_Xml {
+
/**
* @param string $file
* Path to input.
/**
* Default time to wait before retrying.
*/
- const DEFAULT_RETRY = 7200; // 2 hours
+ // 2 hours
+ const DEFAULT_RETRY = 7200;
/**
* @var CRM_Utils_HttpClient
if (empty($document) || !is_array($document)) {
$document = [
'messages' => [],
- 'expires' => 0, // ASAP
+ // ASAP
+ 'expires' => 0,
'ttl' => self::DEFAULT_RETRY,
'retry' => self::DEFAULT_RETRY,
];
*/
const COMPONENT_INFO_CLASS = 'Info';
- static $_contactSubTypes = NULL;
+ /**
+ * @var array
+ */
+ public static $_contactSubTypes = NULL;
/**
* @param bool $force
return $componentIDs;
}
-
/**
* @param bool $force
*
* @return CRM_Core_Component_Info[]
*/
- static public function &getEnabledComponents($force = FALSE) {
+ public static function &getEnabledComponents($force = FALSE) {
return self::_info($force);
}
- static public function flushEnabledComponents() {
+ public static function flushEnabledComponents() {
unset(Civi::$statics[__CLASS__]);
}
return self::$_contactSubTypes;
}
-
/**
* @param $subType
* @param $op
* @return object
* @see Civi::log()
*/
- static public function &getLog() {
+ public static function &getLog() {
if (!isset(self::$_log)) {
self::$_log = Log::singleton('display');
}
// Whether we delete/create or simply preserve directories, we should
// certainly make sure the restrictions are enforced.
foreach ([
- $this->templateCompileDir,
- $this->uploadDir,
- $this->configAndLogDir,
- $this->customFileUploadDir,
- ] as $dir) {
+ $this->templateCompileDir,
+ $this->uploadDir,
+ $this->configAndLogDir,
+ $this->customFileUploadDir,
+ ] as $dir) {
if ($dir && is_dir($dir)) {
CRM_Utils_File::restrictAccess($dir);
}
/**
* Is the system permitted to flush caches at the moment.
*/
- static public function isPermitCacheFlushMode() {
+ public static function isPermitCacheFlushMode() {
return !CRM_Core_Config::singleton()->doNotResetCache;
}
* @param bool $enabled
* If true then caches can be cleared at this time.
*/
- static public function setPermitCacheFlushMode($enabled) {
+ public static function setPermitCacheFlushMode($enabled) {
CRM_Core_Config::singleton()->doNotResetCache = $enabled ? 0 : 1;
}
*/
private $map;
- private $locals, $settings;
+ private $locals;
+ private $settings;
private $cache = [];
'userFrameworkBaseURL' => ['user-system', 'getAbsoluteBaseURL'],
'userFrameworkVersion' => ['user-system', 'getVersion'],
- 'useFrameworkRelativeBase' => ['user-system', 'getRelativeBaseURL'], // ugh typo.
+ // ugh typo.
+ 'useFrameworkRelativeBase' => ['user-system', 'getRelativeBaseURL'],
// "setting" properties are loaded through the setting layer, esp
// table "civicrm_setting" and global $civicrm_setting.
'dateformatYear' => ['setting'],
'dateformatFinancialBatch' => ['setting'],
'dateformatshortdate' => ['setting'],
- 'debug' => ['setting', 'debug_enabled'], // renamed.
+ // renamed.
+ 'debug' => ['setting', 'debug_enabled'],
'defaultContactCountry' => ['setting'],
'defaultContactStateProvince' => ['setting'],
'defaultCurrency' => ['setting'],
'defaultSearchProfileID' => ['setting'],
'doNotAttachPDFReceipt' => ['setting'],
'empoweredBy' => ['setting'],
- 'enableComponents' => ['setting', 'enable_components'], // renamed.
+ // renamed.
+ 'enableComponents' => ['setting', 'enable_components'],
'enableSSL' => ['setting'],
'fatalErrorHandler' => ['setting'],
'fieldSeparator' => ['setting'],
'mapAPIKey' => ['setting'],
'mapProvider' => ['setting'],
'maxFileSize' => ['setting'],
- 'maxAttachments' => ['setting', 'max_attachments'], // renamed.
+ // renamed.
+ 'maxAttachments' => ['setting', 'max_attachments'],
'monetaryDecimalPoint' => ['setting'],
'monetaryThousandSeparator' => ['setting'],
'moneyformat' => ['setting'],
public static function getId() {
if (!isset(Civi::$statics[__CLASS__]['id'])) {
Civi::$statics[__CLASS__]['id'] = md5(implode(\CRM_Core_DAO::VALUE_SEPARATOR, [
- defined('CIVICRM_DOMAIN_ID') ? CIVICRM_DOMAIN_ID : 1, // e.g. one database, multi URL
- parse_url(CIVICRM_DSN, PHP_URL_PATH), // e.g. one codebase, multi database
- \CRM_Utils_Array::value('SCRIPT_FILENAME', $_SERVER, ''), // e.g. CMS vs extern vs installer
- \CRM_Utils_Array::value('HTTP_HOST', $_SERVER, ''), // e.g. name-based vhosts
- \CRM_Utils_Array::value('SERVER_PORT', $_SERVER, ''), // e.g. port-based vhosts
+ // e.g. one database, multi URL
+ defined('CIVICRM_DOMAIN_ID') ? CIVICRM_DOMAIN_ID : 1,
+ // e.g. one codebase, multi database
+ parse_url(CIVICRM_DSN, PHP_URL_PATH),
+ // e.g. CMS vs extern vs installer
+ \CRM_Utils_Array::value('SCRIPT_FILENAME', $_SERVER, ''),
+ // e.g. name-based vhosts
+ \CRM_Utils_Array::value('HTTP_HOST', $_SERVER, ''),
+ // e.g. port-based vhosts
+ \CRM_Utils_Array::value('SERVER_PORT', $_SERVER, ''),
// Depending on deployment arch, these signals *could* be redundant, but who cares?
]));
}
public function fini() {
CRM_Core_BAO_Cache::storeSessionToCache([
- "_{$this->_name}_container",
- ['CiviCRM', $this->_scope],
- ],
- TRUE
- );
+ "_{$this->_name}_container",
+ ['CiviCRM', $this->_scope],
+ ], TRUE);
}
/**
* @var null
* @deprecated
*/
- static $_nullObject = NULL;
+ public static $_nullObject = NULL;
/**
* @var array
* @deprecated
*/
- static $_nullArray = [];
+ public static $_nullArray = [];
- static $_dbColumnValueCache = NULL;
+ public static $_dbColumnValueCache = NULL;
const NOT_NULL = 1, IS_NULL = 2,
DB_DAO_NOTNULL = 128,
VALUE_SEPARATOR = "\ 1",
* test objects - this prevents world regions, countries etc from being added / deleted
* @var array
*/
- static $_testEntitiesToSkip = [];
+ public static $_testEntitiesToSkip = [];
/**
* The factory class for this application.
* @var object
*/
- static $_factory = NULL;
+ public static $_factory = NULL;
- static $_checkedSqlFunctionsExist = FALSE;
+ public static $_checkedSqlFunctionsExist = FALSE;
/**
* https://issues.civicrm.org/jira/browse/CRM-17748
* internal variable for DAO to hold per-query settings
+ * @var array
*/
protected $_options = [];
* @return CRM_Core_DAO
* Object that points to an unbuffered result set
*/
- static public function executeUnbufferedQuery(
+ public static function executeUnbufferedQuery(
$query,
$params = [],
$abort = TRUE,
$object = new $daoName();
$object->id = CRM_Utils_Array::value('id', $params);
- $deletions = []; // array(array(0 => $daoName, 1 => $daoParams))
+ // array(array(0 => $daoName, 1 => $daoParams))
+ $deletions = [];
if ($object->find(TRUE)) {
$fields = $object->fields();
// to make this test process pass - line below makes pass for now
&& $dbName != 'member_of_contact_id'
) {
- $deletions[] = [$FKClassName, ['id' => $object->$dbName]]; // x
+ // x
+ $deletions[] = [$FKClassName, ['id' => $object->$dbName]];
}
}
}
}
}
-
/**
* Update the fields array to also hold keys for pseudoconstant fields that relate to contained fields.
*
return (sprintf('%s ' . $operator . ' "%s" AND "%s"', $fieldName, CRM_Core_DAO::escapeString($criteria[0]), CRM_Core_DAO::escapeString($criteria[1])));
}
else {
- return NULL; // not yet implemented (tests required to implement)
+ // not yet implemented (tests required to implement)
+ return NULL;
}
break;
return (sprintf('%s %s "%s"', $fieldName, $operator, CRM_Core_DAO::escapeString($criteria)));
}
else {
- return NULL; // not yet implemented (tests required to implement)
+ // not yet implemented (tests required to implement)
+ return NULL;
}
}
}
* Class CRM_Exception
*/
class CRM_Exception extends PEAR_Exception {
+
/**
* Redefine the exception so message isn't optional.
*
/**
* If modeException == true, errors are raised as exception instead of returning civicrm_errors
+ * @var bool
*/
public static $modeException = NULL;
*
* @return array|null|string
*/
- static public function getMessages(&$error, $separator = '<br />') {
+ public static function getMessages(&$error, $separator = '<br />') {
if (is_a($error, 'CRM_Core_Error')) {
$errors = $error->getErrors();
$message = [];
$link = $conn->connection;
if (mysqli_error($link)) {
$mysql_error = mysqli_error($link) . ', ' . mysqli_errno($link);
- mysqli_query($link, 'select 1'); // execute a dummy query to clear error stack
+ // execute a dummy query to clear error stack
+ mysqli_query($link, 'select 1');
}
}
elseif ($conn instanceof DB_mysql) {
if (mysql_error()) {
$mysql_error = mysql_error() . ', ' . mysql_errno();
- mysql_query('select 1'); // execute a dummy query to clear error stack
+ // execute a dummy query to clear error stack
+ mysql_query('select 1');
}
}
else {
/**
* Indicate if this form should warn users of unsaved changes
+ * @var bool
*/
protected $unsavedChangesWarn;
const CB_PREFIX = 'mark_x_', CB_PREFIY = 'mark_y_', CB_PREFIZ = 'mark_z_', CB_PREFIX_LEN = 7;
/**
- * @internal to keep track of chain-select fields
* @var array
+ * @internal to keep track of chain-select fields
*/
private $_chainSelectFields = [];
// Respond with JSON if in AJAX context (also support legacy value '6')
if ($allowAjax && !empty($_REQUEST['snippet']) && in_array($_REQUEST['snippet'], [
- CRM_Core_Smarty::PRINT_JSON,
- 6,
- ])
- ) {
+ CRM_Core_Smarty::PRINT_JSON,
+ 6,
+ ])) {
$this->ajaxResponse['buttonName'] = str_replace('_qf_' . $this->getAttribute('id') . '_', '', $this->controller->getButtonName());
$this->ajaxResponse['action'] = $this->_action;
if (isset($this->_id) || isset($this->id)) {
$props['context'] = $this->getDefaultContext();
}
// This is not a required param, so we'll ignore if this doesn't exist.
- catch (Exception $e) {}
+ catch (Exception $e) {
+ }
}
// Fetch options from the api unless passed explicitly
if (isset($props['options'])) {
*
* @throws \CiviCRM_API3_Exception
* @throws \Exception
- * @return HTML_QuickForm_Element
+ * @return mixed
+ * HTML_QuickForm_Element
+ * void
*/
public function addField($name, $props = [], $required = FALSE, $legacyDate = TRUE) {
// Resolve context.
}
$isSelect = (in_array($widget, [
- 'Select',
- 'CheckBoxGroup',
- 'RadioGroup',
- 'Radio',
+ 'Select',
+ 'CheckBoxGroup',
+ 'RadioGroup',
+ 'Radio',
]));
if ($isSelect) {
if ($this->canUseAjaxContactLookups()) {
$this->assign('selectable', $autoCompleteField['id_field']);
$this->addEntityRef($autoCompleteField['id_field'], NULL, [
- 'placeholder' => $autoCompleteField['placeholder'],
- 'api' => $autoCompleteField['api'],
- ]);
+ 'placeholder' => $autoCompleteField['placeholder'],
+ 'api' => $autoCompleteField['api'],
+ ]);
CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/AlternateContactSelector.js', 1, 'html-header')
->addSetting([
public function addChainSelect($elementName, $settings = []) {
$props = $settings += [
'control_field' => str_replace(['state_province', 'StateProvince', 'county', 'County'], [
- 'country',
- 'Country',
- 'state_province',
- 'StateProvince',
- ], $elementName),
+ 'country',
+ 'Country',
+ 'state_province',
+ 'StateProvince',
+ ], $elementName),
'data-callback' => strpos($elementName, 'rovince') ? 'civicrm/ajax/jqState' : 'civicrm/ajax/jqCounty',
'label' => strpos($elementName, 'rovince') ? ts('State/Province') : ts('County'),
'data-empty-prompt' => strpos($elementName, 'rovince') ? ts('Choose country first') : ts('Choose state first'),
$this->setConstants(['task' => '']);
$this->assign('taskMetaData', $tasks);
$select = $this->add('select', 'task', NULL, ['' => ts('Actions')], FALSE, [
- 'class' => 'crm-select2 crm-action-menu fa-check-circle-o huge crm-search-result-actions']
+ 'class' => 'crm-select2 crm-action-menu fa-check-circle-o huge crm-search-result-actions',
+ ]
);
foreach ($tasks as $key => $task) {
$attributes = [];
if (!array_intersect($targetValue, array_keys($options))) {
$this->setElementError($target, $controlType == 'country' ? ts('State/Province does not match the selected Country') : ts('County does not match the selected State/Province'));
}
- } // Suppress "required" error for field if it has no options
+ }
+ // Suppress "required" error for field if it has no options
elseif (!$options) {
$this->setElementError($target, NULL);
}
$form->setDefaults(['dateFormats' => self::DATE_yyyy_mm_dd]);
}
-
/**
* Retrieve the date range - relative or absolute and assign it to the form.
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2019
*/
-
trait CRM_Core_Form_EntityFormTrait {
/**
protected function addFormButtons() {
if ($this->isViewContext() || $this->_action & CRM_Core_Action::PREVIEW) {
$this->addButtons([
- [
- 'type' => 'cancel',
- 'name' => ts('Done'),
- 'isDefault' => TRUE,
- ],
- ]
- );
+ [
+ 'type' => 'cancel',
+ 'name' => ts('Done'),
+ 'isDefault' => TRUE,
+ ],
+ ]);
}
else {
$this->addButtons([
- [
- 'type' => 'next',
- 'name' => $this->isDeleteContext() ? ts('Delete') : ts('Save'),
- 'isDefault' => TRUE,
- ],
- [
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ],
- ]
- );
+ [
+ 'type' => 'next',
+ 'name' => $this->isDeleteContext() ? ts('Delete') : ts('Save'),
+ 'isDefault' => TRUE,
+ ],
+ [
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ],
+ ]);
}
}
$defaults = $moneyFields = [];
if (!$this->isDeleteContext() &&
- $this->getEntityId()
- ) {
+ $this->getEntityId()) {
$params = ['id' => $this->getEntityId()];
$baoName = $this->_BAOName;
$baoName::retrieve($params, $defaults);
class CRM_Core_Form_RecurringEntity {
/**
* Current entity id
+ * @var int
*/
protected static $_entityId = NULL;
/**
* Schedule Reminder ID
+ * @var int
*/
protected static $_scheduleReminderID = NULL;
/**
* Schedule Reminder data
+ * @var array
*/
protected static $_scheduleReminderDetails = [];
/**
* Parent Entity ID
+ * @var int
*/
protected static $_parentEntityId = NULL;
/**
* Exclude date information
+ * @var array
*/
public static $_excludeDateInfo = [];
/**
* Entity Table
+ * @var string
*/
public static $_entityTable;
/**
* Checks current entityID has parent
+ * @var string
*/
public static $_hasParent = FALSE;
$form->add('text', 'exclude_date_list', ts('Exclude Dates'), ['class' => 'twenty']);
$form->addElement('hidden', 'allowRepeatConfigToSubmit', '', ['id' => 'allowRepeatConfigToSubmit']);
$form->addButtons([
- [
- 'type' => 'submit',
- 'name' => ts('Save'),
- 'isDefault' => TRUE,
- ],
- [
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ],
- ]
- );
+ [
+ 'type' => 'submit',
+ 'name' => ts('Save'),
+ 'isDefault' => TRUE,
+ ],
+ [
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ],
+ ]);
// For client-side pluralization
$form->assign('recurringFrequencyOptions', [
'single' => CRM_Utils_Array::makeNonAssociative(CRM_Core_SelectValues::getRecurringFrequencyUnits()),
*
* @var array
*/
- static $_sizeMapper = [
+ public static $_sizeMapper = [
2 => 'two',
4 => 'four',
6 => 'six',
}
}
$field->setAttribute('data-entity-value', json_encode([
- 'id' => $contact['id'],
- 'text' => implode(' :: ', $view),
- ]));
+ 'id' => $contact['id'],
+ 'text' => implode(' :: ', $view),
+ ]));
}
}
}
*
* @param array $fields
* Posted values of the form.
+ * @param array $files
+ * @param object $form
*
* @return array
* list of errors to be posted back to the form
* Values should be an array with label and select.
* Select can be NULL if there is no entity to select.
* Otherwise it contains the shortcode key for this entity id (usually 'id') plus an array of params for the EntityRef field
- * @see CRM_Core_Form::addEntityRef
*
* @var array
* [component => [
* label => Option Label
* select => key + EntityRef params
* ]]
+ * @see CRM_Core_Form::addEntityRef
*/
public $components = [];
*/
public $options = [];
-
/**
* Build form data. Can be modified via hook_civicrm_preProcess.
*/
*
* @var string
*/
- static $tableName = NULL;
+ public static $tableName = NULL;
/**
* Must be set to entity shortname (eg. event)
*
* @var string
*/
- static $entityShortname = NULL;
+ public static $entityShortname = NULL;
/**
* Build all the data structures needed to build the form.
*/
public function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) {
$this->addButtons([
- [
- 'type' => $nextType,
- 'name' => $title,
- 'isDefault' => TRUE,
- ],
- [
- 'type' => $backType,
- 'name' => ts('Cancel'),
- ],
- ]
- );
+ [
+ 'type' => $nextType,
+ 'name' => $title,
+ 'isDefault' => TRUE,
+ ],
+ [
+ 'type' => $backType,
+ 'name' => ts('Cancel'),
+ ],
+ ]);
}
/**
/**
* Maximum profile fields that will be displayed.
+ * @var int
*/
protected $_maxFields = 9;
*/
protected $_fields;
- // Must be set to entity table name (eg. civicrm_participant) by child class
- static $tableName = NULL;
- // Must be set to entity shortname (eg. event)
- static $entityShortname = NULL;
+ /**
+ * Must be set to entity table name (eg. civicrm_participant) by child class
+ * @var string
+ */
+ public static $tableName = NULL;
+ /**
+ * Must be set to entity shortname (eg. event)
+ * @var string
+ */
+ public static $entityShortname = NULL;
/**
* Build all the data structures needed to build the form.
$config = CRM_Core_Config::singleton();
/** CRM-15883 Suppressing Stationery path field until we switch from DOMPDF to a library that supports it.
- if ($config->wkhtmltopdfPath == FALSE) {
- $form->add(
- 'text',
- 'stationery',
- ts('Stationery (relative path to PDF you wish to use as the background)'),
- array('size' => 25, 'maxlength' => 900, 'onkeyup' => "showUpdateFormatChkBox();"),
- FALSE
- );
- }
+ * if ($config->wkhtmltopdfPath == FALSE) {
+ * $form->add(
+ * 'text',
+ * 'stationery',
+ * ts('Stationery (relative path to PDF you wish to use as the background)'),
+ * array('size' => 25, 'maxlength' => 900, 'onkeyup' => "showUpdateFormatChkBox();"),
+ * FALSE
+ * );
+ * }
*/
$form->add('checkbox', 'bind_format', ts('Always use this Page Format with the selected Template'));
$form->add('checkbox', 'update_format', ts('Update Page Format (this will affect all templates that use this format)'));
*
* @var string
*/
- static $tableName = NULL;
+ public static $tableName = NULL;
/**
* Must be set to entity shortname (eg. event)
*
* @var string
*/
- static $entityShortname = NULL;
+ public static $entityShortname = NULL;
/**
* Build all the data structures needed to build the form.
/**
* A PHP-gettext instance for string translation;
* should stay null if the strings are not to be translated (en_US).
+ * @var object
*/
private $_phpgettext = NULL;
/**
* Whether we are using native gettext or not.
+ * @var bool
*/
private $_nativegettext = FALSE;
* Gettext cache for extension domains/streamers, depending on if native or phpgettext.
* - native gettext: we cache the value for textdomain()
* - phpgettext: we cache the file streamer.
+ * @var array
*/
private $_extensioncache = [];
/**
* Return the available UI languages
- * @return array(string languageCode) if $justCodes
- * array(string languageCode => string languageName) if !$justCodes
+ * @return array|string
+ * array(string languageCode => string languageName) if !$justCodes
*/
public static function uiLanguages($justCodes = FALSE) {
// In multilang we only allow the languages that are configured in db
return FALSE;
}
-
/**
* Is the CiviCRM in multilingual mode.
*
*
*/
class CRM_Core_I18n_Form extends CRM_Core_Form {
+
public function buildQuickForm() {
$config = CRM_Core_Config::singleton();
$tsLocale = CRM_Core_I18n::getLocale();
* Convenience class for PHP-Gettext compatibility.
*/
class CRM_Core_I18n_NativeGettext {
+
/**
* @param $string
*
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
* A table-indexed array of translatable columns.
*/
public static function &columns() {
- static $result = null;
+ static $result = NULL;
if (!$result) {
$result = [
'civicrm_location_type' => [
* Indices for translatable fields.
*/
public static function &indices() {
- static $result = null;
+ static $result = NULL;
if (!$result) {
$result = [
'civicrm_custom_group' => [
* @return array
* Array of names of tables with fields that can be translated.
*/
- static function &tables() {
- static $result = null;
+ public static function &tables() {
+ static $result = NULL;
if (!$result) {
$result = array_keys(self::columns());
}
* @return array
* Array of the widgets for editing translatable fields.
*/
- static function &widgets() {
- static $result = null;
+ public static function &widgets() {
+ static $result = NULL;
if (!$result) {
$result = [
'civicrm_location_type' => [
*
*/
class CRM_Core_I18n_SchemaStructure_4_2_alpha1 {
+
/**
* @return array
*/
*
*/
class CRM_Core_I18n_SchemaStructure_4_3_1 {
+
/**
* @return array
*/
* DO NOT EDIT. Generated by CRM_Core_CodeGen
*/
class CRM_Core_I18n_SchemaStructure_4_5_alpha1 {
+
/**
* @return array
*/
/**
* Define the threshold for the ids reactions.
+ * @var array
*/
private $threshold = [
'log' => 25,
* (string $indexName => string $sql)
*/
public function buildIndexSql($table) {
- $sqls = []; // array (string $idxName => string $sql)
+ // array (string $idxName => string $sql)
+ $sqls = [];
if ($this->isActive && isset($this->indices[$table])) {
foreach ($this->indices[$table] as $fields) {
$name = self::IDX_PREFIX . md5($table . '::' . implode(',', $fields));
if (!defined('CIVICRM_SYMFONY_PATH')) {
// Traditional Civi invocation path
- self::hackMenuRebuild($args); // may exit
+ // may exit
+ self::hackMenuRebuild($args);
self::init($args);
self::hackStandalone($args);
$item = self::getItem($args);
* List of path parts.
* @void
*/
- static public function hackMenuRebuild($args) {
+ public static function hackMenuRebuild($args) {
if (['civicrm', 'menu', 'rebuild'] == $args || ['civicrm', 'clearcache'] == $args) {
// ensure that the user has a good privilege level
if (CRM_Core_Permission::check('administer CiviCRM')) {
self::rebuildMenuAndCaches();
CRM_Core_Session::setStatus(ts('Cleared all CiviCRM caches (database, menu, templates)'), ts('Complete'), 'success');
- return CRM_Utils_System::redirect(); // exits
+ // exits
+ return CRM_Utils_System::redirect();
}
else {
CRM_Core_Error::fatal('You do not have permission to execute this url');
* List of path parts.
* @void
*/
- static public function init($args) {
+ public static function init($args) {
// first fire up IDS and check for bad stuff
$config = CRM_Core_Config::singleton();
* List of path parts.
* @void
*/
- static public function hackStandalone($args) {
+ public static function hackStandalone($args) {
$config = CRM_Core_Config::singleton();
if ($config->userFramework == 'Standalone') {
$session = CRM_Core_Session::singleton();
* List of path parts.
* @return array; see CRM_Core_Menu
*/
- static public function getItem($args) {
+ public static function getItem($args) {
if (is_array($args)) {
// get the menu items
$path = implode('/', $args);
* See CRM_Core_Menu.
* @return string, HTML
*/
- static public function runItem($item) {
+ public static function runItem($item) {
$ids = new CRM_Core_IDS();
$ids->check($item);
/**
* @var array ($id => CRM_Core_ScheduledJob)
*/
- var $jobs = NULL;
+ public $jobs = NULL;
/**
* @var CRM_Core_ScheduledJob
*/
- var $currentJob = NULL;
+ public $currentJob = NULL;
- var $singleRunParams = [];
-
- var $_source = NULL;
+ public $singleRunParams = [];
+ public $_source = NULL;
/**
* Class constructor.
*
*/
class CRM_Core_Key {
- static $_key = NULL;
+ public static $_key = NULL;
- static $_sessionID = NULL;
+ public static $_sessionID = NULL;
/**
* Generate a private key per session and store in session.
* Class CRM_Core_LegacyErrorHandler
*/
class CRM_Core_LegacyErrorHandler {
+
/**
* @param \Civi\Core\Event\UnhandledExceptionEvent $event
* @throws Exception
*
* @var bool
*/
- static $jobLog = FALSE;
+ public static $jobLog = FALSE;
- // lets have a 3 second timeout for now
+ /**
+ * lets have a 3 second timeout for now
+ */
const TIMEOUT = 3;
+ /**
+ * @var bool
+ */
protected $_hasLock = FALSE;
protected $_name;
if ($doUpdate) {
$defaults = [
'id' => $dao->entity_id,
- 'is_active' => 1, // FIXME: test whether is_active is valid
+ // FIXME: test whether is_active is valid
+ 'is_active' => 1,
];
$params = array_merge($defaults, $todo['params']);
$result = civicrm_api($dao->entity_type, 'create', $params);
*
* @var array
*/
- static $_items = NULL;
+ public static $_items = NULL;
/**
* The list of permissioned menu items.
*
* @var array
*/
- static $_permissionedItems = NULL;
+ public static $_permissionedItems = NULL;
- static $_serializedElements = array(
+ public static $_serializedElements = array(
'access_arguments',
'access_callback',
'page_arguments',
'breadcrumb',
);
- static $_menuCache = NULL;
+ public static $_menuCache = NULL;
const MENU_ITEM = 1;
/**
'title' => $item['title'],
'desc' => CRM_Utils_Array::value('desc', $item),
'id' => strtr($item['title'], array(
- '(' => '_',
- ')' => '',
- ' ' => '',
- ',' => '_',
- '/' => '_',
- )
- ),
+ '(' => '_',
+ ')' => '',
+ ' ' => '',
+ ',' => '_',
+ '/' => '_',
+ )),
'url' => CRM_Utils_System::url($path, $query,
FALSE,
NULL,
'title' => $menu[$currentPath]['title'],
'url' => CRM_Utils_System::url($currentPath,
'reset=1' . $urlVar,
- FALSE, // absolute
- NULL, // fragment
- TRUE, // htmlize
- FALSE, // frontend
- TRUE // forceBackend; CRM-14439 work-around; acceptable for now because we don't display breadcrumbs on frontend
+ // absolute
+ FALSE,
+ // fragment
+ NULL,
+ // htmlize
+ TRUE,
+ // frontend
+ FALSE,
+ // forceBackend; CRM-14439 work-around; acceptable for now because we don't display breadcrumbs on frontend
+ TRUE
),
);
}
static $result;
if ($fresh || !is_array($result)) {
$result = CRM_Extension_System::singleton()->getMapper()->getModules();
- $result[] = new CRM_Core_Module('civicrm', TRUE); // pseudo-module for core
+ // pseudo-module for core
+ $result[] = new CRM_Core_Module('civicrm', TRUE);
$config = CRM_Core_Config::singleton();
$result = array_merge($result, $config->userSystem->getModules());
* @copyright CiviCRM LLC (c) 2004-2019
*/
class CRM_Core_OptionGroup {
- static $_values = [];
- static $_cache = [];
+ public static $_values = [];
+ public static $_cache = [];
/**
* $_domainIDGroups array maintains the list of option groups for whom
* domainID is to be considered.
+ * @var array
*/
- static $_domainIDGroups = [
+ public static $_domainIDGroups = [
'from_email_address',
'grant_type',
];
if ($dao->fetch()) {
foreach ([
- 'id',
- 'name',
- 'value',
- 'label',
- 'weight',
- 'description',
- ] as $fld) {
+ 'id',
+ 'name',
+ 'value',
+ 'label',
+ 'weight',
+ 'description',
+ ] as $fld) {
$row[$fld] = $dao->$fld;
if ($localize && in_array($fld, ['label', 'description'])) {
$row[$fld] = ts($row[$fld]);
*
* @var array
*/
- static $_exportableFields = NULL;
+ public static $_exportableFields = NULL;
/**
* Static field for all the option value information that we can potentially export.
*
* @var array
*/
- static $_importableFields = NULL;
+ public static $_importableFields = NULL;
/**
* Static field for all the option value information that we can potentially export.
*
* @var array
*/
- static $_fields = NULL;
+ public static $_fields = NULL;
/**
* Return option-values of a particular group
*/
class CRM_Core_Page_AJAX_Attachment {
- const ATTACHMENT_TOKEN_TTL = 10800; // 3hr; 3*60*60
+ // 3hr; 3*60*60
+ const ATTACHMENT_TOKEN_TTL = 10800;
/**
* (Page Callback)
// Verify user id
$user = CRM_Utils_Request::retrieve('uid', 'Integer', CRM_Core_DAO::$_nullObject, FALSE, CRM_Core_Session::singleton()
- ->get('userID'));
+ ->get('userID'));
if (empty($user) || (CRM_Utils_Request::retrieve('cs', 'String', $form, FALSE) && !CRM_Contact_BAO_Contact_Permission::validateChecksumContact($user, CRM_Core_DAO::$_nullObject, FALSE))
) {
CRM_Utils_System::civiExit();
// lets output only required fields.
foreach ($addressOptions as $element => $isSet) {
if ($isSet && (!in_array($element, [
- 'im',
- 'openid',
- ]))
- ) {
+ 'im',
+ 'openid',
+ ]))) {
if (in_array($element, [
'country',
'state_province',
}
foreach ([
- 'email',
- 'phone_type_id',
- 'phone',
- ] as $element) {
+ 'email',
+ 'phone_type_id',
+ 'phone',
+ ] as $element) {
$block = ($element == 'phone_type_id') ? 'phone' : $element;
for ($i = 1; $i < 3; $i++) {
$fld = "{$block}[{$i}][{$element}]";
$download = CRM_Utils_Request::retrieve('download', 'Integer', $this, FALSE, 1);
$disposition = $download == 0 ? 'inline' : 'download';
- $entityId = CRM_Utils_Request::retrieve('eid', 'Positive', $this, FALSE); // Entity ID (e.g. Contact ID)
- $fieldId = CRM_Utils_Request::retrieve('fid', 'Positive', $this, FALSE); // Field ID
- $fileId = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE); // File ID
+ // Entity ID (e.g. Contact ID)
+ $entityId = CRM_Utils_Request::retrieve('eid', 'Positive', $this, FALSE);
+ // Field ID
+ $fieldId = CRM_Utils_Request::retrieve('fid', 'Positive', $this, FALSE);
+ // File ID
+ $fileId = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE);
$fileName = CRM_Utils_Request::retrieve('filename', 'String', $this, FALSE);
if (empty($fileName) && (empty($entityId) || empty($fileId))) {
CRM_Core_Error::statusBounce("Cannot access file: Must pass either \"Filename\" or the combination of \"Entity ID\" + \"File ID\"");
* This loads a smarty help file via ajax and returns as html
*/
class CRM_Core_Page_Inline_Help {
+
public function run() {
$args = $_REQUEST;
if (!empty($args['file']) && strpos($args['file'], '..') === FALSE) {
RECURRING_PAYMENT_START = 'START',
RECURRING_PAYMENT_END = 'END';
+ /**
+ * @var object
+ */
protected $_paymentProcessor;
/**
*
* (Deprecated parameter but used in some messages).
*
+ * @var string
* @deprecated
*
- * @var string
*/
public $_processorName;
case 'contributionPageRecurringHelp':
// require exactly two parameters
if (array_keys($params) == [
- 'is_recur_installments',
- 'is_email_receipt',
- ]) {
+ 'is_recur_installments',
+ 'is_email_receipt',
+ ]) {
$gotText = ts('Your recurring contribution will be processed automatically.');
if ($params['is_recur_installments']) {
$gotText .= ' ' . ts('You can specify the number of installments, or you can leave the number of installments blank if you want to make an open-ended commitment. In either case, you can choose to cancel at any time.');
* @param int $billingLocationID
*
* @return array
- * Array of metadata for address fields.
+ * Array of metadata for address fields.
*/
public function getBillingAddressFieldsMetadata($billingLocationID = NULL) {
if (!$billingLocationID) {
'title' => ts('Country'),
'cc_field' => TRUE,
'attributes' => [
- '' => ts('- select -'),
- ] + CRM_Core_PseudoConstant::country(),
+ '' => ts('- select -'),
+ ] + CRM_Core_PseudoConstant::country(),
'is_required' => TRUE,
];
return $metadata;
* @return array
*/
public function _getAuthorizeNetFields() {
- $amount = $this->_getParam('total_amount');//Total amount is from the form contribution field
- if (empty($amount)) {//CRM-9894 would this ever be the case??
+ //Total amount is from the form contribution field
+ $amount = $this->_getParam('total_amount');
+ //CRM-9894 would this ever be the case??
+ if (empty($amount)) {
$amount = $this->_getParam('amount');
}
$fields = [];
/**
* Process incoming notification.
*/
- static public function handlePaymentNotification() {
+ public static function handlePaymentNotification() {
$ipnClass = new CRM_Core_Payment_AuthorizeNetIPN(array_merge($_GET, $_REQUEST));
$ipnClass->main();
}
'is_test' => 0,
'options' => ['limit' => 1],
'payment_processor_type_id' => $paymentProcessorTypeID,
- 'return' => 'id',
+ 'return' => 'id',
]);
}
*/
class CRM_Core_Payment_BaseIPN {
- static $_now = NULL;
+ public static $_now = NULL;
/**
* Input parameters from payment processor. Store these so that
/**
* Only used by AuthorizeNetIPN.
+ * @var bool
*
* @deprecated
*
- * @var bool
*/
protected $_isRecurring = FALSE;
/**
* Only used by AuthorizeNetIPN.
+ * @var bool
*
* @deprecated
*
- * @var bool
*/
protected $_isFirstOrLastRecurringPayment = FALSE;
// CRM-15546
$contributionStatuses = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'contribution_status_id', [
- 'labelColumn' => 'name',
- 'flip' => 1,
- ]);
+ 'labelColumn' => 'name',
+ 'flip' => 1,
+ ]);
$contribution->receive_date = CRM_Utils_Date::isoToMysql($contribution->receive_date);
$contribution->receipt_date = CRM_Utils_Date::isoToMysql($contribution->receipt_date);
$contribution->thankyou_date = CRM_Utils_Date::isoToMysql($contribution->thankyou_date);
if (!empty($memberships)) {
// if transaction is failed then set "Cancelled" as membership status
$membershipStatuses = CRM_Core_PseudoConstant::get('CRM_Member_DAO_Membership', 'status_id', [
- 'labelColumn' => 'name',
- 'flip' => 1,
- ]);
+ 'labelColumn' => 'name',
+ 'flip' => 1,
+ ]);
foreach ($memberships as $membership) {
if ($membership) {
$membership->status_id = $membershipStatuses['Cancelled'];
$addLineItems = TRUE;
}
$contributionStatuses = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'contribution_status_id', [
- 'labelColumn' => 'name',
- 'flip' => 1,
- ]);
+ 'labelColumn' => 'name',
+ 'flip' => 1,
+ ]);
$contribution->contribution_status_id = $contributionStatuses['Cancelled'];
$contribution->cancel_date = self::$_now;
$contribution->cancel_reason = CRM_Utils_Array::value('reasonCode', $input);
if (empty($input['IAmAHorribleNastyBeyondExcusableHackInTheCRMEventFORMTaskClassThatNeedsToBERemoved'])) {
if (!empty($memberships)) {
$membershipStatuses = CRM_Core_PseudoConstant::get('CRM_Member_DAO_Membership', 'status_id', [
- 'labelColumn' => 'name',
- 'flip' => 1,
- ]);
+ 'labelColumn' => 'name',
+ 'flip' => 1,
+ ]);
// Cancel only Pending memberships
// CRM-18688
$pendingStatusId = $membershipStatuses['Pending'];
return $params;
}
}
+
// end function doDirectPayment
/**
*/
class CRM_Core_Payment_Form {
-
/**
* Add payment fields depending on payment processor.
*
* @param int $paymentInstrumentID
* ID of the payment processor.
*/
- static public function setPaymentFieldsByProcessor(&$form, $processor, $billing_profile_id = NULL, $isBackOffice = FALSE, $paymentInstrumentID = NULL) {
+ public static function setPaymentFieldsByProcessor(&$form, $processor, $billing_profile_id = NULL, $isBackOffice = FALSE, $paymentInstrumentID = NULL) {
$form->billingFieldSets = [];
// Load the pay-later processor
// @todo load this right up where the other processors are loaded initially.
* @param CRM_Core_Form $form
* @param CRM_Core_Payment $processor
*/
- static protected function setBillingAddressFields(&$form, $processor) {
+ protected static function setBillingAddressFields(&$form, $processor) {
$billingID = $form->_bltID;
$smarty = CRM_Core_Smarty::singleton();
$smarty->assign('billingDetailsFields', self::getBillingAddressFields($processor, $billingID));
return $params;
}
+
// end function doDirectPayment
/**
}
}
-
/**
* ignore for now, more elaborate error handling later.
* @param $response
*/
class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN {
- static $_paymentProcessor = NULL;
+ public static $_paymentProcessor = NULL;
/**
* Input parameters from payment processor. Store these so that
}
}
-
/**
* Gets PaymentProcessorID for PayPal
*
];
$paymentProcessorID = civicrm_api3('PaymentProcessor', 'getvalue', $processorParams);
if (empty($paymentProcessorID)) {
- Throw new CRM_Core_Exception('PayPalIPN: Could not get Payment Processor ID');
+ throw new CRM_Core_Exception('PayPalIPN: Could not get Payment Processor ID');
}
return $paymentProcessorID;
}
* @throws \CRM_Core_Exception
* @throws \CiviCRM_API3_Exception
*/
- static public function handlePaymentNotification() {
+ public static function handlePaymentNotification() {
$params = array_merge($_GET, $_REQUEST);
$q = explode('/', CRM_Utils_Array::value('q', $params, ''));
$lastParam = array_pop($q);
*/
class CRM_Core_Payment_PayPalProIPN extends CRM_Core_Payment_BaseIPN {
- static $_paymentProcessor = NULL;
+ public static $_paymentProcessor = NULL;
/**
* Input parameters from payment processor. Store these so that
/**
* Is this a payment express transaction.
+ * @var bool
*/
protected $_isPaymentExpress = FALSE;
switch ($txnType) {
case 'recurring_payment_profile_created':
if (in_array($recur->contribution_status_id, [
- $contributionStatuses['Pending'],
- $contributionStatuses['In Progress'],
- ])
+ $contributionStatuses['Pending'],
+ $contributionStatuses['In Progress'],
+ ])
&& !empty($recur->processor_id)
) {
echo "already handled";
}
// arg api won't get this - fix it
$ids['contributionPage'] = CRM_Core_DAO::singleValueQuery("SELECT contribution_page_id FROM civicrm_contribution WHERE invoice_id = %1", [
- 1 => [
- $ids['contribution'],
- 'Integer',
- ],
- ]);
+ 1 => [
+ $ids['contribution'],
+ 'Integer',
+ ],
+ ]);
// only handle component at this stage - not terribly sure how a recurring event payment would arise
// & suspec main function may be a victom of copy & paste
// membership would be an easy add - but not relevant to my customer...
* the processor. It is the main function for processing on-server
* credit card transactions
*/
+
/**
* This function collects all the information from a web/api form and invokes
* the relevant payment processor specific functions to perform the transaction
return $e;
}
-
/**
* NOTE: 'doTransferCheckout' not implemented
*
if ($contribution->invoice_id != $input['invoice']) {
CRM_Core_Error::debug_log_message("Invoice values dont match between database and IPN request");
echo "Failure: Invoice values dont match between database and IPN request<p>";
- return;
+ return FALSE;
}
// lets replace invoice-id with Payment Processor -number because thats what is common and unique
if ($contribution->total_amount != $input['amount']) {
CRM_Core_Error::debug_log_message("Amount values dont match between database and IPN request");
echo "Failure: Amount values dont match between database and IPN request. " . $contribution->total_amount . "/" . $input['amount'] . "<p>";
- return;
+ return FALSE;
}
$transaction = new CRM_Core_Transaction();
*/
use Civi\Payment\System;
+
/**
*
* @package CRM
return $params;
}
+
// end function doDirectPayment
/**
// Profile permissions
$permissions['profile'] = [
- 'get' => [], // the profile will take care of this
+ // the profile will take care of this
+ 'get' => [],
];
$permissions['uf_group'] = [
protected $_viewPermissionedGroups;
protected $_editPermissionedGroups;
-
/**
* Given a permission string, check for access requirements
*
// FIXME!!!!
/**
- $uids = array();
- $sql = "
- SELECT {users}.uid, {role_permission}.permission
- FROM {users}
- JOIN {users_roles}
- ON {users}.uid = {users_roles}.uid
- JOIN {role_permission}
- ON {role_permission}.rid = {users_roles}.rid
- WHERE {role_permission}.permission = '{$permissionName}'
- AND {users}.status = 1
- ";
-
- $result = db_query($sql);
- foreach ($result as $record) {
- $uids[] = $record->uid;
- }
-
- $_cache[$permissionName] = self::getContactEmails($uids);
- return $_cache[$permissionName];
+ * $uids = array();
+ * $sql = "
+ * SELECT {users}.uid, {role_permission}.permission
+ * FROM {users}
+ * JOIN {users_roles}
+ * ON {users}.uid = {users_roles}.uid
+ * JOIN {role_permission}
+ * ON {role_permission}.rid = {users_roles}.rid
+ * WHERE {role_permission}.permission = '{$permissionName}'
+ * AND {users}.status = 1
+ * ";
+ *
+ * $result = db_query($sql);
+ * foreach ($result as $record) {
+ * $uids[] = $record->uid;
+ * }
+ *
+ * $_cache[$permissionName] = self::getContactEmails($uids);
+ * return $_cache[$permissionName];
*/
return [];
}
*/
class CRM_Core_Permission_Base {
- // permission mapping to stub check() calls
+ /**
+ * permission mapping to stub check() calls
+ * @var array
+ */
public $permissions = NULL;
/**
protected $_viewPermissionedGroups;
protected $_editPermissionedGroups;
-
/**
* Given a permission string, check for access requirements
*
*
*/
class CRM_Core_Permission_Drupal8 extends CRM_Core_Permission_DrupalBase {
+
/**
* Given a permission string, check for access requirements
*
*
*/
class CRM_Core_Permission_Joomla extends CRM_Core_Permission_Base {
+
/**
* Given a permission string, check for access requirements
*
// This is a codeblock copied from /Civicrm/Utils/REST
$uid = NULL;
if (!$uid) {
- $store = NULL;
+ $store = NULL;
$contact_id = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $api_key, 'id', 'api_key');
$query = $db->getQuery(TRUE);
$query
- ->select($db->quoteName('rules'))
- ->from($db->quoteName('#__assets'))
- ->where($db->quoteName('name') . ' = ' . $db->quote('com_civicrm'));
+ ->select($db->quoteName('rules'))
+ ->from($db->quoteName('#__assets'))
+ ->where($db->quoteName('name') . ' = ' . $db->quote('com_civicrm'));
$db->setQuery($query);
$query = $db->getQuery(TRUE);
$query
- ->update($db->quoteName('#__assets'))
- ->set($db->quoteName('rules') . ' = ' . $db->quote(json_encode($associations)))
- ->where($db->quoteName('name') . ' = ' . $db->quote('com_civicrm'));
+ ->update($db->quoteName('#__assets'))
+ ->set($db->quoteName('rules') . ' = ' . $db->quote(json_encode($associations)))
+ ->where($db->quoteName('name') . ' = ' . $db->quote('com_civicrm'));
$db->setQuery($query)->execute();
}
* used when processing certain API backends.
*/
class CRM_Core_Permission_Temp {
- static $id = 0;
+ public static $id = 0;
/**
* Array(int $grantId => array($perm))
*/
class CRM_Core_Permission_UnitTests extends CRM_Core_Permission_Base {
- // permission mapping to stub check() calls
+ /**
+ * permission mapping to stub check() calls
+ * @var array
+ */
public $permissions = NULL;
/**
*
*/
class CRM_Core_Permission_WordPress extends CRM_Core_Permission_Base {
+
/**
* Given a permission string, check for access requirements
*
/**
* Store the results of a SQL query in the cache.
- *
+ * @param string $cacheKey
* @param string $sql
* A SQL query. The query *MUST* be a SELECT statement which yields
* the following columns (in order): cacheKey, entity_id1, data
->columns([
'entity_id1',
'cacheKey',
- 'data'
+ 'data',
]);
foreach ($rows as &$row) {
private static $cache;
/**
- * @deprecated Please use the buildOptions() method in the appropriate BAO object.
- *
* activity type
* @var array
+ * @deprecated Please use the buildOptions() method in the appropriate BAO object.
*/
private static $activityType;
private static $countryIsoCode;
/**
- * @deprecated Please use the buildOptions() method in the appropriate BAO object.
- *
* group
* @var array
+ * @deprecated Please use the buildOptions() method in the appropriate BAO object.
*/
private static $group;
private static $worldRegions;
/**
- * @deprecated Please use the buildOptions() method in the appropriate BAO object.
- *
* activity status
* @var array
+ * @deprecated Please use the buildOptions() method in the appropriate BAO object.
*/
private static $activityStatus;
return CRM_Extension_System::singleton()->getMapper()->getActiveModuleFiles($fresh);
}
-
/**
* Get all tax rates.
*
else {
$value[] = $option['values'][0]['value'];
}
- $where = 'AND efa.account_relationship IN (' . implode(', ', $value) . ' )';
+ $where = 'AND efa.account_relationship IN (' . implode(', ', $value) . ' )';
}
else {
$where = '';
* The template to display the required "red" asterick.
* @var string
*/
- static $_requiredTemplate = NULL;
+ public static $_requiredTemplate = NULL;
/**
* The template to display error messages inline with the form element.
* @var string
*/
- static $_errorTemplate = NULL;
+ public static $_errorTemplate = NULL;
/**
* Class constructor.
$status = $element->moveUploadedFile($this->_uploadDir, $newName);
if (!$status) {
CRM_Core_Error::statusBounce(ts('We could not move the uploaded file %1 to the upload directory %2. Please verify that the \'Temporary Files\' setting points to a valid path which is writable by your web server.', [
- 1 => $value['name'],
- 2 => $this->_uploadDir,
- ]));
+ 1 => $value['name'],
+ 2 => $this->_uploadDir,
+ ]));
}
if (!empty($data['values'][$pageName][$uploadName]['name'])) {
@unlink($this->_uploadDir . $data['values'][$pageName][$uploadName]);
*
*/
class CRM_Core_QuickForm_GroupMultiSelect extends CRM_Core_QuickForm_NestedAdvMultiSelect {
+
/**
* Returns the HTML generated for the advanced multiple select component.
*
* Class CRM_Core_QuickForm_NestedAdvMultiSelect
*/
class CRM_Core_QuickForm_NestedAdvMultiSelect extends HTML_QuickForm_advmultiselect {
+
/**
* Loads options from different types of data sources.
*
* Interface CRM_Core_Reference_Interface
*/
interface CRM_Core_Reference_Interface {
+
public function getReferenceTable();
public function getReferenceKey();
*
* @var string
*/
- var $_name;
+ public $_name;
/**
* List of snippets to inject within region
*
* @var array; e.g. $this->_snippets[3]['type'] = 'template';
*/
- var $_snippets;
+ public $_snippets;
/**
* Whether the snippets array has been sorted
*
* @var boolean
*/
- var $_isSorted;
+ public $_isSorted;
/**
* @param string $name
* New copy of the manager.
* @return CRM_Core_Resources
*/
- static public function singleton(CRM_Core_Resources $instance = NULL) {
+ public static function singleton(CRM_Core_Resources $instance = NULL) {
if ($instance !== NULL) {
self::$_singleton = $instance;
}
*/
public function addScriptUrl($url, $weight = self::DEFAULT_WEIGHT, $region = self::DEFAULT_REGION) {
CRM_Core_Region::instance($region)->add([
- 'name' => $url,
- 'type' => 'scriptUrl',
- 'scriptUrl' => $url,
- 'weight' => $weight,
- 'region' => $region,
- ]);
+ 'name' => $url,
+ 'type' => 'scriptUrl',
+ 'scriptUrl' => $url,
+ 'weight' => $weight,
+ 'region' => $region,
+ ]);
return $this;
}
public function addScript($code, $weight = self::DEFAULT_WEIGHT, $region = self::DEFAULT_REGION) {
CRM_Core_Region::instance($region)->add([
// 'name' => automatic
- 'type' => 'script',
- 'script' => $code,
- 'weight' => $weight,
- 'region' => $region,
- ]);
+ 'type' => 'script',
+ 'script' => $code,
+ 'weight' => $weight,
+ 'region' => $region,
+ ]);
return $this;
}
*/
public function addStyleUrl($url, $weight = self::DEFAULT_WEIGHT, $region = self::DEFAULT_REGION) {
CRM_Core_Region::instance($region)->add([
- 'name' => $url,
- 'type' => 'styleUrl',
- 'styleUrl' => $url,
- 'weight' => $weight,
- 'region' => $region,
- ]);
+ 'name' => $url,
+ 'type' => 'styleUrl',
+ 'styleUrl' => $url,
+ 'weight' => $weight,
+ 'region' => $region,
+ ]);
return $this;
}
public function addStyle($code, $weight = self::DEFAULT_WEIGHT, $region = self::DEFAULT_REGION) {
CRM_Core_Region::instance($region)->add([
// 'name' => automatic
- 'type' => 'style',
- 'style' => $code,
- 'weight' => $weight,
- 'region' => $region,
- ]);
+ 'type' => 'style',
+ 'style' => $code,
+ 'weight' => $weight,
+ 'region' => $region,
+ ]);
return $this;
}
$files = array_merge($files, (array) glob("$path/$pattern", $flags));
}
}
- sort($files); // Deterministic order.
+ // Deterministic order.
+ sort($files);
$files = array_unique($files);
return array_map(function ($file) use ($path) {
return CRM_Utils_File::relativize($file, "$path/");
*/
public static function isAjaxMode() {
if (in_array(CRM_Utils_Array::value('snippet', $_REQUEST), [
- CRM_Core_Smarty::PRINT_SNIPPET,
- CRM_Core_Smarty::PRINT_NOFORM,
- CRM_Core_Smarty::PRINT_JSON,
- ])
+ CRM_Core_Smarty::PRINT_SNIPPET,
+ CRM_Core_Smarty::PRINT_NOFORM,
+ CRM_Core_Smarty::PRINT_JSON,
+ ])
) {
return TRUE;
}
}
/**
- * @param GenericHookEvent $e
+ * @param \Civi\Core\Event\GenericHookEvent $e
* @see \CRM_Utils_Hook::buildAsset()
*/
public static function renderMenubarStylesheet(GenericHookEvent $e) {
* List of translatable strings.
*/
public function get($bucket, $file, $format) {
- $stringsByFile = $this->cache->get($bucket); // array($file => array(...strings...))
+ // array($file => array(...strings...))
+ $stringsByFile = $this->cache->get($bucket);
if (!$stringsByFile) {
$stringsByFile = [];
}
*/
class CRM_Core_ScheduledJob {
- var $version = 3;
+ public $version = 3;
- var $name = NULL;
+ public $name = NULL;
- var $apiParams = [];
+ public $apiParams = [];
- var $remarks = [];
+ public $remarks = [];
/**
* @param array $params
* date format (QF format)
* @param null $minOffset
* @param null $maxOffset
- *
+ * @param string $context
* @return array
* the date array
*/
return $profileGroupType;
}
-
/**
* Word replacement match type.
*
/**
* The objectAction for the WebObject
+ * @var int
*/
protected $_action;
/**
* Cache of all the session names that we manage.
+ * @var array
*/
- static $_managedNames = NULL;
+ public static $_managedNames = NULL;
/**
* Key is used to allow the application to have multiple top
*
* @var string
*/
- static $_showIcon, $_hideIcon;
+ public static $_showIcon;
+ public static $_hideIcon;
/**
* The array of ids of blocks that will be shown.
* Class CRM_Core_Smarty_Permissions
*/
class CRM_Core_Smarty_Permissions {
+
/**
* non-static adapter for CRM_Core_Permission::check
* @param $offset
unset($errorScope);
if ($result === FALSE) {
$smarty->trigger_error("Unknown error");
- return;
}
if (!empty($result['is_error'])) {
* the generated key
*/
function smarty_function_crmKey($params, &$smarty) {
- return
- CRM_Core_Key::get(
+ return CRM_Core_Key::get(
$params['name'],
CRM_Utils_Array::value('addSequence', $params, 0)
);
}
foreach ([
- 'target',
- 'assignee',
- ] as $role) {
+ 'target',
+ 'assignee',
+ ] as $role) {
$contact = [];
if (!empty($activity[$role . '_contact_id'])) {
$contact_id = array_shift($activity[$role . '_contact_id']);
$contact = civicrm_api('contact', 'getsingle', $baseContactParams + [
- 'contact_id' => $contact_id,
- ]);
+ 'contact_id' => $contact_id,
+ ]);
}
$smarty->assign($params[$role . '_var'], $contact);
}
* @return string
*/
function smarty_prefilter_resetExtScope($tpl_source, &$smarty) {
- return
- '{crmScope extensionKey=""}'
+ return '{crmScope extensionKey=""}'
. $tpl_source
. '{/crmScope}';
}
function civicrm_smarty_register_string_resource() {
$template = CRM_Core_Smarty::singleton();
$template->register_resource('string', [
- 'civicrm_smarty_resource_string_get_template',
- 'civicrm_smarty_resource_string_get_timestamp',
- 'civicrm_smarty_resource_string_get_secure',
- 'civicrm_smarty_resource_string_get_trusted',
- ]
- );
+ 'civicrm_smarty_resource_string_get_template',
+ 'civicrm_smarty_resource_string_get_timestamp',
+ 'civicrm_smarty_resource_string_get_secure',
+ 'civicrm_smarty_resource_string_get_trusted',
+ ]);
}
* This array defines weights for table, which are used to sort array of table in from clause
* @var array
*/
- static $info = [
+ public static $info = [
'civicrm_contact' => '01',
'civicrm_address' => '09',
'civicrm_county' => '10',
* This must be defined in each child class. It is passed to the searchTasks hook.
* Example: $objectType = 'event';
*/
- static $objectType = NULL;
+ public static $objectType = NULL;
/**
* Generates a list of batch tasks available for the current entities.
* safe to temporarily switch to exception
*/
class CRM_Core_TemporaryErrorScope {
- static $oldFrames;
+ public static $oldFrames;
/**
* @return CRM_Core_TemporaryErrorScope
/**
* Whether commit() has been called on this instance
* of CRM_Core_Transaction
+ * @var bool
*/
private $_pseudoCommitted = FALSE;
/**
* @param $flag
*/
- static public function rollbackIfFalse($flag) {
+ public static function rollbackIfFalse($flag) {
$frame = \Civi\Core\Transaction\Manager::singleton()->getFrame();
if ($flag === FALSE && $frame !== NULL) {
$frame->setRollbackOnly();
* callstack will not wind-down normally -- e.g. before
* a call to exit().
*/
- static public function forceRollbackIfEnabled() {
+ public static function forceRollbackIfEnabled() {
if (\Civi\Core\Transaction\Manager::singleton()->getFrame() !== NULL) {
\Civi\Core\Transaction\Manager::singleton()->forceRollback();
}
/**
* @return bool
*/
- static public function willCommit() {
+ public static function willCommit() {
$frame = \Civi\Core\Transaction\Manager::singleton()->getFrame();
return ($frame === NULL) ? TRUE : !$frame->isRollbackOnly();
}
/**
* Determine whether there is a pending transaction.
*/
- static public function isActive() {
+ public static function isActive() {
$frame = \Civi\Core\Transaction\Manager::singleton()->getFrame();
return ($frame !== NULL);
}
* See php manual call_user_func_array for details.
* @param int $id
*/
- static public function addCallback($phase, $callback, $params = NULL, $id = NULL) {
+ public static function addCallback($phase, $callback, $params = NULL, $id = NULL) {
$frame = \Civi\Core\Transaction\Manager::singleton()->getBaseFrame();
$frame->addCallback($phase, $callback, $params, $id);
}
/**
* Array of custom field values
+ * @var array
*/
protected $_values;
/**
* Mapper array of valid field type
+ * @var array
*/
protected $_htmlTypeTransitions;
);
$this->addButtons([
- [
- 'type' => 'next',
- 'name' => ts('Change Field Type'),
- 'isDefault' => TRUE,
- 'js' => ['onclick' => 'return checkCustomDataField();'],
- ],
- [
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ],
- ]
- );
+ [
+ 'type' => 'next',
+ 'name' => ts('Change Field Type'),
+ 'isDefault' => TRUE,
+ 'js' => ['onclick' => 'return checkCustomDataField();'],
+ ],
+ [
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ],
+ ]);
}
/**
$customField->find(TRUE);
if ($dstHtmlType == 'Text' && in_array($srcHtmlType, [
- 'Select',
- 'Radio',
- 'Autocomplete-Select',
- ])
- ) {
+ 'Select',
+ 'Radio',
+ 'Autocomplete-Select',
+ ])) {
$customField->option_group_id = "NULL";
CRM_Core_BAO_CustomField::checkOptionGroup($this->_values['option_group_id']);
}
if (in_array($srcHtmlType, $mutliValueOps) &&
- in_array($dstHtmlType, $singleValueOps)
- ) {
+ in_array($dstHtmlType, $singleValueOps)) {
$this->flattenToFirstValue($tableName, $this->_values['column_name']);
}
elseif (in_array($srcHtmlType, $singleValueOps) &&
- in_array($dstHtmlType, $mutliValueOps)
- ) {
+ in_array($dstHtmlType, $mutliValueOps)) {
$this->firstValueToFlatten($tableName, $this->_values['column_name']);
}
public function buildQuickForm() {
$this->addButtons([
- [
- 'type' => 'next',
- 'name' => ts('Delete Custom Field'),
- 'isDefault' => TRUE,
- ],
- [
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ],
- ]
- );
+ [
+ 'type' => 'next',
+ 'name' => ts('Delete Custom Field'),
+ 'isDefault' => TRUE,
+ ],
+ [
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ],
+ ]);
}
/**
public function buildQuickForm() {
$this->addButtons([
- [
- 'type' => 'next',
- 'name' => ts('Delete Custom Group'),
- 'isDefault' => TRUE,
- ],
- [
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ],
- ]
- );
+ [
+ 'type' => 'next',
+ 'name' => ts('Delete Custom Group'),
+ 'isDefault' => TRUE,
+ ],
+ [
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ],
+ ]);
}
/**
/**
* Array of custom field values if update mode.
+ * @var array
*/
protected $_values;
$this->add('number',
'note_length',
ts('Maximum length') . ' ',
- $attributes['text_length'], // note_length is an alias for the text-length field
+ // note_length is an alias for the text-length field
+ $attributes['text_length'],
FALSE
);
// add buttons
$this->addButtons([
- [
- 'type' => 'done',
- 'name' => ts('Save'),
- 'isDefault' => TRUE,
- ],
- [
- 'type' => 'next',
- 'name' => ts('Save and New'),
- 'subName' => 'new',
- ],
- [
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ],
- ]
- );
+ [
+ 'type' => 'done',
+ 'name' => ts('Save'),
+ 'isDefault' => TRUE,
+ ],
+ [
+ 'type' => 'next',
+ 'name' => ts('Save and New'),
+ 'subName' => 'new',
+ ],
+ [
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ],
+ ]);
// add a form rule to check default value
$this->addFormRule(['CRM_Custom_Form_Field', 'formRule'], $this);
//validate field label as well as name.
$title = $fields['label'];
$name = CRM_Utils_String::munge($title, '_', 64);
- $gId = $self->_gid; // CRM-7564
+ // CRM-7564
+ $gId = $self->_gid;
$query = 'select count(*) from civicrm_custom_field where ( name like %1 OR label like %2 ) and id != %3 and custom_group_id = %4';
$fldCnt = CRM_Core_DAO::singleValueQuery($query, [
1 => [$name, 'String'],
);
$this->addButtons([
- [
- 'type' => 'next',
- 'name' => ts('Move Custom Field'),
- 'isDefault' => TRUE,
- ],
- [
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ],
- ]
- );
+ [
+ 'type' => 'next',
+ 'name' => ts('Move Custom Field'),
+ 'isDefault' => TRUE,
+ ],
+ [
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ],
+ ]);
$this->addFormRule(['CRM_Custom_Form_MoveField', 'formRule'], $this);
}
/**
* The option group ID
+ * @var int
*/
protected $_optionGroupID = NULL;
$option = civicrm_api3('option_value', 'getsingle', ['id' => $this->_id]);
$this->assign('label', $option['label']);
$this->addButtons([
- [
- 'type' => 'next',
- 'name' => ts('Delete'),
- 'isDefault' => TRUE,
- ],
- [
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ],
- ]
- );
+ [
+ 'type' => 'next',
+ 'name' => ts('Delete'),
+ 'isDefault' => TRUE,
+ ],
+ [
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ],
+ ]);
}
else {
// lets trim all the whitespace
// add buttons
$this->addButtons([
- [
- 'type' => 'next',
- 'name' => ts('Save'),
- 'isDefault' => TRUE,
- ],
- [
- 'type' => 'next',
- 'name' => ts('Save and New'),
- 'subName' => 'new',
- ],
- [
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ],
- ]
- );
+ [
+ 'type' => 'next',
+ 'name' => ts('Save'),
+ 'isDefault' => TRUE,
+ ],
+ [
+ 'type' => 'next',
+ 'name' => ts('Save and New'),
+ 'subName' => 'new',
+ ],
+ [
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ],
+ ]);
// if view mode pls freeze it with the done button.
if ($this->_action & CRM_Core_Action::VIEW) {
$this->assign('groupTree', $this->_groupTree);
}
$this->addButtons([
- [
- 'type' => 'cancel',
- 'name' => ts('Done with Preview'),
- 'isDefault' => TRUE,
- ],
- ]
- );
+ [
+ 'type' => 'cancel',
+ 'name' => ts('Done with Preview'),
+ 'isDefault' => TRUE,
+ ],
+ ]);
}
}
* Class CRM_Custom_Import_Controller
*/
class CRM_Custom_Import_Controller extends CRM_Core_Controller {
+
/**
* Class constructor.
*
* Class CRM_Custom_Import_Form_Summary
*/
class CRM_Custom_Import_Form_Summary extends CRM_Contact_Import_Form_Summary {
+
/**
* Set variables up before form is built.
*
protected $_fileName;
- /**#@+
+ /**
+ * #@+
* @var integer
*/
/**
* Imported file size
+ * @var int
*/
protected $_fileSize;
/**
* Separator being used
+ * @var string
*/
protected $_separator;
/**
* Total number of lines in file
+ * @var int
*/
protected $_lineCount;
if ($this->_invalidRowCount) {
// removed view url for invlaid contacts
$headers = array_merge([
- ts('Line Number'),
- ts('Reason'),
- ],
- $customHeaders
- );
+ ts('Line Number'),
+ ts('Reason'),
+ ], $customHeaders);
$this->_errorFileName = self::errorFileName(self::ERROR);
self::exportCSV($this->_errorFileName, $headers, $this->_errors);
}
if ($this->_conflictCount) {
$headers = array_merge([
- ts('Line Number'),
- ts('Reason'),
- ],
- $customHeaders
- );
+ ts('Line Number'),
+ ts('Reason'),
+ ], $customHeaders);
$this->_conflictFileName = self::errorFileName(self::CONFLICT);
self::exportCSV($this->_conflictFileName, $headers, $this->_conflicts);
}
if ($this->_duplicateCount) {
$headers = array_merge([
- ts('Line Number'),
- ts('View Activity History URL'),
- ],
- $customHeaders
- );
+ ts('Line Number'),
+ ts('View Activity History URL'),
+ ], $customHeaders);
$this->_duplicateFileName = self::errorFileName(self::DUPLICATE);
self::exportCSV($this->_duplicateFileName, $headers, $this->_duplicates);
$customGroupID = $this->_multipleCustomData;
$importableFields = $this->getGroupFieldsForImport($customGroupID, $this);
$this->_fields = array_merge([
- 'do_not_import' => ['title' => ts('- do not import -')],
- 'contact_id' => ['title' => ts('Contact ID')],
- 'external_identifier' => ['title' => ts('External Identifier')],
- ], $importableFields);
+ 'do_not_import' => ['title' => ts('- do not import -')],
+ 'contact_id' => ['title' => ts('Contact ID')],
+ 'external_identifier' => ['title' => ts('External Identifier')],
+ ], $importableFields);
}
/**
* Class CRM_Dedupe_BAO_QueryBuilder
*/
class CRM_Dedupe_BAO_QueryBuilder {
+
/**
* @param $rg
* @param string $strID1
* Class CRM_Dedupe_BAO_QueryBuilder_IndividualGeneral
*/
class CRM_Dedupe_BAO_QueryBuilder_IndividualGeneral extends CRM_Dedupe_BAO_QueryBuilder {
+
/**
* @param $rg
*
/**
* Ids of the contacts to limit the SQL queries (whole-database queries otherwise)
+ * @var array
*/
- var $contactIds = [];
+ public $contactIds = [];
/**
* Params to dedupe against (queries against the whole contact set otherwise)
+ * @var array
*/
- var $params = [];
+ public $params = [];
/**
* Return the SQL query for the given rule - either for finding matching
$innerJoinClauses = [
"t1.{$this->rule_field} IS NOT NULL",
"t2.{$this->rule_field} IS NOT NULL",
- "t1.{$this->rule_field} = t2.{$this->rule_field}"
+ "t1.{$this->rule_field} = t2.{$this->rule_field}",
];
if ($fields[$this->rule_field]['type'] === CRM_Utils_Type::T_DATE) {
$innerJoinClauses[] = "t1.{$this->rule_field} > '1000-01-01'";
/**
* Ids of the contacts to limit the SQL queries (whole-database queries otherwise)
+ * @var array
*/
- var $contactIds = [];
+ public $contactIds = [];
/**
* Set the contact IDs to restrict the dedupe to.
/**
* Params to dedupe against (queries against the whole contact set otherwise)
+ * @var array
*/
- var $params = [];
+ public $params = [];
/**
* If there are no rules in rule group.
+ * @var bool
*/
- var $noRules = FALSE;
+ public $noRules = FALSE;
protected $temporaryTables = [];
return $result;
}
-
/**
* Get the cached contact type for a particular rule group.
*
* @param array $foundDupes
* @param string $cacheKeyString
*
- * @return array Dupe pairs with the keys
+ * @return array
* Dupe pairs with the keys
* -srcID
* -srcName
$membershipIDs = CRM_Utils_Array::collect('id',
CRM_Utils_Array::value('values',
civicrm_api3("Membership", "get", [
- "contact_id" => $otherID,
- "return" => "id",
- ]
- )
+ "contact_id" => $otherID,
+ "return" => "id",
+ ])
)
);
$msg = '';
if (!empty($stats['merged'])) {
$msg = '<p>' . ts('One contact merged.', [
- 'count' => $stats['merged'],
- 'plural' => '%count contacts merged.',
- ]) . '</p>';
+ 'count' => $stats['merged'],
+ 'plural' => '%count contacts merged.',
+ ]) . '</p>';
}
if (!empty($stats['skipped'])) {
$msg .= '<p>' . ts('One contact was skipped.', [
- 'count' => $stats['skipped'],
- 'plural' => '%count contacts were skipped.',
- ]) . '</p>';
+ 'count' => $stats['skipped'],
+ 'plural' => '%count contacts were skipped.',
+ ]) . '</p>';
}
return $msg;
}
*
* @return bool
*/
- static public function locationIsSame($mainAddress, $comparisonAddress) {
+ public static function locationIsSame($mainAddress, $comparisonAddress) {
$keysToIgnore = [
'id',
'is_primary',
];
$activity = civicrm_api3('activity', 'create', [
'source_contact_id' => CRM_Core_Session::getLoggedInContactID() ? CRM_Core_Session::getLoggedInContactID() :
- $mainId,
+ $mainId,
'subject' => ts('Contact ID %1 has been merged and deleted.', $params),
'target_contact_id' => $mainId,
'activity_type_id' => 'Contact Merged',
])) {
civicrm_api3('activity', 'create', [
'source_contact_id' => CRM_Core_Session::getLoggedInContactID() ? CRM_Core_Session::getLoggedInContactID() :
- $otherId,
+ $otherId,
'subject' => ts('Contact ID %1 has been merged into Contact ID %2 and deleted.', $params),
'target_contact_id' => $otherId,
'activity_type_id' => 'Contact Deleted by Merge',
* Limit to searching for matches against this many contacts.
*
* @return array
- * Array of matches meeting the criteria.
+ * Array of matches meeting the criteria.
*/
public static function getDuplicatePairs($rule_group_id, $group_id, $reloadCacheIfEmpty, $batchLimit, $isSelected, $orderByClause = '', $includeConflicts = TRUE, $criteria = [], $checkPermissions = TRUE, $searchLimit = 0) {
$where = self::getWhereString($isSelected);