+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2016 |
+ | Copyright CiviCRM LLC (c) 2004-2017 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2016
+ * @copyright CiviCRM LLC (c) 2004-2017
*/
/**
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('text', 'min_amount', ts('Minimum Amount'));
+
if (CRM_Utils_System::isNull($extends)) {
$this->assign('extends', FALSE);
}