diff --git a/include/class.config.php b/include/class.config.php index 5a169199d1cca71c2f269c59620ec619ffcfee22..9fbddc5ac56c2912a898ab8d17acec8083cbf8f8 100644 --- a/include/class.config.php +++ b/include/class.config.php @@ -530,8 +530,8 @@ class OsticketConfig extends Config { static function allTopicSortModes() { return array( - 'a' => __('Alphabetically'), - 'm' => __('Manually'), + Topic::SORT_ALPHA => __('Alphabetically'), + Topic::SORT_MANUAL => __('Manually'), ); } diff --git a/include/class.topic.php b/include/class.topic.php index 140be92151c4a2ba6c0b7477da6a2ff6a3fbd5af..6b8f814e1c3115b8dea6056f7912c43437fdddba 100644 --- a/include/class.topic.php +++ b/include/class.topic.php @@ -69,6 +69,9 @@ implements TemplateVariable { const FLAG_CUSTOM_NUMBERS = 0x0001; + const SORT_ALPHA = 'a'; + const SORT_MANUAL = 'm'; + function asVar() { return $this->getName(); } @@ -353,7 +356,7 @@ implements TemplateVariable { // primary, the list may need to be sorted. Caching is ok here, // because the locale is not going to be changed within a single // request. - if ($localize) + if ($localize && $cfg->getTopicSortMode() == self::SORT_ALPHA) return Internationalization::sortKeyedList($requested_names); return $requested_names;