From 5dd94251372426f0114fa2495d04153e0004d45b Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 1 Jun 2005 16:40:49 +0000 Subject: [PATCH] r227: Dependency system is now finished. The tree has yet to be implemented, but it's being worked on. --- editreport.php | 14 ++++++++++++++ showreport.php | 10 ++++++++++ templates/default/SHOWREPORT.tpl | 1 + templates/default/editreport.tpl | 2 ++ 4 files changed, 27 insertions(+) diff --git a/editreport.php b/editreport.php index d55a4d5..3f49d17 100644 --- a/editreport.php +++ b/editreport.php @@ -74,6 +74,9 @@ if ($_POST['do'] == 'update') process_custom_fields($bug['bugid']); + $dependencies = preg_split('#([^0-9].*?)#', $bugsys->in['dependency'], -1, PREG_SPLIT_NO_EMPTY); + $dependencies = ((count($dependencies) < 1) ? '' : implode(', ', $dependencies)); + $db->query(" UPDATE " . TABLE_PREFIX . "bug SET summary = '" . $bugsys->in['summary'] . "', @@ -83,6 +86,7 @@ if ($_POST['do'] == 'update') resolution = " . intval($bugsys->in['resolution']) . ", assignedto = " . intval($bugsys->in['assignedto']) . ", duplicateof = " . intval($bugsys->in['duplicateof']) . ", + dependency = '$dependencies', productid = " . $pcv['product'] . ", componentid = " . $pcv['component'] . ", versionid = " . $pcv['version'] . ", @@ -219,6 +223,16 @@ if ($_REQUEST['do'] == 'edit') $duplicate = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = $bug[duplicateof]"); } + if ($bug['dependency']) + { + $dependencies = $db->query("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid IN ($bug[dependency])"); + while ($dependency = $db->fetch_array($dependencies)) + { + $depends[] = "$dependency[bugid]"; + } + $dependencies = implode(' ', $depends); + } + eval('$template->flush("' . $template->fetch('editreport') . '");'); } diff --git a/showreport.php b/showreport.php index 5b9d6db..6459207 100644 --- a/showreport.php +++ b/showreport.php @@ -70,6 +70,16 @@ while ($duplicate = $db->fetch_array($duplicates)) } $dupelist = implode(', ', $dupelist); +if ($bug['dependency']) +{ + $dependencies = $db->query("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid IN ($bug[dependency])"); + while ($dependency = $db->fetch_array($dependencies)) + { + $depends[] = "$dependency[bugid]"; + } + $dependencies = implode(' ', $depends); +} + // ------------------------------------------------------------------- // custom fields $customfields = ''; diff --git a/templates/default/SHOWREPORT.tpl b/templates/default/SHOWREPORT.tpl index 3abe9c6..700f960 100644 --- a/templates/default/SHOWREPORT.tpl +++ b/templates/default/SHOWREPORT.tpl @@ -10,6 +10,7 @@
Assigned to: $bug[assigninfo]
Duplicate of: $duplicateof[summary]
Bugs marked as duplicates of this: $dupelist
+
Dependencies: $dependencies
$customfields diff --git a/templates/default/editreport.tpl b/templates/default/editreport.tpl index cf04e40..667ca57 100644 --- a/templates/default/editreport.tpl +++ b/templates/default/editreport.tpl @@ -19,6 +19,8 @@
Duplicate of: $bug[duplicateof]" /> $duplicate[summary] +
Dependencies: $dependencies +
Product/Component/Version:
$pcv_select
-- 2.43.5