X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FAdmin%2FForm%2FOptions.php;h=f68718d881b5886a5e55b02c36c8232390f1170e;hb=d998c6152ede6a080f8e93560c7cfc94d718df7e;hp=07ea080b35d71a5a4dd8914919f9d3fe016b3bcb;hpb=dbf3ef22cc2675668c2fff2d851f692d6f048b11;p=civicrm-core.git diff --git a/CRM/Admin/Form/Options.php b/CRM/Admin/Form/Options.php index 07ea080b35..f68718d881 100644 --- a/CRM/Admin/Form/Options.php +++ b/CRM/Admin/Form/Options.php @@ -1,7 +1,7 @@ _gName, array( 'email_greeting', 'postal_greeting', @@ -302,7 +302,7 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form { $enabled->freeze(); } - //fix for CRM-3552, CRM-4575 + // fix for CRM-3552, CRM-4575 $showIsDefaultGroups = array( 'email_greeting', 'postal_greeting', @@ -322,7 +322,7 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form { $this->add('checkbox', 'is_default', ts('Default Option?')); } - //get contact type for which user want to create a new greeting/addressee type, CRM-4575 + // get contact type for which user want to create a new greeting/addressee type, CRM-4575 if (in_array($this->_gName, array( 'email_greeting', 'postal_greeting', @@ -341,7 +341,7 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form { if ($this->_gName == 'participant_status') { // For Participant Status options, expose the 'filter' field to track which statuses are "Counted", and the Visibility field - $element = $this->add('checkbox', 'filter', ts('Counted?')); + $this->add('checkbox', 'filter', ts('Counted?')); $this->add('select', 'visibility_id', ts('Visibility'), CRM_Core_PseudoConstant::visibility()); } if ($this->_gName == 'participant_role') { @@ -364,6 +364,7 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form { * * @return array * array of errors / empty array. + * @throws \CRM_Core_Exception */ public static function formRule($fields, $files, $self) { $errors = array(); @@ -406,7 +407,7 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form { $dataType = self::getOptionGroupDataType($self->_gName); if ($dataType && $self->_gName !== 'activity_type') { $validate = CRM_Utils_Type::validate($fields['value'], $dataType, FALSE); - if (!$validate) { + if ($validate === FALSE) { CRM_Core_Session::setStatus( ts('Data Type of the value field for this option value does not match ' . $dataType), ts('Value field Data Type mismatch')); @@ -435,7 +436,7 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form { public function postProcess() { if ($this->_action & CRM_Core_Action::DELETE) { $fieldValues = array('option_group_id' => $this->_gid); - $wt = CRM_Utils_Weight::delWeight('CRM_Core_DAO_OptionValue', $this->_id, $fieldValues); + CRM_Utils_Weight::delWeight('CRM_Core_DAO_OptionValue', $this->_id, $fieldValues); if (CRM_Core_BAO_OptionValue::del($this->_id)) { if ($this->_gName == 'phone_type') { @@ -450,7 +451,6 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form { } } else { - $ids = array(); $params = $this->exportValues(); // allow multiple defaults within group.