|
From: Benjamin C. <bc...@us...> - 2002-04-11 15:50:03
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv5125
Modified Files:
attachment.php
Log Message:
Cleaned up the attachment interface
Index: attachment.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/attachment.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- attachment.php 10 Apr 2002 15:07:39 -0000 1.17
+++ attachment.php 11 Apr 2002 15:49:58 -0000 1.18
@@ -58,7 +58,7 @@
}
function add_attachment($bugid, $description) {
- global $db, $HTTP_POST_FILES, $now, $u, $STRING, $t;
+ global $db, $HTTP_POST_FILES, $now, $u, $STRING, $t, $_pv;
if (!isset($HTTP_POST_FILES['attachment']) ||
$HTTP_POST_FILES['attachment']['tmp_name'] == 'none') {
@@ -122,8 +122,12 @@
$db->quote(stripslashes($description)),
$HTTP_POST_FILES['attachment']['size'],
$db->quote($HTTP_POST_FILES['attachment']['type']), $u, $now)).")");
- $t->assign('bugid', $bugid);
- $t->display('bugattachmentsuccess.html');
+
+ if ($_pv['use_js']) {
+ $t->display('admin/edit-submit.html');
+ } else {
+ header("Location: bug.php?op=show&bugid=$bugid");
+ }
}
function show_attachment_form($bugid, $error = '') {
@@ -158,7 +162,7 @@
} else {
del_attachment($_gv['del']);
}
-} elseif (isset($HTTP_POST_FILES['attachment'])) {
+} elseif (isset($_pv['submit'])) {
$perm->check('Editbug');
add_attachment($_pv['bugid'], $_pv['description']);
} elseif (isset($_gv['attachid'])) {
@@ -169,7 +173,7 @@
}
} else {
$perm->check('Editbug');
- show_attachment_form($_gv['bug_id']);
+ show_attachment_form($_gv['bugid']);
}
?>
|