From cc28438b880132150ab6fda3f8d4864e50d76eaa Mon Sep 17 00:00:00 2001 From: Saurabh Batra Date: Fri, 2 Oct 2015 18:24:41 +0530 Subject: [PATCH] Comment fixes for CRM/Pledge direcctory. --- CRM/Pledge/BAO/Pledge.php | 75 +++++++++---------- CRM/Pledge/BAO/PledgeBlock.php | 16 ++-- CRM/Pledge/BAO/PledgePayment.php | 39 +++++----- CRM/Pledge/BAO/Query.php | 12 +-- CRM/Pledge/Controller/Search.php | 7 +- CRM/Pledge/Form/Payment.php | 23 ++---- CRM/Pledge/Form/Pledge.php | 69 +++++++---------- CRM/Pledge/Form/PledgeView.php | 11 +-- CRM/Pledge/Form/Search.php | 25 ++----- CRM/Pledge/Form/Task.php | 2 +- CRM/Pledge/Form/Task/Delete.php | 8 -- CRM/Pledge/Form/Task/Print.php | 16 +--- CRM/Pledge/Form/Task/Result.php | 10 +-- CRM/Pledge/Form/Task/SearchTaskHookSample.php | 6 -- CRM/Pledge/Info.php | 26 ++----- CRM/Pledge/Page/AJAX.php | 2 - CRM/Pledge/Page/DashBoard.php | 10 +-- CRM/Pledge/Page/Payment.php | 2 - CRM/Pledge/Page/Tab.php | 6 +- CRM/Pledge/Page/UserDashboard.php | 6 +- CRM/Pledge/Selector/Search.php | 10 +-- CRM/Pledge/StateMachine/Search.php | 2 - CRM/Pledge/Task.php | 10 +-- 23 files changed, 131 insertions(+), 262 deletions(-) diff --git a/CRM/Pledge/BAO/Pledge.php b/CRM/Pledge/BAO/Pledge.php index 9ddc83094d..23920741a5 100644 --- a/CRM/Pledge/BAO/Pledge.php +++ b/CRM/Pledge/BAO/Pledge.php @@ -29,8 +29,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ class CRM_Pledge_BAO_Pledge extends CRM_Pledge_DAO_Pledge { @@ -144,7 +142,7 @@ class CRM_Pledge_BAO_Pledge extends CRM_Pledge_DAO_Pledge { * @return CRM_Pledge_BAO_Pledge */ public static function &create(&$params) { - //FIXME: a cludgy hack to fix the dates to MySQL format + // FIXME: a cludgy hack to fix the dates to MySQL format $dateFields = array('start_date', 'create_date', 'acknowledge_date', 'modified_date', 'cancel_date', 'end_date'); foreach ($dateFields as $df) { if (isset($params[$df])) { @@ -160,10 +158,10 @@ class CRM_Pledge_BAO_Pledge extends CRM_Pledge_DAO_Pledge { $params['amount'] = $params['installment_amount'] * $params['installments']; } - //get All Payments status types. + // get All Payments status types. $paymentStatusTypes = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); - //update the pledge status only if it does NOT come from form + // update the pledge status only if it does NOT come from form if (!isset($params['pledge_status_id'])) { if (isset($params['contribution_id'])) { if ($params['installments'] > 1) { @@ -186,7 +184,7 @@ class CRM_Pledge_BAO_Pledge extends CRM_Pledge_DAO_Pledge { return $pledge; } - //handle custom data. + // handle custom data. if (!empty($params['custom']) && is_array($params['custom']) ) { @@ -196,12 +194,12 @@ class CRM_Pledge_BAO_Pledge extends CRM_Pledge_DAO_Pledge { // skip payment stuff inedit mode if (!isset($params['id']) || !empty($params['is_pledge_pending'])) { - //if pledge is pending delete all payments and recreate. + // if pledge is pending delete all payments and recreate. if (!empty($params['is_pledge_pending'])) { CRM_Pledge_BAO_PledgePayment::deletePayments($pledge->id); } - //building payment params + // building payment params $paymentParams['pledge_id'] = $pledge->id; $paymentKeys = array( 'amount', @@ -268,13 +266,13 @@ class CRM_Pledge_BAO_Pledge extends CRM_Pledge_DAO_Pledge { $transaction = new CRM_Core_Transaction(); - //check for no Completed Payment records with the pledge + // check for no Completed Payment records with the pledge $payment = new CRM_Pledge_DAO_PledgePayment(); $payment->pledge_id = $id; $payment->find(); while ($payment->fetch()) { - //also delete associated contribution. + // also delete associated contribution. if ($payment->contribution_id) { CRM_Contribute_BAO_Contribution::deleteContribution($payment->contribution_id); } @@ -311,7 +309,7 @@ class CRM_Pledge_BAO_Pledge extends CRM_Pledge_DAO_Pledge { public static function getTotalAmountAndCount($status = NULL, $startDate = NULL, $endDate = NULL) { $where = array(); $select = $from = $queryDate = NULL; - //get all status + // get all status $allStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); $statusId = array_search($status, $allStatus); @@ -452,7 +450,6 @@ GROUP BY currency * * @return array * return the list of pledge fields - * */ public static function getHonorContacts($honorId) { $params = array(); @@ -460,7 +457,7 @@ GROUP BY currency $honorDAO->contact_id = $honorId; $honorDAO->find(); - //get all status. + // get all status. while ($honorDAO->fetch()) { $pledgePaymentDAO = new CRM_Pledge_DAO_PledgePayment(); $pledgePaymentDAO->contribution_id = $honorDAO->contribution_id; @@ -496,17 +493,15 @@ GROUP BY currency * Form object. * @param array $params * An assoc array of name/value pairs. - * - * @return void */ public static function sendAcknowledgment(&$form, $params) { //handle Acknowledgment. $allPayments = $payments = array(); - //get All Payments status types. + // get All Payments status types. $paymentStatusTypes = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); $returnProperties = array('status_id', 'scheduled_amount', 'scheduled_date', 'contribution_id'); - //get all paymnets details. + // get all paymnets details. CRM_Core_DAO::commonRetrieveAll('CRM_Pledge_DAO_PledgePayment', 'pledge_id', $params['id'], $allPayments, $returnProperties); if (!empty($allPayments)) { @@ -530,7 +525,7 @@ GROUP BY currency ) ); - //get the first valid payment id. + // get the first valid payment id. if (!isset($form->paymentId) && ($paymentStatusTypes[$values['status_id']] == 'Pending' || $paymentStatusTypes[$values['status_id']] == 'Overdue' ) @@ -540,7 +535,7 @@ GROUP BY currency } } - //assign pledge fields value to template. + // assign pledge fields value to template. $pledgeFields = array( 'create_date', 'total_pledge_amount', @@ -557,12 +552,12 @@ GROUP BY currency } } - //assign all payments details. + // assign all payments details. if ($payments) { $form->assign('payments', $payments); } - //handle domain token values + // handle domain token values $domain = CRM_Core_BAO_Domain::getDomain(); $tokens = array( 'domain' => array('name', 'phone', 'address', 'email'), @@ -574,7 +569,7 @@ GROUP BY currency } $form->assign('domain', $domainValues); - //handle contact token values. + // handle contact token values. $ids = array($params['contact_id']); $fields = array_merge(array_keys(CRM_Contact_BAO_Contact::importableFields()), array('display_name', 'checksum', 'contact_id') @@ -590,7 +585,7 @@ GROUP BY currency ); $form->assign('contact', $details[0][$params['contact_id']]); - //handle custom data. + // handle custom data. if (!empty($params['hidden_custom'])) { $groupTree = CRM_Core_BAO_CustomGroup::getTree('Pledge', CRM_Core_DAO::$_nullObject, $params['id']); $pledgeParams = array(array('pledge_id', '=', $params['id'], 0, 0)); @@ -606,7 +601,7 @@ GROUP BY currency $customFields["custom_{$k}"] = $field; } - //to build array of customgroup & customfields in it + // to build array of customgroup & customfields in it CRM_Core_BAO_UFGroup::getValues($params['contact_id'], $customFields, $customValues, FALSE, $pledgeParams); $customGroup[$group['title']] = $customValues; } @@ -614,12 +609,12 @@ GROUP BY currency $form->assign('customGroup', $customGroup); } - //handle acknowledgment email stuff. + // handle acknowledgment email stuff. list($pledgerDisplayName, $pledgerEmail ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($params['contact_id']); - //check for online pledge. + // check for online pledge. if (!empty($params['receipt_from_email'])) { $userName = CRM_Utils_Array::value('receipt_from_name', $params); $userEmail = CRM_Utils_Array::value('receipt_from_email', $params); @@ -628,11 +623,11 @@ GROUP BY currency $receiptFrom = $params['from_email_id']; } elseif ($userID = CRM_Core_Session::singleton()->get('userID')) { - //check for logged in user. + // check for logged in user. list($userName, $userEmail) = CRM_Contact_BAO_Contact_Location::getEmailDetails($userID); } else { - //set the domain values. + // set the domain values. $userName = CRM_Utils_Array::value('name', $domainValues); $userEmail = CRM_Utils_Array::value('email', $domainValues); } @@ -652,8 +647,8 @@ GROUP BY currency ) ); - //check if activity record exist for this pledge - //Acknowledgment, if exist do not add activity. + // check if activity record exist for this pledge + // Acknowledgment, if exist do not add activity. $activityType = 'Pledge Acknowledgment'; $activity = new CRM_Activity_DAO_Activity(); $activity->source_record_id = $params['id']; @@ -681,7 +676,7 @@ GROUP BY currency 'campaign_id' => CRM_Utils_Array::value('campaign_id', $params), ); - //lets insert assignee record. + // lets insert assignee record. if (!empty($params['contact_id'])) { $activityParams['assignee_contact_id'] = $params['contact_id']; } @@ -708,7 +703,7 @@ GROUP BY currency $fields = array_merge($fields, CRM_Pledge_DAO_PledgePayment::export()); - //set title to calculated fields + // set title to calculated fields $calculatedFields = array( 'pledge_total_paid' => array('title' => ts('Total Paid')), 'pledge_balance_amount' => array('title' => ts('Balance Amount')), @@ -771,7 +766,7 @@ GROUP BY currency $status = array(); - //get pending and in progress status + // get pending and in progress status foreach (array( 'Pending', 'In Progress', @@ -830,7 +825,7 @@ GROUP BY currency $allStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); - //unset statues that we never use for pledges + // unset statues that we never use for pledges foreach (array( 'Completed', 'Cancelled', @@ -942,7 +937,7 @@ SELECT pledge.contact_id as contact_id, $domainValues[$token] = CRM_Utils_Token::getDomainTokenReplacement($token, $domain); } - //get the domain email address, since we don't carry w/ object. + // get the domain email address, since we don't carry w/ object. $domainValue = CRM_Core_BAO_Domain::getNameAndEmail(); $domainValues['email'] = $domainValue[1]; @@ -959,7 +954,7 @@ SELECT pledge.contact_id as contact_id, $template = CRM_Core_Smarty::singleton(); $template->assign('domain', $domainValues); - //set receipt from + // set receipt from $receiptFrom = '"' . $domainValues['name'] . '" <' . $domainValues['email'] . '>'; foreach ($pledgeDetails as $paymentId => $details) { @@ -1001,7 +996,7 @@ SELECT pledge.contact_id as contact_id, // 2. send acknowledgement mail if ($toEmail && !($doNotEmail || $onHold)) { - //assign value to template + // assign value to template $template->assign('amount_paid', $details['amount_paid'] ? $details['amount_paid'] : 0); $template->assign('contact', $contactDetails[$contactId]); $template->assign('next_payment', $details['scheduled_date']); @@ -1101,7 +1096,7 @@ SELECT pledge.contact_id as contact_id, /** * Is this pledge free from financial transactions (this is important to know as we allow editing * when no transactions have taken place - the editing process currently involves deleting all pledge payments & contributions - * & recreating so we want to block that if appropriate + * & recreating so we want to block that if appropriate). * * @param int $pledgeID * @param int $pledgeStatusID @@ -1110,8 +1105,8 @@ SELECT pledge.contact_id as contact_id, */ public static function pledgeHasFinancialTransactions($pledgeID, $pledgeStatusID) { if (empty($pledgeStatusID)) { - //why would this happen? If we can see where it does then we can see if we should look it up - //but assuming from form code it CAN be empty + // why would this happen? If we can see where it does then we can see if we should look it up. + // but assuming from form code it CAN be empty. return TRUE; } if (self::isTransactedStatus($pledgeStatusID)) { diff --git a/CRM/Pledge/BAO/PledgeBlock.php b/CRM/Pledge/BAO/PledgeBlock.php index 6d875e7147..06b4d98367 100644 --- a/CRM/Pledge/BAO/PledgeBlock.php +++ b/CRM/Pledge/BAO/PledgeBlock.php @@ -29,8 +29,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ class CRM_Pledge_BAO_PledgeBlock extends CRM_Pledge_DAO_PledgeBlock { @@ -107,7 +105,7 @@ class CRM_Pledge_BAO_PledgeBlock extends CRM_Pledge_DAO_PledgeBlock { $pledgeBlock = new CRM_Pledge_DAO_PledgeBlock(); - //fix for pledge_frequency_unit + // fix for pledge_frequency_unit $freqUnits = CRM_Utils_Array::value('pledge_frequency_unit', $params); if ($freqUnits && is_array($freqUnits)) { @@ -208,7 +206,7 @@ class CRM_Pledge_BAO_PledgeBlock extends CRM_Pledge_DAO_PledgeBlock { CRM_Core_DAO::commonRetrieveAll('CRM_Pledge_DAO_PledgePayment', 'pledge_id', $form->_values['pledge_id'], $allPayments, $returnProperties ); - //get all status + // get all status $allStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); $nextPayment = array(); @@ -229,7 +227,7 @@ class CRM_Pledge_BAO_PledgeBlock extends CRM_Pledge_DAO_PledgeBlock { elseif (!$isNextPayment && $allStatus[$value['status_id']] == 'Pending' ) { - //get the next payment. + // get the next payment. $nextPayment = array( 'id' => $payID, 'scheduled_amount' => CRM_Utils_Rule::cleanMoney($value['scheduled_amount']), @@ -242,7 +240,7 @@ class CRM_Pledge_BAO_PledgeBlock extends CRM_Pledge_DAO_PledgeBlock { } } - //build check box array for payments. + // build check box array for payments. $payments = array(); if (!empty($overduePayments)) { foreach ($overduePayments as $id => $payment) { @@ -261,7 +259,7 @@ class CRM_Pledge_BAO_PledgeBlock extends CRM_Pledge_DAO_PledgeBlock { )); $payments[$key] = CRM_Utils_Array::value('id', $nextPayment); } - //give error if empty or build form for payment. + // give error if empty or build form for payment. if (empty($payments)) { CRM_Core_Error::fatal(ts("Oops. It looks like there is no valid payment status for online payment.")); } @@ -274,7 +272,7 @@ class CRM_Pledge_BAO_PledgeBlock extends CRM_Pledge_DAO_PledgeBlock { $pledgeBlock = self::getPledgeBlock($form->_id); - //build form for pledge creation. + // build form for pledge creation. $pledgeOptions = array( '0' => ts('I want to make a one-time contribution'), '1' => ts('I pledge to contribute this amount every'), @@ -291,7 +289,7 @@ class CRM_Pledge_BAO_PledgeBlock extends CRM_Pledge_DAO_PledgeBlock { else { $form->add('hidden', 'pledge_frequency_interval', 1); } - //Frequency unit drop-down label suffixes switch from *ly to *(s) + // Frequency unit drop-down label suffixes switch from *ly to *(s) $freqUnitVals = explode(CRM_Core_DAO::VALUE_SEPARATOR, $pledgeBlock['pledge_frequency_unit']); $freqUnits = array(); $frequencyUnits = CRM_Core_OptionGroup::values('recur_frequency_units'); diff --git a/CRM/Pledge/BAO/PledgePayment.php b/CRM/Pledge/BAO/PledgePayment.php index 83ce0f07c7..4be274e4c4 100644 --- a/CRM/Pledge/BAO/PledgePayment.php +++ b/CRM/Pledge/BAO/PledgePayment.php @@ -29,8 +29,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ class CRM_Pledge_BAO_PledgePayment extends CRM_Pledge_DAO_PledgePayment { @@ -132,7 +130,7 @@ WHERE pledge_id = %1 } for ($i = 1; $i <= $params['installments']; $i++) { - //calculate the scheduled amount for every installment. + // calculate the scheduled amount for every installment. if ($i == $params['installments']) { $params['scheduled_amount'] = $params['amount'] - ($i - 1) * $params['scheduled_amount']; } @@ -154,7 +152,7 @@ WHERE pledge_id = %1 } } - //update pledge status + // update pledge status self::updatePledgePaymentStatus($params['pledge_id']); $transaction->commit(); @@ -289,7 +287,7 @@ WHERE pledge_id = %1 * @return bool */ public static function resetPledgePayment($contributionID) { - //get all status + // get all status $allStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); $transaction = new CRM_Core_Transaction(); @@ -350,7 +348,7 @@ WHERE pledge_id = %1 $paymentContributionId = NULL; $editScheduled = FALSE; - //get all statuses + // get all statuses $allStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); // if we get do not get contribution id means we are editing the scheduled payment. @@ -391,7 +389,7 @@ WHERE pledge_id = %1 'amount', 'id' ); - // while editing scheduled we need to check if we are editing last pending + // while editing scheduled we need to check if we are editing last pending $lastPending = FALSE; if (!$paymentContributionId) { $checkPendingCount = self::getOldestPledgePayment($pledgeID, 2); @@ -469,7 +467,7 @@ WHERE pledge_id = %1 } $cancelDateClause = $endDateClause = NULL; - //update pledge and payment status if status is Completed/Cancelled. + // update pledge and payment status if status is Completed/Cancelled. if ($pledgeStatusID && $pledgeStatusID == array_search('Cancelled', $allStatus)) { $paymentStatusID = $pledgeStatusID; $cancelDateClause = ", civicrm_pledge.cancel_date = CURRENT_TIMESTAMP "; @@ -483,7 +481,7 @@ WHERE pledge_id = %1 $endDateClause = ", civicrm_pledge.end_date = CURRENT_TIMESTAMP "; } - //update pledge status + // update pledge status $query = " UPDATE civicrm_pledge SET civicrm_pledge.status_id = %1 @@ -519,17 +517,17 @@ WHERE civicrm_pledge.id = %2 $date['year'] = (int) substr($scheduled_date, 0, 4); $date['month'] = (int) substr($scheduled_date, 4, 2); $date['day'] = (int) substr($scheduled_date, 6, 2); - //calculation of schedule date according to frequency day of period - //frequency day is not applicable for daily installments + // calculation of schedule date according to frequency day of period + // frequency day is not applicable for daily installments if ($params['frequency_unit'] != 'day' && $params['frequency_unit'] != 'year') { if ($params['frequency_unit'] != 'week') { - //for month use day of next month as next payment date + // for month use day of next month as next payment date $date['day'] = $params['frequency_day']; } elseif ($params['frequency_unit'] == 'week') { - //for week calculate day of week ie. Sunday,Monday etc. as next payment date + // for week calculate day of week ie. Sunday,Monday etc. as next payment date $dayOfWeek = date('w', mktime(0, 0, 0, $date['month'], $date['day'], $date['year'])); $frequencyDay = $params['frequency_day'] - $dayOfWeek; @@ -585,7 +583,7 @@ WHERE civicrm_pledge.id = %2 public static function calculatePledgeStatus($pledgeId) { $paymentStatusTypes = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); - //retrieve all pledge payments for this particular pledge + // retrieve all pledge payments for this particular pledge $allPledgePayments = $allStatus = array(); $returnProperties = array('status_id'); CRM_Core_DAO::commonRetrieveAll('CRM_Pledge_DAO_PledgePayment', 'pledge_id', $pledgeId, $allPledgePayments, $returnProperties); @@ -658,7 +656,7 @@ WHERE civicrm_pledge_payment.pledge_id = %1 {$paymentClause} "; - //get all status + // get all status $params = array(1 => array($pledgeId, 'Integer')); $dao = CRM_Core_DAO::executeQuery($query, $params); @@ -669,7 +667,6 @@ WHERE civicrm_pledge_payment.pledge_id = %1 * * @param int $paymentId * Payment id. - * */ public static function updateReminderDetails($paymentId) { $query = " @@ -693,10 +690,10 @@ WHERE civicrm_pledge_payment.id = {$paymentId} * associated array of pledge details */ public static function getOldestPledgePayment($pledgeID, $limit = 1) { - //get pending / overdue statuses + // get pending / overdue statuses $pledgeStatuses = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); - //get pending and overdue payments + // get pending and overdue payments $status[] = array_search('Pending', $pledgeStatuses); $status[] = array_search('Overdue', $pledgeStatuses); @@ -767,11 +764,11 @@ WHERE civicrm_pledge_payment.contribution_id = {$paymentContributionId} } } - //Cancel the initial paid amount + // Cancel the initial paid amount CRM_Core_DAO::setFieldValue('CRM_Pledge_DAO_PledgePayment', reset($paymentIDs), 'status_id', $paymentStatusID, 'id'); CRM_Core_DAO::setFieldValue('CRM_Pledge_DAO_PledgePayment', reset($paymentIDs), 'actual_amount', $actualAmount, 'id'); - //Add new payment after the last payment for the pledge + // Add new payment after the last payment for the pledge $allPayments = self::getPledgePayments($pledgeID); $lastPayment = array_pop($allPayments); @@ -807,7 +804,7 @@ WHERE civicrm_pledge_payment.contribution_id = {$paymentContributionId} if (($actualAmount != $pledgeScheduledAmount) && (($actualAmount < $pledgeScheduledAmount) || (($actualAmount - $pledgeScheduledAmount) < $oldestPayment['amount']))) { $oldScheduledAmount = $oldestPayment['amount']; $newScheduledAmount = $oldScheduledAmount + ($pledgeScheduledAmount - $actualAmount); - //store new amount in oldest pending payment record. + // store new amount in oldest pending payment record. CRM_Core_DAO::setFieldValue('CRM_Pledge_DAO_PledgePayment', $oldestPayment['id'], 'scheduled_amount', diff --git a/CRM/Pledge/BAO/Query.php b/CRM/Pledge/BAO/Query.php index 6d5f4f2c37..67a570e95d 100644 --- a/CRM/Pledge/BAO/Query.php +++ b/CRM/Pledge/BAO/Query.php @@ -29,8 +29,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ class CRM_Pledge_BAO_Query { /** @@ -45,8 +43,6 @@ class CRM_Pledge_BAO_Query { * Build select for Pledge. * * @param $query - * - * @return void */ public static function select(&$query) { $statusId = implode(',', array_keys(CRM_Core_PseudoConstant::accountOptionValues("contribution_status", NULL, " AND v.name IN ('Pending', 'Overdue')"))); @@ -56,7 +52,7 @@ class CRM_Pledge_BAO_Query { $query->_tables['civicrm_pledge'] = $query->_whereTables['civicrm_pledge'] = 1; } - //add pledge select + // add pledge select if (!empty($query->_returnProperties['pledge_amount'])) { $query->_select['pledge_amount'] = 'civicrm_pledge.amount as pledge_amount'; $query->_element['pledge_amount'] = 1; @@ -513,7 +509,7 @@ class CRM_Pledge_BAO_Query { FALSE, array('class' => 'crm-select2', 'multiple' => 'multiple') ); - //unset in progress for payment + // unset in progress for payment unset($statusValues['5']); $form->add('select', 'pledge_payment_status_id', @@ -533,7 +529,7 @@ class CRM_Pledge_BAO_Query { FALSE, array('class' => 'crm-select2') ); - //add fields for pledge frequency + // add fields for pledge frequency $form->add('text', 'pledge_frequency_interval', ts('Every'), array('size' => 8, 'maxlength' => 8)); $form->addRule('pledge_frequency_interval', ts('Please enter valid Pledge Frequency Interval'), 'integer'); $frequencies = CRM_Core_OptionGroup::values('recur_frequency_units'); @@ -581,7 +577,7 @@ class CRM_Pledge_BAO_Query { * @param $tables */ public static function tableNames(&$tables) { - //add status table + // add status table if (!empty($tables['pledge_status']) || !empty($tables['civicrm_pledge_payment'])) { $tables = array_merge(array('civicrm_pledge' => 1), $tables); } diff --git a/CRM/Pledge/Controller/Search.php b/CRM/Pledge/Controller/Search.php index f801d36be6..2bfd9e2f88 100644 --- a/CRM/Pledge/Controller/Search.php +++ b/CRM/Pledge/Controller/Search.php @@ -29,8 +29,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ /** @@ -39,10 +37,9 @@ * - the search controller is used for building/processing multiform * searches. * - * Typically the first form will display the search criteria and it's results - * - * The second form is used to process search results with the asscociated actions + * Typically the first form will display the search criteria and it's results. * + * The second form is used to process search results with the asscociated actions. */ class CRM_Pledge_Controller_Search extends CRM_Core_Controller { diff --git a/CRM/Pledge/Form/Payment.php b/CRM/Pledge/Form/Payment.php index a0cbb00260..aba503ee58 100644 --- a/CRM/Pledge/Form/Payment.php +++ b/CRM/Pledge/Form/Payment.php @@ -29,13 +29,10 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ /** - * This class generates form components for processing a pledge payment - * + * This class generates form components for processing a pledge payment. */ class CRM_Pledge_Form_Payment extends CRM_Core_Form { @@ -48,8 +45,6 @@ class CRM_Pledge_Form_Payment extends CRM_Core_Form { /** * Set variables up before form is built. - * - * @return void */ public function preProcess() { // check for edit permission @@ -64,10 +59,7 @@ class CRM_Pledge_Form_Payment extends CRM_Core_Form { /** * Set default values for the form. - * the default values are retrieved from the database - * - * - * @return void + * the default values are retrieved from the database. */ public function setDefaultValues() { $defaults = array(); @@ -87,11 +79,9 @@ class CRM_Pledge_Form_Payment extends CRM_Core_Form { /** * Build the form object. - * - * @return void */ public function buildQuickForm() { - //add various dates + // add various dates $this->addDate('scheduled_date', ts('Scheduled Date'), TRUE); $this->addMoney('scheduled_amount', @@ -130,12 +120,9 @@ class CRM_Pledge_Form_Payment extends CRM_Core_Form { /** * Process the form submission. - * - * - * @return void */ public function postProcess() { - //get the submitted form values. + // get the submitted form values. $formValues = $this->controller->exportValues($this->_name); $params = array(); $formValues['scheduled_date'] = CRM_Utils_Date::processDate($formValues['scheduled_date']); @@ -173,7 +160,7 @@ class CRM_Pledge_Form_Payment extends CRM_Core_Form { if (($formValues['scheduled_amount'] - $pledgeScheduledAmount) >= $oldestPaymentAmount['amount']) { $adjustTotalAmount = TRUE; } - //update pledge status + // update pledge status CRM_Pledge_BAO_PledgePayment::updatePledgePaymentStatus($pledgeId, array($params['id']), $params['status_id'], diff --git a/CRM/Pledge/Form/Pledge.php b/CRM/Pledge/Form/Pledge.php index c9f1880397..354ba2e0da 100644 --- a/CRM/Pledge/Form/Pledge.php +++ b/CRM/Pledge/Form/Pledge.php @@ -29,13 +29,10 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ /** * This class generates form components for processing a pledge - * */ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { public $_action; @@ -71,8 +68,6 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { /** * Set variables up before form is built. - * - * @return void */ public function preProcess() { $this->_contactID = CRM_Utils_Request::retrieve('cid', 'Positive', $this); @@ -103,12 +98,12 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { $this->setPageTitle(ts('Pledge')); - //build custom data + // build custom data CRM_Custom_Form_CustomData::preProcess($this, NULL, NULL, 1, 'Pledge', $this->_id); $this->_values = array(); // current pledge id if ($this->_id) { - //get the contribution id + // get the contribution id $this->_contributionID = CRM_Core_DAO::getFieldValue('CRM_Pledge_DAO_PledgePayment', $this->_id, 'contribution_id', 'pledge_id' ); @@ -118,7 +113,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { $this->_isPending = (CRM_Pledge_BAO_Pledge::pledgeHasFinancialTransactions($this->_id, CRM_Utils_Array::value('status_id', $this->_values))) ? FALSE : TRUE; } - //get the pledge frequency units. + // get the pledge frequency units. $this->_freqUnits = CRM_Core_OptionGroup::values('recur_frequency_units'); $this->_fromEmails = CRM_Core_BAO_Email::getFromEmail(); @@ -127,10 +122,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { /** * Set default values for the form. - * the default values are retrieved from the database - * - * - * @return void + * The default values are retrieved from the database. */ public function setDefaultValues() { $defaults = $this->_values; @@ -154,8 +146,8 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { list($defaults['acknowledge_date']) = CRM_Utils_Date::setDateDefaults($ackDate); } - //check is this pledge pending - // fix the display of the monetary value, CRM-4038 + // check is this pledge pending. + // fix the display of the monetary value, CRM-4038. if ($this->_isPending) { $defaults['eachPaymentAmount'] = $this->_values['amount'] / $this->_values['installments']; $defaults['eachPaymentAmount'] = CRM_Utils_Money::format($defaults['eachPaymentAmount'], NULL, '%a'); @@ -172,7 +164,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { $this->assign('installments', $defaults['installments']); } else { - //default values. + // default values. list($now) = CRM_Utils_Date::setDateDefaults(); $defaults['create_date'] = $now; $defaults['start_date'] = $now; @@ -195,7 +187,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { $pledgeStatus ); - //assign status. + // assign status. $this->assign('status', CRM_Utils_Array::value(CRM_Utils_Array::value('status_id', $this->_values), $pledgeStatus, $defaultPledgeStatus @@ -213,8 +205,6 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { /** * Build the form object. - * - * @return void */ public function buildQuickForm() { if ($this->_action & CRM_Core_Action::DELETE) { @@ -256,7 +246,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { 'open' => 'false', 'id' => $type, ); - //see if we need to include this paneName in the current form + // see if we need to include this paneName in the current form if ($this->_formType == $type || !empty($_POST["hidden_{$type}"]) || CRM_Utils_Array::value("hidden_{$type}", $defaults) ) { @@ -277,7 +267,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { $this->applyFilter('__ALL__', 'trim'); - //pledge fields. + // pledge fields. $attributes = CRM_Core_DAO::getAttribute('CRM_Pledge_DAO_Pledge'); $this->assign('isPending', $this->_isPending); @@ -356,7 +346,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { 0 => 'READONLY', // WTF, preserved because its inexplicable )); - //add various dates + // add various dates if (!$this->_id || $this->_isPending) { $this->addDate('create_date', ts('Pledge Made'), TRUE); $this->addDate('start_date', ts('Payments Start'), TRUE); @@ -390,7 +380,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { TRUE ); - //CRM-7362 --add campaigns. + // CRM-7362 --add campaigns. CRM_Campaign_BAO_Campaign::addCampaign($this, CRM_Utils_Array::value('campaign_id', $this->_values)); $pageIds = array(); @@ -411,7 +401,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { ); $this->assign('outBound_option', $mailingInfo['outBound_option']); - //build custom data + // build custom data CRM_Custom_Form_CustomData::buildQuickForm($this); // make this form an upload since we dont know if the custom data injected dynamically @@ -481,9 +471,6 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { /** * Process the form submission. - * - * - * @return void */ public function postProcess() { if ($this->_action & CRM_Core_Action::DELETE) { @@ -491,7 +478,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { return; } - //get the submitted form values. + // get the submitted form values. $formValues = $this->controller->exportValues($this->_name); // set the contact, when contact is selected @@ -501,7 +488,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { $session = CRM_Core_Session::singleton(); - //get All Payments status types. + // get All Payments status types. $paymentStatusTypes = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); $fields = array( @@ -520,15 +507,15 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { $params[$f] = CRM_Utils_Array::value($f, $formValues); } - //defaults status is "Pending". - //if update get status. + // defaults status is "Pending". + // if update get status. if ($this->_id) { $params['pledge_status_id'] = $params['status_id'] = $this->_values['status_id']; } else { $params['pledge_status_id'] = $params['status_id'] = array_search('Pending', $paymentStatusTypes); } - //format amount + // format amount $params['amount'] = CRM_Utils_Rule::cleanMoney(CRM_Utils_Array::value('amount', $formValues)); $params['currency'] = CRM_Utils_Array::value('currency', $formValues); $params['original_installment_amount'] = ($params['amount'] / $params['installments']); @@ -563,7 +550,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { $params['contact_id'] = $this->_contactID; - //format custom data + // format custom data if (!empty($formValues['hidden_custom'])) { $params['hidden_custom'] = 1; @@ -574,16 +561,16 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { ); } - //handle pending pledge. + // handle pending pledge. $params['is_pledge_pending'] = $this->_isPending; - //create pledge record. + // create pledge record. $pledge = CRM_Pledge_BAO_Pledge::create($params); $statusMsg = NULL; if ($pledge->id) { - //set the status msg. + // set the status msg. if ($this->_action & CRM_Core_Action::ADD) { $statusMsg = ts('Pledge has been recorded and the payment schedule has been created.
'); } @@ -592,13 +579,13 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { } } - //handle Acknowledgment. + // handle Acknowledgment. if (!empty($formValues['is_acknowledge']) && $pledge->id) { - //calculate scheduled amount. + // calculate scheduled amount. $params['scheduled_amount'] = round($params['amount'] / $params['installments']); $params['total_pledge_amount'] = $params['amount']; - //get some required pledge values in params. + // get some required pledge values in params. $params['id'] = $pledge->id; $params['acknowledge_date'] = $pledge->acknowledge_date; $params['is_test'] = $pledge->is_test; @@ -607,7 +594,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { $params['from_email_id'] = $formValues['from_email_address']; $this->paymentId = NULL; - //send Acknowledgment mail. + // send Acknowledgment mail. CRM_Pledge_BAO_Pledge::sendAcknowledgment($this, $params); if (!isset($this->userEmail)) { @@ -618,14 +605,14 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { $statusMsg .= ' ' . ts("An acknowledgment email has been sent to %1.
", array(1 => $this->userEmail)); - //build the payment urls. + // build the payment urls. if ($this->paymentId) { $urlParams = "reset=1&action=add&cid={$this->_contactID}&ppid={$this->paymentId}&context=pledge"; $contribURL = CRM_Utils_System::url('civicrm/contact/view/contribution', $urlParams); $urlParams .= "&mode=live"; $creditURL = CRM_Utils_System::url('civicrm/contact/view/contribution', $urlParams); - //check if we can process credit card payment. + // check if we can process credit card payment. $processors = CRM_Core_PseudoConstant::paymentProcessor(FALSE, FALSE, "billing_mode IN ( 1, 3 )" ); diff --git a/CRM/Pledge/Form/PledgeView.php b/CRM/Pledge/Form/PledgeView.php index b577f645b1..6f6c95bc97 100644 --- a/CRM/Pledge/Form/PledgeView.php +++ b/CRM/Pledge/Form/PledgeView.php @@ -29,20 +29,15 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ /** * This class generates form components for Pledge - * */ class CRM_Pledge_Form_PledgeView extends CRM_Core_Form { /** * Set variables up before form is built. - * - * @return void */ public function preProcess() { @@ -67,7 +62,7 @@ class CRM_Pledge_Form_PledgeView extends CRM_Core_Form { $values['honor_type'] = $honor[$values['honor_type_id']]; } - //handle custom data. + // handle custom data. $groupTree = CRM_Core_BAO_CustomGroup::getTree('Pledge', $this, $params['id']); CRM_Core_BAO_CustomGroup::buildCustomDataView($this, $groupTree); @@ -121,7 +116,7 @@ class CRM_Pledge_Form_PledgeView extends CRM_Core_Form { // omitting contactImage from title for now since the summary overlay css doesn't work outside of our crm-container CRM_Utils_System::setTitle(ts('View Pledge by') . ' ' . $displayName); - //do check for campaigns + // do check for campaigns if ($campaignId = CRM_Utils_Array::value('campaign_id', $values)) { $campaigns = CRM_Campaign_BAO_Campaign::getCampaigns($campaignId); $values['campaign'] = $campaigns[$campaignId]; @@ -132,8 +127,6 @@ class CRM_Pledge_Form_PledgeView extends CRM_Core_Form { /** * Build the form object. - * - * @return void */ public function buildQuickForm() { $this->addButtons(array( diff --git a/CRM/Pledge/Form/Search.php b/CRM/Pledge/Form/Search.php index cc8d3c184c..d648fe0564 100644 --- a/CRM/Pledge/Form/Search.php +++ b/CRM/Pledge/Form/Search.php @@ -29,8 +29,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ /** @@ -69,19 +67,18 @@ class CRM_Pledge_Form_Search extends CRM_Core_Form_Search { */ public function preProcess() { - /** - * set the button names - */ + // set the button names + $this->_searchButtonName = $this->getButtonName('refresh'); $this->_actionButtonName = $this->getButtonName('next', 'action'); $this->_done = FALSE; $this->defaults = array(); - /* - * we allow the controller to set force/reset externally, useful when we are being - * driven by the wizard framework - */ + + // we allow the controller to set force/reset externally, useful when we are being + // driven by the wizard framework + $this->_reset = CRM_Utils_Request::retrieve('reset', 'Boolean', CRM_Core_DAO::$_nullObject); $this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE); $this->_limit = CRM_Utils_Request::retrieve('limit', 'Positive', $this); @@ -148,9 +145,6 @@ class CRM_Pledge_Form_Search extends CRM_Core_Form_Search { /** * Build the form object. - * - * - * @return void */ public function buildQuickForm() { parent::buildQuickForm(); @@ -182,10 +176,6 @@ class CRM_Pledge_Form_Search extends CRM_Core_Form_Search { * done. * The processing consists of using a Selector / Controller framework for getting the * search results. - * - * @param - * - * @return void */ public function postProcess() { if ($this->_done) { @@ -279,7 +269,6 @@ class CRM_Pledge_Form_Search extends CRM_Core_Form_Search { * add the rules (mainly global rules) for form. * All local rules are added near the element * - * @return void * @see valid_date */ public function addRules() { @@ -291,8 +280,6 @@ class CRM_Pledge_Form_Search extends CRM_Core_Form_Search { * * @param array $fields * Posted values of the form. - * - * @return void */ public static function formRule($fields) { $errors = array(); diff --git a/CRM/Pledge/Form/Task.php b/CRM/Pledge/Form/Task.php index 7aac36e1d3..a443f524a9 100644 --- a/CRM/Pledge/Form/Task.php +++ b/CRM/Pledge/Form/Task.php @@ -117,7 +117,7 @@ class CRM_Pledge_Form_Task extends CRM_Core_Form { $form->_pledgeIds = $form->_componentIds = $ids; - //set the context for redirection for any task actions + // set the context for redirection for any task actions $qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', $form); $urlParams = 'force=1'; if (CRM_Utils_Rule::qfKey($qfKey)) { diff --git a/CRM/Pledge/Form/Task/Delete.php b/CRM/Pledge/Form/Task/Delete.php index 9da9a531fc..5f8491481e 100644 --- a/CRM/Pledge/Form/Task/Delete.php +++ b/CRM/Pledge/Form/Task/Delete.php @@ -29,8 +29,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ /** @@ -61,9 +59,6 @@ class CRM_Pledge_Form_Task_Delete extends CRM_Pledge_Form_Task { /** * Build the form object. - * - * - * @return void */ public function buildQuickForm() { $this->addDefaultButtons(ts('Delete Pledges'), 'done'); @@ -71,9 +66,6 @@ class CRM_Pledge_Form_Task_Delete extends CRM_Pledge_Form_Task { /** * Process the form after the input has been submitted and validated. - * - * - * @return void */ public function postProcess() { $deleted = $failed = 0; diff --git a/CRM/Pledge/Form/Task/Print.php b/CRM/Pledge/Form/Task/Print.php index 2a375ddab4..287df8a75b 100644 --- a/CRM/Pledge/Form/Task/Print.php +++ b/CRM/Pledge/Form/Task/Print.php @@ -29,8 +29,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ /** @@ -41,8 +39,6 @@ class CRM_Pledge_Form_Task_Print extends CRM_Pledge_Form_Task { /** * Build all the data structures needed to build the form. - * - * @return void */ public function preProcess() { parent::preprocess(); @@ -69,15 +65,12 @@ class CRM_Pledge_Form_Task_Print extends CRM_Pledge_Form_Task { /** * Build the form object - it consists of * - displaying the QILL (query in local language) - * - displaying elements for saving the search - * - * - * @return void + * - displaying elements for saving the search. */ public function buildQuickForm() { - // + // just need to add a javacript to popup the window for printing - // + $this->addButtons(array( array( 'type' => 'next', @@ -95,9 +88,6 @@ class CRM_Pledge_Form_Task_Print extends CRM_Pledge_Form_Task { /** * Process the form after the input has been submitted and validated. - * - * - * @return void */ public function postProcess() { // redirect to the main search page after printing is over diff --git a/CRM/Pledge/Form/Task/Result.php b/CRM/Pledge/Form/Task/Result.php index 2497e7a3dc..b856f85b1e 100644 --- a/CRM/Pledge/Form/Task/Result.php +++ b/CRM/Pledge/Form/Task/Result.php @@ -29,29 +29,21 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ /** - * Used for displaying results - * - * + * Used for displaying results. */ class CRM_Pledge_Form_Task_Result extends CRM_Pledge_Form_Task { /** * Build all the data structures needed to build the form. - * - * @return void */ public function preProcess() { } /** * Build the form object. - * - * @return void */ public function buildQuickForm() { $this->addButtons(array( diff --git a/CRM/Pledge/Form/Task/SearchTaskHookSample.php b/CRM/Pledge/Form/Task/SearchTaskHookSample.php index ad77273a51..db176d6fd0 100644 --- a/CRM/Pledge/Form/Task/SearchTaskHookSample.php +++ b/CRM/Pledge/Form/Task/SearchTaskHookSample.php @@ -29,8 +29,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ /** @@ -41,8 +39,6 @@ class CRM_Pledge_Form_Task_SearchTaskHookSample extends CRM_Pledge_Form_Task { /** * Build all the data structures needed to build the form. - * - * @return void */ public function preProcess() { parent::preProcess(); @@ -71,8 +67,6 @@ INNER JOIN civicrm_contact ct ON ( plg.contact_id = ct.id ) /** * Build the form object. - * - * @return void */ public function buildQuickForm() { $this->addButtons(array( diff --git a/CRM/Pledge/Info.php b/CRM/Pledge/Info.php index 4cbf1279f9..b1bdc6f072 100644 --- a/CRM/Pledge/Info.php +++ b/CRM/Pledge/Info.php @@ -32,13 +32,11 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ class CRM_Pledge_Info extends CRM_Core_Component_Info { /** - * @inheritDoc + * {@inheritDoc} */ protected $keyword = 'pledge'; @@ -62,7 +60,7 @@ class CRM_Pledge_Info extends CRM_Core_Component_Info { /** - * @inheritDoc + * {@inheritDoc} * Provides permissions that are used by component. * Needs to be implemented in component's information * class. @@ -103,7 +101,7 @@ class CRM_Pledge_Info extends CRM_Core_Component_Info { } /** - * @inheritDoc + * {@inheritDoc} * Provides information about user dashboard element * offered by this component. * @@ -111,9 +109,6 @@ class CRM_Pledge_Info extends CRM_Core_Component_Info { * collection of required dashboard settings, * null if no element offered */ - /** - * @return array|null - */ public function getUserDashboardElement() { return array( 'name' => ts('Pledges'), @@ -125,7 +120,7 @@ class CRM_Pledge_Info extends CRM_Core_Component_Info { } /** - * @inheritDoc + * {@inheritDoc} * Provides information about user dashboard element * offered by this component. * @@ -133,9 +128,6 @@ class CRM_Pledge_Info extends CRM_Core_Component_Info { * collection of required dashboard settings, * null if no element offered */ - /** - * @return array|null - */ public function registerTab() { return array( 'title' => ts('Pledges'), @@ -145,7 +137,7 @@ class CRM_Pledge_Info extends CRM_Core_Component_Info { } /** - * @inheritDoc + * {@inheritDoc} * Provides information about advanced search pane * offered by this component. * @@ -153,9 +145,6 @@ class CRM_Pledge_Info extends CRM_Core_Component_Info { * collection of required pane settings, * null if no element offered */ - /** - * @return array|null - */ public function registerAdvancedSearchPane() { return array( 'title' => ts('Pledges'), @@ -164,7 +153,7 @@ class CRM_Pledge_Info extends CRM_Core_Component_Info { } /** - * @inheritDoc + * {@inheritDoc} * Provides potential activity types that this * component might want to register in activity history. * Needs to be implemented in component's information @@ -173,9 +162,6 @@ class CRM_Pledge_Info extends CRM_Core_Component_Info { * @return array|null * collection of activity types */ - /** - * @return array|null - */ public function getActivityTypes() { return NULL; } diff --git a/CRM/Pledge/Page/AJAX.php b/CRM/Pledge/Page/AJAX.php index fd3975ba25..7afc7795d9 100755 --- a/CRM/Pledge/Page/AJAX.php +++ b/CRM/Pledge/Page/AJAX.php @@ -29,8 +29,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ /** diff --git a/CRM/Pledge/Page/DashBoard.php b/CRM/Pledge/Page/DashBoard.php index 7e43f88f12..487b3701c7 100644 --- a/CRM/Pledge/Page/DashBoard.php +++ b/CRM/Pledge/Page/DashBoard.php @@ -29,20 +29,16 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ /** - * This is page is for Pledge Dashboard + * This page is for the Pledge Dashboard. */ class CRM_Pledge_Page_DashBoard extends CRM_Core_Page { /** - * Heart of the viewing process. The runner gets all the meta data for + * Heart of the viewing process: The runner gets all the meta data for * the contact and calls the appropriate type of page to view. - * - * @return void */ public function preProcess() { CRM_Utils_System::setTitle(ts('CiviPledge')); @@ -94,7 +90,7 @@ class CRM_Pledge_Page_DashBoard extends CRM_Core_Page { /** * the main function that is called when the page loads, - * it decides the which action has to be taken for the page. + * it decides which action has to be taken for the page. * * @return null */ diff --git a/CRM/Pledge/Page/Payment.php b/CRM/Pledge/Page/Payment.php index cb111859c9..b2b692da4d 100644 --- a/CRM/Pledge/Page/Payment.php +++ b/CRM/Pledge/Page/Payment.php @@ -29,8 +29,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ class CRM_Pledge_Page_Payment extends CRM_Core_Page { diff --git a/CRM/Pledge/Page/Tab.php b/CRM/Pledge/Page/Tab.php index 17a5b27e64..bdc8340721 100644 --- a/CRM/Pledge/Page/Tab.php +++ b/CRM/Pledge/Page/Tab.php @@ -29,8 +29,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ class CRM_Pledge_Page_Tab extends CRM_Core_Page { public $_permission = NULL; @@ -38,8 +36,6 @@ class CRM_Pledge_Page_Tab extends CRM_Core_Page { /** * called when action is browse. - * - * @return void */ public function browse() { $controller = new CRM_Core_Controller_Simple('CRM_Pledge_Form_Search', ts('Pledges'), $this->_action); @@ -163,7 +159,7 @@ class CRM_Pledge_Page_Tab extends CRM_Core_Page { $context = CRM_Utils_Request::retrieve('context', 'String', $form, FALSE, 'search'); $qfKey = CRM_Utils_Request::retrieve('key', 'String', $form); - //validate the qfKey + // validate the qfKey if (!CRM_Utils_Rule::qfKey($qfKey)) { $qfKey = NULL; } diff --git a/CRM/Pledge/Page/UserDashboard.php b/CRM/Pledge/Page/UserDashboard.php index 7bff4ca785..fee6d0b867 100644 --- a/CRM/Pledge/Page/UserDashboard.php +++ b/CRM/Pledge/Page/UserDashboard.php @@ -29,14 +29,11 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ class CRM_Pledge_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBoard { /** * called when action is browse. - * */ public function listPledges() { $controller = new CRM_Core_Controller_Simple( @@ -54,7 +51,7 @@ class CRM_Pledge_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBoard $controller->process(); $controller->run(); - //add honor block. + // add honor block. $honorParams = array(); $honorParams = CRM_Pledge_BAO_Pledge::getHonorContacts($this->_contactId); if (!empty($honorParams)) { @@ -70,7 +67,6 @@ class CRM_Pledge_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBoard /** * the main function that is called when the page * loads, it decides the which action has to be taken for the page. - * */ public function run() { parent::preProcess(); diff --git a/CRM/Pledge/Selector/Search.php b/CRM/Pledge/Selector/Search.php index 70931131aa..183f57e851 100644 --- a/CRM/Pledge/Selector/Search.php +++ b/CRM/Pledge/Selector/Search.php @@ -29,7 +29,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ */ /** @@ -55,6 +54,7 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base { /** * Properties of contact we're interested in displaying + * * @var array */ static $_properties = array( @@ -294,10 +294,10 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base { FALSE, FALSE, FALSE, NULL, 'name', FALSE ); - //get all campaigns. + // get all campaigns. $allCampaigns = CRM_Campaign_BAO_Campaign::getCampaigns(NULL, NULL, FALSE, FALSE, FALSE, TRUE); - //4418 check for view, edit and delete + // CRM-4418 check for view, edit and delete $permissions = array(CRM_Core_Permission::VIEW); if (CRM_Core_Permission::check('edit pledges')) { $permissions[] = CRM_Core_Permission::EDIT; @@ -316,7 +316,7 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base { } } - //carry campaign on selectors. + // carry campaign on selectors. $row['campaign'] = CRM_Utils_Array::value($result->pledge_campaign_id, $allCampaigns); $row['campaign_id'] = $result->pledge_campaign_id; @@ -362,7 +362,7 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base { /** * Get qill (display what was searched on). * - * @inheritDoc + * {@inheritDoc} */ public function getQILL() { return $this->_query->qill(); diff --git a/CRM/Pledge/StateMachine/Search.php b/CRM/Pledge/StateMachine/Search.php index 818f3e19c9..37ff804fd7 100644 --- a/CRM/Pledge/StateMachine/Search.php +++ b/CRM/Pledge/StateMachine/Search.php @@ -29,8 +29,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ class CRM_Pledge_StateMachine_Search extends CRM_Core_StateMachine { diff --git a/CRM/Pledge/Task.php b/CRM/Pledge/Task.php index ab9dda4aeb..3dce80b531 100644 --- a/CRM/Pledge/Task.php +++ b/CRM/Pledge/Task.php @@ -26,17 +26,13 @@ */ /** - * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ /** * class to represent the actions that can be performed on a group of contacts - * used by the search forms - * + * used by the search forms. */ class CRM_Pledge_Task { const DELETE_PLEDGES = 1, PRINT_PLEDGES = 2, EXPORT_PLEDGES = 3; @@ -85,7 +81,7 @@ class CRM_Pledge_Task { ), ); - //CRM-4418, check for delete + // CRM-4418, check for delete if (!CRM_Core_Permission::check('delete in CiviPledge')) { unset(self::$_tasks[1]); } @@ -151,7 +147,7 @@ class CRM_Pledge_Task { /** * These tasks are the core set of tasks that the user can perform - * on pledges + * on pledges. * * @param int $value * -- 2.25.1