r227: Dependency system is now finished. The tree has yet to be implemented, but...
authorRobert Sesek <rsesek@bluestatic.org>
Wed, 1 Jun 2005 16:40:49 +0000 (16:40 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Wed, 1 Jun 2005 16:40:49 +0000 (16:40 +0000)
editreport.php
showreport.php
templates/default/SHOWREPORT.tpl
templates/default/editreport.tpl

index d55a4d5d4aba76a6e40837b62ca086ff40589f26..3f49d177fa27815d14671543ea78f82c5de27e13 100644 (file)
@@ -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[] = "<a href=\"showreport.php?bugid=$dependency[bugid]\" alt=\"$dependency[summary]\">$dependency[bugid]</a>";
+               }
+               $dependencies = implode(' ', $depends);
+       }
+       
        eval('$template->flush("' . $template->fetch('editreport') . '");');
 }
 
index 5b9d6db2e1b9e67e2ade2edfe4f26deb310935b5..64592075d48d69f2a7f0da38b57f1b117219cb4a 100644 (file)
@@ -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[] = "<a href=\"showreport.php?bugid=$dependency[bugid]\" title=\"$dependency[summary]\" target=\"_blank\">$dependency[bugid]</a>";
+       }
+       $dependencies = implode(' ', $depends);
+}
+
 // -------------------------------------------------------------------
 // custom fields
 $customfields = '';
index 3abe9c6916113d314cd9d34480b4aa3b3a239a26..700f9606c3f74b1a3ee14797df56e957fbf771b7 100644 (file)
@@ -10,6 +10,7 @@
 <if condition="$bug['assigninfo']"><div><strong>Assigned to:</strong> $bug[assigninfo]</div></if>
 <if condition="$bug['duplicateof']"><div><strong>Duplicate of:</strong> <a href="showreport.php?bugid=$bug[duplicateof]">$duplicateof[summary]</a></div></if>
 <if condition="$dupelist"><div><strong>Bugs marked as duplicates of this:</strong> $dupelist</div></if>
+<if condition="$dependencies"><div><strong>Dependencies:</strong> $dependencies</div></if>
 
 $customfields
 
index cf04e404cee554e97a03b785a1d18ca28037ed6c..667ca573188c0363d8c5f709b92f7e339a1294c4 100644 (file)
@@ -19,6 +19,8 @@
 
 <div><strong>Duplicate of:</strong> <input type="text" name="duplicateof" size="10" value="<if condition="$bug['duplicateof']">$bug[duplicateof]</if>" /> <if condition="$bug['duplicateof']"><a href="showreport.php?bugid=$bug[duplicateof]" target="_blank">$duplicate[summary]</a></if>
 
+<div><strong>Dependencies:</strong> <input type="text" name="dependency" size="25" value="$bug[dependency]" /> $dependencies
+
 <div><strong>Product/Component/Version:</strong>
 <div>$pcv_select</div>
 </div>