From e12692ee7006396c8e86f4d393e8c76c3905bdc2 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 30 May 2005 20:10:11 +0000 Subject: [PATCH] r218: Duplicates are now done --- docs/schema_changes.sql | 4 +++- docs/todo.txt | 1 - editreport.php | 6 ++++++ showreport.php | 9 +++++++++ templates/default/SHOWREPORT.tpl | 2 ++ templates/default/editreport.tpl | 2 ++ 6 files changed, 22 insertions(+), 2 deletions(-) diff --git a/docs/schema_changes.sql b/docs/schema_changes.sql index 7431b3a..ce200fc 100644 --- a/docs/schema_changes.sql +++ b/docs/schema_changes.sql @@ -54,4 +54,6 @@ ALTER TABLE `bug` ADD `hidden` INT(2) UNSIGNED NOT NULL AFTER `assignedto`; ALTER TABLE `comment` ADD `hidden` INT(2) UNSIGNED NOT NULL; -ALTER TABLE `bug` ADD `hiddenlastposttime` INT(10) UNSIGNED NOT NULL, ADD `hiddenlastpostby` INT(10) UNSIGNED NOT NULL; \ No newline at end of file +ALTER TABLE `bug` ADD `hiddenlastposttime` INT(10) UNSIGNED NOT NULL, ADD `hiddenlastpostby` INT(10) UNSIGNED NOT NULL; + +ALTER TABLE `bug` ADD `duplicateof` INT(10) UNSIGNED NOT NULL AFTER `assignedto`, ADD `dependency` MEDIUMTEXT NOT NULL AFTER `duplicateof`; \ No newline at end of file diff --git a/docs/todo.txt b/docs/todo.txt index 9be1b18..68d6a26 100755 --- a/docs/todo.txt +++ b/docs/todo.txt @@ -17,7 +17,6 @@ BUGTRACK 1.0 - New style - Language independence - Make summary field longer -- When displaying a bug, show a list of bugs that have been marked duplicate - When displaying a bug, show dependency and relation trees ---------------------------------------- diff --git a/editreport.php b/editreport.php index 6522f68..d55a4d5 100644 --- a/editreport.php +++ b/editreport.php @@ -82,6 +82,7 @@ if ($_POST['do'] == 'update') severity = " . intval($bugsys->in['severity']) . ", resolution = " . intval($bugsys->in['resolution']) . ", assignedto = " . intval($bugsys->in['assignedto']) . ", + duplicateof = " . intval($bugsys->in['duplicateof']) . ", productid = " . $pcv['product'] . ", componentid = " . $pcv['component'] . ", versionid = " . $pcv['version'] . ", @@ -213,6 +214,11 @@ if ($_REQUEST['do'] == 'edit') $customfields = construct_custom_fields($bug); + if ($bug['duplicateof']) + { + $duplicate = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = $bug[duplicateof]"); + } + eval('$template->flush("' . $template->fetch('editreport') . '");'); } diff --git a/showreport.php b/showreport.php index a93a24c..5b9d6db 100644 --- a/showreport.php +++ b/showreport.php @@ -61,6 +61,15 @@ $bug['assigninfo'] = ((is_array($assigninfo)) ? construct_user_display($assignin $show['editreport'] = ((((can_perform('caneditown') AND $bugsys->userinfo['userid'] == $comment['userid']) OR can_perform('caneditothers')) AND can_perform('caneditinfo')) ? true : false); +$duplicateof = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = $bug[duplicateof]"); + +$duplicates = $db->query("SELECT * FROM " . TABLE_PREFIX . "bug WHERE duplicateof = $bug[bugid]"); +while ($duplicate = $db->fetch_array($duplicates)) +{ + $dupelist[] = "$duplicate[summary]"; +} +$dupelist = implode(', ', $dupelist); + // ------------------------------------------------------------------- // custom fields $customfields = ''; diff --git a/templates/default/SHOWREPORT.tpl b/templates/default/SHOWREPORT.tpl index d66e025..3abe9c6 100644 --- a/templates/default/SHOWREPORT.tpl +++ b/templates/default/SHOWREPORT.tpl @@ -8,6 +8,8 @@
Severity: $bug[severity]
Priority: $bug[priority]
Assigned to: $bug[assigninfo]
+
Duplicate of: $duplicateof[summary]
+
Bugs marked as duplicates of this: $dupelist
$customfields diff --git a/templates/default/editreport.tpl b/templates/default/editreport.tpl index 16c6ecd..cf04e40 100644 --- a/templates/default/editreport.tpl +++ b/templates/default/editreport.tpl @@ -17,6 +17,8 @@
Assigned to:
+
Duplicate of: $bug[duplicateof]" /> $duplicate[summary] +
Product/Component/Version:
$pcv_select
-- 2.43.5