X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCampaign%2FForm%2FSurveyType.php;h=f7a38ad6c01ee5c8d4ce21fb624d6a8a8389590e;hb=7d26615ff524db9845f4bf194866200627209a8e;hp=0cce9e4b358f8a5378c1037a0952625e678f308d;hpb=3f7c098fcb6553d0662b9bbf3df2261244a97aa8;p=civicrm-core.git diff --git a/CRM/Campaign/Form/SurveyType.php b/CRM/Campaign/Form/SurveyType.php index 0cce9e4b35..f7a38ad6c0 100644 --- a/CRM/Campaign/Form/SurveyType.php +++ b/CRM/Campaign/Form/SurveyType.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 5 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2018 | + | Copyright CiviCRM LLC (c) 2004-2019 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -28,7 +28,7 @@ /** * * @package CRM - * @copyright CiviCRM LLC (c) 2004-2018 + * @copyright CiviCRM LLC (c) 2004-2019 */ /** @@ -98,7 +98,7 @@ class CRM_Campaign_Form_SurveyType extends CRM_Admin_Form { $defaults = parent::setDefaultValues(); if (!isset($defaults['weight']) || !$defaults['weight']) { - $fieldValues = array('option_group_id' => $this->_gid); + $fieldValues = ['option_group_id' => $this->_gid]; $defaults['weight'] = CRM_Utils_Weight::getDefaultWeight('CRM_Core_DAO_OptionValue', $fieldValues); } @@ -127,9 +127,9 @@ class CRM_Campaign_Form_SurveyType extends CRM_Admin_Form { if ($this->_action == CRM_Core_Action::UPDATE && CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $this->_id, 'is_reserved') ) { - $this->freeze(array('label', 'is_active')); + $this->freeze(['label', 'is_active']); } - $this->add('text', 'weight', ts('Order'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionValue', 'weight'), TRUE); + $this->add('number', 'weight', ts('Order'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionValue', 'weight'), TRUE); $this->assign('id', $this->_id); } @@ -140,7 +140,7 @@ class CRM_Campaign_Form_SurveyType extends CRM_Admin_Form { public function postProcess() { if ($this->_action & CRM_Core_Action::DELETE) { - $fieldValues = array('option_group_id' => $this->_gid); + $fieldValues = ['option_group_id' => $this->_gid]; $wt = CRM_Utils_Weight::delWeight('CRM_Core_DAO_OptionValue', $this->_id, $fieldValues); if (CRM_Core_BAO_OptionValue::del($this->_id)) { @@ -148,7 +148,7 @@ class CRM_Campaign_Form_SurveyType extends CRM_Admin_Form { } } else { - $params = $ids = array(); + $params = $ids = []; $params = $this->exportValues(); // set db value of filter in params if filter is non editable @@ -159,7 +159,7 @@ class CRM_Campaign_Form_SurveyType extends CRM_Admin_Form { $params['component_id'] = CRM_Core_Component::getComponentID('CiviCampaign'); $optionValue = CRM_Core_OptionValue::addOptionValue($params, $this->_gName, $this->_action, $this->_id); - CRM_Core_Session::setStatus(ts('The Survey type \'%1\' has been saved.', array(1 => $optionValue->label)), ts('Saved'), 'success'); + CRM_Core_Session::setStatus(ts('The Survey type \'%1\' has been saved.', [1 => $optionValue->label]), ts('Saved'), 'success'); } }