Templatize admin/settings.php
authorRobert Sesek <rsesek@bluestatic.org>
Sat, 10 Jan 2009 07:00:07 +0000 (23:00 -0800)
committerRobert Sesek <rsesek@bluestatic.org>
Sat, 10 Jan 2009 07:00:07 +0000 (23:00 -0800)
* admin/global.php: Include DecoratorHelpers.php
* admin/settings.php: Complete rewrite with templates
* admin/templates/nav.html: Add id's to nav elements
* admin/templates/settings.html: New file
* includes/functions.php:
(construct_option_select): Add an id attribute

admin/global.php
admin/settings.php
admin/templates/nav.html
admin/templates/settings.html [new file with mode: 0644]
includes/functions.php

index 39391a5119e9a8d769308dce6b87f2761610f169..2f8a485313bc73e035648a5796c13e989a34824a 100755 (executable)
@@ -27,6 +27,8 @@ require_once('./includes/functions.php');
 // ###################################################################
 // setup admin templates
 
+require_once ISSO . '/DecoratorHelpers.php';
+
 require_once ISSO . '/Template.php';
 BSTemplate::$dbCacheTable      = TABLE_PREFIX . 'template';
 BSTemplate::$templatePath      = 'admin/templates/%s.html';
index 43a01a12e0e8182aab9681deb2fa15b96e17d0ea..2421406816352f501dec2f3071e2d5ac1b907b4c 100755 (executable)
 || ###################################################################
 \*=====================================================================*/
 
+$fetchtemplates = array(
+       'settings'
+);
+
 require_once('./global.php');
 require_once('./includes/class_sort.php');
 require_once('./includes/functions_datastore.php');
 
-NavLinks::optionsPages();
-$navigator->set_focus('tab', 'options', null);
-$navigator->set_focus('link', 'options-pages-settings', 'options-pages');
-
 if (!can_perform('canadmintools'))
 {
        admin_login();
@@ -44,7 +44,7 @@ if (empty($_REQUEST['do']))
 if ($_POST['do'] == 'update')
 {
        $updates = array();
-       foreach ($input->in['setting'] AS $varname => $value)
+       foreach ($input->in['settings'] as $varname => $value)
        {
                if (is_array($value))
                {
@@ -58,187 +58,34 @@ if ($_POST['do'] == 'update')
                        }
                }
                
-               $updates[] = "('" . $bugsys->escape($varname) . "', '" . $bugsys->escape($value) . "')";
+               $updates[] = "('" . $input->escape($varname) . "', '" . $input->escape($value) . "')";
        }
        
        $db->query("REPLACE INTO " . TABLE_PREFIX . "setting (varname, value) VALUES " . implode(',', $updates));
        
        build_settings();
        
-       $admin->redirect('setting.php');
+       $admin->redirect('settings.php');
 }
 
 // ###################################################################
 
 if ($_REQUEST['do'] == 'modify')
 {
-       $admin->page_start(T('Settings'));
-       
-       $admin->form_start('setting.php', 'update');
-       
-       $IS_SETTINGS = true;
-       
-       // ###################################################################
-       $admin->table_start();
-       $admin->table_head(T('General Options'));
+       $admin = new BSTemplate('settings');
        
        // authmethod
-       $admin->row_span(T('Authentication Method'), 'thead');
        $methods = BSFunctions::scan_directory('./includes/auth/');
-       foreach ($methods[''] AS $path)
+       $admin->vars['authmethods'] = '';
+       foreach ($methods AS $path)
        {
                if (preg_match('#auth_(.*)\.php#', $path, $matches))
                {
-                       $admin->list_item(ucwords(str_replace('_', ' ', $matches[1])), $matches[1], ($matches[1] == bugdar::$options['authmethod']));
+                       $admin->vars['authmethods'] .= '<option value="' . $matches[1] . '"' . ($matches[1] == bugdar::$options['authmethod'] ? ' selected="selected"' : '') . '>' . ucwords(str_replace('_', ' ', $matches[1])) . '</option>';
                }
        }
-       $admin->row_list(T('The authentication class to use to validate cookie data and longins. You may need to edit the actual file for certain authentication systems.'), 'setting[authmethod]');
-       
-       // allownewreg
-       $admin->row_span(T('Allow New Registrations'), 'thead');
-       $admin->row_yesno(T('If this is set to <em>yes</em>, then new users will be allowed to register.'), 'setting[allownewreg]', bugdar::$options['allownewreg']);
-       
-       // verifyemail
-       $admin->row_span(T('Require Activation Email'), 'thead');
-       $admin->row_yesno(T('Setting this to yes will force all new users to verify their account with an email activation link.'), 'setting[verifyemail]', bugdar::$options['verifyemail']);
-       
-       // moderatenewusers
-       $admin->row_span(T('Moderate New Users'), 'thead');
-       $admin->row_yesno(T('All new users will have to be approved by the administration before being able to have normal user rights.'), 'setting[moderatenewusers]', bugdar::$options['moderatenewusers']);
-       
-       // sendwelcomemail
-       $admin->row_span(T('Send New Use Welcome Email'), 'thead');
-       $admin->row_yesno(T('Setting this option to <em>yes</em> will send each new verified user a welcome email.'), 'setting[sendwelcomemail]', bugdar::$options['sendwelcomemail']);
-       
-       // webmasteremail
-       $admin->row_span(T('Webmaster Email Address'), 'thead');
-       $admin->row_input(T('The email address from which emails will be sent out.'), 'setting[webmasteremail]', bugdar::$options['webmasteremail']);
-       
-       // trackertitle
-       $admin->row_span(T('Tracker Title'), 'thead');
-       $admin->row_input(T('The global name of the bug tracker. Example: Blue Static Bug Tracker'), 'setting[trackertitle]', bugdar::$options['trackertitle']);
-       
-       // trackerurl
-       $admin->row_span(T('Tracker Base URL'), 'thead');
-       $admin->row_input(T('The base URL of the tracker. This is used when creating external links to the tracker. <strong>Be sure that this does not end in a trailing slash (&quot;/&quot;).</strong><br />Example: http://www.bluestatic.org/bugs'), 'setting[trackerurl]', bugdar::$options['trackerurl']);
-       
-       // dateformat
-       $admin->row_span(T('Date Format'), 'thead');
-       $admin->row_input(T('Set the date format used for bug report and comment information. This is based on PHP\'s date() function.'), 'setting[dateformat]', bugdar::$options['dateformat']);
-       
-       // defaulttimezone
-       $admin->row_span(T('Default Time Zone'), 'thead');
-       $admin->row_text(T('This controls the time zone that all unregistered users view the tracker with.'), construct_option_select('setting[defaulttimezone]', $bugsys->datef->fetch_timezone_list(), bugdar::$options['defaulttimezone']), bugdar::$options['defaulttimezone']);
-       
-       // defaultlanguage
-       $admin->row_span(T('Default Language'), 'thead');
-       $admin->row_text(T('You can set the default language that all new users (and guests) will use.'), construct_option_select('setting[defaultlanguage]', bugdar::$datastore['language'], bugdar::$options['defaultlanguage'], 'languageid', 'title'), bugdar::$options['defaultlanguage']);
-       
-       // syndicateditems
-       $admin->row_span(T('Number of Syndicated Items'), 'thead');
-       $admin->row_input(T('The number of bugs to be syndicated at any one time by the Atom XML feed.'), 'setting[syndicateditems]', bugdar::$options['syndicateditems']);
-       
-       // redirectheaders
-       $admin->row_span(T('Use Header Redirects'), 'thead');
-       $admin->row_yesno(T('Instead of displaying an intermediate page informing the user that their action was a success and a redirect is occurring, just send the user to the next screen using HTTP headers. This can save bandwidth.'), 'setting[redirectheaders]', bugdar::$options['redirectheaders']);
-       
-       $admin->table_end();
-       
-       // ###################################################################
-       $admin->table_start();
-       $admin->table_head(T('Bug Reporting Options'));
-       
-       // allowhtml
-       $admin->row_span(T('Allow HTML in Bug Reports'), 'thead');
-       $admin->row_yesno(T('Set this to <em>yes</em> if you want to allow users to post raw HTML in their bug reports. This is <strong>very</strong> dangerous and it is not recommended.'), 'setting[allowhtml]', bugdar::$options['allowhtml']);
-       
-       // defaultseverity
-       $admin->row_span(T('Default Severity'), 'thead');
-       $admin->row_text(T('The default severity that is selected when creating a new bug report.'), construct_option_select('setting[defaultseverity]', bugdar::$datastore['severity'],  bugdar::$options['defaultseverity'], 'severityid', 'severity'));
-       
-       // defaultpriority
-       $admin->row_span(T('Default Priority'), 'thead');
-       $admin->row_text(T('The default priority that will be selected when creating a new bug report. Depending on your permission setup, the user may not be able to set this in a new report so this will act as the value.'), construct_option_select('setting[defaultpriority]', bugdar::$datastore['priority'],  bugdar::$options['defaultpriority'], 'priorityid', 'priority'));
-       
-       // defaultstatus
-       $admin->row_span(T('Default Status'), 'thead');
-       $admin->row_text(T('The default default that is selected when creating a new bug report. If a user can not assign a status, this will be the one inserted into the database.'), construct_option_select('setting[defaultstatus]', bugdar::$datastore['status'],  bugdar::$options['defaultstatus'], 'statusid', 'status'));
-       
-       // defaultresolve
-       $admin->row_span(T('Default Resolution'), 'thead');
-       $admin->row_text(T('This is the default bug resolution. If a user is not able to change this field, setting this will act as the default value.'), construct_option_select('setting[defaultresolve]', bugdar::$datastore['resolution'],  bugdar::$options['defaultresolve'], 'resolutionid', 'resolution'));
-       
-       // defaultassign
-       $admin->row_span(T('Default Bug Assignment'), 'thead');
-       $admin->row_text(T('This is the default developer new bugs will be assigned to. If a user does not have permisssion to assign bugs, this will be the default. If you don\'t want any default assignment, leave this as <em>Not Selected</em>.'), construct_option_select('setting[defaultassign]', bugdar::$datastore['assignto'],  bugdar::$options['defaultassign'], 'userid', 'displayname', 0));
-       
-       // defaultcomment
-       $admin->row_span(T('Default Comment Text'), 'thead');
-       $admin->row_textarea(T('If you wish to set a template for entering the initial comment of a bug report, then you may specify this here. However, the template will only take effect on the initial report/comment. Note: the template cannot be forced on the user as there is no way to validate it.'), 'setting[defaultcomment]', bugdar::$options['defaultcomment']);
-       
-       $admin->table_end();
-       
-       // ###################################################################
-       $admin->table_start();
-       $admin->table_head(T('Bug Listing Display Options'));
-       
-       // hidestatuses
-       $admin->row_span(T('Hide Statuses on Bug Listings'), 'thead');
-       $admin->row_text(T('Here you can specify which statuses to hide on the bug list displays. Users have options in their controls to change this from these values, and this does not affect searches or the favorites list.'), construct_option_select('setting[hidestatuses]', bugdar::$datastore['status'], bugdar::$options['hidestatuses'], 'statusid', 'status', 0, true));
-       
-       // defaultsortkey
-       $admin->row_span(T('Default Sort Column'), 'thead');
-       $admin->row_text(T('Select the column to sort bugs by on listings. This is only a default setting which users can override in their preferences.'), construct_option_select('setting[defaultsortkey]', ListSorter::fetch_by_text(false, false), bugdar::$options['defaultsortkey']));
-       
-       // defaultsortas
-       $admin->row_span(T('Default Sort Direction'), 'thead');
-       $admin->row_text(T('Specify the default direction to sort bugs in the selected column. This works with and follows the same rules as the Sort Column.'), construct_option_select('setting[defaultsortas]', ListSorter::fetch_as_text(false), bugdar::$options['defaultsortas']));
-       
-       // columnoptions
-       $admin->row_span(T('Default Column Ordering Options'), 'thead');
-       $admin->row_text(T('Specify the order of the columns for bug listings. The value 0 disables the display of a column and if two or more columns have the same position number, they will be displayed in the same column.'), ConstructColumnOptionsSetting());
-       
-       $admin->table_end();
-       
-       // ###################################################################
-       $admin->table_start();
-       $admin->table_head(T('Pagination Options'));
-       
-       // defaultpp
-       $admin->row_span(T('Default Per-Page Amount'), 'thead');
-       $admin->row_input(T('The number of items (e.g. bugs) to be displayed on a page by default. The user will have the option of over-riding these values.'), 'setting[defaultpp]', bugdar::$options['defaultpp']);
-       
-       // maxpp
-       $admin->row_span(T('Maximum Per-Page Value'), 'thead');
-       $admin->row_input(T('To prevent your server from experiencing load problems, set the maximum per page limit. Specifying a value here will make sure any user-entered value will not be higher than this, preventing server load problems.'), 'setting[maxpp]', bugdar::$options['maxpp']);
-       
-       // pagelinks
-       $admin->row_span(T('Number of Page Links'), 'thead');
-       $admin->row_input(T('The number of pages that will appear in the page navigation system on either side of the current page. Set this to 0 to display all pages.'), 'setting[pagelinks]', bugdar::$options['pagelinks']);
-       
-       $admin->table_end();
-       
-       // ###################################################################
-       if (DEVDEBUG)
-       {
-               $admin->table_start();
-               $admin->table_head('Untouchables');
-               
-               // trackerversion
-               $admin->row_span('Version Number', 'thead');
-               $admin->row_input('Version Number', 'setting[trackerversion]', bugdar::$options['trackerversion']);
-               
-               $admin->row_span('Custom Gettext Localizer', 'thead');
-               $admin->row_yesno('Use the custom MOReader implementation rather than the built-in Gettext extension.', 'setting[devgettext]', bugdar::$options['devgettext']);
-       }
 
-       // ###################################################################
-       $admin->table_start();
-       $admin->row_submit();
-       $admin->table_end();
-       $admin->form_end();
-       
-       $admin->page_end();
+       $admin->evaluate()->flush();
 }
 
 // ###################################################################
index 31f2f56416f0228e2bb4c32284b08f71cb44291e..e007bca09cd2ddd912813b3e3731835865f42fe1 100644 (file)
        </h2>
        
        <ul>
-               <li><%- T('System') %></li>
+               <li id="nav_system"><%- T('System') %></li>
                <li>
                        <ul>
-                               <li><a href="settings.php"><%- T('Bugdar Settings') %></a></li>
+                               <li id="nav_system_settings"><a href="settings.php"><%- T('Bugdar Settings') %></a></li>
                                <li><a href="language.php"><%- T('Languages') %></a></li>
                                <li><a href="userhelp.php"><%- T('User Help Items') %></a></li>
                        </ul>
diff --git a/admin/templates/settings.html b/admin/templates/settings.html
new file mode 100644 (file)
index 0000000..f7eca0c
--- /dev/null
@@ -0,0 +1,351 @@
+<%- $templates['doctype'] %>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<%- $stylevar['lang'] %>" xml:lang="<%- $stylevar['lang'] %>" dir="<%- $stylevar['lang_dir'] %>">
+<head>
+       <%- $templates['headinclude'] %>
+       <title><%- $templates['title'] %> - <%- T('Settings') %></title>
+</head>
+
+<body>
+
+<%- $templates['nav'] %>
+
+<div id="title"><%- T('Administration') %></div>
+
+<div id="body">
+
+<form action="settings.php" method="post">
+<input type="hidden" name="do" value="update" />
+
+<fieldset>
+       <legend><%- T('General Options') %></legend>
+       <dl>
+       
+       <!-- authmethod -->
+       <dt>
+               <label for="settings[authmethod]">
+                       <%- T('Authentication Method') %>
+                       <dfn><%- T('The authentication class to use to validate cookie data and longins. You may need to edit the actual file for certain authentication systems.') %></dfn>
+               </label>
+       </dt>
+       <dd><select name="settings[authmethod]" id="settings[authmethod]"><%- $authmethods %></select></dd>
+       <!-- / authmethod -->
+       
+       <!-- allownewreg -->
+       <dt>
+               <label for="settings[allownewreg]">
+                       <%- T('Allow New Registrations') %>
+                       <dfn><%- T('If this is set to <em>yes</em>, then new users will be allowed to register.') %></dfn>
+               </label>
+       </dt>
+       <dd><%- BSDecorator::yesno('settings[allownewreg]', bugdar::$options['allownewreg']) %></dd>
+       <!-- / allownewreg -->
+       
+       <!-- verifyemail -->
+       <dt>
+               <label for="settings[verifyemail]">
+                       <%- T('Require Activation Email') %>
+                       <dfn><%- T('Setting this to yes will force all new users to verify their account with an email activation link.') %></dfn>
+               </label>
+       </dt>
+       <dd><%- BSDecorator::yesno('settings[verifyemail]', bugdar::$options['verifyemail']) %></dd>
+       <!-- / verifyemail -->
+       
+       <!-- moderatenewusers -->
+       <dt>
+               <label for="settings[moderatenewusers]">
+                       <%- T('Moderate New Users') %>
+                       <dfn><%- T('All new users will have to be approved by the administration before being able to have normal user rights.') %></dfn>
+               </label>
+       </dt>
+       <dd><%- BSDecorator::yesno('settings[moderatenewusers]', bugdar::$options['moderatenewusers']) %></dd>
+       <!-- / moderatenewusers -->
+       
+       <!-- sendwelcomemail -->
+       <dt>
+               <label for="settings[sendwelcomemail]">
+                       <%- T('Send New Use Welcome Email') %>
+                       <dfn><%- T('Setting this option to <em>yes</em> will send each new verified user a welcome email.') %></dfn>
+               </label>
+       </dt>
+       <dd><%- BSDecorator::yesno('settings[sendwelcomemail]', bugdar::$options['sendwelcomemail']) %></dd>
+       <!-- / sendwelcomemail -->
+       
+       <!-- webmasteremail -->
+       <dt>
+               <label for="settings[webmasteremail]">
+                       <%- T('Webmaster Email Address') %>
+                       <dfn><%- T('The email address from which emails will be sent out.') %></dfn>
+               </label>
+       </dt>
+       <dd><input type="text" name="settings[webmasteremail]" value="<%- bugdar::$options['webmasteremail'] %>" id="settings[webmasteremail]" /></dd>
+       <!-- / webmasteremail -->
+       
+       <!-- trackertitle -->
+       <dt>
+               <label for="settings[trackertitle]">
+                       <%- T('Tracker Title') %>
+                       <dfn><%- T('The global name of the bug tracker. Example: Blue Static Bug Tracker') %></dfn>
+               </label>
+       </dt>
+       <dd><input type="text" name="settings[trackertitle]" value="<%- bugdar::$options['trackertitle'] %>" id="settings[trackertitle]" /></dd>
+       <!-- / trackertitle -->
+       
+       <!-- trackerurl -->
+       <dt>
+               <label for="settings[trackerurl]">
+                       <%- T('Tracker Base URL') %>
+                       <dfn><%- T('The base URL of the tracker. This is used when creating external links to the tracker. <strong>Be sure that this does not end in a trailing slash (&quot;/&quot;).</strong><br />Example: http://www.bluestatic.org/bugs') %></dfn>
+               </label>
+       </dt>
+       <dd><input type="text" name="settings[trackerurl]" value="<%- bugdar::$options['trackerurl'] %>" id="settings[trackerurl]" /></dd>
+       <!-- / trackerurl -->
+       
+       <!-- dateformat -->
+       <dt>
+               <label for="settings[dateformat]">
+                       <%- T('Date Format') %>
+                       <dfn><%- T('Set the date format used for bug report and comment information. This is based on PHP\'s date() function.') %></dfn>
+               </label>
+       </dt>
+       <dd><input type="text" name="settings[dateformat]" value="<%- bugdar::$options['dateformat'] %>" id="settings[dateformat]" /></dd>
+       <!-- / dateformat -->
+       
+       <!-- defaulttimezone -->
+       <dt>
+               <label for="settings[defaulttimezone]">
+                       <%- T('Default Time Zone') %>
+                       <dfn><%- T('This controls the time zone that all unregistered users view the tracker with.') %></dfn>
+               </label>
+       </dt>
+       <dd><%- construct_option_select('settings[defaulttimezone]', BSDate::fetch_timezone_list(), bugdar::$options['defaulttimezone']) %></dd>
+       <!-- / defaulttimezone -->
+       
+       <!-- defaultlanguage -->
+       <dt>
+               <label for="settings[defaultlanguage]">
+                       <%- T('Default Language') %>
+                       <dfn><%- T('You can set the default language that all new users (and guests) will use.') %></dfn>
+               </label>
+       </dt>
+       <dd><%- construct_option_select('settings[defaultlanguage]', bugdar::$datastore['language'], bugdar::$options['defaultlanguage'], 'languageid', 'title') %></dd>
+       <!-- / defaultlanguage -->
+       
+       <!-- syndicateditems -->
+       <dt>
+               <label for="settings[syndicateditems]">
+                       <%- T('Number of Syndicated Items') %>
+                       <dfn><%- T('The number of bugs to be syndicated at any one time by the Atom XML feed.') %></dfn>
+               </label>
+       </dt>
+       <dd><input type="text" name="settings[syndicateditems]" value="<%- bugdar::$options['syndicateditems'] %>" id="settings[syndicateditems]" /></dd>
+       <!-- / syndicateditems -->
+       
+       <!-- redirectheaders -->
+       <dt>
+               <label for="settings[redirectheaders]">
+                       <%- T('Use Header Redirects') %>
+                       <dfn><%- T('Instead of displaying an intermediate page informing the user that their action was a success and a redirect is occurring, just send the user to the next screen using HTTP headers. This can save bandwidth.') %></dfn>
+               </label>
+       </dt>
+       <dd><%- BSDecorator::yesno('settings[redirectheaders]', bugdar::$options['redirectheaders']) %></dd>
+       <!-- / redirectheaders -->
+       
+       </dl>
+</fieldset>
+
+<fieldset>
+       <legend><%- T('Bug Reporting Options') %></legend>
+       <dl>
+       
+       <!-- allowhtml -->
+       <dt>
+               <label for="settings[allowhtml]">
+                       <%- T('Allow HTML in Bug Reports') %>
+                       <dfn><%- T('Set this to <em>yes</em> if you want to allow users to post raw HTML in their bug reports. This is <strong>very</strong> dangerous and it is not recommended.') %></dfn>
+               </label>
+       </dt>
+       <dd><%- BSDecorator::yesno('settings[allowhtml]', bugdar::$options['allowhtml']) %></dd>
+       <!-- / allowhtml -->
+       
+       <!-- defaultseverity -->
+       <dt>
+               <label for="settings[defaultseverity]">
+                       <%- T('Default Severity') %>
+                       <dfn><%- T('The default severity that is selected when creating a new bug report.') %></dfn>
+               </label>
+       </dt>
+       <dd><%- construct_option_select('setting[defaultseverity]', bugdar::$datastore['severity'],  bugdar::$options['defaultseverity'], 'severityid', 'severity') %></dd>
+       <!-- / defaultseverity -->
+       
+       <!-- defaultpriority -->
+       <dt>
+               <label for="settings[defaultpriority]">
+                       <%- T('Default Priority') %>
+                       <dfn><%- T('The default priority that will be selected when creating a new bug report. Depending on your permission setup, the user may not be able to set this in a new report so this will act as the value.') %></dfn>
+               </label>
+       </dt>
+       <dd><%- construct_option_select('settings[defaultpriority]', bugdar::$datastore['priority'],  bugdar::$options['defaultpriority'], 'priorityid', 'priority') %></dd>
+       <!-- / defaultpriority -->
+       
+       <!-- defaultstatus -->
+       <dt>
+               <label for="settings[defaultstatus]">
+                       <%- T('Default Status') %>
+                       <dfn><%- T('The default default that is selected when creating a new bug report. If a user can not assign a status, this will be the one inserted into the database.') %></dfn>
+               </label>
+       </dt>
+       <dd><%- construct_option_select('settings[defaultstatus]', bugdar::$datastore['status'],  bugdar::$options['defaultstatus'], 'statusid', 'status') %></dd>
+       <!-- / defaultstatus -->
+       
+       <!-- defaultresolve -->
+       <dt>
+               <label for="settings[defaultresolve]">
+                       <%- T('Default Resolution') %>
+                       <dfn><%- T('This is the default bug resolution. If a user is not able to change this field, setting this will act as the default value.') %></dfn>
+               </label>
+       </dt>
+       <dd><%- construct_option_select('settings[defaultresolve]', bugdar::$datastore['resolution'],  bugdar::$options['defaultresolve'], 'resolutionid', 'resolution') %></dd>
+       <!-- / defaultresolve -->
+       
+       <!-- defaultassign -->
+       <dt>
+               <label for="settings[defaultassign]">
+                       <%- T('Default Bug Assignment') %>
+                       <dfn><%- T('This is the default developer new bugs will be assigned to. If a user does not have permisssion to assign bugs, this will be the default. If you don\'t want any default assignment, leave this as <em>Not Selected</em>.') %></dfn>
+               </label>
+       </dt>
+       <dd><%- construct_option_select('settings[defaultassign]', bugdar::$datastore['assignto'],  bugdar::$options['defaultassign'], 'userid', 'displayname', 0) %></dd>
+       <!-- / defaultassign -->
+       
+       <!-- defaultcomment -->
+       <dt>
+               <label for="settings[defaultcomment]">
+                       <%- T('Default Comment Text') %>
+                       <dfn><%- T('If you wish to set a template for entering the initial comment of a bug report, then you may specify this here. However, the template will only take effect on the initial report/comment. Note: the template cannot be forced on the user as there is no way to validate it.') %></dfn>
+               </label>
+       </dt>
+       <dd><textarea name="settings[defaultcomment]" id="settings[defaultcomment]"><%- bugdar::$options['defaultcomment'] %></textarea></dd>
+       <!-- / defaultcomment -->
+       </dl>
+</fieldset>
+
+<fieldset>
+       <legend><%- T('Bug Listing Display Options') %></legend>
+       <dl>
+       
+       <!-- hidestatuses -->
+       <dt>
+               <label for="settings[hidestatuses]">
+                       <%- T('Hide Statuses on Bug Listings') %>
+                       <dfn><%- T('Here you can specify which statuses to hide on the bug list displays. Users have options in their controls to change this from these values, and this does not affect searches or the favorites list.') %></dfn>
+               </label>
+       </dt>
+       <dd><%- construct_option_select('settings[hidestatuses]', bugdar::$datastore['status'], bugdar::$options['hidestatuses'], 'statusid', 'status', 0, true) %></dd>
+       <!-- / hidestatuses -->
+       
+       <!-- defaultsortkey -->
+       <dt>
+               <label for="settings[defaultsortkey]">
+                       <%- T('Default Sort Column') %>
+                       <dfn><%- T('Select the column to sort bugs by on listings. This is only a default setting which users can override in their preferences.') %></dfn>
+               </label>
+       </dt>
+       <dd><%- construct_option_select('settings[defaultsortkey]', ListSorter::fetch_by_text(false, false), bugdar::$options['defaultsortkey']) %></dd>
+       <!-- / defaultsortkey -->
+       
+       <!-- defaultsortas -->
+       <dt>
+               <label for="settings[defaultsortas]">
+                       <%- T('Default Sort Direction') %>
+                       <dfn><%- T('Specify the default direction to sort bugs in the selected column. This works with and follows the same rules as the Sort Column.') %></dfn>
+               </label>
+       </dt>
+       <dd><%- construct_option_select('settings[defaultsortas]', ListSorter::fetch_as_text(false), bugdar::$options['defaultsortas']) %></dd>
+       <!-- / defaultsortas -->
+       
+       <!-- columnoptions -->
+       <dt>
+               <label for="settings[columnoptions]">
+                       <%- T('Default Column Ordering Options') %>
+                       <dfn><%- T('Specify the order of the columns for bug listings. The value 0 disables the display of a column and if two or more columns have the same position number, they will be displayed in the same column.') %></dfn>
+               </label>
+       </dt>
+       <dd><%- ConstructColumnOptionsSetting() %></dd>
+       <!-- / columnoptions -->
+       
+       </dl>
+</fieldset>
+
+<fieldset>
+       <legend><%- T('Pagination Options') %></legend>
+       <dl>
+       
+       <!-- defaultpp -->
+       <dt>
+               <label for="settings[defaultpp]">
+                       <%- T('Default Per-Page Amount') %>
+                       <dfn><%- T('The number of items (e.g. bugs) to be displayed on a page by default. The user will have the option of over-riding these values.') %></dfn>
+               </label>
+       </dt>
+       <dd><input type="text" name="settings[defaultpp]" value="<%- bugdar::$options['defaultpp'] %>" id="settings[defaultpp]" /></dd>
+       <!-- / defaultpp -->
+       
+       <!-- maxpp -->
+       <dt>
+               <label for="settings[maxpp]">
+                       <%- T('Maximum Per-Page Value') %>
+                       <dfn><%- T('To prevent your server from experiencing load problems, set the maximum per page limit. Specifying a value here will make sure any user-entered value will not be higher than this, preventing server load problems.') %></dfn>
+               </label>
+       </dt>
+       <dd><input type="text" name="settings[maxpp]" value="<%- bugdar::$options['maxpp'] %>" id="settings[maxpp]" /></dd>
+       <!-- / maxpp -->
+       
+       <!-- pagelinks -->
+       <dt>
+               <label for="settings[pagelinks]">
+                       <%- T('Number of Page Links') %>
+                       <dfn><%- T('The number of pages that will appear in the page navigation system on either side of the current page. Set this to 0 to display all pages.') %></dfn>
+               </label>
+       </dt>
+       <dd><input type="text" name="settings[pagelinks]" value="<%- bugdar::$options['pagelinks'] %>" id="settings[pagelinks]" /></dd>
+       <!-- / pagelinks -->
+       
+       </dl>
+</fieldset>
+
+<% if (DEVDEBUG): %>
+<fieldset>
+       <legend>Untouchables</legend>
+       <dl>
+       
+       <!-- trackerversion -->
+       <dt>
+               <label for="settings[trackerversion]">Version Number</label>
+       </dt>
+       <dd><input type="text" name="settings[trackerversion]" value="<%- bugdar::$options['trackerversion'] %>" id="settings[trackerversion]" /></dd>
+       <!-- / trackerversion -->
+       
+       <!-- devgettext -->
+       <dt>
+               <label for="settings[devgettext]">Custom Gettext Localizer</label>
+               <dfn>Use the custom MOReader implementation rather than the built-in Gettext extension.</dfn>
+       </dt>
+       <dd><%- BSDecorator::yesno('settings[devgettext]', bugdar::$options['devgettext']) %></dd>
+       <!-- / devgettext -->
+       
+       </dl>
+</fieldset>
+
+<% endif %>
+
+</form>
+
+<%- admin_footer() %>
+
+</div>
+
+<script type="text/javascript"> nav_init("system", "system_settings"); </script>
+
+</body>
+
+</html>
\ No newline at end of file
index 791229830b8465e89945c56e05676c9ce8b9fece..397126134061654cd868ccf54a42e55bd4248abe 100755 (executable)
@@ -54,7 +54,7 @@ function construct_option_select($name, $array, $selected = 0, $valuekey = '', $
                $newlab = ($labelkey ? $label["$labelkey"] : $label);
                $opts[] = '<option value="' . $newval . '"' . (($selected == $newval OR (is_array($selected) AND in_array($newval, $selected))) ? ' selected="selected"' : '') . '>' . $newlab . '</option>';
        }
-       return '<select class="input" name="' . $name . ($multiple ? '[]' : '') . '"' . ($multiple ? ' multiple="multiple" size="' . (sizeof($array) < 8 ? sizeof($array) + 1 : 8) . '"' : '') . '>' . implode("\n\t", $opts) . "\r</select>";
+       return '<select class="input" id="' . $name . '" name="' . $name . ($multiple ? '[]' : '') . '"' . ($multiple ? ' multiple="multiple" size="' . (sizeof($array) < 8 ? sizeof($array) + 1 : 8) . '"' : '') . '>' . implode("\n\t", $opts) . "\r</select>";
 }
 
 /**