From ce2269441d1a4303a3f772d1b7468fd8bc8022b5 Mon Sep 17 00:00:00 2001 From: aydreeihn <adriane@enhancesoft.com> Date: Thu, 28 Jun 2018 14:46:24 -0500 Subject: [PATCH] Issue: Translating Archive Selections This commit avoids camel casing the select values for Archiving Help Topic and Department options. It also fixes an issue where the selected value was being translated and it should not have been. --- include/class.dept.php | 8 ++++---- include/class.topic.php | 8 ++++---- include/staff/department.inc.php | 6 +++--- include/staff/helptopic.inc.php | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/class.dept.php b/include/class.dept.php index 4eb0b8e22..88cbcad97 100644 --- a/include/class.dept.php +++ b/include/class.dept.php @@ -736,23 +736,23 @@ implements TemplateVariable, Searchable { $this->setFlag(self::FLAG_DISABLE_AUTO_CLAIM, isset($vars['disable_auto_claim'])); $filter_actions = FilterAction::objects()->filter(array('type' => 'dept', 'configuration' => '{"dept_id":'. $this->getId().'}')); - if ($filter_actions && $vars['status'] == __('Active')) + if ($filter_actions && $vars['status'] == 'active') FilterAction::setFilterFlag($filter_actions, 'dept', false); else FilterAction::setFilterFlag($filter_actions, 'dept', true); switch ($vars['status']) { - case __('Active'): + case 'active': $this->setFlag(self::FLAG_ACTIVE, true); $this->setFlag(self::FLAG_ARCHIVED, false); break; - case __('Disabled'): + case 'disabled': $this->setFlag(self::FLAG_ACTIVE, false); $this->setFlag(self::FLAG_ARCHIVED, false); break; - case __('Archived'): + case 'archived': $this->setFlag(self::FLAG_ACTIVE, false); $this->setFlag(self::FLAG_ARCHIVED, true); break; diff --git a/include/class.topic.php b/include/class.topic.php index 245b3c39f..8ef9de212 100644 --- a/include/class.topic.php +++ b/include/class.topic.php @@ -471,23 +471,23 @@ implements TemplateVariable, Searchable { $this->notes = Format::sanitize($vars['notes']); $filter_actions = FilterAction::objects()->filter(array('type' => 'topic', 'configuration' => '{"topic_id":'. $this->getId().'}')); - if ($filter_actions && $vars['status'] == __('Active')) + if ($filter_actions && $vars['status'] == 'active') FilterAction::setFilterFlag($filter_actions, 'topic', false); else FilterAction::setFilterFlag($filter_actions, 'topic', true); switch ($vars['status']) { - case __('Active'): + case 'active': $this->setFlag(self::FLAG_ACTIVE, true); $this->setFlag(self::FLAG_ARCHIVED, false); break; - case __('Disabled'): + case 'disabled': $this->setFlag(self::FLAG_ACTIVE, false); $this->setFlag(self::FLAG_ARCHIVED, false); break; - case __('Archived'): + case 'archived': $this->setFlag(self::FLAG_ACTIVE, false); $this->setFlag(self::FLAG_ARCHIVED, true); break; diff --git a/include/staff/department.inc.php b/include/staff/department.inc.php index 4352badf3..2005cf534 100644 --- a/include/staff/department.inc.php +++ b/include/staff/department.inc.php @@ -99,9 +99,9 @@ $info = Format::htmlchars(($errors && $_POST) ? $_POST : $info); </td> <td> <select name="status"> - <option value="Active"<?php echo ($info['status'] == __('Active'))?'selected="selected"':'';?>><?php echo __('Active'); ?></option> - <option value="Disabled"<?php echo ($info['status'] == __('Disabled'))?'selected="selected"':'';?>><?php echo __('Disabled'); ?></option> - <option value="Archived"<?php echo ($info['status'] == __('Archived'))?'selected="selected"':'';?>><?php echo __('Archived'); ?></option> + <option value="active"<?php echo ($info['status'] == __('Active'))?'selected="selected"':'';?>><?php echo __('Active'); ?></option> + <option value="disabled"<?php echo ($info['status'] == __('Disabled'))?'selected="selected"':'';?>><?php echo __('Disabled'); ?></option> + <option value="archived"<?php echo ($info['status'] == __('Archived'))?'selected="selected"':'';?>><?php echo __('Archived'); ?></option> </select> <span class="error"> </span> <i class="help-tip icon-question-sign" href="#status"></i> </td> diff --git a/include/staff/helptopic.inc.php b/include/staff/helptopic.inc.php index b67836669..23e813d37 100644 --- a/include/staff/helptopic.inc.php +++ b/include/staff/helptopic.inc.php @@ -61,9 +61,9 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); </td> <td> <select name="status"> - <option value="Active"<?php echo ($info['status'] == __('Active'))?'selected="selected"':'';?>><?php echo __('Active'); ?></option> - <option value="Disabled"<?php echo ($info['status'] == __('Disabled'))?'selected="selected"':'';?>><?php echo __('Disabled'); ?></option> - <option value="Archived"<?php echo ($info['status'] == __('Archived'))?'selected="selected"':'';?>><?php echo __('Archived'); ?></option> + <option value="active"<?php echo ($info['status'] == __('Active'))?'selected="selected"':'';?>><?php echo __('Active'); ?></option> + <option value="disabled"<?php echo ($info['status'] == __('Disabled'))?'selected="selected"':'';?>><?php echo __('Disabled'); ?></option> + <option value="archived"<?php echo ($info['status'] == __('Archived'))?'selected="selected"':'';?>><?php echo __('Archived'); ?></option> </select> <span class="error">* </span> <i class="help-tip icon-question-sign" href="#status"></i> </td> -- GitLab