style fixes based upon updated phpcs Drupal standard
authorAndrew Hunt <andrew@aghstrategies.com>
Tue, 23 Feb 2016 01:30:26 +0000 (20:30 -0500)
committerAndrew Hunt <andrew@aghstrategies.com>
Tue, 23 Feb 2016 01:30:26 +0000 (20:30 -0500)
52 files changed:
CRM/Activity/Form/Activity.php
CRM/Activity/Form/Task.php
CRM/Activity/Form/Task/Batch.php
CRM/Activity/Form/Task/PickOption.php
CRM/Activity/Form/Task/PickProfile.php
CRM/Activity/Form/Task/Print.php
CRM/Activity/Form/Task/RemoveFromTag.php
CRM/Activity/Form/Task/SearchTaskHookSample.php
CRM/Activity/Page/AJAX.php
CRM/Dedupe/Finder.php
CRM/Dedupe/Merger.php
CRM/Member/BAO/Membership.php
CRM/Member/BAO/MembershipPayment.php
CRM/Member/BAO/MembershipType.php
CRM/Member/Form.php
CRM/Member/Form/Membership.php
CRM/Member/Form/MembershipBlock.php
CRM/Member/Form/MembershipConfig.php
CRM/Member/Form/MembershipRenewal.php
CRM/Member/Form/MembershipView.php
CRM/Member/Form/Task.php
CRM/Member/Form/Task/Batch.php
CRM/Member/Form/Task/Label.php
CRM/Member/Form/Task/PickProfile.php
CRM/Member/Form/Task/Print.php
CRM/Member/Form/Task/Result.php
CRM/Member/Form/Task/SearchTaskHookSample.php
CRM/Member/Import/Form/MapField.php
CRM/Member/Import/Parser.php
CRM/Member/Page/Tab.php
CRM/Member/Page/UserDashboard.php
CRM/Member/Tokens.php
CRM/Price/BAO/PriceField.php
CRM/Price/BAO/PriceSet.php
CRM/Price/Form/DeleteField.php
CRM/Price/Form/DeleteSet.php
CRM/Price/Form/Field.php
CRM/Price/Form/Option.php
CRM/Price/Form/Preview.php
CRM/Price/Form/Set.php
CRM/Profile/Form.php
CRM/Profile/Form/Dynamic.php
CRM/Profile/Page/Dynamic.php
CRM/Profile/Page/Listings.php
CRM/Profile/Page/MultipleRecordFieldsListing.php
CRM/SMS/Form/Group.php
CRM/SMS/Form/Provider.php
CRM/SMS/Form/Upload.php
CRM/UF/Form/Field.php
CRM/UF/Form/Group.php
CRM/UF/Form/Preview.php
CRM/UF/Page/ProfileEditor.php

index 257fe7d5ff0fb277434e6c50e2331ec59fca67fa..1d56c70888dbb52f7e550e4faa03b5ee8da1cb1e 100644 (file)
@@ -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) {
index f359020924ca0ab99a1288b21c6351948f3d2cf7..c2a755dee32da59b5747c53092f45480d9ccf5fa 100644 (file)
@@ -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'),
+      ),
+    ));
   }
 
 }
index 9f56da60646d0b14340c2769583b6527fb8dea38..3d44c27b246554c41cccedd4678f4a57e7878937 100644 (file)
@@ -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);
index 1d3af3d06f379ed63cb5e3b078543a299197a252..e81b27b8db6ded0e6c986097f9ddca3d96bda35e 100644 (file)
@@ -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
index ae2cbc55d6a4f03b958f72892522141f716ffb58..d310764ac95dc421e2e555be2373d860996e25a2 100644 (file)
@@ -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;
     }
 
index 4ecf118db484a9f6604e37f001bfb74c5f566209..f7463340832236a1e7581af57af2e1a0d82a27b8 100644 (file)
@@ -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'),
+      ),
+    ));
   }
 
 }
index 3c3c305b85f74ca570fa691fff8a656dfe87c6ac..b3a5d98216a7e2edb8aa825bf3819489cf31140b 100644 (file)
@@ -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 = '<ul><li>' . implode('</li><li>', $status) . '</li></ul>';
       CRM_Core_Session::setStatus($status, ts("Removed Tag <em>%1</em>", array(1 => $this->_tags[$key])), 'success', array('expires' => 0));
index 51b036d393a7d32c132cac26f7ed93f1733bf50e..f7da94a4d43e5e9db82376843d7a3a290f709409 100644 (file)
@@ -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,
+      ),
+    ));
   }
 
 }
index 8182a2e6a1d0476187c890ba51889e6d5a8fcc7c..efb7415622e5ad727ebb5dc57068057d7d6cb12f 100644 (file)
@@ -271,7 +271,7 @@ class CRM_Activity_Page_AJAX {
         $contactType = $contactType == 'Contact' ? '' : $contactType;
         switch ($row['source']) {
           case 'caseRel':
-            $row['actions'] = '<a href="#editCaseRoleDialog" title="' . ts('Reassign %1', array(1 => $typeLabel)) . '" class="crm-hover-button case-miniform" data-contact_type="' . $contactType . '" data-rel_type="' . $row['relation_type'] . '_' . $row['relationship_direction'] . '" data-cid="'  . '" data-rel_id="' . $row['rel_id'] . '"data-key="' . CRM_Core_Key::get('civicrm/ajax/relation') . '">' .
+            $row['actions'] = '<a href="#editCaseRoleDialog" title="' . ts('Reassign %1', array(1 => $typeLabel)) . '" class="crm-hover-button case-miniform" data-contact_type="' . $contactType . '" data-rel_type="' . $row['relation_type'] . '_' . $row['relationship_direction'] . '" data-cid="' . '" data-rel_id="' . $row['rel_id'] . '"data-key="' . CRM_Core_Key::get('civicrm/ajax/relation') . '">' .
               '<i class="crm-i fa-pencil"></i>' .
               '</a>' .
               '<a href="#deleteCaseRoleDialog" title="' . ts('Remove %1', array(1 => $typeLabel)) . '" class="crm-hover-button case-miniform" data-contact_type="' . $contactType . '" data-rel_type="' . $row['relation_type'] . '_' . $row['relationship_direction'] . '" data-cid="' . $row['cid'] . '" data-key="' . CRM_Core_Key::get('civicrm/ajax/delcaserole') . '">' .
@@ -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();
index 3d083c76b3610faf466a159313e633284030ebcf..18d59de52d8c908a662732a520ef8d6083604657 100644 (file)
@@ -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])) {
index 457f12096e52d2a45a68298486466345448010fc..6fba6f79b9f14a3c06ae05083dd60a6fa1686475 100644 (file)
@@ -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;
       }
     }
 
index 3d79545be59a898fed4b9fb0bfcd80e4d7317a51..93052afceade06271723fffa7e79302eb29cf6c6 100644 (file)
@@ -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);
index f596ecd79a8375bc246b0f5355e89b4fb11c7697..8f718b1cb61e9960c5a4220f9979c18454d1f7bf 100644 (file)
@@ -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;
   }
 
index 53a442883642339afb3ad08a8875b0dd2be2906c..6bfe56ce430639e399b1fda509b7e0f2c8b77f10 100644 (file)
@@ -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 .= '<br/>' . ts('%3. There are some contacts who have this membership type assigned to them. Search for contacts with this membership type from <a href=\'%1\'>Find Members</a>. 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 <a href="%2">Advanced Search</a> 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 <a href=\'%1\'>Online Contribution page</a>. 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');
       }
index ec8fd490b1aff1f2767dd23eecbdbd29b662b531..6c1223923a2944bf71e315e7b247bbc367a7d1a8 100644 (file)
@@ -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'),
+        ),
+      ));
     }
   }
 
index 0ddedb633a5e3b78f6f3ee51b0c791da4cba772a..37f26d5b3cfbdddaa1f2a13477d2842a06f2a512 100644 (file)
@@ -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' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
-            'isDefault' => TRUE,
-          ),
-          array(
-            'type' => 'cancel',
-            'name' => ts('Cancel'),
-          ),
-        )
-      );
+        array(
+          'type' => 'next',
+          'name' => ts('Delete'),
+          'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
+          '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 -');
index 12640d12252a473f5434be38b95fb7dbfd30113f..2dcecf49bf20948b165703e896262263fb23f122 100644 (file)
@@ -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' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
-            'isDefault' => TRUE,
-          ),
-          array(
-            'type' => 'cancel',
-            'name' => ts('Cancel'),
-          ),
-        )
-      );
+        array(
+          'type' => 'next',
+          'name' => ts('Save'),
+          'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
+          'isDefault' => TRUE,
+        ),
+        array(
+          'type' => 'cancel',
+          'name' => ts('Cancel'),
+        ),
+      ));
     }
     else {
       parent::buildQuickForm();
index 2035463ff7bea92b30d021830eb62c7b45ca2c17..e3e4f09dc73efac877abcbe49ef8cc090481bc71 100644 (file)
@@ -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'),
+        ),
+      ));
     }
   }
 
index 12120b3bc285c8740a1b7780df5c22e7a8e3723d..b55ca2628dbfa656d3a7d74ac2eecec1979092d0 100644 (file)
@@ -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;
       }
index c98144ca34096ce0b89f0925ef842eedf731b15b..27bb15ae7a562489f80125d0c8a0b7fef12bdba7 100644 (file)
@@ -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' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
-          'isDefault' => TRUE,
-        ),
-      )
-    );
+      array(
+        'type' => 'cancel',
+        'name' => ts('Done'),
+        'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
+        'isDefault' => TRUE,
+      ),
+    ));
   }
 
 }
index bdf12dfaf5d1c195d6bd3057688ee0f4b7e70008..9267b117a007baaab54a72840e672c9795e79343 100644 (file)
@@ -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'),
+      ),
+    ));
   }
 
 }
index 9424dd5298034ebf64637632a467f84ea20e8fb2..e14212eb8cca729e9563a0f0fa260a5896f2df53 100644 (file)
@@ -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);
index 5e2638717ace8664b3bdcaf1304646e712d26e52..7a5a5a635b0e354771f13c849e11c47dfeed2334 100644 (file)
@@ -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']];
       }
index 0920d73e20e5994e27e835b141ad3f2ded89a2d0..6f4c3231ca9f06952bcf3e1c361777b024a55386 100644 (file)
@@ -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;
     }
 
index 4176c001a90b969582c2215036e994704eea18d8..1b85dca26b2a41aa7eeadfde40bb79ee2f5d62be 100644 (file)
@@ -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'),
+      ),
+    ));
   }
 
   /**
index 0bead844d677584d0ecbaf35b0eac0bbcee7f6b7..cfe7a3925833d03fba6053d02f96071d44e5b9e6 100644 (file)
@@ -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,
+      ),
+    ));
   }
 
 }
index a2b3d53ae0ff5bb9d5c63b7ce13b910808399b70..c9beaa82c53c57465f5720a31406ea1e353fab10 100644 (file)
@@ -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,
+      ),
+    ));
   }
 
 }
index 67fe9906ce4f1e7170f9cf0a08bcb6a854f6a8ea..24e48ec986cdef12fc714ec0924034b2e72951f3 100644 (file)
@@ -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' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
-          'isDefault' => TRUE,
-        ),
-        array(
-          'type' => 'cancel',
-          'name' => ts('Cancel'),
-        ),
-      )
-    );
+      array(
+        'type' => 'back',
+        'name' => ts('Previous'),
+      ),
+      array(
+        'type' => 'next',
+        'name' => ts('Continue'),
+        'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
+        '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.)') . '<br />';
+              )) . ' ' . ts('(OR Membership ID if update mode.)') . '<br />';
             }
           }
           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,
-              )) . '<br />';
+            )) . '<br />';
           }
         }
       }
index d374c49d45db3f442e83c27c3cce8e6a56bd6371..920ce53592972b549c8ab3512c0242b95c24a46a 100644 (file)
@@ -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);
index fd551b64445da5dfa707f071f270d605948a920a..91b3397ea71c2a64a163e7b47977561fb6f24905 100644 (file)
@@ -166,9 +166,9 @@ class CRM_Member_Page_Tab extends CRM_Core_Page {
         $membership[$dao->id]['auto_renew'] = 0;
       }
 
-      // if relevantcount 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');
index 8cdcd78e7969c575f3164b6f90a020a5d47788b3..f2bf0faa0cf0ca1bba88f9470a331532d63c507a 100644 (file)
@@ -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'])) {
index 2adda80da4eadd5c22a16d5daa37ba8c022ec81c..2c60e85a3e13d6bc9f20329729ad85884ec97014 100644 (file)
@@ -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");
index b3ec0f5398646109d5d08b4b1c9aaac83e607887..d0f8a98080156fd461888797f3f6670878e38e03 100644 (file)
@@ -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;
index cb8be72f3dd868e3ac77d328363a4511b897e181..b02055c3e750aee261fe41e7e02fad90f8ade195 100644 (file)
@@ -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);
index efba36cff8bbd73b38dca19e0b782772fdff8faa..2b8fafad55ad425ca944418a3c8d24f787c8383f 100644 (file)
@@ -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'),
+      ),
+    ));
   }
 
   /**
index 1fe1729e9c89e3077dd4604d5aac3998138f2b6b..87b955e9abbf8783b78a9ac99058ca824ae3f2cc 100644 (file)
@@ -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'),
+      ),
+    ));
   }
 
   /**
index e73f803b8f0e10619b54eda1c4b17dce6bd3d5d0..903e926aa37e9d8059f542a99a4839abcf76d02f 100644 (file)
@@ -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());
 
index 4f3c074d4e4ddafd92b61577f73474c3d0f267d3..08d3eaf614924ba72adcad1dfc4cb4eba65641aa 100644 (file)
@@ -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,
+          ),
+        ));
       }
     }
 
index 93761e6b9aa0bc5e17d506a9744766d9c1c8f4b0..a3b4f523b142755306883a3a4aaa7ba12dfef188 100644 (file)
@@ -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,
+      ),
+    ));
   }
 
 }
index 9e278f6c41e47858cb03a55ad53946c94c13c74d..a4234cd1dd7a91eca013f6c100e85c5332e7ebac 100644 (file)
@@ -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' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
-          'isDefault' => TRUE,
-        ),
-        array(
-          'type' => 'cancel',
-          'name' => ts('Cancel'),
-        ),
-      )
-    );
+      array(
+        'type' => 'next',
+        'name' => ts('Save'),
+        'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
+        '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');
index 6647f57a3e5bc09b59c1c7328994dbc129b73076..babd87a1bb7f1083784c60ef5045eb12bfd73ecb 100644 (file)
@@ -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 = '<div class="matching-contacts-found">';
             $duplicateContactsLinks .= ts('One matching contact was found. ', array(
-                'count' => count($contactLinks['rows']),
-                'plural' => '%count matching contacts were found.<br />',
-              ));
+              'count' => count($contactLinks['rows']),
+              'plural' => '%count matching contacts were found.<br />',
+            ));
             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 .= '</div>';
             $duplicateContactsLinks .= '<table class="matching-contacts-actions">';
index 00666418c8695e0e27ac514d858902b1a8b1f152..a06f79b7234c79d86681991c2bb616752bf94246 100644 (file)
@@ -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");
index d2db2a713541b4271173ee6f275038464aa78de7..e1d68d53f684c458a0baf9ff284fd52d229fbf8b 100644 (file)
@@ -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
index fbbaaaaddc56f635cbda91993d01c3f868d10a6c..7689b6ec7b66054b5260573d502c44987d4421bb 100644 (file)
@@ -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();
index ae46a19c1537d99d5564ebf28d4cc27a5a06f631..6a4fd0a0450173cd481c12882d6d44aa3f267443 100644 (file)
@@ -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
               );
             }
           }
index 064848ece856a519d3b1e5d8b71afdff5241c93f..acb5d76be8e77bade84069b23bd1076d9a2d0937 100644 (file)
@@ -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;
index ff1501a3ea99128aad130a1e04cae4e894617385..25dd50e7cb3eb84c4dbe956549447f5600c4df26 100644 (file)
@@ -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
index 4600431e9103945467a1f473d97fa4cab6b6d9e7..6082c835238a43b28c48ff950854f2d1b3d979d8 100644 (file)
@@ -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,
-          )) . ' <ul>' . implode('', $dataErrors) . '</ul>';
+        )) . ' <ul>' . implode('', $dataErrors) . '</ul>';
       }
     }
 
index fcea43ed06c1c66504c240e77de8f442e2818d74..42c9d58c9d1581cac173957df76f4b0bcdfb6db7 100644 (file)
@@ -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' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
-            'isDefault' => TRUE,
-          ),
-          array(
-            'type' => 'cancel',
-            'name' => ts('Cancel'),
-          ),
-        )
-      );
+        array(
+          'type' => 'next',
+          'name' => ts('Delete Profile Field'),
+          'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
+          '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,
+              ));
             }
           }
         }
index f75eded31deb2c06f6273223a0f2cc8501aef31d..f824edcba1fa1a5bbed0a44cfc9f15f181ac4e0e 100644 (file)
@@ -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' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
-            'isDefault' => TRUE,
-          ),
-          array(
-            'type' => 'cancel',
-            'name' => ts('Cancel'),
-          ),
-        )
-      );
+        array(
+          'type' => 'next',
+          'name' => $display,
+          'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
+          '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' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
-          'isDefault' => TRUE,
-        ),
-        array(
-          'type' => 'cancel',
-          'name' => ts('Cancel'),
-        ),
-      )
-    );
+      array(
+        'type' => 'next',
+        'name' => ts('Save'),
+        'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
+        'isDefault' => TRUE,
+      ),
+      array(
+        'type' => 'cancel',
+        'name' => ts('Cancel'),
+      ),
+    ));
 
     // views are implemented as frozen form
     if ($this->_action & CRM_Core_Action::VIEW) {
index 66bd90a3494fa55ae9cfd5e3a65997fa57162b0c..ed9ae0b4d20df8a69c5c32c6965ac6e07be9d579 100644 (file)
@@ -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,
+      ),
+    ));
   }
 
 }
index d877b1b5c702c47185b1da1e0b9e763eeb1418db..f6d22d45ccdf95507bce4f8fcb25e8ad340ab430 100644 (file)
@@ -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'],
       );