Skip to content
Snippets Groups Projects
Commit ce226944 authored by aydreeihn's avatar aydreeihn
Browse files

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.
parent 96982469
Branches
Tags
No related merge requests found
......@@ -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;
......
......@@ -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;
......
......@@ -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>
&nbsp;<span class="error">&nbsp;</span> <i class="help-tip icon-question-sign" href="#status"></i>
</td>
......
......@@ -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>
&nbsp;<span class="error">*&nbsp;</span> <i class="help-tip icon-question-sign" href="#status"></i>
</td>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment