r136: Completed attachment uploading stuff:
authorRobert Sesek <rsesek@bluestatic.org>
Sat, 14 May 2005 21:41:19 +0000 (21:41 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Sat, 14 May 2005 21:41:19 +0000 (21:41 +0000)
- Added delete/kill methods [attachment.php]
- Struck it off the roadmap and to-do list... we're at beta 1 now...? w00t!

attachment.php
docs/roadmap.txt
docs/todo.txt
templates/default/editattach.tpl

index 61e915b61ca8d7a90eca680ae0bc4c839103eaa5..adea2170318bd4ce1c8ee6a8c7975c3e8bd24a86 100755 (executable)
@@ -38,14 +38,28 @@ if (!$bug)
 
 if ($_REQUEST['do'] == 'kill')
 {
-       // run code to remove item in database
+       if (!can_perform('caneditattach'))
+       {
+               echo 'alert: no permission';
+               exit;
+       }
+       
+       $db->query("DELETE FROM " . TABLE_PREFIX . "attachment WHERE attachmentid = $attachment[attachmentid]");
+       
+       echo "<a href=\"showreport.php?bugid=$bug[bugid]\">attachment removed</a>";
 }
 
 // ###################################################################
 
 if ($_REQUEST['do'] == 'delete')
 {
-       // display delete confirmation message
+       if (!can_perform('caneditattach'))
+       {
+               echo 'alert: no permission';
+               exit;
+       }
+       
+       echo "are you sure you want to delete this attachment? <a href=\"attachment.php?do=kill&amp;attachmentid=$attachment[attachmentid]\">yes</a>";
 }
 
 // ###################################################################
@@ -192,6 +206,8 @@ if ($_REQUEST['do'] == 'edit')
                exit;
        }
        
+       $show['delete'] = ((can_perform('caneditattach')) ? true : false);
+       
        eval('$template->flush("' . $template->fetch('editattach') . '");');
 }
 
index 27a6cdf2e48a67c1fdddff6dd1634de5f90d9fd6..5013b4326fd9a2570ee55916d5d50368a633c6a0 100755 (executable)
@@ -5,11 +5,6 @@ SVN: $Id$
 ###############################################################################
 BUGTRACK 1.0
 
-----------------------------------------
-  ALPHA 2
-----------------------------------------
-- Attachment uploading
-
 ----------------------------------------
   BETA 1
 ----------------------------------------
index bf2f9fd1f3efb439d62cecf50aa438418766ebb9..b4b5341d45fb6e901ce06a55f10e5047c798ce08 100755 (executable)
@@ -31,7 +31,6 @@ BUGTRACK 1.0
 ----------------------------------------
   BUG REPORTING/EDITING
 ----------------------------------------
-- Attachment uploading
 - Custom bug fields
 - Default templates in the description field
 - Help bubbles detailing each field
index e185c189cb874f12d2d25f353a44db34b9bdee67..1961a4f8e5a36b543195f0305c40eba8cc0d954c 100644 (file)
@@ -12,5 +12,6 @@
        
 <input name="submit" type="submit" value="  Submit  " accesskey="s" />
 <input name="reset" type="reset" value="  Reset  " accesskey="r" />
+[<a href="attachment.php?do=delete&amp;attachmentid=$attachment[attachmentid]\">Delete</a>]
 
 </form>
\ No newline at end of file