$this->applyFilter('__ALL__', 'trim');
$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', [
- 'CRM_Contribute_DAO_Product',
- $this->_id,
- ]);
+ 'CRM_Contribute_DAO_Product',
+ $this->_id,
+ ]);
$this->add('text', 'sku', ts('SKU'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Product', 'sku'));
$this->add('textarea', 'description', ts('Description'), 'rows=3, cols=60');
$this->add('textarea', 'options', ts('Options'), 'rows=3, cols=60');
$this->add('select', 'period_type', ts('Period Type'), [
- '' => '- select -',
- 'rolling' => 'Rolling',
- 'fixed' => 'Fixed',
- ]);
+ '' => '- select -',
+ 'rolling' => 'Rolling',
+ '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'));
$this->addFormRule(['CRM_Contribute_Form_ManagePremiums', 'formRule']);
$this->addButtons([
- [
- 'type' => 'upload',
- 'name' => ts('Save'),
- 'isDefault' => TRUE,
- ],
- [
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ],
- ]
- );
+ [
+ 'type' => 'upload',
+ 'name' => ts('Save'),
+ 'isDefault' => TRUE,
+ ],
+ [
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ],
+ ]);
$this->assign('productId', $this->_id);
}