Migrate 4 builtin fields to fields2: priority, resolution, severity, status. hoplite
authorRobert Sesek <rsesek@bluestatic.org>
Wed, 27 May 2015 05:32:54 +0000 (01:32 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Wed, 27 May 2015 06:04:46 +0000 (02:04 -0400)
Since the new upgrade system is not in place yet, there's no full migration
path, but docs/migrate_to_fields2.php can be used as the basis for that.

13 files changed:
admin/priority.php [deleted file]
admin/resolution.php [deleted file]
admin/setting.php
admin/severity.php [deleted file]
admin/status.php [deleted file]
docs/migrate_to_fields2.php [new file with mode: 0644]
docs/schema_changes.sql
includes/api_priority.php [deleted file]
includes/api_resolution.php [deleted file]
includes/api_severity.php [deleted file]
includes/api_status.php [deleted file]
includes/class_admin_navigation.php
includes/functions_datastore.php

diff --git a/admin/priority.php b/admin/priority.php
deleted file mode 100644 (file)
index ef7dc6a..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-<?php
-/*=====================================================================*\
-|| ###################################################################
-|| # Bugdar
-|| # Copyright (c)2002-2007 Blue Static
-|| #
-|| # This program is free software; you can redistribute it and/or modify
-|| # it under the terms of the GNU General Public License as published by
-|| # the Free Software Foundation; version 2 of the License.
-|| #
-|| # This program is distributed in the hope that it will be useful, but
-|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-|| # more details.
-|| #
-|| # You should have received a copy of the GNU General Public License along
-|| # with this program; if not, write to the Free Software Foundation, Inc.,
-|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-|| ###################################################################
-\*=====================================================================*/
-
-require_once('./global.php');
-require_once('./includes/api_priority.php');
-
-require_once('./includes/class_api_error.php');
-APIError(array(new API_Error_Handler($admin), 'admin_error'));
-
-NavLinks::fieldsPages();
-$navigator->set_focus('tab', 'fields', null);
-
-if (!can_perform('canadminfields'))
-{
-       admin_login();
-}
-
-// ###################################################################
-
-if (empty($_REQUEST['do']))
-{
-       $_REQUEST['do'] = 'modify';
-}
-
-// ###################################################################
-
-if ($_REQUEST['do'] == 'kill')
-{
-       $priority = new PriorityAPI($bugsys);
-       $priority->set('priorityid',    $bugsys->in['priorityid']);
-       $priority->set_condition();
-       $priority->delete();
-       
-       $admin->redirect('priority.php?do=modify');
-}
-
-// ###################################################################
-
-if ($_REQUEST['do'] == 'delete')
-{
-       $admin->page_confirm(T('Are you sure you want to delete this priority? Doing so will revert all bugs to the default priority (which is set in the options panel)?'), 'priority.php', 'kill', array('priorityid' => $bugsys->input_clean('priorityid', TYPE_UINT)));
-}
-
-// ###################################################################
-
-if ($_POST['do'] == 'insert')
-{
-       $priority = new PriorityAPI($bugsys);
-       $priority->set('priority',              $bugsys->in['priority']);
-       $priority->set('displayorder',  $bugsys->in['displayorder']);
-       $priority->insert();
-       
-       $admin->redirect('priority.php?do=modify');
-}
-
-// ###################################################################
-
-if ($_REQUEST['do'] == 'add')
-{
-       NavLinks::prioritiesAdd();
-       $navigator->set_focus('link', 'priorities-add', 'priorities');
-       
-       $admin->page_start(T('Add New Priority'));
-       
-       $admin->form_start('priority.php', 'insert');
-       $admin->table_start();
-       $admin->table_head(T('New Priority'));
-       $admin->row_input(T('Priority Title<div><dfn>The title of this priority flag (eg: `Slated for Development` or `Address Now`)</dfn></div>'), 'priority');
-       $admin->row_input(T('Display Order<div><dfn>The order in which the priorities are displayed. The higher the number, the lower down in the list it is.</dfn></div>'), 'displayorder');
-       $admin->row_submit();
-       $admin->table_end();
-       $admin->form_end();
-       
-       $admin->page_end();
-}
-
-// ###################################################################
-
-if ($_POST['do'] == 'update')
-{
-       $priority = new PriorityAPI($bugsys);
-       $priority->set('priorityid',    $bugsys->in['priorityid']);
-       $priority->set_condition();
-       $priority->set('priority',              $bugsys->in['priority']);
-       $priority->set('displayorder',  $bugsys->in['displayorder']);
-       $priority->update();
-       
-       $admin->redirect('priority.php?do=modify');
-}
-
-// ###################################################################
-
-if ($_REQUEST['do'] == 'edit')
-{
-       NavLinks::prioritiesEdit($bugsys->in['priorityid']);
-       $navigator->set_focus('link', 'fields-pages-priorities', 'fields-pages');
-       
-       $priority = new PriorityAPI($bugsys);
-       $priority->set('priorityid',    $bugsys->in['priorityid']);
-       $priority->set_condition();
-       $priority->fetch();
-       
-       $admin->page_start(T('Edit Priority'));
-       
-       $admin->form_start('priority.php', 'update');
-       $admin->form_hidden_field('priorityid', $priority->objdata['priorityid']);
-       $admin->table_start();
-       $admin->table_head(sprintf(T('Edit Priority `%1$s` (id: %2$s)'), $priority->objdata['priority'], $priority->objdata['priorityid']));
-       $admin->row_input(T('Priority Title<div><dfn>The title of this priority flag (eg: `Slated for Development` or `Address Now`)</dfn></div>'), 'priority', $priority->objdata['priority']);
-       $admin->row_input(T('Display Order<div><dfn>The order in which the priorities are displayed. The higher the number, the lower down in the list it is.</dfn></div>'), 'displayorder', $priority->objdata['displayorder']);
-       $admin->row_submit();
-       $admin->table_end();
-       $admin->form_end();
-       
-       $admin->page_end();
-}
-
-// ###################################################################
-
-if ($_REQUEST['do'] == 'modify')
-{
-       NavLinks::prioritiesAdd();
-       $navigator->set_focus('link', 'fields-pages-priorities', 'fields-pages');
-       
-       $admin->page_start(T('Priority Manager'));
-       
-       $priorities = $db->query("SELECT * FROM " . TABLE_PREFIX . "priority ORDER BY displayorder");
-       
-       $admin->form_start('priority.php', 'null');
-       $admin->table_start();
-       $admin->table_head(T('Priority Manager'));
-       
-       while ($priority = $db->fetch_array($priorities))
-       {
-               $admin->row_text("$priority[displayorder]: <a href=\"priority.php?do=edit&amp;priorityid=$priority[priorityid]\">$priority[priority]</a>", "(priorityid: $priority[priorityid]) <a href=\"priority.php?do=edit&amp;priorityid=$priority[priorityid]\">[" . T('Edit') . "]</a> <a href=\"priority.php?do=delete&amp;priorityid=$priority[priorityid]\">[" . T('Delete') . "]</a>");
-       }
-       $db->free_result($priorities);
-       
-       $admin->table_end();
-       $admin->form_end();
-       
-       $admin->page_end();
-}
-
diff --git a/admin/resolution.php b/admin/resolution.php
deleted file mode 100644 (file)
index 649a024..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-<?php
-/*=====================================================================*\
-|| ###################################################################
-|| # Bugdar
-|| # Copyright (c)2002-2007 Blue Static
-|| #
-|| # This program is free software; you can redistribute it and/or modify
-|| # it under the terms of the GNU General Public License as published by
-|| # the Free Software Foundation; version 2 of the License.
-|| #
-|| # This program is distributed in the hope that it will be useful, but
-|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-|| # more details.
-|| #
-|| # You should have received a copy of the GNU General Public License along
-|| # with this program; if not, write to the Free Software Foundation, Inc.,
-|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-|| ###################################################################
-\*=====================================================================*/
-
-require_once('./global.php');
-require_once('./includes/api_resolution.php');
-
-require_once('./includes/class_api_error.php');
-APIError(array(new API_Error_Handler($admin), 'admin_error'));
-
-NavLinks::fieldsPages();
-$navigator->set_focus('tab', 'fields', null);
-
-if (!can_perform('canadminfields'))
-{
-       admin_login();
-}
-
-// ###################################################################
-
-if (empty($_REQUEST['do']))
-{
-       $_REQUEST['do'] = 'modify';
-}
-
-// ###################################################################
-
-if ($_REQUEST['do'] == 'kill')
-{
-       $resolution = new ResolutionAPI($bugsys);
-       $resolution->set('resolutionid',        $bugsys->in['resolutionid']);
-       $resolution->set_condition();
-       $resolution->delete();
-       
-       $admin->redirect('resolution.php?do=modify');
-}
-
-// ###################################################################
-
-if ($_REQUEST['do'] == 'delete')
-{
-       $admin->page_confirm(T('Are you sure you want to delete this resolution? Doing so will revert all bugs to the default resolution (which is set in the options panel)?'), 'resolution.php', 'kill', array('resolutionid' => $bugsys->input_clean('resolutionid', TYPE_UINT)));
-}
-
-// ###################################################################
-
-if ($_POST['do'] == 'insert')
-{
-       $resolution = new ResolutionAPI($bugsys);
-       $resolution->set('resolution',          $bugsys->in['resolution']);
-       $resolution->set('displayorder',        $bugsys->in['displayorder']);
-       $resolution->insert();
-       
-       $admin->redirect('resolution.php?do=modify');
-}
-
-// ###################################################################
-
-if ($_REQUEST['do'] == 'add')
-{
-       NavLinks::resolutionsAdd();
-       $navigator->set_focus('link', 'resolutions-add', 'resolutions');
-       
-       $admin->page_start(T('Add New Resolution'));
-       
-       $admin->form_start('resolution.php', 'insert');
-       $admin->table_start();
-       $admin->table_head(T('New Resolution'));
-       $admin->row_input(T('Resolution Title<div><dfn>The title of this resolution flag (eg: `Fixed` or `Bogus`)</dfn></div>'), 'resolution');
-       $admin->row_input(T('Display Order<div><dfn>The order in which the resolutions are displayed. The higher the number, the lower down in the list it is.</dfn></div>'), 'displayorder');
-       $admin->row_submit();
-       $admin->table_end();
-       $admin->form_end();
-       
-       $admin->page_end();
-}
-
-// ###################################################################
-
-if ($_POST['do'] == 'update')
-{
-       $resolution = new ResolutionAPI($bugsys);
-       $resolution->set('resolutionid',        $bugsys->in['resolutionid']);
-       $resolution->set_condition();
-       $resolution->set('resolution',          $bugsys->in['resolution']);
-       $resolution->set('displayorder',        $bugsys->in['displayorder']);
-       $resolution->update();
-       
-       $admin->redirect('resolution.php?do=modify');
-}
-
-// ###################################################################
-
-if ($_REQUEST['do'] == 'edit')
-{
-       NavLinks::resolutionsEdit($bugsys->in['resolutionid']);
-       $navigator->set_focus('link', 'fields-pages-resolutions', 'fields-pages');
-       
-       $resolution = new ResolutionAPI($bugsys);
-       $resolution->set('resolutionid',        $bugsys->in['resolutionid']);
-       $resolution->set_condition();
-       $resolution->fetch();
-       
-       $admin->page_start(T('Edit Resolution'));
-       
-       $admin->form_start('resolution.php', 'update');
-       $admin->form_hidden_field('resolutionid', $resolution->objdata['resolutionid']);
-       $admin->table_start();
-       $admin->table_head(sprintf(T('Edit Resolution - %1$s (id: %2$s)'), $resolution->objdata['resolution'], $resolution->objdata['resolutionid']));
-       $admin->row_input(T('Resolution Title<div><dfn>The title of this resolution flag (eg: `Fixed` or `Bogus`)</dfn></div>'), 'resolution', $resolution->objdata['resolution']);
-       $admin->row_input(T('Display Order<div><dfn>The order in which the resolutions are displayed. The higher the number, the lower down in the list it is.</dfn></div>'), 'displayorder', $resolution->objdata['displayorder']);
-       $admin->row_submit();
-       $admin->table_end();
-       $admin->form_end();
-       
-       $admin->page_end();
-}
-
-// ###################################################################
-
-if ($_REQUEST['do'] == 'modify')
-{
-       NavLinks::resolutionsAdd();
-       $navigator->set_focus('link', 'fields-pages-resolutions', 'fields-pages');
-       
-       $admin->page_start(T('Resolution Manager'));
-       
-       $resolutions = $db->query("SELECT * FROM " . TABLE_PREFIX . "resolution ORDER BY displayorder");
-       
-       $admin->form_start('resolution.php', 'null');
-       $admin->table_start();
-       $admin->table_head(T('Resolution Manager'));
-       
-       while ($resolution = $db->fetch_array($resolutions))
-       {
-               $admin->row_text("$resolution[displayorder]: <a href=\"resolution.php?do=edit&amp;resolutionid=$resolution[resolutionid]\">$resolution[resolution]</a>", "(resolutionid: $resolution[resolutionid]) <a href=\"resolution.php?do=edit&amp;resolutionid=$resolution[resolutionid]\">[" . T('Edit') . "]</a> <a href=\"resolution.php?do=delete&amp;resolutionid=$resolution[resolutionid]\">[" . T('Delete') . "]</a>");
-       }
-       $db->free_result($resolutions);
-       
-       $admin->table_end();
-       $admin->form_end();
-       
-       $admin->page_end();
-}
-
index 1ffb7891a9810994a5f2360dc3ecbce557d8968c..86d286c0fbd11e3c9ed9670ff22770de911b030f 100644 (file)
@@ -107,23 +107,7 @@ if ($_REQUEST['do'] == 'modify')
        // 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]', $bugsys->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'],  $bugsys->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'],  $bugsys->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'],  $bugsys->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'],  $bugsys->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'],  $bugsys->options['defaultassign'], 'userid', 'displayname', 0));
diff --git a/admin/severity.php b/admin/severity.php
deleted file mode 100644 (file)
index 0a39dc0..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-<?php
-/*=====================================================================*\
-|| ###################################################################
-|| # Bugdar
-|| # Copyright (c)2002-2007 Blue Static
-|| #
-|| # This program is free software; you can redistribute it and/or modify
-|| # it under the terms of the GNU General Public License as published by
-|| # the Free Software Foundation; version 2 of the License.
-|| #
-|| # This program is distributed in the hope that it will be useful, but
-|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-|| # more details.
-|| #
-|| # You should have received a copy of the GNU General Public License along
-|| # with this program; if not, write to the Free Software Foundation, Inc.,
-|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-|| ###################################################################
-\*=====================================================================*/
-
-require_once('./global.php');
-require_once('./includes/api_severity.php');
-
-require_once('./includes/class_api_error.php');
-APIError(array(new API_Error_Handler($admin), 'admin_error'));
-
-NavLinks::fieldsPages();
-$navigator->set_focus('tab', 'fields', null);
-
-if (!can_perform('canadminfields'))
-{
-       admin_login();
-}
-
-// ###################################################################
-
-if (empty($_REQUEST['do']))
-{
-       $_REQUEST['do'] = 'modify';
-}
-
-// ###################################################################
-
-if ($_REQUEST['do'] == 'kill')
-{
-       $severity = new SeverityAPI($bugsys);
-       $severity->set('severityid',    $bugsys->in['severityid']);
-       $severity->set_condition();
-       $severity->delete();
-       
-       $admin->redirect('severity.php?do=modify');
-}
-
-// ###################################################################
-
-if ($_REQUEST['do'] == 'delete')
-{
-       $admin->page_confirm(T('Are you sure you want to delete this severity? Doing so will revert all bugs to the default severity (which is set in the options panel)?'), 'severity.php', 'kill', array('severityid' => $bugsys->input_clean('severityid', TYPE_UINT)));
-}
-
-// ###################################################################
-
-if ($_POST['do'] == 'insert')
-{
-       $severity = new SeverityAPI($bugsys);
-       $severity->set('severity',              $bugsys->in['severity']);
-       $severity->set('displayorder',  $bugsys->in['displayorder']);
-       $severity->insert();
-       
-       $admin->redirect('severity.php?do=modify');
-}
-
-// ###################################################################
-
-if ($_REQUEST['do'] == 'add')
-{
-       NavLinks::severitiesAdd();
-       $navigator->set_focus('link', 'severities-add', 'severities');
-       
-       $admin->page_start(T('Add New Severity'));
-       
-       $admin->form_start('severity.php', 'insert');
-       $admin->table_start();
-       $admin->table_head(T('New Severity'));
-       $admin->row_input(T('Severity Title<div><dfn>The title of this severity flag (eg: `Major` or `Critical`)</dfn></div>'), 'severity');
-       $admin->row_input(T('Display Order<div><dfn>The order in which the severities are displayed. The higher the number, the lower down in the list it is.</dfn></div>'), 'displayorder');
-       $admin->row_submit();
-       $admin->table_end();
-       $admin->form_end();
-       
-       $admin->page_end();
-}
-
-// ###################################################################
-
-if ($_POST['do'] == 'update')
-{
-       $severity = new SeverityAPI($bugsys);
-       $severity->set('severityid',    $bugsys->in['severityid']);
-       $severity->set_condition();
-       $severity->set('severity',              $bugsys->in['severity']);
-       $severity->set('displayorder',  $bugsys->in['displayorder']);
-       $severity->update();
-       
-       $admin->redirect('severity.php?do=modify');
-}
-
-// ###################################################################
-
-if ($_REQUEST['do'] == 'edit')
-{
-       NavLinks::severitiesEdit($bugsys->in['severityid']);
-       $navigator->set_focus('link', 'fields-pages-severities', 'fields-pages');
-       
-       $severity = new SeverityAPI($bugsys);
-       $severity->set('severityid',    $bugsys->in['severityid']);
-       $severity->set_condition();
-       $severity->fetch();
-       
-       $admin->page_start(T('Edit Severity'));
-       
-       $admin->form_start('severity.php', 'update');
-       $admin->form_hidden_field('severityid', $severity->objdata['severityid']);
-       $admin->table_start();
-       $admin->table_head(sprintf(T('Edit Severity - %1$s (id: %2$s)'), $severity->objdata['severity'], $severity->objdata['severityid']));
-       $admin->row_input(T('Severity Title<div><dfn>The title of this severity flag (eg: `Major` or `Critical`)</dfn></div>'), 'severity', $severity->objdata['severity']);
-       $admin->row_input(T('Display Order<div><dfn>The order in which the severities are displayed. The higher the number, the lower down in the list it is.</dfn></div>'), 'displayorder', $severity->objdata['displayorder']);
-       $admin->row_submit();
-       $admin->table_end();
-       $admin->form_end();
-       
-       $admin->page_end();
-}
-
-// ###################################################################
-
-if ($_REQUEST['do'] == 'modify')
-{
-       NavLinks::severitiesAdd();
-       $navigator->set_focus('link', 'fields-pages-severities', 'fields-pages');
-       
-       $admin->page_start(T('Severity Manager'));
-       
-       $severities = $db->query("SELECT * FROM " . TABLE_PREFIX . "severity ORDER BY displayorder");
-       
-       $admin->form_start('severity.php', 'null');
-       $admin->table_start();
-       $admin->table_head(T('Severity Manager'));
-       
-       while ($severity = $db->fetch_array($severities))
-       {
-               $admin->row_text("$severity[displayorder]: <a href=\"severity.php?do=edit&amp;severityid=$severity[severityid]\">$severity[severity]</a>", "(severityid: $severity[severityid]) <a href=\"severity.php?do=edit&amp;severityid=$severity[severityid]\">[" . T('Edit') . "]</a> <a href=\"severity.php?do=delete&amp;severityid=$severity[severityid]\">[" . T('Delete') . "]</a>");
-       }
-       $db->free_result($severities);
-       
-       $admin->table_end();
-       $admin->form_end();
-       
-       $admin->page_end();
-}
-
diff --git a/admin/status.php b/admin/status.php
deleted file mode 100644 (file)
index 5765d49..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-<?php
-/*=====================================================================*\
-|| ###################################################################
-|| # Bugdar
-|| # Copyright (c)2002-2007 Blue Static
-|| #
-|| # This program is free software; you can redistribute it and/or modify
-|| # it under the terms of the GNU General Public License as published by
-|| # the Free Software Foundation; version 2 of the License.
-|| #
-|| # This program is distributed in the hope that it will be useful, but
-|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-|| # more details.
-|| #
-|| # You should have received a copy of the GNU General Public License along
-|| # with this program; if not, write to the Free Software Foundation, Inc.,
-|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-|| ###################################################################
-\*=====================================================================*/
-
-require_once('./global.php');
-require_once('./includes/api_status.php');
-
-require_once('./includes/class_api_error.php');
-APIError(array(new API_Error_Handler($admin), 'admin_error'));
-
-NavLinks::fieldsPages();
-$navigator->set_focus('tab', 'fields', null);
-
-if (!can_perform('canadminfields'))
-{
-       admin_login();
-}
-
-// ###################################################################
-
-if (empty($_REQUEST['do']))
-{
-       $_REQUEST['do'] = 'modify';
-}
-
-// ###################################################################
-
-if ($_REQUEST['do'] == 'kill')
-{
-       $status = new StatusAPI($bugsys);
-       $status->set('statusid',        $bugsys->in['statusid']);
-       $status->set_condition();
-       $status->delete();
-       
-       $admin->redirect('status.php?do=modify');
-}
-
-// ###################################################################
-
-if ($_REQUEST['do'] == 'delete')
-{
-       $admin->page_confirm(T('Are you sure you want to delete this status? Doing so will revert all bugs to the default status (which is set in the options panel)?'), 'status.php', 'kill', array('statusid' => $bugsys->input_clean('statusid', TYPE_UINT)));
-}
-
-// ###################################################################
-
-if ($_POST['do'] == 'insert')
-{
-       $status = new StatusAPI($bugsys);
-       $status->set('status',                  $bugsys->in['status']);
-       $status->set('color',                   $bugsys->in['color']);
-       $status->set('displayorder',    $bugsys->in['displayorder']);
-       $status->insert();
-       
-       $admin->redirect('status.php?do=modify');
-}
-
-// ###################################################################
-
-if ($_REQUEST['do'] == 'add')
-{
-       NavLinks::statusesAdd();
-       $navigator->set_focus('link', 'statuses-add', 'statuses');
-       
-       $admin->page_start(T('Add New Status'));
-       
-       $admin->form_start('status.php', 'insert');
-       $admin->table_start();
-       $admin->table_head(T('New Status'));
-       $admin->row_input(T('Status Title<div><dfn>The title of this status flag (eg: `Confirmed` or `Closed (Fixed)`)</dfn></div>'), 'status');
-       $admin->row_input(T('Display Order<div><dfn>The order in which the statuses ar displayed.</dfn></div>'), 'displayorder');
-       $admin->row_input(T('Status Color<div><dfn>The color of the status. This will be displayed on bug listings page to make viewing easier. Note: you must enter the # sign if you are using HEX values.</dfn></div>'), 'color');
-       $admin->row_submit();
-       $admin->table_end();
-       $admin->form_end();
-       
-       $admin->page_end();
-}
-
-// ###################################################################
-
-if ($_POST['do'] == 'update')
-{
-       $status = new StatusAPI($bugsys);
-       $status->set('statusid',                $bugsys->in['statusid']);
-       $status->set_condition();
-       $status->set('status',                  $bugsys->in['status']);
-       $status->set('color',                   $bugsys->in['color']);
-       $status->set('displayorder',    $bugsys->in['displayorder']);
-       $status->update();
-       
-       $admin->redirect('status.php?do=modify');
-}
-
-// ###################################################################
-
-if ($_REQUEST['do'] == 'edit')
-{
-       NavLinks::statusesEdit($bugsys->in['statusid']);
-       $navigator->set_focus('link', 'fields-pages-statuses', 'fields-pages');
-       
-       $status = new StatusAPI($bugsys);
-       $status->set('statusid',        $bugsys->in['statusid']);
-       $status->set_condition();
-       $status->fetch();
-       
-       $admin->page_start(T('Edit Status'));
-       
-       $admin->form_start('status.php', 'update');
-       $admin->form_hidden_field('statusid', $status->objdata['statusid']);
-       $admin->table_start();
-       $admin->table_head(sprintf(T('Edit Status - %1$s (id: %2$s)'), $status->objdata['status'], $status->objdata['statusid']));
-       $admin->row_input(T('Status Title<div><dfn>The title of this status flag (eg: `Confirmed` or `Closed (Fixed)`)</dfn></div>'), 'status', $status->objdata['status']);
-       $admin->row_input(T('Display Order<div><dfn>The order in which the statuses ar displayed.</dfn></div>'), 'displayorder', $status->objdata['displayorder']);
-       $admin->row_input(T('Status Color<div><dfn>The color of the status. This will be displayed on bug listings page to make viewing easier. Note: you must enter the # sign if you are using HEX values.</dfn></div>'), 'color', $status->objdata['color']);
-       $admin->row_submit();
-       $admin->table_end();
-       $admin->form_end();
-       
-       $admin->page_end();
-}
-
-// ###################################################################
-
-if ($_REQUEST['do'] == 'modify')
-{
-       NavLinks::statusesAdd();
-       $navigator->set_focus('link', 'fields-pages-statuses', 'fields-pages');
-       
-       $admin->page_start(T('Status Manager'));
-       
-       $statuses = $db->query("SELECT * FROM " . TABLE_PREFIX . "status");
-       
-       $admin->table_start();
-       $admin->table_head(T('Status Manager'));
-       
-       while ($status = $db->fetch_array($statuses))
-       {
-               $colorblock = '<span style="float: right"><div style="height: 12px; width: 12px; background-color: ' . $status['color'] . '; border: 1px black solid"></div></span>';
-               $admin->row_text("$colorblock$status[displayorder]: <a href=\"status.php?do=edit&amp;statusid=$status[statusid]\">$status[status]</a>", "(statusid: $status[statusid]) <a href=\"status.php?do=edit&amp;statusid=$status[statusid]\">[" . T('Edit') . "]</a> <a href=\"status.php?do=delete&amp;statusid=$status[statusid]\">[" . T('Delete') . "]</a>");
-       }
-       $db->free_result($statuses);
-       
-       $admin->table_end();
-       
-       $admin->page_end();
-}
-
diff --git a/docs/migrate_to_fields2.php b/docs/migrate_to_fields2.php
new file mode 100644 (file)
index 0000000..c141097
--- /dev/null
@@ -0,0 +1,94 @@
+<?php
+/*=====================================================================*\
+|| ###################################################################
+|| # Bugdar
+|| # Copyright (c)2002-2015 Blue Static
+|| #
+|| # This program is free software; you can redistribute it and/or modify
+|| # it under the terms of the GNU General Public License as published by
+|| # the Free Software Foundation; version 2 of the License.
+|| #
+|| # This program is distributed in the hope that it will be useful, but
+|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+|| # more details.
+|| #
+|| # You should have received a copy of the GNU General Public License along
+|| # with this program; if not, write to the Free Software Foundation, Inc.,
+|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+|| ###################################################################
+\*=====================================================================*/
+
+chdir('../');
+require_once './includes/init.php';
+require_once BUGDAR_ROOT . '/includes/model_field.php';
+
+$do = filter_input(INPUT_GET, 'do');
+
+$simple_field_types = [
+       'priority',
+       'resolution',
+       'severity',
+       'status',
+];
+
+if ($do === NULL) {
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+if (in_array($do, $simple_field_types)) {
+       // Get the userhelp for title and description.
+       $stmt = Bugdar::$db->Prepare("SELECT * FROM " . TABLE_PREFIX . "fieldhelp WHERE keystring = ?");
+       $stmt->Execute([$do]);
+       $fieldhelp = $stmt->FetchObject();
+
+       // Find the default value.
+       $stmt = Bugdar::$db->Prepare("SELECT value FROM " . TABLE_PREFIX . "setting WHERE varname = ?");
+       if ($do == 'resolution')
+               $stmt->Execute(['defaultresolve']);  // Unclear why this ever was.
+       else
+               $stmt->Execute(['default' . $do]);
+       $default_setting = $stmt->FetchObject();
+
+       // Get all the values.
+       $stmt = Bugdar::$db->Query("SELECT * FROM " . TABLE_PREFIX . $do . " ORDER BY displayorder");
+       $values = [];
+       $default_value = NULL;
+       while ($value = $stmt->Fetch()) {
+               $values[] = $value[$do];
+               if ($value[$do . 'id'] == $default_setting->value)
+                       $default_value = $value[$do];
+       }
+
+       // Create the new field.
+       $field = new bugdar\Field();
+       $field->title = $fieldhelp->title;
+       $field->description = $fieldhelp->body;
+       $field->type = bugdar\Field::TYPE_LIST;
+       $field->validator_pattern = implode("\n", $values);
+       $field->required = TRUE;
+       $field->default_value = $default_value;
+       $field->can_search = TRUE;
+       var_dump($field);
+       $field->Insert();
+
+       // Migrate the data from field IDs in the bug table to the values in the new
+       // all-values table.
+       $stmt = Bugdar::$db->Prepare("
+               INSERT INTO ". TABLE_PREFIX . "bugfield2
+                       (bugid, title, value)
+               SELECT bug.bugid, '" . $field->title . "', field." . $do . "
+               FROM " . TABLE_PREFIX . "bug AS bug
+               LEFT JOIN " . TABLE_PREFIX . $do . " AS field
+               ON (bug." . $do . " = field." . $do . "id)
+       ");
+       $stmt->Execute();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+if ($do === 'product') {
+}
+
+print Bugdar::$db->ConstructHTMLDebugBlock();
index f4d844bacfac8a9088d3658bc9007b205688983a..a4e0537f7cb8cf32c912ef2a3d9fab387398b593 100644 (file)
@@ -13,3 +13,11 @@ CREATE TABLE field
        color_background varchar(6) NOT NULL,
        PRIMARY KEY (title)
 );
+
+CREATE TABLE bugfield2
+(
+       bugid int unsigned NOT NULL,
+       title varchar(255) NOT NULL,
+       value varchar(255) NOT NULL,
+       PRIMARY KEY (bugid, title)
+);
diff --git a/includes/api_priority.php b/includes/api_priority.php
deleted file mode 100644 (file)
index 216f4f8..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-<?php
-/*=====================================================================*\
-|| ###################################################################
-|| # Bugdar
-|| # Copyright (c)2002-2007 Blue Static
-|| #
-|| # This program is free software; you can redistribute it and/or modify
-|| # it under the terms of the GNU General Public License as published by
-|| # the Free Software Foundation; version 2 of the License.
-|| #
-|| # This program is distributed in the hope that it will be useful, but
-|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-|| # more details.
-|| #
-|| # You should have received a copy of the GNU General Public License along
-|| # with this program; if not, write to the Free Software Foundation, Inc.,
-|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-|| ###################################################################
-\*=====================================================================*/
-
-$GLOBALS['isso:callback']->load('api', null);
-
-require_once('./includes/functions_datastore.php');
-
-/**
-* API: Priority
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2002 - 2007, Blue Static
-* @version             $Revision$
-* @package             Bugdar
-* 
-*/
-class PriorityAPI extends API
-{
-       /**
-       * Fields
-       * @var  array
-       * @access       private
-       */
-       var $fields = array(
-               'priorityid'    => array(TYPE_UINT,             REQ_AUTO,       'verify_nozero'),
-               'priority'              => array(TYPE_STR,              REQ_YES,        'verify_noempty'),
-               'displayorder'  => array(TYPE_INT,              REQ_NO)
-       );
-       
-       /**
-       * Database table
-       * @var  string
-       * @access       private
-       */
-       var $table = 'priority';
-       
-       /**
-       * Table prefix
-       * @var  string
-       * @access       private
-       */
-       var $prefix = TABLE_PREFIX;
-       
-       // ###################################################################
-       /**
-       * Post-insert
-       *
-       * @access       protected
-       */
-       function post_insert()
-       {
-               build_priorities();
-       }
-       
-       // ###################################################################
-       /**
-       * Post-update
-       *
-       * @access       protected
-       */
-       function post_update()
-       {
-               build_priorities();
-       }
-       
-       // ###################################################################
-       /**
-       * Post-delete
-       *
-       * @access       protected
-       */
-       function post_delete()
-       {
-               build_priorities();
-               $this->registry->db->query("UPDATE " . TABLE_PREFIX . "bug SET priority = " . $this->registry->options['defaultpriority'] . " WHERE priority = " . $this->values['priorityid']);
-       }
-}
-
diff --git a/includes/api_resolution.php b/includes/api_resolution.php
deleted file mode 100644 (file)
index ada17fe..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-<?php
-/*=====================================================================*\
-|| ###################################################################
-|| # Bugdar
-|| # Copyright (c)2002-2007 Blue Static
-|| #
-|| # This program is free software; you can redistribute it and/or modify
-|| # it under the terms of the GNU General Public License as published by
-|| # the Free Software Foundation; version 2 of the License.
-|| #
-|| # This program is distributed in the hope that it will be useful, but
-|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-|| # more details.
-|| #
-|| # You should have received a copy of the GNU General Public License along
-|| # with this program; if not, write to the Free Software Foundation, Inc.,
-|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-|| ###################################################################
-\*=====================================================================*/
-
-$GLOBALS['isso:callback']->load('api', null);
-
-require_once('./includes/functions_datastore.php');
-
-/**
-* API: Resolution
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2002 - 2007, Blue Static
-* @version             $Revision$
-* @package             Bugdar
-* 
-*/
-class ResolutionAPI extends API
-{
-       /**
-       * Fields
-       * @var  array
-       * @access       private
-       */
-       var $fields = array(
-               'resolutionid'  => array(TYPE_UINT,             REQ_AUTO,       'verify_nozero'),
-               'resolution'    => array(TYPE_STR,              REQ_YES,        'verify_noempty'),
-               'displayorder'  => array(TYPE_INT,              REQ_NO)
-       );
-       
-       /**
-       * Database table
-       * @var  string
-       * @access       private
-       */
-       var $table = 'resolution';
-       
-       /**
-       * Table prefix
-       * @var  string
-       * @access       private
-       */
-       var $prefix = TABLE_PREFIX;
-       
-       // ###################################################################
-       /**
-       * Post-insert
-       *
-       * @access       protected
-       */
-       function post_insert()
-       {
-               build_resolutions();
-       }
-       
-       // ###################################################################
-       /**
-       * Post-update
-       *
-       * @access       protected
-       */
-       function post_update()
-       {
-               build_resolutions();
-       }
-       
-       // ###################################################################
-       /**
-       * Post-delete
-       *
-       * @access       protected
-       */
-       function post_delete()
-       {
-               build_resolutions();
-               $this->registry->db->query("UPDATE " . TABLE_PREFIX . "bug SET resolution = " . $this->registry->clean($this->registry->options['defaultresolve'], TYPE_UINT) . " WHERE resolution = " . $this->values['resolutionid']);
-       }
-}
-
diff --git a/includes/api_severity.php b/includes/api_severity.php
deleted file mode 100644 (file)
index 01a4a54..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-<?php
-/*=====================================================================*\
-|| ###################################################################
-|| # Bugdar
-|| # Copyright (c)2002-2007 Blue Static
-|| #
-|| # This program is free software; you can redistribute it and/or modify
-|| # it under the terms of the GNU General Public License as published by
-|| # the Free Software Foundation; version 2 of the License.
-|| #
-|| # This program is distributed in the hope that it will be useful, but
-|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-|| # more details.
-|| #
-|| # You should have received a copy of the GNU General Public License along
-|| # with this program; if not, write to the Free Software Foundation, Inc.,
-|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-|| ###################################################################
-\*=====================================================================*/
-
-$GLOBALS['isso:callback']->load('api', null);
-
-require_once('./includes/functions_datastore.php');
-
-/**
-* API: Severity
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2002 - 2007, Blue Static
-* @version             $Revision$
-* @package             Bugdar
-* 
-*/
-class SeverityAPI extends API
-{
-       /**
-       * Fields
-       * @var  array
-       * @access       private
-       */
-       var $fields = array(
-               'severityid'    => array(TYPE_UINT,             REQ_AUTO,       'verify_nozero'),
-               'severity'              => array(TYPE_STR,              REQ_YES,        'verify_noempty'),
-               'displayorder'  => array(TYPE_INT,              REQ_NO)
-       );
-       
-       /**
-       * Database table
-       * @var  string
-       * @access       private
-       */
-       var $table = 'severity';
-       
-       /**
-       * Table prefix
-       * @var  string
-       * @access       private
-       */
-       var $prefix = TABLE_PREFIX;
-       
-       // ###################################################################
-       /**
-       * Post-insert
-       *
-       * @access       protected
-       */
-       function post_insert()
-       {
-               build_severities();
-       }
-       
-       // ###################################################################
-       /**
-       * Post-update
-       *
-       * @access       protected
-       */
-       function post_update()
-       {
-               build_severities();
-       }
-       
-       // ###################################################################
-       /**
-       * Post-delete
-       *
-       * @access       protected
-       */
-       function post_delete()
-       {
-               build_severities();
-               $this->registry->db->query("UPDATE " . TABLE_PREFIX . "bug SET severity = " . $this->registry->options['defaultseverity'] . " WHERE severity = " . $this->values['severityid']);
-       }
-}
-
diff --git a/includes/api_status.php b/includes/api_status.php
deleted file mode 100644 (file)
index 898f6dc..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-<?php
-/*=====================================================================*\
-|| ###################################################################
-|| # Bugdar
-|| # Copyright (c)2002-2007 Blue Static
-|| #
-|| # This program is free software; you can redistribute it and/or modify
-|| # it under the terms of the GNU General Public License as published by
-|| # the Free Software Foundation; version 2 of the License.
-|| #
-|| # This program is distributed in the hope that it will be useful, but
-|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-|| # more details.
-|| #
-|| # You should have received a copy of the GNU General Public License along
-|| # with this program; if not, write to the Free Software Foundation, Inc.,
-|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-|| ###################################################################
-\*=====================================================================*/
-
-$GLOBALS['isso:callback']->load('api', null);
-
-require_once('./includes/functions_datastore.php');
-
-/**
-* API: Status
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2002 - 2007, Blue Static
-* @version             $Revision$
-* @package             Bugdar
-* 
-*/
-class StatusAPI extends API
-{
-       /**
-       * Fields
-       * @var  array
-       * @access       private
-       */
-       var $fields = array(
-               'statusid'              => array(TYPE_UINT,             REQ_AUTO,       'verify_nozero'),
-               'status'                => array(TYPE_STR,              REQ_YES,        'verify_noempty'),
-               'color'                 => array(TYPE_STR,              REQ_NO),
-               'displayorder'  => array(TYPE_INT,              REQ_NO)
-       );
-       
-       /**
-       * Database table
-       * @var  string
-       * @access       private
-       */
-       var $table = 'status';
-       
-       /**
-       * Table prefix
-       * @var  string
-       * @access       private
-       */
-       var $prefix = TABLE_PREFIX;
-       
-       // ###################################################################
-       /**
-       * Post-insert
-       *
-       * @access       protected
-       */
-       function post_insert()
-       {
-               build_statuses();
-       }
-       
-       // ###################################################################
-       /**
-       * Post-update
-       *
-       * @access       protected
-       */
-       function post_update()
-       {
-               build_statuses();
-       }
-       
-       // ###################################################################
-       /**
-       * Post-delete
-       *
-       * @access       protected
-       */
-       function post_delete()
-       {
-               build_statuses();
-               $this->registry->db->query("UPDATE " . TABLE_PREFIX . "bug SET status = " . $this->registry->options['defaultstatus'] . " WHERE status = " . $this->values['statusid']);
-       }
-}
-
index 9bd6f2adcf160d16bf566767af805a840611bd44..37492069073f469cd5ac89a9d9641dedf869feb8 100644 (file)
@@ -141,14 +141,6 @@ class NavLinks
 
                $navigator->add_component('section', 'fields-pages', 'fields', T('Fields'), null);
                $navigator->add_component('link', 'fields-pages-fields', 'fields-pages',  T('Custom Fields'), 'field.php');
-               $navigator->add_component('link', 'fields-pages-priorities', 'fields-pages', T('Priorities'), 'priority.php');
-               $navigator->add_component('link', 'fields-pages-resolutions', 'fields-pages', T('Resolutions'), 'resolution.php');
-               $navigator->add_component('link', 'fields-pages-severities', 'fields-pages', T('Severities'), 'severity.php');
-               $navigator->add_component('link', 'fields-pages-statuses', 'fields-pages', T('Statuses'), 'status.php');
-               $navigator->add_component('link', 'fields-pages-automations', 'fields-pages', T('Automations'), 'automation.php');
-
-               // TODO(port): remove this.
-               $navigator->add_component('link', 'fields-pages-v2', 'fields-pages', 'FIELDS - V2', 'field2.php');
        }
        
        // ###################################################################
@@ -181,126 +173,6 @@ class NavLinks
                $navigator->add_component('link', 'fields-delete', 'fields', T('Delete'), 'field.php?do=delete&amp;fieldid=' . $id);
        }
        
-       // ###################################################################
-       /**
-       * Adding an new priority
-       *
-       * @access       public
-       */
-       function prioritiesAdd()
-       {
-               global $navigator;
-               
-               $navigator->add_component('section', 'priorities', 'fields', T('Priorities'), null);
-               $navigator->add_component('link', 'priorities-add', 'priorities', T('Add New Priority'), 'priority.php?do=add');
-       }
-       
-       // ###################################################################
-       /**
-       * Edit a priority
-       *
-       * @access       public
-       *
-       * @param        integer Priority ID
-       */
-       function prioritiesEdit($id)
-       {
-               global $navigator;
-               
-               NavLinks::prioritiesAdd();
-               $navigator->add_component('link', 'priorities-delete', 'priorities', T('Delete'), 'priority.php?do=delete&amp;priorityid=' . $id);
-       }
-       
-       // ###################################################################
-       /**
-       * Adding an new resolution
-       *
-       * @access       public
-       */
-       function resolutionsAdd()
-       {
-               global $navigator;
-               
-               $navigator->add_component('section', 'resolutions', 'fields', T('Resolutions'), null);
-               $navigator->add_component('link', 'resolutions-add', 'resolutions', T('Add New Resolution'), 'resolution.php?do=add');
-       }
-       
-       // ###################################################################
-       /**
-       * Edit a resolution
-       *
-       * @access       public
-       *
-       * @param        integer Resolution ID
-       */
-       function resolutionsEdit($id)
-       {
-               global $navigator;
-               
-               NavLinks::resolutionsAdd();
-               $navigator->add_component('link', 'resolutions-delete', 'resolutions', T('Delete'), 'resolution.php?do=delete&amp;resolutionid=' . $id);
-       }
-       
-       // ###################################################################
-       /**
-       * Adding an new severity
-       *
-       * @access       public
-       */
-       function severitiesAdd()
-       {
-               global $navigator;
-               
-               $navigator->add_component('section', 'severities', 'fields', T('Severities'), null);
-               $navigator->add_component('link', 'severities-add', 'severities', T('Add New Severity'), 'severity.php?do=add');
-       }
-       
-       // ###################################################################
-       /**
-       * Edit a severity
-       *
-       * @access       public
-       *
-       * @param        integer Severity ID
-       */
-       function severitiesEdit($id)
-       {
-               global $navigator;
-               
-               NavLinks::severitiesAdd();
-               $navigator->add_component('link', 'severities-delete', 'severities', T('Delete'), 'severity.php?do=delete&amp;severityid=' . $id);
-       }
-       
-       // ###################################################################
-       /**
-       * Adding an new status
-       *
-       * @access       public
-       */
-       function statusesAdd()
-       {
-               global $navigator;
-               
-               $navigator->add_component('section', 'statuses', 'fields', T('Severities'), null);
-               $navigator->add_component('link', 'statuses-add', 'statuses', T('Add New Status'), 'status.php?do=add');
-       }
-       
-       // ###################################################################
-       /**
-       * Edit a status
-       *
-       * @access       public
-       *
-       * @param        integer Status ID
-       */
-       function statusesEdit($id)
-       {
-               global $navigator;
-               
-               NavLinks::statusesAdd();
-               $navigator->add_component('link', 'statuses-delete', 'statuses', T('Delete'), 'status.php?do=delete&amp;statusid=' . $id);
-       }
-       
        // ###################################################################
        /**
        * Adding an new automation
index 0fea3d937929d8cea3f6b2c559a56220b568d0f2..b997989a3f19440a510d9f989856d4b26678d213 100644 (file)
@@ -79,66 +79,6 @@ function build_usergroups()
        Bugdar::$datastore['usergroup'] = $groups;
 }
 
-// ####################### Start build_statuses ######################
-function build_statuses()
-{
-       global $bugsys;
-       
-       $statuses = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "status ORDER BY displayorder ASC");
-       while ($status = $bugsys->db->fetch_array($statuses))
-       {
-               $tempstore["$status[statusid]"] = $status;
-       }
-       
-       $bugsys->db->query("
-               ### replacing status cache ###
-               REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
-               VALUES ('status', '" . $bugsys->escape(serialize($tempstore)) . "')"
-       );
-       
-       Bugdar::$datastore['status'] = $tempstore;
-}
-
-// ###################### Start build_severities #####################
-function build_severities()
-{
-       global $bugsys;
-       
-       $severities = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "severity ORDER BY displayorder ASC");
-       while ($severity = $bugsys->db->fetch_array($severities))
-       {
-               $tempstore["$severity[severityid]"] = $severity;
-       }
-       
-       $bugsys->db->query("
-               ### replacing severity cache ###
-               REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
-               VALUES ('severity', '" . $bugsys->escape(serialize($tempstore)) . "')"
-       );
-       
-       Bugdar::$datastore['severity'] = $tempstore;
-}
-
-// ###################### Start build_priorities #####################
-function build_priorities()
-{
-       global $bugsys;
-       
-       $priorities = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "priority ORDER BY displayorder ASC");
-       while ($priority = $bugsys->db->fetch_array($priorities))
-       {
-               $tempstore["$priority[priorityid]"] = $priority;
-       }
-       
-       $bugsys->db->query("
-               ### replacing priority cache ###
-               REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
-               VALUES ('priority', '" . $bugsys->escape(serialize($tempstore)) . "')"
-       );
-       
-       Bugdar::$datastore['priority'] = $tempstore;
-}
-
 // ###################### Start build_assignedto #####################
 function build_assignedto()
 {
@@ -176,26 +116,6 @@ function build_assignedto()
        Bugdar::$datastore['assignto'] = $devs;
 }
 
-// ##################### Start build_resolutions #####################
-function build_resolutions()
-{
-       global $bugsys;
-       
-       $resolutions = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "resolution ORDER BY displayorder ASC");
-       while ($resolution = $bugsys->db->fetch_array($resolutions))
-       {
-               $tempstore["$resolution[resolutionid]"] = $resolution;
-       }
-       
-       $bugsys->db->query("
-               ### replacing resolution cache ###
-               REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
-               VALUES ('resolution', '" . $bugsys->escape(serialize($tempstore)) . "')"
-       );
-       
-       Bugdar::$datastore['resolution'] = $tempstore;
-}
-
 // ####################### Start build_versions ######################
 function build_versions()
 {