From c5c263cabdd47a41f44c6a39a81e212d69616ea1 Mon Sep 17 00:00:00 2001 From: Andrew Hunt Date: Mon, 22 Feb 2016 20:30:26 -0500 Subject: [PATCH] style fixes based upon updated phpcs Drupal standard --- CRM/Activity/Form/Activity.php | 23 +++-- CRM/Activity/Form/Task.php | 21 +++-- CRM/Activity/Form/Task/Batch.php | 21 +++-- CRM/Activity/Form/Task/PickOption.php | 6 +- CRM/Activity/Form/Task/PickProfile.php | 6 +- CRM/Activity/Form/Task/Print.php | 23 +++-- CRM/Activity/Form/Task/RemoveFromTag.php | 12 +-- .../Form/Task/SearchTaskHookSample.php | 13 ++- CRM/Activity/Page/AJAX.php | 6 +- CRM/Dedupe/Finder.php | 6 +- CRM/Dedupe/Merger.php | 6 +- CRM/Member/BAO/Membership.php | 15 ++-- CRM/Member/BAO/MembershipPayment.php | 8 +- CRM/Member/BAO/MembershipType.php | 22 ++--- CRM/Member/Form.php | 73 ++++++++-------- CRM/Member/Form/Membership.php | 29 +++---- CRM/Member/Form/MembershipBlock.php | 31 ++++--- CRM/Member/Form/MembershipConfig.php | 73 ++++++++-------- CRM/Member/Form/MembershipRenewal.php | 4 +- CRM/Member/Form/MembershipView.php | 15 ++-- CRM/Member/Form/Task.php | 21 +++-- CRM/Member/Form/Task/Batch.php | 21 +++-- CRM/Member/Form/Task/Label.php | 6 +- CRM/Member/Form/Task/PickProfile.php | 6 +- CRM/Member/Form/Task/Print.php | 23 +++-- CRM/Member/Form/Task/Result.php | 13 ++- CRM/Member/Form/Task/SearchTaskHookSample.php | 13 ++- CRM/Member/Import/Form/MapField.php | 35 ++++---- CRM/Member/Import/Parser.php | 24 ++---- CRM/Member/Page/Tab.php | 13 ++- CRM/Member/Page/UserDashboard.php | 6 +- CRM/Member/Tokens.php | 3 +- CRM/Price/BAO/PriceField.php | 14 +-- CRM/Price/BAO/PriceSet.php | 3 +- CRM/Price/Form/DeleteField.php | 21 +++-- CRM/Price/Form/DeleteSet.php | 21 +++-- CRM/Price/Form/Field.php | 31 ++++--- CRM/Price/Form/Option.php | 58 ++++++------- CRM/Price/Form/Preview.php | 13 ++- CRM/Price/Form/Set.php | 33 ++++--- CRM/Profile/Form.php | 24 +++--- CRM/Profile/Form/Dynamic.php | 13 ++- CRM/Profile/Page/Dynamic.php | 2 +- CRM/Profile/Page/Listings.php | 3 +- .../Page/MultipleRecordFieldsListing.php | 2 +- CRM/SMS/Form/Group.php | 14 +-- CRM/SMS/Form/Provider.php | 27 +++--- CRM/SMS/Form/Upload.php | 2 +- CRM/UF/Form/Field.php | 86 +++++++++---------- CRM/UF/Form/Group.php | 46 +++++----- CRM/UF/Form/Preview.php | 13 ++- CRM/UF/Page/ProfileEditor.php | 9 +- 52 files changed, 498 insertions(+), 534 deletions(-) diff --git a/CRM/Activity/Form/Activity.php b/CRM/Activity/Form/Activity.php index 257fe7d5ff..1d56c70888 100644 --- a/CRM/Activity/Form/Activity.php +++ b/CRM/Activity/Form/Activity.php @@ -767,18 +767,17 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { ); $js = array('onclick' => "return activityStatus(" . json_encode($message) . ");"); $this->addButtons(array( - array( - 'type' => 'upload', - 'name' => ts('Save'), - 'js' => $js, - 'isDefault' => TRUE, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); + array( + 'type' => 'upload', + 'name' => ts('Save'), + 'js' => $js, + 'isDefault' => TRUE, + ), + array( + 'type' => 'cancel', + 'name' => ts('Cancel'), + ), + )); } if ($this->_activityTypeFile) { diff --git a/CRM/Activity/Form/Task.php b/CRM/Activity/Form/Task.php index f359020924..c2a755dee3 100644 --- a/CRM/Activity/Form/Task.php +++ b/CRM/Activity/Form/Task.php @@ -192,17 +192,16 @@ WHERE activity_id IN ( $IDs ) AND */ public function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { $this->addButtons(array( - array( - 'type' => $nextType, - 'name' => $title, - 'isDefault' => TRUE, - ), - array( - 'type' => $backType, - 'name' => ts('Cancel'), - ), - ) - ); + array( + 'type' => $nextType, + 'name' => $title, + 'isDefault' => TRUE, + ), + array( + 'type' => $backType, + 'name' => ts('Cancel'), + ), + )); } } diff --git a/CRM/Activity/Form/Task/Batch.php b/CRM/Activity/Form/Task/Batch.php index 9f56da6064..3d44c27b24 100644 --- a/CRM/Activity/Form/Task/Batch.php +++ b/CRM/Activity/Form/Task/Batch.php @@ -125,17 +125,16 @@ class CRM_Activity_Form_Task_Batch extends CRM_Activity_Form_Task { $this->_fields = array_slice($this->_fields, 0, $this->_maxFields); $this->addButtons(array( - array( - 'type' => 'submit', - 'name' => ts('Update Activities'), - 'isDefault' => TRUE, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); + array( + 'type' => 'submit', + 'name' => ts('Update Activities'), + 'isDefault' => TRUE, + ), + array( + 'type' => 'cancel', + 'name' => ts('Cancel'), + ), + )); $this->assign('profileTitle', $this->_title); $this->assign('componentIds', $this->_activityHolderIds); diff --git a/CRM/Activity/Form/Task/PickOption.php b/CRM/Activity/Form/Task/PickOption.php index 1d3af3d06f..e81b27b8db 100644 --- a/CRM/Activity/Form/Task/PickOption.php +++ b/CRM/Activity/Form/Task/PickOption.php @@ -74,9 +74,9 @@ class CRM_Activity_Form_Task_PickOption extends CRM_Activity_Form_Task { //validations if (count($this->_activityHolderIds) > $this->_maxActivities) { CRM_Core_Session::setStatus(ts("The maximum number of Activities you can select to send an email is %1. You have selected %2. Please select fewer Activities from your search results and try again.", array( - 1 => $this->_maxActivities, - 2 => count($this->_activityHolderIds), - )), ts("Maximum Exceeded"), "error"); + 1 => $this->_maxActivities, + 2 => count($this->_activityHolderIds), + )), ts("Maximum Exceeded"), "error"); $validate = TRUE; } // then redirect diff --git a/CRM/Activity/Form/Task/PickProfile.php b/CRM/Activity/Form/Task/PickProfile.php index ae2cbc55d6..d310764ac9 100644 --- a/CRM/Activity/Form/Task/PickProfile.php +++ b/CRM/Activity/Form/Task/PickProfile.php @@ -69,9 +69,9 @@ class CRM_Activity_Form_Task_PickProfile extends CRM_Activity_Form_Task { // Validations. if (count($this->_activityHolderIds) > $this->_maxActivities) { CRM_Core_Session::setStatus(ts("The maximum number of activities you can select for Update multiple activities is %1. You have selected %2. Please select fewer Activities from your search results and try again.", array( - 1 => $this->_maxActivities, - 2 => count($this->_activityHolderIds), - )), ts('Maximum Exceeded'), 'error'); + 1 => $this->_maxActivities, + 2 => count($this->_activityHolderIds), + )), ts('Maximum Exceeded'), 'error'); $validate = TRUE; } diff --git a/CRM/Activity/Form/Task/Print.php b/CRM/Activity/Form/Task/Print.php index 4ecf118db4..f746334083 100644 --- a/CRM/Activity/Form/Task/Print.php +++ b/CRM/Activity/Form/Task/Print.php @@ -72,18 +72,17 @@ class CRM_Activity_Form_Task_Print extends CRM_Activity_Form_Task { // just need to add a javacript to popup the window for printing $this->addButtons(array( - array( - 'type' => 'next', - 'name' => ts('Print Activities'), - 'js' => array('onclick' => 'window.print()'), - 'isDefault' => TRUE, - ), - array( - 'type' => 'back', - 'name' => ts('Done'), - ), - ) - ); + array( + 'type' => 'next', + 'name' => ts('Print Activities'), + 'js' => array('onclick' => 'window.print()'), + 'isDefault' => TRUE, + ), + array( + 'type' => 'back', + 'name' => ts('Done'), + ), + )); } } diff --git a/CRM/Activity/Form/Task/RemoveFromTag.php b/CRM/Activity/Form/Task/RemoveFromTag.php index 3c3c305b85..b3a5d98216 100644 --- a/CRM/Activity/Form/Task/RemoveFromTag.php +++ b/CRM/Activity/Form/Task/RemoveFromTag.php @@ -129,15 +129,15 @@ class CRM_Activity_Form_Task_RemoveFromTag extends CRM_Activity_Form_Task { $status = array( ts('%count activity un-tagged', array( - 'count' => $removed, - 'plural' => '%count activities un-tagged', - )), + 'count' => $removed, + 'plural' => '%count activities un-tagged', + )), ); if ($notRemoved) { $status[] = ts('1 activity already did not have this tag', array( - 'count' => $notRemoved, - 'plural' => '%count activities already did not have this tag', - )); + 'count' => $notRemoved, + 'plural' => '%count activities already did not have this tag', + )); } $status = ''; CRM_Core_Session::setStatus($status, ts("Removed Tag %1", array(1 => $this->_tags[$key])), 'success', array('expires' => 0)); diff --git a/CRM/Activity/Form/Task/SearchTaskHookSample.php b/CRM/Activity/Form/Task/SearchTaskHookSample.php index 51b036d393..f7da94a4d4 100644 --- a/CRM/Activity/Form/Task/SearchTaskHookSample.php +++ b/CRM/Activity/Form/Task/SearchTaskHookSample.php @@ -80,13 +80,12 @@ INNER JOIN civicrm_contact ct ON ( ac.contact_id = ct.id ) */ public function buildQuickForm() { $this->addButtons(array( - array( - 'type' => 'done', - 'name' => ts('Done'), - 'isDefault' => TRUE, - ), - ) - ); + array( + 'type' => 'done', + 'name' => ts('Done'), + 'isDefault' => TRUE, + ), + )); } } diff --git a/CRM/Activity/Page/AJAX.php b/CRM/Activity/Page/AJAX.php index 8182a2e6a1..efb7415622 100644 --- a/CRM/Activity/Page/AJAX.php +++ b/CRM/Activity/Page/AJAX.php @@ -271,7 +271,7 @@ class CRM_Activity_Page_AJAX { $contactType = $contactType == 'Contact' ? '' : $contactType; switch ($row['source']) { case 'caseRel': - $row['actions'] = '' . + $row['actions'] = '' . '' . '' . '' . @@ -368,8 +368,8 @@ class CRM_Activity_Page_AJAX { } else { $otherActivity->subject = ts('(Filed on case %1)', array( - 1 => $params['caseID'], - )) . ' ' . $otherActivity->subject; + 1 => $params['caseID'], + )) . ' ' . $otherActivity->subject; } $otherActivity->activity_date_time = $actDateTime; $otherActivity->save(); diff --git a/CRM/Dedupe/Finder.php b/CRM/Dedupe/Finder.php index 3d083c76b3..18d59de52d 100644 --- a/CRM/Dedupe/Finder.php +++ b/CRM/Dedupe/Finder.php @@ -235,9 +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])) { diff --git a/CRM/Dedupe/Merger.php b/CRM/Dedupe/Merger.php index 457f12096e..6fba6f79b9 100644 --- a/CRM/Dedupe/Merger.php +++ b/CRM/Dedupe/Merger.php @@ -439,7 +439,8 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m $eidRefs = self::eidRefs(); $cpTables = self::cpTables(); $paymentTables = self::paymentTables(); - $membershipMerge = FALSE; // CRM-12695 + // CRM-12695: + $membershipMerge = FALSE; $affected = array_merge(array_keys($cidRefs), array_keys($eidRefs)); if ($tables !== FALSE) { @@ -467,8 +468,9 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m // retrieve main contact's related table(s) $activeMainRelTables = CRM_Dedupe_Merger::getActiveRelTables($mainId); // check if membership table exists in main contact's related table(s) + // set membership flag - CRM-12695 if (in_array('rel_table_memberships', $activeMainRelTables)) { - $membershipMerge = TRUE; // set membership flag - CRM-12695 + $membershipMerge = TRUE; } } diff --git a/CRM/Member/BAO/Membership.php b/CRM/Member/BAO/Membership.php index 3d79545be5..93052afcea 100644 --- a/CRM/Member/BAO/Membership.php +++ b/CRM/Member/BAO/Membership.php @@ -531,9 +531,9 @@ class CRM_Member_BAO_Membership extends CRM_Member_DAO_Membership { //get the membership status and type values. $statusANDType = self::getStatusANDTypeValues($membership->id); foreach (array( - 'status', - 'membership_type', - ) as $fld) { + 'status', + 'membership_type', + ) as $fld) { $defaults[$fld] = CRM_Utils_Array::value($fld, $statusANDType[$membership->id]); } if (!empty($statusANDType[$membership->id]['is_current_member'])) { @@ -1832,11 +1832,10 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND //1. membership with status : PENDING/CANCELLED (CRM-2395) //2. Paylater/IPN renew. CRM-4556. if ($pending || in_array($currentMembership['status_id'], array( - array_search('Pending', $allStatus), - // CRM-15475 - array_search('Cancelled', CRM_Member_PseudoConstant::membershipStatus(NULL, " name = 'Cancelled' ", 'name', FALSE, TRUE)), - )) - ) { + array_search('Pending', $allStatus), + // CRM-15475 + array_search('Cancelled', CRM_Member_PseudoConstant::membershipStatus(NULL, " name = 'Cancelled' ", 'name', FALSE, TRUE)), + ))) { $membership = new CRM_Member_DAO_Membership(); $membership->id = $currentMembership['id']; $membership->find(TRUE); diff --git a/CRM/Member/BAO/MembershipPayment.php b/CRM/Member/BAO/MembershipPayment.php index f596ecd79a..8f718b1cb6 100644 --- a/CRM/Member/BAO/MembershipPayment.php +++ b/CRM/Member/BAO/MembershipPayment.php @@ -82,10 +82,10 @@ class CRM_Member_BAO_MembershipPayment extends CRM_Member_DAO_MembershipPayment WHERE pv.membership_type_id = %2 AND contribution_id = %3"; CRM_Core_DAO::executeQuery($sql, array( - 1 => array($dao->membership_id, 'Integer'), - 2 => array($membership_type_id, 'Integer'), - 3 => array($dao->contribution_id, 'Integer'), - )); + 1 => array($dao->membership_id, 'Integer'), + 2 => array($membership_type_id, 'Integer'), + 3 => array($dao->contribution_id, 'Integer'), + )); return $dao; } diff --git a/CRM/Member/BAO/MembershipType.php b/CRM/Member/BAO/MembershipType.php index 53a4428836..6bfe56ce43 100644 --- a/CRM/Member/BAO/MembershipType.php +++ b/CRM/Member/BAO/MembershipType.php @@ -177,19 +177,19 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { $findMembersURL = CRM_Utils_System::url('civicrm/member/search', 'reset=1'); $deleteURL = CRM_Utils_System::url('civicrm/contact/search/advanced', 'reset=1'); $message .= '
' . ts('%3. There are some contacts who have this membership type assigned to them. Search for contacts with this membership type from
Find Members. If you are still getting this message after deleting these memberships, there may be contacts in the Trash (deleted) with this membership type. Try using Advanced Search and checking "Search in Trash".', array( - 1 => $findMembersURL, - 2 => $deleteURL, - 3 => $cnt, - )); + 1 => $findMembersURL, + 2 => $deleteURL, + 3 => $cnt, + )); $cnt++; } if (in_array('MembershipBlock', $status)) { $deleteURL = CRM_Utils_System::url('civicrm/admin/contribute', 'reset=1'); $message .= ts('%2. This Membership Type is used in an Online Contribution page. Uncheck this membership type in the Memberships tab.', array( - 1 => $deleteURL, - 2 => $cnt, - )); + 1 => $deleteURL, + 2 => $cnt, + )); throw new CRM_Core_Exception($message); } } @@ -315,10 +315,10 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { // Convert all dates to 'Y-m-d' format. foreach (array( - 'joinDate', - 'startDate', - 'endDate', - ) as $dateParam) { + 'joinDate', + 'startDate', + 'endDate', + ) as $dateParam) { if (!empty($$dateParam)) { $$dateParam = CRM_Utils_Date::processDate($$dateParam, NULL, FALSE, 'Y-m-d'); } diff --git a/CRM/Member/Form.php b/CRM/Member/Form.php index ec8fd490b1..6c1223923a 100644 --- a/CRM/Member/Form.php +++ b/CRM/Member/Form.php @@ -190,50 +190,47 @@ class CRM_Member_Form extends CRM_Contribute_Form_AbstractEditPayment { if ($this->_action & CRM_Core_Action::RENEW) { $this->addButtons(array( - array( - 'type' => 'upload', - 'name' => ts('Renew'), - 'isDefault' => TRUE, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); + array( + 'type' => 'upload', + 'name' => ts('Renew'), + 'isDefault' => TRUE, + ), + array( + 'type' => 'cancel', + 'name' => ts('Cancel'), + ), + )); } elseif ($this->_action & CRM_Core_Action::DELETE) { $this->addButtons(array( - array( - 'type' => 'next', - 'name' => ts('Delete'), - 'isDefault' => TRUE, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); + array( + 'type' => 'next', + 'name' => ts('Delete'), + 'isDefault' => TRUE, + ), + array( + 'type' => 'cancel', + 'name' => ts('Cancel'), + ), + )); } else { $this->addButtons(array( - array( - 'type' => 'upload', - 'name' => ts('Save'), - 'isDefault' => TRUE, - ), - array( - 'type' => 'upload', - 'name' => ts('Save and New'), - 'subName' => 'new', - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); + array( + 'type' => 'upload', + 'name' => ts('Save'), + 'isDefault' => TRUE, + ), + array( + 'type' => 'upload', + 'name' => ts('Save and New'), + 'subName' => 'new', + ), + array( + 'type' => 'cancel', + 'name' => ts('Cancel'), + ), + )); } } diff --git a/CRM/Member/Form/Membership.php b/CRM/Member/Form/Membership.php index 0ddedb633a..37f26d5b3c 100644 --- a/CRM/Member/Form/Membership.php +++ b/CRM/Member/Form/Membership.php @@ -479,26 +479,25 @@ class CRM_Member_Form_Membership extends CRM_Member_Form { if ($this->_action & CRM_Core_Action::DELETE) { $this->addButtons(array( - array( - 'type' => 'next', - 'name' => ts('Delete'), - 'spacing' => '         ', - 'isDefault' => TRUE, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); + array( + 'type' => 'next', + 'name' => ts('Delete'), + 'spacing' => '         ', + 'isDefault' => TRUE, + ), + array( + 'type' => 'cancel', + 'name' => ts('Cancel'), + ), + )); return; } if ($this->_context == 'standalone') { $this->addEntityRef('contact_id', ts('Contact'), array( - 'create' => TRUE, - 'api' => array('extra' => array('email')), - ), TRUE); + 'create' => TRUE, + 'api' => array('extra' => array('email')), + ), TRUE); } $selOrgMemType[0][0] = $selMemTypeOrg[0] = ts('- select -'); diff --git a/CRM/Member/Form/MembershipBlock.php b/CRM/Member/Form/MembershipBlock.php index 12640d1225..2dcecf49bf 100644 --- a/CRM/Member/Form/MembershipBlock.php +++ b/CRM/Member/Form/MembershipBlock.php @@ -80,10 +80,10 @@ class CRM_Member_Form_MembershipBlock extends CRM_Contribute_Form_ContributionPa $pFIDs = array(); if ($priceSetId) { CRM_Core_DAO::commonRetrieveAll('CRM_Price_DAO_PriceField', 'price_set_id', $priceSetId, $pFIDs, $return = array( - 'html_type', - 'name', - 'label', - )); + 'html_type', + 'name', + 'label', + )); foreach ($pFIDs as $pid => $pValue) { if ($pValue['html_type'] == 'Radio' && $pValue['name'] == 'membership_amount') { $defaults['mem_price_field_id'] = $pValue['id']; @@ -196,18 +196,17 @@ class CRM_Member_Form_MembershipBlock extends CRM_Contribute_Form_ContributionPa $single = $session->get('singleForm'); if ($single) { $this->addButtons(array( - array( - 'type' => 'next', - 'name' => ts('Save'), - 'spacing' => '         ', - 'isDefault' => TRUE, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); + array( + 'type' => 'next', + 'name' => ts('Save'), + 'spacing' => '         ', + 'isDefault' => TRUE, + ), + array( + 'type' => 'cancel', + 'name' => ts('Cancel'), + ), + )); } else { parent::buildQuickForm(); diff --git a/CRM/Member/Form/MembershipConfig.php b/CRM/Member/Form/MembershipConfig.php index 2035463ff7..e3e4f09dc7 100644 --- a/CRM/Member/Form/MembershipConfig.php +++ b/CRM/Member/Form/MembershipConfig.php @@ -112,50 +112,47 @@ class CRM_Member_Form_MembershipConfig extends CRM_Core_Form { public function buildQuickForm() { if ($this->_action & CRM_Core_Action::RENEW) { $this->addButtons(array( - array( - 'type' => 'upload', - 'name' => ts('Renew'), - 'isDefault' => TRUE, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); + array( + 'type' => 'upload', + 'name' => ts('Renew'), + 'isDefault' => TRUE, + ), + array( + 'type' => 'cancel', + 'name' => ts('Cancel'), + ), + )); } elseif ($this->_action & CRM_Core_Action::DELETE) { $this->addButtons(array( - array( - 'type' => 'next', - 'name' => ts('Delete'), - 'isDefault' => TRUE, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); + array( + 'type' => 'next', + 'name' => ts('Delete'), + 'isDefault' => TRUE, + ), + array( + 'type' => 'cancel', + 'name' => ts('Cancel'), + ), + )); } else { $this->addButtons(array( - array( - 'type' => 'upload', - 'name' => ts('Save'), - 'isDefault' => TRUE, - ), - array( - 'type' => 'upload', - 'name' => ts('Save and New'), - 'subName' => 'new', - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); + array( + 'type' => 'upload', + 'name' => ts('Save'), + 'isDefault' => TRUE, + ), + array( + 'type' => 'upload', + 'name' => ts('Save and New'), + 'subName' => 'new', + ), + array( + 'type' => 'cancel', + 'name' => ts('Cancel'), + ), + )); } } diff --git a/CRM/Member/Form/MembershipRenewal.php b/CRM/Member/Form/MembershipRenewal.php index 12120b3bc2..b55ca2628d 100644 --- a/CRM/Member/Form/MembershipRenewal.php +++ b/CRM/Member/Form/MembershipRenewal.php @@ -463,13 +463,13 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form { if ($this->endDate) { $statusMsg .= ' ' . ts('The new membership End Date is %1.', array( - 1 => CRM_Utils_Date::customFormat(substr($this->endDate, 0, 8)), + 1 => CRM_Utils_Date::customFormat(substr($this->endDate, 0, 8)), )); } if ($this->isMailSent) { $statusMsg .= ' ' . ts('A renewal confirmation and receipt has been sent to %1.', array( - 1 => $this->_contributorEmail, + 1 => $this->_contributorEmail, )); return $statusMsg; } diff --git a/CRM/Member/Form/MembershipView.php b/CRM/Member/Form/MembershipView.php index c98144ca34..27bb15ae7a 100644 --- a/CRM/Member/Form/MembershipView.php +++ b/CRM/Member/Form/MembershipView.php @@ -408,14 +408,13 @@ SELECT r.id, c.id as cid, c.display_name as name, c.job_title as comment, */ public function buildQuickForm() { $this->addButtons(array( - array( - 'type' => 'cancel', - 'name' => ts('Done'), - 'spacing' => '         ', - 'isDefault' => TRUE, - ), - ) - ); + array( + 'type' => 'cancel', + 'name' => ts('Done'), + 'spacing' => '         ', + 'isDefault' => TRUE, + ), + )); } } diff --git a/CRM/Member/Form/Task.php b/CRM/Member/Form/Task.php index bdf12dfaf5..9267b117a0 100644 --- a/CRM/Member/Form/Task.php +++ b/CRM/Member/Form/Task.php @@ -175,17 +175,16 @@ class CRM_Member_Form_Task extends CRM_Core_Form { */ public function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { $this->addButtons(array( - array( - 'type' => $nextType, - 'name' => $title, - 'isDefault' => TRUE, - ), - array( - 'type' => $backType, - 'name' => ts('Cancel'), - ), - ) - ); + array( + 'type' => $nextType, + 'name' => $title, + 'isDefault' => TRUE, + ), + array( + 'type' => $backType, + 'name' => ts('Cancel'), + ), + )); } } diff --git a/CRM/Member/Form/Task/Batch.php b/CRM/Member/Form/Task/Batch.php index 9424dd5298..e14212eb8c 100644 --- a/CRM/Member/Form/Task/Batch.php +++ b/CRM/Member/Form/Task/Batch.php @@ -120,17 +120,16 @@ class CRM_Member_Form_Task_Batch extends CRM_Member_Form_Task { $this->_fields = array_slice($this->_fields, 0, $this->_maxFields); $this->addButtons(array( - array( - 'type' => 'submit', - 'name' => ts('Update Members(s)'), - 'isDefault' => TRUE, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); + array( + 'type' => 'submit', + 'name' => ts('Update Members(s)'), + 'isDefault' => TRUE, + ), + array( + 'type' => 'cancel', + 'name' => ts('Cancel'), + ), + )); $this->assign('profileTitle', $this->_title); $this->assign('componentIds', $this->_memberIds); diff --git a/CRM/Member/Form/Task/Label.php b/CRM/Member/Form/Task/Label.php index 5e2638717a..7a5a5a635b 100644 --- a/CRM/Member/Form/Task/Label.php +++ b/CRM/Member/Form/Task/Label.php @@ -129,9 +129,9 @@ class CRM_Member_Form_Task_Label extends CRM_Member_Form_Task { if ($isPerMembership) { $labelRows = array(); $memberships = civicrm_api3('membership', 'get', array( - 'id' => array('IN' => $this->_memberIds), - 'return' => 'contact_id', - )); + 'id' => array('IN' => $this->_memberIds), + 'return' => 'contact_id', + )); foreach ($memberships['values'] as $id => $membership) { $labelRows[$id] = $rows[$membership['contact_id']]; } diff --git a/CRM/Member/Form/Task/PickProfile.php b/CRM/Member/Form/Task/PickProfile.php index 0920d73e20..6f4c3231ca 100644 --- a/CRM/Member/Form/Task/PickProfile.php +++ b/CRM/Member/Form/Task/PickProfile.php @@ -72,9 +72,9 @@ class CRM_Member_Form_Task_PickProfile extends CRM_Member_Form_Task { //validations if (count($this->_memberIds) > $this->_maxMembers) { CRM_Core_Session::setStatus(ts("The maximum number of members you can select for Update multiple memberships is %1. You have selected %2. Please select fewer members from your search results and try again.", array( - 1 => $this->_maxMembers, - 2 => count($this->_memberIds), - )), ts('Update multiple records error'), 'error'); + 1 => $this->_maxMembers, + 2 => count($this->_memberIds), + )), ts('Update multiple records error'), 'error'); $validate = TRUE; } diff --git a/CRM/Member/Form/Task/Print.php b/CRM/Member/Form/Task/Print.php index 4176c001a9..1b85dca26b 100644 --- a/CRM/Member/Form/Task/Print.php +++ b/CRM/Member/Form/Task/Print.php @@ -78,18 +78,17 @@ class CRM_Member_Form_Task_Print extends CRM_Member_Form_Task { // just need to add a javacript to popup the window for printing // $this->addButtons(array( - array( - 'type' => 'next', - 'name' => ts('Print Members'), - 'js' => array('onclick' => 'window.print()'), - 'isDefault' => TRUE, - ), - array( - 'type' => 'back', - 'name' => ts('Done'), - ), - ) - ); + array( + 'type' => 'next', + 'name' => ts('Print Members'), + 'js' => array('onclick' => 'window.print()'), + 'isDefault' => TRUE, + ), + array( + 'type' => 'back', + 'name' => ts('Done'), + ), + )); } /** diff --git a/CRM/Member/Form/Task/Result.php b/CRM/Member/Form/Task/Result.php index 0bead844d6..cfe7a39258 100644 --- a/CRM/Member/Form/Task/Result.php +++ b/CRM/Member/Form/Task/Result.php @@ -55,13 +55,12 @@ class CRM_Member_Form_Task_Result extends CRM_Member_Form_Task { */ public function buildQuickForm() { $this->addButtons(array( - array( - 'type' => 'done', - 'name' => ts('Done'), - 'isDefault' => TRUE, - ), - ) - ); + array( + 'type' => 'done', + 'name' => ts('Done'), + 'isDefault' => TRUE, + ), + )); } } diff --git a/CRM/Member/Form/Task/SearchTaskHookSample.php b/CRM/Member/Form/Task/SearchTaskHookSample.php index a2b3d53ae0..c9beaa82c5 100644 --- a/CRM/Member/Form/Task/SearchTaskHookSample.php +++ b/CRM/Member/Form/Task/SearchTaskHookSample.php @@ -78,13 +78,12 @@ WHERE mem.id IN ( $memberIDs )"; */ public function buildQuickForm() { $this->addButtons(array( - array( - 'type' => 'done', - 'name' => ts('Done'), - 'isDefault' => TRUE, - ), - ) - ); + array( + 'type' => 'done', + 'name' => ts('Done'), + 'isDefault' => TRUE, + ), + )); } } diff --git a/CRM/Member/Import/Form/MapField.php b/CRM/Member/Import/Form/MapField.php index 67fe9906ce..24e48ec986 100644 --- a/CRM/Member/Import/Form/MapField.php +++ b/CRM/Member/Import/Form/MapField.php @@ -280,22 +280,21 @@ class CRM_Member_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'), + ), + )); } /** @@ -363,7 +362,7 @@ class CRM_Member_Import_Form_MapField extends CRM_Import_Form_MapField { } $errors['_qf_default'] .= ts('Missing required contact matching fields.') . " $fieldMessage " . ts('(Sum of all weights should be greater than or equal to threshold: %1).', array( 1 => $threshold, - )) . ' ' . ts('(OR Membership ID if update mode.)') . '
'; + )) . ' ' . ts('(OR Membership ID if update mode.)') . '
'; } } else { @@ -372,7 +371,7 @@ class CRM_Member_Import_Form_MapField extends CRM_Import_Form_MapField { } $errors['_qf_default'] .= ts('Missing required field: %1', array( 1 => $title, - )) . '
'; + )) . '
'; } } } diff --git a/CRM/Member/Import/Parser.php b/CRM/Member/Import/Parser.php index d374c49d45..920ce53592 100644 --- a/CRM/Member/Import/Parser.php +++ b/CRM/Member/Import/Parser.php @@ -245,32 +245,26 @@ abstract class CRM_Member_Import_Parser extends CRM_Import_Parser { if ($this->_invalidRowCount) { // removed view url for invlaid contacts $headers = array_merge(array( - ts('Line Number'), - ts('Reason'), - ), - $customHeaders - ); + ts('Line Number'), + ts('Reason'), + ), $customHeaders); $this->_errorFileName = self::errorFileName(self::ERROR); self::exportCSV($this->_errorFileName, $headers, $this->_errors); } if ($this->_conflictCount) { $headers = array_merge(array( - ts('Line Number'), - ts('Reason'), - ), - $customHeaders - ); + ts('Line Number'), + ts('Reason'), + ), $customHeaders); $this->_conflictFileName = self::errorFileName(self::CONFLICT); self::exportCSV($this->_conflictFileName, $headers, $this->_conflicts); } if ($this->_duplicateCount) { $headers = array_merge(array( - ts('Line Number'), - ts('View Membership URL'), - ), - $customHeaders - ); + ts('Line Number'), + ts('View Membership URL'), + ), $customHeaders); $this->_duplicateFileName = self::errorFileName(self::DUPLICATE); self::exportCSV($this->_duplicateFileName, $headers, $this->_duplicates); diff --git a/CRM/Member/Page/Tab.php b/CRM/Member/Page/Tab.php index fd551b6444..91b3397ea7 100644 --- a/CRM/Member/Page/Tab.php +++ b/CRM/Member/Page/Tab.php @@ -166,9 +166,9 @@ class CRM_Member_Page_Tab extends CRM_Core_Page { $membership[$dao->id]['auto_renew'] = 0; } - // if relevant, count related memberships - if (CRM_Utils_Array::value('is_current_member', $statusANDType[$dao->id]) // membership is active - && CRM_Utils_Array::value('relationship_type_id', $statusANDType[$dao->id]) // membership type allows inheritance + // if relevant--membership is active and type allows inheritance--count related memberships + if (CRM_Utils_Array::value('is_current_member', $statusANDType[$dao->id]) + && CRM_Utils_Array::value('relationship_type_id', $statusANDType[$dao->id]) && empty($dao->owner_membership_id) ) { // not an related membership @@ -181,10 +181,9 @@ class CRM_Member_Page_Tab extends CRM_Core_Page { $num_related = CRM_Core_DAO::singleValueQuery($query); $max_related = CRM_Utils_Array::value('max_related', $membership[$dao->id]); $membership[$dao->id]['related_count'] = ($max_related == '' ? ts('%1 created', array(1 => $num_related)) : ts('%1 out of %2', array( - 1 => $num_related, - 2 => $max_related, - )) - ); + 1 => $num_related, + 2 => $max_related, + ))); } else { $membership[$dao->id]['related_count'] = ts('N/A'); diff --git a/CRM/Member/Page/UserDashboard.php b/CRM/Member/Page/UserDashboard.php index 8cdcd78e79..f2bf0faa0c 100644 --- a/CRM/Member/Page/UserDashboard.php +++ b/CRM/Member/Page/UserDashboard.php @@ -56,9 +56,9 @@ class CRM_Member_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBoard //get the membership status and type values. $statusANDType = CRM_Member_BAO_Membership::getStatusANDTypeValues($dao->id); foreach (array( - 'status', - 'membership_type', - ) as $fld) { + 'status', + 'membership_type', + ) as $fld) { $membership[$dao->id][$fld] = CRM_Utils_Array::value($fld, $statusANDType[$dao->id]); } if (!empty($statusANDType[$dao->id]['is_current_member'])) { diff --git a/CRM/Member/Tokens.php b/CRM/Member/Tokens.php index 2adda80da4..2c60e85a3e 100644 --- a/CRM/Member/Tokens.php +++ b/CRM/Member/Tokens.php @@ -74,8 +74,9 @@ class CRM_Member_Tokens extends \Civi\Token\AbstractTokenSubscriber { return; } + // FIXME: `select('e.*')` seems too broad. $e->query - ->select('e.*') // FIXME: seems too broad. + ->select('e.*') ->select('mt.minimum_fee as fee, e.id as id , e.join_date, e.start_date, e.end_date, ms.name as status, mt.name as type') ->join('mt', "!casMailingJoinType civicrm_membership_type mt ON e.membership_type_id = mt.id") ->join('ms', "!casMailingJoinType civicrm_membership_status ms ON e.status_id = ms.id"); diff --git a/CRM/Price/BAO/PriceField.php b/CRM/Price/BAO/PriceField.php index b3ec0f5398..d0f8a98080 100644 --- a/CRM/Price/BAO/PriceField.php +++ b/CRM/Price/BAO/PriceField.php @@ -313,10 +313,10 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { $qf->assign('invoicing', $invoicing); } $priceVal = implode($seperator, array( - $customOption[$optionKey][$valueFieldName] + $taxAmount, - $count, - $max_value, - )); + $customOption[$optionKey][$valueFieldName] + $taxAmount, + $count, + $max_value, + )); $extra = array(); if (!empty($qf->_membershipBlock) && !empty($qf->_quickConfig) && $field->name == 'other_amount' && empty($qf->_contributionAmount)) { @@ -633,9 +633,9 @@ WHERE AND option_value.label = %2"; $dao = CRM_Core_DAO::executeQuery($query, array( - 1 => array($optionGroupName, 'String'), - 2 => array($optionLabel, 'String'), - )); + 1 => array($optionGroupName, 'String'), + 2 => array($optionLabel, 'String'), + )); while ($dao->fetch()) { return $dao->id; diff --git a/CRM/Price/BAO/PriceSet.php b/CRM/Price/BAO/PriceSet.php index cb8be72f3d..b02055c3e7 100644 --- a/CRM/Price/BAO/PriceSet.php +++ b/CRM/Price/BAO/PriceSet.php @@ -476,7 +476,8 @@ WHERE ct.id = cp.financial_type_id AND $query .= ' AND s.financial_type_id IN (' . $types . ') AND v.financial_type_id IN (' . $types . ') '; } else { - $query .= " AND 0 "; // Do not display any price sets + // Do not display any price sets + $query .= " AND 0 "; } $query .= " GROUP BY s.id"; $dao = CRM_Core_DAO::executeQuery($query); diff --git a/CRM/Price/Form/DeleteField.php b/CRM/Price/Form/DeleteField.php index efba36cff8..2b8fafad55 100644 --- a/CRM/Price/Form/DeleteField.php +++ b/CRM/Price/Form/DeleteField.php @@ -78,17 +78,16 @@ class CRM_Price_Form_DeleteField extends CRM_Core_Form { */ public function buildQuickForm() { $this->addButtons(array( - array( - 'type' => 'next', - 'name' => ts('Delete Price Field'), - 'isDefault' => TRUE, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); + array( + 'type' => 'next', + 'name' => ts('Delete Price Field'), + 'isDefault' => TRUE, + ), + array( + 'type' => 'cancel', + 'name' => ts('Cancel'), + ), + )); } /** diff --git a/CRM/Price/Form/DeleteSet.php b/CRM/Price/Form/DeleteSet.php index 1fe1729e9c..87b955e9ab 100644 --- a/CRM/Price/Form/DeleteSet.php +++ b/CRM/Price/Form/DeleteSet.php @@ -73,17 +73,16 @@ class CRM_Price_Form_DeleteSet extends CRM_Core_Form { public function buildQuickForm() { $this->assign('title', $this->_title); $this->addButtons(array( - array( - 'type' => 'next', - 'name' => ts('Delete Price Set'), - 'isDefault' => TRUE, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); + array( + 'type' => 'next', + 'name' => ts('Delete Price Set'), + 'isDefault' => TRUE, + ), + array( + 'type' => 'cancel', + 'name' => ts('Cancel'), + ), + )); } /** diff --git a/CRM/Price/Form/Field.php b/CRM/Price/Form/Field.php index e73f803b8f..903e926aa3 100644 --- a/CRM/Price/Form/Field.php +++ b/CRM/Price/Form/Field.php @@ -346,22 +346,21 @@ class CRM_Price_Form_Field extends CRM_Core_Form { // add buttons $this->addButtons(array( - array( - 'type' => 'next', - 'name' => ts('Save'), - 'isDefault' => TRUE, - ), - array( - 'type' => 'next', - 'name' => ts('Save and New'), - 'subName' => 'new', - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); + array( + 'type' => 'next', + 'name' => ts('Save'), + 'isDefault' => TRUE, + ), + array( + 'type' => 'next', + 'name' => ts('Save and New'), + 'subName' => 'new', + ), + array( + 'type' => 'cancel', + 'name' => ts('Cancel'), + ), + )); // is public? $this->add('select', 'visibility_id', ts('Visibility'), CRM_Core_PseudoConstant::visibility()); diff --git a/CRM/Price/Form/Option.php b/CRM/Price/Form/Option.php index 4f3c074d4e..08d3eaf614 100644 --- a/CRM/Price/Form/Option.php +++ b/CRM/Price/Form/Option.php @@ -122,16 +122,15 @@ class CRM_Price_Form_Option extends CRM_Core_Form { } if ($this->_action == CRM_Core_Action::DELETE) { $this->addButtons(array( - array( - 'type' => 'next', - 'name' => ts('Delete'), - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); + array( + 'type' => 'next', + 'name' => ts('Delete'), + ), + array( + 'type' => 'cancel', + 'name' => ts('Cancel'), + ), + )); return NULL; } else { @@ -166,10 +165,9 @@ class CRM_Price_Form_Option extends CRM_Core_Form { $this->assign('showMember', TRUE); $membershipTypes = CRM_Member_PseudoConstant::membershipType(); $this->add('select', 'membership_type_id', ts('Membership Type'), array( - '' => ' ', - ) + $membershipTypes, FALSE, - array('onClick' => "calculateRowValues( );") - ); + '' => ' ', + ) + $membershipTypes, FALSE, + array('onClick' => "calculateRowValues( );")); $this->add('text', 'membership_num_terms', ts('Number of Terms'), $attributes['membership_num_terms']); } else { @@ -239,28 +237,26 @@ class CRM_Price_Form_Option extends CRM_Core_Form { } // add buttons $this->addButtons(array( - array( - 'type' => 'next', - 'name' => ts('Save'), - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); + array( + 'type' => 'next', + 'name' => ts('Save'), + ), + array( + 'type' => 'cancel', + 'name' => ts('Cancel'), + ), + )); // if view mode pls freeze it with the done button. if ($this->_action & CRM_Core_Action::VIEW) { $this->freeze(); $this->addButtons(array( - array( - 'type' => 'cancel', - 'name' => ts('Done'), - 'isDefault' => TRUE, - ), - ) - ); + array( + 'type' => 'cancel', + 'name' => ts('Done'), + 'isDefault' => TRUE, + ), + )); } } diff --git a/CRM/Price/Form/Preview.php b/CRM/Price/Form/Preview.php index 93761e6b9a..a3b4f523b1 100644 --- a/CRM/Price/Form/Preview.php +++ b/CRM/Price/Form/Preview.php @@ -138,13 +138,12 @@ class CRM_Price_Form_Preview extends CRM_Core_Form { } $this->addButtons(array( - array( - 'type' => 'cancel', - 'name' => ts('Done with Preview'), - 'isDefault' => TRUE, - ), - ) - ); + array( + 'type' => 'cancel', + 'name' => ts('Done with Preview'), + 'isDefault' => TRUE, + ), + )); } } diff --git a/CRM/Price/Form/Set.php b/CRM/Price/Form/Set.php index 9e278f6c41..a4234cd1dd 100644 --- a/CRM/Price/Form/Set.php +++ b/CRM/Price/Form/Set.php @@ -210,18 +210,17 @@ class CRM_Price_Form_Set extends CRM_Core_Form { $this->addElement('checkbox', 'is_active', ts('Is this Price Set active?')); $this->addButtons(array( - array( - 'type' => 'next', - 'name' => ts('Save'), - 'spacing' => '         ', - 'isDefault' => TRUE, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); + array( + 'type' => 'next', + 'name' => ts('Save'), + 'spacing' => '         ', + 'isDefault' => TRUE, + ), + array( + 'type' => 'cancel', + 'name' => ts('Cancel'), + ), + )); $this->addFormRule(array('CRM_Price_Form_Set', 'formRule')); @@ -292,11 +291,11 @@ class CRM_Price_Form_Set extends CRM_Core_Form { // Jump directly to adding a field if popups are disabled $action = CRM_Core_Resources::singleton()->ajaxPopupsEnabled ? 'browse' : 'add'; $url = CRM_Utils_System::url('civicrm/admin/price/field', array( - 'reset' => 1, - 'action' => $action, - 'sid' => $set->id, - 'new' => 1, - )); + 'reset' => 1, + 'action' => $action, + 'sid' => $set->id, + 'new' => 1, + )); CRM_Core_Session::setStatus(ts("Your Set '%1' has been added. You can add fields to this set now.", array(1 => $set->title) ), ts('Saved'), 'success'); diff --git a/CRM/Profile/Form.php b/CRM/Profile/Form.php index 6647f57a3e..babd87a1bb 100644 --- a/CRM/Profile/Form.php +++ b/CRM/Profile/Form.php @@ -371,9 +371,9 @@ class CRM_Profile_Form extends CRM_Core_Form { } elseif (!empty($this->_multiRecordFields) && (!$this->_multiRecord || !in_array($this->_multiRecord, array( - CRM_Core_Action::DELETE, - CRM_Core_Action::UPDATE, - ))) + CRM_Core_Action::DELETE, + CRM_Core_Action::UPDATE, + ))) ) { CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js', 1, 'html-header'); //multirecord listing page @@ -976,20 +976,20 @@ class CRM_Profile_Form extends CRM_Core_Form { $duplicateContactsLinks = '
'; $duplicateContactsLinks .= ts('One matching contact was found. ', array( - 'count' => count($contactLinks['rows']), - 'plural' => '%count matching contacts were found.
', - )); + '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.', - )); + '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.', - )); + 'count' => count($contactLinks['rows']), + 'plural' => 'You can View or Edit the existing contacts.', + )); } $duplicateContactsLinks .= '
'; $duplicateContactsLinks .= ''; diff --git a/CRM/Profile/Form/Dynamic.php b/CRM/Profile/Form/Dynamic.php index 00666418c8..a06f79b723 100644 --- a/CRM/Profile/Form/Dynamic.php +++ b/CRM/Profile/Form/Dynamic.php @@ -75,13 +75,12 @@ class CRM_Profile_Form_Dynamic extends CRM_Profile_Form { */ public function buildQuickForm() { $this->addButtons(array( - array( - 'type' => 'upload', - 'name' => ts('Save'), - 'isDefault' => TRUE, - ), - ) - ); + array( + 'type' => 'upload', + 'name' => ts('Save'), + 'isDefault' => TRUE, + ), + )); // also add a hidden element for to trick drupal $this->addElement('hidden', "edit[civicrm_dummy_field]", "CiviCRM Dummy Field for Drupal"); diff --git a/CRM/Profile/Page/Dynamic.php b/CRM/Profile/Page/Dynamic.php index d2db2a7135..e1d68d53f6 100644 --- a/CRM/Profile/Page/Dynamic.php +++ b/CRM/Profile/Page/Dynamic.php @@ -206,7 +206,7 @@ class CRM_Profile_Page_Dynamic extends CRM_Core_Page { $this->_isPermissionedChecksum = $allowPermission = FALSE; $permissionType = CRM_Core_Permission::VIEW; if (CRM_Core_Permission::check('administer users') || CRM_Core_Permission::check('view all contacts') || CRM_Contact_BAO_Contact_Permission::allow($this->_id)) { - $allowPermission = TRUE; + $allowPermission = TRUE; } if ($this->_id != $userID) { // do not allow edit for anon users in joomla frontend, CRM-4668, unless u have checksum CRM-5228 diff --git a/CRM/Profile/Page/Listings.php b/CRM/Profile/Page/Listings.php index fbbaaaaddc..7689b6ec7b 100644 --- a/CRM/Profile/Page/Listings.php +++ b/CRM/Profile/Page/Listings.php @@ -288,7 +288,8 @@ class CRM_Profile_Page_Listings extends CRM_Core_Page { $this->preProcess(); $this->assign('recentlyViewed', FALSE); - $this->assign('ufGroupName', 'unknown'); // override later (if possible) + // override later (if possible): + $this->assign('ufGroupName', 'unknown'); if ($this->_gid) { $ufgroupDAO = new CRM_Core_DAO_UFGroup(); diff --git a/CRM/Profile/Page/MultipleRecordFieldsListing.php b/CRM/Profile/Page/MultipleRecordFieldsListing.php index ae46a19c15..6a4fd0a045 100644 --- a/CRM/Profile/Page/MultipleRecordFieldsListing.php +++ b/CRM/Profile/Page/MultipleRecordFieldsListing.php @@ -415,7 +415,7 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { FALSE, $op, 'customValue', - $fieldId // not ideal, but the one thing not sent in $actionParams + $fieldId ); } } diff --git a/CRM/SMS/Form/Group.php b/CRM/SMS/Form/Group.php index 064848ece8..acb5d76be8 100644 --- a/CRM/SMS/Form/Group.php +++ b/CRM/SMS/Form/Group.php @@ -180,10 +180,10 @@ class CRM_SMS_Form_Group extends CRM_Contact_Form_Task { $groups = array(); foreach (array( - 'name', - 'group_id', - 'is_sms', - ) as $n) { + 'name', + 'group_id', + 'is_sms', + ) as $n) { if (!empty($values[$n])) { $params[$n] = $values[$n]; } @@ -242,9 +242,9 @@ class CRM_SMS_Form_Group extends CRM_Contact_Form_Task { // delete previous includes/excludes, if mailing already existed foreach (array( - 'groups', - 'mailings', - ) as $entity) { + 'groups', + 'mailings', + ) as $entity) { $mg = new CRM_Mailing_DAO_MailingGroup(); $mg->mailing_id = $ids['mailing_id']; $mg->entity_table = ($entity == 'groups') ? $groupTableName : $mailingTableName; diff --git a/CRM/SMS/Form/Provider.php b/CRM/SMS/Form/Provider.php index ff1501a3ea..25dd50e7cb 100644 --- a/CRM/SMS/Form/Provider.php +++ b/CRM/SMS/Form/Provider.php @@ -66,17 +66,16 @@ class CRM_SMS_Form_Provider extends CRM_Core_Form { parent::buildQuickForm(); $this->addButtons(array( - array( - 'type' => 'next', - 'name' => $this->_action & CRM_Core_Action::DELETE ? ts('Delete') : ts('Save'), - 'isDefault' => TRUE, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); + array( + 'type' => 'next', + 'name' => $this->_action & CRM_Core_Action::DELETE ? ts('Delete') : ts('Save'), + 'isDefault' => TRUE, + ), + array( + 'type' => 'cancel', + 'name' => ts('Cancel'), + ), + )); if ($this->_action & CRM_Core_Action::DELETE) { return; @@ -94,9 +93,9 @@ class CRM_SMS_Form_Provider extends CRM_Core_Form { ); $this->addRule('title', ts('This Title already exists in Database.'), 'objectExists', array( - 'CRM_SMS_DAO_Provider', - $this->_id, - )); + 'CRM_SMS_DAO_Provider', + $this->_id, + )); $this->add('text', 'username', ts('Username'), $attributes['username'], TRUE diff --git a/CRM/SMS/Form/Upload.php b/CRM/SMS/Form/Upload.php index 4600431e91..6082c83523 100644 --- a/CRM/SMS/Form/Upload.php +++ b/CRM/SMS/Form/Upload.php @@ -405,7 +405,7 @@ class CRM_SMS_Form_Upload extends CRM_Core_Form { if (!empty($dataErrors)) { $errors['textFile'] = ts('The following errors were detected in %1:', array( 1 => $name, - )) . ' '; + )) . ' '; } } diff --git a/CRM/UF/Form/Field.php b/CRM/UF/Form/Field.php index fcea43ed06..42c9d58c9d 100644 --- a/CRM/UF/Form/Field.php +++ b/CRM/UF/Form/Field.php @@ -183,18 +183,17 @@ class CRM_UF_Form_Field extends CRM_Core_Form { public function buildQuickForm() { if ($this->_action & CRM_Core_Action::DELETE) { $this->addButtons(array( - array( - 'type' => 'next', - 'name' => ts('Delete Profile Field'), - 'spacing' => '         ', - 'isDefault' => TRUE, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); + array( + 'type' => 'next', + 'name' => ts('Delete Profile Field'), + 'spacing' => '         ', + 'isDefault' => TRUE, + ), + array( + 'type' => 'cancel', + 'name' => ts('Cancel'), + ), + )); return; } @@ -464,24 +463,23 @@ class CRM_UF_Form_Field extends CRM_Core_Form { // add buttons $this->addButtons(array( - array( - 'type' => 'next', - 'name' => ts('Save'), - 'isDefault' => TRUE, - 'js' => $js, - ), - array( - 'type' => 'next', - 'name' => ts('Save and New'), - 'subName' => 'new', - 'js' => $js, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); + array( + 'type' => 'next', + 'name' => ts('Save'), + 'isDefault' => TRUE, + 'js' => $js, + ), + array( + 'type' => 'next', + 'name' => ts('Save and New'), + 'subName' => 'new', + 'js' => $js, + ), + array( + 'type' => 'cancel', + 'name' => ts('Cancel'), + ), + )); $this->addFormRule(array('CRM_UF_Form_Field', 'formRule'), $this); @@ -560,9 +558,9 @@ class CRM_UF_Form_Field extends CRM_Core_Form { $config = CRM_Core_Config::singleton(); $showBestResult = FALSE; if (in_array($ufField->field_name, array( - 'country', - 'state_province', - )) && count($config->countryLimit) > 1 + 'country', + 'state_province', + )) && count($config->countryLimit) > 1 ) { // get state or country field weight if exists $field = 'state_province'; @@ -788,11 +786,11 @@ class CRM_UF_Form_Field extends CRM_Core_Form { } if ($in_selector && in_array($entityName, array( - 'Contribution', - 'Participant', - 'Membership', - 'Activity', - )) + 'Contribution', + 'Participant', + 'Membership', + 'Activity', + )) ) { $errors['in_selector'] = ts("'In Selector' cannot be checked for %1 fields.", array(1 => $entityName)); } @@ -982,9 +980,9 @@ class CRM_UF_Form_Field extends CRM_Core_Form { if (CRM_Contact_BAO_ContactType::isaSubType($profileType)) { if ($fieldType != $profileType) { $errors['field_name'] = ts('Cannot add or update profile field type "%1" with combination of "%2".', array( - 1 => $fieldType, - 2 => $profileType, - )); + 1 => $fieldType, + 2 => $profileType, + )); } } else { @@ -994,9 +992,9 @@ class CRM_UF_Form_Field extends CRM_Core_Form { $profileType != 'Contact' ) { $errors['field_name'] = ts('Cannot add or update profile field type "%1" with combination of "%2".', array( - 1 => $fieldType, - 2 => $profileType, - )); + 1 => $fieldType, + 2 => $profileType, + )); } } } diff --git a/CRM/UF/Form/Group.php b/CRM/UF/Form/Group.php index f75eded31d..f824edcba1 100644 --- a/CRM/UF/Form/Group.php +++ b/CRM/UF/Form/Group.php @@ -119,18 +119,17 @@ class CRM_UF_Form_Group extends CRM_Core_Form { $display = 'Delete Profile'; } $this->addButtons(array( - array( - 'type' => 'next', - 'name' => $display, - 'spacing' => '         ', - 'isDefault' => TRUE, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); + array( + 'type' => 'next', + 'name' => $display, + 'spacing' => '         ', + 'isDefault' => TRUE, + ), + array( + 'type' => 'cancel', + 'name' => ts('Cancel'), + ), + )); return; } $this->applyFilter('__ALL__', 'trim'); @@ -180,18 +179,17 @@ class CRM_UF_Form_Group extends CRM_Core_Form { } $this->addButtons(array( - array( - 'type' => 'next', - 'name' => ts('Save'), - 'spacing' => '         ', - 'isDefault' => TRUE, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); + array( + 'type' => 'next', + 'name' => ts('Save'), + 'spacing' => '         ', + 'isDefault' => TRUE, + ), + array( + 'type' => 'cancel', + 'name' => ts('Cancel'), + ), + )); // views are implemented as frozen form if ($this->_action & CRM_Core_Action::VIEW) { diff --git a/CRM/UF/Form/Preview.php b/CRM/UF/Form/Preview.php index 66bd90a349..ed9ae0b4d2 100644 --- a/CRM/UF/Form/Preview.php +++ b/CRM/UF/Form/Preview.php @@ -131,13 +131,12 @@ class CRM_UF_Form_Preview extends CRM_UF_Form_AbstractPreview { parent::buildQuickForm(); $this->addButtons(array( - array( - 'type' => 'cancel', - 'name' => ts('Done with Preview'), - 'isDefault' => TRUE, - ), - ) - ); + array( + 'type' => 'cancel', + 'name' => ts('Done with Preview'), + 'isDefault' => TRUE, + ), + )); } } diff --git a/CRM/UF/Page/ProfileEditor.php b/CRM/UF/Page/ProfileEditor.php index d877b1b5c7..f6d22d45cc 100644 --- a/CRM/UF/Page/ProfileEditor.php +++ b/CRM/UF/Page/ProfileEditor.php @@ -235,9 +235,11 @@ class CRM_UF_Page_ProfileEditor extends CRM_Core_Page { public static function convertCiviModelToBackboneModel($extends, $title, $availableFields) { $locationFields = CRM_Core_BAO_UFGroup::getLocationFields(); + // schema in format array($fieldName => $fieldSchema) + // sections in format array($sectionName => $section) $result = array( - 'schema' => array(), // array($fieldName => $fieldSchema) - 'sections' => array(), // array($sectionName => $section) + 'schema' => array(), + 'sections' => array(), ); // build field list @@ -259,8 +261,9 @@ class CRM_UF_Page_ProfileEditor extends CRM_Core_Page { continue 2; } } + // FIXME: type set to "Text" $result['schema'][$fieldName] = array( - 'type' => 'Text', // FIXME, + 'type' => 'Text', 'title' => $field['title'], 'civiFieldType' => $field['field_type'], ); -- 2.25.1