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&attachmentid=$attachment[attachmentid]\">yes</a>";
}
// ###################################################################
exit;
}
+ $show['delete'] = ((can_perform('caneditattach')) ? true : false);
+
eval('$template->flush("' . $template->fetch('editattach') . '");');
}
###############################################################################
BUGTRACK 1.0
-----------------------------------------
- ALPHA 2
-----------------------------------------
-- Attachment uploading
-
----------------------------------------
BETA 1
----------------------------------------
----------------------------------------
BUG REPORTING/EDITING
----------------------------------------
-- Attachment uploading
- Custom bug fields
- Default templates in the description field
- Help bubbles detailing each field
<input name="submit" type="submit" value=" Submit " accesskey="s" />
<input name="reset" type="reset" value=" Reset " accesskey="r" />
+[<a href="attachment.php?do=delete&attachmentid=$attachment[attachmentid]\">Delete</a>]
</form>
\ No newline at end of file