$financialTypeID = $defaultContributionTypeID;
}
-
if (CRM_Utils_Array::value('membership_source', $form->_params)) {
$membershipParams['contribution_source'] = $form->_params['membership_source'];
}
// 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(
);
}
-
-
// action is taken depending upon the mode
$membershipStatus = new CRM_Member_DAO_MembershipStatus();
$membershipStatus->copyValues($params);
* @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
$membershipDetails = array();
if (!$statusDate || $statusDate == 'today') {
- $statusDate = getDate();
+ $statusDate = getdate();
$statusDate = date('Ymd',
mktime($statusDate['hours'],
$statusDate['minutes'],
${$dat . 'Month'} + $membershipStatus->{$eve . '_event_adjust_interval'},
${$dat . 'Day'},
${$dat . 'Year'}
- ));
+ ));
}
// add in days
if ($membershipStatus->{$eve . '_event_adjust_unit'} == 'day') {
${$dat . 'Month'},
${$dat . 'Day'} + $membershipStatus->{$eve . '_event_adjust_interval'},
${$dat . 'Year'}
- ));
+ ));
}
// add in years
if ($membershipStatus->{$eve . '_event_adjust_unit'} == 'year') {
${$dat . 'Month'},
${$dat . 'Day'},
${$dat . 'Year'} + $membershipStatus->{$eve . '_event_adjust_interval'}
- ));
+ ));
}
// if no interval and unit, present
}
// 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
$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]
));
$day = substr($membershipTypeDetails['fixed_period_start_day'], -2);
$year += 1;
} else {
- $year = $year + ($numRenewTerms * $membershipTypeDetails['duration_interval']);
+ $year = $year + ($numRenewTerms * $membershipTypeDetails['duration_interval']);
}
break;
/** 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'])){
"ccr.contribution_status_id",
$op,
array_search(
- 'Cancelled',
+ 'Cancelled',
CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name')
),
"Integer"
$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);
}
* @param $row
* @param int $id
*/
- public static function searchAction(&$row, $id) {}
+ public static function searchAction(&$row, $id) {
+ }
/**
* @param $tables
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);
// 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 {
$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.'));
$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));
$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,
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');
}
$$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) {
//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();
}
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;
$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(
//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;
}
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',
$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;
$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[''];
/*
* 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
'minimum_fee'
), NULL, '%a');
-
$defaults['record_contribution'] = 0;
$defaults['num_terms'] = 1;
$defaults['send_receipt'] = 0;
if (!empty($values['auto_renew'])) {
$allMembershipInfo[$key]['auto_renew'] = $options[$values['auto_renew']];
+ }
}
}
- }
$this->assign('allMembershipInfo', json_encode($allMembershipInfo));
$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
);
}
- $now = CRM_Utils_Date::getToday( null, 'YmdHis');
+ $now = CRM_Utils_Date::getToday( NULL, 'YmdHis');
$this->convertDateFieldsToMySQL($formValues);
$this->assign('receive_date', $formValues['receive_date']);
$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'],
//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]
$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) {
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(
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"));
}
$this->_defaults['member_membership_type_id'] = array($membershipType => 1);
}
-
$cid = CRM_Utils_Request::retrieve('cid', 'Positive',
CRM_Core_DAO::$_nullObject
);
}
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 );
}
)
);
-
$this->assign('profileTitle', $this->_title);
$this->assign('componentIds', $this->_memberIds);
$fileFieldExists = FALSE;
* @see CRM_Core_Form::setDefaultValues()
*/
public function setDefaultValues() {
- return CRM_Contact_Form_Task_PDFLetterCommon::setDefaultValues();
+ return CRM_Contact_Form_Task_PDFLetterCommon::setDefaultValues();
}
/**
*
* @return void
*/
- public function preProcess() {}
+ public function preProcess() {
+ }
/**
* Build the form object
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;
$dataPatterns = $this->get('dataPatterns');
$hasLocationTypes = $this->get('fieldTypes');
-
/* Initialize all field usages to false */
foreach ($mapperKeys as $key) {
}
}
-
if (!empty($fields['saveMapping'])) {
$nameField = CRM_Utils_Array::value('saveMappingName', $fields);
if (empty($nameField)) {
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);
}
}
*
* @return void
*/
- public function fini() {}
+ public function fini() {
+ }
/**
* to calculate join, start and end dates
$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) {
_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
* @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
* @return array|null
*/
public function registerTab() {
- return array('title' => ts('Memberships'),
+ return array(
+ 'title' => ts('Memberships'),
'url' => 'membership',
'weight' => 30,
);
* @return array|null
*/
public function registerAdvancedSearchPane() {
- return array('title' => ts('Memberships'),
+ return array(
+ 'title' => ts('Memberships'),
'weight' => 30,
);
}
}
$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;
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,
);
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 {
$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();
}
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(
* @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;
- }
+ }
}
}
@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;
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') {
}
$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;
'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,
),