From c3f60f8be2b77302154e7035ae8113b866e01f61 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 13 Dec 2006 02:11:34 +0000 Subject: [PATCH] r1366: Add the ability to obsolete a version --- admin/product.php | 6 ++++-- docs/changes.txt | 1 + docs/schema_changes.sql | 2 ++ docs/todo.txt | 1 - includes/functions_product.php | 12 +++++++----- newreport.php | 2 +- 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/admin/product.php b/admin/product.php index 8ec720c..d98a0d9 100755 --- a/admin/product.php +++ b/admin/product.php @@ -99,7 +99,7 @@ if ($_REQUEST['do'] == 'deleteversion') if ($_REQUEST['do'] == 'insertversion') { - $db->query("INSERT INTO " . TABLE_PREFIX . "version (productid, version, displayorder) VALUES (" . $bugsys->input_clean('productid', TYPE_UINT) . ", '" . $bugsys->input_escape('version') . "', " . $bugsys->input_clean('displayorder', TYPE_UINT) . ")"); + $db->query("INSERT INTO " . TABLE_PREFIX . "version (productid, version, displayorder, obsolete) VALUES (" . $bugsys->input_clean('productid', TYPE_UINT) . ", '" . $bugsys->input_escape('version') . "', " . $bugsys->input_clean('displayorder', TYPE_UINT) . ", " . $bugsys->input_clean('obsolete', TYPE_UINT) . ")"); build_versions(); $admin->redirect('product.php?do=modify'); } @@ -132,6 +132,7 @@ if ($_REQUEST['do'] == 'addversion') $admin->table_head(_('Add New Version')); $admin->row_input(_('Version Number
This is the version string for this product.
'), 'version'); $admin->row_input(_('Display Order
The order in which the versions are displayed.
'), 'displayorder'); + $admin->row_yesno(_('Obsolete
An obsolete version cannot have new bugs filed against it, but existing ones can be set to it.
'), 'obsolete'); $admin->row_submit(); $admin->table_end(); $admin->form_end(); @@ -148,7 +149,7 @@ if ($_REQUEST['do'] == 'updateversion') $admin->error(_('Please fill in a version number.')); } - $db->query("UPDATE " . TABLE_PREFIX . "version SET version = '" . $bugsys->input_escape('version') . "', displayorder = " . $bugsys->input_clean('displayorder', TYPE_UINT) . " WHERE versionid = " . $bugsys->input_clean('versionid', TYPE_UINT)); + $db->query("UPDATE " . TABLE_PREFIX . "version SET version = '" . $bugsys->input_escape('version') . "', displayorder = " . $bugsys->input_clean('displayorder', TYPE_UINT) . ", obsolete = " . $bugsys->input_clean('obsolete', TYPE_UINT) . " WHERE versionid = " . $bugsys->input_clean('versionid', TYPE_UINT)); build_versions(); $admin->redirect('product.php?do=modify'); @@ -172,6 +173,7 @@ if ($_REQUEST['do'] == 'editversion') $admin->table_head(sprintf(_('Edit Version - %1$s'), $version['version'])); $admin->row_input(_('Version Number
This is the version string for this product.
'), 'version', $version['version']); $admin->row_input(_('Display Order
The order in which the versions are displayed.
'), 'displayorder', $version['displayorder']); + $admin->row_yesno(_('Obsolete
An obsolete version cannot have new bugs filed against it, but existing ones can be set to it.
'), 'obsolete', $version['obsolete']); $admin->row_submit(); $admin->table_end(); $admin->form_end(); diff --git a/docs/changes.txt b/docs/changes.txt index b755999..4a9badc 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -8,6 +8,7 @@ - Votes can now be displayed and sorted on the bug grid (bug://report/13) - Users can save a search so they can rerun it at any time - Component and product changes wouldn't appear correcly on showhistory.php +- Versions can be marked "Obsolete" so new bugs cannot be filed against them 1.1.4 =============================== diff --git a/docs/schema_changes.sql b/docs/schema_changes.sql index 50e7dce..fc8d0e0 100644 --- a/docs/schema_changes.sql +++ b/docs/schema_changes.sql @@ -11,3 +11,5 @@ ALTER TABLE search DROP PRIMARY KEY; ALTER TABLE search ADD searchid INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY; ALTER TABLE search ADD name VARCHAR(250) NULL; + +ALTER TABLE version ADD obsolete BOOL NULL; diff --git a/docs/todo.txt b/docs/todo.txt index 7af45f8..700c7f2 100755 --- a/docs/todo.txt +++ b/docs/todo.txt @@ -5,7 +5,6 @@ SVN: $Id$ ############################################################################### BUGDAR 1.2 -- Mark products/versions as obsolete so bugs cannot be filed against them - Mass updates and deletes - Importing from other bug systems (bug://report/41) - Workflow interface diff --git a/includes/functions_product.php b/includes/functions_product.php index 57bb576..a6ee0a6 100644 --- a/includes/functions_product.php +++ b/includes/functions_product.php @@ -28,10 +28,11 @@ * * @param string Permission action to verify against for a product * @param string Selection +* @param bool Include obsolete versions? * * @return string A large blob of