'downloadDuplicateRecordsUrl',
'downloadMismatchRecordsUrl',
'groupAdditions',
- 'unMatchCount'
+ 'unMatchCount',
);
foreach ($properties as $property) {
$this->assign($property, $this->get($property));
// add select for contact type
$contactTypeA = &$this->add('select', 'contact_types_a', ts('Contact Type A') . ' ',
array(
- '' => ts('All Contacts')
+ '' => ts('All Contacts'),
) + $contactTypes
);
$contactTypeB = &$this->add('select', 'contact_types_b', ts('Contact Type B') . ' ',
array(
- '' => ts('All Contacts')
+ '' => ts('All Contacts'),
) + $contactTypes
);
}
elseif (in_array($context, array(
'dashlet',
- 'dashletFullscreen'
+ 'dashletFullscreen',
))) {
$url = CRM_Utils_System::url('civicrm/dashboard', 'reset=1');
}
*
* @return void
*/
- function preProcess() {
+ public function preProcess() {
//check for delete
if (!CRM_Core_Permission::checkActionPermission('CiviCase', CRM_Core_Action::DELETE)) {
CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
$nextGroup = $this->_getNextSiblingGroup($currentGroup);
if (!$nextGroup) {
// no sibling, find an ancestor w/ a sibling
- for (; ;) {
+ for (;;) {
// since we pop this array everytime, we should be
// reasonably safe from infinite loops, I think :)
$ancestor = array_pop($this->_parentStack);
* @param $childID
* The child id of the association.
*
- * @return boolean
+ * @return bool
* True if association is found, false otherwise.
*/
public static function isParentChild($parentID, $childID) {
* @param $groupId
* The id of the group to check for child groups.
*
- * @return boolean
+ * @return bool
* True if 1 or more child groups are found, false otherwise.
*/
public static function hasChildGroups($groupId) {
* @param $groupId
* The id of the group to check for parent groups.
*
- * @return boolean
+ * @return bool
* True if 1 or more parent groups are found, false otherwise.
*/
public static function hasParentGroups($groupId) {
* @param $checkGroupId
* The group id to check if it is a parent of the $groupIds group(s).
*
- * @return boolean
+ * @return bool
* True if $checkGroupId points to a group that is a parent of one of the $groupIds groups, false otherwise.
*/
public static function isParentGroup($groupIds, $checkGroupId) {
* @param $checkGroupId
* The group id to check if it is a child of the $groupIds group(s).
*
- * @return boolean
+ * @return bool
* True if $checkGroupId points to a group that is a child of one of the $groupIds groups, false otherwise.
*/
public static function isChildGroup($groupIds, $checkGroupId) {
* @param $checkGroupId
* The group id to check if it is an ancestor of the $groupIds group(s).
*
- * @return boolean
+ * @return bool
* True if $checkGroupId points to a group that is an ancestor of one of the $groupIds groups, false otherwise.
*/
public static function isAncestorGroup($groupIds, $checkGroupId) {
* @param $checkGroupId
* The group id to check if it is a descendent of the $groupIds group(s).
*
- * @return boolean
+ * @return bool
* True if $checkGroupId points to a group that is a descendent of one of the $groupIds groups, false otherwise.
*/
public static function isDescendentGroup($groupIds, $checkGroupId) {
'relationship_type_id',
ts('Relationship Type'),
array(
- '' => ts('- select -')
+ '' => ts('- select -'),
) +
CRM_Contact_BAO_Relationship::getRelationType("Organization"), TRUE
);
$this->assign('searchRows', $searchRows);
}
-
$this->assign('searchCount', $searchCount);
$this->assign('searchDone', $this->get('searchDone'));
$this->assign('contact_type_display', ts('Organization'));
$this->addElement('submit', $this->getButtonName('refresh'), ts('Search'), array('class' => 'crm-form-submit'));
$this->addElement('submit', $this->getButtonName('cancel'), ts('Cancel'), array('class' => 'crm-form-submit'));
-
$this->addButtons(array(
array(
'type' => 'next',
'count' => $valid,
'plural' => '%count %2 %3 relationships created',
2 => $relationship,
- 3 => $org
- ))
+ 3 => $org,
+ )),
);
if ($duplicate) {
$status[] = ts('%count was skipped because the contact is already %2 %3', array(
'count' => $duplicate,
'plural' => '%count were skipped because the contacts are already %2 %3',
2 => $relationship,
- 3 => $org
+ 3 => $org,
));
}
if ($invalid) {
$status[] = ts('%count relationship was not created because the contact is not of the right type for this relationship', array(
'count' => $invalid,
- 'plural' => '%count relationships were not created because the contact is not of the right type for this relationship'
+ 'plural' => '%count relationships were not created because the contact is not of the right type for this relationship',
));
}
$status = '<ul><li>' . implode('</li><li>', $status) . '</li></ul>';
CRM_Core_Session::setStatus($status, ts('Relationship created.', array(
'count' => $valid,
- 'plural' => 'Relationships created.'
+ 'plural' => 'Relationships created.',
)), 'success', array('expires' => 0));
}
}
if (count($this->_contactIds) > $this->_maxContacts) {
CRM_Core_Session::setStatus(ts("The maximum number of contacts you can select for Batch Update is %1. You have selected %2. Please select fewer contacts from your search results and try again.", array(
1 => $this->_maxContacts,
- 2 => count($this->_contactIds)
+ 2 => count($this->_contactIds),
)), ts('Maximum Exceeded'), 'error');
$validate = TRUE;
}
*
* @param int $productID
*/
-
public static function del($productID) {
//check dependencies
$premiumsProduct = new CRM_Contribute_DAO_PremiumsProduct();
if ($value['active']) {
if (in_array($id, array(
self::ADD,
- self::CREATE_NEW
+ self::CREATE_NEW,
))) {
$hasAccess = TRUE;
if (!CRM_Core_Permission::check('add contacts') &&
$urlArray = array(
'fullTextSearchID' => CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue',
'CRM_Contact_Form_Search_Custom_FullText', 'value', 'name'
- )
+ ),
);
self::setProperty(self::FULLTEXT_SEARCH, 'templateValues', $urlArray);
break;
'query' => 'action=add&reset=1&context=standalone',
'ref' => 'new-activity',
'title' => ts('Activity'),
- )
+ ),
));
$components = CRM_Core_Component::getEnabledComponents();
'query' => 'atype=3&action=add&reset=1&context=standalone',
'ref' => 'new-email',
'title' => ts('Email'),
- )
+ ),
));
if (CRM_Core_Permission::check('edit groups')) {
'query' => 'reset=1',
'ref' => 'new-group',
'title' => ts('Group'),
- )
+ ),
));
}
'query' => 'reset=1&action=add',
'ref' => 'new-tag',
'title' => ts('Tag'),
- )
+ ),
));
}
'path' => 'civicrm/user',
'query' => 'reset=1',
'title' => ts('My Contact Dashboard'),
- )
+ ),
);
}
// return if upgrade mode
$config = CRM_Core_Config::singleton();
if ($config->isUpgradeMode()) {
- return;
+ return NULL;
}
if (!self::getProperty($id, 'active')) {
* - PEAR_Exception(string $message, array $causes);
* - PEAR_Exception(string $message, array $causes, int $code);
*
- * @param string exception message
+ * @param string $message exception message
* @param int $code
* @param Exception $previous
*/
* the errors we expect are from the pear modules DB, DB_DataObject
* which currently use PEAR::raiseError to notify of error messages.
*
- * @param object PEAR_Error
+ * @param object $pearError PEAR_Error
*
* @return void
*/
* Outputs pre-formatted debug information. Flushes the buffers
* so we can interrupt a potential POST/redirect
*
- * @param string name of debug section
- * @param mixed reference to variables that we need a trace of
- * @param bool should we log or return the output
- * @param bool whether to generate a HTML-escaped output
- * @param bool should we check permissions before displaying output
+ * @param string $name name of debug section
+ * @param $variable mixed reference to variables that we need a trace of
+ * @param bool $log should we log or return the output
+ * @param bool $html whether to generate a HTML-escaped output
+ * @param bool $checkPermission should we check permissions before displaying output
* useful when we die during initialization and permissioning
* subsystem is not initialized - CRM-13765
*
* @see CRM_Core_Error::debug()
* @see CRM_Core_Error::debug_log_message()
*/
- static function debug_var(
+ public static function debug_var(
$variable_name,
$variable,
$print = TRUE,
* @return void
*/
public static function makeSinglelingual($retain) {
- $domain = new CRM_Core_DAO_Domain;
+ $domain = new CRM_Core_DAO_Domain();
$domain->find(TRUE);
$locales = explode(CRM_Core_DAO::VALUE_SEPARATOR, $domain->locales);
}
// lets drop all triggers first
- $logging = new CRM_Logging_Schema;
+ $logging = new CRM_Logging_Schema();
$logging->dropTriggers();
// turn subsequent tables singlelingual
*
* @return void
*/
- static function makeSinglelingualTable(
+ public static function makeSinglelingualTable(
$retain,
$table,
$class = 'CRM_Core_I18n_SchemaStructure',
$triggers = array()
) {
- $domain = new CRM_Core_DAO_Domain;
+ $domain = new CRM_Core_DAO_Domain();
$domain->find(TRUE);
$locales = explode(CRM_Core_DAO::VALUE_SEPARATOR, $domain->locales);
$queries = array_merge($queries, self::createIndexQueries(NULL, $table));
// execute the queries without i18n rewriting
- $dao = new CRM_Core_DAO;
+ $dao = new CRM_Core_DAO();
foreach ($queries as $query) {
$dao->query($query, FALSE);
}
$indices =& $class::indices();
$tables =& $class::tables();
$queries = array();
- $dao = new CRM_Core_DAO;
+ $dao = new CRM_Core_DAO();
// get all of the already existing indices
$existing = array();
foreach ($locales as $old) {
$trigger[] = "ELSEIF NEW.{$column}_{$old} IS NOT NULL THEN";
foreach (array_merge($locales, array(
- $locale
+ $locale,
)) as $loc) {
if ($loc == $old) {
continue;
foreach ($locales as $old) {
$trigger[] = "ELSEIF NEW.{$column}_{$old} IS NOT NULL THEN";
foreach (array_merge($locales, array(
- $locale
+ $locale,
)) as $loc) {
if ($loc == $old) {
continue;
/**
* @return array
*/
- static function &columns() {
+ public static function &columns() {
static $result = NULL;
if (!$result) {
$result = array(
* This function includes the IDS vendor parts and runs the
* detection routines on the request array.
*
- * @param object cake controller object
+ * @param object $args cake controller object
*
- * @return boolean
+ * @return bool
*/
public function check(&$args) {
// lets bypass a few civicrm urls from this check
static $skip = array('civicrm/admin/setting/updateConfigBackend', 'civicrm/admin/messageTemplates');
$path = implode('/', $args);
if (in_array($path, $skip)) {
- return;
+ return NULL;
}
#add request url and user agent
CRM_Core_Error::movedSiteError($configFile);
}
-
// also create the .htaccess file so we prevent the reading of the log and ini files
// via a browser, CRM-3875
CRM_Utils_File::restrictAccess($config->configAndLogDir);
*
* @param IDS_Report $result
*
- * @return boolean
+ * @return bool
*/
private function react(IDS_Report $result) {
* @param array $result
* @param int $reaction
*
- * @return boolean
+ * @return bool
*/
private function log($result, $reaction = 0) {
$ip = (isset($_SERVER['SERVER_ADDR']) &&
- $_SERVER['SERVER_ADDR'] != '127.0.0.1'
- ) ? $_SERVER['SERVER_ADDR'] : (isset($_SERVER['HTTP_X_FORWARDED_FOR']) ?
- $_SERVER['HTTP_X_FORWARDED_FOR'] :
- '127.0.0.1'
+ $_SERVER['SERVER_ADDR'] != '127.0.0.1') ? $_SERVER['SERVER_ADDR'] : (
+ isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : '127.0.0.1'
);
$data = array();
* Any GET arguments.
* @param array $pageArgs
* The page_arguments registered in the router.
- * @param array $requestArgs
- * Any parameters passed as part of this page request.
* @param bool $absolute
* Whether to return an absolute URL.
* @return string
foreach (array(
'membership',
'related_contact',
- 'onbehalf_dupe_alert'
+ 'onbehalf_dupe_alert',
) as $fld) {
if (!is_numeric($ids[$fld])) {
unset($ids[$fld]);
$ids['event'] = $privateData['eventID'];
}
else {
- list($ids['event'], $ids['participant']) =
- explode(CRM_Core_DAO::VALUE_SEPARATOR, $contribution->trxn_id);
+ list($ids['event'], $ids['participant']) = explode(CRM_Core_DAO::VALUE_SEPARATOR, $contribution->trxn_id);
}
}
case "merchant-calculation-callback":
break;
- case "new-order-notification": {
+ case "new-order-notification":
$response->SendAck($serial, FALSE);
$ipn->newOrderNotify($data[$root], $privateData, $module);
break;
- }
- case "order-state-change-notification": {
+ case "order-state-change-notification":
$response->SendAck($serial, FALSE);
$new_financial_state = $data[$root]['new-financial-order-state']['VALUE'];
$new_fulfillment_order = $data[$root]['new-fulfillment-order-state']['VALUE'];
break;
}
break;
- }
- case "authorization-amount-notification": {
+ case "authorization-amount-notification":
$response->SendAck($serial, FALSE);
$new_financial_state = $data[$root]['order-summary']['financial-order-state']['VALUE'];
$new_fulfillment_order = $data[$root]['order-summary']['fulfillment-order-state']['VALUE'];
break;
}
break;
- }
case "charge-amount-notification":
case "chargeback-amount-notification":
/**
* Set variables up before form is built
*
- * @param null
*
* @return void
*/
* add the rules (mainly global rules) for form.
* All local rules are added near the element
*
- * @param null
*
* @return void
* @see valid_date
/**
* Build the form object
*
- * @param null
*
* @return void
*/
if ($main == 'Relationship') {
$relName = self::getFormattedList($sel2[$main]);
$sel2[$main] = array(
- '' => ts("- Any -")
- ) + $relName;
+ '' => ts("- Any -"),
+ ) + $relName;
}
else {
$sel2[$main] = array(
- '' => ts("- Any -")
- ) + $sel2[$main];
+ '' => ts("- Any -"),
+ ) + $sel2[$main];
}
}
}
$contactSubTypes[$key] = $key;
}
$sel2['Contact'] = array(
- "" => "-- Any --"
- ) + $contactSubTypes;
+ "" => "-- Any --",
+ ) + $contactSubTypes;
}
else {
if (!isset($this->_id)) {
* Set default values for the form. Note that in edit/view mode
* the default values are retrieved from the database
*
- * @param null
*
* @return array
* array of default values
/**
* Process the form
*
- * @param null
*
* @return void
*/
$url = CRM_Utils_System::url('civicrm/event/view_cart');
CRM_Utils_System::setUFMessage(ts("<b>%1</b> has been added to your cart. <a href='%2'>View your cart.</a>", array(
1 => $event_in_cart->event->title,
- 2 => $url
+ 2 => $url,
)));
$transaction->commit();
/**
* List participations for the UF user
*
- * @return null
*/
public function listParticipations() {
$controller = new CRM_Core_Controller_Simple(
* the main function that is called when the page
* loads, it decides the which action has to be taken for the page.
*
- * @return null
*/
public function run() {
parent::preProcess();
*
* @return \CRM_Grant_Selector_Search
*/
- function __construct(
+ public function __construct(
&$queryParams,
$action = CRM_Core_Action::NONE,
$grantClause = NULL,
$status = ts('Mailing is not forwarded to the given email address.', array(
'count' => count($emails),
- 'plural' => 'Mailing is not forwarded to the given email addresses.'
+ 'plural' => 'Mailing is not forwarded to the given email addresses.',
));
if ($forwarded) {
$status = ts('Mailing is forwarded successfully to %count email address.', array(
'count' => $forwarded,
- 'plural' => 'Mailing is forwarded successfully to %count email addresses.'
+ 'plural' => 'Mailing is forwarded successfully to %count email addresses.',
));
}
* @param $files
* @param $self
*
- * @return boolean
+ * @return bool
* True if either we deliver immediately, or the
* date is properly set.
*/
* @return mixed
* @throws Exception
*/
- function run(
+ public function run(
$fileName,
$seperator = ',',
&$mapper,
* Given a list of the importable field keys that the user has selected
* set the active fields array to this list
*
- * @param array mapped array of values
+ * @param array $fieldKeys mapped array of values
*
* @return void
*/
/**
* Ideally this function should include fields that are displayed in the selector
*/
- static function defaultReturnProperties(
+ public static function defaultReturnProperties(
$mode,
$includeCustomFields = TRUE
) {
'type' => CRM_Utils_Type::T_INT,
'operatorType' => CRM_Report_Form::OP_SELECT,
'options' => array(
- '' => ts('- any interviewer -'),
- ) + $allSurveyInterviewers,
+ '' => ts('- any interviewer -'),
+ ) + $allSurveyInterviewers,
),
),
'grouping' => 'survey-interviewer-fields',
//apply survey activity types filter.
$surveyActivityTypes = CRM_Campaign_BAO_Survey::getSurveyActivityType();
if (!empty($surveyActivityTypes)) {
- $clauses[] =
- "( {$this->_aliases['civicrm_activity']}.activity_type_id IN ( " .
+ $clauses[] = "( {$this->_aliases['civicrm_activity']}.activity_type_id IN ( " .
implode(' , ', array_keys($surveyActivityTypes)) . ' ) )';
}
//get the data per page.
$dataPerPage[$pageCnt][] = $row;
$lastStreetName = CRM_Utils_Array::value('civicrm_address_street_name', $row);
- $lastStreetNum =
- CRM_Utils_Array::value('civicrm_address_street_number', $row) % 2;
+ $lastStreetNum = CRM_Utils_Array::value('civicrm_address_street_number', $row) % 2;
}
foreach ($dataPerPage as $page) {
foreach ($responseFields as $key => $value) {
if (substr($key, 0, 5) == 'phone' && !empty($value['location_type_id'])) {
$fName = str_replace('-', '_', $key);
- $this->_columns["civicrm_{$fName}"] =
- array(
- 'dao' => 'CRM_Core_DAO_Phone',
- 'alias' => "phone_civireport_{$fName}",
- 'fields' => array(
- $fName => array_merge($value, array(
- 'is_required' => '1',
- 'alias' => "phone_civireport_{$fName}",
- 'dbAlias' => "phone_civireport_{$fName}.phone",
- 'no_display' => TRUE,
- )
- ),
+ $this->_columns["civicrm_{$fName}"] = array(
+ 'dao' => 'CRM_Core_DAO_Phone',
+ 'alias' => "phone_civireport_{$fName}",
+ 'fields' => array(
+ $fName => array_merge($value, array(
+ 'is_required' => '1',
+ 'alias' => "phone_civireport_{$fName}",
+ 'dbAlias' => "phone_civireport_{$fName}.phone",
+ 'no_display' => TRUE,
+ )
),
- );
+ ),
+ );
$this->_aliases["civicrm_phone_{$fName}"] = $this->_columns["civicrm_{$fName}"]['alias'];
$this->_locationBasedPhoneField = TRUE;
}
'htmlType' => $response->html_type,
'required' => TRUE,
'alias' => ($response->data_type == 'ContactReference') ? $this->_columns[$resTable]['alias'] .
- '_contact' : $this->_columns[$resTable]['alias'],
+ '_contact' : $this->_columns[$resTable]['alias'],
'dbAlias' => $this->_columns[$resTable]['alias'] . '.' .
- $response->column_name,
+ $response->column_name,
'no_display' => TRUE,
'isSurveyResponseField' => TRUE,
);
foreach ($rows as $key => &$row) {
if (!isset($isDeleted[$row['log_civicrm_entity_altered_contact_id']])) {
- $isDeleted[$row['log_civicrm_entity_altered_contact_id']] =
- CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $row['log_civicrm_entity_altered_contact_id'], 'is_deleted') !== '0';
+ $isDeleted[$row['log_civicrm_entity_altered_contact_id']] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact',
+ $row['log_civicrm_entity_altered_contact_id'], 'is_deleted') !== '0';
}
if (!empty($row['log_civicrm_entity_altered_contact']) &&
!$isDeleted[$row['log_civicrm_entity_altered_contact_id']]
) {
- $row['log_civicrm_entity_altered_contact_link'] =
- CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $row['log_civicrm_entity_altered_contact_id']);
+ $row['log_civicrm_entity_altered_contact_link'] = CRM_Utils_System::url('civicrm/contact/view',
+ 'reset=1&cid=' . $row['log_civicrm_entity_altered_contact_id']);
$row['log_civicrm_entity_altered_contact_hover'] = ts("Go to contact summary");
$entity = $this->getEntityValue($row['log_civicrm_entity_id'], $row['log_civicrm_entity_log_type'], $row['log_civicrm_entity_log_date']);
if ($entity) {
'contact/log',
'activitySummary',
'case/timespent',
- 'case/summary'
+ 'case/summary',
);
$instances = CRM_Core_DAO::executeQuery("SELECT id, form_values, report_id FROM civicrm_report_instance WHERE report_id IN ('" . implode("','", $modifiedReportIds) . "')");
*/
public function upgrade_3_4_beta3($rev) {
// do the regular upgrade
- $upgrade = new CRM_Upgrade_Form;
+ $upgrade = new CRM_Upgrade_Form();
$upgrade->processSQL($rev);
if ($upgrade->multilingual) {
'Contact',
'Individual',
'Organization',
- 'Household'
+ 'Household',
);
while ($ufGroups->fetch()) {
if (!in_array($ufGroups->group_type, $skipGroupTypes)) {
CRM_Core_DAO::executeQuery($query);
}
- $upgrade = new CRM_Upgrade_Form;
+ $upgrade = new CRM_Upgrade_Form();
$upgrade->processSQL($rev);
}
'event_start_date_from',
'event_start_date_to',
'event_end_date_from',
- 'event_end_date_to'
+ 'event_end_date_to',
);
foreach ($eventDates as $date) {
if (isset($formValues[$date]) && $formValues[$date] == ' ') {
WHERE v.option_group_id = g.id
AND g.name = %1
AND g.is_active = 1
- AND v.name = %2", array(
+ AND v.name = %2",
+ array(
1 => array('activity_type', 'String'),
2 => array('Bulk Email', 'String'),
));
* <p>.
* An offset to check for.
* </p>
- * @return boolean
+ * @return bool
* true on success or false on failure.
- * </p>
- * <p>
- * The return value will be casted to boolean if non-boolean was returned.
+ * </p>
+ * <p>
+ * The return value will be casted to boolean if non-boolean was returned.
*/
public function offsetExists($offset) {
return array_key_exists($offset, $this->data);
* @link http://php.net/manual/en/iteratoraggregate.getiterator.php
* @return Traversable
* An instance of an object implementing <b>Iterator</b> or
- * <b>Traversable</b>
+ * <b>Traversable</b>
*/
public function getIterator() {
return new ArrayIterator($this->data);
* @link http://php.net/manual/en/countable.count.php
* @return int
* The custom count as an integer.
- * </p>
- * <p>
- * The return value is cast to an integer.
+ * </p>
+ * <p>
+ * The return value is cast to an integer.
*/
public function count() {
return count($this->data);
$params[$paramName] = (string) $params[$paramName];
}
}
- else { // $paramName is not included or ===NULL
+ else {// $paramName is not included or ===NULL
$params[$paramName] = '';
}
$message['payload'][$paramName] = $params[$paramName];
}
/**
- * @param string dir base civicrm directory
+ * @param string $dir base civicrm directory
* Return default Site Settings
* @return array
* array
- * - $url, (Joomla - non admin url)
- * - $siteName,
- * - $siteRoot
+ * - $url, (Joomla - non admin url)
+ * - $siteName,
+ * - $siteRoot
*/
public function getDefaultSiteSettings($dir) {
$config = CRM_Core_Config::singleton();
/**
* Check if a resource url is within the drupal directory and format appropriately
*
- * @param url (reference)
+ * @param $url (reference)
*
* @return bool
* TRUE for internal paths, FALSE for external. The drupal_add_js fn is able to add js more
* @return string
* an HTML string containing a link to the given path.
*/
- function url(
+ public function url(
$path = NULL, $query = NULL, $absolute = FALSE,
$fragment = NULL, $htmlize = TRUE,
$frontend = FALSE, $forceBackend = FALSE
if (CRM_Core_Session::singleton()
->get('userID') == $contactID || CRM_Core_Permission::checkAnyPerm(array(
'cms:administer users',
- 'cms:view user account'
+ 'cms:view user account',
))
) {
return CRM_Utils_System::url('user/' . $uid);
* e.g. for drupal: records a watchdog message about the new session, saves the login timestamp,
* calls hook_user op 'login' and generates a new session.
*
- * @param array params
+ * @param array $params
*
* FIXME: Document values accepted/required by $params
*/
/**
* Find any extra listeners declared in XML and pass the event along to them
*
- * @param Event\CaseChangeEvent $event
+ * @param \Civi\CCase\Event\CaseChangeEvent $event
*/
public static function delegateToXmlListeners(\Civi\CCase\Event\CaseChangeEvent $event) {
$p = new \CRM_Case_XMLProcessor_Process();
/**
* @param array $config API configuration.
*/
- function __construct($config = NULL) {
+ public function __construct($config = NULL) {
$this->local = TRUE;
$this->input = array();
$this->lastResult = array();
* @param array $params
* @return \stdClass
*/
- function remoteCall($entity, $action, $params = array()) {
+ public function remoteCall($entity, $action, $params = array()) {
$fields = "key={$this->key}&api_key={$this->api_key}";
$query = $this->uri . "&entity=$entity&action=$action";
foreach ($params as $k => $v) {
$result = curl_exec($ch);
// CiviCRM expects to get back a CiviCRM error object.
if (curl_errno($ch)) {
- $res = new stdClass;
+ $res = new stdClass();
$res->is_error = 1;
$res->error_message = curl_error($ch);
$res->level = "cURL";
$result = file_get_contents($query . '&' . $fields);
}
if (!$res = json_decode($result)) {
- $res = new stdClass;
+ $res = new stdClass();
$res->is_error = 1;
$res->error_message = 'Unable to parse returned JSON';
$res->level = 'json_decode';
*
* @return bool
*/
- function call($entity, $action = 'Get', $params = array()) {
+ public function call($entity, $action = 'Get', $params = array()) {
if (is_int($params)) {
$params = array('id' => $params);
}
/**
* Helper method for long running programs (eg bots).
*/
- function ping() {
+ public function ping() {
global $_DB_DATAOBJECT;
foreach ($_DB_DATAOBJECT['CONNECTIONS'] as & $c) {
if (!$c->connection->ping()) {
* Return the last error message.
* @return string
*/
- function errorMsg() {
+ public function errorMsg() {
return $this->lastResult->error_message;
}
/**
* Initialize
*/
- function init() {
+ public function init() {
CRM_Core_DAO::init($this->cfg->dsn);
}
* @param $start
* @param $end
*/
- static
- function paypal($paymentProcessor, $paymentMode, $start, $end) {
+ public static function paypal($paymentProcessor, $paymentMode, $start, $end) {
$url = "{$paymentProcessor['url_api']}nvp";
$keyArgs = array(
// details about a transaction, let's make sure that it doesn't
// already exist in the database.
require_once 'CRM/Contribute/DAO/Contribution.php';
- $dao = new CRM_Contribute_DAO_Contribution;
+ $dao = new CRM_Contribute_DAO_Contribution();
$dao->trxn_id = $value;
if ($dao->find(TRUE)) {
preg_match('/(\d+)$/', $name, $matches);
* @param $start
* @param $end
*/
- static
- function google($paymentProcessor, $paymentMode, $start, $end) {
+ public static function google($paymentProcessor, $paymentMode, $start, $end) {
require_once "CRM/Contribute/BAO/Contribution/Utils.php";
require_once 'CRM/Core/Payment/Google.php';
$nextPageToken = TRUE;
$response[1][$response[0]]['notifications']['charge-amount-notification'][] = $chrgAmt;
}
- foreach ($response[1][$response[0]]['notifications']['charge-amount-notification']
- as $amtData
- ) {
+ foreach ($response[1][$response[0]]['notifications']['charge-amount-notification'] as $amtData) {
$searchParams = array(
'order-numbers' => array($amtData['google-order-number']['VALUE']),
'notification-types' => array('risk-information', 'new-order', 'charge-amount'),
}
}
- static
- function csv() {
+ public static function csv() {
$csvFile = '/home/deepak/Desktop/crm-4247.csv';
$delimiter = ";";
$row = 1;
fclose($handle);
}
- static
- function process() {
+ public static function process() {
require_once 'CRM/Utils/Request.php';
$type = CRM_Utils_Request::retrieve('type', 'String', CRM_Core_DAO::$_nullObject, FALSE, 'csv', 'REQUEST');
*
* @return object
*/
- static function &singleton($mode = 'test', &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) {
+ public static function &singleton($mode = 'test', &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) {
$processorName = $paymentProcessor['name'];
if (self::$_singleton[$processorName] === NULL) {
self::$_singleton[$processorName] = new test_extension_manager_paymenttest();
static $counts = array();
- function install() {
+ public function install() {
self::$counts['install'] = 1 + (int) self::$counts['install'];
}
- function uninstall() {
+ public function uninstall() {
self::$counts['uninstall'] = 1 + (int) self::$counts['uninstall'];
}
- function disable() {
+ public function disable() {
self::$counts['disable'] = 1 + (int) self::$counts['disable'];
}
- function enable() {
+ public function enable() {
self::$counts['enable'] = 1 + (int) self::$counts['enable'];
}
* @param array $params
* Assoc array of input parameters for this transaction.
*
- * @return array
- * the result in an nice formatted array (or an error object)
- * @abstract
*/
- function doDirectPayment(&$params) {
+ public function doDirectPayment(&$params) {
}
- function checkConfig() {
+ public function checkConfig() {
}
}
ctrl = $controller('mailingCtrl', {$scope: scope});
}));
-
it('should check if 5 groups are there', function() {
expect(scope.cool_api.length).toBe(3);
* @param int $row
* @param string $prefix
*/
- function webtestNewDialogContact(
+ public function webtestNewDialogContact(
$fname = 'Anthony', $lname = 'Anderson', $email = 'anthony@anderson.biz',
$type = 4, $selectId = 's2id_contact_id', $row = 1, $prefix = '') {
// 4 - Individual profile
* @throws PHPUnit_Framework_AssertionFailedError
* @return int
*/
-
public function webtestAddPaymentProcessor($processorName = 'Test Processor', $processorType = 'Dummy', $processorSettings = NULL, $financialAccount = 'Deposit Bank Account') {
if (!$processorName) {
$this->fail("webTestAddPaymentProcessor requires $processorName.");
if (!$filePath) {
$filePath = '/tmp/testfile_' . substr(sha1(rand()), 0, 7) . '.txt';
$fp = @fopen($filePath, 'w');
- fputs($fp, 'Test file created by selenium test.');
+ fwrite($fp, 'Test file created by selenium test.');
@fclose($fp);
}
* @return null
* of newly created online contribution page.
*/
- function webtestAddContributionPage(
+ public function webtestAddContributionPage(
$hash = NULL,
$rand = NULL,
$pageTitle = NULL,
/**
* @return bool
*/
- static
- public function checkDoLocalDBTest() {
+ public static function checkDoLocalDBTest() {
if (defined('CIVICRM_WEBTEST_LOCAL_DB') &&
CIVICRM_WEBTEST_LOCAL_DB
) {
* @param array $match
* Associative array of field name => expected value. Empty if asserting
* that a DELETE occurred
- * @param boolean $delete
+ * @param bool $delete
* are we checking that a DELETE action occurred?
*/
public function assertDBState($daoName, $id, $match, $delete = FALSE) {
* @param bool $taxRate
* @param bool $isDefault
*/
- function _testAddFinancialAccount(
+ public function _testAddFinancialAccount(
$financialAccountTitle,
$financialAccountDescription = FALSE,
$accountingCode = FALSE,
* @param bool $taxRate
* @param bool $isDefault
*/
- function _testEditFinancialAccount(
+ public function _testEditFinancialAccount(
$editfinancialAccount,
$financialAccountTitle = FALSE,
$financialAccountDescription = FALSE,
*
* @param int $contactID
* Id of the contact to delete.
- * @return boolean
+ * @return bool
* true if contact deleted, false otherwise
*/
public static function delete($contactID) {
* Helper function to delete a participant
*
* @param int $participantId
- * @return boolean
+ * @return bool
* true if participant deleted, false otherwise
*/
public static function delete($participantId) {
'edit-2-access-all-cases-and-activities',
'edit-2-access-my-cases-and-activities',
'edit-2-administer-civicase',
- 'edit-2-delete-in-civicase'
+ 'edit-2-delete-in-civicase',
);
$this->changePermissions($permission);