INFRA-132 - CRM/Member - phpcbf
authorTim Otten <totten@civicrm.org>
Tue, 6 Jan 2015 21:21:22 +0000 (13:21 -0800)
committerTim Otten <totten@civicrm.org>
Tue, 6 Jan 2015 23:07:43 +0000 (15:07 -0800)
23 files changed:
CRM/Member/BAO/Membership.php
CRM/Member/BAO/MembershipStatus.php
CRM/Member/BAO/MembershipType.php
CRM/Member/BAO/Query.php
CRM/Member/Form.php
CRM/Member/Form/Membership.php
CRM/Member/Form/MembershipBlock.php
CRM/Member/Form/MembershipRenewal.php
CRM/Member/Form/MembershipView.php
CRM/Member/Form/Search.php
CRM/Member/Form/Task.php
CRM/Member/Form/Task/Batch.php
CRM/Member/Form/Task/PDFLetter.php
CRM/Member/Form/Task/Result.php
CRM/Member/Import/Field.php
CRM/Member/Import/Form/MapField.php
CRM/Member/Import/Parser/Membership.php
CRM/Member/Info.php
CRM/Member/Page/AJAX.php
CRM/Member/Page/DashBoard.php
CRM/Member/Page/Tab.php
CRM/Member/PseudoConstant.php
CRM/Member/Selector/Search.php

index 7e87a995ba04a28ded70b067634c034312770601..c0e0044c8e08eb38f528e0cfcde5931beb080e2a 100644 (file)
@@ -1333,7 +1333,6 @@ AND civicrm_membership.is_test = %2";
       $financialTypeID = $defaultContributionTypeID;
     }
 
-
     if (CRM_Utils_Array::value('membership_source', $form->_params)) {
       $membershipParams['contribution_source'] = $form->_params['membership_source'];
     }
@@ -2988,7 +2987,6 @@ WHERE      civicrm_membership.is_test = 0";
     // store contribution id
     $params['contribution_id'] = $contribution->id;
 
-
     //insert payment record for this membership
     if (empty($ids['contribution']) || !empty($params['is_recur'])) {
       CRM_Member_BAO_MembershipPayment::create(array(
index 93f2f91c01c8261f0fa6e7b8e1acebb8521667e1..ef528a7d8bf9e95b39e5f9203e8556c4a11101ef 100644 (file)
@@ -143,8 +143,6 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus {
       );
     }
 
-
-
     // action is taken depending upon the mode
     $membershipStatus = new CRM_Member_DAO_MembershipStatus();
     $membershipStatus->copyValues($params);
@@ -226,7 +224,7 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus {
    * @param string $joinDate
    *   Join date of the member whose membership status is to be calculated.
    * @param \date|string $statusDate status date of the member whose membership status is to be calculated.
-   * @param boolean $excludeIsAdmin
+   * @param bool $excludeIsAdminExclude the statuses those having is_admin = 1.
    *   Exclude the statuses those having is_admin = 1.
    * @param int $membershipTypeID
    * @param array $membership
@@ -241,7 +239,7 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus {
     $membershipDetails = array();
 
     if (!$statusDate || $statusDate == 'today') {
-      $statusDate = getDate();
+      $statusDate = getdate();
       $statusDate = date('Ymd',
         mktime($statusDate['hours'],
           $statusDate['minutes'],
@@ -308,7 +306,7 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus {
                     ${$dat . 'Month'} + $membershipStatus->{$eve . '_event_adjust_interval'},
                     ${$dat . 'Day'},
                     ${$dat . 'Year'}
-                  ));
+                ));
               }
               // add in days
               if ($membershipStatus->{$eve . '_event_adjust_unit'} == 'day') {
@@ -316,7 +314,7 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus {
                     ${$dat . 'Month'},
                     ${$dat . 'Day'} + $membershipStatus->{$eve . '_event_adjust_interval'},
                     ${$dat . 'Year'}
-                  ));
+                ));
               }
               // add in years
               if ($membershipStatus->{$eve . '_event_adjust_unit'} == 'year') {
@@ -324,7 +322,7 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus {
                     ${$dat . 'Month'},
                     ${$dat . 'Day'},
                     ${$dat . 'Year'} + $membershipStatus->{$eve . '_event_adjust_interval'}
-                  ));
+                ));
               }
               // if no interval and unit, present
             }
index 4867781bd89f589f6d213f6ad1a15580485d6300..062be223da472fbe2caaa4d2ef2cf2545efc2326 100644 (file)
@@ -394,7 +394,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType {
         // If so, set fixed_period_rollover TRUE so we increment end_date month below.
         $dateParts = explode('-', $actualStartDate);
         if ($dateParts[2] >= $membershipTypeDetails['fixed_period_rollover_day']){
-          $fixed_period_rollover = True;
+          $fixed_period_rollover = TRUE;
         }
 
         // Start date is always first day of actualStartDate month
@@ -510,7 +510,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType {
       $date  = explode('-', $date);
       $logStartDate = date('Y-m-d', mktime(0, 0, 0,
           (double) $date[1],
-          (double)($date[2] + 1),
+          (double) ($date[2] + 1),
           (double) $date[0]
         ));
 
@@ -527,7 +527,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType {
             $day = substr($membershipTypeDetails['fixed_period_start_day'], -2);
             $year += 1;
           } else {
-          $year = $year + ($numRenewTerms * $membershipTypeDetails['duration_interval']);
+            $year = $year + ($numRenewTerms * $membershipTypeDetails['duration_interval']);
           }
           break;
 
@@ -750,9 +750,9 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType {
   /** This function updates all price field value for quick config
    * price set which has membership type
    *
-   *  @param  integer      membership type id
+   * @param  integer      membership type id
    *
-   *  @param  integer      financial type id
+   * @param  integer      financial type id
    */
   public static function updateAllPriceFieldValue($membershipTypeId, $params) {
     if (!empty($params['minimum_fee'])){
index ccb28bb63ac417a84e7a51834018cf5ea719ac06..17b2a689eb0fc933182a59948481e29956621157 100644 (file)
@@ -253,7 +253,7 @@ class CRM_Member_BAO_Query {
             "ccr.contribution_status_id",
             $op,
             array_search(
-              'Cancelled', 
+              'Cancelled',
               CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name')
             ),
             "Integer"
@@ -439,7 +439,6 @@ class CRM_Member_BAO_Query {
       $form->_membershipType = &$form->addElement('checkbox', "member_membership_type_id[$id]", NULL, $Name);
     }
 
-
     foreach (CRM_Member_PseudoConstant::membershipStatus(NULL, NULL, 'label') as $sId => $sName) {
       $form->_membershipStatus = &$form->addElement('checkbox', "member_status_id[$sId]", NULL, $sName);
     }
@@ -485,7 +484,8 @@ class CRM_Member_BAO_Query {
    * @param $row
    * @param int $id
    */
-  public static function searchAction(&$row, $id) {}
+  public static function searchAction(&$row, $id) {
+  }
 
   /**
    * @param $tables
index 3b79251379fbe1ca2be501252ce2a608f6b07054..c3b9dcda01437f8f6a6ac24a2714d51d312c0bee 100644 (file)
@@ -59,7 +59,7 @@ class CRM_Member_Form extends CRM_Contribute_Form_AbstractEditPayment {
   protected $_fromEmails = array();
 
   public function preProcess() {
-    $this->_action = CRM_Utils_Request::retrieve('action', 'String',$this, FALSE, 'add');
+    $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'add');
     $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'membership');
     $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
     $this->_contactID = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
@@ -212,7 +212,7 @@ class CRM_Member_Form extends CRM_Contribute_Form_AbstractEditPayment {
     // here we store details in order to do that
     if (!empty($formValues['soft_credit_contact_id'])) {
       $this->_receiptContactId = $this->_contributorContactID = $formValues['soft_credit_contact_id'];
-       list( $this->_contributorDisplayName,
+      list( $this->_contributorDisplayName,
          $this->_contributorEmail ) = CRM_Contact_BAO_Contact_Location::getEmailDetails( $this->_contributorContactID );
     }
     else {
index 504c870b6f1cd0f5de7be4802854e601514c5225..f7ea549083273a9e087df935d3a7540500bd7eaf 100644 (file)
@@ -117,7 +117,6 @@ class CRM_Member_Form_Membership extends CRM_Member_Form {
     $this->set('priceSetId', $this->_priceSetId);
     $this->assign('priceSetId', $this->_priceSetId);
 
-
     // check for edit permission
     if (!CRM_Core_Permission::checkActionPermission('CiviMember', $this->_action)) {
       CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
@@ -373,7 +372,7 @@ class CRM_Member_Form_Membership extends CRM_Member_Form {
     $this->assign('taxRates', json_encode(CRM_Core_PseudoConstant::getTaxRates()));
     $config = CRM_Core_Config::singleton();
     $this->assign('currency', $config->defaultCurrencySymbol);
-    $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,'contribution_invoice_settings');
+    $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
     $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
     if (isset($invoicing)){
       $this->assign('taxTerm', CRM_Utils_Array::value('tax_term', $invoiceSettings));
@@ -686,7 +685,6 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
     $this->addSelect('soft_credit_type_id', array('entity' => 'contribution_soft'));
     $this->addEntityRef('soft_credit_contact_id', ts('Payment From'), array('create' => TRUE));
 
-
     $this->addElement('checkbox',
       'send_receipt',
       ts('Send Confirmation and Receipt?'), NULL,
@@ -889,7 +887,7 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
             foreach($tmp_statuses as $cur_stat) {
               $status_ids[] = $cur_stat['id'];
             }
-            if (empty($params['status_id']) || in_array( $params['status_id'] , $status_ids) == false) {
+            if (empty($params['status_id']) || in_array( $params['status_id'], $status_ids) == FALSE) {
               $errors['status_id'] = ts('Please enter a status that does NOT represent a current membership status.');
               $errors['is_override']  = ts('This must be checked because you set an End Date for a lifetime membership');
             }
@@ -1108,7 +1106,7 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
       $$dateVariable = CRM_Utils_Date::processDate($formValues[$dateField]);
     }
 
-    $memTypeNumTerms =  empty($termsByType) ? CRM_Utils_Array::value('num_terms', $formValues) : NULL;
+    $memTypeNumTerms = empty($termsByType) ? CRM_Utils_Array::value('num_terms', $formValues) : NULL;
 
     $calcDates = array();
     foreach ($this->_memTypeSelected as $memType) {
@@ -1265,7 +1263,6 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
       //get the payment processor id as per mode.
       $params['payment_processor_id'] = $this->_params['payment_processor_id'] = $formValues['payment_processor_id'] = $this->_paymentProcessor['id'];
 
-
       $now = date('YmdHis');
       $fields = array();
 
@@ -1579,7 +1576,7 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
     }
 
     if (!empty($lineItem[$priceSetId])) {
-      $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,'contribution_invoice_settings');
+      $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
       $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
       $taxAmount = FALSE;
       $totalTaxAmount = 0;
@@ -1844,10 +1841,10 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
     $prefixValue = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
     $invoicing = CRM_Utils_Array::value('invoicing', $prefixValue);
     if ((!empty($taxAmt) || isset($eventTaxAmt)) && (isset($invoicing) && isset($prefixValue['is_email_pdf']))) {
-      $isEmailPdf = True;
+      $isEmailPdf = TRUE;
     }
     else {
-      $isEmailPdf = False;
+      $isEmailPdf = FALSE;
     }
 
     list($mailSend, $subject, $message, $html) = CRM_Core_BAO_MessageTemplate::sendTemplate(
index 7c21b99c2464541ee6544baeed6d6ae6fbc22e73..264692408f1f91cb5e6dbce5860504c80bf5bd9f 100644 (file)
@@ -156,7 +156,7 @@ class CRM_Member_Form_MembershipBlock extends CRM_Contribute_Form_ContributionPa
             //CRM-15573
             if($autoRenew == 2) {
               $this->freeze("auto_renew_$k");
-              $params['id'] = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipBlock', $this->_id , 'id', 'entity_id');
+              $params['id'] = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipBlock', $this->_id, 'id', 'entity_id');
             }
             $this->_renewOption[$k] = $autoRenew;
           }
@@ -226,19 +226,19 @@ class CRM_Member_Form_MembershipBlock extends CRM_Contribute_Form_ContributionPa
 
     if (!empty($params['member_price_set_id'])) {
       //check if this price set has membership type both auto-renew and non-auto-renew memberships.
-      $bothTypes =  CRM_Price_BAO_PriceSet::checkMembershipPriceSet($params['member_price_set_id']);
+      $bothTypes = CRM_Price_BAO_PriceSet::checkMembershipPriceSet($params['member_price_set_id']);
 
       //check for supporting payment processors
       //if both auto-renew and non-auto-renew memberships
       if ($bothTypes) {
-          $paymentProcessorIds = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage',
+        $paymentProcessorIds = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage',
             $contributionPageId, 'payment_processor'
             );
 
-          $paymentProcessorId = explode(CRM_Core_DAO::VALUE_SEPARATOR, $paymentProcessorIds);
+        $paymentProcessorId = explode(CRM_Core_DAO::VALUE_SEPARATOR, $paymentProcessorIds);
 
         if (!empty($paymentProcessorId)) {
-          $paymentProcessorType = CRM_Core_PseudoConstant::paymentProcessorType(false, null, 'name');
+          $paymentProcessorType = CRM_Core_PseudoConstant::paymentProcessorType(FALSE, NULL, 'name');
           foreach($paymentProcessorId as $pid) {
             if ($pid) {
               $paymentProcessorTypeId = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessor',
@@ -359,7 +359,7 @@ class CRM_Member_Form_MembershipBlock extends CRM_Contribute_Form_ContributionPa
             $setParams['name'] = $pageTitle . '_' . $this->_id;
           }
           else {
-            $timeSec = explode(".", microtime(true));
+            $timeSec = explode(".", microtime(TRUE));
             $setParams['name'] = $pageTitle . '_' . date('is', $timeSec[0]) . $timeSec[1];
           }
           $setParams['is_quick_config'] = 1;
@@ -420,7 +420,7 @@ class CRM_Member_Form_MembershipBlock extends CRM_Contribute_Form_ContributionPa
           $fieldParams['option_weight'][$rowCount]      = CRM_Utils_Array::value('weight', $membetype);
           $fieldParams['option_description'][$rowCount] = CRM_Utils_Array::value('description', $membetype);
           $fieldParams['default_option']                = CRM_Utils_Array::value('membership_type_default', $params);
-          $fieldParams['option_financial_type_id'] [$rowCount] = CRM_Utils_Array::value('financial_type_id', $membetype);
+          $fieldParams['option_financial_type_id'][$rowCount] = CRM_Utils_Array::value('financial_type_id', $membetype);
 
           $fieldParams['membership_type_id'][$rowCount] = $memType;
           // [$rowCount] = $membetype[''];
index fc6721f5f4d975e1d23989e1fc173004bb20ef7b..b54420d99ab76aafb9fc69b9cee78e7f21c4ea52 100644 (file)
@@ -41,31 +41,31 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form {
   /*
    * Display name of the member
    */
-  protected $_memberDisplayName = null;
+  protected $_memberDisplayName = NULL;
   /*
   * email of the person paying for the membership (used for receipts)
   */
-  protected $_memberEmail = null;
+  protected $_memberEmail = NULL;
   /*
   * Contact ID of the member
   */
-  public $_contactID = null;
+  public $_contactID = NULL;
   /*
   * Display name of the person paying for the membership (used for receipts)
   */
-  protected $_contributorDisplayName = null;
- /*
+  protected $_contributorDisplayName = NULL;
 /*
   * email of the person paying for the membership (used for receipts)
   */
-  protected $_contributorEmail = null;
+  protected $_contributorEmail = NULL;
   /*
   * email of the person paying for the membership (used for receipts)
   */
-  protected $_contributorContactID = null;
- /*
+  protected $_contributorContactID = NULL;
 /*
   * ID of the person the receipt is to go to
   */
-  protected $_receiptContactId = null;
+  protected $_receiptContactId = NULL;
   /*
    * context would be set to standalone if the contact is use is being selected from
    * the form rather than in the URL
@@ -187,7 +187,6 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form {
         'minimum_fee'
       ), NULL, '%a');
 
-
     $defaults['record_contribution'] = 0;
     $defaults['num_terms'] = 1;
     $defaults['send_receipt'] = 0;
@@ -300,9 +299,9 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form {
 
         if (!empty($values['auto_renew'])) {
           $allMembershipInfo[$key]['auto_renew'] = $options[$values['auto_renew']];
+        }
       }
     }
-    }
 
     $this->assign('allMembershipInfo', json_encode($allMembershipInfo));
 
@@ -446,8 +445,8 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
       $this->addElement('checkbox', 'contribution_contact', ts('Record Payment from a Different Contact?'));
       $this->addSelect('soft_credit_type_id', array('entity' => 'contribution_soft'));
       $this->addEntityRef('soft_credit_contact_id', ts('Payment From'), array('create' => TRUE));
-  }
     }
+  }
 
   /**
    * Validation
@@ -507,7 +506,7 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
       );
     }
 
-    $now = CRM_Utils_Date::getToday( null, 'YmdHis');
+    $now = CRM_Utils_Date::getToday( NULL, 'YmdHis');
     $this->convertDateFieldsToMySQL($formValues);
     $this->assign('receive_date', $formValues['receive_date']);
 
@@ -524,7 +523,7 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
           $this->_memType, 'minimum_fee'
         ));
       if (empty($formValues['financial_type_id'])) {
-        $formValues['financial_type_id'] = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $this->_memType,'financial_type_id');
+        $formValues['financial_type_id'] = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $this->_memType, 'financial_type_id');
       }
 
       $this->_paymentProcessor = CRM_Financial_BAO_PaymentProcessor::getPayment($formValues['payment_processor_id'],
@@ -679,7 +678,7 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
 
       //create line items
       $lineItem = array();
-      $priceSetId = null;
+      $priceSetId = NULL;
       CRM_Member_BAO_Membership::createLineItems($this, $formValues['membership_type_id'], $priceSetId);
       CRM_Price_BAO_PriceSet::processAmount($this->_priceSet['fields'],
         $this->_params, $lineItem[$priceSetId]
@@ -820,7 +819,7 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
     $statusMsg = ts('%1 membership for %2 has been renewed.', array(1 => $memType, 2 => $this->_memberDisplayName));
 
     if ($endDate) {
-      $statusMsg .= ' ' . ts('The new membership End Date is %1.', array(1 => CRM_Utils_Date::customFormat(substr($endDate,0,8))));
+      $statusMsg .= ' ' . ts('The new membership End Date is %1.', array(1 => CRM_Utils_Date::customFormat(substr($endDate, 0, 8))));
     }
 
     if ($receiptSend && $mailSend) {
index 474d691c1fae8bfcdbb05e868a095e1789a30018..5558b47c0702254d172bea64dbb104c5d43087c7 100644 (file)
@@ -106,6 +106,7 @@ class CRM_Member_Form_MembershipView extends CRM_Core_Form {
         CRM_Core_Session::setStatus(ts('Related membership for %1 has been deleted.', array(1 => $relatedDisplayName)),
           ts('Membership Deleted'), 'success');
         break;
+
       case 'create':
         $ids = array();
         $params = array(
@@ -127,6 +128,7 @@ class CRM_Member_Form_MembershipView extends CRM_Core_Form {
         CRM_Core_Session::setStatus(ts('Related membership for %1 has been created.', array(1 => $relatedDisplayName)),
           ts('Membership Added'), 'success');
         break;
+
       default:
         CRM_Core_Error::fatal(ts("Invalid action specified in URL"));
     }
index 5405da423bd6ac211f29bc9c713e76231fd76dc7..fd8f755c427249638a9c5ead60347e2f82b8752b 100644 (file)
@@ -300,7 +300,6 @@ class CRM_Member_Form_Search extends CRM_Core_Form_Search {
       $this->_defaults['member_membership_type_id'] = array($membershipType => 1);
     }
 
-
     $cid = CRM_Utils_Request::retrieve('cid', 'Positive',
       CRM_Core_DAO::$_nullObject
     );
index 837031b8c8381d8edb4881621421b06cdb975dff..2da2220560701d81cb0066113dca20cd8169e674 100644 (file)
@@ -108,7 +108,7 @@ class CRM_Member_Form_Task extends CRM_Core_Form {
     }
     else {
       $queryParams = $form->get('queryParams');
-      $sortOrder = null;
+      $sortOrder = NULL;
       if ( $form->get( CRM_Utils_Sort::SORT_ORDER  ) ) {
         $sortOrder = $form->get( CRM_Utils_Sort::SORT_ORDER );
       }
index 5c081ba222b40dce78d292759205c48eb97e25dc..ea61ee9148ab33697190192a651057681381bf1a 100644 (file)
@@ -136,7 +136,6 @@ class CRM_Member_Form_Task_Batch extends CRM_Member_Form_Task {
       )
     );
 
-
     $this->assign('profileTitle', $this->_title);
     $this->assign('componentIds', $this->_memberIds);
     $fileFieldExists = FALSE;
index 6668c3391823e5f51fb4e7b564226840e855a4e2..e0801921f309c6becb1a194285e502e1f37e21c4 100644 (file)
@@ -68,7 +68,7 @@ class CRM_Member_Form_Task_PDFLetter extends CRM_Member_Form_Task {
    * @see CRM_Core_Form::setDefaultValues()
    */
   public function setDefaultValues() {
-    return  CRM_Contact_Form_Task_PDFLetterCommon::setDefaultValues();
+    return CRM_Contact_Form_Task_PDFLetterCommon::setDefaultValues();
   }
 
   /**
index f287252adc67ecb02cdc1fe5a1626f898ffcf4b0..be993f444372eba423c9324b481888fc3b78a991 100644 (file)
@@ -45,7 +45,8 @@ class CRM_Member_Form_Task_Result extends CRM_Member_Form_Task {
    *
    * @return void
    */
-  public function preProcess() {}
+  public function preProcess() {
+  }
 
   /**
    * Build the form object
index 4048c14326eb4765531e6efa7ae669b3ab9a0801..2055d17bc200d5a5cd06db5316e098a03cb8a9c1 100644 (file)
@@ -198,7 +198,7 @@ class CRM_Member_Import_Field {
       if (!array_key_exists($customFieldID, $customFields)) {
         return FALSE;
       }
-            return CRM_Core_BAO_CustomValue::typecheck($customFields[$customFieldID]['data_type'], $this->_value);
+      return CRM_Core_BAO_CustomValue::typecheck($customFields[$customFieldID]['data_type'], $this->_value);
     }
 
     return TRUE;
index 4345b09973affa2eb76277b429c6d677e22061f1..f5c462f4cd244071c61262bf325a9967bc11dddf 100644 (file)
@@ -170,7 +170,6 @@ class CRM_Member_Import_Form_MapField extends CRM_Import_Form_MapField {
     $dataPatterns     = $this->get('dataPatterns');
     $hasLocationTypes = $this->get('fieldTypes');
 
-
     /* Initialize all field usages to false */
 
     foreach ($mapperKeys as $key) {
@@ -373,7 +372,6 @@ class CRM_Member_Import_Form_MapField extends CRM_Import_Form_MapField {
       }
     }
 
-
     if (!empty($fields['saveMapping'])) {
       $nameField = CRM_Utils_Array::value('saveMappingName', $fields);
       if (empty($nameField)) {
index a49e8801898deeb9a8c0f28beed11c28ec57aaa0..1addb243d34cbb41111e7b3473864617940eda25 100644 (file)
@@ -316,10 +316,10 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser {
               break;
           }
           if ($customFieldID = CRM_Core_BAO_CustomField::getKeyID($key)) {
-                      if ( $customFields[$customFieldID]['data_type'] == 'Date' ) {
+            if ( $customFields[$customFieldID]['data_type'] == 'Date' ) {
               CRM_Contact_Import_Parser_Contact::formatCustomDate($params, $formatted, $dateType, $key);
               unset($params[$key]);
-                      } else if ( $customFields[$customFieldID]['data_type'] == 'Boolean' ) {
+            } else if ( $customFields[$customFieldID]['data_type'] == 'Boolean' ) {
               $params[$key] = CRM_Utils_String::strtoboolstr($val);
             }
           }
@@ -579,7 +579,8 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser {
    *
    * @return void
    */
-  public function fini() {}
+  public function fini() {
+  }
 
   /**
    *  to calculate join, start and end dates
@@ -647,8 +648,8 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser {
         $values[$key] = $value;
         $type = $customFields[$customFieldID]['html_type'];
         if( $type == 'CheckBox' || $type == 'Multi-Select' || $type == 'AdvMulti-Select') {
-          $mulValues = explode( ',' , $value );
-          $customOption = CRM_Core_BAO_CustomOption::getCustomOption($customFieldID, true);
+          $mulValues = explode( ',', $value );
+          $customOption = CRM_Core_BAO_CustomOption::getCustomOption($customFieldID, TRUE);
           $values[$key] = array();
           foreach( $mulValues as $v1 ) {
             foreach($customOption as $customValueID => $customLabel) {
@@ -738,7 +739,6 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser {
 
     _civicrm_api3_custom_format_params($params, $values, 'Membership');
 
-
     if ($create) {
       // CRM_Member_BAO_Membership::create() handles membership_start_date,
       // membership_end_date and membership_source. So, if $values contains
index 12c0c6e6f3f2453b70d678654b3fc45bcea862f1..5b7a9313b07240d808b19311dc80d96d02b10c5b 100644 (file)
@@ -102,7 +102,8 @@ class CRM_Member_Info extends CRM_Core_Component_Info {
    * @return array|null
    */
   public function getUserDashboardElement() {
-    return array('name' => ts('Memberships'),
+    return array(
+    'name' => ts('Memberships'),
       'title' => ts('Your Membership(s)'),
       // this is CiviContribute specific permission, since
       // there is no permission that could be checked for
@@ -125,7 +126,8 @@ class CRM_Member_Info extends CRM_Core_Component_Info {
    * @return array|null
    */
   public function registerTab() {
-    return array('title' => ts('Memberships'),
+    return array(
+    'title' => ts('Memberships'),
       'url' => 'membership',
       'weight' => 30,
     );
@@ -144,7 +146,8 @@ class CRM_Member_Info extends CRM_Core_Component_Info {
    * @return array|null
    */
   public function registerAdvancedSearchPane() {
-    return array('title' => ts('Memberships'),
+    return array(
+    'title' => ts('Memberships'),
       'weight' => 30,
     );
   }
index 15b9bb002de377f1c184c8a6deb29b6f02f6c02e..7c0aad0d9e7deb351d84ad2e042b32ba31443309 100644 (file)
@@ -51,12 +51,12 @@ class CRM_Member_Page_AJAX {
     }
     $memType = CRM_Utils_Type::escape($_POST['mtype'], 'Integer');
 
-        $query = "SELECT name, minimum_fee AS total_amount, financial_type_id, auto_renew
+    $query = "SELECT name, minimum_fee AS total_amount, financial_type_id, auto_renew
 FROM    civicrm_membership_type
 WHERE   id = %1";
 
     $dao = CRM_Core_DAO::executeQuery($query, array(1 => array($memType, 'Positive')));
-        $properties = array( 'financial_type_id', 'total_amount', 'name', 'auto_renew' );
+    $properties = array( 'financial_type_id', 'total_amount', 'name', 'auto_renew' );
     while ($dao->fetch()) {
       foreach ($properties as $property) {
         $details[$property] = $dao->$property;
index 5a7f95f71de1916047d7660dd04b1222b65642f7..f96d8a09f9258880a21c1ddd851bcfd4cb54ac99 100644 (file)
@@ -102,65 +102,76 @@ class CRM_Member_Page_DashBoard extends CRM_Core_Page {
 
     foreach ($membershipTypes as $key => $value) {
 
-      $membershipSummary[$key]['premonth']['new'] = array('count' => CRM_Member_BAO_Membership::getMembershipJoins($key, $preMonth, $preMonthEnd),
+      $membershipSummary[$key]['premonth']['new'] = array(
+      'count' => CRM_Member_BAO_Membership::getMembershipJoins($key, $preMonth, $preMonthEnd),
         'name' => $value,
       );
 
-      $membershipSummary[$key]['premonth']['renew'] = array('count' => CRM_Member_BAO_Membership::getMembershipRenewals($key, $preMonth, $preMonthEnd),
+      $membershipSummary[$key]['premonth']['renew'] = array(
+      'count' => CRM_Member_BAO_Membership::getMembershipRenewals($key, $preMonth, $preMonthEnd),
         'name' => $value,
       );
 
-      $membershipSummary[$key]['premonth']['total'] = array('count' => CRM_Member_BAO_Membership::getMembershipStarts($key, $preMonth, $preMonthEnd),
+      $membershipSummary[$key]['premonth']['total'] = array(
+      'count' => CRM_Member_BAO_Membership::getMembershipStarts($key, $preMonth, $preMonthEnd),
         'name' => $value,
       );
 
-
-      $membershipSummary[$key]['month']['new'] = array('count' => CRM_Member_BAO_Membership::getMembershipJoins($key, $monthStart, $ymd),
+      $membershipSummary[$key]['month']['new'] = array(
+      'count' => CRM_Member_BAO_Membership::getMembershipJoins($key, $monthStart, $ymd),
         'name' => $value,
       );
 
-      $membershipSummary[$key]['month']['renew'] = array('count' => CRM_Member_BAO_Membership::getMembershipRenewals($key, $monthStart, $ymd),
+      $membershipSummary[$key]['month']['renew'] = array(
+      'count' => CRM_Member_BAO_Membership::getMembershipRenewals($key, $monthStart, $ymd),
         'name' => $value,
       );
 
-      $membershipSummary[$key]['month']['total'] = array('count' => CRM_Member_BAO_Membership::getMembershipStarts($key, $monthStart, $ymd),
+      $membershipSummary[$key]['month']['total'] = array(
+      'count' => CRM_Member_BAO_Membership::getMembershipStarts($key, $monthStart, $ymd),
         'name' => $value,
       );
 
-
-      $membershipSummary[$key]['year']['new'] = array('count' => CRM_Member_BAO_Membership::getMembershipJoins($key, $yearStart, $ymd),
+      $membershipSummary[$key]['year']['new'] = array(
+      'count' => CRM_Member_BAO_Membership::getMembershipJoins($key, $yearStart, $ymd),
         'name' => $value,
       );
 
-      $membershipSummary[$key]['year']['renew'] = array('count' => CRM_Member_BAO_Membership::getMembershipRenewals($key, $yearStart, $ymd),
+      $membershipSummary[$key]['year']['renew'] = array(
+      'count' => CRM_Member_BAO_Membership::getMembershipRenewals($key, $yearStart, $ymd),
         'name' => $value,
       );
 
-      $membershipSummary[$key]['year']['total'] = array('count' => CRM_Member_BAO_Membership::getMembershipStarts($key, $yearStart, $ymd),
+      $membershipSummary[$key]['year']['total'] = array(
+      'count' => CRM_Member_BAO_Membership::getMembershipStarts($key, $yearStart, $ymd),
         'name' => $value,
       );
 
-
-      $membershipSummary[$key]['current']['total'] = array('count' => CRM_Member_BAO_Membership::getMembershipCount($key, $current),
+      $membershipSummary[$key]['current']['total'] = array(
+      'count' => CRM_Member_BAO_Membership::getMembershipCount($key, $current),
         'name' => $value,
       );
 
       $membershipSummary[$key]['total']['total'] = array('count' => CRM_Member_BAO_Membership::getMembershipCount($key, $ymd));
 
       //LCD also get summary stats for membership owners
-      $membershipSummary[$key]['premonth_owner']['premonth_owner'] = array('count' => CRM_Member_BAO_Membership::getMembershipStarts($key, $preMonth, $preMonthEnd, 0, 1),
+      $membershipSummary[$key]['premonth_owner']['premonth_owner'] = array(
+      'count' => CRM_Member_BAO_Membership::getMembershipStarts($key, $preMonth, $preMonthEnd, 0, 1),
         'name' => $value,
       );
 
-      $membershipSummary[$key]['month_owner']['month_owner'] = array('count' => CRM_Member_BAO_Membership::getMembershipStarts($key, $monthStart, $ymd, 0, 1),
+      $membershipSummary[$key]['month_owner']['month_owner'] = array(
+      'count' => CRM_Member_BAO_Membership::getMembershipStarts($key, $monthStart, $ymd, 0, 1),
         'name' => $value,
       );
 
-      $membershipSummary[$key]['year_owner']['year_owner'] = array('count' => CRM_Member_BAO_Membership::getMembershipStarts($key, $yearStart, $ymd, 0, 1),
+      $membershipSummary[$key]['year_owner']['year_owner'] = array(
+      'count' => CRM_Member_BAO_Membership::getMembershipStarts($key, $yearStart, $ymd, 0, 1),
         'name' => $value,
       );
 
-      $membershipSummary[$key]['current_owner']['current_owner'] = array('count' => CRM_Member_BAO_Membership::getMembershipCount($key, $current, 0, 1),
+      $membershipSummary[$key]['current_owner']['current_owner'] = array(
+      'count' => CRM_Member_BAO_Membership::getMembershipCount($key, $current, 0, 1),
         'name' => $value,
       );
 
index 62a5d03ab8b789dc67091b230aa13abd4a509820..96f634d1f944cebd4d67d9f0cf6a24c3db104e0e 100644 (file)
@@ -167,9 +167,7 @@ class CRM_Member_Page_Tab extends CRM_Core_Page {
   WHERE m.owner_membership_id = {$dao->id} AND m.is_test = 0 AND ms.is_current_member = 1 AND ct.is_deleted = 0";
         $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))
+        $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))
         );
       }
       else {
@@ -351,7 +349,7 @@ class CRM_Member_Page_Tab extends CRM_Core_Page {
       $this->view();
     }
     elseif ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD | CRM_Core_Action::DELETE
       | CRM_Core_Action::RENEW)) {
+ | CRM_Core_Action::RENEW)) {
       self::setContext($this);
       $this->edit();
     }
@@ -518,7 +516,6 @@ class CRM_Member_Page_Tab extends CRM_Core_Page {
       self::$_links['all'] = self::$_links['view'] + $extraLinks;
     }
 
-
     if ($isCancelSupported) {
       $cancelMessage = ts('WARNING: If you cancel the recurring contribution associated with this membership, the membership will no longer be renewed automatically. However, the current membership status will not be affected.');
       self::$_links['all'][CRM_Core_Action::DISABLE] = array(
index 5f729a673858667e25ba270ed5f408808534a399..03415578db831e34350f9702f840220a46bb7904 100644 (file)
@@ -130,8 +130,8 @@ class CRM_Member_PseudoConstant extends CRM_Core_PseudoConstant {
    * @param bool|string $name pseudoconstant to be flushed
    */
   public static function flush($name = 'cache') {
-   if (isset(self::$$name)) {
+    if (isset(self::$$name)) {
       self::$$name = NULL;
-    }
+   }
   }
 }
index 632f8730cc14ca22c86f67d0d99df2b544a892d5..feeab4caa8a6c53764237c2ba6b9d2efadff14fb 100644 (file)
@@ -148,11 +148,11 @@ class CRM_Member_Selector_Search extends CRM_Core_Selector_Base implements CRM_C
   @access public
    */
   function __construct(&$queryParams,
-    $action       = CRM_Core_Action::NONE,
+    $action = CRM_Core_Action::NONE,
     $memberClause = NULL,
-    $single       = FALSE,
-    $limit        = NULL,
-    $context      = 'search'
+    $single = FALSE,
+    $limit = NULL,
+    $context = 'search'
   ) {
     // submitted form values
     $this->_queryParams = &$queryParams;
@@ -197,9 +197,9 @@ class CRM_Member_Selector_Search extends CRM_Core_Selector_Base implements CRM_C
   function &links($status = 'all',
     $isPaymentProcessor = NULL,
     $accessContribution = NULL,
-    $qfKey              = NULL,
-    $context            = NULL,
-    $isCancelSupported  = FALSE
+    $qfKey = NULL,
+    $context = NULL,
+    $isCancelSupported = FALSE
   ) {
     $extraParams = NULL;
     if ($context == 'search') {
@@ -437,8 +437,7 @@ class CRM_Member_Selector_Search extends CRM_Core_Selector_Base implements CRM_C
       }
       $row['auto_renew'] = $autoRenew;
 
-      $row['contact_type'] = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ?
-        $result->contact_sub_type : $result->contact_type, FALSE, $result->contact_id
+      $row['contact_type'] = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ? $result->contact_sub_type : $result->contact_type, FALSE, $result->contact_id
       );
 
       $rows[] = $row;
@@ -476,7 +475,8 @@ class CRM_Member_Selector_Search extends CRM_Core_Selector_Base implements CRM_C
           'sort' => 'membership_type',
           'direction' => CRM_Utils_Sort::DONTCARE,
         ),
-        array('name' => ts('Member Since'),
+        array(
+      'name' => ts('Member Since'),
           'sort' => 'join_date',
           'direction' => CRM_Utils_Sort::DESCENDING,
         ),