<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
* The set id saved to the session for an update
*
* @var int
- * @access protected
*/
protected $_sid;
* @param null
*
* @return void
- * @access public
*/
public function preProcess() {
// current set id
CRM_Utils_System::setTitle($title);
$url = CRM_Utils_System::url('civicrm/admin/price', 'reset=1');
- $breadCrumb = array(array('title' => ts('Price Sets'),
+ $breadCrumb = array(array(
+ 'title' => ts('Price Sets'),
'url' => $url,
));
CRM_Utils_System::appendBreadCrumb($breadCrumb);
/**
* 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
* @param null
*
* @return void
- * @access public
*/
public function buildQuickForm() {
$this->applyFilter('__ALL__', 'trim');
}
$extends[] = $option;
break;
+
case 'CiviContribute':
$option = $this->createElement('checkbox', $compObj->componentID, NULL, ts('Contribution'));
if (!empty($priceSetUsedTables)) {
}
$extends[] = $option;
break;
+
case 'CiviMember':
$option = $this->createElement('checkbox', $compObj->componentID, NULL, ts('Membership'));
if (!empty($priceSetUsedTables)) {
* @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;
* @param null
*
* @return void
- * @access public
*/
public function postProcess() {
// get the submitted form values.
$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);
}
}
}
-