From: Tim Otten Date: Tue, 6 Jan 2015 21:21:22 +0000 (-0800) Subject: INFRA-132 - CRM/Member - phpcbf X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b09fe5ed5a5b5d235584467412936e24e9e694ce;p=civicrm-core.git INFRA-132 - CRM/Member - phpcbf --- diff --git a/CRM/Member/BAO/Membership.php b/CRM/Member/BAO/Membership.php index 7e87a995ba..c0e0044c8e 100644 --- a/CRM/Member/BAO/Membership.php +++ b/CRM/Member/BAO/Membership.php @@ -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( diff --git a/CRM/Member/BAO/MembershipStatus.php b/CRM/Member/BAO/MembershipStatus.php index 93f2f91c01..ef528a7d8b 100644 --- a/CRM/Member/BAO/MembershipStatus.php +++ b/CRM/Member/BAO/MembershipStatus.php @@ -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 } diff --git a/CRM/Member/BAO/MembershipType.php b/CRM/Member/BAO/MembershipType.php index 4867781bd8..062be223da 100644 --- a/CRM/Member/BAO/MembershipType.php +++ b/CRM/Member/BAO/MembershipType.php @@ -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'])){ diff --git a/CRM/Member/BAO/Query.php b/CRM/Member/BAO/Query.php index ccb28bb63a..17b2a689eb 100644 --- a/CRM/Member/BAO/Query.php +++ b/CRM/Member/BAO/Query.php @@ -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 diff --git a/CRM/Member/Form.php b/CRM/Member/Form.php index 3b79251379..c3b9dcda01 100644 --- a/CRM/Member/Form.php +++ b/CRM/Member/Form.php @@ -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 { diff --git a/CRM/Member/Form/Membership.php b/CRM/Member/Form/Membership.php index 504c870b6f..f7ea549083 100644 --- a/CRM/Member/Form/Membership.php +++ b/CRM/Member/Form/Membership.php @@ -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( diff --git a/CRM/Member/Form/MembershipBlock.php b/CRM/Member/Form/MembershipBlock.php index 7c21b99c24..264692408f 100644 --- a/CRM/Member/Form/MembershipBlock.php +++ b/CRM/Member/Form/MembershipBlock.php @@ -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['']; diff --git a/CRM/Member/Form/MembershipRenewal.php b/CRM/Member/Form/MembershipRenewal.php index fc6721f5f4..b54420d99a 100644 --- a/CRM/Member/Form/MembershipRenewal.php +++ b/CRM/Member/Form/MembershipRenewal.php @@ -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) { diff --git a/CRM/Member/Form/MembershipView.php b/CRM/Member/Form/MembershipView.php index 474d691c1f..5558b47c07 100644 --- a/CRM/Member/Form/MembershipView.php +++ b/CRM/Member/Form/MembershipView.php @@ -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")); } diff --git a/CRM/Member/Form/Search.php b/CRM/Member/Form/Search.php index 5405da423b..fd8f755c42 100644 --- a/CRM/Member/Form/Search.php +++ b/CRM/Member/Form/Search.php @@ -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 ); diff --git a/CRM/Member/Form/Task.php b/CRM/Member/Form/Task.php index 837031b8c8..2da2220560 100644 --- a/CRM/Member/Form/Task.php +++ b/CRM/Member/Form/Task.php @@ -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 ); } diff --git a/CRM/Member/Form/Task/Batch.php b/CRM/Member/Form/Task/Batch.php index 5c081ba222..ea61ee9148 100644 --- a/CRM/Member/Form/Task/Batch.php +++ b/CRM/Member/Form/Task/Batch.php @@ -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; diff --git a/CRM/Member/Form/Task/PDFLetter.php b/CRM/Member/Form/Task/PDFLetter.php index 6668c33918..e0801921f3 100644 --- a/CRM/Member/Form/Task/PDFLetter.php +++ b/CRM/Member/Form/Task/PDFLetter.php @@ -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(); } /** diff --git a/CRM/Member/Form/Task/Result.php b/CRM/Member/Form/Task/Result.php index f287252adc..be993f4443 100644 --- a/CRM/Member/Form/Task/Result.php +++ b/CRM/Member/Form/Task/Result.php @@ -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 diff --git a/CRM/Member/Import/Field.php b/CRM/Member/Import/Field.php index 4048c14326..2055d17bc2 100644 --- a/CRM/Member/Import/Field.php +++ b/CRM/Member/Import/Field.php @@ -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; diff --git a/CRM/Member/Import/Form/MapField.php b/CRM/Member/Import/Form/MapField.php index 4345b09973..f5c462f4cd 100644 --- a/CRM/Member/Import/Form/MapField.php +++ b/CRM/Member/Import/Form/MapField.php @@ -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)) { diff --git a/CRM/Member/Import/Parser/Membership.php b/CRM/Member/Import/Parser/Membership.php index a49e880189..1addb243d3 100644 --- a/CRM/Member/Import/Parser/Membership.php +++ b/CRM/Member/Import/Parser/Membership.php @@ -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 diff --git a/CRM/Member/Info.php b/CRM/Member/Info.php index 12c0c6e6f3..5b7a9313b0 100644 --- a/CRM/Member/Info.php +++ b/CRM/Member/Info.php @@ -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, ); } diff --git a/CRM/Member/Page/AJAX.php b/CRM/Member/Page/AJAX.php index 15b9bb002d..7c0aad0d9e 100644 --- a/CRM/Member/Page/AJAX.php +++ b/CRM/Member/Page/AJAX.php @@ -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; diff --git a/CRM/Member/Page/DashBoard.php b/CRM/Member/Page/DashBoard.php index 5a7f95f71d..f96d8a09f9 100644 --- a/CRM/Member/Page/DashBoard.php +++ b/CRM/Member/Page/DashBoard.php @@ -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, ); diff --git a/CRM/Member/Page/Tab.php b/CRM/Member/Page/Tab.php index 62a5d03ab8..96f634d1f9 100644 --- a/CRM/Member/Page/Tab.php +++ b/CRM/Member/Page/Tab.php @@ -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( diff --git a/CRM/Member/PseudoConstant.php b/CRM/Member/PseudoConstant.php index 5f729a6738..03415578db 100644 --- a/CRM/Member/PseudoConstant.php +++ b/CRM/Member/PseudoConstant.php @@ -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; - } + } } } diff --git a/CRM/Member/Selector/Search.php b/CRM/Member/Selector/Search.php index 632f8730cc..feeab4caa8 100644 --- a/CRM/Member/Selector/Search.php +++ b/CRM/Member/Selector/Search.php @@ -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, ),