+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2017 |
+ | Copyright CiviCRM LLC (c) 2004-2018 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2017
+ * @copyright CiviCRM LLC (c) 2004-2018
*/
/**
*/
protected $_gLabel;
+ /**
+ * Is this Option Group Domain Specific
+ * @var bool
+ */
+ protected $_domainSpecific = FALSE;
+
/**
* Pre-process
*/
'name'
);
$this->_gLabel = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $this->_gid, 'title');
+ $this->_domainSpecific = in_array($this->_gName, CRM_Core_OptionGroup::$_domainIDGroups);
$url = "civicrm/admin/options/{$this->_gName}";
$params = "reset=1";
CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionValue', 'value'),
TRUE
);
+ $this->addRule('value',
+ ts('This Value already exists in the database for this option group. Please select a different Value.'),
+ 'optionExists',
+ array('CRM_Core_DAO_OptionValue', $this->_id, $this->_gid, 'value', $this->_domainSpecific)
+ );
}
else {
$this->add('text', 'icon', ts('Icon'), array('class' => 'crm-icon-picker', 'title' => ts('Choose Icon'), 'allowClear' => TRUE));
'addressee',
)) && !$isReserved
) {
- $domainSpecificOptionGroups = array('from_email_address');
- $domainSpecific = in_array($this->_gName, $domainSpecificOptionGroups) ? TRUE : FALSE;
$this->addRule('label',
- ts('This Label already exists in the database for this option group. Please select a different Value.'),
+ ts('This Label already exists in the database for this option group. Please select a different Label.'),
'optionExists',
- array('CRM_Core_DAO_OptionValue', $this->_id, $this->_gid, 'label', $domainSpecific)
+ array('CRM_Core_DAO_OptionValue', $this->_id, $this->_gid, 'label', $this->_domainSpecific)
);
}