$this->_gid = CRM_Utils_Request::retrieve('gid', 'Positive', $this);
- if ($isReserved = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $this->_gid, 'is_reserved', 'id')) {
- CRM_Core_Error::fatal("You cannot add or edit muliple choice options in a reserved custom field-set.");
- }
if (!isset($this->_gid) && $this->_fid) {
- $this->_gid = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField',
+ $this->_gid = CRM_Core_DAO::getFieldValue(
+ 'CRM_Core_DAO_CustomField',
$this->_fid,
'custom_group_id'
);
}
+
if ($this->_fid) {
- $this->_optionGroupID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField',
+ $this->_optionGroupID = CRM_Core_DAO::getFieldValue(
+ 'CRM_Core_DAO_CustomField',
$this->_fid,
'option_group_id'
);
}
+ if ($isReserved = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $this->_gid, 'is_reserved', 'id')) {
+ CRM_Core_Error::fatal("You cannot add or edit muliple choice options in a reserved custom field-set.");
+ }
+
$this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
}
*/
public function buildQuickForm() {
if ($this->_action == CRM_Core_Action::DELETE) {
+ $option = civicrm_api3('option_value', 'getsingle', array('id' => $this->_id));
+ $this->assign('label', $option['label']);
$this->addButtons(array(
array(
'type' => 'next',
$params = $this->controller->exportValues('Option');
if ($this->_action == CRM_Core_Action::DELETE) {
+ $option = civicrm_api3('option_value', 'getsingle', array('id' => $this->_id));
$fieldValues = array('option_group_id' => $this->_optionGroupID);
- $wt = CRM_Utils_Weight::delWeight('CRM_Core_DAO_OptionValue', $this->_id, $fieldValues);
+ CRM_Utils_Weight::delWeight('CRM_Core_DAO_OptionValue', $this->_id, $fieldValues);
CRM_Core_BAO_CustomOption::del($this->_id);
- CRM_Core_Session::setStatus(ts('Your multiple choice option has been deleted'), ts('Deleted'), 'success');
+ CRM_Core_Session::setStatus(ts('Option "%1" has been deleted.', array(1 => $option['label'])), ts('Deleted'), 'success');
return;
}