';
- $duplicateContactsLinks .= ts('One matching contact was found. ', array('count' => count($contactLinks['rows']), 'plural' => '%count matching contacts were found.
'));
+ $duplicateContactsLinks .= ts('One matching contact was found. ', array(
+ 'count' => count($contactLinks['rows']),
+ 'plural' => '%count matching contacts were found.
'
+ ));
if ($contactLinks['msg'] == 'view') {
- $duplicateContactsLinks .= ts('You can View the existing contact', array('count' => count($contactLinks['rows']), 'plural' => 'You can View the existing contacts'));
+ $duplicateContactsLinks .= ts('You can View the existing contact', array(
+ 'count' => count($contactLinks['rows']),
+ 'plural' => 'You can View the existing contacts'
+ ));
}
else {
- $duplicateContactsLinks .= ts('You can View or Edit the existing contact', array('count' => count($contactLinks['rows']), 'plural' => 'You can View or Edit the existing contacts'));
+ $duplicateContactsLinks .= ts('You can View or Edit the existing contact', array(
+ 'count' => count($contactLinks['rows']),
+ 'plural' => 'You can View or Edit the existing contacts'
+ ));
}
if ($contactLinks['msg'] == 'merge') {
// We should also get a merge link if this is for an existing contact
@@ -1160,7 +1184,6 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
$errors['_qf_default'] = $duplicateContactsLinks;
-
// let smarty know that there are duplicates
$template = CRM_Core_Smarty::singleton();
$template->assign('isDuplicate', 1);
@@ -1213,7 +1236,10 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
$buildStreetAddress = FALSE;
$parseFieldName = 'street_address';
foreach (array(
- 'street_number', 'street_name', 'street_unit') as $fld) {
+ 'street_number',
+ 'street_name',
+ 'street_unit'
+ ) as $fld) {
if (!empty($address[$fld])) {
$parseFieldName = 'street_number';
$buildStreetAddress = TRUE;
@@ -1242,9 +1268,15 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
$streetAddress = NULL;
foreach (array(
- 'street_number', 'street_number_suffix', 'street_name', 'street_unit') as $fld) {
+ 'street_number',
+ 'street_number_suffix',
+ 'street_name',
+ 'street_unit'
+ ) as $fld) {
if (in_array($fld, array(
- 'street_name', 'street_unit'))) {
+ 'street_name',
+ 'street_unit'
+ ))) {
$streetAddress .= ' ';
}
$streetAddress .= CRM_Utils_Array::value($fld, $address);
@@ -1358,12 +1390,13 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
*/
public function updateMembershipStatus($deceasedParams) {
$updateMembershipMsg = NULL;
- $contactId = CRM_Utils_Array::value('contact_id', $deceasedParams);
- $deceasedDate = CRM_Utils_Array::value('deceased_date', $deceasedParams);
+ $contactId = CRM_Utils_Array::value('contact_id', $deceasedParams);
+ $deceasedDate = CRM_Utils_Array::value('deceased_date', $deceasedParams);
// process to set membership status to deceased for both active/inactive membership
if ($contactId &&
- $this->_contactType == 'Individual' && !empty($deceasedParams['is_deceased'])) {
+ $this->_contactType == 'Individual' && !empty($deceasedParams['is_deceased'])
+ ) {
$session = CRM_Core_Session::singleton();
$userId = $session->get('userID');
@@ -1390,7 +1423,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
$dao->whereAdd("status_id != $deceasedStatusId");
$dao->find();
$activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, FALSE, FALSE, 'name');
- $allStatus = CRM_Member_PseudoConstant::membershipStatus();
+ $allStatus = CRM_Member_PseudoConstant::membershipStatus();
$memCount = 0;
while ($dao->fetch()) {
// update status to deceased (for both active/inactive membership )
diff --git a/CRM/Contact/Form/CustomData.php b/CRM/Contact/Form/CustomData.php
index 9e805a5a51..6334991867 100644
--- a/CRM/Contact/Form/CustomData.php
+++ b/CRM/Contact/Form/CustomData.php
@@ -102,6 +102,7 @@ class CRM_Contact_Form_CustomData extends CRM_Core_Form {
public $_multiRecordDisplay;
public $_copyValueId;
+
/**
* Pre processing work done here.
*
@@ -306,7 +307,8 @@ class CRM_Contact_Form_CustomData extends CRM_Core_Form {
$cgcount += 1;
$buttonName = $this->controller->getButtonName();
if ($buttonName == $this->getButtonName('upload', 'new')) {
- CRM_Core_Session::singleton()->pushUserContext(CRM_Utils_System::url('civicrm/contact/view/cd/edit', "reset=1&type={$this->_contactType}&groupID={$this->_groupID}&entityID={$this->_tableID}&cgcount={$cgcount}&multiRecordDisplay=single&mode=add"));
+ CRM_Core_Session::singleton()
+ ->pushUserContext(CRM_Utils_System::url('civicrm/contact/view/cd/edit', "reset=1&type={$this->_contactType}&groupID={$this->_groupID}&entityID={$this->_tableID}&cgcount={$cgcount}&multiRecordDisplay=single&mode=add"));
}
// reset the group contact cache for this group
CRM_Contact_BAO_GroupContactCache::remove();
diff --git a/CRM/Contact/Form/DedupeRules.php b/CRM/Contact/Form/DedupeRules.php
index 670c7cb265..d37cdf0d3f 100644
--- a/CRM/Contact/Form/DedupeRules.php
+++ b/CRM/Contact/Form/DedupeRules.php
@@ -218,11 +218,11 @@ UPDATE civicrm_dedupe_rule_group
$rgDao->id = $this->_rgid;
}
- $rgDao->title = $values['title'];
- $rgDao->is_reserved = CRM_Utils_Array::value('is_reserved', $values, FALSE);
- $rgDao->used = $values['used'];
+ $rgDao->title = $values['title'];
+ $rgDao->is_reserved = CRM_Utils_Array::value('is_reserved', $values, FALSE);
+ $rgDao->used = $values['used'];
$rgDao->contact_type = $this->_contactType;
- $rgDao->threshold = $values['threshold'];
+ $rgDao->threshold = $values['threshold'];
$rgDao->save();
// make sure name is set only during insert
@@ -285,7 +285,15 @@ UPDATE civicrm_dedupe_rule_group
if ($dao->fetch()) {
// set the length to null for all the fields where prefix length is not supported. eg. int,tinyint,date,enum etc dataTypes.
- if ($dao->COLUMN_NAME == $field && !in_array($dao->DATA_TYPE, array('char', 'varchar', 'binary', 'varbinary', 'text', 'blob'))) {
+ if ($dao->COLUMN_NAME == $field && !in_array($dao->DATA_TYPE, array(
+ 'char',
+ 'varchar',
+ 'binary',
+ 'varbinary',
+ 'text',
+ 'blob'
+ ))
+ ) {
$length = NULL;
}
elseif ($dao->COLUMN_NAME == $field && !empty($dao->CHARACTER_MAXIMUM_LENGTH) && ($length > $dao->CHARACTER_MAXIMUM_LENGTH)) {
diff --git a/CRM/Contact/Form/Domain.php b/CRM/Contact/Form/Domain.php
index 603cfaa20d..124ca0f8b1 100644
--- a/CRM/Contact/Form/Domain.php
+++ b/CRM/Contact/Form/Domain.php
@@ -109,8 +109,8 @@ class CRM_Contact_Form_Domain extends CRM_Core_Form {
* @return array
*/
public function setDefaultValues() {
- $defaults = array();
- $params = array();
+ $defaults = array();
+ $params = array();
if (isset($this->_id)) {
$params['id'] = $this->_id;
@@ -167,17 +167,17 @@ class CRM_Contact_Form_Domain extends CRM_Core_Form {
CRM_Contact_Form_Location::buildQuickForm($this);
$this->addButtons(array(
- array(
- 'type' => 'next',
- 'name' => ts('Save'),
- 'subName' => 'view',
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- ));
+ array(
+ 'type' => 'next',
+ 'name' => ts('Save'),
+ 'subName' => 'view',
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ),
+ ));
if ($this->_action & CRM_Core_Action::VIEW) {
$this->freeze();
@@ -267,9 +267,9 @@ class CRM_Contact_Form_Domain extends CRM_Core_Form {
$params += array('contact_id' => $this->_contactId);
$contactParams = array(
- 'sort_name' => $domain->name,
+ 'sort_name' => $domain->name,
'display_name' => $domain->name,
- 'legal_name' => $domain->name,
+ 'legal_name' => $domain->name,
'organization_name' => $domain->name,
'contact_id' => $this->_contactId,
'contact_type' => 'Organization',
diff --git a/CRM/Contact/Form/Edit/Address.php b/CRM/Contact/Form/Edit/Address.php
index c3885983d1..c7aa121d1e 100644
--- a/CRM/Contact/Form/Edit/Address.php
+++ b/CRM/Contact/Form/Edit/Address.php
@@ -73,7 +73,10 @@ class CRM_Contact_Form_Edit_Address {
}
//make location type required for inline edit
- $form->addSelect("address[$blockId][location_type_id]", array('entity' => 'address', 'class' => 'eight') + $js, $inlineEdit);
+ $form->addSelect("address[$blockId][location_type_id]", array(
+ 'entity' => 'address',
+ 'class' => 'eight'
+ ) + $js, $inlineEdit);
if (!$inlineEdit) {
$js = array('id' => 'Address_' . $blockId . '_IsPrimary', 'onClick' => 'singleSelect( this.id );');
@@ -113,8 +116,16 @@ class CRM_Contact_Form_Edit_Address {
'supplemental_address_1' => array(ts('Supplemental Address 1'), $attributes['supplemental_address_1'], NULL),
'supplemental_address_2' => array(ts('Supplemental Address 2'), $attributes['supplemental_address_2'], NULL),
'city' => array(ts('City'), $attributes['city'], NULL),
- 'postal_code' => array(ts('Zip / Postal Code'), array_merge($attributes['postal_code'], array('class' => 'crm_postal_code')), NULL),
- 'postal_code_suffix' => array(ts('Postal Code Suffix'), array('size' => 4, 'maxlength' => 12, 'class' => 'crm_postal_code_suffix'), NULL),
+ 'postal_code' => array(
+ ts('Zip / Postal Code'),
+ array_merge($attributes['postal_code'], array('class' => 'crm_postal_code')),
+ NULL
+ ),
+ 'postal_code_suffix' => array(
+ ts('Postal Code Suffix'),
+ array('size' => 4, 'maxlength' => 12, 'class' => 'crm_postal_code_suffix'),
+ NULL
+ ),
'country_id' => array(ts('Country'), $attributes['country_id'], 'country'),
'state_province_id' => array(ts('State/Province'), $attributes['state_province_id'], NULL),
'county_id' => array(ts('County'), $attributes['county_id'], NULL),
@@ -132,7 +143,11 @@ class CRM_Contact_Form_Edit_Address {
if (empty($addressOptions[$nameWithoutID])) {
$continue = TRUE;
if (in_array($nameWithoutID, array(
- 'street_number', 'street_name', 'street_unit')) && !empty($addressOptions['street_address_parsing'])) {
+ 'street_number',
+ 'street_name',
+ 'street_unit'
+ )) && !empty($addressOptions['street_address_parsing'])
+ ) {
$continue = FALSE;
}
if ($continue) {
@@ -233,7 +248,7 @@ class CRM_Contact_Form_Edit_Address {
CRM_Contact_Form_Edit_Address::storeRequiredCustomDataInfo($form, $groupTree);
}
- $template = CRM_Core_Smarty::singleton();
+ $template = CRM_Core_Smarty::singleton();
$tplGroupTree = $template->get_template_vars('address_groupTree');
$tplGroupTree = empty($tplGroupTree) ? array() : $tplGroupTree;
@@ -248,7 +263,11 @@ class CRM_Contact_Form_Edit_Address {
$form->addElement('checkbox', "address[$blockId][use_shared_address]", NULL, ts('Use another contact\'s address'));
// Override the default profile links to add address form
- $profileLinks = CRM_Core_BAO_UFGroup::getCreateLinks(array('new_individual', 'new_organization', 'new_household'), 'shared_address');
+ $profileLinks = CRM_Core_BAO_UFGroup::getCreateLinks(array(
+ 'new_individual',
+ 'new_organization',
+ 'new_household'
+ ), 'shared_address');
$form->addEntityRef("address[$blockId][master_contact_id]", ts('Share With'), array('create' => $profileLinks));
}
}
@@ -340,7 +359,10 @@ class CRM_Contact_Form_Edit_Address {
$sharedAddresses[$key]['shared_address_display'] = array(
'address' => $addressValue['display'],
'name' => $shareAddressContactNames[$addressValue['master_id']]['name'],
- 'options' => CRM_Core_BAO_Address::getValues(array('entity_id' => $master_cid, 'contact_id' => $master_cid)),
+ 'options' => CRM_Core_BAO_Address::getValues(array(
+ 'entity_id' => $master_cid,
+ 'contact_id' => $master_cid
+ )),
'master_id' => $addressValue['master_id'],
);
$defaults['address'][$key]['master_contact_id'] = $master_cid;
@@ -364,9 +386,15 @@ class CRM_Contact_Form_Edit_Address {
foreach ($defaults['address'] as $cnt => & $address) {
$streetAddress = NULL;
foreach (array(
- 'street_number', 'street_number_suffix', 'street_name', 'street_unit') as $fld) {
+ 'street_number',
+ 'street_number_suffix',
+ 'street_name',
+ 'street_unit'
+ ) as $fld) {
if (in_array($fld, array(
- 'street_name', 'street_unit'))) {
+ 'street_name',
+ 'street_unit'
+ ))) {
$streetAddress .= ' ';
}
$streetAddress .= CRM_Utils_Array::value($fld, $address);
diff --git a/CRM/Contact/Form/Edit/CommunicationPreferences.php b/CRM/Contact/Form/Edit/CommunicationPreferences.php
index 3343286fd1..7c88999b4d 100644
--- a/CRM/Contact/Form/Edit/CommunicationPreferences.php
+++ b/CRM/Contact/Form/Edit/CommunicationPreferences.php
@@ -120,7 +120,8 @@ class CRM_Contact_Form_Edit_CommunicationPreferences {
if (!empty($greetingTokens)) {
$form->addElement('select', $fields['field'], $fields['label'],
array(
- '' => ts('- select -')) + $greetingTokens
+ '' => ts('- select -')
+ ) + $greetingTokens
);
//custom addressee
$form->addElement('text', $fields['customField'], $fields['customLabel'],
diff --git a/CRM/Contact/Form/Edit/Email.php b/CRM/Contact/Form/Edit/Email.php
index 91953302ac..d778fe6a03 100644
--- a/CRM/Contact/Form/Edit/Email.php
+++ b/CRM/Contact/Form/Edit/Email.php
@@ -67,7 +67,11 @@ class CRM_Contact_Form_Edit_Email {
$form->addRule("email[$blockId][email]", ts('Email is not valid.'), 'email');
if (isset($form->_contactType) || $blockEdit) {
//Block type
- $form->addSelect("email[$blockId][location_type_id]", array('entity' => 'email', 'class' => 'eight', 'placeholder' => NULL));
+ $form->addSelect("email[$blockId][location_type_id]", array(
+ 'entity' => 'email',
+ 'class' => 'eight',
+ 'placeholder' => NULL
+ ));
$multipleBulk = CRM_Core_BAO_Email::isMultipleBulkMail();
diff --git a/CRM/Contact/Form/Edit/IM.php b/CRM/Contact/Form/Edit/IM.php
index 32e0eae755..d5176ea24b 100644
--- a/CRM/Contact/Form/Edit/IM.php
+++ b/CRM/Contact/Form/Edit/IM.php
@@ -64,7 +64,11 @@ class CRM_Contact_Form_Edit_IM {
$form->addSelect("im[$blockId][provider_id]", array('entity' => 'im', 'class' => 'eight', 'placeholder' => NULL));
//Block type select
- $form->addSelect("im[$blockId][location_type_id]", array('entity' => 'im', 'class' => 'eight', 'placeholder' => NULL));
+ $form->addSelect("im[$blockId][location_type_id]", array(
+ 'entity' => 'im',
+ 'class' => 'eight',
+ 'placeholder' => NULL
+ ));
//IM box
$form->addElement('text', "im[$blockId][name]", ts('Instant Messenger'),
diff --git a/CRM/Contact/Form/Edit/Organization.php b/CRM/Contact/Form/Edit/Organization.php
index da17b87dd3..5d808b4797 100644
--- a/CRM/Contact/Form/Edit/Organization.php
+++ b/CRM/Contact/Form/Edit/Organization.php
@@ -40,7 +40,7 @@
*/
class CRM_Contact_Form_Edit_Organization {
- /**
+ /**
* This function provides the HTML form elements that are specific
* to the Organization Contact Type
*
diff --git a/CRM/Contact/Form/Edit/Phone.php b/CRM/Contact/Form/Edit/Phone.php
index 3ee9b6d99e..68da6e976f 100644
--- a/CRM/Contact/Form/Edit/Phone.php
+++ b/CRM/Contact/Form/Edit/Phone.php
@@ -63,7 +63,11 @@ class CRM_Contact_Form_Edit_Phone {
$form->applyFilter('__ALL__', 'trim');
//phone type select
- $form->addSelect("phone[$blockId][phone_type_id]", array('entity' => 'phone', 'class' => 'eight', 'placeholder' => NULL));
+ $form->addSelect("phone[$blockId][phone_type_id]", array(
+ 'entity' => 'phone',
+ 'class' => 'eight',
+ 'placeholder' => NULL
+ ));
//main phone number with crm_phone class
$form->add('text', "phone[$blockId][phone]", ts('Phone'), array_merge(CRM_Core_DAO::getAttribute('CRM_Core_DAO_Phone', 'phone'), array('class' => 'crm_phone twelve')));
@@ -72,7 +76,11 @@ class CRM_Contact_Form_Edit_Phone {
if (isset($form->_contactType) || $blockEdit) {
//Block type select
- $form->addSelect("phone[$blockId][location_type_id]", array('entity' => 'phone', 'class' => 'eight', 'placeholder' => NULL));
+ $form->addSelect("phone[$blockId][location_type_id]", array(
+ 'entity' => 'phone',
+ 'class' => 'eight',
+ 'placeholder' => NULL
+ ));
//is_Primary radio
$js = array('id' => 'Phone_' . $blockId . '_IsPrimary', 'onClick' => 'singleSelect( this.id );');
diff --git a/CRM/Contact/Form/Edit/TagsAndGroups.php b/CRM/Contact/Form/Edit/TagsAndGroups.php
index c59ed345d9..81e20e53ed 100644
--- a/CRM/Contact/Form/Edit/TagsAndGroups.php
+++ b/CRM/Contact/Form/Edit/TagsAndGroups.php
@@ -188,8 +188,8 @@ class CRM_Contact_Form_Edit_TagsAndGroups {
public static function climbtree($form, $tree, &$elements) {
foreach ($tree as $tagID => $varValue) {
$tagAttribute = array(
- 'onclick' => "return changeRowColor(\"rowidtag_$tagID\")",
- 'id' => "tag_{$tagID}",
+ 'onclick' => "return changeRowColor(\"rowidtag_$tagID\")",
+ 'id' => "tag_{$tagID}",
);
$elements[$tagID] = $form->createElement('checkbox', $tagID, '', '', $tagAttribute);
diff --git a/CRM/Contact/Form/GroupContact.php b/CRM/Contact/Form/GroupContact.php
index dd0a16e2b7..d803a9335d 100644
--- a/CRM/Contact/Form/GroupContact.php
+++ b/CRM/Contact/Form/GroupContact.php
@@ -101,7 +101,10 @@ class CRM_Contact_Form_GroupContact extends CRM_Core_Form {
$msg = ts('Add to a group');
}
- $this->add('select', 'group_id', '', $groupSelect, TRUE, array('class' => 'crm-select2 crm-action-menu action-icon-plus', 'placeholder' => $msg));
+ $this->add('select', 'group_id', '', $groupSelect, TRUE, array(
+ 'class' => 'crm-select2 crm-action-menu action-icon-plus',
+ 'placeholder' => $msg
+ ));
$this->addButtons(array(
array(
@@ -120,8 +123,8 @@ class CRM_Contact_Form_GroupContact extends CRM_Core_Form {
*/
public function postProcess() {
$contactID = array($this->_contactId);
- $groupId = $this->controller->exportValue('GroupContact', 'group_id');
- $method = ($this->_context == 'user') ? 'Web' : 'Admin';
+ $groupId = $this->controller->exportValue('GroupContact', 'group_id');
+ $method = ($this->_context == 'user') ? 'Web' : 'Admin';
$session = CRM_Core_Session::singleton();
$userID = $session->get('userID');
diff --git a/CRM/Contact/Form/Inline.php b/CRM/Contact/Form/Inline.php
index e7a8227c0f..20db671923 100644
--- a/CRM/Contact/Form/Inline.php
+++ b/CRM/Contact/Form/Inline.php
@@ -153,8 +153,8 @@ abstract class CRM_Contact_Form_Inline extends CRM_Core_Form {
$this->ajaxResponse = array_merge(
array(
'changeLog' => array(
- 'count' => CRM_Contact_BAO_Contact::getCountComponent('log', $this->_contactId),
- 'markup' => $smarty->fetch('CRM/common/contactFooter.tpl'),
+ 'count' => CRM_Contact_BAO_Contact::getCountComponent('log', $this->_contactId),
+ 'markup' => $smarty->fetch('CRM/common/contactFooter.tpl'),
),
),
$this->ajaxResponse,
diff --git a/CRM/Contact/Form/Inline/ContactInfo.php b/CRM/Contact/Form/Inline/ContactInfo.php
index 30c486823e..0bc5ff71af 100644
--- a/CRM/Contact/Form/Inline/ContactInfo.php
+++ b/CRM/Contact/Form/Inline/ContactInfo.php
@@ -70,7 +70,7 @@ class CRM_Contact_Form_Inline_ContactInfo extends CRM_Contact_Form_Inline {
// Process / save contact info
$params['contact_type'] = $this->_contactType;
- $params['contact_id'] = $this->_contactId;
+ $params['contact_id'] = $this->_contactId;
if (!empty($this->_contactSubType)) {
$params['contact_sub_type'] = $this->_contactSubType;
diff --git a/CRM/Contact/Form/Inline/ContactName.php b/CRM/Contact/Form/Inline/ContactName.php
index 9895863da3..7c70087753 100644
--- a/CRM/Contact/Form/Inline/ContactName.php
+++ b/CRM/Contact/Form/Inline/ContactName.php
@@ -61,7 +61,7 @@ class CRM_Contact_Form_Inline_ContactName extends CRM_Contact_Form_Inline {
// Process / save contact info
$params['contact_type'] = $this->_contactType;
- $params['contact_id'] = $this->_contactId;
+ $params['contact_id'] = $this->_contactId;
if (!empty($this->_contactSubType)) {
$params['contact_sub_type'] = $this->_contactSubType;
diff --git a/CRM/Contact/Form/Inline/Email.php b/CRM/Contact/Form/Inline/Email.php
index 72bf2f1a46..a0efe9980b 100644
--- a/CRM/Contact/Form/Inline/Email.php
+++ b/CRM/Contact/Form/Inline/Email.php
@@ -74,9 +74,9 @@ class CRM_Contact_Form_Inline_Email extends CRM_Contact_Form_Inline {
if (count($this->_emails) > 1) {
$actualBlockCount = $totalBlocks = count($this->_emails);
if ($totalBlocks < $this->_blockCount) {
- $additionalBlocks = $this->_blockCount - $totalBlocks;
- $totalBlocks += $additionalBlocks;
- }
+ $additionalBlocks = $this->_blockCount - $totalBlocks;
+ $totalBlocks += $additionalBlocks;
+ }
else {
$actualBlockCount++;
$totalBlocks++;
@@ -116,9 +116,9 @@ class CRM_Contact_Form_Inline_Email extends CRM_Contact_Form_Inline {
$hasData[] = $instance;
if (!empty($blockValues['is_primary'])) {
$hasPrimary[] = $instance;
- }
}
}
+ }
if (empty($hasPrimary) && !empty($hasData)) {
diff --git a/CRM/Contact/Form/Inline/IM.php b/CRM/Contact/Form/Inline/IM.php
index dfed038617..2bcb95c636 100644
--- a/CRM/Contact/Form/Inline/IM.php
+++ b/CRM/Contact/Form/Inline/IM.php
@@ -117,7 +117,7 @@ class CRM_Contact_Form_Inline_IM extends CRM_Contact_Form_Inline {
if (!empty($blockValues['is_primary'])) {
$hasPrimary[] = $instance;
if (!$primaryID && !empty($blockValues['im'])) {
- $primaryID = $blockValues['im'];
+ $primaryID = $blockValues['im'];
}
}
}
diff --git a/CRM/Contact/Form/Inline/OpenID.php b/CRM/Contact/Form/Inline/OpenID.php
index 4b0c3828d5..c1d77bb93e 100644
--- a/CRM/Contact/Form/Inline/OpenID.php
+++ b/CRM/Contact/Form/Inline/OpenID.php
@@ -117,7 +117,7 @@ class CRM_Contact_Form_Inline_OpenID extends CRM_Contact_Form_Inline {
if (!empty($blockValues['is_primary'])) {
$hasPrimary[] = $instance;
if (!$primaryID && !empty($blockValues['openid'])) {
- $primaryID = $blockValues['openid'];
+ $primaryID = $blockValues['openid'];
}
}
}
diff --git a/CRM/Contact/Form/Inline/Phone.php b/CRM/Contact/Form/Inline/Phone.php
index 9f2f96f979..544bf4872b 100644
--- a/CRM/Contact/Form/Inline/Phone.php
+++ b/CRM/Contact/Form/Inline/Phone.php
@@ -74,9 +74,9 @@ class CRM_Contact_Form_Inline_Phone extends CRM_Contact_Form_Inline {
if (count($this->_phones) > 1) {
$actualBlockCount = $totalBlocks = count($this->_phones);
if ($totalBlocks < $this->_blockCount) {
- $additionalBlocks = $this->_blockCount - $totalBlocks;
- $totalBlocks += $additionalBlocks;
- }
+ $additionalBlocks = $this->_blockCount - $totalBlocks;
+ $totalBlocks += $additionalBlocks;
+ }
else {
$actualBlockCount++;
$totalBlocks++;
@@ -118,7 +118,7 @@ class CRM_Contact_Form_Inline_Phone extends CRM_Contact_Form_Inline {
if (!empty($blockValues['is_primary'])) {
$hasPrimary[] = $instance;
if (!$primaryID && !empty($blockValues['phone'])) {
- $primaryID = $blockValues['phone'];
+ $primaryID = $blockValues['phone'];
}
}
}
diff --git a/CRM/Contact/Form/Location.php b/CRM/Contact/Form/Location.php
index 77a2ed0350..008291f041 100644
--- a/CRM/Contact/Form/Location.php
+++ b/CRM/Contact/Form/Location.php
@@ -55,7 +55,9 @@ class CRM_Contact_Form_Location {
$className = CRM_Utils_System::getClassName($form);
if (in_array($className, array(
- 'CRM_Event_Form_ManageEvent_Location', 'CRM_Contact_Form_Domain'))) {
+ 'CRM_Event_Form_ManageEvent_Location',
+ 'CRM_Contact_Form_Domain'
+ ))) {
$form->_blocks = array(
'Address' => ts('Address'),
'Email' => ts('Email'),
diff --git a/CRM/Contact/Form/Merge.php b/CRM/Contact/Form/Merge.php
index 4141d06aaa..ba367123ca 100644
--- a/CRM/Contact/Form/Merge.php
+++ b/CRM/Contact/Form/Merge.php
@@ -63,12 +63,12 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form {
}
$rows = array();
- $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
- $oid = CRM_Utils_Request::retrieve('oid', 'Positive', $this, TRUE);
+ $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
+ $oid = CRM_Utils_Request::retrieve('oid', 'Positive', $this, TRUE);
$flip = CRM_Utils_Request::retrieve('flip', 'Positive', $this, FALSE);
- $this->_rgid = $rgid = CRM_Utils_Request::retrieve('rgid', 'Positive', $this, FALSE);
- $this->_gid = $gid = CRM_Utils_Request::retrieve('gid', 'Positive', $this, FALSE);
+ $this->_rgid = $rgid = CRM_Utils_Request::retrieve('rgid', 'Positive', $this, FALSE);
+ $this->_gid = $gid = CRM_Utils_Request::retrieve('gid', 'Positive', $this, FALSE);
$this->_mergeId = CRM_Utils_Request::retrieve('mergeId', 'Positive', $this, FALSE);
// Sanity check
@@ -94,8 +94,9 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form {
// Block access if user does not have EDIT permissions for both contacts.
if (!(CRM_Contact_BAO_Contact_Permission::allow($cid, CRM_Core_Permission::EDIT) &&
- CRM_Contact_BAO_Contact_Permission::allow($oid, CRM_Core_Permission::EDIT)
- )) {
+ CRM_Contact_BAO_Contact_Permission::allow($oid, CRM_Core_Permission::EDIT)
+ )
+ ) {
CRM_Utils_System::permissionDenied();
}
@@ -129,7 +130,9 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form {
$this->prev = $this->next = NULL;
foreach (array(
- 'prev', 'next') as $position) {
+ 'prev',
+ 'next'
+ ) as $position) {
if (!empty($pos[$position])) {
if ($pos[$position]['id1'] && $pos[$position]['id2']) {
$urlParam = "reset=1&cid={$pos[$position]['id1']}&oid={$pos[$position]['id2']}&mergeId={$pos[$position]['mergeId']}&action=update";
@@ -206,9 +209,9 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form {
$this->assign('other_cid', $other['contact_id']);
$this->assign('rgid', $rgid);
- $this->_cid = $cid;
- $this->_oid = $oid;
- $this->_rgid = $rgid;
+ $this->_cid = $cid;
+ $this->_oid = $oid;
+ $this->_rgid = $rgid;
$this->_contactType = $main['contact_type'];
$this->addElement('checkbox', 'toggleSelect', NULL, NULL, array('class' => 'select-rows'));
@@ -341,7 +344,7 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form {
);
CRM_Utils_System::redirect($lisitingURL);
}
- if (!empty($formValues['_qf_Merge_done'])) {
+ if (!empty($formValues['_qf_Merge_done'])) {
CRM_Utils_System::redirect($url);
}
diff --git a/CRM/Contact/Form/ProfileContact.php b/CRM/Contact/Form/ProfileContact.php
index 2dd022f0b2..b860cf7c0b 100644
--- a/CRM/Contact/Form/ProfileContact.php
+++ b/CRM/Contact/Form/ProfileContact.php
@@ -89,11 +89,11 @@ class CRM_Contact_Form_ProfileContact {
$prefix = 'honor';
$honoreeProfileFields = CRM_Core_BAO_UFGroup::getFields($form->_honoreeProfileId, FALSE, NULL,
- NULL, NULL,
- FALSE, NULL,
- TRUE, NULL,
- CRM_Core_Permission::CREATE
- );
+ NULL, NULL,
+ FALSE, NULL,
+ TRUE, NULL,
+ CRM_Core_Permission::CREATE
+ );
$form->addElement('hidden', 'honoree_profile_id', $form->_honoreeProfileId);
$form->assign('honoreeProfileFields', $honoreeProfileFields);
diff --git a/CRM/Contact/Form/RelatedContact.php b/CRM/Contact/Form/RelatedContact.php
index ce80a97f24..5ef9d24927 100644
--- a/CRM/Contact/Form/RelatedContact.php
+++ b/CRM/Contact/Form/RelatedContact.php
@@ -76,8 +76,8 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form {
);
$this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
- $rcid = CRM_Utils_Request::retrieve('rcid', 'Positive', $this);
- $rcid = $rcid ? "&id={$rcid}" : '';
+ $rcid = CRM_Utils_Request::retrieve('rcid', 'Positive', $this);
+ $rcid = $rcid ? "&id={$rcid}" : '';
$session = CRM_Core_Session::singleton();
$session->pushUserContext(CRM_Utils_System::url('civicrm/user', "reset=1{$rcid}"));
@@ -119,9 +119,9 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form {
* @return void
*/
public function buildQuickForm() {
- $params = array();
+ $params = array();
$params['id'] = $params['contact_id'] = $this->_contactId;
- $contact = CRM_Contact_BAO_Contact::retrieve($params, $this->_defaults);
+ $contact = CRM_Contact_BAO_Contact::retrieve($params, $this->_defaults);
$countryID = '';
$stateID = '';
@@ -141,16 +141,16 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form {
);
$this->addButtons(array(
- array(
- 'type' => 'next',
- 'name' => ts('Save'),
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- ));
+ array(
+ 'type' => 'next',
+ 'name' => ts('Save'),
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ),
+ ));
}
/**
@@ -165,7 +165,10 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form {
$locType = CRM_Core_BAO_LocationType::getDefault();
foreach (array(
- 'phone', 'email', 'address') as $locFld) {
+ 'phone',
+ 'email',
+ 'address'
+ ) as $locFld) {
if (!empty($this->_defaults[$locFld]) && $this->_defaults[$locFld][1]['location_type_id']) {
$params[$locFld][1]['is_primary'] = $this->_defaults[$locFld][1]['is_primary'];
$params[$locFld][1]['location_type_id'] = $this->_defaults[$locFld][1]['location_type_id'];
diff --git a/CRM/Contact/Form/Relationship.php b/CRM/Contact/Form/Relationship.php
index a2a937849d..dbd0edf5b7 100644
--- a/CRM/Contact/Form/Relationship.php
+++ b/CRM/Contact/Form/Relationship.php
@@ -350,7 +350,10 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form {
);
$label = $this->_action & CRM_Core_Action::ADD ? ts('Contact(s)') : ts('Contact');
- $contactField = $this->addEntityRef('related_contact_id', $label, array('multiple' => TRUE, 'create' => TRUE), TRUE);
+ $contactField = $this->addEntityRef('related_contact_id', $label, array(
+ 'multiple' => TRUE,
+ 'create' => TRUE
+ ), TRUE);
// This field cannot be updated
if ($this->_action & CRM_Core_Action::UPDATE) {
$contactField->freeze();
@@ -466,13 +469,28 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form {
}
if ($valid) {
- CRM_Core_Session::setStatus(ts('Relationship created.', array('count' => $valid, 'plural' => '%count relationships created.')), ts('Saved'), 'success');
+ CRM_Core_Session::setStatus(ts('Relationship created.', array(
+ 'count' => $valid,
+ 'plural' => '%count relationships created.'
+ )), ts('Saved'), 'success');
}
if ($invalid) {
- CRM_Core_Session::setStatus(ts('%count relationship record was not created due to an invalid contact type.', array('count' => $invalid, 'plural' => '%count relationship records were not created due to invalid contact types.')), ts('%count invalid relationship record', array('count' => $invalid, 'plural' => '%count invalid relationship records')));
+ CRM_Core_Session::setStatus(ts('%count relationship record was not created due to an invalid contact type.', array(
+ 'count' => $invalid,
+ 'plural' => '%count relationship records were not created due to invalid contact types.'
+ )), ts('%count invalid relationship record', array(
+ 'count' => $invalid,
+ 'plural' => '%count invalid relationship records'
+ )));
}
if ($duplicate) {
- CRM_Core_Session::setStatus(ts('One relationship was not created because it already exists.', array('count' => $duplicate, 'plural' => '%count relationships were not created because they already exist.')), ts('%count duplicate relationship', array('count' => $duplicate, 'plural' => '%count duplicate relationships')));
+ CRM_Core_Session::setStatus(ts('One relationship was not created because it already exists.', array(
+ 'count' => $duplicate,
+ 'plural' => '%count relationships were not created because they already exist.'
+ )), ts('%count duplicate relationship', array(
+ 'count' => $duplicate,
+ 'plural' => '%count duplicate relationships'
+ )));
}
if ($saved) {
CRM_Core_Session::setStatus(ts('Relationship record has been updated.'), ts('Saved'), 'success');
diff --git a/CRM/Contact/Form/Search.php b/CRM/Contact/Form/Search.php
index 0a4aa10438..30df4e6823 100644
--- a/CRM/Contact/Form/Search.php
+++ b/CRM/Contact/Form/Search.php
@@ -417,8 +417,8 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
// add the go button for the action form, note it is of type 'next' rather than of type 'submit'
if ($this->_context === 'amtg') {
- // check if _groupID exists, it might not if
- // we are displaying a hidden group
+ // check if _groupID exists, it might not if
+ // we are displaying a hidden group
if (!isset($this->_group[$this->_amtgID])) {
$this->assign('permissionedForGroup', FALSE);
$this->_group[$this->_amtgID] =
@@ -603,11 +603,17 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
// FIXME: we should generalise in a way that components could inject url-filters
// just like they build their own form elements
foreach (array(
- 'mailing_id', 'mailing_delivery_status', 'mailing_open_status',
- 'mailing_click_status', 'mailing_reply_status', 'mailing_optout',
- 'mailing_forward', 'mailing_unsubscribe', 'mailing_date_low',
- 'mailing_date_high',
- ) as $mailingFilter) {
+ 'mailing_id',
+ 'mailing_delivery_status',
+ 'mailing_open_status',
+ 'mailing_click_status',
+ 'mailing_reply_status',
+ 'mailing_optout',
+ 'mailing_forward',
+ 'mailing_unsubscribe',
+ 'mailing_date_low',
+ 'mailing_date_high',
+ ) as $mailingFilter) {
$type = 'String';
if ($mailingFilter == 'mailing_id' &&
$filterVal = CRM_Utils_Request::retrieve('mailing_id', 'Positive', $this)
@@ -740,7 +746,8 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
$crmPID = CRM_Utils_Request::retrieve('crmPID', 'Integer', CRM_Core_DAO::$_nullObject);
if (array_key_exists($this->_searchButtonName, $_POST) ||
- ($this->_force && !$crmPID)) {
+ ($this->_force && !$crmPID)
+ ) {
//reset the cache table for new search
$cacheKey = "civicrm search {$this->controller->_key}";
CRM_Core_BAO_PrevNextCache::deleteItem(NULL, $cacheKey);
diff --git a/CRM/Contact/Form/Search/Advanced.php b/CRM/Contact/Form/Search/Advanced.php
index d7fd336071..530c9284a6 100644
--- a/CRM/Contact/Form/Search/Advanced.php
+++ b/CRM/Contact/Form/Search/Advanced.php
@@ -246,7 +246,9 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search {
// FIXME: so leaving this as a dependency for now
if (array_key_exists('contribution_amount_low', $this->_formValues)) {
foreach (array(
- 'contribution_amount_low', 'contribution_amount_high') as $f) {
+ 'contribution_amount_low',
+ 'contribution_amount_high'
+ ) as $f) {
$this->_formValues[$f] = CRM_Utils_Rule::cleanMoney($this->_formValues[$f]);
}
}
@@ -278,7 +280,11 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search {
!$this->_force
) {
foreach (array(
- 'case_type_id', 'case_status_id', 'case_deleted', 'case_tags') as $caseCriteria) {
+ 'case_type_id',
+ 'case_status_id',
+ 'case_deleted',
+ 'case_tags'
+ ) as $caseCriteria) {
if (!empty($this->_formValues[$caseCriteria])) {
$allCases = TRUE;
$this->_formValues['case_owner'] = 1;
diff --git a/CRM/Contact/Form/Search/Basic.php b/CRM/Contact/Form/Search/Basic.php
index 9a5716143f..13dd608ef7 100644
--- a/CRM/Contact/Form/Search/Basic.php
+++ b/CRM/Contact/Form/Search/Basic.php
@@ -83,13 +83,23 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search {
// add select for groups
if (!empty($searchOptions['groups'])) {
- $this->addSelect('group', array('entity' => 'group_contact', 'label' => ts('in'), 'context' => 'search', 'placeholder' => ts('- any group -')));
+ $this->addSelect('group', array(
+ 'entity' => 'group_contact',
+ 'label' => ts('in'),
+ 'context' => 'search',
+ 'placeholder' => ts('- any group -')
+ ));
}
if (!empty($searchOptions['tags'])) {
// tag criteria
if (!empty($this->_tag)) {
- $this->addSelect('tag', array('entity' => 'entity_tag', 'label' => ts('with'), 'context' => 'search', 'placeholder' => ts('- any tag -')));
+ $this->addSelect('tag', array(
+ 'entity' => 'entity_tag',
+ 'label' => ts('with'),
+ 'context' => 'search',
+ 'placeholder' => ts('- any tag -')
+ ));
}
}
diff --git a/CRM/Contact/Form/Search/Builder.php b/CRM/Contact/Form/Search/Builder.php
index 18338dc465..5dbb773d0b 100644
--- a/CRM/Contact/Form/Search/Builder.php
+++ b/CRM/Contact/Form/Search/Builder.php
@@ -160,7 +160,8 @@ class CRM_Contact_Form_Search_Builder extends CRM_Contact_Form_Search {
$v[2] = self::checkArrayKeyEmpty($v[2]);
if (in_array($v[1], array('IS NULL', 'IS NOT NULL', 'IS EMPTY', 'IS NOT EMPTY')) &&
- !empty($v[2])) {
+ !empty($v[2])
+ ) {
$errorMsg["value[$v[3]][$v[4]]"] = ts('Please clear your value if you want to use %1 operator.', array(1 => $v[1]));
}
elseif (($v[0] == 'group' || $v[0] == 'tag') && !empty($v[2])) {
@@ -212,7 +213,9 @@ class CRM_Contact_Form_Search_Builder extends CRM_Contact_Form_Search {
// hack to handle custom data of type state and country
if (in_array($type, array(
- 'Country', 'StateProvince'))) {
+ 'Country',
+ 'StateProvince'
+ ))) {
$type = "Integer";
}
}
@@ -229,7 +232,8 @@ class CRM_Contact_Form_Search_Builder extends CRM_Contact_Form_Search {
$type = CRM_Utils_Type::typeToString($fldType);
// Check Empty values for Integer Or Boolean Or Date type For operators other than IS NULL and IS NOT NULL.
if (!in_array($v[1],
- array('IS NULL', 'IS NOT NULL', 'IS EMPTY', 'IS NOT EMPTY'))) {
+ array('IS NULL', 'IS NOT NULL', 'IS EMPTY', 'IS NOT EMPTY'))
+ ) {
if ((($type == 'Int' || $type == 'Boolean') && !is_array($v[2]) && !trim($v[2])) && $v[2] != '0') {
$errorMsg["value[$v[3]][$v[4]]"] = ts("Please enter a value.");
}
@@ -339,7 +343,7 @@ class CRM_Contact_Form_Search_Builder extends CRM_Contact_Form_Search {
$addMore = CRM_Utils_Array::value('addMore', $params);
for ($x = 1; $x <= $this->_blockCount; $x++) {
if (!empty($addMore[$x])) {
- $this->set('newBlock', $x);
+ $this->set('newBlock', $x);
$this->_columnCount[$x] = $this->_columnCount[$x] + 5;
$this->set('columnCount', $this->_columnCount);
$this->set('showSearchForm', TRUE);
@@ -438,7 +442,17 @@ class CRM_Contact_Form_Search_Builder extends CRM_Contact_Form_Search {
'member_is_pay_later' => 'yesno',
'is_override' => 'yesno',
);
- $entities = array('contact', 'address', 'activity', 'participant', 'pledge', 'member', 'contribution', 'case', 'grant');
+ $entities = array(
+ 'contact',
+ 'address',
+ 'activity',
+ 'participant',
+ 'pledge',
+ 'member',
+ 'contribution',
+ 'case',
+ 'grant'
+ );
CRM_Contact_BAO_Query_Hook::singleton()->alterSearchBuilderOptions($entities, $options);
foreach ($entities as $entity) {
$fields = civicrm_api3($entity, 'getfields');
@@ -453,7 +467,11 @@ class CRM_Contact_Form_Search_Builder extends CRM_Contact_Form_Search {
elseif (!empty($info['data_type']) && in_array($info['data_type'], array('StateProvince', 'Country'))) {
$options[$field] = $entity;
}
- elseif (in_array(substr($field, 0, 3), array('is_', 'do_')) || CRM_Utils_Array::value('data_type', $info) == 'Boolean') {
+ elseif (in_array(substr($field, 0, 3), array(
+ 'is_',
+ 'do_'
+ )) || CRM_Utils_Array::value('data_type', $info) == 'Boolean'
+ ) {
$options[$field] = 'yesno';
if ($entity != 'contact') {
$options[$entity . '_' . $field] = 'yesno';
diff --git a/CRM/Contact/Form/Search/Criteria.php b/CRM/Contact/Form/Search/Criteria.php
index 68fd674444..00d7caa030 100644
--- a/CRM/Contact/Form/Search/Criteria.php
+++ b/CRM/Contact/Form/Search/Criteria.php
@@ -66,7 +66,7 @@ class CRM_Contact_Form_Search_Criteria {
$form->add('select', 'group_type', ts('Group Types'), $groupOptions, FALSE,
array('id' => 'group_type', 'multiple' => 'multiple', 'class' => 'crm-select2')
);
- $form->add('hidden','group_search_selected','group');
+ $form->add('hidden', 'group_search_selected', 'group');
}
}
@@ -100,7 +100,7 @@ class CRM_Contact_Form_Search_Criteria {
$tagTypesText = implode(" or ", $tagsTypes);
if ($showAllTagTypes) {
$form->add('checkbox', 'all_tag_types', ts('Include tags used for %1', array(1 => $tagTypesText)));
- $form->add('hidden','tag_types_text', $tagTypesText);
+ $form->add('hidden', 'tag_types_text', $tagTypesText);
}
}
@@ -158,7 +158,8 @@ class CRM_Contact_Form_Search_Criteria {
'uf_group_id',
ts('Search Views'),
array(
- '0' => ts('- default view -')) + $searchProfiles
+ '0' => ts('- default view -')
+ ) + $searchProfiles
);
$componentModes = CRM_Contact_Form_Search::getModeSelect();
@@ -312,8 +313,8 @@ class CRM_Contact_Form_Search_Criteria {
list($title, $attributes, $select, $multiSelect) = $v;
if (in_array($name,
- array('street_number', 'street_name', 'street_unit')
- )) {
+ array('street_number', 'street_name', 'street_unit')
+ )) {
if (!$parseStreetAddress) {
continue;
}
diff --git a/CRM/Contact/Form/Search/Custom.php b/CRM/Contact/Form/Search/Custom.php
index 283819d2c7..7c4edc5172 100644
--- a/CRM/Contact/Form/Search/Custom.php
+++ b/CRM/Contact/Form/Search/Custom.php
@@ -49,7 +49,7 @@ class CRM_Contact_Form_Search_Custom extends CRM_Contact_Form_Search {
$this->_customSearchID,
$this->_customSearchClass,
$formValues
- ) = CRM_Contact_BAO_SearchCustom::details($csID, $ssID, $gID);
+ ) = CRM_Contact_BAO_SearchCustom::details($csID, $ssID, $gID);
if (!$this->_customSearchID) {
CRM_Core_Error::fatal('Could not get details for custom search.');
@@ -64,12 +64,14 @@ class CRM_Contact_Form_Search_Custom extends CRM_Contact_Form_Search {
}
// set breadcrumb to return to Custom Search listings page
- $breadCrumb = array(array(
+ $breadCrumb = array(
+ array(
'title' => ts('Custom Searches'),
'url' => CRM_Utils_System::url('civicrm/contact/search/custom/list',
'reset=1'
),
- ));
+ )
+ );
CRM_Utils_System::appendBreadCrumb($breadCrumb);
// use the custom selector
@@ -85,7 +87,8 @@ class CRM_Contact_Form_Search_Custom extends CRM_Contact_Form_Search {
// CRM-12747
if (isset($this->_customClass->_permissionedComponent) &&
- !self::isPermissioned($this->_customClass->_permissionedComponent)) {
+ !self::isPermissioned($this->_customClass->_permissionedComponent)
+ ) {
CRM_Utils_System::permissionDenied();
}
}
diff --git a/CRM/Contact/Form/Search/Custom/ActivitySearch.php b/CRM/Contact/Form/Search/Custom/ActivitySearch.php
index b94cd426ff..c518532a9d 100644
--- a/CRM/Contact/Form/Search/Custom/ActivitySearch.php
+++ b/CRM/Contact/Form/Search/Custom/ActivitySearch.php
@@ -138,9 +138,14 @@ class CRM_Contact_Form_Search_Custom_ActivitySearch implements CRM_Contact_Form_
* for the search form.
*/
$form->assign('elements', array(
- 'contact_type', 'activity_subject', 'activity_type_id',
- 'activity_status_id', 'start_date', 'end_date', 'sort_name',
- ));
+ 'contact_type',
+ 'activity_subject',
+ 'activity_type_id',
+ 'activity_status_id',
+ 'start_date',
+ 'end_date',
+ 'sort_name',
+ ));
}
/**
@@ -289,9 +294,9 @@ ORDER BY contact_a.sort_name';
// add contact name search; search on primary name, source contact, assignee
$contactname = $this->_formValues['sort_name'];
if (!empty($contactname)) {
- $dao = new CRM_Core_DAO();
+ $dao = new CRM_Core_DAO();
$contactname = $dao->escape($contactname);
- $clauses[] = "(contact_a.sort_name LIKE '%{$contactname}%' OR
+ $clauses[] = "(contact_a.sort_name LIKE '%{$contactname}%' OR
contact_b.sort_name LIKE '%{$contactname}%' OR
contact_c.display_name LIKE '%{$contactname}%')";
}
@@ -303,8 +308,8 @@ ORDER BY contact_a.sort_name';
}
if (!empty($subject)) {
- $dao = new CRM_Core_DAO();
- $subject = $dao->escape($subject);
+ $dao = new CRM_Core_DAO();
+ $subject = $dao->escape($subject);
$clauses[] = "activity.subject LIKE '%{$subject}%'";
}
diff --git a/CRM/Contact/Form/Search/Custom/Base.php b/CRM/Contact/Form/Search/Custom/Base.php
index cbad293b1f..227c58efb2 100644
--- a/CRM/Contact/Form/Search/Custom/Base.php
+++ b/CRM/Contact/Form/Search/Custom/Base.php
@@ -197,16 +197,16 @@ class CRM_Contact_Form_Search_Custom_Base {
foreach ($includeStrings as $string) {
if (stripos($sql, $string) === FALSE) {
CRM_Core_Error::fatal(ts('Could not find \'%1\' string in SQL clause.',
- array(1 => $string)
- ));
+ array(1 => $string)
+ ));
}
}
foreach ($excludeStrings as $string) {
if (preg_match('/(\s' . $string . ')|(' . $string . '\s)/i', $sql)) {
CRM_Core_Error::fatal(ts('Found illegal \'%1\' string in SQL clause.',
- array(1 => $string)
- ));
+ array(1 => $string)
+ ));
}
}
}
diff --git a/CRM/Contact/Form/Search/Custom/Basic.php b/CRM/Contact/Form/Search/Custom/Basic.php
index 06e492a737..e2c7d55d24 100644
--- a/CRM/Contact/Form/Search/Custom/Basic.php
+++ b/CRM/Contact/Form/Search/Custom/Basic.php
@@ -68,7 +68,13 @@ class CRM_Contact_Form_Search_Custom_Basic extends CRM_Contact_Form_Search_Custo
foreach ($this->_columns as $name => $field) {
if (in_array($field, array(
- 'street_address', 'city', 'state_province', 'postal_code', 'country')) && empty($addressOptions[$field])) {
+ 'street_address',
+ 'city',
+ 'state_province',
+ 'postal_code',
+ 'country'
+ )) && empty($addressOptions[$field])
+ ) {
unset($this->_columns[$name]);
continue;
}
diff --git a/CRM/Contact/Form/Search/Custom/DateAdded.php b/CRM/Contact/Form/Search/Custom/DateAdded.php
index 1adb3d454c..0075f3f05f 100644
--- a/CRM/Contact/Form/Search/Custom/DateAdded.php
+++ b/CRM/Contact/Form/Search/Custom/DateAdded.php
@@ -213,8 +213,8 @@ class CRM_Contact_Form_Search_Custom_DateAdded extends CRM_Contact_Form_Search_C
// CRM-6356
if ($this->_groups) {
//block for Group search
- $smartGroup = array();
- $group = new CRM_Contact_DAO_Group();
+ $smartGroup = array();
+ $group = new CRM_Contact_DAO_Group();
$group->is_active = 1;
$group->find();
while ($group->fetch()) {
diff --git a/CRM/Contact/Form/Search/Custom/EventAggregate.php b/CRM/Contact/Form/Search/Custom/EventAggregate.php
index 06f71fa0f6..1c38c06f3d 100644
--- a/CRM/Contact/Form/Search/Custom/EventAggregate.php
+++ b/CRM/Contact/Form/Search/Custom/EventAggregate.php
@@ -90,7 +90,14 @@ class CRM_Contact_Form_Search_Custom_EventAggregate extends CRM_Contact_Form_Sea
* If you are using the sample template, this array tells the template fields to render
* for the search form.
*/
- $form->assign('elements', array('paid_online', 'start_date', 'end_date', 'show_payees', 'event_type_id', 'event_id'));
+ $form->assign('elements', array(
+ 'paid_online',
+ 'start_date',
+ 'end_date',
+ 'show_payees',
+ 'event_type_id',
+ 'event_id'
+ ));
}
/**
@@ -206,7 +213,7 @@ class CRM_Contact_Form_Search_Custom_EventAggregate extends CRM_Contact_Form_Sea
$clauses[] = "civicrm_participant.status_id in ( 1 )";
$clauses[] = "civicrm_contribution.is_test = 0";
- $onLine = CRM_Utils_Array::value('paid_online',
+ $onLine = CRM_Utils_Array::value('paid_online',
$this->_formValues
);
if ($onLine) {
diff --git a/CRM/Contact/Form/Search/Custom/FullText.php b/CRM/Contact/Form/Search/Custom/FullText.php
index 16c9846d5e..d36d8a1a17 100644
--- a/CRM/Contact/Form/Search/Custom/FullText.php
+++ b/CRM/Contact/Form/Search/Custom/FullText.php
@@ -194,7 +194,6 @@ class CRM_Contact_Form_Search_Custom_FullText implements CRM_Contact_Form_Search
'membership_end_date' => 'datetime',
'membership_source' => 'varchar(255)',
'membership_status' => 'varchar(255)',
-
// We may have multiple files to list on one record.
// The temporary-table approach can't store full details for all of them
'file_ids' => 'varchar(255)', // comma-separate id listing
diff --git a/CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php b/CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php
index 128d6a3e3b..a1f3153f85 100644
--- a/CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php
+++ b/CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php
@@ -161,9 +161,9 @@ $sqlStatement
}
$query = $tableValues + array(
- 'text' => CRM_Utils_QueryFormatter::singleton()
- ->format($queryText, CRM_Utils_QueryFormatter::LANG_SOLR),
- );
+ 'text' => CRM_Utils_QueryFormatter::singleton()
+ ->format($queryText, CRM_Utils_QueryFormatter::LANG_SOLR),
+ );
list($intLimit, $intOffset) = $this->parseLimitOffset($limit);
$files = $searcher->search($query, $intLimit, $intOffset);
$matches = array();
diff --git a/CRM/Contact/Form/Search/Custom/FullText/Contribution.php b/CRM/Contact/Form/Search/Custom/FullText/Contribution.php
index 9f7bfdb2d5..20a27eafe4 100644
--- a/CRM/Contact/Form/Search/Custom/FullText/Contribution.php
+++ b/CRM/Contact/Form/Search/Custom/FullText/Contribution.php
@@ -41,7 +41,7 @@ class CRM_Contact_Form_Search_Custom_FullText_Contribution extends CRM_Contact_F
public function isActive() {
$config = CRM_Core_Config::singleton();
return in_array('CiviContribute', $config->enableComponents) &&
- CRM_Core_Permission::check('access CiviContribute');
+ CRM_Core_Permission::check('access CiviContribute');
}
/**
diff --git a/CRM/Contact/Form/Search/Custom/FullText/Membership.php b/CRM/Contact/Form/Search/Custom/FullText/Membership.php
index 341df71ea4..5c3298cf5f 100644
--- a/CRM/Contact/Form/Search/Custom/FullText/Membership.php
+++ b/CRM/Contact/Form/Search/Custom/FullText/Membership.php
@@ -41,7 +41,7 @@ class CRM_Contact_Form_Search_Custom_FullText_Membership extends CRM_Contact_For
public function isActive() {
$config = CRM_Core_Config::singleton();
return in_array('CiviMember', $config->enableComponents) &&
- CRM_Core_Permission::check('access CiviMember');
+ CRM_Core_Permission::check('access CiviMember');
}
/**
diff --git a/CRM/Contact/Form/Search/Custom/FullText/Participant.php b/CRM/Contact/Form/Search/Custom/FullText/Participant.php
index ecc0d7297d..8ceebbd915 100644
--- a/CRM/Contact/Form/Search/Custom/FullText/Participant.php
+++ b/CRM/Contact/Form/Search/Custom/FullText/Participant.php
@@ -41,7 +41,7 @@ class CRM_Contact_Form_Search_Custom_FullText_Participant extends CRM_Contact_Fo
public function isActive() {
$config = CRM_Core_Config::singleton();
return in_array('CiviEvent', $config->enableComponents) &&
- CRM_Core_Permission::check('view event participants');
+ CRM_Core_Permission::check('view event participants');
}
/**
diff --git a/CRM/Contact/Form/Search/Custom/Group.php b/CRM/Contact/Form/Search/Custom/Group.php
index 07d55c8034..4e55632257 100644
--- a/CRM/Contact/Form/Search/Custom/Group.php
+++ b/CRM/Contact/Form/Search/Custom/Group.php
@@ -65,9 +65,9 @@ class CRM_Contact_Form_Search_Custom_Group
//define variables
$this->_allSearch = FALSE;
- $this->_groups = FALSE;
- $this->_tags = FALSE;
- $this->_andOr = CRM_Utils_Array::value('andOr', $this->_formValues);
+ $this->_groups = FALSE;
+ $this->_tags = FALSE;
+ $this->_andOr = CRM_Utils_Array::value('andOr', $this->_formValues);
//make easy to check conditions for groups and tags are
diff --git a/CRM/Contact/Form/Search/Custom/MultipleValues.php b/CRM/Contact/Form/Search/Custom/MultipleValues.php
index 0e2bb5fc9e..9df1ad8b41 100644
--- a/CRM/Contact/Form/Search/Custom/MultipleValues.php
+++ b/CRM/Contact/Form/Search/Custom/MultipleValues.php
@@ -227,10 +227,10 @@ contact_a.sort_name as sort_name,
* @return string
*/
public function where($includeContactIDs = FALSE) {
- $count = 1;
+ $count = 1;
$clause = array();
$params = array();
- $name = CRM_Utils_Array::value('sort_name',
+ $name = CRM_Utils_Array::value('sort_name',
$this->_formValues
);
if ($name != NULL) {
@@ -292,10 +292,10 @@ contact_a.sort_name as sort_name,
foreach ($this->_options as $fieldID => $values) {
$customVal = $valueSeparatedArray = array();
if (in_array($values['attributes']['html_type'],
- array('Radio', 'Select', 'Autocomplete-Select')
- )) {
+ array('Radio', 'Select', 'Autocomplete-Select')
+ )) {
if ($values['attributes']['data_type'] == 'ContactReference' && $row["custom_{$fieldID}"]) {
- $row["custom_{$fieldID}"] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', (int)$row["custom_{$fieldID}"], 'display_name');
+ $row["custom_{$fieldID}"] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', (int) $row["custom_{$fieldID}"], 'display_name');
}
elseif ($row["custom_{$fieldID}"] &&
array_key_exists($row["custom_{$fieldID}"],
@@ -306,8 +306,8 @@ contact_a.sort_name as sort_name,
}
}
elseif (in_array($values['attributes']['html_type'],
- array('CheckBox', 'Multi-Select', 'AdvMulti-Select')
- )) {
+ array('CheckBox', 'Multi-Select', 'AdvMulti-Select')
+ )) {
$valueSeparatedArray = array_filter(explode(CRM_Core_DAO::VALUE_SEPARATOR, $row["custom_{$fieldID}"]));
foreach ($valueSeparatedArray as $val) {
$customVal[] = $values[$val];
@@ -315,8 +315,8 @@ contact_a.sort_name as sort_name,
$row["custom_{$fieldID}"] = implode(', ', $customVal);
}
elseif (in_array($values['attributes']['html_type'],
- array('Multi-Select State/Province', 'Select State/Province')
- )) {
+ array('Multi-Select State/Province', 'Select State/Province')
+ )) {
$valueSeparatedArray = array_filter(explode(CRM_Core_DAO::VALUE_SEPARATOR, $row["custom_{$fieldID}"]));
$stateName = CRM_Core_PseudoConstant::stateProvince();
foreach ($valueSeparatedArray as $val) {
@@ -325,8 +325,8 @@ contact_a.sort_name as sort_name,
$row["custom_{$fieldID}"] = implode(', ', $customVal);
}
elseif (in_array($values['attributes']['html_type'],
- array('Multi-Select Country', 'Select Country')
- )) {
+ array('Multi-Select Country', 'Select Country')
+ )) {
$valueSeparatedArray = array_filter(explode(CRM_Core_DAO::VALUE_SEPARATOR, $row["custom_{$fieldID}"]));
CRM_Core_PseudoConstant::populate($countryNames, 'CRM_Core_DAO_Country',
TRUE, 'name', 'is_active'
diff --git a/CRM/Contact/Form/Search/Custom/PostalMailing.php b/CRM/Contact/Form/Search/Custom/PostalMailing.php
index fded896cd0..58d0366041 100644
--- a/CRM/Contact/Form/Search/Custom/PostalMailing.php
+++ b/CRM/Contact/Form/Search/Custom/PostalMailing.php
@@ -120,8 +120,8 @@ LEFT JOIN civicrm_state_province state_province ON state_province.id = address.
public function where($includeContactIDs = FALSE) {
$params = array();
- $count = 1;
- $clause = array();
+ $count = 1;
+ $clause = array();
$groupID = CRM_Utils_Array::value('group_id',
$this->_formValues
);
diff --git a/CRM/Contact/Form/Search/Custom/PriceSet.php b/CRM/Contact/Form/Search/Custom/PriceSet.php
index fb54e99841..ae6fd34e6e 100644
--- a/CRM/Contact/Form/Search/Custom/PriceSet.php
+++ b/CRM/Contact/Form/Search/Custom/PriceSet.php
@@ -70,9 +70,9 @@ class CRM_Contact_Form_Search_Custom_PriceSet extends CRM_Contact_Form_Search_Cu
}
public function buildTempTable() {
- $randomNum = md5(uniqid());
+ $randomNum = md5(uniqid());
$this->_tableName = "civicrm_temp_custom_{$randomNum}";
- $sql = "
+ $sql = "
CREATE TEMPORARY TABLE {$this->_tableName} (
id int unsigned NOT NULL AUTO_INCREMENT,
contact_id int unsigned NOT NULL,
@@ -82,9 +82,9 @@ CREATE TEMPORARY TABLE {$this->_tableName} (
foreach ($this->_columns as $dontCare => $fieldName) {
if (in_array($fieldName, array(
'contact_id',
- 'participant_id',
- 'display_name',
- ))) {
+ 'participant_id',
+ 'display_name',
+ ))) {
continue;
}
$sql .= "{$fieldName} int default 0,\n";
@@ -290,9 +290,9 @@ contact_a.display_name as display_name";
foreach ($this->_columns as $dontCare => $fieldName) {
if (in_array($fieldName, array(
- 'contact_id',
- 'display_name',
- ))) {
+ 'contact_id',
+ 'display_name',
+ ))) {
continue;
}
$selectClause .= ",\ntempTable.{$fieldName} as {$fieldName}";
diff --git a/CRM/Contact/Form/Search/Custom/Proximity.php b/CRM/Contact/Form/Search/Custom/Proximity.php
index ffa29d149c..de7bb987d4 100644
--- a/CRM/Contact/Form/Search/Custom/Proximity.php
+++ b/CRM/Contact/Form/Search/Custom/Proximity.php
@@ -150,15 +150,15 @@ class CRM_Contact_Form_Search_Custom_Proximity extends CRM_Contact_Form_Search_C
*/
$form->assign('elements', array(
'distance',
- 'prox_distance_unit',
- 'street_address',
- 'city',
- 'postal_code',
- 'country_id',
- 'state_province_id',
- 'group',
- 'tag',
- ));
+ 'prox_distance_unit',
+ 'street_address',
+ 'city',
+ 'postal_code',
+ 'country_id',
+ 'state_province_id',
+ 'group',
+ 'tag',
+ ));
}
/**
diff --git a/CRM/Contact/Form/Search/Custom/RandomSegment.php b/CRM/Contact/Form/Search/Custom/RandomSegment.php
index 6b37c6b050..2ec16741fc 100644
--- a/CRM/Contact/Form/Search/Custom/RandomSegment.php
+++ b/CRM/Contact/Form/Search/Custom/RandomSegment.php
@@ -160,8 +160,8 @@ class CRM_Contact_Form_Search_Custom_RandomSegment extends CRM_Contact_Form_Sear
$this->_tableName = "civicrm_temp_custom_{$randomNum}";
//block for Group search
- $smartGroup = array();
- $group = new CRM_Contact_DAO_Group();
+ $smartGroup = array();
+ $group = new CRM_Contact_DAO_Group();
$group->is_active = 1;
$group->find();
while ($group->fetch()) {
@@ -308,8 +308,8 @@ class CRM_Contact_Form_Search_Custom_RandomSegment extends CRM_Contact_Form_Sear
if (substr($this->_segmentSize, -1) == '%') {
$countSql = "SELECT DISTINCT contact_a.id $from $fromTail
WHERE " . $this->where();
- $dao = CRM_Core_DAO::executeQuery($countSql);
- $totalSize = $dao->N;
+ $dao = CRM_Core_DAO::executeQuery($countSql);
+ $totalSize = $dao->N;
$multiplier = substr($this->_segmentSize, 0, strlen($this->_segmentSize) - 1);
$multiplier /= 100;
$this->_segmentSize = round($totalSize * $multiplier);
diff --git a/CRM/Contact/Form/Search/Custom/Sample.php b/CRM/Contact/Form/Search/Custom/Sample.php
index 93169bcd03..627a749139 100644
--- a/CRM/Contact/Form/Search/Custom/Sample.php
+++ b/CRM/Contact/Form/Search/Custom/Sample.php
@@ -152,9 +152,9 @@ LEFT JOIN civicrm_state_province state_province ON state_province.id = address.s
$params = array();
$where = "contact_a.contact_type = 'Household'";
- $count = 1;
+ $count = 1;
$clause = array();
- $name = CRM_Utils_Array::value('household_name',
+ $name = CRM_Utils_Array::value('household_name',
$this->_formValues
);
if ($name != NULL) {
diff --git a/CRM/Contact/Form/Search/Custom/ZipCodeRange.php b/CRM/Contact/Form/Search/Custom/ZipCodeRange.php
index 767eec099b..966eb4ba9d 100644
--- a/CRM/Contact/Form/Search/Custom/ZipCodeRange.php
+++ b/CRM/Contact/Form/Search/Custom/ZipCodeRange.php
@@ -156,7 +156,7 @@ LEFT JOIN civicrm_email email ON ( email.contact_id = contact_a.id AND
$where = "ROUND(address.postal_code) >= %1 AND ROUND(address.postal_code) <= %2";
$params = array(
- 1 => array(trim($low), 'Integer'),
+ 1 => array(trim($low), 'Integer'),
2 => array(trim($high), 'Integer'),
);
diff --git a/CRM/Contact/Form/Task.php b/CRM/Contact/Form/Task.php
index 2b4da5af51..134c696520 100644
--- a/CRM/Contact/Form/Task.php
+++ b/CRM/Contact/Form/Task.php
@@ -434,15 +434,15 @@ class CRM_Contact_Form_Task extends CRM_Core_Form {
}
// Find related households.
- $relationSelect = "SELECT contact_household.id as household_id, {$contactA} as refContact ";
+ $relationSelect = "SELECT contact_household.id as household_id, {$contactA} as refContact ";
$relationFrom = " FROM civicrm_contact contact_household
INNER JOIN civicrm_relationship crel ON crel.{$contactB} = contact_household.id AND crel.relationship_type_id = {$id} ";
// Check for active relationship status only.
- $today = date('Ymd');
- $relationActive = " AND (crel.is_active = 1 AND ( crel.end_date is NULL OR crel.end_date >= {$today} ) )";
- $relationWhere = " WHERE contact_household.is_deleted = 0 AND crel.{$contactA} IN ( {$relID} ) {$relationActive}";
- $relationGroupBy = " GROUP BY crel.{$contactA}";
+ $today = date('Ymd');
+ $relationActive = " AND (crel.is_active = 1 AND ( crel.end_date is NULL OR crel.end_date >= {$today} ) )";
+ $relationWhere = " WHERE contact_household.is_deleted = 0 AND crel.{$contactA} IN ( {$relID} ) {$relationActive}";
+ $relationGroupBy = " GROUP BY crel.{$contactA}";
$relationQueryString = "$relationSelect $relationFrom $relationWhere $relationGroupBy";
$householdsDAO = CRM_Core_DAO::executeQuery($relationQueryString);
diff --git a/CRM/Contact/Form/Task/AddToGroup.php b/CRM/Contact/Form/Task/AddToGroup.php
index 10852e63da..976ab1694f 100644
--- a/CRM/Contact/Form/Task/AddToGroup.php
+++ b/CRM/Contact/Form/Task/AddToGroup.php
@@ -214,8 +214,8 @@ class CRM_Contact_Form_Task_AddToGroup extends CRM_Contact_Form_Task {
$groupParams['visibility'] = "User and User Admin Only";
if (array_key_exists('group_type', $params) && is_array($params['group_type'])) {
$groupParams['group_type'] = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR,
- array_keys($params['group_type'])
- ) . CRM_Core_DAO::VALUE_SEPARATOR;
+ array_keys($params['group_type'])
+ ) . CRM_Core_DAO::VALUE_SEPARATOR;
}
else {
$groupParams['group_type'] = '';
@@ -223,26 +223,39 @@ class CRM_Contact_Form_Task_AddToGroup extends CRM_Contact_Form_Task {
$groupParams['is_active'] = 1;
$createdGroup = CRM_Contact_BAO_Group::create($groupParams);
- $groupID = $createdGroup->id;
- $groupName = $groupParams['title'];
+ $groupID = $createdGroup->id;
+ $groupName = $groupParams['title'];
}
else {
- $groupID = $params['group_id'];
- $group = CRM_Core_PseudoConstant::group();
+ $groupID = $params['group_id'];
+ $group = CRM_Core_PseudoConstant::group();
$groupName = $group[$groupID];
}
list($total, $added, $notAdded) = CRM_Contact_BAO_GroupContact::addContactsToGroup($this->_contactIds, $groupID);
- $status = array(ts('%count contact added to group', array('count' => $added, 'plural' => '%count contacts added to group')));
+ $status = array(
+ ts('%count contact added to group', array(
+ 'count' => $added,
+ 'plural' => '%count contacts added to group'
+ ))
+ );
if ($notAdded) {
- $status[] = ts('%count contact was already in group', array('count' => $notAdded, 'plural' => '%count contacts were already in group'));
+ $status[] = ts('%count contact was already in group', array(
+ 'count' => $notAdded,
+ 'plural' => '%count contacts were already in group'
+ ));
}
$status = '
- ' . implode('
- ', $status) . '
';
- CRM_Core_Session::setStatus($status, ts('Added Contact to %1', array(1 => $groupName, 'count' => $added, 'plural' => 'Added Contacts to %1')), 'success', array('expires' => 0));
+ CRM_Core_Session::setStatus($status, ts('Added Contact to %1', array(
+ 1 => $groupName,
+ 'count' => $added,
+ 'plural' => 'Added Contacts to %1'
+ )), 'success', array('expires' => 0));
if ($this->_context === 'amtg') {
- CRM_Core_Session::singleton()->pushUserContext(CRM_Utils_System::url('civicrm/group/search', "reset=1&force=1&context=smog&gid=$groupID"));
+ CRM_Core_Session::singleton()
+ ->pushUserContext(CRM_Utils_System::url('civicrm/group/search', "reset=1&force=1&context=smog&gid=$groupID"));
}
}
}
diff --git a/CRM/Contact/Form/Task/AddToHousehold.php b/CRM/Contact/Form/Task/AddToHousehold.php
index 0490eb929e..c4c11ed02d 100644
--- a/CRM/Contact/Form/Task/AddToHousehold.php
+++ b/CRM/Contact/Form/Task/AddToHousehold.php
@@ -65,7 +65,8 @@ class CRM_Contact_Form_Task_AddToHousehold extends CRM_Contact_Form_Task {
$this->add('select', 'relationship_type_id', ts('Relationship Type'),
array(
- '' => ts('- select -')) +
+ '' => ts('- select -')
+ ) +
CRM_Contact_BAO_Relationship::getRelationType("Household"), TRUE
);
@@ -145,10 +146,11 @@ class CRM_Contact_Form_Task_AddToHousehold extends CRM_Contact_Form_Task {
}
if (CRM_Contact_BAO_Relationship::checkDuplicateRelationship($params,
- CRM_Utils_Array::value('contact', $ids),
- // step 2
- $params['contact_check']
- )) {
+ CRM_Utils_Array::value('contact', $ids),
+ // step 2
+ $params['contact_check']
+ )
+ ) {
$duplicate++;
continue;
}
@@ -160,15 +162,33 @@ class CRM_Contact_Form_Task_AddToHousehold extends CRM_Contact_Form_Task {
list($rtype, $a_b) = explode('_', $data['relationship_type_id'], 2);
$relationship = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_RelationshipType', $rtype, "label_$a_b");
- $status = array(ts('%count %2 %3 relationship created', array('count' => $valid, 'plural' => '%count %2 %3 relationships created', 2 => $relationship, 3 => $house)));
+ $status = array(
+ ts('%count %2 %3 relationship created', array(
+ 'count' => $valid,
+ 'plural' => '%count %2 %3 relationships created',
+ 2 => $relationship,
+ 3 => $house
+ ))
+ );
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 => $house));
+ $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 => $house
+ ));
}
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'));
+ $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'
+ ));
}
$status = '
- ' . implode('
- ', $status) . '
';
- CRM_Core_Session::setStatus($status, ts('Relationship created.', array('count' => $valid, 'plural' => 'Relationships created.')), 'success', array('expires' => 0));
+ CRM_Core_Session::setStatus($status, ts('Relationship created.', array(
+ 'count' => $valid,
+ 'plural' => 'Relationships created.'
+ )), 'success', array('expires' => 0));
}
}
@@ -235,8 +255,8 @@ class CRM_Contact_Form_Task_AddToHousehold extends CRM_Contact_Form_Task {
}
// get the count of contact
- $contactBAO = new CRM_Contact_BAO_Contact();
- $query = new CRM_Contact_BAO_Query($searchValues);
+ $contactBAO = new CRM_Contact_BAO_Contact();
+ $query = new CRM_Contact_BAO_Query($searchValues);
$searchCount = $query->searchQuery(0, 0, NULL, TRUE);
$form->set('searchCount', $searchCount);
if ($searchCount <= 50) {
@@ -269,7 +289,7 @@ class CRM_Contact_Form_Task_AddToHousehold extends CRM_Contact_Form_Task {
$contact_type = '
$valid, 'plural' => '%count %2 %3 relationships created', 2 => $relationship, 3 => $org)));
+ $status = array(
+ ts('%count %2 %3 relationship created', array(
+ 'count' => $valid,
+ 'plural' => '%count %2 %3 relationships created',
+ 2 => $relationship,
+ 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));
+ $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
+ ));
}
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'));
+ $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'
+ ));
}
$status = '
- ' . implode('
- ', $status) . '
';
- CRM_Core_Session::setStatus($status, ts('Relationship created.', array('count' => $valid, 'plural' => 'Relationships created.')), 'success', array('expires' => 0));
+ CRM_Core_Session::setStatus($status, ts('Relationship created.', array(
+ 'count' => $valid,
+ 'plural' => 'Relationships created.'
+ )), 'success', array('expires' => 0));
}
}
diff --git a/CRM/Contact/Form/Task/AddToTag.php b/CRM/Contact/Form/Task/AddToTag.php
index e6e4f15d59..91811916f2 100644
--- a/CRM/Contact/Form/Task/AddToTag.php
+++ b/CRM/Contact/Form/Task/AddToTag.php
@@ -146,7 +146,10 @@ class CRM_Contact_Form_Task_AddToTag extends CRM_Contact_Form_Task {
$status = array(ts('%count contact tagged', array('count' => $added, 'plural' => '%count contacts tagged')));
if ($notAdded) {
- $status[] = ts('%count contact already had this tag', array('count' => $notAdded, 'plural' => '%count contacts already had this tag'));
+ $status[] = ts('%count contact already had this tag', array(
+ 'count' => $notAdded,
+ 'plural' => '%count contacts already had this tag'
+ ));
}
$status = '
- ' . implode('
- ', $status) . '
';
CRM_Core_Session::setStatus($status, ts("Added Tag
%1", array(1 => $this->_tags[$key])), 'success', array('expires' => 0));
diff --git a/CRM/Contact/Form/Task/AlterPreferences.php b/CRM/Contact/Form/Task/AlterPreferences.php
index beb116ce8f..f8c4c746b8 100644
--- a/CRM/Contact/Form/Task/AlterPreferences.php
+++ b/CRM/Contact/Form/Task/AlterPreferences.php
@@ -45,7 +45,7 @@ class CRM_Contact_Form_Task_AlterPreferences extends CRM_Contact_Form_Task {
*
* @return void
*/
- public function buildQuickForm() {
+ public function buildQuickForm() {
// add select for preferences
$options = array(ts('Add Selected Options'), ts('Remove selected options'));
diff --git a/CRM/Contact/Form/Task/Batch.php b/CRM/Contact/Form/Task/Batch.php
index f56373ce8b..75f10ff0f8 100644
--- a/CRM/Contact/Form/Task/Batch.php
+++ b/CRM/Contact/Form/Task/Batch.php
@@ -130,8 +130,12 @@ class CRM_Contact_Form_Task_Batch extends CRM_Contact_Form_Task {
// if below fields are missing we should not reset sort name / display name
// CRM-6794
$preserveDefaultsArray = array(
- 'first_name', 'last_name', 'middle_name',
- 'organization_name', 'prefix_id', 'suffix_id',
+ 'first_name',
+ 'last_name',
+ 'middle_name',
+ 'organization_name',
+ 'prefix_id',
+ 'suffix_id',
'household_name',
);
@@ -226,8 +230,8 @@ class CRM_Contact_Form_Task_Batch extends CRM_Contact_Form_Task {
public function postProcess() {
$params = $this->exportValues();
- $ufGroupId = $this->get('ufGroupId');
- $notify = NULL;
+ $ufGroupId = $this->get('ufGroupId');
+ $notify = NULL;
$inValidSubtypeCnt = 0;
//send profile notification email if 'notify' field is set
$notify = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $ufGroupId, 'notify');
@@ -254,7 +258,10 @@ class CRM_Contact_Form_Task_Batch extends CRM_Contact_Form_Task {
CRM_Core_Session::setStatus('', ts("Updates Saved"), 'success');
if ($inValidSubtypeCnt) {
- CRM_Core_Session::setStatus(ts('Contact Subtype field of 1 contact has not been updated.', array('plural' => 'Contact Subtype field of %count contacts has not been updated.', 'count' => $inValidSubtypeCnt)), ts('Invalid Subtype'));
+ CRM_Core_Session::setStatus(ts('Contact Subtype field of 1 contact has not been updated.', array(
+ 'plural' => 'Contact Subtype field of %count contacts has not been updated.',
+ 'count' => $inValidSubtypeCnt
+ )), ts('Invalid Subtype'));
}
}
diff --git a/CRM/Contact/Form/Task/Delete.php b/CRM/Contact/Form/Task/Delete.php
index 264508fef0..2c85b7e38a 100644
--- a/CRM/Contact/Form/Task/Delete.php
+++ b/CRM/Contact/Form/Task/Delete.php
@@ -67,9 +67,9 @@ class CRM_Contact_Form_Task_Delete extends CRM_Contact_Form_Task {
$this->_searchKey = CRM_Utils_Request::retrieve('key', 'String', $this);
// sort out whether it’s a delete-to-trash, delete-into-oblivion or restore (and let the template know)
- $values = $this->controller->exportValues();
+ $values = $this->controller->exportValues();
$this->_skipUndelete = (CRM_Core_Permission::check('access deleted contacts') and (CRM_Utils_Request::retrieve('skip_undelete', 'Boolean', $this) or CRM_Utils_Array::value('task', $values) == CRM_Contact_Task::DELETE_PERMANENTLY));
- $this->_restore = (CRM_Utils_Request::retrieve('restore', 'Boolean', $this) or CRM_Utils_Array::value('task', $values) == CRM_Contact_Task::RESTORE);
+ $this->_restore = (CRM_Utils_Request::retrieve('restore', 'Boolean', $this) or CRM_Utils_Array::value('task', $values) == CRM_Contact_Task::RESTORE);
if ($this->_restore && !CRM_Core_Permission::check('access deleted contacts')) {
CRM_Core_Error::fatal(ts('You do not have permission to access this contact.'));
@@ -126,11 +126,17 @@ class CRM_Contact_Form_Task_Delete extends CRM_Contact_Form_Task {
if ($sharedAddressCount > 0) {
if (count($this->_contactIds) > 1) {
// more than one contact deleted
- $message = ts('One of the selected contacts has an address record that is shared with 1 other contact.', array('plural' => 'One or more selected contacts have address records which are shared with %count other contacts.', 'count' => $sharedAddressCount));
+ $message = ts('One of the selected contacts has an address record that is shared with 1 other contact.', array(
+ 'plural' => 'One or more selected contacts have address records which are shared with %count other contacts.',
+ 'count' => $sharedAddressCount
+ ));
}
else {
// only one contact deleted
- $message = ts('This contact has an address record which is shared with 1 other contact.', array('plural' => 'This contact has an address record which is shared with %count other contacts.', 'count' => $sharedAddressCount));
+ $message = ts('This contact has an address record which is shared with 1 other contact.', array(
+ 'plural' => 'This contact has an address record which is shared with %count other contacts.',
+ 'count' => $sharedAddressCount
+ ));
}
CRM_Core_Session::setStatus($message . ' ' . ts('Shared addresses will not be removed or altered but will no longer be shared.'), ts('Shared Addesses Owner'));
}
@@ -161,8 +167,8 @@ class CRM_Contact_Form_Task_Delete extends CRM_Contact_Form_Task {
$session = CRM_Core_Session::singleton();
$session->replaceUserContext(CRM_Utils_System::url('civicrm/contact/view',
- 'reset=1&cid=' . $this->_contactIds[0] . $urlParams
- ));
+ 'reset=1&cid=' . $this->_contactIds[0] . $urlParams
+ ));
$this->addDefaultButtons($label, 'done', 'cancel');
}
else {
@@ -204,7 +210,7 @@ class CRM_Contact_Form_Task_Delete extends CRM_Contact_Form_Task {
$session = CRM_Core_Session::singleton();
$currentUserId = $session->get('userID');
- $context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'basic');
+ $context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'basic');
$urlParams = 'force=1';
$urlString = "civicrm/contact/search/$context";
@@ -249,13 +255,25 @@ class CRM_Contact_Form_Task_Delete extends CRM_Contact_Form_Task {
$title = ts('Deleted');
if ($this->_restore) {
$title = ts('Restored');
- $status = ts('%1 has been restored from the trash.', array(1 => $name, 'plural' => '%count contacts restored from trash.', 'count' => $deleted));
+ $status = ts('%1 has been restored from the trash.', array(
+ 1 => $name,
+ 'plural' => '%count contacts restored from trash.',
+ 'count' => $deleted
+ ));
}
elseif ($this->_skipUndelete) {
- $status = ts('%1 has been permanently deleted.', array(1 => $name, 'plural' => '%count contacts permanently deleted.', 'count' => $deleted));
+ $status = ts('%1 has been permanently deleted.', array(
+ 1 => $name,
+ 'plural' => '%count contacts permanently deleted.',
+ 'count' => $deleted
+ ));
}
else {
- $status = ts('%1 has been moved to the trash.', array(1 => $name, 'plural' => '%count contacts moved to trash.', 'count' => $deleted));
+ $status = ts('%1 has been moved to the trash.', array(
+ 1 => $name,
+ 'plural' => '%count contacts moved to trash.',
+ 'count' => $deleted
+ ));
}
$session->setStatus($status, $title, 'success');
}
diff --git a/CRM/Contact/Form/Task/Email.php b/CRM/Contact/Form/Task/Email.php
index e5a89b4c64..a31bceb0a0 100644
--- a/CRM/Contact/Form/Task/Email.php
+++ b/CRM/Contact/Form/Task/Email.php
@@ -118,7 +118,7 @@ class CRM_Contact_Form_Task_Email extends CRM_Contact_Form_Task {
}
if ($cid) {
- $cid = explode(',',$cid);
+ $cid = explode(',', $cid);
$displayName = array();
foreach ($cid as $val) {
diff --git a/CRM/Contact/Form/Task/EmailCommon.php b/CRM/Contact/Form/Task/EmailCommon.php
index 2b8850654c..9907ea8f58 100644
--- a/CRM/Contact/Form/Task/EmailCommon.php
+++ b/CRM/Contact/Form/Task/EmailCommon.php
@@ -152,8 +152,8 @@ class CRM_Contact_Form_Task_EmailCommon {
$emailAttributes = array(
'class' => 'huge',
);
- $to = $form->add('text', 'to', ts('To'), $emailAttributes, TRUE);
- $cc = $form->add('text', 'cc_id', ts('CC'), $emailAttributes);
+ $to = $form->add('text', 'to', ts('To'), $emailAttributes, TRUE);
+ $cc = $form->add('text', 'cc_id', ts('CC'), $emailAttributes);
$bcc = $form->add('text', 'bcc_id', ts('BCC'), $emailAttributes);
$setDefaults = TRUE;
@@ -357,16 +357,16 @@ class CRM_Contact_Form_Task_EmailCommon {
public static function postProcess(&$form) {
if (count($form->_contactIds) > self::MAX_EMAILS_KILL_SWITCH) {
CRM_Core_Error::fatal(ts('Please do not use this task to send a lot of emails (greater than %1). We recommend using CiviMail instead.',
- array(1 => self::MAX_EMAILS_KILL_SWITCH)
- ));
+ array(1 => self::MAX_EMAILS_KILL_SWITCH)
+ ));
}
// check and ensure that
$formValues = $form->controller->exportValues($form->getName());
$fromEmail = $formValues['fromEmailAddress'];
- $from = CRM_Utils_Array::value($fromEmail, $form->_emails);
- $subject = $formValues['subject'];
+ $from = CRM_Utils_Array::value($fromEmail, $form->_emails);
+ $subject = $formValues['subject'];
// CRM-13378: Append CC and BCC information at the end of Activity Details and format cc and bcc fields
$elements = array('cc_id', 'bcc_id');
@@ -451,8 +451,8 @@ class CRM_Contact_Form_Task_EmailCommon {
// we should allow same emails for different contacts
$emailKey = "{$contactId}::{$email}";
if (!in_array($emailKey, $tempEmails)) {
- $tempEmails[] = $emailKey;
- $details = $form->_contactDetails[$contactId];
+ $tempEmails[] = $emailKey;
+ $details = $form->_contactDetails[$contactId];
$details['email'] = $email;
unset($details['email_id']);
$formattedContactDetails[] = $details;
@@ -477,7 +477,10 @@ class CRM_Contact_Form_Task_EmailCommon {
if ($sent) {
$count_success = count($form->_toContactDetails);
- CRM_Core_Session::setStatus(ts('One message was sent successfully.', array('plural' => '%count messages were sent successfully.', 'count' => $count_success)), ts('Message Sent', array('plural' => 'Messages Sent', 'count' => $count_success)), 'success');
+ CRM_Core_Session::setStatus(ts('One message was sent successfully.', array(
+ 'plural' => '%count messages were sent successfully.',
+ 'count' => $count_success
+ )), ts('Message Sent', array('plural' => 'Messages Sent', 'count' => $count_success)), 'success');
}
// Display the name and number of contacts for those email is not sent.
@@ -489,13 +492,16 @@ class CRM_Contact_Form_Task_EmailCommon {
if ($emailsNotSent) {
$not_sent = array();
foreach ($emailsNotSent as $contactId => $values) {
- $displayName = $values['display_name'];
- $email = $values['email'];
+ $displayName = $values['display_name'];
+ $email = $values['email'];
$contactViewUrl = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid=$contactId");
$not_sent[] = "
$displayName" . ($values['on_hold'] ? '(' . ts('on hold') . ')' : '');
}
$status = '(' . ts('because no email address on file or communication preferences specify DO NOT EMAIL or Contact is deceased or Primary email address is On Hold') . ')
- ' . implode('
- ', $not_sent) . '
';
- CRM_Core_Session::setStatus($status, ts('One Message Not Sent', array('count' => count($emailsNotSent), 'plural' => '%count Messages Not Sent')), 'info');
+ CRM_Core_Session::setStatus($status, ts('One Message Not Sent', array(
+ 'count' => count($emailsNotSent),
+ 'plural' => '%count Messages Not Sent'
+ )), 'info');
}
if (isset($form->_caseId)) {
diff --git a/CRM/Contact/Form/Task/Label.php b/CRM/Contact/Form/Task/Label.php
index 431cecb270..9240375488 100644
--- a/CRM/Contact/Form/Task/Label.php
+++ b/CRM/Contact/Form/Task/Label.php
@@ -67,7 +67,8 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task {
// add select for Location Type
$this->addElement('select', 'location_type_id', ts('Select Location'),
array(
- '' => ts('Primary')) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'), TRUE
+ '' => ts('Primary')
+ ) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'), TRUE
);
// checkbox for SKIP contacts with Do Not Mail privacy option
@@ -113,8 +114,8 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task {
* @return void
*/
public function postProcess() {
- $fv = $this->controller->exportValues($this->_name);
- $config = CRM_Core_Config::singleton();
+ $fv = $this->controller->exportValues($this->_name);
+ $config = CRM_Core_Config::singleton();
$locName = NULL;
//get the address format sequence from the config file
$mailingFormat = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
@@ -182,11 +183,11 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task {
//get the contacts information
$params = array();
if (!empty($fv['location_type_id'])) {
- $locType = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
- $locName = $locType[$fv['location_type_id']];
- $location = array('location' => array("{$locName}" => $address));
+ $locType = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
+ $locName = $locType[$fv['location_type_id']];
+ $location = array('location' => array("{$locName}" => $address));
$returnProperties = array_merge($returnProperties, $location);
- $params[] = array('location_type', '=', array($fv['location_type_id'] => 1), 0, 0);
+ $params[] = array('location_type', '=', array($fv['location_type_id'] => 1), 0, 0);
}
else {
$returnProperties = array_merge($returnProperties, $address);
@@ -197,7 +198,10 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task {
foreach ($this->_contactIds as $key => $contactID) {
$params[] = array(
CRM_Core_Form::CB_PREFIX . $contactID,
- '=', 1, 0, 0,
+ '=',
+ 1,
+ 0,
+ 0,
);
}
@@ -218,8 +222,8 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task {
//get the total number of contacts to fetch from database.
$numberofContacts = count($this->_contactIds);
- $query = new CRM_Contact_BAO_Query($params, $returnProperties);
- $details = $query->apiQuery($params, $returnProperties, NULL, NULL, 0, $numberofContacts);
+ $query = new CRM_Contact_BAO_Query($params, $returnProperties);
+ $details = $query->apiQuery($params, $returnProperties, NULL, NULL, 0, $numberofContacts);
$messageToken = CRM_Utils_Token::getTokens($mailingFormat);
@@ -279,11 +283,16 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task {
$valuesothers = CRM_Core_BAO_Location::getValues($paramsothers, $valuesothers);
if (!empty($fv['location_type_id'])) {
foreach ($valuesothers as $vals) {
- if (CRM_Utils_Array::value('location_type_id', $vals) ==
- CRM_Utils_Array::value('location_type_id', $fv)) {
+ if (CRM_Utils_Array::value('location_type_id', $vals) ==
+ CRM_Utils_Array::value('location_type_id', $fv)
+ ) {
foreach ($vals as $k => $v) {
if (in_array($k, array(
- 'email', 'phone', 'im', 'openid'))) {
+ 'email',
+ 'phone',
+ 'im',
+ 'openid'
+ ))) {
if ($k == 'im') {
$rows[$value][$k] = $v['1']['name'];
}
@@ -324,7 +333,7 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task {
// format the addresses according to CIVICRM_ADDRESS_FORMAT (CRM-1327)
foreach ($rows as $id => $row) {
if ($commMethods = CRM_Utils_Array::value('preferred_communication_method', $row)) {
- $val = array_filter(explode(CRM_Core_DAO::VALUE_SEPARATOR, $commMethods));
+ $val = array_filter(explode(CRM_Core_DAO::VALUE_SEPARATOR, $commMethods));
$comm = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'preferred_communication_method');
$temp = array();
foreach ($val as $vals) {
@@ -366,12 +375,13 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task {
public static function tokenIsFound($contact, $mailingFormatProperties, $tokenFields) {
foreach (array_merge($mailingFormatProperties, array_fill_keys($tokenFields, 1)) as $key => $dontCare) {
//we should not consider addressee for data exists, CRM-6025
- if ($key != 'addressee' && !empty($contact[$key])) {
+ if ($key != 'addressee' && !empty($contact[$key])) {
return TRUE;
}
}
return FALSE;
}
+
/**
* Create labels (pdf)
*
diff --git a/CRM/Contact/Form/Task/LabelCommon.php b/CRM/Contact/Form/Task/LabelCommon.php
index ff309d5b18..77b009a42e 100644
--- a/CRM/Contact/Form/Task/LabelCommon.php
+++ b/CRM/Contact/Form/Task/LabelCommon.php
@@ -125,7 +125,10 @@ class CRM_Contact_Form_Task_LabelCommon {
foreach ($contactIDs as $key => $contactID) {
$params[] = array(
CRM_Core_Form::CB_PREFIX . $contactID,
- '=', 1, 0, 0,
+ '=',
+ 1,
+ 0,
+ 0,
);
}
@@ -137,11 +140,11 @@ class CRM_Contact_Form_Task_LabelCommon {
$params[] = array('is_deceased', '=', 0, 0, 0);
if ($locationTypeID) {
- $locType = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
- $locName = $locType[$locationTypeID];
- $location = array('location' => array("{$locName}" => $addressReturnProperties));
+ $locType = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
+ $locName = $locType[$locationTypeID];
+ $location = array('location' => array("{$locName}" => $addressReturnProperties));
$returnProperties = array_merge($returnProperties, $location);
- $params[] = array('location_type', '=', array($locationTypeID => 1), 0, 0);
+ $params[] = array('location_type', '=', array($locationTypeID => 1), 0, 0);
}
else {
$returnProperties = array_merge($returnProperties, $addressReturnProperties);
@@ -158,8 +161,8 @@ class CRM_Contact_Form_Task_LabelCommon {
$numberofContacts = count($contactIDs);
//this does the same as calling civicrm_api3('contact, get, array('id' => array('IN' => $this->_contactIds)
// except it also handles multiple locations
- $query = new CRM_Contact_BAO_Query($params, $returnProperties);
- $details = $query->apiQuery($params, $returnProperties, NULL, NULL, 0, $numberofContacts);
+ $query = new CRM_Contact_BAO_Query($params, $returnProperties);
+ $details = $query->apiQuery($params, $returnProperties, NULL, NULL, 0, $numberofContacts);
$messageToken = CRM_Utils_Token::getTokens($mailingFormat);
$details = $details[0];
@@ -204,10 +207,15 @@ class CRM_Contact_Form_Task_LabelCommon {
if ($locationTypeID) {
foreach ($valuesothers as $vals) {
if (CRM_Utils_Array::value('location_type_id', $vals) ==
- $locationTypeID) {
+ $locationTypeID
+ ) {
foreach ($vals as $k => $v) {
if (in_array($k, array(
- 'email', 'phone', 'im', 'openid'))) {
+ 'email',
+ 'phone',
+ 'im',
+ 'openid'
+ ))) {
if ($k == 'im') {
$rows[$value][$k] = $v['1']['name'];
}
@@ -285,7 +293,7 @@ class CRM_Contact_Form_Task_LabelCommon {
NULL,
$messageToken,
'CRM_Contact_Form_Task_LabelCommon'
- );
+ );
CRM_Utils_Hook::tokens($tokens);
@@ -318,19 +326,19 @@ class CRM_Contact_Form_Task_LabelCommon {
# exclude individuals belonging to selected households
foreach ($households as $household_id => $row) {
- $dao = new CRM_Contact_DAO_Relationship();
- $dao->contact_id_b = $household_id;
- $dao->find();
- while ($dao->fetch()) {
- $individual_id = $dao->contact_id_a;
- if (array_key_exists($individual_id, $individuals)) {
- unset($individuals[$individual_id]);
- }
- }
+ $dao = new CRM_Contact_DAO_Relationship();
+ $dao->contact_id_b = $household_id;
+ $dao->find();
+ while ($dao->fetch()) {
+ $individual_id = $dao->contact_id_a;
+ if (array_key_exists($individual_id, $individuals)) {
+ unset($individuals[$individual_id]);
+ }
+ }
}
# merge back individuals and households
$rows = array_merge($individuals, $households);
return $rows;
- }
+ }
}
diff --git a/CRM/Contact/Form/Task/Map.php b/CRM/Contact/Form/Task/Map.php
index c1f4e8541f..0a225a2ab5 100644
--- a/CRM/Contact/Form/Task/Map.php
+++ b/CRM/Contact/Form/Task/Map.php
@@ -211,7 +211,7 @@ class CRM_Contact_Form_Task_Map extends CRM_Contact_Form_Task {
$sumLat = $sumLng = 0;
$maxLat = $maxLng = -400;
- $minLat = $minLng = + 400;
+ $minLat = $minLng = 400;
foreach ($locations as $location) {
$sumLat += $location['lat'];
$sumLng += $location['lng'];
@@ -236,8 +236,8 @@ class CRM_Contact_Form_Task_Map extends CRM_Contact_Form_Task {
'lng' => (float ) $sumLng / count($locations),
);
$span = array(
- 'lat' => (float )($maxLat - $minLat),
- 'lng' => (float )($maxLng - $minLng),
+ 'lat' => (float ) ($maxLat - $minLat),
+ 'lng' => (float ) ($maxLng - $minLng),
);
$page->assign_by_ref('center', $center);
$page->assign_by_ref('span', $span);
diff --git a/CRM/Contact/Form/Task/Merge.php b/CRM/Contact/Form/Task/Merge.php
index 93b01e3662..c8099dce4d 100644
--- a/CRM/Contact/Form/Task/Merge.php
+++ b/CRM/Contact/Form/Task/Merge.php
@@ -63,7 +63,7 @@ class CRM_Contact_Form_Task_Merge extends CRM_Contact_Form_Task {
while ($contact->fetch()) {
$contactTypes[$contact->contact_type] = TRUE;
if (count($contactTypes) > 1)
- break;
+ break;
}
if (count($contactTypes) > 1) {
$statusMsg = ts('Selected records must all be the same contact type (i.e. all Individuals).');
diff --git a/CRM/Contact/Form/Task/PDFLetterCommon.php b/CRM/Contact/Form/Task/PDFLetterCommon.php
index 8ebdc65f10..b6a6b55c51 100644
--- a/CRM/Contact/Form/Task/PDFLetterCommon.php
+++ b/CRM/Contact/Form/Task/PDFLetterCommon.php
@@ -47,9 +47,9 @@ class CRM_Contact_Form_Task_PDFLetterCommon {
* @return void
*/
public static function preProcess(&$form) {
- $messageText = array();
+ $messageText = array();
$messageSubject = array();
- $dao = new CRM_Core_BAO_MessageTemplate();
+ $dao = new CRM_Core_BAO_MessageTemplate();
$dao->is_active = 1;
$dao->find();
while ($dao->fetch()) {
@@ -370,10 +370,10 @@ class CRM_Contact_Form_Task_PDFLetterCommon {
*/
public static function createActivities($form, $html_message, $contactIds) {
//Added for CRM-12682: Add activity subject and campaign fields
- $formValues = $form->controller->exportValues($form->getName());
+ $formValues = $form->controller->exportValues($form->getName());
- $session = CRM_Core_Session::singleton();
- $userID = $session->get('userID');
+ $session = CRM_Core_Session::singleton();
+ $userID = $session->get('userID');
$activityTypeID = CRM_Core_OptionGroup::getValue(
'activity_type',
'Print PDF Letter',
@@ -439,8 +439,8 @@ class CRM_Contact_Form_Task_PDFLetterCommon {
$matches = array();
if (preg_match('/^( )+/', $msg, $matches)) {
$spaceLen = strlen($matches[0]) / 6;
- $trimMsg = ltrim($msg, ' ');
- $charLen = strlen($trimMsg);
+ $trimMsg = ltrim($msg, ' ');
+ $charLen = strlen($trimMsg);
$totalLen = $charLen + $spaceLen;
if ($totalLen > 100) {
$spacesCount = 10;
diff --git a/CRM/Contact/Form/Task/PickProfile.php b/CRM/Contact/Form/Task/PickProfile.php
index c59a397687..b2cc75dfb4 100644
--- a/CRM/Contact/Form/Task/PickProfile.php
+++ b/CRM/Contact/Form/Task/PickProfile.php
@@ -77,7 +77,10 @@ class CRM_Contact_Form_Task_PickProfile extends CRM_Contact_Form_Task {
$validate = FALSE;
//validations
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))), ts('Maximum Exceeded'), 'error');
+ 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)
+ )), ts('Maximum Exceeded'), 'error');
$validate = TRUE;
}
diff --git a/CRM/Contact/Form/Task/Print.php b/CRM/Contact/Form/Task/Print.php
index 11747d38b8..0b4995e53d 100644
--- a/CRM/Contact/Form/Task/Print.php
+++ b/CRM/Contact/Form/Task/Print.php
@@ -56,12 +56,15 @@ class CRM_Contact_Form_Task_Print extends CRM_Contact_Form_Task {
if (!empty($this->_contactIds)) {
//using _contactIds field for creating params for query so that multiple selections on multiple pages
//can be printed.
- foreach ($this->_contactIds as $contactId) {
+ foreach ($this->_contactIds as $contactId) {
$params[] = array(
CRM_Core_Form::CB_PREFIX . $contactId,
'=',
- 1, 0, 0);
- }
+ 1,
+ 0,
+ 0
+ );
+ }
}
// create the selector, controller and run - store results in session
@@ -85,13 +88,13 @@ class CRM_Contact_Form_Task_Print extends CRM_Contact_Form_Task {
$returnP = isset($returnPropeties) ? $returnPropeties : "";
$customSearchClass = $this->get('customSearchClass');
- $selector = new $selectorName($customSearchClass,
- $fv,
- $params,
- $returnP,
- $this->_action,
- $includeContactIds
- );
+ $selector = new $selectorName($customSearchClass,
+ $fv,
+ $params,
+ $returnP,
+ $this->_action,
+ $includeContactIds
+ );
$controller = new CRM_Core_Selector_Controller($selector,
NULL,
$sortID,
diff --git a/CRM/Contact/Form/Task/ProximityCommon.php b/CRM/Contact/Form/Task/ProximityCommon.php
index 54313f2765..fea9dbe3af 100644
--- a/CRM/Contact/Form/Task/ProximityCommon.php
+++ b/CRM/Contact/Form/Task/ProximityCommon.php
@@ -144,8 +144,8 @@ class CRM_Contact_Form_Task_ProximityCommon extends CRM_Contact_Form_Task {
* the default array reference
*/
public function setDefaultValues($form) {
- $defaults = array();
- $config = CRM_Core_Config::singleton();
+ $defaults = array();
+ $config = CRM_Core_Config::singleton();
$countryDefault = $config->defaultContactCountry;
if ($countryDefault) {
diff --git a/CRM/Contact/Form/Task/RemoveFromGroup.php b/CRM/Contact/Form/Task/RemoveFromGroup.php
index c07fb53dc8..f96c4141a0 100644
--- a/CRM/Contact/Form/Task/RemoveFromGroup.php
+++ b/CRM/Contact/Form/Task/RemoveFromGroup.php
@@ -83,11 +83,23 @@ class CRM_Contact_Form_Task_RemoveFromGroup extends CRM_Contact_Form_Task {
list($total, $removed, $notRemoved) = CRM_Contact_BAO_GroupContact::removeContactsFromGroup($this->_contactIds, $groupId);
- $status = array(ts("%count contact removed from '%2'", array('count' => $removed, 'plural' => "%count contacts removed from '%2'", 2 => $group[$groupId])));
+ $status = array(
+ ts("%count contact removed from '%2'", array(
+ 'count' => $removed,
+ 'plural' => "%count contacts removed from '%2'",
+ 2 => $group[$groupId]
+ ))
+ );
if ($notRemoved) {
- $status[] = ts('1 contact was already not in this group', array('count' => $notRemoved, 'plural' => '%count contacts were already not in this group'));
+ $status[] = ts('1 contact was already not in this group', array(
+ 'count' => $notRemoved,
+ 'plural' => '%count contacts were already not in this group'
+ ));
}
$status = '
- ' . implode('
- ', $status) . '
';
- CRM_Core_Session::setStatus($status, ts("Removed Contact From Group", array('plural' => "Removed Contacts From Group", 'count' => $removed)), 'success', array('expires' => 0));
+ CRM_Core_Session::setStatus($status, ts("Removed Contact From Group", array(
+ 'plural' => "Removed Contacts From Group",
+ 'count' => $removed
+ )), 'success', array('expires' => 0));
}
}
diff --git a/CRM/Contact/Form/Task/RemoveFromTag.php b/CRM/Contact/Form/Task/RemoveFromTag.php
index cc1cf3954b..0c19f2109d 100644
--- a/CRM/Contact/Form/Task/RemoveFromTag.php
+++ b/CRM/Contact/Form/Task/RemoveFromTag.php
@@ -134,9 +134,17 @@ class CRM_Contact_Form_Task_RemoveFromTag extends CRM_Contact_Form_Task {
list($total, $removed, $notRemoved) = CRM_Core_BAO_EntityTag::removeEntitiesFromTag($this->_contactIds, $key);
- $status = array(ts('%count contact un-tagged', array('count' => $removed, 'plural' => '%count contacts un-tagged')));
+ $status = array(
+ ts('%count contact un-tagged', array(
+ 'count' => $removed,
+ 'plural' => '%count contacts un-tagged'
+ ))
+ );
if ($notRemoved) {
- $status[] = ts('1 contact already did not have this tag', array('count' => $notRemoved, 'plural' => '%count contacts already did not have this tag'));
+ $status[] = ts('1 contact already did not have this tag', array(
+ 'count' => $notRemoved,
+ 'plural' => '%count contacts already did not have this tag'
+ ));
}
$status = '
- ' . implode('
- ', $status) . '
';
CRM_Core_Session::setStatus($status, ts("Removed Tag
%1", array(1 => $this->_tags[$key])), 'success', array('expires' => 0));
diff --git a/CRM/Contact/Form/Task/Result.php b/CRM/Contact/Form/Task/Result.php
index 60d03f90be..3696721a67 100644
--- a/CRM/Contact/Form/Task/Result.php
+++ b/CRM/Contact/Form/Task/Result.php
@@ -53,7 +53,9 @@ class CRM_Contact_Form_Task_Result extends CRM_Contact_Form_Task {
$context = $this->get('context');
if (in_array($context, array(
- 'smog', 'amtg'))) {
+ 'smog',
+ 'amtg'
+ ))) {
$urlParams = 'reset=1&force=1&context=smog&gid=';
$urlParams .= ($context == 'smog') ? $this->get('gid') : $this->get('amtgID');
$session->replaceUserContext(CRM_Utils_System::url('civicrm/group/search', $urlParams));
diff --git a/CRM/Contact/Form/Task/SMSCommon.php b/CRM/Contact/Form/Task/SMSCommon.php
index e1bca8a50e..23aa32eb7a 100644
--- a/CRM/Contact/Form/Task/SMSCommon.php
+++ b/CRM/Contact/Form/Task/SMSCommon.php
@@ -76,8 +76,8 @@ class CRM_Contact_Form_Task_SMSCommon {
}
if ($activityCheck == count($form->_activityHolderIds)) {
CRM_Core_Error::statusBounce(ts("The Reply SMS Could only be sent for activities with '%1' subject.",
- array(1 => self::RECIEVED_SMS_ACTIVITY_SUBJECT)
- ));
+ array(1 => self::RECIEVED_SMS_ACTIVITY_SUBJECT)
+ ));
}
}
}
@@ -161,14 +161,16 @@ class CRM_Contact_Form_Task_SMSCommon {
$errorMess = "";
if ($extendTargetContacts) {
$errorMess = ts('One selected activity consists of more than one target contact.', array(
- 'count' => $extendTargetContacts,
- 'plural' => '%count selected activities consist of more than one target contact.'));
+ 'count' => $extendTargetContacts,
+ 'plural' => '%count selected activities consist of more than one target contact.'
+ ));
}
if ($invalidActivity) {
$errorMess = ($errorMess ? ' ' : '');
$errorMess .= ts('The selected activity is invalid.', array(
- 'count' => $invalidActivity,
- 'plural' => '%count selected activities are invalid.'));
+ 'count' => $invalidActivity,
+ 'plural' => '%count selected activities are invalid.'
+ ));
}
CRM_Core_Error::statusBounce(ts("%1: SMS Reply will not be sent.", array(1 => $errorMess)));
}
@@ -214,12 +216,13 @@ class CRM_Contact_Form_Task_SMSCommon {
//if phone is not primary check if non-primary phone is "Mobile"
if (!empty($value['phone'])
- && $value['phone_type_id'] != CRM_Utils_Array::value('Mobile', $phoneTypes) && empty($value['is_deceased'])) {
+ && $value['phone_type_id'] != CRM_Utils_Array::value('Mobile', $phoneTypes) && empty($value['is_deceased'])
+ ) {
$filter = array('do_not_sms' => 0);
$contactPhones = CRM_Core_BAO_Phone::allPhones($contactId, FALSE, 'Mobile', $filter);
if (count($contactPhones) > 0) {
$mobilePhone = CRM_Utils_Array::retrieveValueRecursive($contactPhones, 'phone');
- $form->_contactDetails[$contactId]['phone_id'] = CRM_Utils_Array::retrieveValueRecursive($contactPhones, 'id');
+ $form->_contactDetails[$contactId]['phone_id'] = CRM_Utils_Array::retrieveValueRecursive($contactPhones, 'id');
$form->_contactDetails[$contactId]['phone'] = $mobilePhone;
$form->_contactDetails[$contactId]['phone_type_id'] = CRM_Utils_Array::value('Mobile', $phoneTypes);
}
@@ -402,7 +405,10 @@ class CRM_Contact_Form_Task_SMSCommon {
);
if ($countSuccess > 0) {
- CRM_Core_Session::setStatus(ts('One message was sent successfully.', array('plural' => '%count messages were sent successfully.', 'count' => $countSuccess)), ts('Message Sent', array('plural' => 'Messages Sent', 'count' => $countSuccess)), 'success');
+ CRM_Core_Session::setStatus(ts('One message was sent successfully.', array(
+ 'plural' => '%count messages were sent successfully.',
+ 'count' => $countSuccess
+ )), ts('Message Sent', array('plural' => 'Messages Sent', 'count' => $countSuccess)), 'success');
}
if (is_array($sent)) {
@@ -413,7 +419,10 @@ class CRM_Contact_Form_Task_SMSCommon {
$status .= '
' . $errMsg . '';
}
$status .= '';
- CRM_Core_Session::setStatus($status, ts('One Message Not Sent', array('count' => count($sent), 'plural' => '%count Messages Not Sent')), 'info');
+ CRM_Core_Session::setStatus($status, ts('One Message Not Sent', array(
+ 'count' => count($sent),
+ 'plural' => '%count Messages Not Sent'
+ )), 'info');
}
else {
//Display the name and number of contacts for those sms is not sent.
@@ -422,8 +431,8 @@ class CRM_Contact_Form_Task_SMSCommon {
if (!empty($smsNotSent)) {
$not_sent = array();
foreach ($smsNotSent as $index => $contactId) {
- $displayName = $form->_allContactDetails[$contactId]['display_name'];
- $phone = $form->_allContactDetails[$contactId]['phone'];
+ $displayName = $form->_allContactDetails[$contactId]['display_name'];
+ $phone = $form->_allContactDetails[$contactId]['phone'];
$contactViewUrl = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid=$contactId");
$not_sent[] = "
$displayName";
}
@@ -432,7 +441,10 @@ class CRM_Contact_Form_Task_SMSCommon {
$status .= ' ' . ts("or the contact is not part of the activity '%1'", array(1 => self::RECIEVED_SMS_ACTIVITY_SUBJECT));
}
$status .= ')
- ' . implode('
- ', $not_sent) . '
';
- CRM_Core_Session::setStatus($status, ts('One Message Not Sent', array('count' => count($smsNotSent), 'plural' => '%count Messages Not Sent')), 'info');
+ CRM_Core_Session::setStatus($status, ts('One Message Not Sent', array(
+ 'count' => count($smsNotSent),
+ 'plural' => '%count Messages Not Sent'
+ )), 'info');
}
}
}
diff --git a/CRM/Contact/Form/Task/SaveSearch.php b/CRM/Contact/Form/Task/SaveSearch.php
index ee5150566c..935409a302 100644
--- a/CRM/Contact/Form/Task/SaveSearch.php
+++ b/CRM/Contact/Form/Task/SaveSearch.php
@@ -164,9 +164,9 @@ class CRM_Contact_Form_Task_SaveSearch extends CRM_Contact_Form_Task {
if (!$this->_id) {
//save record in mapping table
$mappingParams = array('mapping_type' => 'Search Builder');
- $temp = array();
- $mapping = CRM_Core_BAO_Mapping::add($mappingParams, $temp);
- $mappingId = $mapping->id;
+ $temp = array();
+ $mapping = CRM_Core_BAO_Mapping::add($mappingParams, $temp);
+ $mappingId = $mapping->id;
}
else {
//get the mapping id from saved search
@@ -199,8 +199,8 @@ class CRM_Contact_Form_Task_SaveSearch extends CRM_Contact_Form_Task {
is_array($formValues['group_type'])
) {
$params['group_type'] = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR,
- array_keys($formValues['group_type'])
- ) . CRM_Core_DAO::VALUE_SEPARATOR;
+ array_keys($formValues['group_type'])
+ ) . CRM_Core_DAO::VALUE_SEPARATOR;
}
else {
$params['group_type'] = '';
diff --git a/CRM/Contact/Form/Task/Unhold.php b/CRM/Contact/Form/Task/Unhold.php
index 8fc69e313c..05ec941b34 100644
--- a/CRM/Contact/Form/Task/Unhold.php
+++ b/CRM/Contact/Form/Task/Unhold.php
@@ -29,10 +29,16 @@ WHERE on_hold = 1 AND hold_date is not null AND contact_id in (" . implode(",",
$sql = "SELECT ROW_COUNT( )";
$result = CRM_Core_DAO::singleValueQuery($sql);
if ($result) {
- CRM_Core_Session::setStatus(ts('%count email was found on hold and updated.', array('count' => $result, 'plural' => '%count emails were found on hold and updated.')), ts('Emails Restored'), 'success');
+ CRM_Core_Session::setStatus(ts('%count email was found on hold and updated.', array(
+ 'count' => $result,
+ 'plural' => '%count emails were found on hold and updated.'
+ )), ts('Emails Restored'), 'success');
}
else {
- CRM_Core_Session::setStatus(ts('The selected contact does not have an email on hold.', array('count' => $result, 'plural' => 'None of the selected contacts have an email on hold.')), ts('No Emails to Restore'), 'info');
+ CRM_Core_Session::setStatus(ts('The selected contact does not have an email on hold.', array(
+ 'count' => $result,
+ 'plural' => 'None of the selected contacts have an email on hold.'
+ )), ts('No Emails to Restore'), 'info');
}
}
else {
diff --git a/CRM/Contact/Form/Task/Useradd.php b/CRM/Contact/Form/Task/Useradd.php
index 401f06532c..1a015edc1d 100755
--- a/CRM/Contact/Form/Task/Useradd.php
+++ b/CRM/Contact/Form/Task/Useradd.php
@@ -55,11 +55,11 @@ class CRM_Contact_Form_Task_Useradd extends CRM_Core_Form {
public function preProcess() {
$params = $defaults = $ids = array();
- $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
- $params['id'] = $params['contact_id'] = $this->_contactId;
- $contact = CRM_Contact_BAO_Contact::retrieve($params, $defaults, $ids);
+ $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
+ $params['id'] = $params['contact_id'] = $this->_contactId;
+ $contact = CRM_Contact_BAO_Contact::retrieve($params, $defaults, $ids);
$this->_displayName = $contact->display_name;
- $this->_email = $contact->email;
+ $this->_email = $contact->email;
CRM_Utils_System::setTitle(ts('Create User Record for %1', array(1 => $this->_displayName)));
}
diff --git a/CRM/Contact/Import/Form/DataSource.php b/CRM/Contact/Import/Form/DataSource.php
index 43191809b4..59a269beed 100644
--- a/CRM/Contact/Import/Form/DataSource.php
+++ b/CRM/Contact/Import/Form/DataSource.php
@@ -66,9 +66,9 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form {
CRM_Core_Error::fatal(ts('Database Configuration Error: Insufficient permissions. Import requires that the CiviCRM database user has permission to create temporary tables. Contact your site administrator for assistance.'));
}
- $results = array();
- $config = CRM_Core_Config::singleton();
- $handler = opendir($config->uploadDir);
+ $results = array();
+ $config = CRM_Core_Config::singleton();
+ $handler = opendir($config->uploadDir);
$errorFiles = array('sqlImport.errors', 'sqlImport.conflicts', 'sqlImport.duplicates', 'sqlImport.mismatch');
// check for post max size avoid when called twice
@@ -86,7 +86,10 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form {
}
closedir($handler);
if (!empty($results)) {
- CRM_Core_Error::fatal(ts('
%1 file(s) in %2 directory are not writable. Listed file(s) might be used during the import to log the errors occurred during Import process. Contact your site administrator for assistance.', array(1 => implode(', ', $results), 2 => $config->uploadDir)));
+ CRM_Core_Error::fatal(ts('
%1 file(s) in %2 directory are not writable. Listed file(s) might be used during the import to log the errors occurred during Import process. Contact your site administrator for assistance.', array(
+ 1 => implode(', ', $results),
+ 2 => $config->uploadDir
+ )));
}
$this->_dataSourceIsValid = FALSE;
@@ -170,9 +173,9 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form {
);
$mappingArray = CRM_Core_BAO_Mapping::getMappings(CRM_Core_OptionGroup::getValue('mapping_type',
- 'Import Contact',
- 'name'
- ));
+ 'Import Contact',
+ 'name'
+ ));
$this->assign('savedMapping', $mappingArray);
$this->addElement('select', 'savedMapping', ts('Mapping Option'), array('' => ts('- select -')) + $mappingArray);
@@ -266,9 +269,9 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form {
*/
private function _getDataSources() {
// Open the data source dir and scan it for class files
- $config = CRM_Core_Config::singleton();
+ $config = CRM_Core_Config::singleton();
$dataSourceDir = $config->importDataSourceDir;
- $dataSources = array();
+ $dataSources = array();
if (!is_dir($dataSourceDir)) {
CRM_Core_Error::fatal("Import DataSource directory $dataSourceDir does not exist");
}
@@ -285,7 +288,7 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form {
$dataSourceClass = "CRM_Import_DataSource_" . $matches[1];
require_once $dataSourceDir . DIRECTORY_SEPARATOR . $dataSourceFile;
$object = new $dataSourceClass;
- $info = $object->getInfo();
+ $info = $object->getInfo();
$dataSources[$dataSourceClass] = $info['title'];
}
}
@@ -340,8 +343,8 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form {
// We should have the data in the DB now, parse it
$importTableName = $this->get('importTableName');
- $fieldNames = $this->_prepareImportTable($db, $importTableName);
- $mapper = array();
+ $fieldNames = $this->_prepareImportTable($db, $importTableName);
+ $mapper = array();
$parser = new CRM_Contact_Import_Parser_Contact($mapper);
$parser->setMaxLinesToProcess(100);
diff --git a/CRM/Contact/Import/Form/MapField.php b/CRM/Contact/Import/Form/MapField.php
index 3d9d87c949..ec64bea512 100644
--- a/CRM/Contact/Import/Form/MapField.php
+++ b/CRM/Contact/Import/Form/MapField.php
@@ -107,7 +107,7 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
//format custom field names, CRM-2676
switch ($this->get('contactType')) {
case CRM_Import_Parser::CONTACT_INDIVIDUAL:
- $contactType = 'Individual';
+ $contactType = 'Individual';
$highlightedFields[] = 'first_name';
$highlightedFields[] = 'last_name';
break;
@@ -133,10 +133,13 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
if ($this->_onDuplicate != CRM_Import_Parser::DUPLICATE_NOCHECK) {
//Mark Dedupe Rule Fields as required, since it's used in matching contact
foreach (array(
- 'Individual', 'Household', 'Organization') as $cType) {
+ 'Individual',
+ 'Household',
+ 'Organization'
+ ) as $cType) {
$ruleParams = array(
'contact_type' => $cType,
- 'used' => 'Unsupervised',
+ 'used' => 'Unsupervised',
);
$this->_dedupeFields[$cType] = CRM_Dedupe_BAO_Rule::dedupeRuleFields($ruleParams);
}
@@ -214,19 +217,19 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
list($mappingName, $mappingContactType, $mappingLocation, $mappingPhoneType, $mappingImProvider, $mappingRelation, $mappingOperator, $mappingValue, $mappingWebsiteType) = CRM_Core_BAO_Mapping::getMappingFields($savedMapping);
//get loaded Mapping Fields
- $mappingName = CRM_Utils_Array::value(1, $mappingName);
+ $mappingName = CRM_Utils_Array::value(1, $mappingName);
$mappingContactType = CRM_Utils_Array::value(1, $mappingContactType);
- $mappingLocation = CRM_Utils_Array::value(1, $mappingLocation);
- $mappingPhoneType = CRM_Utils_Array::value(1, $mappingPhoneType);
- $mappingImProvider = CRM_Utils_Array::value(1, $mappingImProvider);
- $mappingRelation = CRM_Utils_Array::value(1, $mappingRelation);
+ $mappingLocation = CRM_Utils_Array::value(1, $mappingLocation);
+ $mappingPhoneType = CRM_Utils_Array::value(1, $mappingPhoneType);
+ $mappingImProvider = CRM_Utils_Array::value(1, $mappingImProvider);
+ $mappingRelation = CRM_Utils_Array::value(1, $mappingRelation);
$mappingWebsiteType = CRM_Utils_Array::value(1, $mappingWebsiteType);
$this->assign('loadedMapping', $savedMapping);
$this->set('loadedMapping', $savedMapping);
- $params = array('id' => $savedMapping);
- $temp = array();
+ $params = array('id' => $savedMapping);
+ $temp = array();
$mappingDetails = CRM_Core_BAO_Mapping::retrieve($params, $temp);
$this->assign('savedName', $mappingDetails->name);
@@ -245,11 +248,11 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
//-------- end of saved mapping stuff ---------
- $defaults = array();
- $mapperKeys = array_keys($this->_mapperFields);
- $hasColumnNames = !empty($this->_columnNames);
- $columnPatterns = $this->get('columnPatterns');
- $dataPatterns = $this->get('dataPatterns');
+ $defaults = array();
+ $mapperKeys = array_keys($this->_mapperFields);
+ $hasColumnNames = !empty($this->_columnNames);
+ $columnPatterns = $this->get('columnPatterns');
+ $dataPatterns = $this->get('dataPatterns');
$hasLocationTypes = $this->get('fieldTypes');
$this->_location_types = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
@@ -270,8 +273,8 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
$sel1 = $this->_mapperFields;
$sel2[''] = NULL;
- $phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
- $imProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
+ $phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
+ $imProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
$websiteTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id');
foreach ($this->_location_types as $key => $value) {
@@ -444,9 +447,9 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
}
$contactDetails = strtolower(str_replace(" ", "_", $mappingName[$i]));
- $websiteTypeId = isset($mappingWebsiteType[$i]) ? $mappingWebsiteType[$i] : NULL;
- $locationId = isset($mappingLocation[$i]) ? $mappingLocation[$i] : 0;
- $phoneType = isset($mappingPhoneType[$i]) ? $mappingPhoneType[$i] : NULL;
+ $websiteTypeId = isset($mappingWebsiteType[$i]) ? $mappingWebsiteType[$i] : NULL;
+ $locationId = isset($mappingLocation[$i]) ? $mappingLocation[$i] : 0;
+ $phoneType = isset($mappingPhoneType[$i]) ? $mappingPhoneType[$i] : NULL;
//get provider id from saved mappings
$imProvider = isset($mappingImProvider[$i]) ? $mappingImProvider[$i] : NULL;
@@ -488,8 +491,8 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
else {
$mappingHeader = array_keys($this->_mapperFields, $mappingName[$i]);
$websiteTypeId = isset($mappingWebsiteType[$i]) ? $mappingWebsiteType[$i] : NULL;
- $locationId = isset($mappingLocation[$i]) ? $mappingLocation[$i] : 0;
- $phoneType = isset($mappingPhoneType[$i]) ? $mappingPhoneType[$i] : NULL;
+ $locationId = isset($mappingLocation[$i]) ? $mappingLocation[$i] : 0;
+ $phoneType = isset($mappingPhoneType[$i]) ? $mappingPhoneType[$i] : NULL;
// get IM service provider id
$imProvider = isset($mappingImProvider[$i]) ? $mappingImProvider[$i] : NULL;
@@ -599,20 +602,20 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
$this->setDefaults($defaults);
$this->addButtons(array(
- array(
- 'type' => 'back',
- 'name' => ts('Previous'),
- ),
- array(
- 'type' => 'next',
- 'name' => ts('Continue'),
- 'spacing' => ' ',
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
+ array(
+ 'type' => 'back',
+ 'name' => ts('Previous'),
+ ),
+ array(
+ 'type' => 'next',
+ 'name' => ts('Continue'),
+ 'spacing' => ' ',
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ),
)
);
}
@@ -673,14 +676,14 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
return;
}
- $mapper = array();
- $mapperKeys = array();
- $mapperKeys = $this->controller->exportValue($this->_name, 'mapper');
+ $mapper = array();
+ $mapperKeys = array();
+ $mapperKeys = $this->controller->exportValue($this->_name, 'mapper');
$mapperKeysMain = array();
- $phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
- $imProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
- $websiteTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id');
+ $phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
+ $imProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
+ $websiteTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id');
$locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
//these mapper params need to set key as array and val as null.
@@ -710,11 +713,11 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
$$mapperParam = NULL;
}
- $fldName = CRM_Utils_Array::value(0, $mapperKeys[$i]);
- $selOne = CRM_Utils_Array::value(1, $mapperKeys[$i]);
- $selTwo = CRM_Utils_Array::value(2, $mapperKeys[$i]);
- $selThree = CRM_Utils_Array::value(3, $mapperKeys[$i]);
- $mapper[$i] = $this->_mapperFields[$mapperKeys[$i][0]];
+ $fldName = CRM_Utils_Array::value(0, $mapperKeys[$i]);
+ $selOne = CRM_Utils_Array::value(1, $mapperKeys[$i]);
+ $selTwo = CRM_Utils_Array::value(2, $mapperKeys[$i]);
+ $selThree = CRM_Utils_Array::value(3, $mapperKeys[$i]);
+ $mapper[$i] = $this->_mapperFields[$mapperKeys[$i][0]];
$mapperKeysMain[$i] = $fldName;
//need to differentiate non location elements.
@@ -789,8 +792,12 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
//set related contact propeties.
$relProperties = array(
- 'related', 'relatedContactType', 'relatedContactDetails',
- 'relatedContactLocType', 'relatedContactPhoneType', 'relatedContactImProvider',
+ 'related',
+ 'relatedContactType',
+ 'relatedContactDetails',
+ 'relatedContactLocType',
+ 'relatedContactPhoneType',
+ 'relatedContactImProvider',
'relatedContactWebsiteType',
);
foreach ($relProperties as $relProperty) {
@@ -823,9 +830,9 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
$updateMappingFields->column_number = $i;
$mapperKeyParts = explode('_', $mapperKeys[$i][0], 3);
- $id = isset($mapperKeyParts[0]) ? $mapperKeyParts[0] : NULL;
- $first = isset($mapperKeyParts[1]) ? $mapperKeyParts[1] : NULL;
- $second = isset($mapperKeyParts[2]) ? $mapperKeyParts[2] : NULL;
+ $id = isset($mapperKeyParts[0]) ? $mapperKeyParts[0] : NULL;
+ $first = isset($mapperKeyParts[1]) ? $mapperKeyParts[1] : NULL;
+ $second = isset($mapperKeyParts[2]) ? $mapperKeyParts[2] : NULL;
if (($first == 'a' && $second == 'b') || ($first == 'b' && $second == 'a')) {
$updateMappingFields->relationship_type_id = $id;
$updateMappingFields->relationship_direction = "{$first}_{$second}";
@@ -904,9 +911,9 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
$saveMappingFields->column_number = $i;
$mapperKeyParts = explode('_', $mapperKeys[$i][0], 3);
- $id = isset($mapperKeyParts[0]) ? $mapperKeyParts[0] : NULL;
- $first = isset($mapperKeyParts[1]) ? $mapperKeyParts[1] : NULL;
- $second = isset($mapperKeyParts[2]) ? $mapperKeyParts[2] : NULL;
+ $id = isset($mapperKeyParts[0]) ? $mapperKeyParts[0] : NULL;
+ $first = isset($mapperKeyParts[1]) ? $mapperKeyParts[1] : NULL;
+ $second = isset($mapperKeyParts[2]) ? $mapperKeyParts[2] : NULL;
if (($first == 'a' && $second == 'b') || ($first == 'b' && $second == 'a')) {
$saveMappingFields->name = ucwords(str_replace("_", " ", $mapperKeys[$i][1]));
$saveMappingFields->relationship_type_id = $id;
diff --git a/CRM/Contact/Import/Form/Preview.php b/CRM/Contact/Import/Form/Preview.php
index f895702533..f09c2528f3 100644
--- a/CRM/Contact/Import/Form/Preview.php
+++ b/CRM/Contact/Import/Form/Preview.php
@@ -46,12 +46,12 @@ class CRM_Contact_Import_Form_Preview extends CRM_Import_Form_Preview {
*/
public function preProcess() {
//get the data from the session
- $dataValues = $this->get('dataValues');
- $mapper = $this->get('mapper');
- $invalidRowCount = $this->get('invalidRowCount');
+ $dataValues = $this->get('dataValues');
+ $mapper = $this->get('mapper');
+ $invalidRowCount = $this->get('invalidRowCount');
$conflictRowCount = $this->get('conflictRowCount');
- $mismatchCount = $this->get('unMatchCount');
- $columnNames = $this->get('columnNames');
+ $mismatchCount = $this->get('unMatchCount');
+ $columnNames = $this->get('columnNames');
//assign column names
$this->assign('columnNames', $columnNames);
@@ -92,15 +92,25 @@ class CRM_Contact_Import_Form_Preview extends CRM_Import_Form_Preview {
}
$properties = array(
- 'mapper', 'locations', 'phones', 'ims',
- 'dataValues', 'columnCount',
- 'totalRowCount', 'validRowCount',
- 'invalidRowCount', 'conflictRowCount',
+ 'mapper',
+ 'locations',
+ 'phones',
+ 'ims',
+ 'dataValues',
+ 'columnCount',
+ 'totalRowCount',
+ 'validRowCount',
+ 'invalidRowCount',
+ 'conflictRowCount',
'downloadErrorRecordsUrl',
'downloadConflictRecordsUrl',
'downloadMismatchRecordsUrl',
- 'related', 'relatedContactDetails', 'relatedContactLocType',
- 'relatedContactPhoneType', 'relatedContactImProvider', 'websites',
+ 'related',
+ 'relatedContactDetails',
+ 'relatedContactLocType',
+ 'relatedContactPhoneType',
+ 'relatedContactImProvider',
+ 'websites',
'relatedContactWebsiteType',
);
@@ -137,7 +147,10 @@ class CRM_Contact_Import_Form_Preview extends CRM_Import_Form_Preview {
$groups = $this->get('groups');
if (!empty($groups)) {
- $this->addElement('select', 'groups', ts('Add imported records to existing group(s)'), $groups, array('multiple' => "multiple", 'class' => 'crm-select2'));
+ $this->addElement('select', 'groups', ts('Add imported records to existing group(s)'), $groups, array(
+ 'multiple' => "multiple",
+ 'class' => 'crm-select2'
+ ));
}
//display new tag
@@ -204,8 +217,9 @@ class CRM_Contact_Import_Form_Preview extends CRM_Import_Form_Preview {
if (!empty($fields['newTagName'])) {
if (!CRM_Utils_Rule::objectExists(trim($fields['newTagName']),
- array('CRM_Core_DAO_Tag')
- )) {
+ array('CRM_Core_DAO_Tag')
+ )
+ ) {
$errors['newTagName'] = ts('Tag \'%1\' already exists.',
array(1 => $fields['newTagName'])
);
@@ -214,9 +228,9 @@ class CRM_Contact_Import_Form_Preview extends CRM_Import_Form_Preview {
}
if (!empty($fields['newGroupName'])) {
- $title = trim($fields['newGroupName']);
- $name = CRM_Utils_String::titleToVar($title);
- $query = 'select count(*) from civicrm_group where name like %1 OR title like %2';
+ $title = trim($fields['newGroupName']);
+ $name = CRM_Utils_String::titleToVar($title);
+ $query = 'select count(*) from civicrm_group where name like %1 OR title like %2';
$grpCnt = CRM_Core_DAO::singleValueQuery(
$query,
array(
@@ -338,17 +352,17 @@ class CRM_Contact_Import_Form_Preview extends CRM_Import_Form_Preview {
public function postProcessOld() {
$doGeocodeAddress = $this->controller->exportValue('DataSource', 'doGeocodeAddress');
- $invalidRowCount = $this->get('invalidRowCount');
+ $invalidRowCount = $this->get('invalidRowCount');
$conflictRowCount = $this->get('conflictRowCount');
- $onDuplicate = $this->get('onDuplicate');
- $newGroupName = $this->controller->exportValue($this->_name, 'newGroupName');
- $newGroupDesc = $this->controller->exportValue($this->_name, 'newGroupDesc');
- $groups = $this->controller->exportValue($this->_name, 'groups');
- $allGroups = $this->get('groups');
- $newTagName = $this->controller->exportValue($this->_name, 'newTagName');
- $newTagDesc = $this->controller->exportValue($this->_name, 'newTagDesc');
- $tag = $this->controller->exportValue($this->_name, 'tag');
- $allTags = $this->get('tag');
+ $onDuplicate = $this->get('onDuplicate');
+ $newGroupName = $this->controller->exportValue($this->_name, 'newGroupName');
+ $newGroupDesc = $this->controller->exportValue($this->_name, 'newGroupDesc');
+ $groups = $this->controller->exportValue($this->_name, 'groups');
+ $allGroups = $this->get('groups');
+ $newTagName = $this->controller->exportValue($this->_name, 'newTagName');
+ $newTagDesc = $this->controller->exportValue($this->_name, 'newTagDesc');
+ $tag = $this->controller->exportValue($this->_name, 'tag');
+ $allTags = $this->get('tag');
$mapper = $this->controller->exportValue('MapField', 'mapper');
@@ -519,8 +533,8 @@ class CRM_Contact_Import_Form_Preview extends CRM_Import_Form_Preview {
'description' => $newTagDesc,
'is_active' => TRUE,
);
- $id = array();
- $addedTag = CRM_Core_BAO_Tag::add($tagParams, $id);
+ $id = array();
+ $addedTag = CRM_Core_BAO_Tag::add($tagParams, $id);
$tag[$addedTag->id] = 1;
}
//add Tag to Import
diff --git a/CRM/Contact/Import/Form/Summary.php b/CRM/Contact/Import/Form/Summary.php
index 3bf9f8a72a..4522a0e363 100644
--- a/CRM/Contact/Import/Form/Summary.php
+++ b/CRM/Contact/Import/Form/Summary.php
@@ -100,7 +100,21 @@ class CRM_Contact_Import_Form_Summary extends CRM_Import_Form_Summary {
$this->assign('dupeActionString', $dupeActionString);
- $properties = array('totalRowCount', 'validRowCount', 'invalidRowCount', 'conflictRowCount', 'downloadConflictRecordsUrl', 'downloadErrorRecordsUrl', 'duplicateRowCount', 'downloadDuplicateRecordsUrl', 'downloadMismatchRecordsUrl', 'groupAdditions', 'tagAdditions', 'unMatchCount', 'unparsedAddressCount');
+ $properties = array(
+ 'totalRowCount',
+ 'validRowCount',
+ 'invalidRowCount',
+ 'conflictRowCount',
+ 'downloadConflictRecordsUrl',
+ 'downloadErrorRecordsUrl',
+ 'duplicateRowCount',
+ 'downloadDuplicateRecordsUrl',
+ 'downloadMismatchRecordsUrl',
+ 'groupAdditions',
+ 'tagAdditions',
+ 'unMatchCount',
+ 'unparsedAddressCount'
+ );
foreach ($properties as $property) {
$this->assign($property, $this->get($property));
}
diff --git a/CRM/Contact/Import/ImportJob.php b/CRM/Contact/Import/ImportJob.php
index 84e2a176dd..6b3269d7f6 100644
--- a/CRM/Contact/Import/ImportJob.php
+++ b/CRM/Contact/Import/ImportJob.php
@@ -168,11 +168,11 @@ class CRM_Contact_Import_ImportJob {
* @param int $timeout
*/
public function runImport(&$form, $timeout = 55) {
- $mapper = $this->_mapper;
- $mapperFields = array();
- $phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
- $imProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
- $websiteTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id');
+ $mapper = $this->_mapper;
+ $mapperFields = array();
+ $phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
+ $imProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
+ $websiteTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id');
$locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
//initialize mapper perperty value.
@@ -226,9 +226,9 @@ class CRM_Contact_Import_ImportJob {
}
$fldNameParts = explode('_', $fldName, 3);
- $id = $fldNameParts[0];
- $first = isset($fldNameParts[1]) ? $fldNameParts[1] : NULL;
- $second = isset($fldNameParts[2]) ? $fldNameParts[2] : NULL;
+ $id = $fldNameParts[0];
+ $first = isset($fldNameParts[1]) ? $fldNameParts[1] : NULL;
+ $second = isset($fldNameParts[2]) ? $fldNameParts[2] : NULL;
if (($first == 'a' && $second == 'b') ||
($first == 'b' && $second == 'a')
) {
@@ -456,9 +456,9 @@ class CRM_Contact_Import_ImportJob {
* @return array
*/
public static function getIncompleteImportTables() {
- $dao = new CRM_Core_DAO();
+ $dao = new CRM_Core_DAO();
$database = $dao->database();
- $query = "SELECT TABLE_NAME FROM INFORMATION_SCHEMA
+ $query = "SELECT TABLE_NAME FROM INFORMATION_SCHEMA
WHERE TABLE_SCHEMA = ? AND
TABLE_NAME LIKE 'civicrm_import_job_%'
ORDER BY TABLE_NAME";
diff --git a/CRM/Contact/Import/Parser.php b/CRM/Contact/Import/Parser.php
index 288ba58ccd..fddfc8f8bb 100644
--- a/CRM/Contact/Import/Parser.php
+++ b/CRM/Contact/Import/Parser.php
@@ -32,8 +32,6 @@
* $Id$
*
*/
-
-
abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser {
protected $_tableName;
@@ -347,7 +345,8 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser {
if ($this->_invalidRowCount) {
// removed view url for invlaid contacts
- $headers = array_merge(array(ts('Line Number'),
+ $headers = array_merge(array(
+ ts('Line Number'),
ts('Reason'),
),
$customHeaders
@@ -356,7 +355,8 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser {
self::exportCSV($this->_errorFileName, $headers, $this->_errors);
}
if ($this->_conflictCount) {
- $headers = array_merge(array(ts('Line Number'),
+ $headers = array_merge(array(
+ ts('Line Number'),
ts('Reason'),
),
$customHeaders
@@ -365,7 +365,8 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser {
self::exportCSV($this->_conflictFileName, $headers, $this->_conflicts);
}
if ($this->_duplicateCount) {
- $headers = array_merge(array(ts('Line Number'),
+ $headers = array_merge(array(
+ ts('Line Number'),
ts('View Contact URL'),
),
$customHeaders
@@ -375,7 +376,8 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser {
self::exportCSV($this->_duplicateFileName, $headers, $this->_duplicates);
}
if ($this->_unMatchCount) {
- $headers = array_merge(array(ts('Line Number'),
+ $headers = array_merge(array(
+ ts('Line Number'),
ts('Reason'),
),
$customHeaders
@@ -385,7 +387,8 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser {
self::exportCSV($this->_misMatchFilemName, $headers, $this->_unMatch);
}
if ($this->_unparsedAddressCount) {
- $headers = array_merge(array(ts('Line Number'),
+ $headers = array_merge(array(
+ ts('Line Number'),
ts('Contact Edit URL'),
),
$customHeaders
@@ -552,9 +555,9 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser {
$value = array(
$this->_activeFields[$i]->_name =>
- $this->_activeFields[$i]->_value,
+ $this->_activeFields[$i]->_value,
'location_type_id' =>
- $this->_activeFields[$i]->_hasLocationType,
+ $this->_activeFields[$i]->_hasLocationType,
);
if (isset($this->_activeFields[$i]->_phoneType)) {
@@ -595,7 +598,8 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser {
if (isset($this->_activeFields[$i]->_relatedContactLocType) && !empty($this->_activeFields[$i]->_value)) {
if (!empty($params[$this->_activeFields[$i]->_related][$this->_activeFields[$i]->_relatedContactDetails]) &&
- !is_array($params[$this->_activeFields[$i]->_related][$this->_activeFields[$i]->_relatedContactDetails])) {
+ !is_array($params[$this->_activeFields[$i]->_related][$this->_activeFields[$i]->_relatedContactDetails])
+ ) {
$params[$this->_activeFields[$i]->_related][$this->_activeFields[$i]->_relatedContactDetails] = array();
}
$value = array(
diff --git a/CRM/Contact/Page/AJAX.php b/CRM/Contact/Page/AJAX.php
index e7ddfec6b3..9d1580f5c8 100644
--- a/CRM/Contact/Page/AJAX.php
+++ b/CRM/Contact/Page/AJAX.php
@@ -135,8 +135,8 @@ class CRM_Contact_Page_AJAX {
}
$list = array_keys(CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
- 'contact_reference_options'
- ), '1');
+ 'contact_reference_options'
+ ), '1');
$return = array_unique(array_merge(array('sort_name'), $list));
@@ -148,7 +148,21 @@ class CRM_Contact_Page_AJAX {
}
if (!empty($action)) {
- $excludeGet = array('reset', 'key', 'className', 'fnName', 'json', 'reset', 'context', 'timestamp', 'limit', 'id', 's', 'q', 'action');
+ $excludeGet = array(
+ 'reset',
+ 'key',
+ 'className',
+ 'fnName',
+ 'json',
+ 'reset',
+ 'context',
+ 'timestamp',
+ 'limit',
+ 'id',
+ 's',
+ 'q',
+ 'action'
+ );
foreach ($_GET as $param => $val) {
if (empty($val) ||
in_array($param, $excludeGet) ||
@@ -199,8 +213,8 @@ class CRM_Contact_Page_AJAX {
* Fetch PCP ID by PCP Supporter sort_name, also displays PCP title and associated Contribution Page title
*/
public static function getPCPList() {
- $name = CRM_Utils_Array::value('s', $_GET);
- $name = CRM_Utils_Type::escape($name, 'String');
+ $name = CRM_Utils_Array::value('s', $_GET);
+ $name = CRM_Utils_Type::escape($name, 'String');
$limit = '10';
$where = ' AND pcp.page_id = cp.id AND pcp.contact_id = cc.id';
@@ -320,10 +334,10 @@ class CRM_Contact_Page_AJAX {
* Fetch the custom field help
*/
public static function customField() {
- $fieldId = CRM_Utils_Type::escape($_REQUEST['id'], 'Integer');
- $params = array('id' => $fieldId);
+ $fieldId = CRM_Utils_Type::escape($_REQUEST['id'], 'Integer');
+ $params = array('id' => $fieldId);
$returnProperties = array('help_pre', 'help_post');
- $values = array();
+ $values = array();
CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_CustomField', $params, $values, $returnProperties);
CRM_Utils_JSON::output($values);
@@ -368,8 +382,8 @@ class CRM_Contact_Page_AJAX {
$relType = NULL;
if (isset($_GET['rel'])) {
$relation = explode('_', $_GET['rel']);
- $relType = CRM_Utils_Type::escape($relation[0], 'Integer');
- $rel = CRM_Utils_Type::escape($relation[2], 'String');
+ $relType = CRM_Utils_Type::escape($relation[0], 'Integer');
+ $rel = CRM_Utils_Type::escape($relation[2], 'String');
}
//shared household info
@@ -403,8 +417,8 @@ class CRM_Contact_Page_AJAX {
$splitName = explode(' :: ', $name);
if ($splitName) {
$contactName = trim(CRM_Utils_Array::value('0', $splitName));
- $street = trim(CRM_Utils_Array::value('1', $splitName));
- $city = trim(CRM_Utils_Array::value('2', $splitName));
+ $street = trim(CRM_Utils_Array::value('1', $splitName));
+ $city = trim(CRM_Utils_Array::value('2', $splitName));
}
else {
$contactName = $name;
@@ -484,7 +498,7 @@ ORDER BY sort_name ";
while ($dao->fetch()) {
if ($json) {
$elements[] = array(
- 'name' => addslashes($dao->sort_name),
+ 'name' => addslashes($dao->sort_name),
'id' => $dao->id,
);
}
@@ -540,8 +554,8 @@ ORDER BY sort_name ";
* Perform enable / disable actions on record.
*/
public static function enableDisable() {
- $op = CRM_Utils_Type::escape($_REQUEST['op'], 'String');
- $recordID = CRM_Utils_Type::escape($_REQUEST['recordID'], 'Positive');
+ $op = CRM_Utils_Type::escape($_REQUEST['op'], 'String');
+ $recordID = CRM_Utils_Type::escape($_REQUEST['recordID'], 'Positive');
$recordBAO = CRM_Utils_Type::escape($_REQUEST['recordBAO'], 'String');
$isActive = NULL;
@@ -626,7 +640,7 @@ ORDER BY sort_name ";
}
list($displayName,
$userEmail
- ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($contactID);
+ ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($contactID);
if ($userEmail) {
echo $userEmail;
}
@@ -878,8 +892,8 @@ LIMIT {$offset}, {$rowCount}
*/
public static function getSignature() {
$emailID = CRM_Utils_Type::escape($_REQUEST['emailID'], 'Positive');
- $query = "SELECT signature_text, signature_html FROM civicrm_email WHERE id = {$emailID}";
- $dao = CRM_Core_DAO::executeQuery($query);
+ $query = "SELECT signature_text, signature_html FROM civicrm_email WHERE id = {$emailID}";
+ $dao = CRM_Core_DAO::executeQuery($query);
$signatures = array();
while ($dao->fetch()) {
@@ -897,8 +911,8 @@ LIMIT {$offset}, {$rowCount}
*/
public static function processDupes() {
$oper = CRM_Utils_Type::escape($_REQUEST['op'], 'String');
- $cid = CRM_Utils_Type::escape($_REQUEST['cid'], 'Positive');
- $oid = CRM_Utils_Type::escape($_REQUEST['oid'], 'Positive');
+ $cid = CRM_Utils_Type::escape($_REQUEST['cid'], 'Positive');
+ $oid = CRM_Utils_Type::escape($_REQUEST['oid'], 'Positive');
if (!$oper || !$cid || !$oid) {
return;
@@ -926,21 +940,21 @@ LIMIT {$offset}, {$rowCount}
public static function getDedupes() {
- $sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
- $offset = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0;
- $rowCount = isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25;
- $sort = 'sort_name';
+ $sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
+ $offset = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0;
+ $rowCount = isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25;
+ $sort = 'sort_name';
$sortOrder = isset($_REQUEST['sSortDir_0']) ? CRM_Utils_Type::escape($_REQUEST['sSortDir_0'], 'String') : 'asc';
- $gid = isset($_REQUEST['gid']) ? CRM_Utils_Type::escape($_REQUEST['gid'], 'Integer') : 0;
- $rgid = isset($_REQUEST['rgid']) ? CRM_Utils_Type::escape($_REQUEST['rgid'], 'Integer') : 0;
+ $gid = isset($_REQUEST['gid']) ? CRM_Utils_Type::escape($_REQUEST['gid'], 'Integer') : 0;
+ $rgid = isset($_REQUEST['rgid']) ? CRM_Utils_Type::escape($_REQUEST['rgid'], 'Integer') : 0;
$contactType = '';
if ($rgid) {
$contactType = CRM_Core_DAO::getFieldValue('CRM_Dedupe_DAO_RuleGroup', $rgid, 'contact_type');
}
- $cacheKeyString = "merge {$contactType}_{$rgid}_{$gid}";
- $searchRows = array();
+ $cacheKeyString = "merge {$contactType}_{$rgid}_{$gid}";
+ $searchRows = array();
$selectorElements = array('src', 'dst', 'weight', 'actions');
$join = "LEFT JOIN civicrm_dedupe_exception de ON ( pn.entity_id1 = de.contact_id1 AND
@@ -997,9 +1011,9 @@ LIMIT {$offset}, {$rowCount}
}
public static function selectUnselectContacts() {
- $name = CRM_Utils_Array::value('name', $_REQUEST);
- $cacheKey = CRM_Utils_Array::value('qfKey', $_REQUEST);
- $state = CRM_Utils_Array::value('state', $_REQUEST, 'checked');
+ $name = CRM_Utils_Array::value('name', $_REQUEST);
+ $cacheKey = CRM_Utils_Array::value('qfKey', $_REQUEST);
+ $state = CRM_Utils_Array::value('state', $_REQUEST, 'checked');
$variableType = CRM_Utils_Array::value('variableType', $_REQUEST, 'single');
$actionToPerform = CRM_Utils_Array::value('action', $_REQUEST, 'select');
@@ -1080,10 +1094,10 @@ LIMIT {$offset}, {$rowCount}
10 => '',
);
- $sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
- $offset = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0;
- $rowCount = isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25;
- $sort = isset($_REQUEST['iSortCol_0']) ? CRM_Utils_Array::value(CRM_Utils_Type::escape($_REQUEST['iSortCol_0'], 'Integer'), $sortMapper) : NULL;
+ $sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
+ $offset = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0;
+ $rowCount = isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25;
+ $sort = isset($_REQUEST['iSortCol_0']) ? CRM_Utils_Array::value(CRM_Utils_Type::escape($_REQUEST['iSortCol_0'], 'Integer'), $sortMapper) : NULL;
$sortOrder = isset($_REQUEST['sSortDir_0']) ? CRM_Utils_Type::escape($_REQUEST['sSortDir_0'], 'String') : 'asc';
$params = $_POST;
diff --git a/CRM/Contact/Page/DashBoard.php b/CRM/Contact/Page/DashBoard.php
index 2466d9f8bb..7c695f8652 100644
--- a/CRM/Contact/Page/DashBoard.php
+++ b/CRM/Contact/Page/DashBoard.php
@@ -72,8 +72,8 @@ class CRM_Contact_Page_DashBoard extends CRM_Core_Page {
}
//check that default FROM email address, owner (domain) organization name and default mailbox are configured.
- $fromEmailOK = TRUE;
- $ownerOrgOK = TRUE;
+ $fromEmailOK = TRUE;
+ $ownerOrgOK = TRUE;
$defaultMailboxOK = TRUE;
// Don't put up notices if user doesn't have administer CiviCRM permission
diff --git a/CRM/Contact/Page/DedupeException.php b/CRM/Contact/Page/DedupeException.php
index 64801beaec..db0e324281 100644
--- a/CRM/Contact/Page/DedupeException.php
+++ b/CRM/Contact/Page/DedupeException.php
@@ -57,14 +57,14 @@ class CRM_Contact_Page_DedupeException extends CRM_Core_Page {
$contactIds[$exception->contact_id1] = $exception->contact_id1;
$contactIds[$exception->contact_id2] = $exception->contact_id2;
$dedupeExceptions[$key] = array(
- 'main' => array('id' => $exception->contact_id1),
+ 'main' => array('id' => $exception->contact_id1),
'other' => array('id' => $exception->contact_id2),
);
}
//get the dupe contacts display names.
if (!empty($dedupeExceptions)) {
- $sql = 'select id, display_name from civicrm_contact where id IN ( ' . implode(', ', $contactIds) . ' )';
- $contact = CRM_Core_DAO::executeQuery($sql);
+ $sql = 'select id, display_name from civicrm_contact where id IN ( ' . implode(', ', $contactIds) . ' )';
+ $contact = CRM_Core_DAO::executeQuery($sql);
$displayNames = array();
while ($contact->fetch()) {
$displayNames[$contact->id] = $contact->display_name;
diff --git a/CRM/Contact/Page/DedupeFind.php b/CRM/Contact/Page/DedupeFind.php
index 2acdf69d2d..36c9348507 100644
--- a/CRM/Contact/Page/DedupeFind.php
+++ b/CRM/Contact/Page/DedupeFind.php
@@ -63,8 +63,8 @@ class CRM_Contact_Page_DedupeFind extends CRM_Core_Page_Basic {
* @return void
*/
public function run() {
- $gid = CRM_Utils_Request::retrieve('gid', 'Positive', $this, FALSE, 0);
- $action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 0);
+ $gid = CRM_Utils_Request::retrieve('gid', 'Positive', $this, FALSE, 0);
+ $action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 0);
$context = CRM_Utils_Request::retrieve('context', 'String', $this);
$session = CRM_Core_Session::singleton();
@@ -98,8 +98,8 @@ class CRM_Contact_Page_DedupeFind extends CRM_Core_Page_Basic {
$skippedCount = CRM_Utils_Request::retrieve('skipped', 'Positive', $this, FALSE, 0);
$skippedCount = $skippedCount + count($result['skipped']);
- $mergedCount = CRM_Utils_Request::retrieve('merged', 'Positive', $this, FALSE, 0);
- $mergedCount = $mergedCount + count($result['merged']);
+ $mergedCount = CRM_Utils_Request::retrieve('merged', 'Positive', $this, FALSE, 0);
+ $mergedCount = $mergedCount + count($result['merged']);
if (empty($result['merged']) && empty($result['skipped'])) {
$message = '';
@@ -138,8 +138,8 @@ class CRM_Contact_Page_DedupeFind extends CRM_Core_Page_Basic {
if ($action & CRM_Core_Action::UPDATE ||
$action & CRM_Core_Action::BROWSE
) {
- $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this, FALSE, 0);
- $rgid = CRM_Utils_Request::retrieve('rgid', 'Positive', $this, FALSE, 0);
+ $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this, FALSE, 0);
+ $rgid = CRM_Utils_Request::retrieve('rgid', 'Positive', $this, FALSE, 0);
$this->action = CRM_Core_Action::UPDATE;
//calculate the $contactType
@@ -211,8 +211,8 @@ class CRM_Contact_Page_DedupeFind extends CRM_Core_Page_Basic {
$cids[$dupe[1]] = 1;
}
$cidString = implode(', ', array_keys($cids));
- $sql = "SELECT id, display_name FROM civicrm_contact WHERE id IN ($cidString) ORDER BY sort_name";
- $dao = new CRM_Core_DAO();
+ $sql = "SELECT id, display_name FROM civicrm_contact WHERE id IN ($cidString) ORDER BY sort_name";
+ $dao = new CRM_Core_DAO();
$dao->query($sql);
$displayNames = array();
while ($dao->fetch()) {
@@ -224,8 +224,8 @@ class CRM_Contact_Page_DedupeFind extends CRM_Core_Page_Basic {
// (also, consider sorting by dupe count first)
// lobo - change the sort to by threshold value
// so the more likely dupes are sorted first
- $session = CRM_Core_Session::singleton();
- $userId = $session->get('userID');
+ $session = CRM_Core_Session::singleton();
+ $userId = $session->get('userID');
$mainContacts = $permission = array();
foreach ($foundDupes as $dupes) {
@@ -240,14 +240,14 @@ class CRM_Contact_Page_DedupeFind extends CRM_Core_Page_Basic {
* Eliminate this since it introduces 3 queries PER merge row
* and hence is very expensive
* CRM-8822
- if ( !array_key_exists( $srcID, $permission ) ) {
- $permission[$srcID] = CRM_Contact_BAO_Contact_Permission::allow( $srcID, CRM_Core_Permission::EDIT );
- }
- if ( !array_key_exists( $dstID, $permission ) ) {
- $permission[$dstID] = CRM_Contact_BAO_Contact_Permission::allow( $dstID, CRM_Core_Permission::EDIT );
- }
-
- $canMerge = ( $permission[$dstID] && $permission[$srcID] );
+ * if ( !array_key_exists( $srcID, $permission ) ) {
+ * $permission[$srcID] = CRM_Contact_BAO_Contact_Permission::allow( $srcID, CRM_Core_Permission::EDIT );
+ * }
+ * if ( !array_key_exists( $dstID, $permission ) ) {
+ * $permission[$dstID] = CRM_Contact_BAO_Contact_Permission::allow( $dstID, CRM_Core_Permission::EDIT );
+ * }
+ *
+ * $canMerge = ( $permission[$dstID] && $permission[$srcID] );
*
*/
@@ -279,13 +279,13 @@ class CRM_Contact_Page_DedupeFind extends CRM_Core_Page_Basic {
$session = CRM_Core_Session::singleton();
if ($this->_cid) {
$session->pushUserContext(CRM_Utils_System::url('civicrm/contact/deduperules',
- "action=update&rgid={$this->_rgid}&gid={$this->_gid}&cid={$this->_cid}"
- ));
+ "action=update&rgid={$this->_rgid}&gid={$this->_gid}&cid={$this->_cid}"
+ ));
}
else {
$session->pushUserContext(CRM_Utils_System::url('civicrm/contact/dedupefind',
- "reset=1&action=update&rgid={$this->_rgid}"
- ));
+ "reset=1&action=update&rgid={$this->_rgid}"
+ ));
}
}
}
diff --git a/CRM/Contact/Page/Inline/CustomData.php b/CRM/Contact/Page/Inline/CustomData.php
index 90735344e2..820ccc9270 100644
--- a/CRM/Contact/Page/Inline/CustomData.php
+++ b/CRM/Contact/Page/Inline/CustomData.php
@@ -54,11 +54,11 @@ class CRM_Contact_Page_Inline_CustomData extends CRM_Core_Page {
$cgcount = CRM_Utils_Request::retrieve('cgcount', 'Positive', CRM_Core_DAO::$_nullObject, FALSE, 1, $_REQUEST);
//custom groups Inline
- $entityType = CRM_Contact_BAO_Contact::getContactType($contactId);
+ $entityType = CRM_Contact_BAO_Contact::getContactType($contactId);
$entitySubType = CRM_Contact_BAO_Contact::getContactSubType($contactId);
- $groupTree = &CRM_Core_BAO_CustomGroup::getTree($entityType, $this, $contactId,
+ $groupTree = &CRM_Core_BAO_CustomGroup::getTree($entityType, $this, $contactId,
$cgId, $entitySubType
- );
+ );
$details = CRM_Core_BAO_CustomGroup::buildCustomDataView($this, $groupTree);
//get the fields of single custom group record
if ($customRecId == 1) {
diff --git a/CRM/Contact/Page/Inline/Website.php b/CRM/Contact/Page/Inline/Website.php
index 50b5af159f..301d3af816 100644
--- a/CRM/Contact/Page/Inline/Website.php
+++ b/CRM/Contact/Page/Inline/Website.php
@@ -52,7 +52,7 @@ class CRM_Contact_Page_Inline_Website extends CRM_Core_Page {
$websiteTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id');
- $params = array('contact_id' => $contactId);
+ $params = array('contact_id' => $contactId);
$websites = CRM_Core_BAO_Website::getValues($params, CRM_Core_DAO::$_nullArray);
if (!empty($websites)) {
foreach ($websites as $key => & $value) {
diff --git a/CRM/Contact/Page/SavedSearch.php b/CRM/Contact/Page/SavedSearch.php
index a513e09df2..ca861385a5 100644
--- a/CRM/Contact/Page/SavedSearch.php
+++ b/CRM/Contact/Page/SavedSearch.php
@@ -96,13 +96,13 @@ class CRM_Contact_Page_SavedSearch extends CRM_Core_Page {
$row['name'] = $group->title;
$row['description'] = $group->description;
- $row['id'] = $savedSearch->id;
- $formValues = unserialize($savedSearch->form_values);
- $query = new CRM_Contact_BAO_Query($formValues);
+ $row['id'] = $savedSearch->id;
+ $formValues = unserialize($savedSearch->form_values);
+ $query = new CRM_Contact_BAO_Query($formValues);
$row['query_detail'] = $query->qill();
- $action = array_sum(array_keys(self::links()));
- $action = $action & CRM_Core_Action::mask($permissions);
+ $action = array_sum(array_keys(self::links()));
+ $action = $action & CRM_Core_Action::mask($permissions);
$row['action'] = CRM_Core_Action::formLink(
self::links(),
$action,
diff --git a/CRM/Contact/Page/View.php b/CRM/Contact/Page/View.php
index c33f3c8ac2..7c90bf2987 100644
--- a/CRM/Contact/Page/View.php
+++ b/CRM/Contact/Page/View.php
@@ -182,7 +182,7 @@ class CRM_Contact_Page_View extends CRM_Core_Page {
list($displayName, $contactImage,
$contactType, $contactSubtype, $contactImageUrl
- ) = self::getContactDetails($this->_contactId);
+ ) = self::getContactDetails($this->_contactId);
$this->assign('displayName', $displayName);
$this->set('contactType', $contactType);
@@ -265,7 +265,7 @@ class CRM_Contact_Page_View extends CRM_Core_Page {
$contactType,
$contactSubtype,
$contactImageUrl
- ) = CRM_Contact_BAO_Contact::getDisplayAndImage($contactId,
+ ) = CRM_Contact_BAO_Contact::getDisplayAndImage($contactId,
TRUE,
TRUE
);
diff --git a/CRM/Contact/Page/View/CustomData.php b/CRM/Contact/Page/View/CustomData.php
index 511bd859ec..7f0f8b8817 100644
--- a/CRM/Contact/Page/View/CustomData.php
+++ b/CRM/Contact/Page/View/CustomData.php
@@ -111,9 +111,9 @@ class CRM_Contact_Page_View_CustomData extends CRM_Core_Page {
if ($this->_action == CRM_Core_Action::BROWSE) {
//Custom Groups Inline
- $entityType = CRM_Contact_BAO_Contact::getContactType($this->_contactId);
+ $entityType = CRM_Contact_BAO_Contact::getContactType($this->_contactId);
$entitySubType = CRM_Contact_BAO_Contact::getContactSubType($this->_contactId);
- $groupTree = &CRM_Core_BAO_CustomGroup::getTree($entityType, $this, $this->_contactId,
+ $groupTree = &CRM_Core_BAO_CustomGroup::getTree($entityType, $this, $this->_contactId,
$this->_groupId, $entitySubType
);
diff --git a/CRM/Contact/Page/View/GroupContact.php b/CRM/Contact/Page/View/GroupContact.php
index 3310b10660..01d5c7cdf1 100644
--- a/CRM/Contact/Page/View/GroupContact.php
+++ b/CRM/Contact/Page/View/GroupContact.php
@@ -43,9 +43,9 @@ class CRM_Contact_Page_View_GroupContact extends CRM_Core_Page {
$count = CRM_Contact_BAO_GroupContact::getContactGroup($this->_contactId, NULL, NULL, TRUE);
- $in = CRM_Contact_BAO_GroupContact::getContactGroup($this->_contactId, 'Added');
+ $in = CRM_Contact_BAO_GroupContact::getContactGroup($this->_contactId, 'Added');
$pending = CRM_Contact_BAO_GroupContact::getContactGroup($this->_contactId, 'Pending');
- $out = CRM_Contact_BAO_GroupContact::getContactGroup($this->_contactId, 'Removed');
+ $out = CRM_Contact_BAO_GroupContact::getContactGroup($this->_contactId, 'Removed');
// keep track of all 'added' contact groups so we can remove them from the smart group
// section
diff --git a/CRM/Contact/Page/View/Log.php b/CRM/Contact/Page/View/Log.php
index 9e857fb8d1..3b8da83952 100644
--- a/CRM/Contact/Page/View/Log.php
+++ b/CRM/Contact/Page/View/Log.php
@@ -45,8 +45,8 @@ class CRM_Contact_Page_View_Log extends CRM_Core_Page {
if ($loggingReport) {
$this->assign('instanceUrl',
- CRM_Utils_System::url("civicrm/report/instance/{$loggingReport}",
- "reset=1&force=1&snippet=4§ion=2&altered_contact_id_op=eq&altered_contact_id_value={$this->_contactId}&cid={$this->_contactId}", FALSE, NULL, FALSE));
+ CRM_Utils_System::url("civicrm/report/instance/{$loggingReport}",
+ "reset=1&force=1&snippet=4§ion=2&altered_contact_id_op=eq&altered_contact_id_value={$this->_contactId}&cid={$this->_contactId}", FALSE, NULL, FALSE));
return;
}
diff --git a/CRM/Contact/Page/View/Note.php b/CRM/Contact/Page/View/Note.php
index 83c2ef243b..2906018d68 100644
--- a/CRM/Contact/Page/View/Note.php
+++ b/CRM/Contact/Page/View/Note.php
@@ -87,9 +87,9 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page {
* return null
*/
public function browse() {
- $note = new CRM_Core_DAO_Note();
+ $note = new CRM_Core_DAO_Note();
$note->entity_table = 'civicrm_contact';
- $note->entity_id = $this->_contactId;
+ $note->entity_id = $this->_contactId;
$note->orderBy('modified_date desc');
@@ -103,7 +103,7 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page {
$mask = CRM_Core_Action::mask($permissions);
$values = array();
- $links = self::links();
+ $links = self::links();
$action = array_sum(array_keys($links)) & $mask;
$note->find();
@@ -177,8 +177,9 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page {
$session->pushUserContext($url);
if (CRM_Utils_Request::retrieve('confirmed', 'Boolean',
- CRM_Core_DAO::$_nullObject
- )) {
+ CRM_Core_DAO::$_nullObject
+ )
+ ) {
CRM_Core_BAO_Note::del($this->_id);
CRM_Utils_System::redirect($url);
}
diff --git a/CRM/Contact/Page/View/Print.php b/CRM/Contact/Page/View/Print.php
index d28510a543..eac69366dd 100644
--- a/CRM/Contact/Page/View/Print.php
+++ b/CRM/Contact/Page/View/Print.php
@@ -61,9 +61,9 @@ class CRM_Contact_Page_View_Print extends CRM_Contact_Page_View_Summary {
* @return void
*/
public function view() {
- $params = array();
+ $params = array();
$defaults = array();
- $ids = array();
+ $ids = array();
$params['id'] = $params['contact_id'] = $this->_contactId;
$contact = CRM_Contact_BAO_Contact::retrieve($params, $defaults, $ids);
diff --git a/CRM/Contact/Page/View/Relationship.php b/CRM/Contact/Page/View/Relationship.php
index ed73699a9a..2fdd80530d 100644
--- a/CRM/Contact/Page/View/Relationship.php
+++ b/CRM/Contact/Page/View/Relationship.php
@@ -165,8 +165,9 @@ class CRM_Contact_Page_View_Relationship extends CRM_Core_Page {
$session->pushUserContext($url);
if (CRM_Utils_Request::retrieve('confirmed', 'Boolean',
- CRM_Core_DAO::$_nullObject
- )) {
+ CRM_Core_DAO::$_nullObject
+ )
+ ) {
if ($this->_caseId) {
//create an activity for case role removal.CRM-4480
CRM_Case_BAO_Case::createCaseRoleActivity($this->_caseId, $this->_id);
diff --git a/CRM/Contact/Page/View/Summary.php b/CRM/Contact/Page/View/Summary.php
index 24eb69dd2a..169a9766e9 100644
--- a/CRM/Contact/Page/View/Summary.php
+++ b/CRM/Contact/Page/View/Summary.php
@@ -141,9 +141,9 @@ class CRM_Contact_Page_View_Summary extends CRM_Contact_Page_View {
$url = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $this->_contactId);
$session->pushUserContext($url);
- $params = array();
+ $params = array();
$defaults = array();
- $ids = array();
+ $ids = array();
$params['id'] = $params['contact_id'] = $this->_contactId;
$params['noRelationships'] = $params['noNotes'] = $params['noGroups'] = TRUE;
@@ -360,14 +360,14 @@ class CRM_Contact_Page_View_Summary extends CRM_Contact_Page_View {
foreach ($rest as $k => $v) {
if ($accessCiviCRM && !empty($this->_viewOptions[$k])) {
$allTabs[] = $v + array(
- 'id' => $k,
- 'url' => CRM_Utils_System::url(
- "civicrm/contact/view/$k",
- "reset=1&cid={$this->_contactId}"
- ),
- 'weight' => $weight,
- 'count' => CRM_Contact_BAO_Contact::getCountComponent($k, $this->_contactId),
- );
+ 'id' => $k,
+ 'url' => CRM_Utils_System::url(
+ "civicrm/contact/view/$k",
+ "reset=1&cid={$this->_contactId}"
+ ),
+ 'weight' => $weight,
+ 'count' => CRM_Contact_BAO_Contact::getCountComponent($k, $this->_contactId),
+ );
$weight += 10;
}
}
diff --git a/CRM/Contact/Page/View/UserDashBoard.php b/CRM/Contact/Page/View/UserDashBoard.php
index 3b1db77572..fdc49338e2 100644
--- a/CRM/Contact/Page/View/UserDashBoard.php
+++ b/CRM/Contact/Page/View/UserDashBoard.php
@@ -240,13 +240,13 @@ class CRM_Contact_Page_View_UserDashBoard extends CRM_Core_Page {
if (CRM_Core_Permission::check('access CiviCRM')) {
self::$_links = array_merge(self::$_links, array(
CRM_Core_Action::DISABLE => array(
- 'name' => ts('Disable'),
- 'url' => 'civicrm/contact/view/rel',
- 'qs' => 'action=disable&reset=1&cid=%%cid%%&id=%%id%%&rtype=%%rtype%%&selectedChild=rel&context=dashboard',
- 'extra' => 'onclick = "return confirm(\'' . $disableExtra . '\');"',
- 'title' => ts('Disable Relationship'),
- ),
- ));
+ 'name' => ts('Disable'),
+ 'url' => 'civicrm/contact/view/rel',
+ 'qs' => 'action=disable&reset=1&cid=%%cid%%&id=%%id%%&rtype=%%rtype%%&selectedChild=rel&context=dashboard',
+ 'extra' => 'onclick = "return confirm(\'' . $disableExtra . '\');"',
+ 'title' => ts('Disable Relationship'),
+ ),
+ ));
}
}
diff --git a/CRM/Contact/Page/View/Vcard.php b/CRM/Contact/Page/View/Vcard.php
index a697d348cc..88e2eaa3f7 100644
--- a/CRM/Contact/Page/View/Vcard.php
+++ b/CRM/Contact/Page/View/Vcard.php
@@ -51,9 +51,9 @@ class CRM_Contact_Page_View_Vcard extends CRM_Contact_Page_View {
public function run() {
$this->preProcess();
- $params = array();
+ $params = array();
$defaults = array();
- $ids = array();
+ $ids = array();
$params['id'] = $params['contact_id'] = $this->_contactId;
$contact = CRM_Contact_BAO_Contact::retrieve($params, $defaults, $ids);
@@ -111,9 +111,9 @@ class CRM_Contact_Page_View_Vcard extends CRM_Contact_Page_View {
if (!empty($location['supplemental_address_2'])) {
$extend .= ', ' . $location['supplemental_address_2'];
}
- $street = CRM_Utils_Array::value('street_address', $location);
+ $street = CRM_Utils_Array::value('street_address', $location);
$locality = CRM_Utils_Array::value('city', $location);
- $region = NULL;
+ $region = NULL;
if (!empty($location['state_province_id'])) {
$region = $stateProvices[CRM_Utils_Array::value('state_province_id', $location)];
}
diff --git a/CRM/Contact/Selector.php b/CRM/Contact/Selector.php
index f2914c6506..3c37792145 100644
--- a/CRM/Contact/Selector.php
+++ b/CRM/Contact/Selector.php
@@ -63,12 +63,25 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se
* @static
*/
static $_properties = array(
- 'contact_id', 'contact_type', 'contact_sub_type',
- 'sort_name', 'street_address',
- 'city', 'state_province', 'postal_code', 'country',
- 'geo_code_1', 'geo_code_2', 'is_deceased',
- 'email', 'on_hold', 'phone', 'status',
- 'do_not_email', 'do_not_phone', 'do_not_mail',
+ 'contact_id',
+ 'contact_type',
+ 'contact_sub_type',
+ 'sort_name',
+ 'street_address',
+ 'city',
+ 'state_province',
+ 'postal_code',
+ 'country',
+ 'geo_code_1',
+ 'geo_code_2',
+ 'is_deceased',
+ 'email',
+ 'on_hold',
+ 'phone',
+ 'status',
+ 'do_not_email',
+ 'do_not_phone',
+ 'do_not_mail',
);
/**
@@ -299,9 +312,9 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se
* @param array $params
*/
public function getPagerParams($action, &$params) {
- $params['status'] = ts('Contact %%StatusMessage%%');
+ $params['status'] = ts('Contact %%StatusMessage%%');
$params['csvString'] = NULL;
- $params['rowCount'] = CRM_Utils_Pager::ROWCOUNT;
+ $params['rowCount'] = CRM_Utils_Pager::ROWCOUNT;
$params['buttonTop'] = 'PagerTopButton';
$params['buttonBottom'] = 'PagerBottomButton';
@@ -374,7 +387,8 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se
$direction = CRM_Utils_Sort::ASCENDING;
$empty = TRUE;
if (!self::$_columnHeaders) {
- self::$_columnHeaders = array(array('name' => ''),
+ self::$_columnHeaders = array(
+ array('name' => ''),
array(
'name' => ts('Name'),
'sort' => 'sort_name',
@@ -399,7 +413,10 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se
}
if (in_array($fieldName, array(
- 'phone', 'im', 'email'))) {
+ 'phone',
+ 'im',
+ 'email'
+ ))) {
if ($type) {
$name = "`$locationTypeName-$fieldName-$type`";
}
@@ -438,7 +455,8 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se
$headers = self::$_columnHeaders;
}
elseif (!empty($this->_returnProperties)) {
- self::$_columnHeaders = array(array('name' => ''),
+ self::$_columnHeaders = array(
+ array('name' => ''),
array(
'name' => ts('Name'),
'sort' => 'sort_name',
@@ -576,7 +594,10 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se
$locationTypeName = str_replace(' ', '_', $locationTypeName);
if (in_array($fieldName, array(
- 'phone', 'im', 'email'))) {
+ 'phone',
+ 'im',
+ 'email'
+ ))) {
if ($type) {
$names[] = "{$locationTypeName}-{$fieldName}-{$type}";
}
@@ -651,14 +672,17 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se
elseif (strpos($property, '-im')) {
$row[$property] = $result->$property;
if (!empty($result->$property)) {
- $imProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
- $providerId = $property . "-provider_id";
- $providerName = $imProviders[$result->$providerId];
+ $imProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
+ $providerId = $property . "-provider_id";
+ $providerName = $imProviders[$result->$providerId];
$row[$property] = $result->$property . " ({$providerName})";
}
}
elseif (in_array($property, array(
- 'addressee', 'email_greeting', 'postal_greeting'))) {
+ 'addressee',
+ 'email_greeting',
+ 'postal_greeting'
+ ))) {
$greeting = $property . '_display';
$row[$property] = $result->$greeting;
}
@@ -675,9 +699,9 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se
$websiteFld = $websiteKey . '-' . array_pop($propertyArray);
if (!empty($result->$websiteFld)) {
$websiteTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id');
- $websiteType = $websiteTypes[$result->{"$websiteKey-website_type_id"}];
+ $websiteType = $websiteTypes[$result->{"$websiteKey-website_type_id"}];
$websiteValue = $result->$websiteFld;
- $websiteUrl = "
{$websiteValue} ({$websiteType})";
+ $websiteUrl = "
{$websiteValue} ({$websiteType})";
}
$row[$property] = $websiteUrl;
}
@@ -799,7 +823,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se
);
$row['contact_type_orig'] = $result->contact_sub_type ? $result->contact_sub_type : $result->contact_type;
- $row['contact_sub_type'] = $result->contact_sub_type ? CRM_Contact_BAO_ContactType::contactTypePairs(FALSE, $result->contact_sub_type, ', ') : $result->contact_sub_type;
+ $row['contact_sub_type'] = $result->contact_sub_type ? CRM_Contact_BAO_ContactType::contactTypePairs(FALSE, $result->contact_sub_type, ', ') : $result->contact_sub_type;
$row['contact_id'] = $result->contact_id;
$row['sort_name'] = $result->sort_name;
if (array_key_exists('id', $row)) {
@@ -1077,8 +1101,8 @@ SELECT DISTINCT 'civicrm_contact', contact_a.id, contact_a.id, '$cacheKey', cont
* Given the current formValues, gets the query in local
* language
*
- * @param array(
- reference) $formValues submitted formValues
+ * @param array (
+ * reference) $formValues submitted formValues
*
* @return array
* which contains an array of strings
diff --git a/CRM/Contact/Selector/Custom.php b/CRM/Contact/Selector/Custom.php
index e8dee4b0a8..b4ad66c504 100644
--- a/CRM/Contact/Selector/Custom.php
+++ b/CRM/Contact/Selector/Custom.php
@@ -209,9 +209,9 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector {
* @param array $params
*/
public function getPagerParams($action, &$params) {
- $params['status'] = ts('Contact %%StatusMessage%%');
+ $params['status'] = ts('Contact %%StatusMessage%%');
$params['csvString'] = NULL;
- $params['rowCount'] = CRM_Utils_Pager::ROWCOUNT;
+ $params['rowCount'] = CRM_Utils_Pager::ROWCOUNT;
$params['buttonTop'] = 'PagerTopButton';
$params['buttonBottom'] = 'PagerBottomButton';
@@ -296,15 +296,16 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector {
// contact query object used for creating $sql
$contactQueryObj = NULL;
if (method_exists($this->_search, 'getQueryObj') &&
- is_a($this->_search->getQueryObj(), 'CRM_Contact_BAO_Query')) {
+ is_a($this->_search->getQueryObj(), 'CRM_Contact_BAO_Query')
+ ) {
$contactQueryObj = $this->_search->getQueryObj();
}
$dao = CRM_Core_DAO::executeQuery($sql, CRM_Core_DAO::$_nullArray);
- $columns = $this->_search->columns();
+ $columns = $this->_search->columns();
$columnNames = array_values($columns);
- $links = self::links($this->_key);
+ $links = self::links($this->_key);
$permissions = array(CRM_Core_Permission::getPermission());
if (CRM_Core_Permission::check('delete contacts')) {
@@ -314,8 +315,8 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector {
$alterRow = FALSE;
if (method_exists($this->_customSearchClass,
- 'alterRow'
- )) {
+ 'alterRow'
+ )) {
$alterRow = TRUE;
}
$image = FALSE;
@@ -377,8 +378,8 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector {
* Given the current formValues, gets the query in local
* language
*
- * @param array(
- reference) $formValues submitted formValues
+ * @param array (
+ * reference) $formValues submitted formValues
*
* @return array
* which contains an array of strings
diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php
index 57b00994ac..6d83725bef 100644
--- a/CRM/Contribute/BAO/Contribution.php
+++ b/CRM/Contribute/BAO/Contribution.php
@@ -3160,9 +3160,9 @@ WHERE contribution_id = %1 ";
if (!in_array($contributionStatuses[$fields['contribution_status_id']], $checkStatus[$contributionStatuses[$values['contribution_status_id']]])) {
$errors['contribution_status_id'] = ts("Cannot change contribution status from %1 to %2.", array(
- 1 => $contributionStatuses[$values['contribution_status_id']],
- 2 => $contributionStatuses[$fields['contribution_status_id']],
- ));
+ 1 => $contributionStatuses[$values['contribution_status_id']],
+ 2 => $contributionStatuses[$fields['contribution_status_id']],
+ ));
}
}
diff --git a/CRM/Contribute/BAO/Contribution/Utils.php b/CRM/Contribute/BAO/Contribution/Utils.php
index fc85bb7b97..1d9b7a5527 100644
--- a/CRM/Contribute/BAO/Contribution/Utils.php
+++ b/CRM/Contribute/BAO/Contribution/Utils.php
@@ -283,8 +283,8 @@ class CRM_Contribute_BAO_Contribution_Utils {
if ($component !== 'membership') {
CRM_Core_Error::displaySessionError($result);
CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contribute/transact',
- "_qf_Main_display=true&qfKey={$form->_params['qfKey']}"
- ));
+ "_qf_Main_display=true&qfKey={$form->_params['qfKey']}"
+ ));
}
$membershipResult[1] = $result;
}
@@ -354,7 +354,7 @@ class CRM_Contribute_BAO_Contribution_Utils {
$form->_values['contribution_id'] = $contribution->id;
CRM_Contribute_BAO_ContributionPage::sendMail($contactID,
$form->_values, $contribution->is_test,
- FALSE, $fieldTypes
+ FALSE, $fieldTypes
);
}
}
@@ -374,6 +374,7 @@ class CRM_Contribute_BAO_Contribution_Utils {
return FALSE;
}
+
/**
* Get the contribution details by month
* of the year
@@ -511,9 +512,10 @@ INNER JOIN civicrm_contact contact ON ( contact.id = contrib.contact_id )
if (!CRM_Utils_System::isNull($params['email'])) {
$params['email'] = array(
1 => array(
- 'email' => $params['email'],
+ 'email' => $params['email'],
'location_type_id' => $billingLocTypeId,
- ));
+ )
+ );
}
if (isset($transaction['trxn_id'])) {
@@ -567,7 +569,11 @@ INNER JOIN civicrm_contact contact ON ( contact.id = contrib.contact_id )
$type = strtolower($type);
if (!in_array($type, array(
- 'paypal', 'google', 'csv'))) {
+ 'paypal',
+ 'google',
+ 'csv'
+ ))
+ ) {
// return the params as is
return $apiParams;
}
diff --git a/CRM/Contribute/BAO/ContributionPage.php b/CRM/Contribute/BAO/ContributionPage.php
index 389aafd036..77729652e3 100644
--- a/CRM/Contribute/BAO/ContributionPage.php
+++ b/CRM/Contribute/BAO/ContributionPage.php
@@ -633,60 +633,60 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio
),
);
$copy = &CRM_Core_DAO::copyGeneric('CRM_Contribute_DAO_ContributionPage', array(
- 'id' => $id,
- ), NULL, $fieldsFix);
+ 'id' => $id,
+ ), NULL, $fieldsFix);
//copying all the blocks pertaining to the contribution page
$copyPledgeBlock = &CRM_Core_DAO::copyGeneric('CRM_Pledge_DAO_PledgeBlock', array(
- 'entity_id' => $id,
- 'entity_table' => 'civicrm_contribution_page',
- ), array(
- 'entity_id' => $copy->id,
- ));
+ 'entity_id' => $id,
+ 'entity_table' => 'civicrm_contribution_page',
+ ), array(
+ 'entity_id' => $copy->id,
+ ));
$copyMembershipBlock = &CRM_Core_DAO::copyGeneric('CRM_Member_DAO_MembershipBlock', array(
- 'entity_id' => $id,
- 'entity_table' => 'civicrm_contribution_page',
- ), array(
- 'entity_id' => $copy->id,
- ));
+ 'entity_id' => $id,
+ 'entity_table' => 'civicrm_contribution_page',
+ ), array(
+ 'entity_id' => $copy->id,
+ ));
$copyUFJoin = &CRM_Core_DAO::copyGeneric('CRM_Core_DAO_UFJoin', array(
- 'entity_id' => $id,
- 'entity_table' => 'civicrm_contribution_page',
- ), array(
- 'entity_id' => $copy->id,
- ));
+ 'entity_id' => $id,
+ 'entity_table' => 'civicrm_contribution_page',
+ ), array(
+ 'entity_id' => $copy->id,
+ ));
$copyWidget = &CRM_Core_DAO::copyGeneric('CRM_Contribute_DAO_Widget', array(
- 'contribution_page_id' => $id,
- ), array(
- 'contribution_page_id' => $copy->id,
- ));
+ 'contribution_page_id' => $id,
+ ), array(
+ 'contribution_page_id' => $copy->id,
+ ));
//copy price sets
CRM_Price_BAO_PriceSet::copyPriceSet('civicrm_contribution_page', $id, $copy->id);
$copyTellFriend = &CRM_Core_DAO::copyGeneric('CRM_Friend_DAO_Friend', array(
- 'entity_id' => $id,
- 'entity_table' => 'civicrm_contribution_page',
- ), array(
- 'entity_id' => $copy->id,
- ));
+ 'entity_id' => $id,
+ 'entity_table' => 'civicrm_contribution_page',
+ ), array(
+ 'entity_id' => $copy->id,
+ ));
$copyPersonalCampaignPages = &CRM_Core_DAO::copyGeneric('CRM_PCP_DAO_PCPBlock', array(
- 'entity_id' => $id,
- 'entity_table' => 'civicrm_contribution_page',
- ), array(
- 'entity_id' => $copy->id,
- ));
+ 'entity_id' => $id,
+ 'entity_table' => 'civicrm_contribution_page',
+ ), array(
+ 'entity_id' => $copy->id,
+ ));
$copyPremium = &CRM_Core_DAO::copyGeneric('CRM_Contribute_DAO_Premium', array(
- 'entity_id' => $id,
- 'entity_table' => 'civicrm_contribution_page',
- ), array(
- 'entity_id' => $copy->id,
- ));
+ 'entity_id' => $id,
+ 'entity_table' => 'civicrm_contribution_page',
+ ), array(
+ 'entity_id' => $copy->id,
+ ));
$premiumQuery = "
SELECT id
FROM civicrm_premiums
@@ -696,7 +696,7 @@ WHERE entity_table = 'civicrm_contribution_page'
$premiumDao = CRM_Core_DAO::executeQuery($premiumQuery, CRM_Core_DAO::$_nullArray);
while ($premiumDao->fetch()) {
if ($premiumDao->id) {
- $copyPremiumProduct = & CRM_Core_DAO::copyGeneric('CRM_Contribute_DAO_PremiumsProduct', array(
+ $copyPremiumProduct = &CRM_Core_DAO::copyGeneric('CRM_Contribute_DAO_PremiumsProduct', array(
'premiums_id' => $premiumDao->id,
), array(
'premiums_id' => $copyPremium->id,
@@ -818,8 +818,8 @@ LEFT JOIN civicrm_premiums ON ( civicrm_premiums.entity_id = civicrm
* @see CRM_Core_DAO::buildOptions
*
* @param string $fieldName
- * @param string $context: @see CRM_Core_DAO::buildOptionsContext
- * @param array $props: whatever is known about this dao object
+ * @param string $context : @see CRM_Core_DAO::buildOptionsContext
+ * @param array $props : whatever is known about this dao object
*
* @return array|bool
*/
@@ -831,7 +831,7 @@ LEFT JOIN civicrm_premiums ON ( civicrm_premiums.entity_id = civicrm
// Fixme - this is going to ignore context, better to get conditions, add params, and call PseudoConstant::get
return CRM_Financial_BAO_FinancialType::getIncomeFinancialType();
- break;
+ break;
}
return CRM_Core_PseudoConstant::get(__CLASS__, $fieldName, $params, $context);
}
@@ -839,8 +839,8 @@ LEFT JOIN civicrm_premiums ON ( civicrm_premiums.entity_id = civicrm
/**
* Get or Set multilingually affected honor params for processing module_data or setting default values.
*
- * @param string $params:
- * @param bool $setDefault: If yes then returns array to used for setting default value afterward
+ * @param string $params :
+ * @param bool $setDefault : If yes then returns array to used for setting default value afterward
*
* @return array|string
*/
@@ -938,7 +938,11 @@ LEFT JOIN civicrm_premiums ON ( civicrm_premiums.entity_id = civicrm
* isSeparateMembershipPayment
*/
public static function getIsMembershipPayment($id) {
- $membershipBlocks = civicrm_api3('membership_block', 'get', array('entity_table' => 'civicrm_contribution_page', 'entity_id' => $id, 'sequential' => TRUE));
+ $membershipBlocks = civicrm_api3('membership_block', 'get', array(
+ 'entity_table' => 'civicrm_contribution_page',
+ 'entity_id' => $id,
+ 'sequential' => TRUE
+ ));
if (!$membershipBlocks['count']) {
return FALSE;
}
diff --git a/CRM/Contribute/BAO/ContributionRecur.php b/CRM/Contribute/BAO/ContributionRecur.php
index 153fa200dd..ccfef2f84e 100644
--- a/CRM/Contribute/BAO/ContributionRecur.php
+++ b/CRM/Contribute/BAO/ContributionRecur.php
@@ -117,8 +117,8 @@ class CRM_Contribute_BAO_ContributionRecur extends CRM_Contribute_DAO_Contributi
* static
*/
public static function checkDuplicate($params, &$duplicates) {
- $id = CRM_Utils_Array::value('id', $params);
- $trxn_id = CRM_Utils_Array::value('trxn_id', $params);
+ $id = CRM_Utils_Array::value('id', $params);
+ $trxn_id = CRM_Utils_Array::value('trxn_id', $params);
$invoice_id = CRM_Utils_Array::value('invoice_id', $params);
$clause = array();
@@ -144,8 +144,8 @@ class CRM_Contribute_BAO_ContributionRecur extends CRM_Contribute_DAO_Contributi
$params[3] = array($id, 'Integer');
}
- $query = "SELECT id FROM civicrm_contribution_recur WHERE $clause";
- $dao = CRM_Core_DAO::executeQuery($query, $params);
+ $query = "SELECT id FROM civicrm_contribution_recur WHERE $clause";
+ $dao = CRM_Core_DAO::executeQuery($query, $params);
$result = FALSE;
while ($dao->fetch()) {
$duplicates[] = $dao->id;
@@ -219,9 +219,9 @@ SELECT r.payment_processor_id
return $result;
}
- $recur = new CRM_Contribute_DAO_ContributionRecur();
+ $recur = new CRM_Contribute_DAO_ContributionRecur();
$recur->id = $recurId;
- $result = $recur->delete();
+ $result = $recur->delete();
return $result;
}
@@ -246,9 +246,9 @@ SELECT r.payment_processor_id
}
$contributionStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name');
- $canceledId = array_search('Cancelled', $contributionStatus);
- $recur = new CRM_Contribute_DAO_ContributionRecur();
- $recur->id = $recurId;
+ $canceledId = array_search('Cancelled', $contributionStatus);
+ $recur = new CRM_Contribute_DAO_ContributionRecur();
+ $recur->id = $recurId;
$recur->whereAdd("contribution_status_id != $canceledId");
if ($recur->find(TRUE)) {
@@ -266,15 +266,15 @@ SELECT r.payment_processor_id
if ($dao->auto_renew && $dao->membership_id) {
// its auto-renewal membership mode
$membershipTypes = CRM_Member_PseudoConstant::membershipType();
- $membershipType = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_Membership', $dao->membership_id, 'membership_type_id');
- $membershipType = CRM_Utils_Array::value($membershipType, $membershipTypes);
+ $membershipType = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_Membership', $dao->membership_id, 'membership_type_id');
+ $membershipType = CRM_Utils_Array::value($membershipType, $membershipTypes);
$details .= '
' . ts('Automatic renewal of %1 membership cancelled.', array(1 => $membershipType));
}
else {
$details .= '
' . ts('The recurring contribution of %1, every %2 %3 has been cancelled.', array(
- 1 => $dao->amount,
+ 1 => $dao->amount,
2 => $dao->frequency_interval,
3 => $dao->frequency_unit,
));
diff --git a/CRM/Contribute/BAO/ContributionSoft.php b/CRM/Contribute/BAO/ContributionSoft.php
index f27bc3cb7e..e654b31857 100644
--- a/CRM/Contribute/BAO/ContributionSoft.php
+++ b/CRM/Contribute/BAO/ContributionSoft.php
@@ -114,8 +114,9 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio
GROUP BY currency';
$params = array(
- 1 => array($contact_id, 'Integer'),
- 2 => array($isTest, 'Integer'));
+ 1 => array($contact_id, 'Integer'),
+ 2 => array($isTest, 'Integer')
+ );
$cs = CRM_Core_DAO::executeQuery($query, $params);
diff --git a/CRM/Contribute/BAO/Query.php b/CRM/Contribute/BAO/Query.php
index 4c8e4c9671..a4448dd253 100644
--- a/CRM/Contribute/BAO/Query.php
+++ b/CRM/Contribute/BAO/Query.php
@@ -81,7 +81,7 @@ class CRM_Contribute_BAO_Query {
// get financial_type
if (!empty($query->_returnProperties['financial_type'])) {
- $query->_select['financial_type'] = "civicrm_financial_type.name as financial_type";
+ $query->_select['financial_type'] = "civicrm_financial_type.name as financial_type";
$query->_element['financial_type'] = 1;
$query->_tables['civicrm_contribution'] = 1;
$query->_tables['civicrm_financial_type'] = 1;
@@ -89,7 +89,7 @@ class CRM_Contribute_BAO_Query {
// get accounting code
if (!empty($query->_returnProperties['accounting_code'])) {
- $query->_select['accounting_code'] = "civicrm_financial_account.accounting_code as accounting_code";
+ $query->_select['accounting_code'] = "civicrm_financial_account.accounting_code as accounting_code";
$query->_element['accounting_code'] = 1;
$query->_tables['civicrm_accounting_code'] = 1;
$query->_tables['civicrm_financial_account'] = 1;
@@ -150,7 +150,7 @@ class CRM_Contribute_BAO_Query {
$query->_element['contribution_soft_credit_name'] = 1;
// also include contact id. Will help build hyperlinks
- $query->_select['contribution_soft_credit_contact_id'] = "civicrm_contact_d.id as contribution_soft_credit_contact_id";
+ $query->_select['contribution_soft_credit_contact_id'] = "civicrm_contact_d.id as contribution_soft_credit_contact_id";
$query->_element['contribution_soft_credit_contact_id'] = 1;
$query->_tables['civicrm_contribution'] = 1;
@@ -419,7 +419,7 @@ class CRM_Contribute_BAO_Query {
$scTypes = $value;
$names[] = $softCreditTypes[$value];
}
- $query->_qill[$grouping][] = ts('Soft Credit Type %1', array(1 => $op)) . " '" . implode("' " . ts('or') . " '", $names) . "'";
+ $query->_qill[$grouping][] = ts('Soft Credit Type %1', array(1 => $op)) . " '" . implode("' " . ts('or') . " '", $names) . "'";
$query->_where[$grouping][] =
CRM_Contact_BAO_Query::buildClause(
"civicrm_contribution_soft.soft_credit_type_id",
@@ -642,7 +642,7 @@ class CRM_Contribute_BAO_Query {
default:
//all other elements are handle in this case
- $fldName = substr($name, 13);
+ $fldName = substr($name, 13);
if (!isset($fields[$fldName])) {
// CRM-12597
CRM_Core_Session::setStatus(ts(
@@ -653,7 +653,7 @@ class CRM_Contribute_BAO_Query {
return;
}
$whereTable = $fields[$fldName];
- $value = trim($value);
+ $value = trim($value);
//contribution fields (decimal fields) which don't require a quote in where clause.
$moneyFields = array('non_deductible_amount', 'fee_amount', 'net_amount');
@@ -695,15 +695,15 @@ class CRM_Contribute_BAO_Query {
public static function from($name, $mode, $side) {
$from = NULL;
switch ($name) {
- case 'civicrm_contribution':
- $from = " $side JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id ";
- if (in_array(self::$_contribOrSoftCredit, array("only_scredits", "both_related", "both"))) {
- // switch the from table if its only soft credit search
- $from = " $side JOIN contribution_search_scredit_combined ON contribution_search_scredit_combined.contact_id = contact_a.id ";
- $from .= " $side JOIN civicrm_contribution ON civicrm_contribution.id = contribution_search_scredit_combined.id ";
- $from .= " $side JOIN civicrm_contribution_soft ON civicrm_contribution_soft.id = contribution_search_scredit_combined.scredit_id";
- }
- break;
+ case 'civicrm_contribution':
+ $from = " $side JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id ";
+ if (in_array(self::$_contribOrSoftCredit, array("only_scredits", "both_related", "both"))) {
+ // switch the from table if its only soft credit search
+ $from = " $side JOIN contribution_search_scredit_combined ON contribution_search_scredit_combined.contact_id = contact_a.id ";
+ $from .= " $side JOIN civicrm_contribution ON civicrm_contribution.id = contribution_search_scredit_combined.id ";
+ $from .= " $side JOIN civicrm_contribution_soft ON civicrm_contribution_soft.id = contribution_search_scredit_combined.scredit_id";
+ }
+ break;
case 'civicrm_contribution_recur':
if ($mode == 1) {
@@ -761,7 +761,7 @@ class CRM_Contribute_BAO_Query {
break;
case 'contribution_softcredit_type':
- $from = " $side JOIN civicrm_option_group option_group_contribution_softcredit_type ON
+ $from = " $side JOIN civicrm_option_group option_group_contribution_softcredit_type ON
(option_group_contribution_softcredit_type.name = 'soft_credit_type')";
$from .= " $side JOIN civicrm_option_value contribution_softcredit_type ON
( civicrm_contribution_soft.soft_credit_type_id = contribution_softcredit_type.value
@@ -856,10 +856,10 @@ class CRM_Contribute_BAO_Query {
}
if (in_array(self::$_contribOrSoftCredit,
array("only_scredits", "both_related", "both"))) {
- if (!$tempTableFilled) {
- // build a temp table which is union of contributions and soft credits
- // note: group-by in first part ensures uniqueness in counts
- $tempQuery = "
+ if (!$tempTableFilled) {
+ // build a temp table which is union of contributions and soft credits
+ // note: group-by in first part ensures uniqueness in counts
+ $tempQuery = "
CREATE TEMPORARY TABLE IF NOT EXISTS contribution_search_scredit_combined AS
SELECT con.id as id, con.contact_id, cso.id as filter_id, NULL as scredit_id
FROM civicrm_contribution con
@@ -868,11 +868,11 @@ class CRM_Contribute_BAO_Query {
UNION ALL
SELECT scredit.contribution_id as id, scredit.contact_id, scredit.id as filter_id, scredit.id as scredit_id
FROM civicrm_contribution_soft as scredit";
- CRM_Core_DAO::executeQuery($tempQuery);
- $tempTableFilled = TRUE;
- }
- return TRUE;
+ CRM_Core_DAO::executeQuery($tempQuery);
+ $tempTableFilled = TRUE;
}
+ return TRUE;
+ }
return FALSE;
}
@@ -881,11 +881,11 @@ class CRM_Contribute_BAO_Query {
*
* @return array
*/
- public static function softCreditReturnProperties($isExportMode = False) {
+ public static function softCreditReturnProperties($isExportMode = FALSE) {
$properties = array(
- 'contribution_soft_credit_name' => 1,
+ 'contribution_soft_credit_name' => 1,
'contribution_soft_credit_amount' => 1,
- 'contribution_soft_credit_type' => 1,
+ 'contribution_soft_credit_type' => 1,
);
if ($isExportMode) {
$properties['contribution_soft_credit_contribution_id'] = 1;
@@ -982,7 +982,8 @@ class CRM_Contribute_BAO_Query {
$form->add('select', 'contribution_currency_type',
ts('Currency Type'),
array(
- '' => ts('- any -')) +
+ '' => ts('- any -')
+ ) +
CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'currency', array('labelColumn' => 'name')),
FALSE, array('class' => 'crm-select2')
);
@@ -995,7 +996,8 @@ class CRM_Contribute_BAO_Query {
$form->add('select', 'contribution_page_id',
ts('Contribution Page'),
array(
- '' => ts('- any -')) +
+ '' => ts('- any -')
+ ) +
CRM_Contribute_PseudoConstant::contributionPage(),
FALSE, array('class' => 'crm-select2')
);
@@ -1004,7 +1006,8 @@ class CRM_Contribute_BAO_Query {
$form->add('select', 'contribution_payment_instrument_id',
ts('Payment Instrument'),
array(
- '' => ts('- any -')) +
+ '' => ts('- any -')
+ ) +
CRM_Contribute_PseudoConstant::paymentInstrument(),
FALSE, array('class' => 'crm-select2')
);
@@ -1012,7 +1015,8 @@ class CRM_Contribute_BAO_Query {
$form->add('select', 'contribution_pcp_made_through_id',
ts('Personal Campaign Page'),
array(
- '' => ts('- any -')) +
+ '' => ts('- any -')
+ ) +
CRM_Contribute_PseudoConstant::pcPage(),
FALSE, array('class' => 'crm-select2')
);
@@ -1059,17 +1063,17 @@ class CRM_Contribute_BAO_Query {
$options = array(
'only_contribs' => ts('Contributions Only'),
'only_scredits' => ts('Soft Credits Only'),
- 'both_related' => ts('Soft Credits with related Hard Credit'),
- 'both' => ts('Both'),
+ 'both_related' => ts('Soft Credits with related Hard Credit'),
+ 'both' => ts('Both'),
);
$form->add('select', 'contribution_or_softcredits', ts('Contributions OR Soft Credits?'), $options, FALSE, array('class' => "crm-select2"));
$form->addSelect(
'contribution_soft_credit_type_id',
array(
- 'entity' => 'contribution_soft',
- 'field' => 'soft_credit_type_id',
- 'multiple' => TRUE,
- 'context' => 'search',
+ 'entity' => 'contribution_soft',
+ 'field' => 'soft_credit_type_id',
+ 'multiple' => TRUE,
+ 'context' => 'search',
)
);
diff --git a/CRM/Contribute/BAO/Widget.php b/CRM/Contribute/BAO/Widget.php
index e2f2c98e87..731660dd9d 100644
--- a/CRM/Contribute/BAO/Widget.php
+++ b/CRM/Contribute/BAO/Widget.php
@@ -89,8 +89,8 @@ class CRM_Contribute_BAO_Widget extends CRM_Contribute_DAO_Widget {
$params = array(1 => array($contributionPageID, 'Integer'));
$dao = CRM_Core_DAO::executeQuery($query, $params);
if ($dao->fetch()) {
- $data['num_donors'] = (int)$dao->count;
- $data['money_raised'] = (int)$dao->amount;
+ $data['num_donors'] = (int) $dao->count;
+ $data['money_raised'] = (int) $dao->amount;
}
else {
$data['num_donors'] = $data['money_raised'] = $data->money_raised = 0;
@@ -106,7 +106,7 @@ class CRM_Contribute_BAO_Widget extends CRM_Contribute_DAO_Widget {
$data['campaign_start'] = '';
$startDate = NULL;
if ($dao->fetch()) {
- $data['money_target'] = (int)$dao->goal_amount;
+ $data['money_target'] = (int) $dao->goal_amount;
// conditions that needs to be handled
// 1. Campaign is not active - no text
@@ -126,8 +126,9 @@ class CRM_Contribute_BAO_Widget extends CRM_Contribute_DAO_Widget {
$data['is_active'] = FALSE;
$data['campaign_start'] = ts('Campaign starts on %1', array(
1 => CRM_Utils_Date::customFormat($dao->start_date,
- $config->dateformatFull
- )));
+ $config->dateformatFull
+ )
+ ));
}
}
@@ -139,20 +140,23 @@ class CRM_Contribute_BAO_Widget extends CRM_Contribute_DAO_Widget {
$data['is_active'] = FALSE;
$data['campaign_start'] = ts('Campaign ended on %1', array(
1 => CRM_Utils_Date::customFormat($dao->end_date,
- $config->dateformatFull
- )));
+ $config->dateformatFull
+ )
+ ));
}
elseif ($startDate >= $now) {
$data['campaign_start'] = ts('Campaign starts on %1', array(
1 => CRM_Utils_Date::customFormat($dao->start_date,
- $config->dateformatFull
- )));
+ $config->dateformatFull
+ )
+ ));
}
else {
$data['campaign_start'] = ts('Campaign ends on %1', array(
1 => CRM_Utils_Date::customFormat($dao->end_date,
- $config->dateformatFull
- )));
+ $config->dateformatFull
+ )
+ ));
}
}
}
@@ -169,15 +173,18 @@ class CRM_Contribute_BAO_Widget extends CRM_Contribute_DAO_Widget {
$percent = $data['money_raised'] / $data['money_target'];
$data['money_raised_percentage'] = (round($percent, 2)) * 100 . "%";
$data['money_target_display'] = CRM_Utils_Money::format($data['money_target']);
- $data['money_raised'] = ts('Raised %1 of %2', array(1 => CRM_Utils_Money::format($data['money_raised']), 2 => $data['money_target_display']));
+ $data['money_raised'] = ts('Raised %1 of %2', array(
+ 1 => CRM_Utils_Money::format($data['money_raised']),
+ 2 => $data['money_target_display']
+ ));
}
else {
$data['money_raised'] = ts('Raised %1', array(1 => CRM_Utils_Money::format($data['money_raised'])));
}
- $data['money_low'] = 0;
+ $data['money_low'] = 0;
$data['num_donors'] = $data['num_donors'] . " " . ts('Donors');
- $data['home_url'] = "
" . ts('Learn more.') . "";
+ $data['home_url'] = "
" . ts('Learn more.') . "";
// if is_active is false, show this link and hide the contribute button
$data['homepage_link'] = $widget->url_homepage;
diff --git a/CRM/Contribute/Config.php b/CRM/Contribute/Config.php
index d91601fb00..b90b21013f 100644
--- a/CRM/Contribute/Config.php
+++ b/CRM/Contribute/Config.php
@@ -36,4 +36,5 @@
* $Id$
*
*/
-class CRM_Contribute_Config extends CRM_Core_Component_Config {}
+class CRM_Contribute_Config extends CRM_Core_Component_Config {
+}
diff --git a/CRM/Contribute/Exception/InactiveContributionPageException.php b/CRM/Contribute/Exception/InactiveContributionPageException.php
index 788ac732c4..742d1b0b37 100644
--- a/CRM/Contribute/Exception/InactiveContributionPageException.php
+++ b/CRM/Contribute/Exception/InactiveContributionPageException.php
@@ -1,4 +1,5 @@
id = $id;
diff --git a/CRM/Contribute/Form/AbstractEditPayment.php b/CRM/Contribute/Form/AbstractEditPayment.php
index 55dd114c9d..f515b9ab05 100644
--- a/CRM/Contribute/Form/AbstractEditPayment.php
+++ b/CRM/Contribute/Form/AbstractEditPayment.php
@@ -329,11 +329,11 @@ LEFT JOIN civicrm_contribution on (civicrm_contribution.contact_id = civicrm_co
$endDate = CRM_Utils_Array::value('membership_end_date', $updateResult);
if ($endDate) {
$statusMsg .= "
" . ts("Membership for %1 has been updated. The membership End Date is %2.",
- array(
- 1 => $userDisplayName,
- 2 => $endDate,
- )
- );
+ array(
+ 1 => $userDisplayName,
+ 2 => $endDate,
+ )
+ );
}
}
}
@@ -418,7 +418,7 @@ LEFT JOIN civicrm_contribution on (civicrm_contribution.contact_id = civicrm_co
if (empty($this->_paymentProcessors)) {
throw new CRM_Core_Exception(ts('You will need to configure the %1 settings for your Payment Processor before you can submit a credit card transactions.', array(1 => $this->_mode)));
}
- $this->_processors = array();
+ $this->_processors = array();
foreach ($this->_paymentProcessors as $id => $processor) {
$this->_processors[$id] = ts($processor['name']);
}
diff --git a/CRM/Contribute/Form/AdditionalInfo.php b/CRM/Contribute/Form/AdditionalInfo.php
index 5d1c072e30..31ec73c698 100644
--- a/CRM/Contribute/Form/AdditionalInfo.php
+++ b/CRM/Contribute/Form/AdditionalInfo.php
@@ -66,7 +66,7 @@ class CRM_Contribute_Form_AdditionalInfo {
}
$form->_options = $sel2;
$form->assign('mincontribution', $min_amount);
- $sel = & $form->addElement('hierselect', "product_name", ts('Premium'), 'onclick="showMinContrib();"');
+ $sel = &$form->addElement('hierselect', "product_name", ts('Premium'), 'onclick="showMinContrib();"');
$js = "\n", $snippet['script']);
@@ -220,7 +220,7 @@ class CRM_Core_Region {
default:
require_once 'CRM/Core/Error.php';
CRM_Core_Error::fatal(ts('Snippet type %1 is unrecognized',
- array(1 => $snippet['type'])));
+ array(1 => $snippet['type'])));
}
}
return $html;
@@ -255,14 +255,14 @@ class CRM_Core_Region {
* @param string $markup
* HTML.
*
- public function addMarkup($markup) {
- return $this->add(array(
- 'type' => 'markup',
- 'markup' => $markup,
- ));
- }
-
- /**
+ * public function addMarkup($markup) {
+ * return $this->add(array(
+ * 'type' => 'markup',
+ * 'markup' => $markup,
+ * ));
+ * }
+ *
+ * /**
* Add a Smarty template file to a region
*
* Note: File is not evaluated until the page is rendered
@@ -270,26 +270,26 @@ class CRM_Core_Region {
* @param string $template
* Path to the Smarty template file.
*
- public function addTemplate($template) {
- return $this->add(array(
- 'type' => 'template',
- 'template' => $template,
- ));
- }
-
- /**
+ * public function addTemplate($template) {
+ * return $this->add(array(
+ * 'type' => 'template',
+ * 'template' => $template,
+ * ));
+ * }
+ *
+ * /**
* Use a callback function to extend a region
*
* @param mixed $callback
* @param array $arguments
* Optional, array of parameters for callback; if omitted, the default arguments are ($snippetSpec, $html).
*
- public function addCallback($callback, $arguments = FALSE) {
- return $this->add(array(
- 'type' => 'callback',
- 'callback' => $callback,
- 'arguments' => $arguments,
- ));
- }
- */
+ * public function addCallback($callback, $arguments = FALSE) {
+ * return $this->add(array(
+ * 'type' => 'callback',
+ * 'callback' => $callback,
+ * 'arguments' => $arguments,
+ * ));
+ * }
+ */
}
diff --git a/CRM/Core/Report/Excel.php b/CRM/Core/Report/Excel.php
index 0ae0eca5f6..83aeaa1584 100644
--- a/CRM/Core/Report/Excel.php
+++ b/CRM/Core/Report/Excel.php
@@ -59,10 +59,10 @@ class CRM_Core_Report_Excel {
$result = '';
- $config = CRM_Core_Config::singleton();
- $seperator = $config->fieldSeparator;
- $enclosed = '"';
- $escaped = $enclosed;
+ $config = CRM_Core_Config::singleton();
+ $seperator = $config->fieldSeparator;
+ $enclosed = '"';
+ $escaped = $enclosed;
$add_character = "\015\012";
$schema_insert = '';
diff --git a/CRM/Core/Resources.php b/CRM/Core/Resources.php
index 10e4f40460..7c361855c0 100644
--- a/CRM/Core/Resources.php
+++ b/CRM/Core/Resources.php
@@ -160,7 +160,7 @@ class CRM_Core_Resources {
* relative weight within a given region.
* @param string $region
* location within the file; 'html-header', 'page-header', 'page-footer'.
- * @param $translate, whether to parse this file for strings enclosed in ts()
+ * @param $translate , whether to parse this file for strings enclosed in ts()
*
* @return CRM_Core_Resources
*/
@@ -258,9 +258,9 @@ class CRM_Core_Resources {
$region = self::isAjaxMode() ? 'ajax-snippet' : 'html-header';
$resources = $this;
CRM_Core_Region::instance($region)->add(array(
- 'callback' => function(&$snippet, &$html) use ($resources) {
- $html .= "\n" . $resources->renderSetting();
- },
+ 'callback' => function (&$snippet, &$html) use ($resources) {
+ $html .= "\n" . $resources->renderSetting();
+ },
'weight' => -100000,
));
$this->addedSettings = TRUE;
@@ -530,10 +530,11 @@ class CRM_Core_Resources {
// Add global settings
$settings = array(
- 'config' => array(
- 'ajaxPopupsEnabled' => $this->ajaxPopupsEnabled,
- 'isFrontend' => $config->userFrameworkFrontend,
- ));
+ 'config' => array(
+ 'ajaxPopupsEnabled' => $this->ajaxPopupsEnabled,
+ 'isFrontend' => $config->userFrameworkFrontend,
+ )
+ );
// Disable profile creation if user lacks permission
if (!CRM_Core_Permission::check('edit all contacts') && !CRM_Core_Permission::check('add contacts')) {
$settings['config']['entityRef']['contactCreate'] = FALSE;
@@ -650,30 +651,19 @@ class CRM_Core_Resources {
"packages/jquery/jquery-1.11.1$min.js",
"packages/jquery/jquery-ui/jquery-ui$min.js",
"packages/jquery/jquery-ui/jquery-ui$min.css",
-
"packages/backbone/lodash.compat$min.js",
-
"packages/jquery/plugins/jquery.mousewheel$min.js",
-
"packages/jquery/plugins/select2/select2$min.js",
"packages/jquery/plugins/select2/select2.css",
-
"packages/jquery/plugins/jquery.tableHeader.js",
-
"packages/jquery/plugins/jquery.textarearesizer.js",
-
"packages/jquery/plugins/jquery.form$min.js",
-
"packages/jquery/plugins/jquery.timeentry$min.js",
-
"packages/jquery/plugins/jquery.blockUI$min.js",
-
"packages/jquery/plugins/DataTables/media/js/jquery.dataTables$min.js",
"packages/jquery/plugins/DataTables/media/css/jquery.dataTables$min.css",
-
"packages/jquery/plugins/jquery.validate$min.js",
"packages/jquery/plugins/jquery.ui.datepicker.validation.pack.js",
-
"js/Common.js",
"js/crm.ajax.js",
);
@@ -722,7 +712,11 @@ class CRM_Core_Resources {
* is this page request an ajax snippet?
*/
public static function isAjaxMode() {
- return in_array(CRM_Utils_Array::value('snippet', $_REQUEST), array(CRM_Core_Smarty::PRINT_SNIPPET, CRM_Core_Smarty::PRINT_NOFORM, CRM_Core_Smarty::PRINT_JSON));
+ return in_array(CRM_Utils_Array::value('snippet', $_REQUEST), array(
+ CRM_Core_Smarty::PRINT_SNIPPET,
+ CRM_Core_Smarty::PRINT_NOFORM,
+ CRM_Core_Smarty::PRINT_JSON
+ ));
}
/**
@@ -737,14 +731,15 @@ class CRM_Core_Resources {
$filters['event'] = array(
array('key' => 'event_type_id', 'value' => ts('Event Type')),
array(
- 'key' => 'start_date',
- 'value' => ts('Start Date'),
- 'options' => array(
- array('key' => '{">":"now"}', 'value' => ts('Upcoming')),
- array('key' => '{"BETWEEN":["now - 3 month","now"]}', 'value' => ts('Past 3 Months')),
- array('key' => '{"BETWEEN":["now - 6 month","now"]}', 'value' => ts('Past 6 Months')),
- array('key' => '{"BETWEEN":["now - 1 year","now"]}', 'value' => ts('Past Year')),
- )),
+ 'key' => 'start_date',
+ 'value' => ts('Start Date'),
+ 'options' => array(
+ array('key' => '{">":"now"}', 'value' => ts('Upcoming')),
+ array('key' => '{"BETWEEN":["now - 3 month","now"]}', 'value' => ts('Past 3 Months')),
+ array('key' => '{"BETWEEN":["now - 6 month","now"]}', 'value' => ts('Past 6 Months')),
+ array('key' => '{"BETWEEN":["now - 1 year","now"]}', 'value' => ts('Past Year')),
+ )
+ ),
);
$filters['activity'] = array(
diff --git a/CRM/Core/ScheduledJob.php b/CRM/Core/ScheduledJob.php
index fc96115de5..effe858229 100644
--- a/CRM/Core/ScheduledJob.php
+++ b/CRM/Core/ScheduledJob.php
@@ -80,8 +80,8 @@ class CRM_Core_ScheduledJob {
* @param null $date
*/
public function saveLastRun($date = NULL) {
- $dao = new CRM_Core_DAO_Job();
- $dao->id = $this->id;
+ $dao = new CRM_Core_DAO_Job();
+ $dao->id = $this->id;
$dao->last_run = ($date == NULL) ? CRM_Utils_Date::currentDBDate() : CRM_Utils_Date::currentDBDate($date);
$dao->save();
}
@@ -101,7 +101,7 @@ class CRM_Core_ScheduledJob {
return TRUE;
case 'Hourly':
- $now = CRM_Utils_Date::currentDBDate();
+ $now = CRM_Utils_Date::currentDBDate();
$hourAgo = strtotime('-1 hour', strtotime($now));
$lastRun = strtotime($this->last_run);
if ($lastRun < $hourAgo) {
@@ -109,8 +109,8 @@ class CRM_Core_ScheduledJob {
}
case 'Daily':
- $now = CRM_Utils_Date::currentDBDate();
- $dayAgo = strtotime('-1 day', strtotime($now));
+ $now = CRM_Utils_Date::currentDBDate();
+ $dayAgo = strtotime('-1 day', strtotime($now));
$lastRun = strtotime($this->last_run);
if ($lastRun < $dayAgo) {
return TRUE;
diff --git a/CRM/Core/SelectValues.php b/CRM/Core/SelectValues.php
index 4839aa8464..5a31958955 100644
--- a/CRM/Core/SelectValues.php
+++ b/CRM/Core/SelectValues.php
@@ -357,7 +357,7 @@ class CRM_Core_SelectValues {
*/
public static function mailingComponents() {
return array(
- 'Header' => ts('Header'),
+ 'Header' => ts('Header'),
'Footer' => ts('Footer'),
'Reply' => ts('Reply Auto-responder'),
'OptOut' => ts('Opt-out Message'),
@@ -571,7 +571,7 @@ class CRM_Core_SelectValues {
static $tokens = NULL;
if (!$tokens) {
$additionalFields = array(
- 'checksum' => array('title' => ts('Checksum')),
+ 'checksum' => array('title' => ts('Checksum')),
'contact_id' => array('title' => ts('Internal Contact ID')),
);
$exportFields = array_merge(CRM_Contact_BAO_Contact::exportableFields(), $additionalFields);
@@ -581,8 +581,16 @@ class CRM_Core_SelectValues {
//FIXME:skipping some tokens for time being.
$skipTokens = array(
- 'is_bulkmail', 'group', 'tag', 'contact_sub_type', 'note',
- 'is_deceased', 'deceased_date', 'legal_identifier', 'contact_sub_type', 'user_unique_id',
+ 'is_bulkmail',
+ 'group',
+ 'tag',
+ 'contact_sub_type',
+ 'note',
+ 'is_deceased',
+ 'deceased_date',
+ 'legal_identifier',
+ 'contact_sub_type',
+ 'user_unique_id',
);
$customFields = CRM_Core_BAO_CustomField::getFields(array('Individual', 'Address'));
@@ -645,8 +653,14 @@ class CRM_Core_SelectValues {
// skipping some tokens for time being.
$skipTokens = array(
- 'event_id', 'participant_is_pay_later', 'participant_is_test', 'participant_contact_id',
- 'participant_fee_currency', 'participant_campaign_id', 'participant_status', 'participant_discount_name',
+ 'event_id',
+ 'participant_is_pay_later',
+ 'participant_is_test',
+ 'participant_contact_id',
+ 'participant_fee_currency',
+ 'participant_campaign_id',
+ 'participant_status',
+ 'participant_discount_name',
);
$customFields = CRM_Core_BAO_CustomField::getFields('Participant');
@@ -879,9 +893,9 @@ class CRM_Core_SelectValues {
*/
public static function getWordReplacementMatchType() {
return array(
- 'exactMatch' => ts('Exact Match'),
- 'wildcardMatch' => ts('Wildcard Match'),
- );
+ 'exactMatch' => ts('Exact Match'),
+ 'wildcardMatch' => ts('Wildcard Match'),
+ );
}
/**
@@ -924,7 +938,8 @@ class CRM_Core_SelectValues {
static $scheduleReminderFrequencyUnits = NULL;
if (!$scheduleReminderFrequencyUnits) {
$scheduleReminderFrequencyUnits = array(
- 'hour' => ts('hour')) + CRM_Core_OptionGroup::values('recur_frequency_units');
+ 'hour' => ts('hour')
+ ) + CRM_Core_OptionGroup::values('recur_frequency_units');
}
return $scheduleReminderFrequencyUnits;
diff --git a/CRM/Core/Selector/Controller.php b/CRM/Core/Selector/Controller.php
index 534cef9eb4..457d4cac31 100644
--- a/CRM/Core/Selector/Controller.php
+++ b/CRM/Core/Selector/Controller.php
@@ -48,7 +48,7 @@ class CRM_Core_Selector_Controller {
*/
// move the values from the session to the template
const SESSION = 1, TEMPLATE = 2,
- TRANSFER = 4, EXPORT = 8, SCREEN = 16, PDF = 32;
+ TRANSFER = 4, EXPORT = 8, SCREEN = 16, PDF = 32;
/**
* A CRM Object that implements CRM_Core_Selector_API
@@ -201,10 +201,10 @@ class CRM_Core_Selector_Controller {
$this->_pageID = $pageID ? $pageID : 1;
$this->_sortID = $sortID ? $sortID : NULL;
$this->_action = $action;
- $this->_store = $store;
+ $this->_store = $store;
$this->_output = $output;
$this->_prefix = $prefix;
- $this->_case = $case;
+ $this->_case = $case;
// fix sortID
if ($this->_sortID && strpos($this->_sortID, '_') === FALSE) {
@@ -342,8 +342,8 @@ class CRM_Core_Selector_Controller {
$rows = self::getRows($this);
CRM_Utils_Hook::searchColumns($contextName, $columnHeaders, $rows, $this);
$rowsEmpty = count($rows) ? FALSE : TRUE;
- $qill = $this->getQill();
- $summary = $this->getSummary();
+ $qill = $this->getQill();
+ $summary = $this->getSummary();
// if we need to store in session, lets update session
if ($this->_output & self::SESSION) {
$this->_store->set("{$this->_prefix}columnHeaders", $columnHeaders);
diff --git a/CRM/Core/Session.php b/CRM/Core/Session.php
index 0c9133346f..458fe56cdf 100644
--- a/CRM/Core/Session.php
+++ b/CRM/Core/Session.php
@@ -125,7 +125,7 @@ class CRM_Core_Session {
// FIXME: This belongs in CRM_Utils_System_*
if ($config->userSystem->is_drupal && function_exists('drupal_session_start')) {
// https://issues.civicrm.org/jira/browse/CRM-14356
- if (! (isset($GLOBALS['lazy_session']) && $GLOBALS['lazy_session'] == TRUE)) {
+ if (!(isset($GLOBALS['lazy_session']) && $GLOBALS['lazy_session'] == TRUE)) {
drupal_session_start();
}
$_SESSION = array();
diff --git a/CRM/Core/ShowHideBlocks.php b/CRM/Core/ShowHideBlocks.php
index 887ea1b8e3..1617329987 100644
--- a/CRM/Core/ShowHideBlocks.php
+++ b/CRM/Core/ShowHideBlocks.php
@@ -196,7 +196,7 @@ class CRM_Core_ShowHideBlocks {
$hideCode = "cj('#id_{$prefix}').hide(); cj('#id_{$prefix}_show').show(); return false;";
self::setIcons();
- $values = array();
+ $values = array();
$values['show'] = self::linkHtml("${prefix}_show", "#${prefix}_hide", self::$_showIcon . $showLinkText, "onclick=\"$showCode\"");
$values['hide'] = self::linkHtml("${prefix}_hide", "#${prefix}", self::$_hideIcon . $hideLinkText, "onclick=\"$hideCode\"");
diff --git a/CRM/Core/Smarty.php b/CRM/Core/Smarty.php
index 5ff43aca84..928036aadf 100644
--- a/CRM/Core/Smarty.php
+++ b/CRM/Core/Smarty.php
@@ -120,10 +120,10 @@ class CRM_Core_Smarty extends Smarty {
if (isset($config->customPHPPathDir)) {
$customPluginsDir =
$config->customPHPPathDir . DIRECTORY_SEPARATOR .
- 'CRM' . DIRECTORY_SEPARATOR .
- 'Core' . DIRECTORY_SEPARATOR .
- 'Smarty' . DIRECTORY_SEPARATOR .
- 'plugins' . DIRECTORY_SEPARATOR;
+ 'CRM' . DIRECTORY_SEPARATOR .
+ 'Core' . DIRECTORY_SEPARATOR .
+ 'Smarty' . DIRECTORY_SEPARATOR .
+ 'plugins' . DIRECTORY_SEPARATOR;
if (!file_exists($customPluginsDir)) {
$customPluginsDir = NULL;
}
diff --git a/CRM/Core/Smarty/plugins/block.edit.php b/CRM/Core/Smarty/plugins/block.edit.php
index a39a478a0d..851e724b94 100644
--- a/CRM/Core/Smarty/plugins/block.edit.php
+++ b/CRM/Core/Smarty/plugins/block.edit.php
@@ -49,7 +49,7 @@
* The Smarty object.
*
* @return string
- * the string, translated by gettext
+ * the string, translated by gettext
*/
function smarty_block_edit($params, $text, &$smarty) {
$action = $smarty->_tpl_vars['action'];
diff --git a/CRM/Core/Smarty/plugins/block.htxt.php b/CRM/Core/Smarty/plugins/block.htxt.php
index a87f7e85b9..d228479aee 100644
--- a/CRM/Core/Smarty/plugins/block.htxt.php
+++ b/CRM/Core/Smarty/plugins/block.htxt.php
@@ -45,7 +45,7 @@
* The Smarty object.
*
* @return string
- * the string, translated by gettext
+ * the string, translated by gettext
*/
function smarty_block_htxt($params, $text, &$smarty) {
$id = $params['id'];
diff --git a/CRM/Core/Smarty/plugins/block.localize.php b/CRM/Core/Smarty/plugins/block.localize.php
index 198df317c7..8e0bed30bc 100644
--- a/CRM/Core/Smarty/plugins/block.localize.php
+++ b/CRM/Core/Smarty/plugins/block.localize.php
@@ -46,7 +46,7 @@
* The Smarty object.
*
* @return string
- * multilingualized query
+ * multilingualized query
*/
function smarty_block_localize($params, $text, &$smarty) {
if (!$smarty->_tpl_vars['multilingual']) {
diff --git a/CRM/Core/Smarty/plugins/block.serialize.php b/CRM/Core/Smarty/plugins/block.serialize.php
index 64a1ad80aa..1092629b18 100644
--- a/CRM/Core/Smarty/plugins/block.serialize.php
+++ b/CRM/Core/Smarty/plugins/block.serialize.php
@@ -47,7 +47,7 @@
* The Smarty object.
*
* @return string
- * the string, translated by gettext
+ * the string, translated by gettext
*/
function smarty_block_serialize($params, $text, &$smarty) {
return serialize($text);
diff --git a/CRM/Core/Smarty/plugins/block.ts.php b/CRM/Core/Smarty/plugins/block.ts.php
index 14c535e9f8..092363eda2 100644
--- a/CRM/Core/Smarty/plugins/block.ts.php
+++ b/CRM/Core/Smarty/plugins/block.ts.php
@@ -48,7 +48,7 @@
* The Smarty object.
*
* @return string
- * the string, translated by gettext
+ * the string, translated by gettext
*/
function smarty_block_ts($params, $text, &$smarty) {
if (!isset($params['domain'])) {
diff --git a/CRM/Core/Smarty/plugins/function.crmKey.php b/CRM/Core/Smarty/plugins/function.crmKey.php
index ea8f01754e..47d2e40a56 100644
--- a/CRM/Core/Smarty/plugins/function.crmKey.php
+++ b/CRM/Core/Smarty/plugins/function.crmKey.php
@@ -42,7 +42,7 @@
* The Smarty object.
*
* @return string
- * the generated key
+ * the generated key
*/
function smarty_function_crmKey($params, &$smarty) {
return
diff --git a/CRM/Core/Smarty/plugins/function.crmNavigationMenu.php b/CRM/Core/Smarty/plugins/function.crmNavigationMenu.php
index 252cdf08c6..b5bfba1315 100644
--- a/CRM/Core/Smarty/plugins/function.crmNavigationMenu.php
+++ b/CRM/Core/Smarty/plugins/function.crmNavigationMenu.php
@@ -42,7 +42,7 @@
* The Smarty object.
*
* @return string
- * HTML
+ * HTML
*/
function smarty_function_crmNavigationMenu($params, &$smarty) {
$config = CRM_Core_Config::singleton();
diff --git a/CRM/Core/Smarty/plugins/function.docURL.php b/CRM/Core/Smarty/plugins/function.docURL.php
index 17a0e6057a..84d9bbc050 100644
--- a/CRM/Core/Smarty/plugins/function.docURL.php
+++ b/CRM/Core/Smarty/plugins/function.docURL.php
@@ -43,7 +43,7 @@
* Reference to the smarty object.
*
* @return string
- * HTML code of a link to documentation
+ * HTML code of a link to documentation
*/
function smarty_function_docURL($params, &$smarty) {
if (!isset($smarty)) {
diff --git a/CRM/Core/Smarty/plugins/function.help.php b/CRM/Core/Smarty/plugins/function.help.php
index bf93bddf16..fce651c236 100644
--- a/CRM/Core/Smarty/plugins/function.help.php
+++ b/CRM/Core/Smarty/plugins/function.help.php
@@ -42,7 +42,7 @@
* Reference to the smarty object.
*
* @return string
- * the help html to be inserted
+ * the help html to be inserted
*/
function smarty_function_help($params, &$smarty) {
if (!isset($params['id']) || !isset($smarty->_tpl_vars['config'])) {
diff --git a/CRM/Core/Smarty/plugins/function.sectionTotal.php b/CRM/Core/Smarty/plugins/function.sectionTotal.php
index 11cf42ac95..9d1e03fdc3 100644
--- a/CRM/Core/Smarty/plugins/function.sectionTotal.php
+++ b/CRM/Core/Smarty/plugins/function.sectionTotal.php
@@ -49,7 +49,7 @@
* The Smarty object.
*
* @return string
- * the string, translated by gettext
+ * the string, translated by gettext
*/
function smarty_function_sectionTotal($params, &$smarty) {
/* section totals are stored in template variable 'sectionTotals',
diff --git a/CRM/Core/Smarty/plugins/function.simpleActivityContacts.php b/CRM/Core/Smarty/plugins/function.simpleActivityContacts.php
index 22c64acc41..59459c5e4a 100644
--- a/CRM/Core/Smarty/plugins/function.simpleActivityContacts.php
+++ b/CRM/Core/Smarty/plugins/function.simpleActivityContacts.php
@@ -39,11 +39,11 @@ function smarty_function_simpleActivityContacts($params, &$smarty) {
require_once 'api/api.php';
require_once 'api/v3/utils.php';
$activity = civicrm_api('activity', 'getsingle', array(
- 'version' => 3,
- 'id' => $params['activity_id'],
- 'return.target_contact_id' => 1,
- 'return.assignee_contact_id' => 1,
- ));
+ 'version' => 3,
+ 'id' => $params['activity_id'],
+ 'return.target_contact_id' => 1,
+ 'return.assignee_contact_id' => 1,
+ ));
$baseContactParams = array('version' => 3);
foreach (explode(',', $params['return']) as $field) {
@@ -51,7 +51,9 @@ function smarty_function_simpleActivityContacts($params, &$smarty) {
}
foreach (array(
- 'target', 'assignee') as $role) {
+ 'target',
+ 'assignee'
+ ) as $role) {
$contact = array();
if (!empty($activity[$role . '_contact_id'])) {
$contact_id = array_shift($activity[$role . '_contact_id']);
diff --git a/CRM/Core/Smarty/plugins/modifier.crmAddClass.php b/CRM/Core/Smarty/plugins/modifier.crmAddClass.php
index eab0a5df6a..ebecda4452 100644
--- a/CRM/Core/Smarty/plugins/modifier.crmAddClass.php
+++ b/CRM/Core/Smarty/plugins/modifier.crmAddClass.php
@@ -42,7 +42,7 @@
* The new class or classes to add (separate with a space).
*
* @return string
- * the new modified html string
+ * the new modified html string
*/
function smarty_modifier_crmAddClass($string, $class) {
// Standardize white space
diff --git a/CRM/Core/Smarty/plugins/modifier.crmBtnType.php b/CRM/Core/Smarty/plugins/modifier.crmBtnType.php
index 5021647e41..6cb0b34198 100644
--- a/CRM/Core/Smarty/plugins/modifier.crmBtnType.php
+++ b/CRM/Core/Smarty/plugins/modifier.crmBtnType.php
@@ -39,7 +39,7 @@
* @param string $btnName
*
* @return string
- * button type, one of: 'upload', 'next', 'back', 'cancel', 'refresh'
+ * button type, one of: 'upload', 'next', 'back', 'cancel', 'refresh'
* 'submit', 'done', 'display', 'jump' 'process'
*/
function smarty_modifier_crmBtnType($btnName) {
diff --git a/CRM/Core/Smarty/plugins/modifier.crmDate.php b/CRM/Core/Smarty/plugins/modifier.crmDate.php
index ff045b67a6..6847674587 100644
--- a/CRM/Core/Smarty/plugins/modifier.crmDate.php
+++ b/CRM/Core/Smarty/plugins/modifier.crmDate.php
@@ -43,7 +43,7 @@
* @param bool $onlyTime
*
* @return string
- * human readable date format | invalid date message
+ * human readable date format | invalid date message
*/
function smarty_modifier_crmDate($dateString, $dateFormat = NULL, $onlyTime = FALSE) {
if ($dateString) {
diff --git a/CRM/Core/Smarty/plugins/modifier.crmDelete.php b/CRM/Core/Smarty/plugins/modifier.crmDelete.php
index e4b5f10f1b..57dc27cc18 100644
--- a/CRM/Core/Smarty/plugins/modifier.crmDelete.php
+++ b/CRM/Core/Smarty/plugins/modifier.crmDelete.php
@@ -45,7 +45,7 @@
* The attribute to modify.
*
* @return string
- * the new modified html string
+ * the new modified html string
*/
function smarty_modifier_crmDelete($string, $attribute) {
static $endOfElement = '/>';
diff --git a/CRM/Core/Smarty/plugins/modifier.crmICalDate.php b/CRM/Core/Smarty/plugins/modifier.crmICalDate.php
index fb4c8b2f2f..0751831c95 100644
--- a/CRM/Core/Smarty/plugins/modifier.crmICalDate.php
+++ b/CRM/Core/Smarty/plugins/modifier.crmICalDate.php
@@ -41,7 +41,7 @@
* @param bool $gdata
*
* @return string
- * formatted text
+ * formatted text
*/
function smarty_modifier_crmICalDate($str, $gdata = FALSE) {
return CRM_Utils_ICalendar::formatDate($str, $gdata);
diff --git a/CRM/Core/Smarty/plugins/modifier.crmICalText.php b/CRM/Core/Smarty/plugins/modifier.crmICalText.php
index e629e01953..5e3828dd96 100644
--- a/CRM/Core/Smarty/plugins/modifier.crmICalText.php
+++ b/CRM/Core/Smarty/plugins/modifier.crmICalText.php
@@ -39,7 +39,7 @@
* @param string $str
*
* @return string
- * formatted text
+ * formatted text
*/
function smarty_modifier_crmICalText($str) {
return CRM_Utils_ICalendar::formatText($str);
diff --git a/CRM/Core/Smarty/plugins/modifier.crmInsert.php b/CRM/Core/Smarty/plugins/modifier.crmInsert.php
index 8c8ad73390..9eb279573e 100644
--- a/CRM/Core/Smarty/plugins/modifier.crmInsert.php
+++ b/CRM/Core/Smarty/plugins/modifier.crmInsert.php
@@ -49,7 +49,7 @@
* The string before which we want this tag inserted.
*
* @return string
- * the new modified html string
+ * the new modified html string
*/
function smarty_modifier_crmInsert($string, $attribute, $value, $insertBefore = '/>') {
return str_replace($insertBefore, ' ' . $attribute . '="' . $value . '"' . $insertBefore, $string);
diff --git a/CRM/Core/Smarty/plugins/modifier.crmMoney.php b/CRM/Core/Smarty/plugins/modifier.crmMoney.php
index 227ad3f77e..9de1095e58 100644
--- a/CRM/Core/Smarty/plugins/modifier.crmMoney.php
+++ b/CRM/Core/Smarty/plugins/modifier.crmMoney.php
@@ -45,7 +45,7 @@
* @param bool $onlyNumber
*
* @return string
- * formatted monetary amount
+ * formatted monetary amount
*/
function smarty_modifier_crmMoney($amount, $currency = NULL, $format = NULL, $onlyNumber = FALSE) {
return CRM_Utils_Money::format($amount, $currency, $format, $onlyNumber);
diff --git a/CRM/Core/Smarty/plugins/modifier.crmNumberFormat.php b/CRM/Core/Smarty/plugins/modifier.crmNumberFormat.php
index fa810c250d..0c847f9139 100644
--- a/CRM/Core/Smarty/plugins/modifier.crmNumberFormat.php
+++ b/CRM/Core/Smarty/plugins/modifier.crmNumberFormat.php
@@ -47,7 +47,7 @@
* Thousands sep character (if other than ",").
*
* @return string
- * the formatted string
+ * the formatted string
*
* For alternate decimal point and thousands separator, delimit values with single quotes in the template.
* EXAMPLE: {$number|crmNumberFormat:2:',':' '} for French notation - 1234.56 becomes 1 234,56
@@ -57,8 +57,8 @@ function smarty_modifier_crmNumberFormat($number, $decimals = NULL, $dec_point =
// Both dec_point AND thousands_sep are required if one is not specified
// then use the config defaults
if (!$dec_point || !$thousands_sep) {
- $config = CRM_Core_Config::singleton();
- $dec_point = $config->monetaryDecimalPoint;
+ $config = CRM_Core_Config::singleton();
+ $dec_point = $config->monetaryDecimalPoint;
$thousands_sep = $config->monetaryThousandSeparator;
}
diff --git a/CRM/Core/Smarty/plugins/modifier.crmReplace.php b/CRM/Core/Smarty/plugins/modifier.crmReplace.php
index cd572a89b1..330299ce98 100644
--- a/CRM/Core/Smarty/plugins/modifier.crmReplace.php
+++ b/CRM/Core/Smarty/plugins/modifier.crmReplace.php
@@ -47,7 +47,7 @@
* The new attribute value.
*
* @return string
- * the new modified html string
+ * the new modified html string
*/
function smarty_modifier_crmReplace($string, $attribute, $value) {
// we need to search and replace the string: $attribute=XXX or $attribute="XXX"
diff --git a/CRM/Core/Smarty/plugins/modifier.crmStripAlternatives.php b/CRM/Core/Smarty/plugins/modifier.crmStripAlternatives.php
index 76da47c45c..5cfe8df3f8 100644
--- a/CRM/Core/Smarty/plugins/modifier.crmStripAlternatives.php
+++ b/CRM/Core/Smarty/plugins/modifier.crmStripAlternatives.php
@@ -41,7 +41,7 @@
* All alternatives as a long string (or some other text).
*
* @return string
- * only the first alternative found (or the text without alternatives)
+ * only the first alternative found (or the text without alternatives)
*/
function smarty_modifier_crmStripAlternatives($full) {
return CRM_Utils_String::stripAlternatives($full);
diff --git a/CRM/Core/Smarty/plugins/modifier.htmlize.php b/CRM/Core/Smarty/plugins/modifier.htmlize.php
index 5b2ae4b2bc..6f6ae44eb8 100644
--- a/CRM/Core/Smarty/plugins/modifier.htmlize.php
+++ b/CRM/Core/Smarty/plugins/modifier.htmlize.php
@@ -40,7 +40,7 @@
* Text to HTML-ize.
*
* @return string
- * HTML-ized version of $text
+ * HTML-ized version of $text
*/
function smarty_modifier_htmlize($text) {
$text = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([-\w/_\.]*(\?\S+)?)?)?)@', '
$1', $text);
diff --git a/CRM/Core/Smarty/plugins/modifier.json.php b/CRM/Core/Smarty/plugins/modifier.json.php
index 9e03697dc8..7530d77824 100644
--- a/CRM/Core/Smarty/plugins/modifier.json.php
+++ b/CRM/Core/Smarty/plugins/modifier.json.php
@@ -41,7 +41,7 @@
* @param mixed $data
*
* @return string
- * JSON
+ * JSON
*/
function smarty_modifier_json($data) {
return json_encode($data);
diff --git a/CRM/Core/Smarty/plugins/modifier.mb_truncate.php b/CRM/Core/Smarty/plugins/modifier.mb_truncate.php
index 8d8e3e56c2..997da1c479 100644
--- a/CRM/Core/Smarty/plugins/modifier.mb_truncate.php
+++ b/CRM/Core/Smarty/plugins/modifier.mb_truncate.php
@@ -58,7 +58,7 @@
* @return string
*/
function smarty_modifier_mb_truncate($string, $length = 80, $etc = '...',
- $break_words = FALSE
+ $break_words = FALSE
) {
if (function_exists('mb_internal_encoding') and function_exists('mb_strlen') and function_exists('mb_substr')) {
mb_internal_encoding('UTF-8');
diff --git a/CRM/Core/Smarty/plugins/prefilter.resetExtScope.php b/CRM/Core/Smarty/plugins/prefilter.resetExtScope.php
index 2415b84ce8..e7b6501e7b 100644
--- a/CRM/Core/Smarty/plugins/prefilter.resetExtScope.php
+++ b/CRM/Core/Smarty/plugins/prefilter.resetExtScope.php
@@ -8,5 +8,5 @@ function smarty_prefilter_resetExtScope($tpl_source, &$smarty) {
return
'{crmScope extensionKey=""}'
. $tpl_source
- . '{/crmScope}';
+ . '{/crmScope}';
}
diff --git a/CRM/Core/TableHierarchy.php b/CRM/Core/TableHierarchy.php
index c5a8d72658..dc07c38908 100644
--- a/CRM/Core/TableHierarchy.php
+++ b/CRM/Core/TableHierarchy.php
@@ -58,7 +58,7 @@ class CRM_Core_TableHierarchy {
'civicrm_entity_tag' => '22',
'civicrm_note' => '23',
'civicrm_contribution' => '24',
- 'civicrm_financial_type' => '25',
+ 'civicrm_financial_type' => '25',
'civicrm_participant' => '26',
'civicrm_event' => '27',
'civicrm_worldregion' => '28',
diff --git a/CRM/Custom/Form/ChangeFieldType.php b/CRM/Custom/Form/ChangeFieldType.php
index d6f4544374..06d26d3da6 100644
--- a/CRM/Custom/Form/ChangeFieldType.php
+++ b/CRM/Custom/Form/ChangeFieldType.php
@@ -85,8 +85,8 @@ class CRM_Custom_Form_ChangeFieldType extends CRM_Core_Form {
$session->pushUserContext($url);
CRM_Utils_System::setTitle(ts('Change Field Type: %1',
- array(1 => $this->_values['label'])
- ));
+ array(1 => $this->_values['label'])
+ ));
}
/**
@@ -112,7 +112,8 @@ class CRM_Custom_Form_ChangeFieldType extends CRM_Core_Form {
'dst_html_type',
ts('New HTML Type'),
array(
- '' => ts('- select -')) + $this->_htmlTypeTransitions,
+ '' => ts('- select -')
+ ) + $this->_htmlTypeTransitions,
TRUE
);
@@ -165,7 +166,11 @@ class CRM_Custom_Form_ChangeFieldType extends CRM_Core_Form {
$customField->find(TRUE);
if ($dstHtmlType == 'Text' && in_array($srcHtmlType, array(
- 'Select', 'Radio', 'Autocomplete-Select'))) {
+ 'Select',
+ 'Radio',
+ 'Autocomplete-Select'
+ ))
+ ) {
$customField->option_group_id = "NULL";
CRM_Core_BAO_CustomField::checkOptionGroup($this->_values['option_group_id']);
}
@@ -188,8 +193,8 @@ class CRM_Custom_Form_ChangeFieldType extends CRM_Core_Form {
CRM_Core_BAO_Cache::deleteGroup('contact fields');
CRM_Core_Session::setStatus(ts('Input type of custom field \'%1\' has been successfully changed to \'%2\'.',
- array(1 => $this->_values['label'], 2 => $dstHtmlType)
- ), ts('Field Type Changed'), 'success');
+ array(1 => $this->_values['label'], 2 => $dstHtmlType)
+ ), ts('Field Type Changed'), 'success');
}
/**
@@ -266,14 +271,14 @@ class CRM_Custom_Form_ChangeFieldType extends CRM_Core_Form {
public function firstValueToFlatten($table, $column) {
$selectSql = "SELECT id, $column FROM $table WHERE $column IS NOT NULL";
$updateSql = "UPDATE $table SET $column = %1 WHERE id = %2";
- $dao = CRM_Core_DAO::executeQuery($selectSql);
+ $dao = CRM_Core_DAO::executeQuery($selectSql);
while ($dao->fetch()) {
if (!$dao->{$column}) {
continue;
}
$value = CRM_Core_DAO::VALUE_SEPARATOR . $dao->{$column} . CRM_Core_DAO::VALUE_SEPARATOR;
$params = array(
- 1 => array((string) $value, 'String'),
+ 1 => array((string) $value, 'String'),
2 => array($dao->id, 'Integer'),
);
CRM_Core_DAO::executeQuery($updateSql, $params);
@@ -287,11 +292,11 @@ class CRM_Custom_Form_ChangeFieldType extends CRM_Core_Form {
public function flattenToFirstValue($table, $column) {
$selectSql = "SELECT id, $column FROM $table WHERE $column IS NOT NULL";
$updateSql = "UPDATE $table SET $column = %1 WHERE id = %2";
- $dao = CRM_Core_DAO::executeQuery($selectSql);
+ $dao = CRM_Core_DAO::executeQuery($selectSql);
while ($dao->fetch()) {
$values = self::explode($dao->{$column});
$params = array(
- 1 => array((string) array_shift($values), 'String'),
+ 1 => array((string) array_shift($values), 'String'),
2 => array($dao->id, 'Integer'),
);
CRM_Core_DAO::executeQuery($updateSql, $params);
diff --git a/CRM/Custom/Form/Field.php b/CRM/Custom/Form/Field.php
index de9ea04349..922246b88a 100644
--- a/CRM/Custom/Form/Field.php
+++ b/CRM/Custom/Form/Field.php
@@ -133,27 +133,27 @@ class CRM_Custom_Form_Field extends CRM_Core_Form {
if (self::$_dataToLabels == NULL) {
self::$_dataToLabels = array(
array(
- 'Text' => ts('Text'),
- 'Select' => ts('Select'),
+ 'Text' => ts('Text'),
+ 'Select' => ts('Select'),
'Radio' => ts('Radio'),
- 'CheckBox' => ts('CheckBox'),
- 'Multi-Select' => ts('Multi-Select'),
+ 'CheckBox' => ts('CheckBox'),
+ 'Multi-Select' => ts('Multi-Select'),
'AdvMulti-Select' => ts('Adv Multi-Select (obsolete)'),
'Autocomplete-Select' => ts('Autocomplete-Select'),
),
array(
- 'Text' => ts('Text'),
- 'Select' => ts('Select'),
+ 'Text' => ts('Text'),
+ 'Select' => ts('Select'),
'Radio' => ts('Radio'),
),
array(
- 'Text' => ts('Text'),
- 'Select' => ts('Select'),
+ 'Text' => ts('Text'),
+ 'Select' => ts('Select'),
'Radio' => ts('Radio'),
),
array(
- 'Text' => ts('Text'),
- 'Select' => ts('Select'),
+ 'Text' => ts('Text'),
+ 'Select' => ts('Select'),
'Radio' => ts('Radio'),
),
array('TextArea' => ts('TextArea'), 'RichTextEditor' => ts('Rich Text Editor')),
@@ -268,7 +268,8 @@ class CRM_Custom_Form_Field extends CRM_Core_Form {
$this->assign('dontShowLink', $dontShowLink);
}
if ($this->_action & CRM_Core_Action::ADD &&
- CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $this->_gid, 'is_multiple', 'id')) {
+ CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $this->_gid, 'is_multiple', 'id')
+ ) {
$defaults['in_selector'] = 1;
}
@@ -334,7 +335,7 @@ class CRM_Custom_Form_Field extends CRM_Core_Form {
}
else {
$optionTypes = array(
- '1' => ts('Create a new set of options'),
+ '1' => ts('Create a new set of options'),
'2' => ts('Reuse an existing set'),
);
@@ -342,7 +343,8 @@ class CRM_Custom_Form_Field extends CRM_Core_Form {
'option_group_id',
ts('Multiple Choice Option Sets'),
array(
- '' => ts('- select -')) + $optionGroups
+ '' => ts('- select -')
+ ) + $optionGroups
);
}
@@ -350,7 +352,8 @@ class CRM_Custom_Form_Field extends CRM_Core_Form {
ts('Option Type'),
$optionTypes,
array(
- 'onclick' => "showOptionSelect();"), '
'
+ 'onclick' => "showOptionSelect();"
+ ), '
'
);
$contactGroups = CRM_Core_PseudoConstant::group();
@@ -523,7 +526,7 @@ class CRM_Custom_Form_Field extends CRM_Core_Form {
);
// is searchable by range?
- $searchRange = array();
+ $searchRange = array();
$searchRange[] = $this->createElement('radio', NULL, NULL, ts('Yes'), '1');
$searchRange[] = $this->createElement('radio', NULL, NULL, ts('No'), '0');
@@ -583,16 +586,16 @@ class CRM_Custom_Form_Field extends CRM_Core_Form {
$errors = array();
//validate field label as well as name.
- $title = $fields['label'];
- $name = CRM_Utils_String::munge($title, '_', 64);
- $gId = $self->_gid; // CRM-7564
- $query = 'select count(*) from civicrm_custom_field where ( name like %1 OR label like %2 ) and id != %3 and custom_group_id = %4';
+ $title = $fields['label'];
+ $name = CRM_Utils_String::munge($title, '_', 64);
+ $gId = $self->_gid; // CRM-7564
+ $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, array(
- 1 => array($name, 'String'),
- 2 => array($title, 'String'),
- 3 => array((int) $self->_id, 'Integer'),
- 4 => array($gId, 'Integer'),
- ));
+ 1 => array($name, 'String'),
+ 2 => array($title, 'String'),
+ 3 => array((int) $self->_id, 'Integer'),
+ 4 => array($gId, 'Integer'),
+ ));
if ($fldCnt) {
$errors['label'] = ts('Custom field \'%1\' already exists in Database.', array(1 => $title));
}
@@ -704,8 +707,8 @@ SELECT count(*)
* Incomplete row checking is also required.
*/
$_flagOption = $_rowError = 0;
- $_showHide = new CRM_Core_ShowHideBlocks('', '');
- $dataType = self::$_dataTypeKeys[$fields['data_type'][0]];
+ $_showHide = new CRM_Core_ShowHideBlocks('', '');
+ $dataType = self::$_dataTypeKeys[$fields['data_type'][0]];
if (isset($fields['data_type'][1])) {
$dataField = $fields['data_type'][1];
}
@@ -835,7 +838,8 @@ FROM civicrm_custom_field
WHERE data_type != %1
AND option_group_id = %2";
$params = array(
- 1 => array(self::$_dataTypeKeys[$fields['data_type'][0]],
+ 1 => array(
+ self::$_dataTypeKeys[$fields['data_type'][0]],
'String',
),
2 => array($fields['option_group_id'], 'Integer'),
@@ -907,19 +911,23 @@ AND option_group_id = %2";
// store the submitted values in an array
$params = $this->controller->exportValues($this->_name);
if ($this->_action == CRM_Core_Action::UPDATE) {
- $dataTypeKey = $this->_defaultDataType[0];
+ $dataTypeKey = $this->_defaultDataType[0];
$params['data_type'] = self::$_dataTypeKeys[$this->_defaultDataType[0]];
$params['html_type'] = self::$_dataToHTML[$this->_defaultDataType[0]][$this->_defaultDataType[1]];
}
else {
- $dataTypeKey = $params['data_type'][0];
+ $dataTypeKey = $params['data_type'][0];
$params['html_type'] = self::$_dataToHTML[$params['data_type'][0]][$params['data_type'][1]];
$params['data_type'] = self::$_dataTypeKeys[$params['data_type'][0]];
}
//fix for 'is_search_range' field.
if (in_array($dataTypeKey, array(
- 1, 2, 3, 5))) {
+ 1,
+ 2,
+ 3,
+ 5
+ ))) {
if (empty($params['is_searchable'])) {
$params['is_search_range'] = 0;
}
@@ -1008,13 +1016,13 @@ SELECT id
if ($buttonName == $this->getButtonName('next', 'new')) {
$msg .= '
' . ts("Ready to add another.") . '
';
$session->replaceUserContext(CRM_Utils_System::url('civicrm/admin/custom/group/field/add',
- 'reset=1&action=add&gid=' . $this->_gid
- ));
+ 'reset=1&action=add&gid=' . $this->_gid
+ ));
}
else {
$session->replaceUserContext(CRM_Utils_System::url('civicrm/admin/custom/group/field',
- 'reset=1&action=browse&gid=' . $this->_gid
- ));
+ 'reset=1&action=browse&gid=' . $this->_gid
+ ));
}
$session->setStatus($msg, ts('Saved'), 'success');
diff --git a/CRM/Custom/Form/Group.php b/CRM/Custom/Form/Group.php
index 87d0a94fe5..26d651981d 100644
--- a/CRM/Custom/Form/Group.php
+++ b/CRM/Custom/Form/Group.php
@@ -121,14 +121,14 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
$errors = array();
//validate group title as well as name.
- $title = $fields['title'];
- $name = CRM_Utils_String::munge($title, '_', 64);
- $query = 'select count(*) from civicrm_custom_group where ( name like %1 OR title like %2 ) and id != %3';
+ $title = $fields['title'];
+ $name = CRM_Utils_String::munge($title, '_', 64);
+ $query = 'select count(*) from civicrm_custom_group where ( name like %1 OR title like %2 ) and id != %3';
$grpCnt = CRM_Core_DAO::singleValueQuery($query, array(
- 1 => array($name, 'String'),
- 2 => array($title, 'String'),
- 3 => array((int) $self->_id, 'Integer'),
- ));
+ 1 => array($name, 'String'),
+ 2 => array($title, 'String'),
+ 3 => array((int) $self->_id, 'Integer'),
+ ));
if ($grpCnt) {
$errors['title'] = ts('Custom group \'%1\' already exists in Database.', array(1 => $title));
}
@@ -202,18 +202,18 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
$contactTypes = array('Contact', 'Individual', 'Household', 'Organization');
$this->assign('contactTypes', json_encode($contactTypes));
- $sel1 = array("" => "- select -") + CRM_Core_SelectValues::customGroupExtends();
- $sel2 = array();
+ $sel1 = array("" => "- select -") + CRM_Core_SelectValues::customGroupExtends();
+ $sel2 = array();
$activityType = CRM_Core_PseudoConstant::activityType(FALSE, TRUE, FALSE, 'label', TRUE);
- $eventType = CRM_Core_OptionGroup::values('event_type');
- $grantType = CRM_Core_OptionGroup::values('grant_type');
- $campaignTypes = CRM_Campaign_PseudoConstant::campaignType();
- $membershipType = CRM_Member_BAO_MembershipType::getMembershipTypes(FALSE);
+ $eventType = CRM_Core_OptionGroup::values('event_type');
+ $grantType = CRM_Core_OptionGroup::values('grant_type');
+ $campaignTypes = CRM_Campaign_PseudoConstant::campaignType();
+ $membershipType = CRM_Member_BAO_MembershipType::getMembershipTypes(FALSE);
$participantRole = CRM_Core_OptionGroup::values('participant_role');
- $relTypeInd = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, 'Individual');
- $relTypeOrg = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, 'Organization');
- $relTypeHou = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, 'Household');
+ $relTypeInd = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, 'Individual');
+ $relTypeOrg = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, 'Organization');
+ $relTypeHou = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, 'Household');
ksort($sel1);
asort($activityType);
@@ -257,11 +257,13 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
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];
}
}
}
@@ -274,7 +276,8 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
$contactSubTypes[$key] = $key;
}
$sel2['Contact'] = array(
- "" => "-- Any --") + $contactSubTypes;
+ "" => "-- Any --"
+ ) + $contactSubTypes;
}
else {
if (!isset($this->_id)) {
@@ -493,8 +496,8 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
$action = CRM_Core_Resources::singleton()->ajaxPopupsEnabled ? '' : '/add';
$url = CRM_Utils_System::url("civicrm/admin/custom/group/field$action", 'reset=1&new=1&gid=' . $group->id . '&action=' . ($action ? 'add' : 'browse'));
CRM_Core_Session::setStatus(ts("Your custom field set '%1' has been added. You can add custom fields now.",
- array(1 => $group->title)
- ), ts('Saved'), 'success');
+ array(1 => $group->title)
+ ), ts('Saved'), 'success');
$session = CRM_Core_Session::singleton();
$session->replaceUserContext($url);
}
@@ -505,7 +508,7 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
if (is_array($db_prefix) && $config->userSystem->is_drupal && module_exists('views')) {
// get table_name for each custom group
$tables = array();
- $sql = "SELECT table_name FROM civicrm_custom_group WHERE is_active = 1";
+ $sql = "SELECT table_name FROM civicrm_custom_group WHERE is_active = 1";
$result = CRM_Core_DAO::executeQuery($sql);
while ($result->fetch()) {
$tables[$result->table_name] = $result->table_name;
@@ -516,8 +519,8 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
if (!empty($missingTableNames)) {
CRM_Core_Session::setStatus(ts("To ensure that all of your custom data groups are available to Views, you may need to add the following key(s) to the db_prefix array in your settings.php file: '%1'.",
- array(1 => implode(', ', $missingTableNames))
- ), ts('Note'), 'info');
+ array(1 => implode(', ', $missingTableNames))
+ ), ts('Note'), 'info');
}
}
}
diff --git a/CRM/Custom/Form/MoveField.php b/CRM/Custom/Form/MoveField.php
index f3f24ad943..fcfb6913fd 100644
--- a/CRM/Custom/Form/MoveField.php
+++ b/CRM/Custom/Form/MoveField.php
@@ -95,8 +95,8 @@ class CRM_Custom_Form_MoveField extends CRM_Core_Form {
);
CRM_Utils_System::setTitle(ts('Custom Field Move: %1',
- array(1 => $this->_srcFieldLabel)
- ));
+ array(1 => $this->_srcFieldLabel)
+ ));
$session = CRM_Core_Session::singleton();
$session->pushUserContext(CRM_Utils_System::url('civicrm/admin/custom/group/field', "reset=1&action=browse&gid={$this->_srcGID}"));
@@ -116,7 +116,8 @@ class CRM_Custom_Form_MoveField extends CRM_Core_Form {
}
$customGroup = array(
- '' => ts('- select -')) + $customGroup;
+ '' => ts('- select -')
+ ) + $customGroup;
$this->add('select',
'dst_group_id',
ts('Destination'),
@@ -149,8 +150,8 @@ class CRM_Custom_Form_MoveField extends CRM_Core_Form {
*/
public static function formRule($fields, $files, $self) {
$self->_dstGID = $fields['dst_group_id'];
- $tmp = CRM_Core_BAO_CustomField::_moveFieldValidate($self->_srcFID, $self->_dstGID);
- $errors = array();
+ $tmp = CRM_Core_BAO_CustomField::_moveFieldValidate($self->_srcFID, $self->_dstGID);
+ $errors = array();
if ($tmp['newGroupID']) {
$errors['dst_group_id'] = $tmp['newGroupID'];
}
@@ -172,9 +173,9 @@ class CRM_Custom_Form_MoveField extends CRM_Core_Form {
$srcUrl = CRM_Utils_System::url('civicrm/admin/custom/group/field', "reset=1&action=browse&gid={$this->_dstGID}");
CRM_Core_Session::setStatus(ts("%1 has been moved to the custom set
%2.",
array(
- 1 => $this->_srcFieldLabel,
- 2 => $dstGroup,
+ 1 => $this->_srcFieldLabel,
+ 2 => $dstGroup,
3 => $srcUrl,
- )), '', 'success');
+ )), '', 'success');
}
}
diff --git a/CRM/Custom/Form/Option.php b/CRM/Custom/Form/Option.php
index 3405e1249b..e1da4cc6c2 100644
--- a/CRM/Custom/Form/Option.php
+++ b/CRM/Custom/Form/Option.php
@@ -250,9 +250,9 @@ class CRM_Custom_Form_Option extends CRM_Core_Form {
* @static
*/
public static function formRule($fields, $files, $form) {
- $optionLabel = $fields['label'];
- $optionValue = $fields['value'];
- $fieldId = $form->_fid;
+ $optionLabel = $fields['label'];
+ $optionValue = $fields['value'];
+ $fieldId = $form->_fid;
$optionGroupId = $form->_optionGroupID;
$temp = array();
diff --git a/CRM/Custom/Form/Preview.php b/CRM/Custom/Form/Preview.php
index 982369092a..d5347b3b4a 100644
--- a/CRM/Custom/Form/Preview.php
+++ b/CRM/Custom/Form/Preview.php
@@ -66,7 +66,7 @@ class CRM_Custom_Form_Preview extends CRM_Core_Form {
if ($this->_fieldId) {
// field preview
$defaults = array();
- $params = array('id' => $this->_fieldId);
+ $params = array('id' => $this->_fieldId);
$fieldDAO = new CRM_Core_DAO_CustomField();
CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_CustomField', $params, $defaults);
diff --git a/CRM/Custom/Import/Form/DataSource.php b/CRM/Custom/Import/Form/DataSource.php
index a8c0d3662d..64c9c7564f 100644
--- a/CRM/Custom/Import/Form/DataSource.php
+++ b/CRM/Custom/Import/Form/DataSource.php
@@ -95,7 +95,10 @@ class CRM_Custom_Import_Form_DataSource extends CRM_Core_Form {
$this->assign('uploadSize', $uploadSize);
$this->add('File', 'uploadFile', ts('Import Data File'), 'size=30 maxlength=255', TRUE);
$this->setMaxFileSize($uploadFileSize);
- $this->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', array(1 => $uploadSize, 2 => $uploadFileSize)), 'maxfilesize', $uploadFileSize);
+ $this->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', array(
+ 1 => $uploadSize,
+ 2 => $uploadFileSize
+ )), 'maxfilesize', $uploadFileSize);
$this->addRule('uploadFile', ts('A valid file must be uploaded.'), 'uploadedfile');
$this->addRule('uploadFile', ts('Input file must be in CSV format'), 'utf8File');
@@ -103,9 +106,9 @@ class CRM_Custom_Import_Form_DataSource extends CRM_Core_Form {
//get the saved mapping details
$mappingArray = CRM_Core_BAO_Mapping::getMappings(CRM_Core_OptionGroup::getValue('mapping_type',
- 'Import Multi value custom data',
- 'name'
- ));
+ 'Import Multi value custom data',
+ 'name'
+ ));
$this->assign('savedMapping', $mappingArray);
$this->add('select', 'savedMapping', ts('Mapping Option'), array('' => ts('- select -')) + $mappingArray);
@@ -138,7 +141,7 @@ class CRM_Custom_Import_Form_DataSource extends CRM_Core_Form {
$this->setDefaults(array(
'contactType' => CRM_Import_Parser::CONTACT_INDIVIDUAL,
- ));
+ ));
//build date formats
CRM_Core_Form_Date::buildAllowedDateFormats($this);
@@ -166,11 +169,11 @@ class CRM_Custom_Import_Form_DataSource extends CRM_Core_Form {
public function postProcess() {
$this->controller->resetPage('MapField');
- $fileName = $this->controller->exportValue($this->_name, 'uploadFile');
+ $fileName = $this->controller->exportValue($this->_name, 'uploadFile');
$skipColumnHeader = $this->controller->exportValue($this->_name, 'skipColumnHeader');
- $contactType = $this->controller->exportValue($this->_name, 'contactType');
- $dateFormats = $this->controller->exportValue($this->_name, 'dateFormats');
- $savedMapping = $this->controller->exportValue($this->_name, 'savedMapping');
+ $contactType = $this->controller->exportValue($this->_name, 'contactType');
+ $dateFormats = $this->controller->exportValue($this->_name, 'dateFormats');
+ $savedMapping = $this->controller->exportValue($this->_name, 'savedMapping');
$multipleCustomData = $this->controller->exportValue($this->_name, 'multipleCustomData');
$this->set('contactType', $contactType);
diff --git a/CRM/Custom/Import/Form/MapField.php b/CRM/Custom/Import/Form/MapField.php
index 1958eebde7..2634b7dfc3 100644
--- a/CRM/Custom/Import/Form/MapField.php
+++ b/CRM/Custom/Import/Form/MapField.php
@@ -12,6 +12,7 @@ class CRM_Custom_Import_Form_MapField extends CRM_Contact_Import_Form_MapField {
* @var string
*/
protected $_entity;
+
/**
* Set variables up before form is built
*
@@ -31,7 +32,7 @@ class CRM_Custom_Import_Form_MapField extends CRM_Contact_Import_Form_MapField {
$this->assign('dataValues', $dataValues);
$this->_entity = $this->_multipleCustomData = $this->get('multipleCustomData');
- $skipColumnHeader = $this->controller->exportValue('DataSource', 'skipColumnHeader');
+ $skipColumnHeader = $this->controller->exportValue('DataSource', 'skipColumnHeader');
$this->_onDuplicate = $this->get('onDuplicate');
if ($skipColumnHeader) {
//showColNames needs to be true to show "Column Names" column
@@ -142,9 +143,9 @@ class CRM_Custom_Import_Form_MapField extends CRM_Contact_Import_Form_MapField {
$config = CRM_Core_Config::singleton();
$separator = $config->fieldSeparator;
- $mapperKeys = array();
- $mapper = array();
- $mapperKeys = $this->controller->exportValue($this->_name, 'mapper');
+ $mapperKeys = array();
+ $mapper = array();
+ $mapperKeys = $this->controller->exportValue($this->_name, 'mapper');
$mapperKeysMain = array();
for ($i = 0; $i < $this->_columnCount; $i++) {
@@ -178,9 +179,9 @@ class CRM_Custom_Import_Form_MapField extends CRM_Contact_Import_Form_MapField {
$updateMappingFields->column_number = $i;
$explodedValues = explode('_', $mapperKeys[$i][0]);
- $id = CRM_Utils_Array::value(0, $explodedValues);
- $first = CRM_Utils_Array::value(1, $explodedValues);
- $second = CRM_Utils_Array::value(2, $explodedValues);
+ $id = CRM_Utils_Array::value(0, $explodedValues);
+ $first = CRM_Utils_Array::value(1, $explodedValues);
+ $second = CRM_Utils_Array::value(2, $explodedValues);
$updateMappingFields->name = $mapper[$i];
$updateMappingFields->save();
@@ -205,9 +206,9 @@ class CRM_Custom_Import_Form_MapField extends CRM_Contact_Import_Form_MapField {
$saveMappingFields->column_number = $i;
$explodedValues = explode('_', $mapperKeys[$i][0]);
- $id = CRM_Utils_Array::value(0, $explodedValues);
- $first = CRM_Utils_Array::value(1, $explodedValues);
- $second = CRM_Utils_Array::value(2, $explodedValues);
+ $id = CRM_Utils_Array::value(0, $explodedValues);
+ $first = CRM_Utils_Array::value(1, $explodedValues);
+ $second = CRM_Utils_Array::value(2, $explodedValues);
$saveMappingFields->name = $mapper[$i];
$saveMappingFields->save();
diff --git a/CRM/Custom/Import/Form/Preview.php b/CRM/Custom/Import/Form/Preview.php
index d21fd2a11e..c7911d072a 100644
--- a/CRM/Custom/Import/Form/Preview.php
+++ b/CRM/Custom/Import/Form/Preview.php
@@ -6,6 +6,7 @@
class CRM_Custom_Import_Form_Preview extends CRM_Import_Form_Preview {
public $_parser = 'CRM_Custom_Import_Parser_Api';
protected $_importParserUrl = '&parser=CRM_Custom_Import_Parser';
+
/**
* Set variables up before form is built
*
@@ -15,12 +16,12 @@ class CRM_Custom_Import_Form_Preview extends CRM_Import_Form_Preview {
$skipColumnHeader = $this->controller->exportValue('DataSource', 'skipColumnHeader');
//get the data from the session
- $dataValues = $this->get('dataValues');
- $mapper = $this->get('mapper');
- $invalidRowCount = $this->get('invalidRowCount');
+ $dataValues = $this->get('dataValues');
+ $mapper = $this->get('mapper');
+ $invalidRowCount = $this->get('invalidRowCount');
$conflictRowCount = $this->get('conflictRowCount');
- $mismatchCount = $this->get('unMatchCount');
- $entity = $this->get('_entity');
+ $mismatchCount = $this->get('unMatchCount');
+ $entity = $this->get('_entity');
//get the mapping name displayed if the mappingId is set
$mappingId = $this->get('loadMappingId');
@@ -57,9 +58,12 @@ class CRM_Custom_Import_Form_Preview extends CRM_Import_Form_Preview {
$properties = array(
'mapper',
- 'dataValues', 'columnCount',
- 'totalRowCount', 'validRowCount',
- 'invalidRowCount', 'conflictRowCount',
+ 'dataValues',
+ 'columnCount',
+ 'totalRowCount',
+ 'validRowCount',
+ 'invalidRowCount',
+ 'conflictRowCount',
'downloadErrorRecordsUrl',
'downloadConflictRecordsUrl',
'downloadMismatchRecordsUrl',
@@ -77,12 +81,12 @@ class CRM_Custom_Import_Form_Preview extends CRM_Import_Form_Preview {
* @return void
*/
public function postProcess() {
- $fileName = $this->controller->exportValue('DataSource', 'uploadFile');
+ $fileName = $this->controller->exportValue('DataSource', 'uploadFile');
$skipColumnHeader = $this->controller->exportValue('DataSource', 'skipColumnHeader');
- $invalidRowCount = $this->get('invalidRowCount');
+ $invalidRowCount = $this->get('invalidRowCount');
$conflictRowCount = $this->get('conflictRowCount');
- $onDuplicate = $this->get('onDuplicate');
- $entity = $this->get('_entity');
+ $onDuplicate = $this->get('onDuplicate');
+ $entity = $this->get('_entity');
$config = CRM_Core_Config::singleton();
$separator = $config->fieldSeparator;
diff --git a/CRM/Custom/Import/Parser.php b/CRM/Custom/Import/Parser.php
index f378a70445..0be813e09b 100644
--- a/CRM/Custom/Import/Parser.php
+++ b/CRM/Custom/Import/Parser.php
@@ -32,8 +32,6 @@
* $Id$
*
*/
-
-
abstract class CRM_Custom_Import_Parser extends CRM_Contact_Import_Parser {
protected $_fileName;
@@ -255,7 +253,8 @@ abstract class CRM_Custom_Import_Parser extends CRM_Contact_Import_Parser {
}
if ($this->_invalidRowCount) {
// removed view url for invlaid contacts
- $headers = array_merge(array(ts('Line Number'),
+ $headers = array_merge(array(
+ ts('Line Number'),
ts('Reason'),
),
$customHeaders
@@ -264,7 +263,8 @@ abstract class CRM_Custom_Import_Parser extends CRM_Contact_Import_Parser {
self::exportCSV($this->_errorFileName, $headers, $this->_errors);
}
if ($this->_conflictCount) {
- $headers = array_merge(array(ts('Line Number'),
+ $headers = array_merge(array(
+ ts('Line Number'),
ts('Reason'),
),
$customHeaders
@@ -273,7 +273,8 @@ abstract class CRM_Custom_Import_Parser extends CRM_Contact_Import_Parser {
self::exportCSV($this->_conflictFileName, $headers, $this->_conflicts);
}
if ($this->_duplicateCount) {
- $headers = array_merge(array(ts('Line Number'),
+ $headers = array_merge(array(
+ ts('Line Number'),
ts('View Activity History URL'),
),
$customHeaders
diff --git a/CRM/Custom/Import/Parser/Api.php b/CRM/Custom/Import/Parser/Api.php
index 9e2a3fc204..b5bf3d615d 100644
--- a/CRM/Custom/Import/Parser/Api.php
+++ b/CRM/Custom/Import/Parser/Api.php
@@ -16,6 +16,7 @@ class CRM_Custom_Import_Parser_Api extends CRM_Custom_Import_Parser {
* @var array
*/
protected $_params = array();
+
/**
* Class constructor
*/
@@ -23,10 +24,14 @@ class CRM_Custom_Import_Parser_Api extends CRM_Custom_Import_Parser {
parent::__construct();
$this->_mapperKeys = &$mapperKeys;
}
+
public function setFields() {
$customGroupID = $this->_multipleCustomData;
$importableFields = $this->getGroupFieldsForImport($customGroupID, $this);
- $this->_fields = array_merge(array('do_not_import' => array('title' => ts('- do not import -')), 'contact_id' => array('title' => ts('Contact ID'))), $importableFields);
+ $this->_fields = array_merge(array(
+ 'do_not_import' => array('title' => ts('- do not import -')),
+ 'contact_id' => array('title' => ts('Contact ID'))
+ ), $importableFields);
}
/**
@@ -85,7 +90,7 @@ class CRM_Custom_Import_Parser_Api extends CRM_Custom_Import_Parser {
*/
public function summary(&$values) {
$erroneousField = NULL;
- $response = $this->setActiveFieldValues($values, $erroneousField);
+ $response = $this->setActiveFieldValues($values, $erroneousField);
$errorRequired = FALSE;
$missingField = '';
$this->_params = &$this->getActiveFieldParams();
@@ -168,7 +173,7 @@ class CRM_Custom_Import_Parser_Api extends CRM_Custom_Import_Parser {
try {
civicrm_api3('custom_value', 'create', $this->_params);
}
- catch(CiviCRM_API3_Exception $e) {
+ catch (CiviCRM_API3_Exception $e) {
$error = $e->getMessage();
array_unshift($values, $error);
return CRM_Import_Parser::ERROR;
diff --git a/CRM/Custom/Page/Group.php b/CRM/Custom/Page/Group.php
index 2737323aa3..2003d472f0 100644
--- a/CRM/Custom/Page/Group.php
+++ b/CRM/Custom/Page/Group.php
@@ -288,8 +288,8 @@ class CRM_Custom_Page_Group extends CRM_Core_Page {
foreach ($customGroup as $key => $values) {
$subValue = CRM_Utils_Array::value('extends_entity_column_value', $customGroup[$key]);
- $subName = CRM_Utils_Array::value('extends_entity_column_id', $customGroup[$key]);
- $type = CRM_Utils_Array::value('extends', $customGroup[$key]);
+ $subName = CRM_Utils_Array::value('extends_entity_column_id', $customGroup[$key]);
+ $type = CRM_Utils_Array::value('extends', $customGroup[$key]);
if ($subValue) {
$subValue = explode(CRM_Core_DAO::VALUE_SEPARATOR,
substr($subValue, 1, -1)
diff --git a/CRM/Custom/Page/Option.php b/CRM/Custom/Page/Option.php
index 3dea06a146..bbf3a05389 100644
--- a/CRM/Custom/Page/Option.php
+++ b/CRM/Custom/Page/Option.php
@@ -143,7 +143,7 @@ SELECT id, label
FROM civicrm_custom_field
WHERE option_group_id = %1";
$params = array(
- 1 => array($optionGroupID, 'Integer'),
+ 1 => array($optionGroupID, 'Integer'),
2 => array($this->_fid, 'Integer'),
);
$dao = CRM_Core_DAO::executeQuery($query, $params);
@@ -170,8 +170,8 @@ ORDER BY weight, label
$dao = CRM_Core_DAO::executeQuery($query, $params);
$customOption = array();
- $fields = array('label', 'value', 'is_active', 'weight');
- $config = CRM_Core_Config::singleton();
+ $fields = array('label', 'value', 'is_active', 'weight');
+ $config = CRM_Core_Config::singleton();
while ($dao->fetch()) {
$customOption[$dao->id] = array();
foreach ($fields as $field) {
@@ -251,8 +251,8 @@ ORDER BY weight, label
// set the userContext stack
$session = CRM_Core_Session::singleton();
$session->pushUserContext(CRM_Utils_System::url('civicrm/admin/custom/group/field/option',
- "reset=1&action=browse&fid={$this->_fid}&gid={$this->_gid}"
- ));
+ "reset=1&action=browse&fid={$this->_fid}&gid={$this->_gid}"
+ ));
$controller->setEmbedded(TRUE);
$controller->process();
$controller->run();
@@ -284,10 +284,12 @@ ORDER BY weight, label
}
//as url contain $gid so append breadcrumb dynamically.
- $breadcrumb = array(array(
- 'title' => ts('Custom Data Fields'),
+ $breadcrumb = array(
+ array(
+ 'title' => ts('Custom Data Fields'),
'url' => CRM_Utils_System::url('civicrm/admin/custom/group/field', 'reset=1&gid=' . $this->_gid),
- ));
+ )
+ );
CRM_Utils_System::appendBreadCrumb($breadcrumb);
if ($this->_fid) {
diff --git a/CRM/Dashlet/Page/AllCases.php b/CRM/Dashlet/Page/AllCases.php
index 5e0f90f9ac..d3a7b3eb47 100644
--- a/CRM/Dashlet/Page/AllCases.php
+++ b/CRM/Dashlet/Page/AllCases.php
@@ -53,8 +53,8 @@ class CRM_Dashlet_Page_AllCases extends CRM_Core_Page {
CRM_Core_Error::fatal(ts('You are not authorized to access this page.'));
}
- $session = CRM_Core_Session::singleton();
- $userID = $session->get('userID');
+ $session = CRM_Core_Session::singleton();
+ $userID = $session->get('userID');
$upcoming = CRM_Case_BAO_Case::getCases(TRUE, $userID, 'upcoming', $context);
if (!empty($upcoming)) {
diff --git a/CRM/Dashlet/Page/CaseDashboard.php b/CRM/Dashlet/Page/CaseDashboard.php
index 16d78b4eb4..e7be5280fc 100644
--- a/CRM/Dashlet/Page/CaseDashboard.php
+++ b/CRM/Dashlet/Page/CaseDashboard.php
@@ -52,7 +52,7 @@ class CRM_Dashlet_Page_CaseDashboard extends CRM_Core_Page {
}
$session = &CRM_Core_Session::singleton();
- $userID = $session->get('userID');
+ $userID = $session->get('userID');
$summary = CRM_Case_BAO_Case::getCasesSummary(TRUE, $userID);
if (!empty($summary)) {
diff --git a/CRM/Dashlet/Page/MyCases.php b/CRM/Dashlet/Page/MyCases.php
index 284cc2b854..b121d03573 100644
--- a/CRM/Dashlet/Page/MyCases.php
+++ b/CRM/Dashlet/Page/MyCases.php
@@ -53,8 +53,8 @@ class CRM_Dashlet_Page_MyCases extends CRM_Core_Page {
CRM_Core_Error::fatal(ts('You are not authorized to access this page.'));
}
- $session = CRM_Core_Session::singleton();
- $userID = $session->get('userID');
+ $session = CRM_Core_Session::singleton();
+ $userID = $session->get('userID');
$upcoming = CRM_Case_BAO_Case::getCases(FALSE, $userID, 'upcoming', $context);
if (!empty($upcoming)) {
diff --git a/CRM/Dedupe/BAO/QueryBuilder.php b/CRM/Dedupe/BAO/QueryBuilder.php
index 686cda71d9..393a4dab49 100644
--- a/CRM/Dedupe/BAO/QueryBuilder.php
+++ b/CRM/Dedupe/BAO/QueryBuilder.php
@@ -22,4 +22,6 @@ class CRM_Dedupe_BAO_QueryBuilder {
return "($strID1 < $strID2)";
}
}
-};
+}
+
+;
diff --git a/CRM/Dedupe/BAO/QueryBuilder/IndividualGeneral.php b/CRM/Dedupe/BAO/QueryBuilder/IndividualGeneral.php
index 2d90f02e21..f65884c162 100644
--- a/CRM/Dedupe/BAO/QueryBuilder/IndividualGeneral.php
+++ b/CRM/Dedupe/BAO/QueryBuilder/IndividualGeneral.php
@@ -15,8 +15,8 @@ class CRM_Dedupe_BAO_QueryBuilder_IndividualGeneral extends CRM_Dedupe_BAO_Query
$civicrm_address = CRM_Utils_Array::value('civicrm_address', $rg->params);
// Since definitely have first and last name, escape them upfront.
- $first_name = CRM_Core_DAO::escapeString(CRM_Utils_Array::value('first_name', $civicrm_contact, ''));
- $last_name = CRM_Core_DAO::escapeString(CRM_Utils_Array::value('last_name', $civicrm_contact, ''));
+ $first_name = CRM_Core_DAO::escapeString(CRM_Utils_Array::value('first_name', $civicrm_contact, ''));
+ $last_name = CRM_Core_DAO::escapeString(CRM_Utils_Array::value('last_name', $civicrm_contact, ''));
$street_address = CRM_Core_DAO::escapeString(CRM_Utils_Array::value('street_address', $civicrm_address, ''));
$query = "
diff --git a/CRM/Dedupe/BAO/QueryBuilder/IndividualSupervised.php b/CRM/Dedupe/BAO/QueryBuilder/IndividualSupervised.php
index 080f3df0cb..905aef6fe2 100644
--- a/CRM/Dedupe/BAO/QueryBuilder/IndividualSupervised.php
+++ b/CRM/Dedupe/BAO/QueryBuilder/IndividualSupervised.php
@@ -54,4 +54,6 @@ class CRM_Dedupe_BAO_QueryBuilder_IndividualSupervised extends CRM_Dedupe_BAO_Qu
AND " . self::internalFilters($rg);
return array("civicrm_contact.{$rg->name}.{$rg->threshold}" => $query);
}
-};
+}
+
+;
diff --git a/CRM/Dedupe/BAO/QueryBuilder/IndividualUnsupervised.php b/CRM/Dedupe/BAO/QueryBuilder/IndividualUnsupervised.php
index fc05be3f70..07c7bb797d 100644
--- a/CRM/Dedupe/BAO/QueryBuilder/IndividualUnsupervised.php
+++ b/CRM/Dedupe/BAO/QueryBuilder/IndividualUnsupervised.php
@@ -107,4 +107,6 @@ AND " . self::internalFilters($rg);
return array("civicrm_contact.{$rg->name}.{$rg->threshold}" => $query);
}
-};
+}
+
+;
diff --git a/CRM/Dedupe/BAO/Rule.php b/CRM/Dedupe/BAO/Rule.php
index e513d0c3cc..767d715e29 100644
--- a/CRM/Dedupe/BAO/Rule.php
+++ b/CRM/Dedupe/BAO/Rule.php
@@ -71,7 +71,7 @@ class CRM_Dedupe_BAO_Rule extends CRM_Dedupe_DAO_Rule {
// $using are arrays of required field matchings (for substring and
// full matches, respectively)
$where = array();
- $on = array("SUBSTR(t1.{$this->rule_field}, 1, {$this->rule_length}) = SUBSTR(t2.{$this->rule_field}, 1, {$this->rule_length})");
+ $on = array("SUBSTR(t1.{$this->rule_field}, 1, {$this->rule_length}) = SUBSTR(t2.{$this->rule_field}, 1, {$this->rule_length})");
$using = array($this->rule_field);
switch ($this->rule_table) {
@@ -90,8 +90,8 @@ class CRM_Dedupe_BAO_Rule extends CRM_Dedupe_DAO_Rule {
break;
case 'civicrm_address':
- $id = 'contact_id';
- $on[] = 't1.location_type_id = t2.location_type_id';
+ $id = 'contact_id';
+ $on[] = 't1.location_type_id = t2.location_type_id';
$using[] = 'location_type_id';
if ($this->params['civicrm_address']['location_type_id']) {
$locTypeId = CRM_Utils_Type::escape($this->params['civicrm_address']['location_type_id'], 'Integer', FALSE);
@@ -193,8 +193,8 @@ class CRM_Dedupe_BAO_Rule extends CRM_Dedupe_DAO_Rule {
* @return rule fields array associated to rule group
*/
public static function dedupeRuleFields($params) {
- $rgBao = new CRM_Dedupe_BAO_RuleGroup();
- $rgBao->used = $params['used'];
+ $rgBao = new CRM_Dedupe_BAO_RuleGroup();
+ $rgBao->used = $params['used'];
$rgBao->contact_type = $params['contact_type'];
$rgBao->find(TRUE);
diff --git a/CRM/Dedupe/BAO/RuleGroup.php b/CRM/Dedupe/BAO/RuleGroup.php
index 744e118c6a..bd7d5ec87c 100644
--- a/CRM/Dedupe/BAO/RuleGroup.php
+++ b/CRM/Dedupe/BAO/RuleGroup.php
@@ -80,8 +80,13 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup {
);
// the table names we support in dedupe rules - a filter for importableFields()
$supportedTables = array(
- 'civicrm_address', 'civicrm_contact', 'civicrm_email',
- 'civicrm_im', 'civicrm_note', 'civicrm_openid', 'civicrm_phone',
+ 'civicrm_address',
+ 'civicrm_contact',
+ 'civicrm_email',
+ 'civicrm_im',
+ 'civicrm_note',
+ 'civicrm_openid',
+ 'civicrm_phone',
);
foreach (array('Individual', 'Organization', 'Household') as $ctype) {
@@ -137,7 +142,7 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup {
CRM_Utils_File::isIncludable("CRM/Dedupe/BAO/QueryBuilder/{$this->name}.php")
) {
include_once "CRM/Dedupe/BAO/QueryBuilder/{$this->name}.php";
- $class = "CRM_Dedupe_BAO_QueryBuilder_{$this->name}";
+ $class = "CRM_Dedupe_BAO_QueryBuilder_{$this->name}";
$command = empty($this->params) ? 'internal' : 'record';
$queries = call_user_func(array($class, $command), $this);
}
@@ -182,15 +187,15 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup {
if ($this->params && !$this->noRules) {
$tempTableQuery = "CREATE TEMPORARY TABLE dedupe (id1 int, weight int, UNIQUE UI_id1 (id1)) ENGINE=MyISAM";
- $insertClause = "INSERT INTO dedupe (id1, weight)";
- $groupByClause = "GROUP BY id1";
- $dupeCopyJoin = " JOIN dedupe_copy ON dedupe_copy.id1 = t1.column WHERE ";
+ $insertClause = "INSERT INTO dedupe (id1, weight)";
+ $groupByClause = "GROUP BY id1";
+ $dupeCopyJoin = " JOIN dedupe_copy ON dedupe_copy.id1 = t1.column WHERE ";
}
else {
$tempTableQuery = "CREATE TEMPORARY TABLE dedupe (id1 int, id2 int, weight int, UNIQUE UI_id1_id2 (id1, id2)) ENGINE=MyISAM";
- $insertClause = "INSERT INTO dedupe (id1, id2, weight)";
- $groupByClause = "GROUP BY id1, id2";
- $dupeCopyJoin = " JOIN dedupe_copy ON dedupe_copy.id1 = t1.column AND dedupe_copy.id2 = t2.column WHERE ";
+ $insertClause = "INSERT INTO dedupe (id1, id2, weight)";
+ $groupByClause = "GROUP BY id1, id2";
+ $dupeCopyJoin = " JOIN dedupe_copy ON dedupe_copy.id1 = t1.column AND dedupe_copy.id2 = t2.column WHERE ";
}
$patternColumn = '/t1.(\w+)/';
$exclWeightSum = array();
@@ -215,7 +220,7 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup {
// extract the next query ( and weight ) to be executed
$fieldWeight = array_keys($tableQueries);
$fieldWeight = $fieldWeight[0];
- $query = array_shift($tableQueries);
+ $query = array_shift($tableQueries);
if ($searchWithinDupes) {
// get prepared to search within already found dupes if $searchWithinDupes flag is set
@@ -251,8 +256,8 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup {
// since queries are already sorted by weights, we can continue as is
$fieldWeight = array_keys($tableQueries);
$fieldWeight = $fieldWeight[0];
- $query = array_shift($tableQueries);
- $query = "{$insertClause} {$query} {$groupByClause} ON DUPLICATE KEY UPDATE weight = weight + VALUES(weight)";
+ $query = array_shift($tableQueries);
+ $query = "{$insertClause} {$query} {$groupByClause} ON DUPLICATE KEY UPDATE weight = weight + VALUES(weight)";
$dao->query($query);
if ($dao->affectedRows() >= 1) {
$exclWeightSum[] = substr($fieldWeight, strrpos($fieldWeight, '.') + 1);
@@ -384,7 +389,7 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup {
* @access public
*/
public static function dedupeRuleFieldsWeight($params) {
- $rgBao = new CRM_Dedupe_BAO_RuleGroup();
+ $rgBao = new CRM_Dedupe_BAO_RuleGroup();
$rgBao->contact_type = $params['contact_type'];
if (CRM_Utils_Array::value('id', $params)) {
// accept an ID if provided
diff --git a/CRM/Dedupe/Finder.php b/CRM/Dedupe/Finder.php
index 451c552667..094b399621 100644
--- a/CRM/Dedupe/Finder.php
+++ b/CRM/Dedupe/Finder.php
@@ -52,8 +52,8 @@ class CRM_Dedupe_Finder {
* array of (cid1, cid2, weight) dupe triples
*/
public static function dupes($rgid, $cids = array()) {
- $rgBao = new CRM_Dedupe_BAO_RuleGroup();
- $rgBao->id = $rgid;
+ $rgBao = new CRM_Dedupe_BAO_RuleGroup();
+ $rgBao->id = $rgid;
$rgBao->contactIds = $cids;
if (!$rgBao->find(TRUE)) {
CRM_Core_Error::fatal("Dedupe rule not found for selected contacts");
@@ -109,8 +109,8 @@ class CRM_Dedupe_Finder {
$foundByID = FALSE;
if ($ruleGroupID) {
- $rgBao = new CRM_Dedupe_BAO_RuleGroup();
- $rgBao->id = $ruleGroupID;
+ $rgBao = new CRM_Dedupe_BAO_RuleGroup();
+ $rgBao->id = $ruleGroupID;
$rgBao->contact_type = $ctype;
if ($rgBao->find(TRUE)) {
$foundByID = TRUE;
@@ -118,9 +118,9 @@ class CRM_Dedupe_Finder {
}
if (!$foundByID) {
- $rgBao = new CRM_Dedupe_BAO_RuleGroup();
+ $rgBao = new CRM_Dedupe_BAO_RuleGroup();
$rgBao->contact_type = $ctype;
- $rgBao->used = $used;
+ $rgBao->used = $used;
if (!$rgBao->find(TRUE)) {
CRM_Core_Error::fatal("$used rule for $ctype does not exist");
}
@@ -183,8 +183,8 @@ class CRM_Dedupe_Finder {
}
$ctype = $dao->contact_type;
}
- $rgBao = new CRM_Dedupe_BAO_RuleGroup();
- $rgBao->used = $used;
+ $rgBao = new CRM_Dedupe_BAO_RuleGroup();
+ $rgBao->used = $used;
$rgBao->contact_type = $ctype;
if (!$rgBao->find(TRUE)) {
CRM_Core_Error::fatal("$used rule for $ctype does not exist");
@@ -235,7 +235,9 @@ class CRM_Dedupe_Finder {
// handle {birth,deceased}_date
foreach (array(
- 'birth_date', 'deceased_date') as $date) {
+ 'birth_date',
+ 'deceased_date'
+ ) as $date) {
if (!empty($fields[$date])) {
$flat[$date] = $fields[$date];
if (is_array($flat[$date])) {
@@ -306,9 +308,9 @@ class CRM_Dedupe_Finder {
// FIXME: we also need to do some hacking for id and name fields, see CRM-3902’s comments
$fixes = array(
'address_name' => 'name',
- 'country' => 'country_id',
+ 'country' => 'country_id',
'state_province' => 'state_province_id',
- 'county' => 'county_id',
+ 'county' => 'county_id',
);
foreach ($fixes as $orig => $target) {
if (!empty($flat[$orig])) {
diff --git a/CRM/Dedupe/Merger.php b/CRM/Dedupe/Merger.php
index 8d7e2fc558..3d0da9030f 100644
--- a/CRM/Dedupe/Merger.php
+++ b/CRM/Dedupe/Merger.php
@@ -621,7 +621,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m
* @static
*/
public static function merge($dupePairs = array(), $cacheParams = array(), $mode = 'safe',
- $autoFlip = TRUE, $redirectForPerformance = FALSE
+ $autoFlip = TRUE, $redirectForPerformance = FALSE
) {
$cacheKeyString = CRM_Utils_Array::value('cache_key_string', $cacheParams);
$resultStats = array('merged' => array(), 'skipped' => array());
@@ -726,7 +726,8 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m
}
elseif ((in_array(substr($key, 5), CRM_Dedupe_Merger::getContactFields()) or
substr($key, 0, 12) == 'move_custom_'
- ) and $val != NULL) {
+ ) and $val != NULL
+ ) {
// Rule: if both main-contact has other-contact, let $mode decide if to merge a
// particular field or not
if (!empty($migrationInfo['rows'][$key]['main'])) {
@@ -751,7 +752,8 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m
if ($fieldName == 'address') {
$mainNewLocTypeId = $migrationInfo['location'][$fieldName][$fieldCount]['locTypeId'];
if (!empty($migrationInfo['main_loc_address']) &&
- array_key_exists("main_{$mainNewLocTypeId}", $migrationInfo['main_loc_address'])) {
+ array_key_exists("main_{$mainNewLocTypeId}", $migrationInfo['main_loc_address'])
+ ) {
// main loc already has some address for the loc-type. Its a overwrite situation.
// look for next available loc-type
@@ -824,7 +826,11 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m
// Fetch contacts
foreach (array('main' => $mainId, 'other' => $otherId) as $moniker => $cid) {
- $params = array('contact_id' => $cid, 'version' => 3, 'return' => array_merge(array('display_name'), self::getContactFields()));
+ $params = array(
+ 'contact_id' => $cid,
+ 'version' => 3,
+ 'return' => array_merge(array('display_name'), self::getContactFields())
+ );
$result = civicrm_api('contact', 'get', $params);
if (empty($result['values'][$cid]['contact_type'])) {
@@ -856,10 +862,10 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m
}
$names = array(
'preferred_communication_method' =>
- array(
- 'newName' => 'preferred_communication_method_display',
- 'groupName' => 'preferred_communication_method',
- ),
+ array(
+ 'newName' => 'preferred_communication_method_display',
+ 'groupName' => 'preferred_communication_method',
+ ),
);
CRM_Core_OptionGroup::lookupValues($specialValues[$moniker], $names);
@@ -1058,8 +1064,11 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m
$js = array('onChange' => "mergeBlock('$name', this, $count );");
}
$elements[] = array(
- 'select', "location[{$name}][$count][locTypeId]", NULL,
- $defaultLocType + $locTypeValues, $js,
+ 'select',
+ "location[{$name}][$count][locTypeId]",
+ NULL,
+ $defaultLocType + $locTypeValues,
+ $js,
);
// keep location-type-id same as that of other-contact
$migrationInfo['location'][$name][$count]['locTypeId'] = $locTypeId;
@@ -1229,7 +1238,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m
$value = '0';
}
if ((in_array(substr($key, 5), CRM_Dedupe_Merger::getContactFields()) ||
- substr($key, 0, 12) == 'move_custom_') &&
+ substr($key, 0, 12) == 'move_custom_') &&
$value != NULL
) {
$submitted[substr($key, 5)] = $value;
@@ -1426,10 +1435,13 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m
//keep state and country as array format.
//for checkbox and m-select format w/ VALUE_SEPARATOR
if (in_array($htmlType, array(
- 'CheckBox', 'Multi-Select', 'AdvMulti-Select'))) {
+ 'CheckBox',
+ 'Multi-Select',
+ 'AdvMulti-Select'
+ ))) {
$submitted[$key] = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR,
- $mergeValue
- ) . CRM_Core_DAO::VALUE_SEPARATOR;
+ $mergeValue
+ ) . CRM_Core_DAO::VALUE_SEPARATOR;
}
else {
$submitted[$key] = $mergeValue;
@@ -1437,7 +1449,9 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m
}
}
elseif (in_array($htmlType, array(
- 'Multi-Select Country', 'Multi-Select State/Province'))) {
+ 'Multi-Select Country',
+ 'Multi-Select State/Province'
+ ))) {
//we require submitted values should be in array format
if ($value) {
$mergeValueArray = explode(CRM_Core_DAO::VALUE_SEPARATOR, $value);
@@ -1497,7 +1511,8 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m
if (CRM_Core_DAO::singleValueQuery("
SELECT id
FROM civicrm_entity_file
- WHERE entity_table = '{$tableName}' AND file_id = {$fileIds[$otherId]}")) {
+ WHERE entity_table = '{$tableName}' AND file_id = {$fileIds[$otherId]}")
+ ) {
$sql = "
UPDATE civicrm_entity_file
SET entity_id = {$mainId}
@@ -1599,8 +1614,18 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m
*/
public static function getContactFields() {
$contactFields = CRM_Contact_DAO_Contact::fields();
- $invalidFields = array('api_key', 'contact_is_deleted', 'created_date', 'display_name', 'hash', 'id', 'modified_date',
- 'primary_contact_id', 'sort_name', 'user_unique_id');
+ $invalidFields = array(
+ 'api_key',
+ 'contact_is_deleted',
+ 'created_date',
+ 'display_name',
+ 'hash',
+ 'id',
+ 'modified_date',
+ 'primary_contact_id',
+ 'sort_name',
+ 'user_unique_id'
+ );
foreach ($contactFields as $field => $value) {
if (in_array($field, $invalidFields)) {
unset($contactFields[$field]);
diff --git a/CRM/Event/BAO/Event.php b/CRM/Event/BAO/Event.php
index 8bbb8c8282..0a6fba66a2 100644
--- a/CRM/Event/BAO/Event.php
+++ b/CRM/Event/BAO/Event.php
@@ -269,9 +269,9 @@ class CRM_Event_BAO_Event extends CRM_Event_DAO_Event {
*/
static function getEvents(
$all = 0,
- $id = FALSE,
- $isActive = TRUE,
- $checkPermission = TRUE
+ $id = FALSE,
+ $isActive = TRUE,
+ $checkPermission = TRUE
) {
$query = "
SELECT `id`, `title`, `start_date`
@@ -602,10 +602,10 @@ $event_summary_limit
*/
public static function getParticipantCount(
$eventId,
- $considerStatus = TRUE,
- $status = TRUE,
- $considerRole = TRUE,
- $role = TRUE
+ $considerStatus = TRUE,
+ $status = TRUE,
+ $considerRole = TRUE,
+ $role = TRUE
) {
// consider both role and status for counted participants, CRM-4924.
@@ -702,9 +702,9 @@ WHERE civicrm_address.geo_code_1 IS NOT NULL
$params = array('entity_id' => $id, 'entity_table' => 'civicrm_event');
$addressValues = CRM_Core_BAO_Location::getValues($params, TRUE);
$location['address'] = str_replace(array(
- "\r",
- "\n",
- ), '', addslashes(nl2br($addressValues['address'][1]['display_text'])));
+ "\r",
+ "\n",
+ ), '', addslashes(nl2br($addressValues['address'][1]['display_text'])));
$location['url'] = CRM_Utils_System::url('civicrm/event/register', 'reset=1&id=' . $dao->event_id);
$location['location_type'] = $dao->location_type;
@@ -2232,7 +2232,7 @@ LEFT JOIN civicrm_price_field_value value ON ( value.id = lineItem.price_field
// Fixme - this is going to ignore context, better to get conditions, add params, and call PseudoConstant::get
return CRM_Financial_BAO_FinancialType::getIncomeFinancialType();
- break;
+ break;
}
return CRM_Core_PseudoConstant::get(__CLASS__, $fieldName, $params, $context);
}
diff --git a/CRM/Event/BAO/ParticipantPayment.php b/CRM/Event/BAO/ParticipantPayment.php
index 6a203bf908..1014483149 100644
--- a/CRM/Event/BAO/ParticipantPayment.php
+++ b/CRM/Event/BAO/ParticipantPayment.php
@@ -74,12 +74,20 @@ class CRM_Event_BAO_ParticipantPayment extends CRM_Event_DAO_ParticipantPayment
//generally if people are creating participant_payments via the api they won't be setting the line item correctly - we can't help them if they are doing complex transactions
// but if they have a single line item for the contribution we can assume it should refer to the participant line
- $lineItemCount = CRM_Core_DAO::singleValueQuery("select count(*) FROM civicrm_line_item WHERE contribution_id = %1", array(1 => array($participantPayment->contribution_id, 'Integer')));
+ $lineItemCount = CRM_Core_DAO::singleValueQuery("select count(*) FROM civicrm_line_item WHERE contribution_id = %1", array(
+ 1 => array(
+ $participantPayment->contribution_id,
+ 'Integer'
+ )
+ ));
if ($lineItemCount == 1) {
$sql = "UPDATE civicrm_line_item li
SET entity_table = 'civicrm_participant', entity_id = %1
WHERE contribution_id = %2 AND entity_table = 'civicrm_contribution'";
- CRM_Core_DAO::executeQuery($sql, array(1 => array($participantPayment->participant_id, 'Integer'), 2 => array($participantPayment->contribution_id, 'Integer')));
+ CRM_Core_DAO::executeQuery($sql, array(
+ 1 => array($participantPayment->participant_id, 'Integer'),
+ 2 => array($participantPayment->contribution_id, 'Integer')
+ ));
}
return $participantPayment;
diff --git a/CRM/Event/BAO/ParticipantStatusType.php b/CRM/Event/BAO/ParticipantStatusType.php
index 23797561ec..86439c42a7 100644
--- a/CRM/Event/BAO/ParticipantStatusType.php
+++ b/CRM/Event/BAO/ParticipantStatusType.php
@@ -197,9 +197,9 @@ LEFT JOIN civicrm_event event ON ( event.id = participant.event_id )
//lets get the transaction mechanism.
$transaction = new CRM_Core_Transaction();
- $ids = array($participantId);
+ $ids = array($participantId);
$expiredId = array_search('Expired', $expiredStatuses);
- $results = CRM_Event_BAO_Participant::transitionParticipants($ids, $expiredId, $values['status_id'], TRUE, TRUE);
+ $results = CRM_Event_BAO_Participant::transitionParticipants($ids, $expiredId, $values['status_id'], TRUE, TRUE);
$transaction->commit();
if (!empty($results)) {
diff --git a/CRM/Event/BAO/Query.php b/CRM/Event/BAO/Query.php
index c343efef6e..ca8f7550a7 100644
--- a/CRM/Event/BAO/Query.php
+++ b/CRM/Event/BAO/Query.php
@@ -432,7 +432,7 @@ class CRM_Event_BAO_Query {
"[[:>:]]' ";
$query->_tables['civicrm_participant'] =
- $query->_whereTables['civicrm_participant'] = 1;
+ $query->_whereTables['civicrm_participant'] = 1;
}
return;
diff --git a/CRM/Event/Badge.php b/CRM/Event/Badge.php
index 5baee3d5a4..f5e59dad35 100644
--- a/CRM/Event/Badge.php
+++ b/CRM/Event/Badge.php
@@ -46,11 +46,17 @@ class CRM_Event_Badge {
/**
*/
public function __construct() {
- $this->style = array('width' => 0.1, 'cap' => 'round', 'join' => 'round', 'dash' => '2,2', 'color' => array(0, 0, 200));
- $this->format = '5160';
+ $this->style = array(
+ 'width' => 0.1,
+ 'cap' => 'round',
+ 'join' => 'round',
+ 'dash' => '2,2',
+ 'color' => array(0, 0, 200)
+ );
+ $this->format = '5160';
$this->imgExtension = 'png';
- $this->imgRes = 300;
- $this->event = NULL;
+ $this->imgRes = 300;
+ $this->event = NULL;
$this->setDebug(FALSE);
}
@@ -79,7 +85,7 @@ class CRM_Event_Badge {
public function run(&$participants) {
// fetch the 1st participant, and take her event to retrieve its attributes
$participant = reset($participants);
- $eventID = $participant['event_id'];
+ $eventID = $participant['event_id'];
$this->event = self::retrieveEvent($eventID);
//call function to create labels
self::createLabels($participants);
@@ -142,7 +148,15 @@ class CRM_Event_Badge {
$x = $this->pdf->GetAbsX();
$y = $this->pdf->GetY();
if ($this->debug) {
- $this->pdf->Rect($x, $y, $this->pdf->width, $this->pdf->height, 'D', array('all' => array('width' => 1, 'cap' => 'round', 'join' => 'round', 'dash' => '2,10', 'color' => array(255, 0, 0))));
+ $this->pdf->Rect($x, $y, $this->pdf->width, $this->pdf->height, 'D', array(
+ 'all' => array(
+ 'width' => 1,
+ 'cap' => 'round',
+ 'join' => 'round',
+ 'dash' => '2,10',
+ 'color' => array(255, 0, 0)
+ )
+ ));
}
$img = $this->getImageFileName($this->event->id, $img);
if ($img) {
diff --git a/CRM/Event/Badge/Logo.php b/CRM/Event/Badge/Logo.php
index 575631f22f..016979c6da 100644
--- a/CRM/Event/Badge/Logo.php
+++ b/CRM/Event/Badge/Logo.php
@@ -9,23 +9,23 @@ class CRM_Event_Badge_Logo extends CRM_Event_Badge {
public function __construct() {
parent::__construct();
// A4
- $pw = 210;
- $ph = 297;
- $h = 50;
- $w = 75;
+ $pw = 210;
+ $ph = 297;
+ $h = 50;
+ $w = 75;
$this->format = array(
'name' => 'Sigel 3C',
- 'paper-size' => 'A4',
- 'metric' => 'mm',
- 'lMargin' => ($pw - $w * 2) / 2,
+ 'paper-size' => 'A4',
+ 'metric' => 'mm',
+ 'lMargin' => ($pw - $w * 2) / 2,
'tMargin' => ($ph - $h * 5) / 2,
- 'NX' => 2,
- 'NY' => 5,
- 'SpaceX' => 0,
- 'SpaceY' => 0,
+ 'NX' => 2,
+ 'NY' => 5,
+ 'SpaceX' => 0,
+ 'SpaceY' => 0,
'width' => $w,
- 'height' => $h,
- 'font-size' => 12,
+ 'height' => $h,
+ 'font-size' => 12,
);
$this->lMarginLogo = 20;
$this->tMarginName = 20;
@@ -39,7 +39,13 @@ class CRM_Event_Badge_Logo extends CRM_Event_Badge {
$x = $this->pdf->GetAbsX();
$y = $this->pdf->GetY();
$this->printBackground(TRUE);
- $this->pdf->SetLineStyle(array('width' => 0.1, 'cap' => 'round', 'join' => 'round', 'dash' => '2,2', 'color' => array(0, 0, 200)));
+ $this->pdf->SetLineStyle(array(
+ 'width' => 0.1,
+ 'cap' => 'round',
+ 'join' => 'round',
+ 'dash' => '2,2',
+ 'color' => array(0, 0, 200)
+ ));
$this->pdf->SetFontSize(8);
$this->pdf->MultiCell($this->pdf->width - $this->lMarginLogo, 0, $participant['event_title'], $this->border, "L", 0, 1, $x + $this->lMarginLogo, $y);
diff --git a/CRM/Event/Badge/Logo5395.php b/CRM/Event/Badge/Logo5395.php
index 9fb927d4d9..59d1d18231 100644
--- a/CRM/Event/Badge/Logo5395.php
+++ b/CRM/Event/Badge/Logo5395.php
@@ -9,23 +9,23 @@ class CRM_Event_Badge_Logo5395 extends CRM_Event_Badge {
public function __construct() {
parent::__construct();
// A4
- $pw = 210;
- $ph = 297;
- $h = 59.2;
- $w = 85.7;
+ $pw = 210;
+ $ph = 297;
+ $h = 59.2;
+ $w = 85.7;
$this->format = array(
'name' => 'Avery 5395',
- 'paper-size' => 'A4',
- 'metric' => 'mm',
- 'lMargin' => 13.5,
+ 'paper-size' => 'A4',
+ 'metric' => 'mm',
+ 'lMargin' => 13.5,
'tMargin' => 3,
- 'NX' => 2,
- 'NY' => 4,
- 'SpaceX' => 15,
- 'SpaceY' => 8.5,
+ 'NX' => 2,
+ 'NY' => 4,
+ 'SpaceX' => 15,
+ 'SpaceY' => 8.5,
'width' => $w,
- 'height' => $h,
- 'font-size' => 12,
+ 'height' => $h,
+ 'font-size' => 12,
);
$this->lMarginLogo = 20;
$this->tMarginName = 20;
@@ -39,7 +39,13 @@ class CRM_Event_Badge_Logo5395 extends CRM_Event_Badge {
$x = $this->pdf->GetAbsX();
$y = $this->pdf->GetY();
$this->printBackground(TRUE);
- $this->pdf->SetLineStyle(array('width' => 0.1, 'cap' => 'round', 'join' => 'round', 'dash' => '2,2', 'color' => array(0, 0, 200)));
+ $this->pdf->SetLineStyle(array(
+ 'width' => 0.1,
+ 'cap' => 'round',
+ 'join' => 'round',
+ 'dash' => '2,2',
+ 'color' => array(0, 0, 200)
+ ));
$this->pdf->SetFontSize(9);
$this->pdf->MultiCell($this->pdf->width - $this->lMarginLogo, 0, $participant['event_title'], $this->border, "L", 0, 1, $x + $this->lMarginLogo, $y);
diff --git a/CRM/Event/Badge/NameTent.php b/CRM/Event/Badge/NameTent.php
index 6345be427c..3bca8a13a2 100644
--- a/CRM/Event/Badge/NameTent.php
+++ b/CRM/Event/Badge/NameTent.php
@@ -43,25 +43,25 @@ class CRM_Event_Badge_NameTent extends CRM_Event_Badge {
public function __construct() {
parent::__construct();
// A4
- $pw = 297;
- $ph = 210;
+ $pw = 297;
+ $ph = 210;
$this->lMargin = 10;
$this->tMargin = 0;
- $w = $pw - 2 * $this->lMargin;
- $h = $ph - 2 * $this->tMargin;
- $this->format = array(
+ $w = $pw - 2 * $this->lMargin;
+ $h = $ph - 2 * $this->tMargin;
+ $this->format = array(
'name' => 'A4 horiz',
- 'paper-size' => 'A4',
- 'metric' => 'mm',
- 'lMargin' => 0,
+ 'paper-size' => 'A4',
+ 'metric' => 'mm',
+ 'lMargin' => 0,
'tMargin' => 0,
- 'NX' => 1,
- 'NY' => 1,
- 'SpaceX' => 0,
- 'SpaceY' => 0,
+ 'NX' => 1,
+ 'NY' => 1,
+ 'SpaceX' => 0,
+ 'SpaceY' => 0,
'width' => $w,
- 'height' => $h,
- 'font-size' => 36,
+ 'height' => $h,
+ 'font-size' => 36,
);
// $this->setDebug ();
}
diff --git a/CRM/Event/Cart/BAO/Cart.php b/CRM/Event/Cart/BAO/Cart.php
index c14cbaf4aa..f6841d258c 100644
--- a/CRM/Event/Cart/BAO/Cart.php
+++ b/CRM/Event/Cart/BAO/Cart.php
@@ -104,10 +104,10 @@ class CRM_Event_Cart_BAO_Cart extends CRM_Event_Cart_DAO_Cart {
* @return $this|bool|CRM_Event_Cart_BAO_Cart
*/
public static function find_or_create_for_current_session() {
- $session = CRM_Core_Session::singleton();
+ $session = CRM_Core_Session::singleton();
$event_cart_id = $session->get('event_cart_id');
- $userID = $session->get('userID');
- $cart = FALSE;
+ $userID = $session->get('userID');
+ $cart = FALSE;
if (!is_null($event_cart_id)) {
$cart = self::find_uncompleted_by_id($event_cart_id);
if ($cart && $userID) {
@@ -308,7 +308,7 @@ class CRM_Event_Cart_BAO_Cart extends CRM_Event_Cart_DAO_Cart {
$index++;
}
}
- return - 1;
+ return -1;
}
/**
diff --git a/CRM/Event/Cart/BAO/Conference.php b/CRM/Event/Cart/BAO/Conference.php
index b207e6c7d5..d96f36aaec 100644
--- a/CRM/Event/Cart/BAO/Conference.php
+++ b/CRM/Event/Cart/BAO/Conference.php
@@ -28,8 +28,8 @@ SELECT sub_event.* FROM civicrm_participant main_participant
slot.weight,
sub_event.start_date
EOS;
- $sql_args = array(1 => array($main_event_participant_id, 'Integer'));
- $dao = CRM_Core_DAO::executeQuery($sql, $sql_args);
+ $sql_args = array(1 => array($main_event_participant_id, 'Integer'));
+ $dao = CRM_Core_DAO::executeQuery($sql, $sql_args);
$smarty_sessions = array();
while ($dao->fetch()) {
$smarty_sessions[] = get_object_vars($dao);
diff --git a/CRM/Event/Cart/BAO/EventInCart.php b/CRM/Event/Cart/BAO/EventInCart.php
index f1cbf8562a..b9f661a0d9 100644
--- a/CRM/Event/Cart/BAO/EventInCart.php
+++ b/CRM/Event/Cart/BAO/EventInCart.php
@@ -52,8 +52,8 @@ class CRM_Event_Cart_BAO_EventInCart extends CRM_Event_Cart_DAO_EventInCart impl
$this->load_associations();
$contacts_to_delete = array();
foreach ($this->participants as $participant) {
- $defaults = array();
- $params = array('id' => $participant->contact_id);
+ $defaults = array();
+ $params = array('id' => $participant->contact_id);
$temporary_contact = CRM_Contact_BAO_Contact::retrieve($params, $defaults);
if ($temporary_contact->is_deleted) {
diff --git a/CRM/Event/Cart/Form/Cart.php b/CRM/Event/Cart/Form/Cart.php
index ef67dbfb8d..c227a3c829 100644
--- a/CRM/Event/Cart/Form/Cart.php
+++ b/CRM/Event/Cart/Form/Cart.php
@@ -50,9 +50,9 @@ class CRM_Event_Cart_Form_Cart extends CRM_Core_Form {
foreach ($this->cart->get_main_events_in_carts() as $event_in_cart) {
if (empty($event_in_cart->participants)) {
$participant_params = array(
- 'cart_id' => $this->cart->id,
- 'event_id' => $event_in_cart->event_id,
- 'contact_id' => self::find_or_create_contact($this->getContactID()),
+ 'cart_id' => $this->cart->id,
+ 'event_id' => $event_in_cart->event_id,
+ 'contact_id' => self::find_or_create_contact($this->getContactID()),
);
$participant = CRM_Event_Cart_BAO_MerParticipant::create($participant_params);
$participant->save();
diff --git a/CRM/Event/Cart/Form/Checkout/ConferenceEvents.php b/CRM/Event/Cart/Form/Checkout/ConferenceEvents.php
index 7f8c70d5d7..b6c6a2057e 100644
--- a/CRM/Event/Cart/Form/Checkout/ConferenceEvents.php
+++ b/CRM/Event/Cart/Form/Checkout/ConferenceEvents.php
@@ -64,10 +64,10 @@ EOS;
$slot_buttons = array();
$group_name = "slot_$slot_index";
foreach ($events as $event) {
- $seats_available = $this->checkEventCapacity($event->id);
- $event_is_full = ($seats_available === NULL) ? FALSE : ($seats_available < 1);
- $radio = $this->createElement('radio', NULL, NULL, $event->title, $event->id);
- $slot_buttons[] = $radio;
+ $seats_available = $this->checkEventCapacity($event->id);
+ $event_is_full = ($seats_available === NULL) ? FALSE : ($seats_available < 1);
+ $radio = $this->createElement('radio', NULL, NULL, $event->title, $event->id);
+ $slot_buttons[] = $radio;
$event_description = ($event_is_full ? $event->event_full_text . "
" : '') . $event->description;
$session_options[$radio->getAttribute('id')] = array(
@@ -136,9 +136,9 @@ EOS;
$values = array();
CRM_Core_DAO::storeValues($this->main_participant, $values);
- $values['id'] = NULL;
+ $values['id'] = NULL;
$values['event_id'] = $event_in_cart->event_id;
- $participant = CRM_Event_Cart_BAO_MerParticipant::create($values);
+ $participant = CRM_Event_Cart_BAO_MerParticipant::create($values);
$participant->save();
$event_in_cart->add_participant($participant);
}
diff --git a/CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.php b/CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.php
index 897f8478db..608c1e2399 100644
--- a/CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.php
+++ b/CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.php
@@ -42,8 +42,8 @@ class CRM_Event_Cart_Form_Checkout_ParticipantsAndPrices extends CRM_Event_Cart_
);
if ($this->cid) {
- $params = array('id' => $this->cid);
- $contact = CRM_Contact_BAO_Contact::retrieve($params, $defaults);
+ $params = array('id' => $this->cid);
+ $contact = CRM_Contact_BAO_Contact::retrieve($params, $defaults);
$contact_values = array();
CRM_Core_DAO::storeValues($contact, $contact_values);
$this->assign('contact', $contact_values);
@@ -76,8 +76,8 @@ class CRM_Event_Cart_Form_Checkout_ParticipantsAndPrices extends CRM_Event_Cart_
$price_set_id = CRM_Price_BAO_PriceSet::getFor('civicrm_event', $event->id);
if ($price_set_id) {
$price_sets = CRM_Price_BAO_PriceSet::getSetDetail($price_set_id, TRUE, TRUE);
- $price_set = $price_sets[$price_set_id];
- $index = -1;
+ $price_set = $price_sets[$price_set_id];
+ $index = -1;
foreach ($price_set['fields'] as $field) {
$index++;
$field_name = "event_{$event->id}_price_{$field['id']}";
@@ -143,7 +143,11 @@ class CRM_Event_Cart_Form_Checkout_ParticipantsAndPrices extends CRM_Event_Cart_
while ($participant->fetch()) {
if (array_key_exists($participant->status_id, $statusTypes)) {
$form = $mer_participant->get_form();
- $this->_errors[$form->html_field_name('email')] = ts("The participant %1 is already registered for %2 (%3).", array(1 => $participant_fields['email'], 2 => $event_in_cart->event->title, 3 => $event_in_cart->event->start_date));
+ $this->_errors[$form->html_field_name('email')] = ts("The participant %1 is already registered for %2 (%3).", array(
+ 1 => $participant_fields['email'],
+ 2 => $event_in_cart->event->title,
+ 3 => $event_in_cart->event->start_date
+ ));
}
}
}
@@ -202,8 +206,8 @@ class CRM_Event_Cart_Form_Checkout_ParticipantsAndPrices extends CRM_Event_Cart_
$participant = $this->cart->get_event_in_cart_by_event_id($event_id)->get_participant_by_id($participant_id);
if ($participant->contact_id && $contact_id != $participant->contact_id) {
- $defaults = array();
- $params = array('id' => $participant->contact_id);
+ $defaults = array();
+ $params = array('id' => $participant->contact_id);
$temporary_contact = CRM_Contact_BAO_Contact::retrieve($params, $defaults);
foreach ($this->cart->get_subparticipants($participant) as $subparticipant) {
diff --git a/CRM/Event/Cart/Form/Checkout/Payment.php b/CRM/Event/Cart/Form/Checkout/Payment.php
index c433ca8e7d..38b7b9c7b2 100644
--- a/CRM/Event/Cart/Form/Checkout/Payment.php
+++ b/CRM/Event/Cart/Form/Checkout/Payment.php
@@ -175,8 +175,8 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart {
public function buildQuickForm() {
- $this->line_items = array();
- $this->sub_total = 0;
+ $this->line_items = array();
+ $this->sub_total = 0;
$this->_price_values = $this->getValuesForPage('ParticipantsAndPrices');
// iterate over each event in cart
@@ -239,7 +239,7 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart {
* @param null $class
*/
public function process_event_line_item(&$event_in_cart, $class = NULL) {
- $cost = 0;
+ $cost = 0;
$price_set_id = CRM_Price_BAO_PriceSet::getFor("civicrm_event", $event_in_cart->event_id);
$amount_level = NULL;
if ($price_set_id) {
@@ -249,12 +249,12 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart {
$event_price_values[$matches[1]] = $value;
}
}
- $price_sets = CRM_Price_BAO_PriceSet::getSetDetail($price_set_id, TRUE);
- $price_set = $price_sets[$price_set_id];
+ $price_sets = CRM_Price_BAO_PriceSet::getSetDetail($price_set_id, TRUE);
+ $price_set = $price_sets[$price_set_id];
$price_set_amount = array();
CRM_Price_BAO_PriceSet::processAmount($price_set['fields'], $event_price_values, $price_set_amount);
- $cost = $event_price_values['amount'];
- $amount_level = $event_price_values['amount_level'];
+ $cost = $event_price_values['amount'];
+ $amount_level = $event_price_values['amount_level'];
$price_details[$price_set_id] = $price_set_amount;
}
@@ -316,8 +316,8 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart {
* @param array $params
*/
public function emailReceipt($events_in_cart, $params) {
- $contact_details = CRM_Contact_BAO_Contact::getContactDetails($this->payer_contact_id);
- $state_province = new CRM_Core_DAO_StateProvince();
+ $contact_details = CRM_Contact_BAO_Contact::getContactDetails($this->payer_contact_id);
+ $state_province = new CRM_Core_DAO_StateProvince();
$state_province->id = $params["billing_state_province_id-{$this->_bltID}"];
$state_province->find();
$state_province->fetch();
@@ -429,13 +429,13 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart {
$transaction = new CRM_Core_Transaction();
$trxnDetails = NULL;
- $params = $this->_submitValues;
+ $params = $this->_submitValues;
$main_participants = $this->cart->get_main_event_participants();
foreach ($main_participants as $participant) {
- $defaults = array();
- $ids = array('contact_id' => $participant->contact_id);
- $contact = CRM_Contact_BAO_Contact::retrieve($ids, $defaults);
+ $defaults = array();
+ $ids = array('contact_id' => $participant->contact_id);
+ $contact = CRM_Contact_BAO_Contact::retrieve($ids, $defaults);
$contact->is_deleted = 0;
$contact->save();
}
@@ -443,11 +443,11 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart {
$trxn_prefix = 'VR';
if (array_key_exists('billing_contact_email', $params)) {
$this->payer_contact_id = self::find_or_create_contact($this->getContactID(), array(
- 'email' => $params['billing_contact_email'],
- 'first_name' => $params['billing_first_name'],
- 'last_name' => $params['billing_last_name'],
- 'is_deleted' => FALSE,
- ));
+ 'email' => $params['billing_contact_email'],
+ 'first_name' => $params['billing_first_name'],
+ 'last_name' => $params['billing_last_name'],
+ 'is_deleted' => FALSE,
+ ));
$ctype = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact',
$this->payer_contact_id,
@@ -580,8 +580,8 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart {
$payment = &CRM_Core_Payment::singleton($this->_mode, $this->_paymentProcessor, $this);
CRM_Core_Payment_Form::mapParams($this->_bltID, $params, $params, TRUE);
$params['month'] = $params['credit_card_exp_date']['M'];
- $params['year'] = $params['credit_card_exp_date']['Y'];
- $result = &$payment->doDirectPayment($params);
+ $params['year'] = $params['credit_card_exp_date']['Y'];
+ $result = &$payment->doDirectPayment($params);
if (is_a($result, 'CRM_Core_Error')) {
CRM_Core_Error::displaySessionError($result);
CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/event/cart_checkout', "_qf_Payment_display=1&qfKey={$this->controller->_key}", TRUE, NULL, FALSE));
diff --git a/CRM/Event/Cart/Form/MerParticipant.php b/CRM/Event/Cart/Form/MerParticipant.php
index f67fef8076..b483498281 100644
--- a/CRM/Event/Cart/Form/MerParticipant.php
+++ b/CRM/Event/Cart/Form/MerParticipant.php
@@ -25,7 +25,7 @@ class CRM_Event_Cart_Form_MerParticipant extends CRM_Core_Form {
list(
$custom_fields_pre,
$custom_fields_post
- ) = $this->get_participant_custom_data_fields($this->participant->event_id);
+ ) = $this->get_participant_custom_data_fields($this->participant->event_id);
foreach ($custom_fields_pre as $key => $field) {
CRM_Core_BAO_UFGroup::buildProfile($form, $field, CRM_Profile_Form::MODE_CREATE, $this->participant->id);
@@ -35,10 +35,10 @@ class CRM_Event_Cart_Form_MerParticipant extends CRM_Core_Form {
}
$custom = CRM_Utils_Array::value('custom', $form->getTemplate()->_tpl_vars, array());
$form->assign('custom', array_merge($custom, array(
- $this->html_field_name('customPre') => $custom_fields_pre,
- $this->html_field_name('customPost') => $custom_fields_post,
- $this->html_field_name('number') => $this->name(),
- )));
+ $this->html_field_name('customPre') => $custom_fields_pre,
+ $this->html_field_name('customPost') => $custom_fields_post,
+ $this->html_field_name('number') => $this->name(),
+ )));
}
/**
diff --git a/CRM/Event/Cart/Page/AddToCart.php b/CRM/Event/Cart/Page/AddToCart.php
index 327029bf7f..1aabf6919a 100644
--- a/CRM/Event/Cart/Page/AddToCart.php
+++ b/CRM/Event/Cart/Page/AddToCart.php
@@ -16,7 +16,10 @@ class CRM_Event_Cart_Page_AddToCart extends CRM_Core_Page {
$event_in_cart = $cart->add_event($this->_id);
$url = CRM_Utils_System::url('civicrm/event/view_cart');
- CRM_Utils_System::setUFMessage(ts("%1 has been added to your cart. View your cart.", array(1 => $event_in_cart->event->title, 2 => $url)));
+ CRM_Utils_System::setUFMessage(ts("%1 has been added to your cart. View your cart.", array(
+ 1 => $event_in_cart->event->title,
+ 2 => $url
+ )));
$transaction->commit();
diff --git a/CRM/Event/Cart/Page/CheckoutAJAX.php b/CRM/Event/Cart/Page/CheckoutAJAX.php
index 8b85bf6e80..194f8b50fb 100644
--- a/CRM/Event/Cart/Page/CheckoutAJAX.php
+++ b/CRM/Event/Cart/Page/CheckoutAJAX.php
@@ -11,7 +11,11 @@ class CRM_Event_Cart_Page_CheckoutAJAX {
$cart = CRM_Event_Cart_BAO_Cart::find_by_id($cart_id);
- $params_array = array('cart_id' => $cart->id, 'contact_id' => CRM_Event_Cart_Form_Cart::find_or_create_contact(), 'event_id' => $event_id);
+ $params_array = array(
+ 'cart_id' => $cart->id,
+ 'contact_id' => CRM_Event_Cart_Form_Cart::find_or_create_contact(),
+ 'event_id' => $event_id
+ );
//XXX security?
$participant = CRM_Event_Cart_BAO_MerParticipant::create($params_array);
diff --git a/CRM/Event/Cart/Page/RemoveFromCart.php b/CRM/Event/Cart/Page/RemoveFromCart.php
index 72e3298a6e..06ea46b528 100644
--- a/CRM/Event/Cart/Page/RemoveFromCart.php
+++ b/CRM/Event/Cart/Page/RemoveFromCart.php
@@ -6,11 +6,11 @@
class CRM_Event_Cart_Page_RemoveFromCart extends CRM_Core_Page {
public function run() {
$transaction = new CRM_Core_Transaction();
- $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE);
- $cart = CRM_Event_Cart_BAO_Cart::find_or_create_for_current_session();
+ $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE);
+ $cart = CRM_Event_Cart_BAO_Cart::find_or_create_for_current_session();
$cart->load_associations();
- $event_in_cart = $cart->get_event_in_cart_by_event_id($this->_id);
- $removed_event = $cart->remove_event_in_cart($event_in_cart->id);
+ $event_in_cart = $cart->get_event_in_cart_by_event_id($this->_id);
+ $removed_event = $cart->remove_event_in_cart($event_in_cart->id);
$removed_event_title = $removed_event->event->title;
CRM_Core_Session::setStatus(ts("%1 has been removed from your cart.", array(1 => $removed_event_title)), '', 'success');
$transaction->commit();
diff --git a/CRM/Event/Cart/StateMachine/Checkout.php b/CRM/Event/Cart/StateMachine/Checkout.php
index d56d42ede9..c6d58689a9 100644
--- a/CRM/Event/Cart/StateMachine/Checkout.php
+++ b/CRM/Event/Cart/StateMachine/Checkout.php
@@ -17,8 +17,8 @@ class CRM_Event_Cart_StateMachine_Checkout extends CRM_Core_StateMachine {
CRM_Core_Error::statusBounce(ts("You don't have any events in you cart. Please add some events."), CRM_Utils_System::url('civicrm/event'));
}
- $pages = array();
- $is_monetary = FALSE;
+ $pages = array();
+ $is_monetary = FALSE;
$is_conference = FALSE;
foreach ($cart->events_in_carts as $event_in_cart) {
if ($event_in_cart->event->is_monetary) {
diff --git a/CRM/Event/Config.php b/CRM/Event/Config.php
index 91c15903c9..b60823435f 100644
--- a/CRM/Event/Config.php
+++ b/CRM/Event/Config.php
@@ -35,4 +35,5 @@
* $Id$
*
*/
-class CRM_Event_Config extends CRM_Core_Component_Config {}
+class CRM_Event_Config extends CRM_Core_Component_Config {
+}
diff --git a/CRM/Event/Form/EventFees.php b/CRM/Event/Form/EventFees.php
index 477b056e32..e5628f00e7 100644
--- a/CRM/Event/Form/EventFees.php
+++ b/CRM/Event/Form/EventFees.php
@@ -184,12 +184,12 @@ class CRM_Event_Form_EventFees {
if ($priceSetId) {
// get price set default values, CRM-4090
if (in_array(get_class($form),
- array(
- 'CRM_Event_Form_Participant',
- 'CRM_Event_Form_Registration_Register',
- 'CRM_Event_Form_Registration_AdditionalParticipant',
- )
- )) {
+ array(
+ 'CRM_Event_Form_Participant',
+ 'CRM_Event_Form_Registration_Register',
+ 'CRM_Event_Form_Registration_AdditionalParticipant',
+ )
+ )) {
$priceSetValues = self::setDefaultPriceSet($form->_pId, $form->_eventId);
if (!empty($priceSetValues)) {
$defaults[$form->_pId] = array_merge($defaults[$form->_pId], $priceSetValues);
@@ -234,7 +234,13 @@ class CRM_Event_Form_EventFees {
$contribution = new CRM_Contribute_DAO_Contribution();
$contribution->id = $contriId;
$contribution->find(TRUE);
- foreach (array('financial_type_id', 'payment_instrument_id', 'contribution_status_id', 'receive_date', 'total_amount') as $f) {
+ foreach (array(
+ 'financial_type_id',
+ 'payment_instrument_id',
+ 'contribution_status_id',
+ 'receive_date',
+ 'total_amount'
+ ) as $f) {
if ($f == 'receive_date') {
list($defaults[$form->_pId]['receive_date']) = CRM_Utils_Date::setDateDefaults($contribution->$f);
}
@@ -356,8 +362,9 @@ SELECT id, html_type
if ($form->_pId) {
if (CRM_Core_DAO::getFieldValue('CRM_Event_DAO_ParticipantPayment',
- $form->_pId, 'contribution_id', 'participant_id'
- )) {
+ $form->_pId, 'contribution_id', 'participant_id'
+ )
+ ) {
$form->_online = TRUE;
}
}
@@ -394,7 +401,8 @@ SELECT id, html_type
$element = $form->add('select', 'discount_id',
ts('Discount Set'),
array(
- 0 => ts('- select -')) + $discounts,
+ 0 => ts('- select -')
+ ) + $discounts,
FALSE,
array('onchange' => "buildFeeBlock( {$form->_eventId}, this.value );")
);
@@ -484,7 +492,7 @@ SELECT id, html_type
if ($form->_contactId) {
list($form->_contributorDisplayName,
$form->_contributorEmail
- ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($form->_contactId);
+ ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($form->_contactId);
$form->assign('email', $form->_contributorEmail);
}
else {
diff --git a/CRM/Event/Form/ManageEvent.php b/CRM/Event/Form/ManageEvent.php
index 7e1e55a5c0..53644e2287 100644
--- a/CRM/Event/Form/ManageEvent.php
+++ b/CRM/Event/Form/ManageEvent.php
@@ -206,18 +206,22 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
$this->_doneUrl = CRM_Utils_System::url('civicrm/event/manage',
'reset=1'
);
- $breadCrumb = array(array(
- 'title' => ts('Manage Events'),
+ $breadCrumb = array(
+ array(
+ 'title' => ts('Manage Events'),
'url' => $this->_doneUrl,
- ));
+ )
+ );
}
}
else {
$this->_doneUrl = CRM_Utils_System::url('civicrm/admin/eventTemplate', 'reset=1');
- $breadCrumb = array(array(
- 'title' => ts('Manage Event Templates'),
+ $breadCrumb = array(
+ array(
+ 'title' => ts('Manage Event Templates'),
'url' => $this->_doneUrl,
- ));
+ )
+ );
}
CRM_Utils_System::appendBreadCrumb($breadCrumb);
}
@@ -351,8 +355,8 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
}
CRM_Core_Session::setStatus(ts("'%1' information has been saved.",
- array(1 => CRM_Utils_Array::value('title', CRM_Utils_Array::value($subPage, $this->get('tabHeader')), $className))
- ), ts('Saved'), 'success');
+ array(1 => CRM_Utils_Array::value('title', CRM_Utils_Array::value($subPage, $this->get('tabHeader')), $className))
+ ), ts('Saved'), 'success');
$config = CRM_Core_Config::singleton();
if (in_array('CiviCampaign', $config->enableComponents)) {
@@ -366,7 +370,8 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
$this->postProcessHook();
if ($this->controller->getButtonName('submit') == "_qf_{$className}_upload_done") {
if ($this->_isTemplate) {
- CRM_Core_Session::singleton()->pushUserContext(CRM_Utils_System::url('civicrm/admin/eventTemplate', 'reset=1'));
+ CRM_Core_Session::singleton()
+ ->pushUserContext(CRM_Utils_System::url('civicrm/admin/eventTemplate', 'reset=1'));
}
else {
CRM_Core_Session::singleton()->pushUserContext(CRM_Utils_System::url('civicrm/event/manage', 'reset=1'));
@@ -374,8 +379,8 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
}
else {
CRM_Core_Session::singleton()->pushUserContext(CRM_Utils_System::url("civicrm/event/manage/{$subPage}",
- "action=update&reset=1&id={$this->_id}"
- ));
+ "action=update&reset=1&id={$this->_id}"
+ ));
}
}
}
diff --git a/CRM/Event/Form/ManageEvent/Conference.php b/CRM/Event/Form/ManageEvent/Conference.php
index ad967dbea7..a1ba39b20e 100644
--- a/CRM/Event/Form/ManageEvent/Conference.php
+++ b/CRM/Event/Form/ManageEvent/Conference.php
@@ -54,8 +54,8 @@ class CRM_Event_Form_ManageEvent_Conference extends CRM_Event_Form_ManageEvent {
public function setDefaultValues() {
$parentDefaults = parent::setDefaultValues();
- $eventId = $this->_id;
- $params = array();
+ $eventId = $this->_id;
+ $params = array();
$defaults = array();
if (isset($eventId)) {
$params = array('id' => $eventId);
@@ -81,7 +81,8 @@ class CRM_Event_Form_ManageEvent_Conference extends CRM_Event_Form_ManageEvent {
'slot_label_id',
ts('Conference Slot'),
array(
- '' => ts('- select -')) + $slots,
+ '' => ts('- select -')
+ ) + $slots,
FALSE
);
diff --git a/CRM/Event/Form/ManageEvent/Delete.php b/CRM/Event/Form/ManageEvent/Delete.php
index f18783abde..2507a7cc84 100644
--- a/CRM/Event/Form/ManageEvent/Delete.php
+++ b/CRM/Event/Form/ManageEvent/Delete.php
@@ -99,8 +99,8 @@ class CRM_Event_Form_ManageEvent_Delete extends CRM_Event_Form_ManageEvent {
if ($participant->find()) {
$searchURL = CRM_Utils_System::url('civicrm/event/search', 'reset=1');
CRM_Core_Session::setStatus(ts('This event cannot be deleted because there are participant records linked to it. If you want to delete this event, you must first find the participants linked to this event and delete them. You can use use CiviEvent >> Find Participants page .',
- array(1 => $searchURL)
- ), ts('Deletion Error'), 'error');
+ array(1 => $searchURL)
+ ), ts('Deletion Error'), 'error');
return;
}
CRM_Event_BAO_Event::del($this->_id);
diff --git a/CRM/Event/Form/ManageEvent/EventInfo.php b/CRM/Event/Form/ManageEvent/EventInfo.php
index 74b04386cd..86a0bc70c6 100644
--- a/CRM/Event/Form/ManageEvent/EventInfo.php
+++ b/CRM/Event/Form/ManageEvent/EventInfo.php
@@ -324,8 +324,8 @@ class CRM_Event_Form_ManageEvent_EventInfo extends CRM_Event_Form_ManageEvent {
$url = 'civicrm/event/manage';
$urlParams = 'reset=1';
CRM_Core_Session::setStatus(ts("'%1' information has been saved.",
- array(1 => $this->getTitle())
- ), ts('Saved'), 'success');
+ array(1 => $this->getTitle())
+ ), ts('Saved'), 'success');
}
CRM_Utils_System::redirect(CRM_Utils_System::url($url, $urlParams));
@@ -360,8 +360,8 @@ class CRM_Event_Form_ManageEvent_EventInfo extends CRM_Event_Form_ManageEvent {
}
// pull template custom data as a default for event, CRM-5596
- $groupTree = CRM_Core_BAO_CustomGroup::getTree($this->_type, $this, $templateId, NULL, $this->_subType);
- $groupTree = CRM_Core_BAO_CustomGroup::formatGroupTree($groupTree, $this->_groupCount, $this);
+ $groupTree = CRM_Core_BAO_CustomGroup::getTree($this->_type, $this, $templateId, NULL, $this->_subType);
+ $groupTree = CRM_Core_BAO_CustomGroup::formatGroupTree($groupTree, $this->_groupCount, $this);
$customValues = array();
CRM_Core_BAO_CustomGroup::setDefaults($groupTree, $customValues);
foreach ($customValues as $key => $val) {
diff --git a/CRM/Event/Form/ManageEvent/Fee.php b/CRM/Event/Form/ManageEvent/Fee.php
index 1685248f2a..4e25a57bb5 100644
--- a/CRM/Event/Form/ManageEvent/Fee.php
+++ b/CRM/Event/Form/ManageEvent/Fee.php
@@ -78,8 +78,8 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent {
public function setDefaultValues() {
$parentDefaults = parent::setDefaultValues();
- $eventId = $this->_id;
- $params = array();
+ $eventId = $this->_id;
+ $params = array();
$defaults = array();
if (isset($eventId)) {
$params = array('id' => $eventId);
@@ -130,10 +130,10 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent {
list($defaults["discount_start_date[$i]"]) = CRM_Utils_Date::setDateDefaults(CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Discount', $optionGroupId,
'start_date', 'price_set_id'
- ));
+ ));
list($defaults["discount_end_date[$i]"]) = CRM_Utils_Date::setDateDefaults(CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Discount', $optionGroupId,
'end_date', 'price_set_id'
- ));
+ ));
$defaultDiscounts[] = CRM_Price_BAO_PriceSet::getSetDetail($optionGroupId);
$i++;
}
@@ -241,7 +241,7 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent {
if (!empty($defaults['payment_processor'])) {
$defaults['payment_processor'] = array_fill_keys(explode(CRM_Core_DAO::VALUE_SEPARATOR,
$defaults['payment_processor']
- ), '1');
+ ), '1');
}
return $defaults;
}
@@ -297,7 +297,8 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent {
}
$this->add('select', 'price_set_id', ts('Price Set'),
array(
- '' => ts('- none -')) + $price,
+ '' => ts('- none -')
+ ) + $price,
NULL, array('onchange' => "return showHideByValue('price_set_id', '', 'map-field', 'block', 'select', false);")
);
$default = array($this->createElement('radio', NULL, NULL, NULL, 0));
@@ -414,8 +415,8 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent {
public static function formRule($values) {
$errors = array();
if (!empty($values['is_discount'])) {
- $occurDiscount = array_count_values($values['discount_name']);
- $countemptyrows = 0;
+ $occurDiscount = array_count_values($values['discount_name']);
+ $countemptyrows = 0;
$countemptyvalue = 0;
for ($i = 1; $i <= self::NUM_DISCOUNT; $i++) {
$start_date = $end_date = NULL;
@@ -556,7 +557,7 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent {
*/
public function postProcess() {
$eventTitle = '';
- $params = $this->exportValues();
+ $params = $this->exportValues();
$this->set('discountSection', 0);
@@ -605,15 +606,15 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent {
}
else {
// if there are label / values, create custom options for them
- $labels = CRM_Utils_Array::value('label', $params);
- $values = CRM_Utils_Array::value('value', $params);
+ $labels = CRM_Utils_Array::value('label', $params);
+ $values = CRM_Utils_Array::value('value', $params);
$default = CRM_Utils_Array::value('default', $params);
$options = array();
if (!CRM_Utils_System::isNull($labels) && !CRM_Utils_System::isNull($values)) {
for ($i = 1; $i < self::NUM_OPTION; $i++) {
if (!empty($labels[$i]) && !CRM_Utils_System::isNull($values[$i])) {
$options[] = array(
- 'label' => trim($labels[$i]),
+ 'label' => trim($labels[$i]),
'value' => CRM_Utils_Rule::cleanMoney(trim($values[$i])),
'weight' => $i,
'is_active' => 1,
@@ -678,12 +679,12 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent {
}
$discountPriceSets = !empty($this->_defaultValues['discount_price_set']) ? $this->_defaultValues['discount_price_set'] : array();
- $discountFieldIDs = !empty($this->_defaultValues['discount_option_id']) ? $this->_defaultValues['discount_option_id'] : array();
+ $discountFieldIDs = !empty($this->_defaultValues['discount_option_id']) ? $this->_defaultValues['discount_option_id'] : array();
if (CRM_Utils_Array::value('is_discount', $params) == 1) {
// if there are discounted set of label / values,
// create custom options for them
- $labels = CRM_Utils_Array::value('discounted_label', $params);
- $values = CRM_Utils_Array::value('discounted_value', $params);
+ $labels = CRM_Utils_Array::value('discounted_label', $params);
+ $values = CRM_Utils_Array::value('discounted_value', $params);
$default = CRM_Utils_Array::value('discounted_default', $params);
if (!CRM_Utils_System::isNull($labels) && !CRM_Utils_System::isNull($values)) {
@@ -774,7 +775,7 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent {
'price_set_id' => $priceSetID,
'start_date' => CRM_Utils_Date::processDate($params['discount_start_date'][$j]),
'end_date' => CRM_Utils_Date::processDate($params['discount_end_date'][$j]),
- );
+ );
CRM_Core_BAO_Discount::add($discountParams);
}
}
diff --git a/CRM/Event/Form/ManageEvent/Location.php b/CRM/Event/Form/ManageEvent/Location.php
index ceb4cb239d..25588f5cb2 100644
--- a/CRM/Event/Form/ManageEvent/Location.php
+++ b/CRM/Event/Form/ManageEvent/Location.php
@@ -198,7 +198,7 @@ class CRM_Event_Form_ManageEvent_Location extends CRM_Event_Form_ManageEvent {
if (!empty($locationEvents)) {
$this->assign('locEvents', TRUE);
$optionTypes = array(
- '1' => ts('Create new location'),
+ '1' => ts('Create new location'),
'2' => ts('Use existing location'),
);
@@ -206,7 +206,8 @@ class CRM_Event_Form_ManageEvent_Location extends CRM_Event_Form_ManageEvent {
if (!isset($locationEvents[$this->_oldLocBlockId]) || (!$this->_oldLocBlockId)) {
$locationEvents = array(
- '' => ts('- select -')) + $locationEvents;
+ '' => ts('- select -')
+ ) + $locationEvents;
}
$this->add('select', 'loc_event_id', ts('Use Location'), $locationEvents);
}
@@ -258,7 +259,10 @@ class CRM_Event_Form_ManageEvent_Location extends CRM_Event_Form_ManageEvent {
$defaultLocationType = CRM_Core_BAO_LocationType::getDefault();
foreach (array(
- 'address', 'phone', 'email') as $block) {
+ 'address',
+ 'phone',
+ 'email'
+ ) as $block) {
if (empty($params[$block]) || !is_array($params[$block])) {
continue;
}
diff --git a/CRM/Event/Form/ManageEvent/Registration.php b/CRM/Event/Form/ManageEvent/Registration.php
index 010168182b..7714a34d6d 100644
--- a/CRM/Event/Form/ManageEvent/Registration.php
+++ b/CRM/Event/Form/ManageEvent/Registration.php
@@ -116,7 +116,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
list($defaults['custom_pre_id'],
$defaults['custom_post']
- ) = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
+ ) = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
// Get the id for the event registration profile
$eventRegistrationIdParams = $eventRegistrationIdDefaults = array(
@@ -154,7 +154,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
list($defaults['additional_custom_pre_id'],
$defaults['additional_custom_post']
- ) = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinAddParams);
+ ) = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinAddParams);
if (isset($defaults['additional_custom_post']) && is_numeric($defaults['additional_custom_post'])) {
$defaults['additional_custom_post_id'] = $defaults['additional_custom_post'];
@@ -185,7 +185,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
if (!empty($defaults['registration_start_date'])) {
list($defaults['registration_start_date'],
$defaults['registration_start_date_time']
- ) = CRM_Utils_Date::setDateDefaults($defaults['registration_start_date'],
+ ) = CRM_Utils_Date::setDateDefaults($defaults['registration_start_date'],
'activityDateTime'
);
}
@@ -193,7 +193,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
if (!empty($defaults['registration_end_date'])) {
list($defaults['registration_end_date'],
$defaults['registration_end_date_time']
- ) = CRM_Utils_Date::setDateDefaults($defaults['registration_end_date'],
+ ) = CRM_Utils_Date::setDateDefaults($defaults['registration_end_date'],
'activityDateTime'
);
}
@@ -265,7 +265,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
}
$params = array(
- 'used' => 'Supervised',
+ 'used' => 'Supervised',
'contact_type' => 'Individual',
);
$dedupeRuleFields = CRM_Dedupe_BAO_Rule::dedupeRuleFields($params);
@@ -375,19 +375,26 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
'profileEntities' => array(),
);
- $configs['allowCoreTypes'] = array_merge(array('Contact', 'Individual'), CRM_Contact_BAO_ContactType::subTypes('Individual'));
+ $configs['allowCoreTypes'] = array_merge(array(
+ 'Contact',
+ 'Individual'
+ ), CRM_Contact_BAO_ContactType::subTypes('Individual'));
$configs['allowCoreTypes'][] = 'Participant';
//CRM-15427
$id = CRM_Utils_Request::retrieve('id', 'Integer');
if ($id) {
$participantEventType = CRM_Core_DAO::getFieldValue("CRM_Event_DAO_Event", $id, 'event_type_id', 'id');
- $participantRole = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $id, 'default_role_id');
+ $participantRole = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $id, 'default_role_id');
$configs['allowSubTypes']['ParticipantEventName'] = array($id);
$configs['allowSubTypes']['ParticipantEventType'] = array($participantEventType);
$configs['allowSubTypes']['ParticipantRole'] = array($participantRole);
}
$configs['profileEntities'][] = array('entity_name' => 'contact_1', 'entity_type' => 'IndividualModel');
- $configs['profileEntities'][] = array('entity_name' => 'participant_1', 'entity_type' => 'ParticipantModel', 'entity_sub_type' => '*');
+ $configs['profileEntities'][] = array(
+ 'entity_name' => 'participant_1',
+ 'entity_type' => 'ParticipantModel',
+ 'entity_sub_type' => '*'
+ );
return $configs;
}
@@ -507,7 +514,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
isset($values['registration_end_date'])
) {
$start = CRM_Utils_Date::processDate($values['registration_start_date']);
- $end = CRM_Utils_Date::processDate($values['registration_end_date']);
+ $end = CRM_Utils_Date::processDate($values['registration_end_date']);
if ($end < $start) {
$errorMsg['registration_end_date'] = ts('Registration end date should be after Registration start date');
}
@@ -903,7 +910,8 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
$ufAdd[1] = $params['custom_pre_id'];
$wtAdd = 1;
}
- elseif (CRM_Utils_Array::value('additional_custom_pre_id', $params) == 'none') {}
+ elseif (CRM_Utils_Array::value('additional_custom_pre_id', $params) == 'none') {
+ }
else {
$ufAdd[1] = $params['additional_custom_pre_id'];
$wtAdd = 1;
@@ -914,7 +922,8 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
if (empty($params['additional_custom_post_id'])) {
$ufAdd[2] = $params['custom_post_id'];
}
- elseif (CRM_Utils_Array::value('additional_custom_post_id', $params) == 'none') {}
+ elseif (CRM_Utils_Array::value('additional_custom_post_id', $params) == 'none') {
+ }
else {
$ufAdd[2] = $params['additional_custom_post_id'];
}
diff --git a/CRM/Event/Form/ManageEvent/Repeat.php b/CRM/Event/Form/ManageEvent/Repeat.php
index d6f7ee2370..b418855348 100644
--- a/CRM/Event/Form/ManageEvent/Repeat.php
+++ b/CRM/Event/Form/ManageEvent/Repeat.php
@@ -33,8 +33,8 @@ class CRM_Event_Form_ManageEvent_Repeat extends CRM_Event_Form_ManageEvent {
//If this ID has parent, send parent id
if ($checkParentExistsForThisId) {
/**
- * Get connected event information list
- */
+ * Get connected event information list
+ */
//Get all connected event ids
$allEventIdsArray = CRM_Core_BAO_RecurringEntity::getEntitiesForParent($checkParentExistsForThisId, 'civicrm_event');
$allEventIds = array();
@@ -114,36 +114,36 @@ class CRM_Event_Form_ManageEvent_Repeat extends CRM_Event_Form_ManageEvent {
$linkedEntities = array(
array(
- 'table' => 'civicrm_price_set_entity',
- 'findCriteria' => array(
- 'entity_id' => $this->_id,
+ 'table' => 'civicrm_price_set_entity',
+ 'findCriteria' => array(
+ 'entity_id' => $this->_id,
'entity_table' => 'civicrm_event',
),
'linkedColumns' => array('entity_id'),
'isRecurringEntityRecord' => FALSE,
),
array(
- 'table' => 'civicrm_uf_join',
- 'findCriteria' => array(
- 'entity_id' => $this->_id,
+ 'table' => 'civicrm_uf_join',
+ 'findCriteria' => array(
+ 'entity_id' => $this->_id,
'entity_table' => 'civicrm_event',
),
'linkedColumns' => array('entity_id'),
'isRecurringEntityRecord' => FALSE,
),
array(
- 'table' => 'civicrm_tell_friend',
- 'findCriteria' => array(
- 'entity_id' => $this->_id,
+ 'table' => 'civicrm_tell_friend',
+ 'findCriteria' => array(
+ 'entity_id' => $this->_id,
'entity_table' => 'civicrm_event',
),
'linkedColumns' => array('entity_id'),
'isRecurringEntityRecord' => TRUE,
),
array(
- 'table' => 'civicrm_pcp_block',
- 'findCriteria' => array(
- 'entity_id' => $this->_id,
+ 'table' => 'civicrm_pcp_block',
+ 'findCriteria' => array(
+ 'entity_id' => $this->_id,
'entity_table' => 'civicrm_event',
),
'linkedColumns' => array('entity_id'),
@@ -171,7 +171,7 @@ class CRM_Event_Form_ManageEvent_Repeat extends CRM_Event_Form_ManageEvent {
*/
static public function getParticipantCountforEvent($listOfRelatedEntities = array()) {
if (!empty($listOfRelatedEntities)) {
- $implodeRelatedEntities = implode(',', array_map(function($entity) {
+ $implodeRelatedEntities = implode(',', array_map(function ($entity) {
return $entity['id'];
}, $listOfRelatedEntities));
if ($implodeRelatedEntities) {
diff --git a/CRM/Event/Form/ManageEvent/TabHeader.php b/CRM/Event/Form/ManageEvent/TabHeader.php
index edd9177eea..54198ece0a 100644
--- a/CRM/Event/Form/ManageEvent/TabHeader.php
+++ b/CRM/Event/Form/ManageEvent/TabHeader.php
@@ -53,9 +53,10 @@ class CRM_Event_Form_ManageEvent_TabHeader {
CRM_Core_Resources::singleton()
->addScriptFile('civicrm', 'templates/CRM/common/TabHeader.js', 1, 'html-header')
->addSetting(array(
- 'tabSettings' => array(
- 'active' => self::getCurrentTab($tabs),
- )));
+ 'tabSettings' => array(
+ 'active' => self::getCurrentTab($tabs),
+ )
+ ));
CRM_Event_Form_ManageEvent::addProfileEditScripts();
return $tabs;
}
@@ -148,9 +149,9 @@ WHERE e.id = %1
CRM_Utils_Hook::tabset('civicrm/event/manage', $tabs,
array('event_id' => $eventID));
- $fullName = $form->getVar('_name');
+ $fullName = $form->getVar('_name');
$className = CRM_Utils_String::getClassName($fullName);
- $new = '';
+ $new = '';
// hack for special cases.
switch ($className) {
diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php
index 4a247eca19..a750a12532 100644
--- a/CRM/Event/Form/Participant.php
+++ b/CRM/Event/Form/Participant.php
@@ -200,9 +200,9 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
$this->assign('feeBlockPaid', FALSE);
$this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
- $this->_mode = CRM_Utils_Request::retrieve('mode', 'String', $this);
- $this->_eID = CRM_Utils_Request::retrieve('eid', 'Positive', $this);
- $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this);
+ $this->_mode = CRM_Utils_Request::retrieve('mode', 'String', $this);
+ $this->_eID = CRM_Utils_Request::retrieve('eid', 'Positive', $this);
+ $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this);
$this->assign('context', $this->_context);
if ($this->_contactId) {
@@ -220,7 +220,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
if (
strpos($path, 'civicrm/contact/search') === 0 ||
strpos($path, 'civicrm/group/search') === 0
- ) {
+ ) {
$this->_id = NULL;
}
else {
@@ -286,18 +286,20 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
$this->_single = TRUE;
$this->assign('urlPath', 'civicrm/contact/view/participant');
if (!$this->_id && !$this->_contactId) {
- $breadCrumbs = array(array(
- 'title' => ts('CiviEvent Dashboard'),
+ $breadCrumbs = array(
+ array(
+ 'title' => ts('CiviEvent Dashboard'),
'url' => CRM_Utils_System::url('civicrm/event', 'reset=1'),
- ));
+ )
+ );
CRM_Utils_System::appendBreadCrumb($breadCrumbs);
}
}
else {
//set the appropriate action
- $context = $this->get('context');
- $urlString = 'civicrm/contact/search';
+ $context = $this->get('context');
+ $urlString = 'civicrm/contact/search';
$this->_action = CRM_Core_Action::BASIC;
switch ($context) {
case 'advanced':
@@ -530,7 +532,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
list($defaults[$this->_id]['register_date'],
$defaults[$this->_id]['register_date_time']
- ) = CRM_Utils_Date::setDateDefaults(
+ ) = CRM_Utils_Date::setDateDefaults(
CRM_Utils_Array::value('register_date', $defaults[$this->_id]), 'activityDateTime'
);
@@ -614,7 +616,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
)) - 1;
if ($additionalParticipant) {
$deleteParticipants = array(
- 1 => ts('Delete this participant record along with associated participant record(s).'),
+ 1 => ts('Delete this participant record along with associated participant record(s).'),
2 => ts('Delete only this participant record.'),
);
$this->addRadio('delete_participant', NULL, $deleteParticipants, NULL, '
');
@@ -639,7 +641,10 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
}
if ($this->_single && $this->_context == 'standalone') {
- $this->addEntityRef('contact_id', ts('Contact'), array('create' => TRUE, 'api' => array('extra' => array('email'))), TRUE);
+ $this->addEntityRef('contact_id', ts('Contact'), array(
+ 'create' => TRUE,
+ 'api' => array('extra' => array('email'))
+ ), TRUE);
}
$eventFieldParams = array(
@@ -661,8 +666,9 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
//frozen the field fix for CRM-4171
if ($this->_action & CRM_Core_Action::UPDATE && $this->_id) {
if (CRM_Core_DAO::getFieldValue('CRM_Event_DAO_ParticipantPayment',
- $this->_id, 'contribution_id', 'participant_id'
- )) {
+ $this->_id, 'contribution_id', 'participant_id'
+ )
+ ) {
$element->freeze();
}
}
@@ -698,7 +704,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
);
$checkCancelledJs = array(
'onchange' =>
- "checkCancelled( this.value, {$cancelledparticipantStatusId},{$cancelledContributionStatusId});",
+ "checkCancelled( this.value, {$cancelledparticipantStatusId},{$cancelledContributionStatusId});",
);
$participantStatusId = array_search('Pending from pay later',
@@ -734,7 +740,10 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
}
}
- $this->addSelect('status_id', $checkCancelledJs + array('options' => $statusOptions, 'option_url' => 'civicrm/admin/participant_status'), TRUE);
+ $this->addSelect('status_id', $checkCancelledJs + array(
+ 'options' => $statusOptions,
+ 'option_url' => 'civicrm/admin/participant_status'
+ ), TRUE);
$this->addElement('checkbox', 'is_notify', ts('Send Notification'), NULL);
@@ -996,7 +1005,8 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
$params['fee_level'] = $params['amount_level'];
$contributionParams['total_amount'] = $params['amount'];
if ($this->_quickConfig && !empty($params['total_amount']) &&
- $params['status_id'] != array_search('Partially paid', $participantStatus)) {
+ $params['status_id'] != array_search('Partially paid', $participantStatus)
+ ) {
$params['fee_amount'] = $params['total_amount'];
}
else {
@@ -1009,8 +1019,8 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
if (!empty($lineItem[0])) {
$this->set('lineItem', $lineItem);
- $this->_lineItem = $lineItem;
- $lineItem = array_merge($lineItem, $additionalParticipantDetails);
+ $this->_lineItem = $lineItem;
+ $lineItem = array_merge($lineItem, $additionalParticipantDetails);
$participantCount = array();
foreach ($lineItem as $k) {
@@ -1051,7 +1061,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
$userID = $session->get('userID');
list($userName,
$userEmail
- ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($userID);
+ ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($userID);
if ($this->_contactId) {
list($this->_contributorDisplayName, $this->_contributorEmail, $this->_toDoNotEmail) = CRM_Contact_BAO_Contact::getContactDetails($this->_contactId);
@@ -1078,7 +1088,10 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
// set source if not set
if (empty($params['source'])) {
- $this->_params['participant_source'] = ts('Offline Registration for Event: %2 by: %1', array(1 => $userName, 2 => $eventTitle));
+ $this->_params['participant_source'] = ts('Offline Registration for Event: %2 by: %1', array(
+ 1 => $userName,
+ 2 => $eventTitle
+ ));
}
else {
$this->_params['participant_source'] = $params['source'];
@@ -1192,8 +1205,8 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
if (is_a($result, 'CRM_Core_Error')) {
CRM_Core_Error::displaySessionError($result);
CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contact/view/participant',
- "reset=1&action=add&cid={$this->_contactId}&context=participant&mode={$this->_mode}"
- ));
+ "reset=1&action=add&cid={$this->_contactId}&context=participant&mode={$this->_mode}"
+ ));
}
if ($result) {
@@ -1308,7 +1321,10 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
//build contribution params
if (!$this->_onlinePendingContributionId) {
if (empty($params['source'])) {
- $contributionParams['source'] = ts('%1 : Offline registration (by %2)', array(1 => $eventTitle, 2 => $userName));
+ $contributionParams['source'] = ts('%1 : Offline registration (by %2)', array(
+ 1 => $eventTitle,
+ 2 => $userName
+ ));
}
else {
$contributionParams['source'] = $params['source'];
@@ -1319,10 +1335,15 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
$contributionParams['non_deductible_amount'] = 'null';
$contributionParams['receipt_date'] = !empty($params['send_receipt']) ? CRM_Utils_Array::value('receive_date', $params) : 'null';
- $recordContribution = array('contact_id', 'financial_type_id',
- 'payment_instrument_id', 'trxn_id',
- 'contribution_status_id', 'receive_date',
- 'check_number', 'campaign_id',
+ $recordContribution = array(
+ 'contact_id',
+ 'financial_type_id',
+ 'payment_instrument_id',
+ 'trxn_id',
+ 'contribution_status_id',
+ 'receive_date',
+ 'check_number',
+ 'campaign_id',
);
foreach ($recordContribution as $f) {
@@ -1442,7 +1463,8 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
$updateStatusMsg = NULL;
//send mail when participant status changed, CRM-4326
if ($this->_id && $this->_statusId &&
- $this->_statusId != CRM_Utils_Array::value('status_id', $params) && !empty($params['is_notify'])) {
+ $this->_statusId != CRM_Utils_Array::value('status_id', $params) && !empty($params['is_notify'])
+ ) {
$updateStatusMsg = CRM_Event_BAO_Participant::updateStatusMessage($this->_id,
$params['status_id'],
@@ -1672,8 +1694,8 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
$template = CRM_Core_Smarty::singleton();
$taxAmt = $template->get_template_vars('dataArray');
$contributionId = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_ParticipantPayment',
- $this->_id, 'contribution_id', 'participant_id'
- );
+ $this->_id, 'contribution_id', 'participant_id'
+ );
$prefixValue = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
$invoicing = CRM_Utils_Array::value('invoicing', $prefixValue);
if (count($taxAmt) > 0 && (isset($invoicing) && isset($prefixValue['is_email_pdf']))) {
@@ -1745,14 +1767,14 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
}
else {
$session->replaceUserContext(CRM_Utils_System::url('civicrm/contact/view',
- "reset=1&cid={$this->_contactId}&selectedChild=participant"
- ));
+ "reset=1&cid={$this->_contactId}&selectedChild=participant"
+ ));
}
}
elseif ($buttonName == $this->getButtonName('upload', 'new')) {
$session->replaceUserContext(CRM_Utils_System::url('civicrm/contact/view/participant',
- "reset=1&action=add&context={$this->_context}&cid={$this->_contactId}"
- ));
+ "reset=1&action=add&context={$this->_context}&cid={$this->_contactId}"
+ ));
}
}
}
diff --git a/CRM/Event/Form/ParticipantFeeSelection.php b/CRM/Event/Form/ParticipantFeeSelection.php
index 44eafbc624..0e0be7404a 100644
--- a/CRM/Event/Form/ParticipantFeeSelection.php
+++ b/CRM/Event/Form/ParticipantFeeSelection.php
@@ -181,7 +181,8 @@ class CRM_Event_Form_ParticipantFeeSelection extends CRM_Core_Form {
$statusOptions = CRM_Event_PseudoConstant::participantStatus(NULL, NULL, 'label');
$this->add('select', 'status_id', ts('Participant Status'),
array(
- '' => ts('- select -')) + $statusOptions,
+ '' => ts('- select -')
+ ) + $statusOptions,
TRUE
);
@@ -265,8 +266,8 @@ class CRM_Event_Form_ParticipantFeeSelection extends CRM_Core_Form {
if ($buttonName == $this->getButtonName('upload', 'new')) {
$session = CRM_Core_Session::singleton();
$session->pushUserContext(CRM_Utils_System::url('civicrm/payment/add',
- "reset=1&action=add&component=event&id={$this->_participantId}&cid={$this->_contactId}"
- ));
+ "reset=1&action=add&component=event&id={$this->_participantId}&cid={$this->_contactId}"
+ ));
}
}
diff --git a/CRM/Event/Form/ParticipantView.php b/CRM/Event/Form/ParticipantView.php
index 43510502fe..e14f071acb 100644
--- a/CRM/Event/Form/ParticipantView.php
+++ b/CRM/Event/Form/ParticipantView.php
@@ -47,10 +47,10 @@ class CRM_Event_Form_ParticipantView extends CRM_Core_Form {
* @return void
*/
public function preProcess() {
- $values = $ids = array();
+ $values = $ids = array();
$participantID = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE);
- $contactID = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
- $params = array('id' => $participantID);
+ $contactID = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
+ $params = array('id' => $participantID);
CRM_Event_BAO_Participant::getValues($params,
$values,
@@ -76,8 +76,9 @@ class CRM_Event_Form_ParticipantView extends CRM_Core_Form {
$this->assign('hasPayment', $paymentId);
if ($parentParticipantId = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Participant',
- $participantID, 'registered_by_id'
- )) {
+ $participantID, 'registered_by_id'
+ )
+ ) {
$parentHasPayment = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_ParticipantPayment',
$parentParticipantId, 'id', 'participant_id'
);
@@ -132,11 +133,11 @@ class CRM_Event_Form_ParticipantView extends CRM_Core_Form {
$eventGroupTree = &CRM_Core_BAO_CustomGroup::getTree('Participant', $this, $participantID, NULL,
$values[$participantID]['event_id'], $eventNameCustomDataTypeID
);
- $eventTypeID = CRM_Core_DAO::getFieldValue("CRM_Event_DAO_Event", $values[$participantID]['event_id'], 'event_type_id', 'id');
+ $eventTypeID = CRM_Core_DAO::getFieldValue("CRM_Event_DAO_Event", $values[$participantID]['event_id'], 'event_type_id', 'id');
$eventTypeGroupTree = CRM_Core_BAO_CustomGroup::getTree('Participant', $this, $participantID, NULL, $eventTypeID, $eventTypeCustomDataTypeID);
- $groupTree = CRM_Utils_Array::crmArrayMerge($roleGroupTree, $eventGroupTree);
- $groupTree = CRM_Utils_Array::crmArrayMerge($groupTree, $eventTypeGroupTree);
- $groupTree = CRM_Utils_Array::crmArrayMerge($groupTree, CRM_Core_BAO_CustomGroup::getTree('Participant', $this, $participantID));
+ $groupTree = CRM_Utils_Array::crmArrayMerge($roleGroupTree, $eventGroupTree);
+ $groupTree = CRM_Utils_Array::crmArrayMerge($groupTree, $eventTypeGroupTree);
+ $groupTree = CRM_Utils_Array::crmArrayMerge($groupTree, CRM_Core_BAO_CustomGroup::getTree('Participant', $this, $participantID));
foreach ($groupTree as $treeId => $trees) {
$finalTree[$treeId] = $trees;
}
diff --git a/CRM/Event/Form/Registration.php b/CRM/Event/Form/Registration.php
index d901357cf4..e58bfb6c5d 100644
--- a/CRM/Event/Form/Registration.php
+++ b/CRM/Event/Form/Registration.php
@@ -346,7 +346,7 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
);
list($this->_values['custom_pre_id'],
$this->_values['custom_post_id']
- ) = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
+ ) = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
// set profiles for additional participants
if ($this->_values['event']['is_multiple_registrations']) {
@@ -355,7 +355,7 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
list($this->_values['additional_custom_pre_id'],
$this->_values['additional_custom_post_id'], $preActive, $postActive
- ) = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
+ ) = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
// CRM-4377: we need to maintain backward compatibility, hence if there is profile for main contact
// set same profile for additional contacts.
@@ -429,8 +429,8 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
// Handle PCP
$pcpId = CRM_Utils_Request::retrieve('pcpId', 'Positive', $this);
if ($pcpId) {
- $pcp = CRM_PCP_BAO_PCP::handlePcp($pcpId, 'event', $this->_values['event']);
- $this->_pcpId = $pcp['pcpId'];
+ $pcp = CRM_PCP_BAO_PCP::handlePcp($pcpId, 'event', $this->_values['event']);
+ $this->_pcpId = $pcp['pcpId'];
$this->_values['event']['intro_text'] = CRM_Utils_Array::value('intro_text', $pcp['pcpInfo']);
}
@@ -485,8 +485,12 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
$this->set('name', $name);
$vars = array(
- 'amount', 'currencyID', 'credit_card_type',
- 'trxn_id', 'amount_level', 'receive_date',
+ 'amount',
+ 'currencyID',
+ 'credit_card_type',
+ 'trxn_id',
+ 'amount_level',
+ 'receive_date',
);
foreach ($vars as $v) {
@@ -564,9 +568,9 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
*/
public function buildCustom($id, $name, $viewOnly = FALSE) {
if ($id) {
- $button = substr($this->controller->getButtonName(), -4);
- $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
- $session = CRM_Core_Session::singleton();
+ $button = substr($this->controller->getButtonName(), -4);
+ $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
+ $session = CRM_Core_Session::singleton();
$contactID = $session->get('userID');
// we don't allow conflicting fields to be
@@ -637,7 +641,7 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
$field['is_required'] = FALSE;
}
// CRM-11316 Is ReCAPTCHA enabled for this profile AND is this an anonymous visitor
- elseif ($field['add_captcha'] && !$contactID) {
+ elseif ($field['add_captcha'] && !$contactID) {
// only add captcha for first page
$addCaptcha = TRUE;
}
@@ -679,7 +683,8 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
}
if (property_exists($form, '_context') && ($form->_context == 'standalone'
- || $form->_context == 'participant')) {
+ || $form->_context == 'participant')
+ ) {
$discountedEvent = CRM_Core_BAO_Discount::getOptionGroup($eventID, 'civicrm_event');
if (is_array($discountedEvent)) {
foreach ($discountedEvent as $key => $priceSetId) {
@@ -790,7 +795,7 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
$this->_params['contactID'] = $contactID;
if (array_key_exists('email-5', $this->_params)) {
- $mail = 'email-5';
+ $mail = 'email-5';
}
else {
foreach ($this->_params as $name => $dontCare) {
@@ -807,7 +812,8 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
// 3. waiting list participant.
// 4. require approval participant.
if (!empty($this->_params['is_pay_later']) ||
- $this->_allowWaitlist || $this->_requireApproval || empty($this->_values['event']['is_monetary'])) {
+ $this->_allowWaitlist || $this->_requireApproval || empty($this->_values['event']['is_monetary'])
+ ) {
$mail = 'email-Primary';
}
@@ -944,9 +950,9 @@ WHERE v.option_group_id = g.id
return $totalCount;
}
- $priceSetId = $form->get('priceSetId');
- $addParticipantNum = substr($form->_name, 12);
- $priceSetFields = $priceSetDetails = array();
+ $priceSetId = $form->get('priceSetId');
+ $addParticipantNum = substr($form->_name, 12);
+ $priceSetFields = $priceSetDetails = array();
$hasPriceFieldsCount = FALSE;
if ($priceSetId) {
$priceSetDetails = $form->get('priceSet');
@@ -1088,8 +1094,8 @@ WHERE v.option_group_id = g.id
* @return array
*/
public static function getPriceSetOptionCount(&$form) {
- $params = $form->get('params');
- $priceSet = $form->get('priceSet');
+ $params = $form->get('params');
+ $priceSet = $form->get('priceSet');
$priceSetId = $form->get('priceSetId');
$optionsCount = array();
@@ -1345,9 +1351,9 @@ WHERE v.option_group_id = g.id
// also set the allow confirmation stuff
if (array_key_exists(
- $this->_values['participant']['status_id'],
- CRM_Event_PseudoConstant::participantStatus(NULL, "class = 'Pending'")
- )) {
+ $this->_values['participant']['status_id'],
+ CRM_Event_PseudoConstant::participantStatus(NULL, "class = 'Pending'")
+ )) {
$this->_allowConfirmation = TRUE;
$this->set('allowConfirmation', TRUE);
}
@@ -1379,8 +1385,8 @@ WHERE v.option_group_id = g.id
$now = date('YmdHis');
$startDate = CRM_Utils_Date::processDate(CRM_Utils_Array::value('registration_start_date',
- $this->_values['event']
- ));
+ $this->_values['event']
+ ));
if (
$startDate &&
@@ -1390,8 +1396,8 @@ WHERE v.option_group_id = g.id
}
$endDate = CRM_Utils_Date::processDate(CRM_Utils_Array::value('registration_end_date',
- $this->_values['event']
- ));
+ $this->_values['event']
+ ));
$eventEndDate = CRM_Utils_Date::processDate(CRM_Utils_Array::value('event_end_date', $this->_values['event']));
if (
$endDate &&
diff --git a/CRM/Event/Form/Registration/AdditionalParticipant.php b/CRM/Event/Form/Registration/AdditionalParticipant.php
index 9b86dfcd3c..e69ae49be0 100644
--- a/CRM/Event/Form/Registration/AdditionalParticipant.php
+++ b/CRM/Event/Form/Registration/AdditionalParticipant.php
@@ -130,9 +130,9 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
//CRM-4320, setdefault additional participant values.
if ($this->_allowConfirmation && $this->_additionalParticipantId) {
//hack to get set default from eventFees.php
- $this->_discountId = $discountId;
- $this->_pId = $this->_additionalParticipantId;
- $this->_contactId = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Participant', $this->_additionalParticipantId, 'contact_id');
+ $this->_discountId = $discountId;
+ $this->_pId = $this->_additionalParticipantId;
+ $this->_contactId = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Participant', $this->_additionalParticipantId, 'contact_id');
$participantDefaults = CRM_Event_Form_EventFees::setDefaultValues($this);
$participantDefaults = array_merge($this->_defaults, $participantDefaults);
// use primary email address if billing email address is empty
@@ -177,13 +177,17 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
$first_name = $last_name = NULL;
$pre = $post = array();
foreach (array(
- 'pre', 'post') as $keys) {
+ 'pre',
+ 'post'
+ ) as $keys) {
if (isset($this->_values['additional_custom_' . $keys . '_id'])) {
$this->buildCustom($this->_values['additional_custom_' . $keys . '_id'], 'additionalCustom' . ucfirst($keys), TRUE);
$$keys = CRM_Core_BAO_UFGroup::getFields($this->_values['additional_custom_' . $keys . '_id']);
}
foreach (array(
- 'first_name', 'last_name') as $name) {
+ 'first_name',
+ 'last_name'
+ ) as $name) {
if (array_key_exists($name, $$keys) &&
CRM_Utils_Array::value('is_required', CRM_Utils_Array::value($name, $$keys))
) {
@@ -252,14 +256,23 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
$this->_allowWaitlist = FALSE;
$this->set('allowWaitlist', $this->_allowWaitlist);
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));
+ $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
+ ));
}
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));
+ $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
+ ));
}
}
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));
+ $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
+ ));
$allowToProceed = FALSE;
}
CRM_Core_Session::setStatus($statusMessage, ts('Registration Error'), 'error');
@@ -336,7 +349,7 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
//CRM-4320
if ($allowToProceed) {
$buttons = array_merge($buttons, array(
- array(
+ array(
'type' => 'next',
'name' => ts('Continue'),
'spacing' => ' ',
@@ -347,12 +360,13 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
);
if ($includeSkipButton) {
$buttons = array_merge($buttons, array(
- array(
- 'type' => 'next',
- 'name' => ts('Skip Participant'),
- 'subName' => 'skip',
- 'icon' => 'seek-next',
- ))
+ array(
+ 'type' => 'next',
+ 'name' => ts('Skip Participant'),
+ 'subName' => 'skip',
+ 'icon' => 'seek-next',
+ )
+ )
);
}
}
@@ -471,7 +485,10 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
if (!$self->_allowConfirmation && empty($self->_values['event']['has_waitlist']) &&
$totalParticipants > $self->_availableRegistrations
) {
- $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));
+ $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
+ ));
}
}
}
@@ -828,7 +845,10 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
return;
}
foreach (array(
- 'constantValues', 'submitValues', 'defaultValues') as $val) {
+ 'constantValues',
+ 'submitValues',
+ 'defaultValues'
+ ) as $val) {
$values = &$this->{"_$val"};
if (!is_array($values) || empty($values)) {
continue;
diff --git a/CRM/Event/Form/Registration/Confirm.php b/CRM/Event/Form/Registration/Confirm.php
index 37997cc45c..b901947c09 100644
--- a/CRM/Event/Form/Registration/Confirm.php
+++ b/CRM/Event/Form/Registration/Confirm.php
@@ -166,7 +166,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
$registerParams["billing_country-{$this->_bltID}"] = CRM_Core_PseudoConstant::countryIsoCode($registerParams["billing_country_id-{$this->_bltID}"]);
}
if (isset($registerParams['credit_card_exp_date'])) {
- $registerParams['year'] = CRM_Core_Payment_Form::getCreditCardExpirationYear($registerParams);
+ $registerParams['year'] = CRM_Core_Payment_Form::getCreditCardExpirationYear($registerParams);
$registerParams['month'] = CRM_Core_Payment_Form::getCreditCardExpirationMonth($registerParams);
}
if ($this->_values['event']['is_monetary']) {
@@ -238,7 +238,9 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
$taxAmount += $v['tax_amount'];
if (is_array($v)) {
foreach (array(
- 'first_name', 'last_name') as $name) {
+ 'first_name',
+ 'last_name'
+ ) as $name) {
if (isset($v['billing_' . $name]) &&
!isset($v[$name])
) {
@@ -416,6 +418,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
}
return empty($errors) ? TRUE : $errors;
}
+
/**
* Process the form submission
*
@@ -423,7 +426,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
* @return void
*/
public function postProcess() {
- $now = date('YmdHis');
+ $now = date('YmdHis');
$this->_params = $this->get('params');
if (!empty($this->_params[0]['contact_id'])) {
@@ -647,7 +650,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
$value['contributionTypeID'] = $contribution->financial_type_id;
}
$value['contactID'] = $contactID;
- $value['eventID'] = $this->_eventId;
+ $value['eventID'] = $this->_eventId;
$value['item_name'] = $value['description'];
}
@@ -827,8 +830,8 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
}
if (!empty($this->_lineItem)) {
- $lineItems = $this->_lineItem;
- $lineItem = array();
+ $lineItems = $this->_lineItem;
+ $lineItem = array();
if ($lineItemValue = CRM_Utils_Array::value($participantNum, $lineItems)) {
$lineItem[] = $lineItemValue;
}
@@ -920,8 +923,8 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
$this->assign('amounts', $amount);
}
if ($this->_lineItem) {
- $lineItems = $this->_lineItem;
- $lineItem = array();
+ $lineItems = $this->_lineItem;
+ $lineItem = array();
if ($lineItemValue = CRM_Utils_Array::value($participantNum, $lineItems)) {
$lineItem[] = $lineItemValue;
}
@@ -961,7 +964,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
) {
$transaction = new CRM_Core_Transaction();
- $now = date('YmdHis');
+ $now = date('YmdHis');
$receiptDate = NULL;
if (!empty($form->_values['event']['is_email_confirm'])) {
@@ -974,7 +977,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
$contribParams = array(
'contact_id' => $contactID,
- 'financial_type_id' => !empty($form->_values['event']['financial_type_id']) ? $form->_values['event']['financial_type_id'] : $params['financial_type_id'],
+ 'financial_type_id' => !empty($form->_values['event']['financial_type_id']) ? $form->_values['event']['financial_type_id'] : $params['financial_type_id'],
'receive_date' => $now,
'total_amount' => $params['amount'],
'tax_amount' => $params['tax_amount'],
@@ -1105,7 +1108,8 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
!$form->_values['event']['is_monetary'] ||
$form->_allowWaitlist ||
$form->_requireApproval
- ) && !empty($params["email-{$form->_bltID}"])) {
+ ) && !empty($params["email-{$form->_bltID}"])
+ ) {
$params['email-Primary'] = $params["email-{$form->_bltID}"];
}
}
@@ -1215,7 +1219,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
public static function assignProfiles(&$form) {
$participantParams = $form->_params;
$formattedValues = $profileFields = array();
- $count = 1;
+ $count = 1;
foreach ($participantParams as $participantNum => $participantValue) {
if ($participantNum) {
$prefix1 = 'additional';
diff --git a/CRM/Event/Form/Registration/ParticipantConfirm.php b/CRM/Event/Form/Registration/ParticipantConfirm.php
index 6d3ca4c6a3..581b48ae34 100644
--- a/CRM/Event/Form/Registration/ParticipantConfirm.php
+++ b/CRM/Event/Form/Registration/ParticipantConfirm.php
@@ -106,12 +106,12 @@ class CRM_Event_Form_Registration_ParticipantConfirm extends CRM_Event_Form_Regi
$statusMsg = NULL;
if (array_key_exists($this->_participantStatusId,
- CRM_Event_PseudoConstant::participantStatus(NULL, "class = 'Pending'")
- )) {
+ CRM_Event_PseudoConstant::participantStatus(NULL, "class = 'Pending'")
+ )) {
//need to confirm that though participant confirming
//registration - but is there enough space to confirm.
- $emptySeats = CRM_Event_BAO_Participant::pendingToConfirmSpaces($this->_eventId);
+ $emptySeats = CRM_Event_BAO_Participant::pendingToConfirmSpaces($this->_eventId);
$additonalIds = CRM_Event_BAO_Participant::getAdditionalParticipantIds($this->_participantId);
$requireSpace = 1 + count($additonalIds);
if ($emptySeats !== NULL && ($requireSpace > $emptySeats)) {
@@ -120,34 +120,38 @@ class CRM_Event_Form_Registration_ParticipantConfirm extends CRM_Event_Form_Regi
else {
if ($this->_cc == 'fail') {
$statusMsg = '
' . ts('Your Credit Card transaction was not successful. No money has yet been charged to your card.') . '
' . ts('Click the "Confirm Registration" button to complete your registration in %1, or click "Cancel Registration" if you are no longer interested in attending this event.', array(
- 1 => $values['title'])) . '
';
+ 1 => $values['title']
+ )) . '
';
}
else {
$statusMsg = '' . ts('Confirm your registration for %1.', array(
- 1 => $values['title'])) . '