$form->assign_by_ref('tabHeader', $tabs);
CRM_Core_Resources::singleton()
->addScriptFile('civicrm', 'templates/CRM/common/TabHeader.js', 1, 'html-header')
- ->addSetting(array('tabSettings' => array(
- 'active' => self::getCurrentTab($tabs),
- )));
+ ->addSetting(array(
+ 'tabSettings' => array(
+ 'active' => self::getCurrentTab($tabs),
+ ),
+ ));
return $tabs;
}
}
$tabs = array(
- 'main' => array('title' => ts('Main Information'),
+ 'main' => array(
+ 'title' => ts('Main Information'),
'link' => NULL,
'valid' => FALSE,
'active' => FALSE,
'current' => FALSE,
),
- 'questions' => array('title' => ts('Questions'),
+ 'questions' => array(
+ 'title' => ts('Questions'),
'link' => NULL,
'valid' => FALSE,
'active' => FALSE,
'current' => FALSE,
),
- 'results' => array('title' => ts('Results'),
+ 'results' => array(
+ 'title' => ts('Results'),
'link' => NULL,
'valid' => FALSE,
'active' => FALSE,
* @static
*/
public static function mergeGroupContact($mainContactId, $otherContactId) {
- $params = array(1 => array($mainContactId, 'Integer'),
+ $params = array(
+ 1 => array($mainContactId, 'Integer'),
2 => array($otherContactId, 'Integer'),
);
AND status = %2
AND contact_id IN ( $contactStr )
";
- $params = array(1 => array($groupID, 'Integer'),
+ $params = array(
+ 1 => array($groupID, 'Integer'),
2 => array($status, 'String'),
);
$tree = array();
while ($dao->fetch()) {
if (!array_key_exists($dao->child, $tree)) {
- $tree[$dao->child] = array('children' => array(),
+ $tree[$dao->child] = array(
+ 'children' => array(),
'parents' => array(),
);
}
if (!array_key_exists($dao->parent, $tree)) {
- $tree[$dao->parent] = array('children' => array(),
+ $tree[$dao->parent] = array(
+ 'children' => array(),
'parents' => array(),
);
}
/**
* This is a contructor of the class.
*/
- public function __construct() {}
+ public function __construct() {
+ }
/**
* Function is used to format the individual contact values
if (isset($params['contact_id'])) {
// process membership status for deceased contact
- $deceasedParams = array('contact_id' => CRM_Utils_Array::value('contact_id', $params),
+ $deceasedParams = array(
+ 'contact_id' => CRM_Utils_Array::value('contact_id', $params),
'is_deceased' => CRM_Utils_Array::value('is_deceased', $params, FALSE),
'deceased_date' => CRM_Utils_Array::value('deceased_date', $params, NULL),
);
*
* @return void
*/
- public static function setDefaultValues(&$form, &$defaults) {}
+ public static function setDefaultValues(&$form, &$defaults) {
+ }
}
//On-hold select
if ($multipleBulk) {
- $holdOptions = array(0 => ts('- select -'),
+ $holdOptions = array(
+ 0 => ts('- select -'),
1 => ts('On Hold Bounce'),
2 => ts('On Hold Opt Out'),
);
$className = CRM_Utils_System::getClassName($form);
if (in_array($className, array(
'CRM_Event_Form_ManageEvent_Location', 'CRM_Contact_Form_Domain'))) {
- $form->_blocks = array('Address' => ts('Address'),
+ $form->_blocks = array(
+ 'Address' => ts('Address'),
'Email' => ts('Email'),
'Phone' => ts('Phone'),
);
return array('deleteOther' => 1);
}
- public function addRules() {}
+ public function addRules() {
+ }
public function buildQuickForm() {
CRM_Utils_System::setTitle(ts('Merge %1s', array(1 => $this->_contactType)));
return TRUE;
}
- public function normalizeFormValues() {}
+ public function normalizeFormValues() {
+ }
/**
* @param $formValues
$form->addElement('select',
'operator',
ts('Search Operator'),
- array('AND' => ts('AND'),
+ array(
+ 'AND' => ts('AND'),
'OR' => ts('OR'),
)
);
$form->addElement('select',
'privacy_operator',
ts('Operator'),
- array('OR' => ts('OR'),
+ array(
+ 'OR' => ts('OR'),
'AND' => ts('AND'),
)
);
}
// set breadcrumb to return to Custom Search listings page
- $breadCrumb = array(array('title' => ts('Custom Searches'),
+ $breadCrumb = array(array(
+ 'title' => ts('Custom Searches'),
'url' => CRM_Utils_System::url('civicrm/contact/search/custom/list',
'reset=1'
),
ts('Contribution Amount') => 'donation_amount',
);
- $this->_amounts = array('min_amount_1' => ts('Min Amount One'),
+ $this->_amounts = array(
+ 'min_amount_1' => ts('Min Amount One'),
'max_amount_1' => ts('Max Amount One'),
'min_amount_2' => ts('Min Amount Two'),
'max_amount_2' => ts('Max Amount Two'),
'exclude_max_amount' => ts('Exclusion Max Amount'),
);
- $this->_dates = array('start_date_1' => ts('Start Date One'),
+ $this->_dates = array(
+ 'start_date_1' => ts('Start Date One'),
'end_date_1' => ts('End Date One'),
'start_date_2' => ts('Start Date Two'),
'end_date_2' => ts('End Date Two'),
*
* @return void
*/
- public function postProcess() {}
+ public function postProcess() {
+ }
}
*
* @return void
*/
- public function postProcess() {}
+ public function postProcess() {
+ }
/**
* Assign smarty variables to the template that will be used by google api to plot the contacts
* @param int $id
* @todo - this function is a long way, non standard of saying $dao = new CRM_Contribute_DAO_ContributionProduct(); $dao->id = $id; $dao->find();
*/
- public function assignPremiumProduct($id) { //to get Premium id
+ public function assignPremiumProduct($id) {
$sql = "
SELECT *
FROM civicrm_contribution_product
}
/**
+ * Get current currency from DB or use default currency.
+ *
* @param $submittedValues
*
* @return mixed
*/
- public function getCurrency($submittedValues) { // get current currency from DB or use default currency
+ public function getCurrency($submittedValues) {
$config = CRM_Core_Config::singleton();
$currentCurrency = CRM_Utils_Array::value('currency',
// save the changes
$result = CRM_Contribute_BAO_ContributionRecur::add($params);
$status = ts('Recurring contribution has been updated to: %1, every %2 %3(s) for %4 installments.',
- array(1 => CRM_Utils_Money::format($params['amount'], $this->_subscriptionDetails->currency),
+ array(
+ 1 => CRM_Utils_Money::format($params['amount'], $this->_subscriptionDetails->currency),
2 => $this->_subscriptionDetails->frequency_interval,
3 => $this->_subscriptionDetails->frequency_unit,
4 => $params['installments'],
*
* @return void
*/
- public function fini() {}
+ public function fini() {
+ }
}
// for each menu get their children
$navigationTree[$navigation->id] = array(
- 'attributes' => array('label' => $label,
+ 'attributes' => array(
+ 'label' => $label,
'name' => $navigation->name,
'url' => $navigation->url,
'permission' => $navigation->permission,
else {
$value = CRM_Utils_System::relativeURL($value);
}
- $sqlParams = array(1 => array($value, 'String'),
+ $sqlParams = array(
+ 1 => array($value, 'String'),
2 => array($optionName, 'String'),
3 => array($name, 'String'),
);
entity_table = 'civicrm_contact'
";
- $params = array(1 => array($id1, 'Integer'),
- 2 => array($id2, 'Integer'),
- 3 => array($cacheKey, 'String'),
+ $params = array(
+ 1 => array($id1, 'Integer'),
+ 2 => array($id2, 'Integer'),
+ 3 => array($cacheKey, 'String'),
);
$mergeId = CRM_Core_DAO::singleValueQuery($query, $params);
$where = " AND {$where}";
}
- $p = array(1 => array($mergeId, 'Integer'),
- 2 => array($cacheKey, 'String'),
+ $p = array(
+ 1 => array($mergeId, 'Integer'),
+ 2 => array($cacheKey, 'String'),
);
$sql = "SELECT pn.id, pn.entity_id1, pn.entity_id2, pn.data FROM civicrm_prevnext_cache pn {$join} ";
$wherePrev = " WHERE pn.id < %1 AND pn.cacheKey = %2 {$where} ORDER BY ID DESC LIMIT 1";
SET text_length = %1
WHERE id = %2
";
- $params = array(1 => array($length, 'Integer'),
+ $params = array(
+ 1 => array($length, 'Integer'),
2 => array($customFieldID, 'Integer'),
);
CRM_Core_DAO::executeQuery($sql, $params);
OR group_name = %2 )
AND domain_id = %3
";
- $sqlParams = array(1 => array(self::DIRECTORY_PREFERENCES_NAME, 'String'),
+ $sqlParams = array(
+ 1 => array(self::DIRECTORY_PREFERENCES_NAME, 'String'),
2 => array(self::URL_PREFERENCES_NAME, 'String'),
3 => array(CRM_Core_Config::domainID(), 'Integer'),
);
}
$sql = implode(' ', $trigger);
- $info[] = array('table' => array($table),
+ $info[] = array(
+ 'table' => array($table),
'when' => 'BEFORE',
'event' => array('UPDATE'),
'sql' => $sql,
}
$sql = implode(' ', $trigger);
- $info[] = array('table' => array($table),
+ $info[] = array(
+ 'table' => array($table),
'when' => 'BEFORE',
'event' => array('INSERT'),
'sql' => $sql,
/**
* @return array
*/
- public static function &indices()
- {
+ public static function &indices() {
static $result = NULL;
if (!$result) {
$result = array(
/**
* @return array
*/
- public static function &tables()
- {
+ public static function &tables() {
static $result = NULL;
if (!$result) {
$result = array_keys(self::columns());
/**
* @return array
*/
- public static function &columns()
- {
+ public static function &columns() {
static $result = NULL;
if (!$result) {
$result = array(
/**
* @return array
*/
- public static function &indices()
- {
+ public static function &indices() {
static $result = NULL;
if (!$result) {
$result = array(
/**
* @return array
*/
- public static function &tables()
- {
+ public static function &tables() {
static $result = NULL;
if (!$result) {
$result = array_keys(self::columns());
/**
* @return array
*/
- public static function &indices()
- {
+ public static function &indices() {
static $result = NULL;
if (!$result) {
$result = array(
/**
* @return array
*/
- public static function &tables()
- {
+ public static function &tables() {
static $result = NULL;
if (!$result) {
$result = array_keys(self::columns());
}
return $result;
}
- public static function &indices()
- {
+ public static function &indices() {
static $result = NULL;
if (!$result) {
$result = array(
}
return $result;
}
- public static function &tables()
- {
+ public static function &tables() {
static $result = NULL;
if (!$result) {
$result = array_keys(self::columns());
*
* @param void
*/
- public function __destruct() {}
+ public function __destruct() {
+ }
/**
* @param $entity
*
* @return string
*/
-function smarty_block_crmRegion($params, $content, &$smarty, &$repeat)
-{
+function smarty_block_crmRegion($params, $content, &$smarty, &$repeat) {
if ($repeat) {
return;
}
}
$participantFields = CRM_Event_DAO_Participant::fields();
- $participantParams = array('id' => CRM_Utils_Array::value('participant_id', $params),
+ $participantParams = array(
+ 'id' => CRM_Utils_Array::value('participant_id', $params),
'contact_id' => $contactID,
'event_id' => $form->_eventId ? $form->_eventId : $params['event_id'],
'status_id' => CRM_Utils_Array::value('participant_status',
*
* @return void
*/
- public function postProcess() {}
+ public function postProcess() {
+ }
/**
* Return a descriptive name for the page, used in wizard header
* @return void
* @see valid_date
*/
- public function addRules() {}
+ public function addRules() {
+ }
/**
* Set the default form values
* @return void
*/
public function buildQuickForm() {
- $deleteParticipants = array(1 => ts('Delete this participant record along with associated participant record(s).'),
+ $deleteParticipants = array(
+ 1 => ts('Delete this participant record along with associated participant record(s).'),
2 => ts('Delete only this participant record.'),
);
*
* @return void
*/
- public function fini() {}
+ public function fini() {
+ }
}
* @return array
*/
public function getUserDashboardElement() {
- return array('name' => ts('Events'),
+ return array(
+ 'name' => ts('Events'),
'title' => ts('Your Event(s)'),
'perm' => array('register for events'),
'weight' => 20,
* @return array
*/
public function registerTab() {
- return array('title' => ts('Events'),
+ return array(
+ 'title' => ts('Events'),
'id' => 'participant',
'url' => 'participant',
'weight' => 40,
* @return array
*/
public function registerAdvancedSearchPane() {
- return array('title' => ts('Events'),
+ return array(
+ 'title' => ts('Events'),
'weight' => 40,
);
}
*/
public function getActivityTypes() {
$types = array();
- $types['Event'] = array('title' => ts('Event'),
+ $types['Event'] = array(
+ 'title' => ts('Event'),
'callback' => 'CRM_Event_Page_EventInfo::run()',
);
return $types;
}
}
- $center = array('lat' => (float ) $sumLat / count($locations),
+ $center = array(
+ 'lat' => (float ) $sumLat / count($locations),
'lng' => (float ) $sumLng / count($locations),
);
- $span = array('lat' => (float )($maxLat - $minLat),
+ $span = array(
+ 'lat' => (float )($maxLat - $minLat),
'lng' => (float )($maxLng - $minLng),
);
$this->assign_by_ref('center', $center);
$this->assign('allowRegistration', $allowRegistration);
$session = CRM_Core_Session::singleton();
- $params = array('contact_id' => $session->get('userID'),
+ $params = array(
+ 'contact_id' => $session->get('userID'),
'event_id' => CRM_Utils_Array::value('id', $values['event']),
'role_id' => CRM_Utils_Array::value('default_role_id', $values['event']),
);
}
if (!$this->_isTemplate && $id) {
- $breadCrumb = array(array('title' => ts('Manage Events'),
+ $breadCrumb = array(array(
+ 'title' => ts('Manage Events'),
'url' => CRM_Utils_System::url(CRM_Utils_System::currentPath(), 'reset=1'),
));
CRM_Utils_System::appendBreadCrumb($breadCrumb);
CRM_Utils_System::resetBreadCrumb();
$breadcrumb =
array(
- array('title' => ts('Home'),
+ array(
+ 'title' => ts('Home'),
'url' => CRM_Utils_System::url()),
- array('title' => ts('CiviCRM'),
+ array(
+ 'title' => ts('CiviCRM'),
'url' => CRM_Utils_System::url('civicrm', 'reset=1')),
- array('title' => ts('View Contact'),
+ array(
+ 'title' => ts('View Contact'),
'url' => CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$this->cid}")),
- array('title' => ts('Search Results'),
+ array(
+ 'title' => ts('Search Results'),
'url' => CRM_Utils_System::url('civicrm/contact/search', "force=1")),
);
CRM_Utils_System::appendBreadCrumb($breadcrumb);
/**
* @param bool $applyLimit
*/
- public function buildQuery($applyLimit = TRUE) {}
+ public function buildQuery($applyLimit = TRUE) {
+ }
/**
* @param $sql
* @return string
* name of the file
*/
- public function getExportFileName($output = 'csv') {}
+ public function getExportFileName($output = 'csv') {
+ }
public function eventToTitle() {
static $events = NULL;
$element = &$qf->add('text', $elementName, $label,
array_merge($extra,
- array('price' => json_encode(array($optionKey, $priceVal)),
+ array(
+ 'price' => json_encode(array($optionKey, $priceVal)),
'size' => '4',
)
),
$count = CRM_Utils_Array::value('count', $opt, '');
$max_value = CRM_Utils_Array::value('max_value', $opt, '');
$priceVal = implode($seperator, array($opt[$valueFieldName] + $taxAmount, $count, $max_value));
- $extra = array('price' => json_encode(array($elementName, $priceVal)),
+ $extra = array(
+ 'price' => json_encode(array($elementName, $priceVal)),
'data-amount' => $opt[$valueFieldName],
'data-currency' => $currencyName,
);
}
$priceVal = implode($seperator, array($opt[$valueFieldName] + $taxAmount, $count, $max_value));
$check[$opId] = &$qf->createElement('checkbox', $opt['id'], NULL, $opt['label'],
- array('price' => json_encode(array($opt['id'], $priceVal)),
+ array(
+ 'price' => json_encode(array($opt['id'], $priceVal)),
'data-amount' => $opt[$valueFieldName],
'data-currency' => $currencyName,
)
$this->addFormRule(array('CRM_SMS_Form_Group', 'formRule'));
$buttons = array(
- array('type' => 'next',
+ array(
+ 'type' => 'next',
'name' => ts('Next'),
'spacing' => ' ',
'isDefault' => TRUE,
$this->addFormRule(array('CRM_SMS_Form_Schedule', 'formRule'), $this);
$buttons = array(
- array('type' => 'back',
+ array(
+ 'type' => 'back',
'name' => ts('Previous'),
),
array(
$this->addFormRule(array('CRM_SMS_Form_Upload', 'formRule'), $this);
$buttons = array(
- array('type' => 'back',
+ array(
+ 'type' => 'back',
'name' => ts('Previous'),
),
array(
$mailing->find(TRUE);
$session = CRM_Core_Session::singleton();
- $values = array('contact_id' => $session->get('userID'),
+ $values = array(
+ 'contact_id' => $session->get('userID'),
'version' => 3,
);
require_once 'api/api.php';
public function run() {
// set title and breadcrumb
CRM_Utils_System::setTitle(ts('Settings - SMS Provider'));
- $breadCrumb = array(array('title' => ts('SMS Provider'),
+ $breadCrumb = array(array(
+ 'title' => ts('SMS Provider'),
'url' => CRM_Utils_System::url('civicrm/admin/sms/provider',
'reset=1'
),
* @throws API_Exception
* @throws CiviCRM_API3_Exception
*/
-function _civicrm_api3_contact_check_params(&$params, $dupeCheck = TRUE, $dupeErrorArray = FALSE, $obsoletevalue = TRUE, $dedupeRuleGroupID = NULL)
-{
+function _civicrm_api3_contact_check_params(&$params, $dupeCheck = TRUE, $dupeErrorArray = FALSE, $obsoletevalue = TRUE, $dedupeRuleGroupID = NULL) {
switch (strtolower(CRM_Utils_Array::value('contact_type', $params))) {
case 'household':
if (!$contactId) {
//create new contact.
$contact = civicrm_api3('Contact', 'create',
- array('contact_type' => 'Individual',
+ array(
+ 'contact_type' => 'Individual',
'email' => $email,
'api.Email.get' => array('return' => 'id'),
)
$emailId = $contact['values'][$contactId]['api.Email.get']['id'];
}
civicrm_api3('MailingEventQueue', 'create',
- array('job_id' => $job['id'],
+ array(
+ 'job_id' => $job['id'],
'email_id' => $emailId,
'contact_id' => $contactId,
)
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- public function tearDown()
- {
+ public function tearDown() {
$this->quickCleanUpFinancialEntities();
$this->relationshipTypeDelete($this->_relationshipTypeId);
if ($this->callAPISuccessGetCount('membership', array('id' => $this->_membershipTypeID))) {
* We are retrieving primary here - checking the actual sql seems super prescriptive - but since the massive query object has
* so few tests detecting any change seems good here :-)
*/
- public function testSearchProfilePrimaryCityCRM14263()
- {
+ public function testSearchProfilePrimaryCityCRM14263() {
$contactID = $this->individualCreate();
CRM_Core_Config::singleton()->defaultSearchProfileID = 1;
$this->callAPISuccess('address', 'create', array('contact_id' => $contactID, 'city' => 'Cool City', 'location_type_id' => 1));