From 9dedbeabc2a4f4cc155f7d4ee68867e50e008bd1 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 14 May 2005 21:41:19 +0000 Subject: [PATCH] r136: Completed attachment uploading stuff: - Added delete/kill methods [attachment.php] - Struck it off the roadmap and to-do list... we're at beta 1 now...? w00t! --- attachment.php | 20 ++++++++++++++++++-- docs/roadmap.txt | 5 ----- docs/todo.txt | 1 - templates/default/editattach.tpl | 1 + 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/attachment.php b/attachment.php index 61e915b..adea217 100755 --- a/attachment.php +++ b/attachment.php @@ -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 "attachment removed"; } // ################################################################### 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? yes"; } // ################################################################### @@ -192,6 +206,8 @@ if ($_REQUEST['do'] == 'edit') exit; } + $show['delete'] = ((can_perform('caneditattach')) ? true : false); + eval('$template->flush("' . $template->fetch('editattach') . '");'); } diff --git a/docs/roadmap.txt b/docs/roadmap.txt index 27a6cdf..5013b43 100755 --- a/docs/roadmap.txt +++ b/docs/roadmap.txt @@ -5,11 +5,6 @@ SVN: $Id$ ############################################################################### BUGTRACK 1.0 ----------------------------------------- - ALPHA 2 ----------------------------------------- -- Attachment uploading - ---------------------------------------- BETA 1 ---------------------------------------- diff --git a/docs/todo.txt b/docs/todo.txt index bf2f9fd..b4b5341 100755 --- a/docs/todo.txt +++ b/docs/todo.txt @@ -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 diff --git a/templates/default/editattach.tpl b/templates/default/editattach.tpl index e185c18..1961a4f 100644 --- a/templates/default/editattach.tpl +++ b/templates/default/editattach.tpl @@ -12,5 +12,6 @@ +[Delete] \ No newline at end of file -- 2.22.5