diff --git a/CRM/PCP/Form/Campaign.php b/CRM/PCP/Form/Campaign.php index c6bfa959f3aeb4e3ad4cf02c0c4b2434a81d9546..bf3796bb466b1923c1e36ddeaf7d55088c51548b 100644 --- a/CRM/PCP/Form/Campaign.php +++ b/CRM/PCP/Form/Campaign.php @@ -211,7 +211,7 @@ class CRM_PCP_Form_Campaign extends CRM_Core_Form { $params[$field] = CRM_Utils_String::purifyHTML($params[$field]); } } - + $entity_table = CRM_PCP_BAO_PCP::getPcpEntityTable($params['page_type']); $pcpBlock = new CRM_PCP_DAO_PCPBlock(); diff --git a/CRM/PCP/Form/Event.php b/CRM/PCP/Form/Event.php index 594088f0491cdc432a7642f812d9da2ae9d3ee38..b8fcc2bf30ee2dc45eb4424666f0a79d212ef2b5 100644 --- a/CRM/PCP/Form/Event.php +++ b/CRM/PCP/Form/Event.php @@ -81,7 +81,7 @@ class CRM_PCP_Form_Event extends CRM_Event_Form_ManageEvent { $defaults['tellfriend_limit'] = 5; $defaults['link_text'] = ts('Promote this event with a personal campaign page'); - if ($this->_id && + if ($this->_id && $ccReceipt = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage', $this->_id, 'cc_receipt')) { $defaults['notify_email'] = $ccReceipt; } diff --git a/CRM/PCP/Page/PCP.php b/CRM/PCP/Page/PCP.php index ae640c718e12c3005b4f87f1f52d72870bed5bb9..41bb8ef1830322dc81ae21f8c16ab983338b91c8 100644 --- a/CRM/PCP/Page/PCP.php +++ b/CRM/PCP/Page/PCP.php @@ -236,8 +236,8 @@ class CRM_PCP_Page_PCP extends CRM_Core_Page_Basic { // get all event pages. pcp campaign start and end dates for event related pcp's use the online registration start and end dates, // altho if target is contribution page this might not be correct. fixme? dgg - $query = "SELECT id, title, start_date, end_date, registration_start_date, registration_end_date - FROM civicrm_event + $query = "SELECT id, title, start_date, end_date, registration_start_date, registration_end_date + FROM civicrm_event WHERE is_template IS NULL OR is_template != 1"; $epages = CRM_Core_DAO::executeQuery($query); while ($epages->fetch()) { diff --git a/CRM/Pledge/Form/Pledge.php b/CRM/Pledge/Form/Pledge.php index 0e0e1e11f7056e5525fee6498ba49c1905817ef4..fa154f95eb6aba331d48c7ab85ad6baa5615989f 100644 --- a/CRM/Pledge/Form/Pledge.php +++ b/CRM/Pledge/Form/Pledge.php @@ -447,8 +447,8 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { $this->addDate('acknowledge_date', ts('Acknowledgment Date')); - $this->add('select', 'financial_type_id', - ts( 'Financial Type' ), + $this->add('select', 'financial_type_id', + ts( 'Financial Type' ), array(''=>ts( '- select -' )) + CRM_Contribute_PseudoConstant::financialType( ), TRUE ); diff --git a/CRM/Pledge/Form/PledgeView.php b/CRM/Pledge/Form/PledgeView.php index f0dd487b727843304b8ce20f23e432bac1d6263c..617a89e981dfe961ebf6e52c25497fd4d17421e4 100644 --- a/CRM/Pledge/Form/PledgeView.php +++ b/CRM/Pledge/Form/PledgeView.php @@ -101,8 +101,8 @@ class CRM_Pledge_Form_PledgeView extends CRM_Core_Form { $displayName = CRM_Contact_BAO_Contact::displayName($values['contact_id']); $this->assign('displayName', $displayName); - $title = $displayName . - ' - (' . ts('Pledged') . ' ' . CRM_Utils_Money::format( $values['pledge_amount'] ) . + $title = $displayName . + ' - (' . ts('Pledged') . ' ' . CRM_Utils_Money::format( $values['pledge_amount'] ) . ' - ' . $values['financial_type'] . ')'; // add Pledge to Recent Items diff --git a/CRM/Pledge/Form/Search.php b/CRM/Pledge/Form/Search.php index eb82310f552a0909a03912d604916be70fbabe84..16a6d9d31e3bfeecda947236c206eb3c2d066673 100644 --- a/CRM/Pledge/Form/Search.php +++ b/CRM/Pledge/Form/Search.php @@ -21,7 +21,7 @@ | with this program; if not, contact CiviCRM LLC | | at info[AT]civicrm[DOT]org. If you have questions about the | | GNU Affero General Public License or the licensing of CiviCRM, | - | see the CiviCRM license FAQ at http://civicrm.org/licensing + | see the CiviCRM license FAQ at http://civicrm.org/licensing +--------------------------------------------------------------------+ */ @@ -144,9 +144,9 @@ class CRM_Pledge_Form_Search extends CRM_Core_Form { $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); @@ -225,9 +225,9 @@ class CRM_Pledge_Form_Search extends CRM_Core_Form { CRM_Pledge_BAO_Query::buildSearchForm($this); - /* - * add form checkboxes for each row. This is needed out here to conform to QF protocol - * of all elements being declared in builQuickForm + /* + * add form checkboxes for each row. This is needed out here to conform to QF protocol + * of all elements being declared in builQuickForm */ $rows = $this->get('rows'); if (is_array($rows)) { diff --git a/CRM/Pledge/Form/Task/SearchTaskHookSample.php b/CRM/Pledge/Form/Task/SearchTaskHookSample.php index b02c38b023097fc5a1fccafde98fbfdf06fa5aa0..e13da5329935513310ceb3664a515d020ca9b841 100644 --- a/CRM/Pledge/Form/Task/SearchTaskHookSample.php +++ b/CRM/Pledge/Form/Task/SearchTaskHookSample.php @@ -55,7 +55,7 @@ class CRM_Pledge_Form_Task_SearchTaskHookSample extends CRM_Pledge_Form_Task { plg.create_date as create_date, ct.display_name as display_name FROM civicrm_pledge plg -INNER JOIN civicrm_contact ct ON ( plg.contact_id = ct.id ) +INNER JOIN civicrm_contact ct ON ( plg.contact_id = ct.id ) WHERE plg.id IN ( $pledgeIDs )"; $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray); diff --git a/CRM/Price/BAO/Field.php b/CRM/Price/BAO/Field.php index 04575f5e55142d6a71d2df91bbef83e16e587ce6..96b8f40598146ceedb3a5c592c35b5622655561b 100644 --- a/CRM/Price/BAO/Field.php +++ b/CRM/Price/BAO/Field.php @@ -242,7 +242,7 @@ class CRM_Price_BAO_Field extends CRM_Price_DAO_Field { /* FIXME: failure! */ return NULL; } - + $is_pay_later = 0; if (isset($qf->_mode) && empty($qf->_mode)) { $is_pay_later = 1; @@ -300,7 +300,7 @@ class CRM_Price_BAO_Field extends CRM_Price_DAO_Field { if (!empty($qf->_membershipBlock) && !empty($qf->_quickConfig) && $field->name == 'other_amount' && empty($qf->_contributionAmount)) { $label = ts('Additional Contribution'); $useRequired = 0; - } + } elseif (CRM_Utils_Array::value('label', $fieldOptions[$optionKey])) { //check for label. $label = $fieldOptions[$optionKey]['label']; } @@ -326,7 +326,7 @@ class CRM_Price_BAO_Field extends CRM_Price_DAO_Field { if (!empty($qf->_quickConfig)) { $message = ts('Please enter a valid amount.'); $type = 'money'; - } + } else { $message = ts('%1 must be an integer (whole number).', array(1 => $label)); $type = 'positiveInteger'; @@ -356,15 +356,15 @@ class CRM_Price_BAO_Field extends CRM_Price_DAO_Field { ); if (!empty($qf->_quickConfig) && $field->name == 'contribution_amount') { $extra += array('onclick' => 'clearAmountOther();'); - } + } elseif (!empty($qf->_quickConfig) && $field->name == 'membership_amount') { $extra += array( 'onclick' => "return showHideAutoRenew({$opt['membership_type_id']});", 'membership-type' => $opt['membership_type_id'], - ); + ); $qf->assign('membershipFieldID',$field->id); } - + $choice[$opId] = $qf->createElement('radio', NULL, '', $opt['label'], $opt['id'], $extra); if ($is_pay_later) { @@ -388,10 +388,10 @@ class CRM_Price_BAO_Field extends CRM_Price_DAO_Field { // add "none" option if (CRM_Utils_Array::value('is_allow_other_amount', $otherAmount) && $field->name == 'contribution_amount') { $none = ts('Other Amount'); - } + } elseif (!empty($qf->_membershipBlock) && !CRM_Utils_Array::value('is_required', $qf->_membershipBlock) && $field->name == 'membership_amount') { $none = ts('No thank you'); - } + } else { $none = ts('- none -'); } diff --git a/CRM/Price/Form/Field.php b/CRM/Price/Form/Field.php index a505e91219b37ae4e509e4b5f2f593d807c8066f..7978facf9d87d1bb062c005785bac40431f3361a 100644 --- a/CRM/Price/Form/Field.php +++ b/CRM/Price/Form/Field.php @@ -197,13 +197,13 @@ class CRM_Price_Form_Field extends CRM_Core_Form { if (count($financialType)) { $this->assign('financialType', $financialType); } - + $eventComponentId = CRM_Core_Component::getComponentID('CiviEvent'); $memberComponentId = CRM_Core_Component::getComponentID('CiviMember'); $attributes = CRM_Core_DAO::getAttribute('CRM_Price_DAO_FieldValue'); - - $this->add('select', 'financial_type_id', - ts('Financial Type'), + + $this->add('select', 'financial_type_id', + ts('Financial Type'), array(' '=> ts('- select -')) + $financialType ); @@ -265,10 +265,10 @@ class CRM_Price_Form_Field extends CRM_Core_Form { //Financial Type $this->add( - 'select', - 'option_financial_type_id['.$i.']', - ts('Financial Type'), - array('' => ts('- select -')) + $financialType + 'select', + 'option_financial_type_id['.$i.']', + ts('Financial Type'), + array('' => ts('- select -')) + $financialType ); if (in_array($eventComponentId, $this->_extendComponentId)) { // count @@ -407,7 +407,7 @@ class CRM_Price_Form_Field extends CRM_Core_Form { $fields['html_type'] == 'Text' && $fields['financial_type_id'] == '') { $errors['financial_type_id'] = ts('Financial Type is a required field'); } - + //avoid the same price field label in Within PriceSet $priceFieldLabel = new CRM_Price_DAO_Field(); $priceFieldLabel->label = $fields['label']; @@ -481,7 +481,7 @@ class CRM_Price_Form_Field extends CRM_Core_Form { } if (!$noLabel && !$noAmount && CRM_Utils_Array::value('option_financial_type_id', $fields) && $fields['option_financial_type_id'][$index] == '' && $fields['html_type'] != 'Text') { $errors["option_financial_type_id[{$index}]"] = ts('Financial Type is a Required field.'); - } + } if ($noLabel && !$noAmount) { $errors["option_label[{$index}]"] = ts('Label cannot be empty.'); $_flagOption = 1; @@ -542,7 +542,7 @@ class CRM_Price_Form_Field extends CRM_Core_Form { $errors['_qf_default'] = ts('You have selected multiple memberships for the same organization or entity. Please review your selections and choose only one membership per entity.'); } } - + // CRM-10390 - Only one price field in a set can include auto-renew membership options $foundAutorenew = FALSE; foreach ($memTypesIDS as $key => $val) { @@ -661,7 +661,7 @@ class CRM_Price_Form_Field extends CRM_Core_Form { if ($this->_fid) { $params['id'] = $this->_fid; } - + $params['membership_num_terms'] = (!empty($params['membership_type_id'])) ? CRM_Utils_Array::value('membership_num_terms', $params, 1) : NULL; $priceField = CRM_Price_BAO_Field::create($params); diff --git a/CRM/Price/Form/Option.php b/CRM/Price/Form/Option.php index 2ab3e3bafb3cea6588146424c0e8dc0f0d551930..bd22ac79c928b57de86ca85754b1d8d15e6239f6 100644 --- a/CRM/Price/Form/Option.php +++ b/CRM/Price/Form/Option.php @@ -177,26 +177,26 @@ class CRM_Price_Form_Option extends CRM_Core_Form { // count $this->add('text', 'count', ts('Participants Count')); $this->addRule('count', ts('Please enter a valid Max Participants.'), 'positiveInteger'); - + $this->add('text', 'max_value', ts('Max Participants')); $this->addRule('max_value', ts('Please enter a valid Max Participants.'), 'positiveInteger'); } - + } //Financial Type $financialType = CRM_Financial_BAO_FinancialType::getIncomeFinancialType(); - + if (count($financialType)) { $this->assign('financialType', $financialType); } $this->add( - 'select', - 'financial_type_id', - ts('Financial Type'), + 'select', + 'financial_type_id', + ts('Financial Type'), array('' => ts('- select -')) + $financialType, true ); - + //CRM_Core_DAO::getFieldValue( 'CRM_Price_DAO_Field', $this->_fid, 'weight', 'id' ); // FIX ME: duplicate rule? /* diff --git a/CRM/Price/Form/Set.php b/CRM/Price/Form/Set.php index fdebf211321a03b228a18ea6399e4122d6f7e7d8..dd2f6ce9585fb77115e6fa7167e43e91636d53aa 100644 --- a/CRM/Price/Form/Set.php +++ b/CRM/Price/Form/Set.php @@ -186,10 +186,10 @@ class CRM_Price_Form_Set extends CRM_Core_Form { $this->addGroup($extends, 'extends', ts('Used For'), ' ', TRUE); $this->addRule('extends', ts('%1 is a required field.', array(1 => ts('Used For'))), 'required'); - + // financial type $financialType = CRM_Financial_BAO_FinancialType::getIncomeFinancialType(); - + $this->add('select', 'financial_type_id', ts('Default Financial Type'), array('' => ts('- select -')) + $financialType, 'required' diff --git a/CRM/Price/Page/Field.php b/CRM/Price/Page/Field.php index f52f8f26cf09edd218cf42f2db63e2ef2440d980..4151ed7be7d87bb7a688049a0e3e2f7b22eb8817 100644 --- a/CRM/Price/Page/Field.php +++ b/CRM/Price/Page/Field.php @@ -131,7 +131,7 @@ class CRM_Price_Page_Field extends CRM_Core_Page { $priceFieldBAO->price_set_id = $this->_sid; $priceFieldBAO->orderBy('weight, label'); $priceFieldBAO->find(); - + while ($priceFieldBAO->fetch()) { $priceField[$priceFieldBAO->id] = array(); CRM_Core_DAO::storeValues($priceFieldBAO, $priceField[$priceFieldBAO->id]); @@ -145,7 +145,7 @@ class CRM_Price_Page_Field extends CRM_Core_Page { $priceField[$priceFieldBAO->id]['price'] = CRM_Utils_Array::value('amount', $optionValues); } - + $action = array_sum(array_keys($this->actionLinks())); if ($this->_isSetReserved) { @@ -243,7 +243,7 @@ class CRM_Price_Page_Field extends CRM_Core_Page { $this->assign('usedBy', $usedBy); $this->_isSetReserved= CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $this->_sid, 'is_reserved'); $this->assign('isReserved', $this->_isSetReserved); - + CRM_Price_BAO_Set::checkPermission($this->_sid); $comps = array( 'Event' => 'civicrm_event', diff --git a/CRM/Price/Page/Option.php b/CRM/Price/Page/Option.php index b3c9b9cf7162d26bd14ea2ffa248e5bdd78eaefe..6ac60c4659649966f95d430ba5a7ff5bfef7cbe4 100644 --- a/CRM/Price/Page/Option.php +++ b/CRM/Price/Page/Option.php @@ -66,7 +66,7 @@ class CRM_Price_Page_Option extends CRM_Core_Page { * @access protected */ protected $_isSetReserved = false; - + /** * The action links that we need to display for the browse screen * diff --git a/CRM/Profile/Page/Dynamic.php b/CRM/Profile/Page/Dynamic.php index ea51c989a8488439954a813a7bbb5b59e482d7ee..d66d1b547c8c4b9e539ad8bfebd0f6e145b54d3f 100644 --- a/CRM/Profile/Page/Dynamic.php +++ b/CRM/Profile/Page/Dynamic.php @@ -98,7 +98,7 @@ class CRM_Profile_Page_Dynamic extends CRM_Core_Page { protected $_multiRecord = NULL; protected $_recordId = NULL; - + /* * fetch multirecord as well as non-multirecord fields */ @@ -130,21 +130,21 @@ class CRM_Profile_Page_Dynamic extends CRM_Core_Page { if (!array_key_exists('allFields', $_GET)) { $this->set('allFields', NULL); } - + //specifies the action being done on a multi record field $multiRecordAction = CRM_Utils_Request::retrieve('multiRecord', 'String', $this); - - $this->_multiRecord = (!is_numeric($multiRecordAction)) ? + + $this->_multiRecord = (!is_numeric($multiRecordAction)) ? CRM_Core_Action::resolve($multiRecordAction) : $multiRecordAction; if ($this->_multiRecord) { $this->set('multiRecord', $this->_multiRecord); } - + if ($this->_multiRecord & CRM_Core_Action::VIEW) { $this->_recordId = CRM_Utils_Request::retrieve('recordId', 'Positive', $this); $this->_allFields = CRM_Utils_Request::retrieve('allFields', 'Integer', $this); } - + if ($profileIds) { $this->_profileIds = $profileIds; } diff --git a/CRM/Profile/Page/MultipleRecordFieldsListing.php b/CRM/Profile/Page/MultipleRecordFieldsListing.php index 5a36f740ecc85777b01eeb6ed008ccd931f81d57..81bc7bd191d8b24dccbc5ee56093a3b740b874f2 100644 --- a/CRM/Profile/Page/MultipleRecordFieldsListing.php +++ b/CRM/Profile/Page/MultipleRecordFieldsListing.php @@ -45,10 +45,10 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { protected $_fields = NULL; protected $_profileId = NULL; - + protected $_contactId = NULL; - protected $_customGroupTitle = NULL; + protected $_customGroupTitle = NULL; /** * Get BAO Name * @@ -71,7 +71,7 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { $view = array_search(CRM_Core_Action::VIEW, CRM_Core_Action::$_names); $update = array_search(CRM_Core_Action::UPDATE, CRM_Core_Action::$_names); $delete = array_search(CRM_Core_Action::DELETE, CRM_Core_Action::$_names); - + $links[CRM_Core_Action::VIEW] = array( 'name' => ts('View'), 'url' => 'civicrm/profile/view', @@ -92,7 +92,7 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { 'qs' => "id=%%id%%&recordId=%%recordId%%&gid=%%gid%%&multiRecord={$delete}&snippet=1&context=multiProfileDialog", 'title' => ts('Delete %1', array( 1 => $this->_customGroupTitle . ' record')), ); - + self::$_links = $links; } return self::$_links; @@ -117,17 +117,17 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { $this->assign('action', $action); $profileId = CRM_Utils_Request::retrieve('profileId', 'Positive', $this, FALSE); if (!is_array($profileId) && is_numeric($profileId)) { - $this->_profileId = $profileId; + $this->_profileId = $profileId; } //record id $recid = CRM_Utils_Request::retrieve('recid', 'Positive', $this, FALSE, 0); //custom group id $groupId = CRM_Utils_Request::retrieve('groupId', 'Positive', $this, FALSE, 0); - + $this->_contactId = CRM_Utils_Request::retrieve('contactId', 'Positive', $this, FALSE); - + if ($action & CRM_Core_Action::BROWSE) { - //browse + //browse $this->browse(); return; } @@ -154,7 +154,7 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { $fieldIDs = NULL; $result = NULL; $multiRecordFieldsWithSummaryListing = CRM_Core_BAO_UFGroup::shiftMultiRecordFields($fields, $multiRecordFields, TRUE); - + $multiFieldId = CRM_Core_BAO_CustomField::getKeyID(key($multiRecordFields)); $customGroupId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField', $multiFieldId, 'custom_group_id'); $reached = CRM_Core_BAO_CustomGroup::hasReachedMaxLimit($customGroupId, $this->_contactId); @@ -163,12 +163,12 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { $this->assign('gid', $this->_profileId); } $this->assign('reachedMax', $reached); - + if ($multiRecordFieldsWithSummaryListing && !empty($multiRecordFieldsWithSummaryListing)) { $fieldIDs = array_keys($multiRecordFieldsWithSummaryListing); } } - + if ($fieldIDs && !empty($fieldIDs) && $this->_contactId) { $options = array( ); $returnProperities = array('html_type', 'data_type', 'date_format', 'time_format'); @@ -177,24 +177,24 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { $param = array('id' => $fieldIDs[$key]); $returnValues = array( ); CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_CustomField', $param, $returnValues, $returnProperities); - + $optionValuePairs = CRM_Core_BAO_CustomOption::getCustomOption($fieldIDs[$key]); if (!empty($optionValuePairs)) { foreach ($optionValuePairs as $optionPairs) { $options[$fieldIDs[$key]][$optionPairs['value']] = $optionPairs['label']; } } - + $options[$fieldIDs[$key]]['attributes']['html_type'] = $returnValues['html_type']; $options[$fieldIDs[$key]]['attributes']['data_type'] = $returnValues['data_type']; - - $options[$fieldIDs[$key]]['attributes']['format'] = + + $options[$fieldIDs[$key]]['attributes']['format'] = $options[$fieldIDs[$key]]['attributes']['date_format'] = CRM_Utils_Array::value('date_format', $returnValues); $options[$fieldIDs[$key]]['attributes']['time_format'] = CRM_Utils_Array::value('time_format', $returnValues); } - + $result = CRM_Core_BAO_CustomValueTable::getEntityValues($this->_contactId, NULL, $fieldIDs, TRUE); - + if (!empty($fieldIDs)) { //get the group info of multi rec fields in listing view $fieldInput = $fieldIDs; @@ -209,7 +209,7 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { } $customGroupInfo = CRM_Core_BAO_CustomGroup::getGroupTitles($fieldInput); $this->_customGroupTitle = $customGroupInfo[$fieldIdInput]['groupTitle']; - + if ($result && !empty($result)) { $links = self::links(); $pageCheckSum = $this->get('pageCheckSum'); @@ -219,7 +219,7 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { } } $linkAction = array_sum(array_keys($this->links())); - + foreach ($result as $recId => &$value) { foreach ($value as $fieldId => &$val) { if (is_numeric($fieldId)) { @@ -240,7 +240,7 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { } } } - + $headers = array( ); if (!empty($fieldIDs)) { foreach ($fieldIDs as $fieldID) {