+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015 |
+ | Copyright CiviCRM LLC (c) 2004-2016 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2015
+ * @copyright CiviCRM LLC (c) 2004-2016
*/
/**
if ($asciiValue >= 48 && $asciiValue <= 57) {
$errors['title'] = ts("Name cannot not start with a digit");
}
+ // CRM-16189
+ if (!empty($fields['extends'])
+ && (array_key_exists(CRM_Core_Component::getComponentID('CiviEvent'), $fields['extends'])
+ || array_key_exists(CRM_Core_Component::getComponentID('CiviMember'), $fields['extends']))
+ ) {
+ try {
+ CRM_Financial_BAO_FinancialAccount::validateFinancialType($fields['financial_type_id']);
+ }
+ catch (CRM_Core_Exception $e) {
+ $errors['financial_type_id'] = $e->getMessage();
+ }
+ }
return empty($errors) ? TRUE : $errors;
}
$this->addElement('checkbox', 'is_active', ts('Is this Price Set active?'));
$this->addButtons(array(
- array(
- 'type' => 'next',
- 'name' => ts('Save'),
- 'spacing' => ' ',
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- )
- );
+ array(
+ 'type' => 'next',
+ 'name' => ts('Save'),
+ 'spacing' => ' ',
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ),
+ ));
$this->addFormRule(array('CRM_Price_Form_Set', 'formRule'));
// Jump directly to adding a field if popups are disabled
$action = CRM_Core_Resources::singleton()->ajaxPopupsEnabled ? 'browse' : 'add';
$url = CRM_Utils_System::url('civicrm/admin/price/field', array(
- 'reset' => 1,
- 'action' => $action,
- 'sid' => $set->id,
- 'new' => 1,
- ));
+ 'reset' => 1,
+ 'action' => $action,
+ 'sid' => $set->id,
+ 'new' => 1,
+ ));
CRM_Core_Session::setStatus(ts("Your Set '%1' has been added. You can add fields to this set now.",
array(1 => $set->title)
), ts('Saved'), 'success');