From 1d18e5a34d28f951a16ad5facb0b47b31b14a02a Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 14 Jan 2006 21:46:49 +0000 Subject: [PATCH] r703: language.isdefault is no longer how we see what language to use; we now have a setting --- admin/language.php | 5 ++--- docs/schema_changes.sql | 4 +++- includes/language.php | 2 +- includes/settings.php | 1 + 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/admin/language.php b/admin/language.php index f04aa97..5d9c7bd 100644 --- a/admin/language.php +++ b/admin/language.php @@ -35,8 +35,7 @@ if ($_REQUEST['do'] == 'kill') $admin->error($lang->string('At least one language needs to be present. Deleting this language would violate that.')); } - $language = $db->query_first("SELECT * FROM language WHERE languageid = " . intval($bugsys->in['languageid'])); - if ($language['isdefault']) + if ($bugsys->options['defaultlanguage'] == intval($bugsys->in['languageid'])) { $admin->error($lang->string('You cannot delete the default language. Please select another language to be the default language and then delete this one.')); } @@ -185,7 +184,7 @@ if ($_REQUEST['do'] == 'modify') $admin->row_multi_item(array( $language['title'] => 'l', $language['charset'] => 'c', - (($language['isdefault']) ? '' . $lang->string('DEFAULT LANGUAGE') . ' / ' : '') . ($language['userselect'] ? $lang->string('User Selectable') : $lang->string('Private')) => 'c', + (($bugsys->options['defaultlanguage'] == $language['languageid']) ? '' . $lang->string('DEFAULT LANGUAGE') . ' / ' : '') . ($language['userselect'] ? $lang->string('User Selectable') : $lang->string('Private')) => 'c', "[" . $lang->string('Edit Settings') . "] [" . $lang->string('Reload XML') . "]" => 'c' )); } diff --git a/docs/schema_changes.sql b/docs/schema_changes.sql index 8549382..9803a48 100644 --- a/docs/schema_changes.sql +++ b/docs/schema_changes.sql @@ -14,4 +14,6 @@ CREATE TABLE `fieldhelp` ( ALTER TABLE `fieldhelp` ADD PRIMARY KEY(`keystring`); -ALTER TABLE `language` CHANGE `default` `isdefault` INT(2) UNSIGNED NOT NULL DEFAULT '0'; \ No newline at end of file +ALTER TABLE `language` CHANGE `default` `isdefault` INT(2) UNSIGNED NOT NULL DEFAULT '0'; + +ALTER TABLE `language` DROP `isdefault`; \ No newline at end of file diff --git a/includes/language.php b/includes/language.php index 006c219..8fab2d2 100644 --- a/includes/language.php +++ b/includes/language.php @@ -95,7 +95,7 @@ function fetch_user_language() { foreach ($bugsys->datastore['language'] AS $language) { - if ($language['isdefault']) + if ($bugsys->options['defaultlanguage'] == $language['languageid']) { $languageid = $language['languageid']; $language = $bugsys->datastore['language']["$languageid"]; diff --git a/includes/settings.php b/includes/settings.php index 14dbea0..82264d8 100755 --- a/includes/settings.php +++ b/includes/settings.php @@ -38,6 +38,7 @@ $config['webmasteremail'] = array('general', 'webmasteremail', 'textbox', '', f $config['trackertitle'] = array('general', 'trackertitle', 'textbox', '', false, $lang->string('Tracker Title'), $lang->string('The global name of the bug tracker. Example: Iris Studios Bug Tracker')); $config['trackerurl'] = array('general', 'trackerurl', 'textbox', '', false, $lang->string('Tracker Base URL'), $lang->string('The base URL of the tracker. This is used when creating external links to the tracker. Be sure that this does not end in a trailing slash ("/").
Example: http://www.iris-studios.com/bugs')); $config['dateformat'] = array('general', 'dateformat', 'textbox', 'F j, Y h:i:s A', false, $lang->string('Date Format'), $lang->string('Set the date format used for bug report and comment information. This is based on PHP\'s date() function.')); +$config['defaultlanguage'] = array('general', 'defaultlanguage', '" . construct_option_select(\'setting[defaultlanguage]\', $bugsys->datastore[\'language\'], $bugsys->options[\'defaultlanguage\'], \'languageid\', \'title\') . "', 1, false, $lang->string('Default Language'), $lang->string('You can set the default language that all new users (and guests) will use.')); // ################################################################### -- 2.43.5