set_focus('tab', 'options', null); $navigator->set_focus('link', 'options-pages-settings', 'options-pages'); if (!can_perform('canadmintools')) { admin_login(); } // ################################################################### if (empty($_REQUEST['do'])) { $_REQUEST['do'] = 'modify'; } // ################################################################### if ($_POST['do'] == 'update') { $updates = array(); foreach ($bugsys->in['setting'] AS $varname => $value) { if (is_array($value)) { if ($varname == 'columnoptions') { $value = serialize($value); } else { $value = implode(',', $value); } } $updates[] = "('" . $bugsys->escape($varname) . "', '" . $bugsys->escape($value) . "')"; } $db->query("REPLACE INTO " . TABLE_PREFIX . "setting (varname, value) VALUES " . implode(',', $updates)); build_settings(); $admin->redirect('setting.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')); // authmethod $admin->row_span(T('Authentication Method'), 'thead'); $methods = $funct->scandir('./includes/auth/'); foreach ($methods[''] AS $path) { if (preg_match('#auth_(.*)\.php#', $path, $matches)) { $admin->list_item(ucwords(str_replace('_', ' ', $matches[1])), $matches[1], ($matches[1] == $bugsys->options['authmethod'])); } } $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]'); // 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'], $bugsys->options['defaultlanguage'], 'languageid', 'title'), $bugsys->options['defaultlanguage']); $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 yes if you want to allow users to post raw HTML in their bug reports. This is very dangerous and it is not recommended.'), 'setting[allowhtml]', $bugsys->options['allowhtml']); // 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 Not Selected.'), construct_option_select('setting[defaultassign]', Bugdar::$datastore['assignto'], $bugsys->options['defaultassign'], 'userid', 'displayname', 0)); $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'], $bugsys->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), $bugsys->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), $bugsys->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]', $bugsys->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]', $bugsys->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]', $bugsys->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]', $bugsys->options['trackerversion']); } // ################################################################### $admin->table_start(); $admin->row_submit(); $admin->table_end(); $admin->form_end(); $admin->page_end(); } // ################################################################### /** * Helper function for the $bugsys->options['columnoptions'] setting * * @return string Setting HTML code */ function ConstructColumnOptionsSetting() { global $bugsys; $array = ($bugsys->options['columnoptions'] == null ? array('bugid' => 1, 'summary' => 2, 'userid' => 2, 'product' => 3, 'version' => 3, 'component' => 0, 'status' => 4, 'resolution' => 4, 'priority' => 5, 'severity' => 5, 'lastpost' => 6, 'votes' => 0) : $bugsys->options['columnoptions']); $return = ''; foreach ($bugsys->columns AS $column => $mask) { $return .= ''; } $return .= '
' . $bugsys->columnNames["$column"] . '
'; return $return; }