+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
* $Id$
*
*/
class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form {
/**
- * Pre process the form
- *
- *
- * @return void
+ * Pre process the form.
*/
public function preProcess() {
parent::preProcess();
}
/**
- * Build the form object
+ * Build the form object.
*
* @return void
*/
$this->add('text', 'name', ts('Name'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Product', 'name'), TRUE);
$this->addRule('name', ts('A product with this name already exists. Please select another name.'), 'objectExists', array(
'CRM_Contribute_DAO_Product',
- $this->_id
+ $this->_id,
));
$this->add('text', 'sku', ts('SKU'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Product', 'sku'));
$this->add('select', 'period_type', ts('Period Type'), array(
'' => '- select -',
'rolling' => 'Rolling',
- 'fixed' => 'Fixed'
+ 'fixed' => 'Fixed',
));
$this->add('text', 'fixed_period_start_day', ts('Fixed Period Start Day'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Product', 'fixed_period_start_day'));
}
/**
- * Function for validation
+ * Function for validation.
*
* @param array $params
* (ref.) an assoc array of name/value pairs.
*
* @return bool|array
* mixed true or array of errors
- * @static
*/
public static function formRule($params, $files) {
if (isset($params['imageOption'])) {
}
/**
- * Process the form submission
+ * Process the form submission.
*
*
* @return void
foreach (array(
'cost',
'price',
- 'min_contribution'
+ 'min_contribution',
) as $f) {
$params[$f] = CRM_Utils_Rule::cleanMoney($params[$f]);
}
}
/**
- * Resize a premium image to a different size
+ * Resize a premium image to a different size.
*
*
* @param string $filename