<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
|| $fieldDefaults['html_type'] == 'Multi-Select'
|| $fieldDefaults['html_type'] == 'AdvMulti-Select'
) {
- if (CRM_Utils_Array::value('default_value', $fieldDefaults)) {
+ if (!empty($fieldDefaults['default_value'])) {
$defaultCheckValues = explode(CRM_Core_DAO::VALUE_SEPARATOR,
substr($fieldDefaults['default_value'], 1, -1)
);
*/
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',
*
* @param array $fields posted values of the form
*
+ * @param $files
+ * @param $form
+ *
* @return array list of errors to be posted back to the form
* @static
* @access public
$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;
}
CRM_Core_DAO::VALUE_SEPARATOR,
substr($customField->default_value, 1, -1)
);
- if (CRM_Utils_Array::value('default_value', $params)) {
+ if (!empty($params['default_value'])) {
if (!in_array($customOption->value, $defVal)) {
if (empty($defVal[0])) {
$defVal = array($customOption->value);
break;
}
- if (CRM_Utils_Array::value('default_value', $params)) {
+ if (!empty($params['default_value'])) {
$customField->default_value = $customOption->value;
$customField->save();
}