From e8286c2735e98c203c1871da410982b00230de32 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 9 Dec 2006 21:55:39 +0000 Subject: [PATCH] r1340: Adding a global option for the column ordering stuff --- includes/settings.php | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/includes/settings.php b/includes/settings.php index e95aa50..b9aa15c 100755 --- a/includes/settings.php +++ b/includes/settings.php @@ -70,7 +70,8 @@ $settings = array( 'hidestatuses' => array('" . construct_option_select("setting[hidestatuses]", $bugsys->datastore["status"], $bugsys->options["hidestatuses"], "statusid", "status", 0, true) . "', '0', false, _('Hide Statuses on Bug Listings'), _('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.')), 'defaultsortkey' => array('" . construct_option_select("setting[defaultsortkey]", ListSorter::fetch_by_text(false), $bugsys->options["defaultsortkey"]) . "', 'lastpost', false, _('Default Sort Column'), _('Select the column to sort bugs by on listings. This is only a default setting which users can override in their preferences.')), - 'defaultsortas' => array('" . construct_option_select("setting[defaultsortas]", ListSorter::fetch_as_text(false), $bugsys->options["defaultsortas"]) . "', 'desc', false, _('Default Sort Direction'), _('Specify the default direction to sort bugs in the selected column. This works with and follows the same rules as the Sort Column.')) + 'defaultsortas' => array('" . construct_option_select("setting[defaultsortas]", ListSorter::fetch_as_text(false), $bugsys->options["defaultsortas"]) . "', 'desc', false, _('Default Sort Direction'), _('Specify the default direction to sort bugs in the selected column. This works with and follows the same rules as the Sort Column.')), + 'columnoptions' => array('" . ConstructColumnOptionsSetting() . "', null, false, _('Default Column Ordering Options'), _('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.')) ), 'pagination' => array( @@ -88,6 +89,29 @@ $settings = array( ) ); +// ################################################################### + +// ################################################################### +/** +* 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; +} + /*=====================================================================*\ || ################################################################### || # $HeadURL$ -- 2.43.5