diff --git a/include/class.config.php b/include/class.config.php index e886ad749bde746e946eb639e0fffea0948894db..2cdce1351937f1838b0710e43b72b42574c7c522 100644 --- a/include/class.config.php +++ b/include/class.config.php @@ -931,7 +931,7 @@ class OsticketConfig extends Config { if($vars['enable_captcha']) { if (!extension_loaded('gd')) - $errors['enable_captcha']='The GD extension required'; + $errors['enable_captcha']='The GD extension is required'; elseif(!function_exists('imagepng')) $errors['enable_captcha']='PNG support required for Image Captcha'; } @@ -957,7 +957,11 @@ class OsticketConfig extends Config { $errors['max_staff_file_uploads']='Invalid selection. Must be less than '.$maxfileuploads; } - + if ($vars['default_help_topic'] + && ($T = Topic::lookup($vars['default_help_topic'])) + && !$T->isActive()) { + $errors['default_help_topic'] = 'Default help topic must be set to active'; + } if(!Validator::process($f, $vars, $errors) || $errors) return false; diff --git a/include/class.topic.php b/include/class.topic.php index 700072c13460540c2b967f2d9e184b4da67c156a..930b1795dd0dbf2fc9143a58cc8699c2a64dd960 100644 --- a/include/class.topic.php +++ b/include/class.topic.php @@ -23,6 +23,8 @@ class Topic { var $page; var $form; + const DISPLAY_DISABLED = 2; + function Topic($id) { $this->id=0; $this->load($id); @@ -250,8 +252,6 @@ class Topic { $names[$id] = $name; } } - if ($disabled && !$publicOnly) - return $names; // Apply requested filters $requested_names = array(); @@ -261,6 +261,8 @@ class Topic { continue; if (!$disabled && $info['disabled']) continue; + if ($disabled === self::DISPLAY_DISABLED && $info['disabled']) + $n .= " — (disabled)"; $requested_names[$id] = $n; } diff --git a/include/staff/settings-tickets.inc.php b/include/staff/settings-tickets.inc.php index 3be8dd7d6f1b5afb3a6ac2b8fa3c3cf14dffe516..a7960a02b16552d72bd5377a138ccc049b535d46 100644 --- a/include/staff/settings-tickets.inc.php +++ b/include/staff/settings-tickets.inc.php @@ -68,12 +68,13 @@ if(!($maxfileuploads=ini_get('max_file_uploads'))) <td> <select name="default_help_topic"> <option value="0">— None —</option><?php - $topics = Topic::getHelpTopics(); + $topics = Topic::getHelpTopics(false, Topic::DISPLAY_DISABLED); while (list($id,$topic) = each($topics)) { ?> <option value="<?php echo $id; ?>"<?php echo ($config['default_help_topic']==$id)?'selected':''; ?>><?php echo $topic; ?></option> <?php } ?> - </select> + </select><br/> + <span class="error"><?php echo $errors['default_help_topic']; ?></span> </td> </tr> <tr>