X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FPrice%2FForm%2FSet.php;h=5bcc4d664e15254b52329e88cea932ee37064141;hb=92fcb95fbd9114b128e44d19b8208e20e0ae3742;hp=1aadbe2b05f0af546f4bea3e157e2827c46d5c1b;hpb=a6da8f4ce01fc90680ae8c52c976797b2a953579;p=civicrm-core.git diff --git a/CRM/Price/Form/Set.php b/CRM/Price/Form/Set.php index 1aadbe2b05..5bcc4d664e 100644 --- a/CRM/Price/Form/Set.php +++ b/CRM/Price/Form/Set.php @@ -1,7 +1,7 @@ ts('Price Sets'), + $breadCrumb = array(array( + 'title' => ts('Price Sets'), 'url' => $url, )); CRM_Utils_System::appendBreadCrumb($breadCrumb); } /** - * global form rule + * Global form rule * - * @param array $fields the input form values - * @param array $files the uploaded files if any - * @param array $options additional user data + * @param array $fields + * The input form values. + * @param array $files + * The uploaded files if any. + * @param array $options + * Additional user data. * * @return true if no errors, else array of errors - * @access public * @static */ - static function formRule($fields, $files, $options) { + public static function formRule($fields, $files, $options) { $errors = array(); $count = count(CRM_Utils_Array::value('extends', $fields)); //price sets configured for membership @@ -109,12 +110,11 @@ class CRM_Price_Form_Set extends CRM_Core_Form { } /** - * Function to actually build the form + * Build the form object * * @param null * * @return void - * @access public */ public function buildQuickForm() { $this->applyFilter('__ALL__', 'trim'); @@ -150,6 +150,7 @@ class CRM_Price_Form_Set extends CRM_Core_Form { } $extends[] = $option; break; + case 'CiviContribute': $option = $this->createElement('checkbox', $compObj->componentID, NULL, ts('Contribution')); if (!empty($priceSetUsedTables)) { @@ -162,6 +163,7 @@ class CRM_Price_Form_Set extends CRM_Core_Form { } $extends[] = $option; break; + case 'CiviMember': $option = $this->createElement('checkbox', $compObj->componentID, NULL, ts('Membership')); if (!empty($priceSetUsedTables)) { @@ -231,22 +233,23 @@ class CRM_Price_Form_Set extends CRM_Core_Form { } /** - * This function sets the default values for the form. Note that in edit/view mode + * Set default values for the form. Note that in edit/view mode * the default values are retrieved from the database * * @param null * * @return array array of default values - * @access public */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array('is_active' => TRUE); if ($this->_sid) { $params = array('id' => $this->_sid); CRM_Price_BAO_PriceSet::retrieve($params, $defaults); $extends = explode(CRM_Core_DAO::VALUE_SEPARATOR, $defaults['extends']); unset($defaults['extends']); - foreach ($extends as $compId) $defaults['extends'][$compId] = 1; + foreach ($extends as $compId) { + $defaults['extends'][$compId] = 1; + } } return $defaults; @@ -258,7 +261,6 @@ class CRM_Price_Form_Set extends CRM_Core_Form { * @param null * * @return void - * @access public */ public function postProcess() { // get the submitted form values. @@ -270,7 +272,11 @@ class CRM_Price_Form_Set extends CRM_Core_Form { $compIds = array(); $extends = CRM_Utils_Array::value('extends', $params); if (is_array($extends)) { - foreach ($extends as $compId => $selected) if ($selected) { $compIds[] = $compId; } + foreach ($extends as $compId => $selected) { + if ($selected) { + $compIds[] = $compId; + } + } } $params['extends'] = implode(CRM_Core_DAO::VALUE_SEPARATOR, $compIds); @@ -298,4 +304,3 @@ class CRM_Price_Form_Set extends CRM_Core_Form { } } } -