From 7e026d214f4ba5451aab756af78e776fdcc0cb84 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Alexander_Nicolaysen_S=C3=B8rnes?= <alexander@alex.alexstyrt>
Date: Mon, 17 Sep 2007 20:41:47 +0200
Subject: [PATCH] bug: Let objectManager delete bug links

---
 appview.php      |   12 ------------
 include/bugs.php |    2 +-
 2 files changed, 1 insertions(+), 13 deletions(-)

diff --git a/appview.php b/appview.php
index 601fc11..ebf028b 100644
--- a/appview.php
+++ b/appview.php
@@ -80,18 +80,6 @@ if (isset($aClean['sSub']))
     if(isset($aClean['iVersionId']))
       $oVersion = new Version($aClean['iVersionId']);
 
-    if(($aClean['sSub'] == 'delete' ) && ($aClean['iBuglinkId']))
-    {
-        if(($_SESSION['current']->hasPriv("admin") ||
-            $_SESSION['current']->isMaintainer($oVersion->iVersionId) ||
-            $_SESSION['current']->isSuperMaintainer($oVersion->iAppId)))
-        {
-            $oBuglink = new Bug($aClean['iBuglinkId']);
-            $oBuglink->delete();
-            util_redirect_and_exit($oVersion->objectMakeUrl());
-        }
- 
-    }
     if(($aClean['sSub'] == 'unqueue' ) && ($aClean['iBuglinkId']))
     {
         if(($_SESSION['current']->hasPriv("admin") ||
diff --git a/include/bugs.php b/include/bugs.php
index 7b44519..a68129d 100644
--- a/include/bugs.php
+++ b/include/bugs.php
@@ -563,7 +563,7 @@ function view_version_bugs($iVersionId = null, $aBuglinkIds)
             
             if($bCanEdit == true)
             {
-                echo "<td align=center>[<a href='".$oVersion->objectMakeUrl()."&sSub=delete&iBuglinkId=".$oBuglink->iLinkId."'>delete</a>]</td>\n";
+                echo "<td align=center>[<a href='objectManager.php?sClass=bug&iId=".$oBuglink->iLinkId."&sAction=delete&sSubmit=Delete&sReturnTo=".$oVersion->objectMakeUrl()."'>delete</a>]</td>\n";
                 if ($oBuglink->bQueued)
                 {
                     echo "<td align=center>[<a href='".$oVersion->objectMakeUrl()."&sSub=unqueue&iBuglinkId=".$oBuglink->iLinkId."'>OK</a>]</td>\n";
-- 
1.5.0.7

