'type' => 'next',
'name' => ts('Save'),
'spacing' => '',
- 'isDefault' => FALSE
+ 'isDefault' => FALSE,
),
)
);
CRM_Core_Session::setStatus(
ts('The %1 role was assigned one or more permissions that may prove dangerous for users of that role to have. Please reconsider assigning %2 to them.', array(
1 => $wp_roles->role_names[$role],
- 2 => implode(', ', $warningPermissionNames)
+ 2 => implode(', ', $warningPermissionNames),
)),
ts('Unsafe Permission Settings')
);
array(
'title' => ts('Word Replacements'),
'url' => $breadCrumbUrl,
- )
+ ),
);
CRM_Utils_System::appendBreadCrumb($breadCrumb);
}
*/
public function postProcess() {
$params = $this->controller->exportValues($this->_name);
- $this->_numStrings = sizeof($params['old']);
+ $this->_numStrings = count($params['old']);
$enabled['exactMatch'] = $enabled['wildcardMatch'] = $disabled['exactMatch'] = $disabled['wildcardMatch'] = array();
for ($i = 1; $i <= $this->_numStrings; $i++) {
//format multi-select group and contact types.
foreach (array(
'group',
- 'contact_type'
+ 'contact_type',
) as $param) {
$paramValue = CRM_Utils_Array::value($param, $params);
if ($paramValue) {
foreach (array(
'campaign_survey_id',
'survey_interviewer_id',
- 'campaign_search_voter_for'
+ 'campaign_search_voter_for',
) as $fld) {
$voterClauseParams[$fld] = CRM_Utils_Array::value($fld, $params);
}
array(
'value' => '',
'title' => ts('- select -'),
- )
+ ),
);
foreach ($campaigns as $value => $title) {
$class = NULL;
array(
'value' => '',
'title' => ts('- select -'),
- )
+ ),
);
foreach ($campGroups as $grpId => $title) {
$groups[] = array(
/**
* Retrieve campaigns as for campaign dashboard.
*
- **/
+ */
public function campaignList() {
//get the search criteria params.
$searchParams = explode(',', CRM_Utils_Array::value('searchCriteria', $_POST));
'sort',
'offset',
'rowCount',
- 'sortOrder'
+ 'sortOrder',
) as $sortParam) {
$params[$sortParam] = $$sortParam;
}
/**
* Retrieve survey for survey dashboard.
*
- **/
+ */
public function surveyList() {
//get the search criteria params.
$searchParams = explode(',', CRM_Utils_Array::value('searchCriteria', $_POST));
'sort',
'offset',
'rowCount',
- 'sortOrder'
+ 'sortOrder',
) as $sortParam) {
$params[$sortParam] = $$sortParam;
}
/**
* Retrieve petitions for petition dashboard.
*
- **/
+ */
public function petitionList() {
//get the search criteria params.
$searchParams = explode(',', CRM_Utils_Array::value('searchCriteria', $_POST));
'sort',
'offset',
'rowCount',
- 'sortOrder'
+ 'sortOrder',
) as $sortParam) {
$params[$sortParam] = $$sortParam;
}
*
* @return void
*/
- function preProcess() {
+ public function preProcess() {
parent::preProcess();
}
* @param array $params
* (reference ) an assoc array of name/value pairs.
*
- * @return boolean
+ * @return bool
*/
public static function dataExists(&$params) {
// return if no data present
* @return array
* (total, added, notAdded) count of contacts added to group
*/
- static function addContactsToGroup(
+ public static function addContactsToGroup(
$contactIds,
$groupId,
$method = 'Admin',
$tracking = NULL
) {
-
CRM_Utils_Hook::pre('create', 'GroupContact', $groupId, $contactIds);
list($numContactsAdded,
* @return array
* (total, removed, notRemoved) count of contacts removed to group
*/
- static function removeContactsFromGroup(
+ public static function removeContactsFromGroup(
&$contactIds,
$groupId,
$method = 'Admin',
*
* @param bool $excludeHidden
*
- * @return array
- * (reference )|int $values the relevant data object values for the contact or
- * the total count when $count is TRUE
- *
- * $access public
+ * @return array (reference)|int $values
+ * the relevant data object values for the contact or
+ * the total count when $count is TRUE
*/
- static function &getContactGroup(
+ public static function &getContactGroup(
$contactId,
$status = NULL,
$numGroupContact = NULL,
* @return array
* (total, added, notAdded) count of contacts added to group
*/
- static function bulkAddContactsToGroup(
+ public static function bulkAddContactsToGroup(
$contactIDs,
$groupID,
$method = 'Admin',
*
* @param string $fieldName
* @param string $context
- * @see CRM_Core_DAO::buildOptionsContext.
+ * @see CRM_Core_DAO::buildOptionsContext
* @param array $props
* whatever is known about this dao object.
*
- * @return Array|bool
+ * @return array|bool
*/
public static function buildOptions($fieldName, $context = NULL, $props = array()) {
$params = array();
$emailParams['weight'] = CRM_Utils_Weight::getDefaultWeight('CRM_Core_DAO_OptionValue', $fieldValues);
}
-
//reset default within domain.
$emailParams['reset_default_for'] = array('domain_id' => CRM_Core_Config::domainID());
/**
* called when action is browse
*
- * @return null
+ * @return void
*/
public function browse() {
// get the primary city, state and zip for the contact
/**
* called when action is browse
*
- * @return null
+ * @return void
*/
public function browse() {
$controller = new CRM_Core_Controller_Simple('CRM_Tag_Form_Tag', ts('Contact Tags'), $this->_action);
/**
* Class constructor
*/
- function __construct($controller, $action = CRM_Core_Action::NONE) {
+ public function __construct($controller, $action = CRM_Core_Action::NONE) {
parent::__construct($controller, $action);
$this->_pages = array();
* @param array $params
* Associated array of civicrm variables.
*
- * @return null
+ * @return void
*/
public static function create($params) {
self::add($params);
* @param array $params
* Associated array of civicrm variables.
*
- * @return null
+ * @return void
*/
public static function add(&$params) {
self::fixParams($params);
// also set a template url so js files can use this
// CRM-6194
$params['civiRelativeURL'] = CRM_Utils_System::url('CIVI_BASE_TEMPLATE');
- $params['civiRelativeURL'] =
- str_replace(
+ $params['civiRelativeURL']
+ = str_replace(
'CIVI_BASE_TEMPLATE',
'',
$params['civiRelativeURL']
* @param array $params
* Associated array of civicrm variables.
*
- * @return null
+ * @return void
*/
public static function fixParams(&$params) {
// in our old civicrm.settings.php we were using ISO code for country and
* @param array $values
* Associated array of civicrm variables stored in db.
*
- * @return null
+ * @return void
*/
public static function formatParams(&$params, &$values) {
if (empty($params) ||
$defaults = unserialize($domain->config_backend);
if ($defaults === FALSE || !is_array($defaults)) {
$defaults = array();
- return;
+ return FALSE;
}
$skipVars = self::skipVars();
list($oldURL, $oldDir, $oldSiteName, $oldSiteRoot) = self::getConfigSettings();
list($newURL, $newDir, $newSiteName, $newSiteRoot) = self::getBestGuessSettings();
-
// retrieve these values from the argument list
$variables = array('URL', 'Dir', 'SiteName', 'SiteRoot', 'Val_1', 'Val_2', 'Val_3');
$states = array('old', 'new');
* @param string $componentName
* Name of the component to be enabled, needs to be valid.
*
- * @return boolean
+ * @return bool
* true if valid component name and enabling succeeds, else false
*/
public static function enableComponent($componentName) {
}
// get enabled-components from DB and add to the list
- $enabledComponents =
- CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'enable_components', NULL, array());
+ $enabledComponents
+ = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'enable_components', NULL, array());
$enabledComponents[] = $componentName;
self::setEnabledComponents($enabledComponents);
}
// get enabled-components from DB and add to the list
- $enabledComponents =
- CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'enable_components', NULL, array());
+ $enabledComponents
+ = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'enable_components', NULL, array());
$enabledComponents = array_diff($enabledComponents, array($componentName));
self::setEnabledComponents($enabledComponents);
/**
* Delete the Message Templates
*
- *
* @param int $messageTemplatesID
- *
- * @return object
+ * @return void
*/
public static function del($messageTemplatesID) {
// make sure messageTemplatesID is an integer
$smarty = CRM_Core_Smarty::singleton();
foreach (array(
'text',
- 'html'
+ 'html',
) as $elem) {
$$elem = $smarty->fetch("string:{$$elem}");
}
/**
* Revert a message template to its default subject+text+HTML state
*
- * @param int id id of the template
+ * @param int $id id of the template
*
* @return void
*/
public static function revert($id) {
- $diverted = new self;
+ $diverted = new CRM_Core_BAO_MessageTemplate();
$diverted->id = (int) $id;
$diverted->find(1);
CRM_Core_Error::fatal(ts('Did not find a message template with id of %1.', array(1 => $id)));
}
- $orig = new self;
+ $orig = new CRM_Core_BAO_MessageTemplate();
$orig->workflow_id = $diverted->workflow_id;
$orig->is_reserved = 1;
$orig->find(1);
else {
CRM_Core_Error::fatal(ts('No such message template: option group %1, option value %2.', array(
1 => $params['groupName'],
- 2 => $params['valueName']
+ 2 => $params['valueName'],
)));
}
}
// replace tokens in the three elements (in subject as if it was the text body)
$domain = CRM_Core_BAO_Domain::getDomain();
$hookTokens = array();
- $mailing = new CRM_Mailing_BAO_Mailing;
+ $mailing = new CRM_Mailing_BAO_Mailing();
$mailing->body_text = $text;
$mailing->body_html = $html;
$tokens = $mailing->getTokens();
$text = CRM_Utils_Token::replaceContactTokens($text, $contact, FALSE, $tokens['text'], FALSE, TRUE);
$html = CRM_Utils_Token::replaceContactTokens($html, $contact, FALSE, $tokens['html'], FALSE, TRUE);
-
$contactArray = array($contactID => $contact);
CRM_Utils_Hook::tokenValues($contactArray,
array($contactID),
$subject = "{strip}$subject{/strip}";
// parse the three elements with Smarty
-
-
$smarty = CRM_Core_Smarty::singleton();
foreach ($params['tplParams'] as $name => $value) {
$smarty->assign($name, $value);
foreach (array(
'subject',
'text',
- 'html'
+ 'html',
) as $elem) {
$$elem = $smarty->fetch("string:{$$elem}");
}
* @param int $id
* Field Id.
*
- * @return boolean
+ * @return bool
*
*/
public static function del($id) {
*
* @param int $UFFieldId
*
- * @return boolean
+ * @return bool
* false if custom field are disabled else true
*/
public static function checkUFStatus($UFFieldId) {
* @param array $optional
* Array of types those are optional.
*
- * @return boolean
+ * @return bool
*/
public static function checkValidProfileType($ufGroupId, $required, $optional = NULL) {
if (!is_array($required) || empty($required)) {
- return;
+ return FALSE;
}
$ufGroup = new CRM_Core_DAO_UFGroup();
* @return string
* profile group_type
*
- * TODO Why is this function in this class? It seems to be about the UFGroup.
*/
public static function getProfileType($ufGroupId, $returnMixType = TRUE, $onlyPure = FALSE, $skipComponentType = FALSE) {
$ufGroup = new CRM_Core_DAO_UFGroup();
* True if only pure profiles are required.
* @param bool $skipComponentType
*
- * @return string
- * profile group_type
+ * @return string profile group_type
*
- * TODO Why is this function in this class? It seems to be about the UFGroup.
*/
public static function calculateProfileType($ufGroupType, $returnMixType = TRUE, $onlyPure = FALSE, $skipComponentType = FALSE) {
// profile types
*
* @param int $profileID
*
- * @return boolean
+ * @return bool
*/
public static function checkSearchableORInSelector($profileID) {
$result = FALSE;
'return' => 'field_name, is_required',
'options' => array(
'limit' => 0,
- )
+ ),
)
));
//check for valid fields ( fields that are present in billing block )
}
if (!in_array($prefixName, $validProfileFields)) {
- return;
+ return FALSE;
}
if (!empty($index) && (
));
//unset selected fields
foreach ($groupFieldList as $key => $value) {
- if (is_integer($key)) {
+ if (is_int($key)) {
unset($fields['Individual'][$value], $fields['Household'][$value], $fields['Organization'][$value]);
continue;
}
*
* @return void
*/
- static function buildQuickForm(
+ public static function buildQuickForm(
&$form, $parentNames, $entityTable, $entityId = NULL, $skipTagCreate = FALSE,
$skipEntityAction = FALSE, $tagsetElementName = NULL) {
$tagset = $form->_entityTagValues = array();
* @param string $str
* The permission to check.
*
- * @return boolean
+ * @return bool
* true if yes, else false
*/
public function check($str) {
$item = (array) $item;
// Clean up description - remove tags that would break dashboard layout
$description = preg_replace('#<h[1-3][^>]*>(.+?)</h[1-3][^>]*>#s', '<h4>$1</h4>', $item['description']);
- $item['description'] = strip_tags($description, "<a><p><h4><h5><h6><b><i><em><strong><ol><ul><li><dd><dt><code><pre><br>");
+ $item['description'] = strip_tags($description, "<a><p><h4><h5><h6><b><i><em><strong><ol><ul><li><dd><dt><code><pre><br/>");
$blog[] = $item;
}
if ($blog) {
$pre = $post = array();
foreach (array(
'pre',
- 'post'
+ 'post',
) as $keys) {
if (isset($this->_values['additional_custom_' . $keys . '_id'])) {
$this->buildCustom($this->_values['additional_custom_' . $keys . '_id'], 'additionalCustom' . ucfirst($keys), TRUE);
}
foreach (array(
'first_name',
- 'last_name'
+ 'last_name',
) as $name) {
if (array_key_exists($name, $$keys) &&
CRM_Utils_Array::value('is_required', CRM_Utils_Array::value($name, $$keys))
if ($this->_requireApproval) {
$statusMessage = ts("It looks like you are now registering a group of %1 participants. The event has %2 available spaces (you will not be wait listed). Registration for this event requires approval. You will receive an email once your registration has been reviewed.", array(
1 => ++$processedCnt,
- 2 => $spaces
+ 2 => $spaces,
));
}
else {
$statusMessage = ts("It looks like you are now registering a group of %1 participants. The event has %2 available spaces (you will not be wait listed).", array(
1 => ++$processedCnt,
- 2 => $spaces
+ 2 => $spaces,
));
}
}
else {
$statusMessage = ts("It looks like you are now registering a group of %1 participants. The event has %2 available spaces (you will not be wait listed). Please go back to the main registration page and reduce the number of additional people. You will also need to complete payment information.", array(
1 => ++$processedCnt,
- 2 => $spaces
+ 2 => $spaces,
));
$allowToProceed = FALSE;
}
'name' => ts('Skip Participant'),
'subName' => 'skip',
'icon' => 'seek-next',
- )
+ ),
)
);
}
) {
$errors['_qf_default'] = ts('It looks like event has only %2 seats available and you are trying to register %1 participants, so could you please select price options accordingly.', array(
1 => $totalParticipants,
- 2 => $self->_availableRegistrations
+ 2 => $self->_availableRegistrations,
));
}
}
*
* @param bool $isButtonJs
*
- * @return boolean
+ * @return bool
* ture on success.
*/
public function isLastParticipant($isButtonJs = FALSE) {
/**
* Reset values for all options those are full.
*
- **/
+ */
public function resetElementValue($optionFullIds = array()) {
if (!is_array($optionFullIds) ||
empty($optionFullIds) ||
foreach (array(
'constantValues',
'submitValues',
- 'defaultValues'
+ 'defaultValues',
) as $val) {
$values = &$this->{"_$val"};
if (!is_array($values) || empty($values)) {
// add this event's default participant role to defaults array
// (for cases where participant_role field is included in form via profile)
if ($this->_values['event']['default_role_id']) {
- $this->_defaults['participant_role'] =
- $this->_defaults['participant_role_id'] = $this->_values['event']['default_role_id'];
+ $this->_defaults['participant_role']
+ = $this->_defaults['participant_role_id'] = $this->_values['event']['default_role_id'];
}
if ($this->_priceSetId && !empty($this->_feeBlock)) {
foreach ($this->_feeBlock as $key => $val) {
$dbTotalCount = CRM_Utils_Array::value($optId, $recordedOptionsCount, 0);
$currentTotalCount = CRM_Utils_Array::value($optId, $currentOptionsCount, 0);
-
$totalCount = $currentTotalCount + $dbTotalCount;
$isFull = FALSE;
if ($maxValue &&
self::$_tabLinks = array();
}
if (!isset(self::$_tabLinks[$cacheKey])) {
- self::$_tabLinks[$cacheKey]['settings'] =
- array(
+ self::$_tabLinks[$cacheKey]['settings']
+ = array(
'title' => ts('Info and Settings'),
'url' => 'civicrm/event/manage/settings',
'field' => 'id',
);
- self::$_tabLinks[$cacheKey]['location'] =
- array(
+ self::$_tabLinks[$cacheKey]['location']
+ = array(
'title' => ts('Location'),
'url' => 'civicrm/event/manage/location',
'field' => 'loc_block_id',
);
- self::$_tabLinks[$cacheKey]['fee'] =
- array(
+ self::$_tabLinks[$cacheKey]['fee']
+ = array(
'title' => ts('Fees'),
'url' => 'civicrm/event/manage/fee',
'field' => 'is_monetary',
);
- self::$_tabLinks[$cacheKey]['registration'] =
- array(
+ self::$_tabLinks[$cacheKey]['registration']
+ = array(
'title' => ts('Online Registration'),
'url' => 'civicrm/event/manage/registration',
'field' => 'is_online_registration',
);
+
if (CRM_Core_Permission::check('administer CiviCRM')) {
- self::$_tabLinks[$cacheKey]['reminder'] =
- array(
+ self::$_tabLinks[$cacheKey]['reminder']
+ = array(
'title' => ts('Schedule Reminders'),
'url' => 'civicrm/event/manage/reminder',
'field' => 'reminder',
);
}
- self::$_tabLinks[$cacheKey]['conference'] =
- array(
+ self::$_tabLinks[$cacheKey]['conference']
+ = array(
'title' => ts('Conference Slots'),
'url' => 'civicrm/event/manage/conference',
'field' => 'slot_label_id',
);
- self::$_tabLinks[$cacheKey]['friend'] =
- array(
+ self::$_tabLinks[$cacheKey]['friend']
+ = array(
'title' => ts('Tell a Friend'),
'url' => 'civicrm/event/manage/friend',
'field' => 'friend',
);
- self::$_tabLinks[$cacheKey]['pcp'] =
- array(
+ self::$_tabLinks[$cacheKey]['pcp']
+ = array(
'title' => ts('Personal Campaign Pages'),
'url' => 'civicrm/event/manage/pcp',
'field' => 'is_pcp_enabled',
);
- self::$_tabLinks[$cacheKey]['repeat'] =
- array(
+ self::$_tabLinks[$cacheKey]['repeat']
+ = array(
'title' => ts('Repeat'),
'url' => 'civicrm/event/manage/repeat',
'field' => 'is_repeating_event',
);
-
}
if (!$enableCart) {
}
public function search() {
- if (isset($this->_action) &
- (CRM_Core_Action::ADD |
+ if (isset($this->_action) & (CRM_Core_Action::ADD |
CRM_Core_Action::UPDATE |
CRM_Core_Action::DELETE
)
*
* @return void
*/
- function preProcess() {
+ public function preProcess() {
self::preProcessCommon($this);
}
*
* @param int $action
*
- * @return Array
+ * @return array
* array of contact_id of all related contacts.
*/
public static function checkMembershipRelationship($membershipId, $contactId, $action = CRM_Core_Action::ADD) {
* Membership id that needs to be deleted.
*
*
- * @return $results no of deleted Membership on success, false otherwise
+ * @return int $results id of deleted Membership on success, false otherwise
*/
public static function del($membershipId) {
//delete related first and then delete parent.
* Membership id that needs to be deleted.
*
*
- * @return $results no of deleted Membership on success, false otherwise
+ * @return int $results id of deleted Membership on success, false otherwise
*/
public static function deleteMembership($membershipId) {
// CRM-12147, retrieve membership data before we delete it for hooks
*/
public static function deleteRelatedMemberships($ownerMembershipId, $contactId = NULL) {
if (!$ownerMembershipId && !$contactId) {
- return;
+ return FALSE;
}
$membership = new CRM_Member_DAO_Membership();
* Is this a separate membership payment
*
*/
- static function buildMembershipBlock(
+ public static function buildMembershipBlock(
&$form,
$pageID,
$cid,
* @throws CRM_Core_Exception
*
*/
- static function renewMembershipFormWrapper(
+ public static function renewMembershipFormWrapper(
$contactID,
$membershipTypeID,
$is_test,
if ($reset) {
// not sure why a static var is in use here - we need a way to reset it from the test suite
$relatedContactIds = array();
- return;
+ return FALSE;
}
$membership = new CRM_Member_DAO_Membership();
CRM_Member_BAO_Membership::create($params, $relMemIds);
$available--;
}
- else { // we have run out of inherited memberships, so delete extras
+ else {
+ // we have run out of inherited memberships, so delete extras
self::deleteMembership($params['id']);
}
// we need to first check if there will remain inherited memberships, so queue it up
*
* @param int $membershipId
*
- * @return boolean
- * true if deleted false otherwise
+ * @return object
+ * $membershipPayment deleted membership payment object
*/
public static function deleteMembershipPayment($membershipId) {
- $membesrshipPayment = new CRM_Member_DAO_MembershipPayment();
- $membesrshipPayment->membership_id = $membershipId;
- $membesrshipPayment->find();
+ $membershipPayment = new CRM_Member_DAO_MembershipPayment();
+ $membershipPayment->membership_id = $membershipId;
+ $membershipPayment->find();
- while ($membesrshipPayment->fetch()) {
- CRM_Contribute_BAO_Contribution::deleteContribution($membesrshipPayment->contribution_id);
- CRM_Utils_Hook::pre('delete', 'MembershipPayment', $membesrshipPayment->id, $membesrshipPayment);
+ while ($membershipPayment->fetch()) {
+ CRM_Contribute_BAO_Contribution::deleteContribution($membershipPayment->contribution_id);
+ CRM_Utils_Hook::pre('delete', 'MembershipPayment', $membershipPayment->id, $membershipPayment);
$membesrshipPayment->delete();
- CRM_Utils_Hook::post('delete', 'MembershipPayment', $membesrshipPayment->id, $membesrshipPayment);
+ CRM_Utils_Hook::post('delete', 'MembershipPayment', $membershipPayment->id, $membershipPayment);
}
- return $membesrshipPayment;
+ return $membershipPayment;
}
/**
*
* @param bool $isNotCancelled
*
- * @return boolean
+ * @return bool
*/
public static function isCancelSubscriptionSupported($mid, $isNotCancelled = TRUE) {
$cacheKeyString = "$mid";
*
* @return mixed
*/
-
public static function del($membershipID) {
$membershipLog = new CRM_Member_DAO_MembershipLog();
$membershipLog->membership_id = $membershipID;
'start_date',
'end_date',
'registration_start_date',
- 'registration_end_date'
+ 'registration_end_date',
)
);
}
* @param bool $stateName
* This parameter currently has no function.
*
- * @return boolean
+ * @return bool
* true if we modified the address, false otherwise
*/
public static function format(&$values, $stateName = FALSE) {
$add = 'q=' . urlencode('select * from geo.placefinder where ');
- $add .= join(urlencode(' and '), $whereComponents);
+ $add .= implode(urlencode(' and '), $whereComponents);
$add .= "&appid=" . urlencode($config->mapAPIKey);
*
* @return void
*/
- static function add(
+ public static function add(
$title,
$url,
$id,
* Convert a display name into a potential variable
* name that we could use in forms/code
*
- * @param name Name of the string
- *
+ * @param $title title of the string
* @param int $maxLength
*
* @return string
* @param bool $utf8
* Attempt utf8 match on failure (default yes).
*
- * @return boolean
+ * @return bool
* true if string is ascii
*/
public static function isAscii($str, $utf8 = TRUE) {
* @param string $str
* Input string.
*
- * @return boolean
+ * @return bool
*/
public static function isUtf8($str) {
if (!function_exists(mb_detect_encoding)) {
* @param string $url2
* The second url to be matched against.
*
- * @return boolean
+ * @return bool
* true if the urls match, else false
*/
public static function match($url1, $url2) {
* @param string $str
* The string to be translated.
*
- * @return boolean
+ * @return bool
*/
public static function strtobool($str) {
if (!is_scalar($str)) {
* @param string $str
* The string to be translated.
*
- * @return boolean
+ * @return bool
*/
public static function strtoboolstr($str) {
if (!is_scalar($str)) {
* @return string
* the sanitized string
*/
- static function stripPathChars(
+ public static function stripPathChars(
$string,
$search = NULL,
$replace = NULL
* @param bool $case
* Boolean indicating whether you want the comparison to be case sensitive or not.
*
- * @return boolean
+ * @return bool
* TRUE (string are identical); FALSE (strings are not identical)
*/
public static function compareStr($strOne, $strTwo, $case) {
* (because most other odd characters are %-escaped in URLs; and %-escaped
* strings don't need any extra escaping in HTML).
*
- * @param string $url
+ * @param string $htmlUrl
* URL with HTML entities.
* @return string
* URL without HTML entities
$activityStatusGroup = civicrm_api3('option_group', 'get', array('name' => 'activity_status'));
$activityStatus = array(
'name' => $status,
- 'option_group_id' => $activityStatusGroup['id']
+ 'option_group_id' => $activityStatusGroup['id'],
);
$activityStatusID = civicrm_api3('option_value', 'get', $activityStatus);
$activityStatusID = $activityStatusID['values'][$activityStatusID['id']]['value'];
*
* @return array
*
- * {@getfields Job_create}
+ * {@getfields Job_create}
*/
function civicrm_api3_job_create($params) {
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
* input parameters
* @return array
*
- * {@getfields email_get}
+ * {@getfields email_get}
*/
function civicrm_api3_job_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
* @return array
* API Result Array
*/
-function civicrm_api3_job_execute(/** @noinspection PhpUnusedParameterInspection */
- $params) {
+function civicrm_api3_job_execute($params) {
+ // @noinspection PhpUnusedParameterInspection
+
$facility = new CRM_Core_JobManager();
$facility->execute(FALSE);
* @return bool
* true if success, else false
*/
-function civicrm_api3_job_process_membership(/** @noinspection PhpUnusedParameterInspection */
- $params) {
+function civicrm_api3_job_process_membership($params) {
$lock = new CRM_Core_Lock('civimail.job.updateMembership');
if (!$lock->isAcquired()) {
return civicrm_api3_create_error('Could not acquire lock, another Membership Processing process is running');
);
$params['mode'] = array(
'title' => 'Mode',
- 'description' => 'helps decide how to behave when there are conflicts.
- A \'safe\' value skips the merge if there are no conflicts.
- Does a force merge otherwise.',
+ 'description' => 'helps decide how to behave when there are conflicts. A \'safe\' value skips the merge if there are no conflicts. Does a force merge otherwise.',
'type' => CRM_Utils_Type::T_STRING,
);
$params['auto_flip'] = array(
* @return array
* @throws \API_Exception
*/
-function civicrm_api3_job_disable_expired_relationships(/** @noinspection PhpUnusedParameterInspection */
- $params) {
+function civicrm_api3_job_disable_expired_relationships($params) {
+ /** @noinspection PhpUnusedParameterInspection */
$result = CRM_Contact_BAO_Relationship::disableExpiredRelationships();
if (!$result) {
throw new API_Exception('Failed to disable all expired relationships.');
*
* @return array
* API result array
- * {@getfields UFGroup_create}
+ * {@getfields UFGroup_create}
* @example UFGroupCreate.php
*/
function civicrm_api3_uf_group_create($params) {
*
* @return array
* Array of matching profiles
- * {@getfields UFGroup_get}
+ * {@getfields UFGroup_get}
* @example UFGroupGet.php
*/
function civicrm_api3_uf_group_get($params) {
* in order to correct the condition where a contribution row is linked to > 1 membership.
*/
+/**
+ * Initialization
+ */
function initialize() {
session_start();
if (!function_exists('drush_get_context')) {
/**
* @param $formValues
*/
- function __construct(&$formValues) {
+ public function __construct(&$formValues) {
parent::__construct($formValues);
}
* Modifiable.
* @return void
*/
- function buildForm(&$form) {
+ public function buildForm(&$form) {
CRM_Utils_System::setTitle(ts('My Search Title'));
$form->add('text',
* - summary: string
* - total: numeric
*/
- function summary() {
+ public function summary() {
return NULL;
// return array(
// 'summary' => 'This is a summary',
*
* @return array, keys are printable column headers and values are SQL column names
*/
- function &columns() {
+ public function &columns() {
// return by reference
$columns = array(
ts('Contact ID') => 'contact_id',
*
* @return string, sql
*/
- function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE) {
+ public function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE) {
// delegate to $this->sql(), $this->select(), $this->from(), $this->where(), etc.
return $this->sql($this->select(), $offset, $rowcount, $sort, $includeContactIDs, NULL);
}
*
* @return string, sql fragment with SELECT arguments
*/
- function select() {
+ public function select() {
return "
contact_a.id as contact_id ,
contact_a.contact_type as contact_type,
*
* @return string, sql fragment with FROM and JOIN clauses
*/
- function from() {
+ public function from() {
return "
FROM civicrm_contact contact_a
LEFT JOIN civicrm_address address ON ( address.contact_id = contact_a.id AND
*
* @return string, sql fragment with conditional expressions
*/
- function where($includeContactIDs = FALSE) {
+ public function where($includeContactIDs = FALSE) {
$params = array();
$where = "contact_a.contact_type = 'Household'";
*
* @return string, template path (findable through Smarty template path)
*/
- function templateFile() {
+ public function templateFile() {
return 'CRM/Contact/Form/Search/Custom.tpl';
}
* Modifiable SQL result row.
* @return void
*/
- function alterRow(&$row) {
+ public function alterRow(&$row) {
$row['sort_name'] .= ' ( altered )';
}
*/
private static function getInstance() {
if (is_null(self::$instance)) {
- self::$instance = new self;
+ self::$instance = new CiviTestSuite();
}
return self::$instance;
}
CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_PRE_COMMIT, array($this, '_preCommit'), array(
'qwe',
- 'rty'
+ 'rty',
));
CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_POST_COMMIT, array($this, '_postCommit'), array(
'uio',
- 'p[]'
+ 'p[]',
));
CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_PRE_ROLLBACK, array(
$this,
- '_preRollback'
+ '_preRollback',
), array('asd', 'fgh'));
CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_POST_ROLLBACK, array(
$this,
- '_postRollback'
+ '_postRollback',
), array('jkl', ';'));
CRM_Core_DAO::executeQuery('UPDATE civicrm_contact SET id = 100 WHERE id = 100');
CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_PRE_COMMIT, array($this, '_preCommit'), array(
'ewq',
- 'ytr'
+ 'ytr',
));
CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_POST_COMMIT, array($this, '_postCommit'), array(
'oiu',
- '][p'
+ '][p',
));
CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_PRE_ROLLBACK, array(
$this,
- '_preRollback'
+ '_preRollback',
), array('dsa', 'hgf'));
CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_POST_ROLLBACK, array(
$this,
- '_postRollback'
+ '_postRollback',
), array('lkj', ';'));
CRM_Core_DAO::executeQuery('UPDATE civicrm_contact SET id = 100 WHERE id = 100');
* See assertContactsMix.
* @param string $outcome
* 'rollback'|'implicit-commit'|'explicit-commit' how to finish transaction.
- * @return int
- * cid
+ * @return void
*/
public function runBatch($nesting, $callbacks, $existsByOffset, $outcome) {
if ($nesting != 'reuse-tx' && $nesting != 'nest-tx') {
* @return CRM_Mailing_BAO_QueryTestDataProvider
*/
public function dataProvider() {
- return new CRM_Mailing_BAO_QueryTestDataProvider;
+ return new CRM_Mailing_BAO_QueryTestDataProvider();
}
public function setUp() {
*/
private static function getInstance() {
if (is_null(self::$instance)) {
- self::$instance = new self;
+ self::$instance = new CiviTestSuite();
}
return self::$instance;
}