diff options
author | myk%mozilla.org <> | 2002-03-13 01:05:33 +0100 |
---|---|---|
committer | myk%mozilla.org <> | 2002-03-13 01:05:33 +0100 |
commit | cb6f229206bf8bf8f873e6d1c954139042655895 (patch) | |
tree | d92921de32049cb09b1f683feed6cc64c2c514d2 /template/default/attachstatus | |
parent | 496013d2cc0586cde9db0ace761292594fcae995 (diff) | |
download | bugzilla-cb6f229206bf8bf8f873e6d1c954139042655895.tar.gz bugzilla-cb6f229206bf8bf8f873e6d1c954139042655895.tar.xz |
Fix for bug 97739: Confirms deletion of an attachment status in browsers with no-JS/JS-off.
Patch by Jeff Hedlund <jeff.hedlund@matrixsi.com>.
r=myk,gerv
Diffstat (limited to 'template/default/attachstatus')
-rwxr-xr-x | template/default/attachstatus/list.atml | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/template/default/attachstatus/list.atml b/template/default/attachstatus/list.atml index 6828ea40c..60199a292 100755 --- a/template/default/attachstatus/list.atml +++ b/template/default/attachstatus/list.atml @@ -44,8 +44,14 @@ <td>[% statusdef.sortkey %]</td> <td>[% statusdef.product %]</td> <td> - <a href="editattachstatuses.cgi?action=edit&id=[% statusdef.id %]">Edit</a> - <a href="editattachstatuses.cgi?action=delete&id=[% statusdef.id %]" onclick="return confirmDelete();">Delete</a> + <a href="editattachstatuses.cgi?action=edit&id=[% statusdef.id %]"> + Edit</a> + | + <a href="editattachstatuses.cgi?action=confirmdelete&id=[% statusdef.id %]" + onclick="return confirmDelete([% statusdef.attachcount %], + '[% statusdef.name FILTER js %]', + [% statusdef.id %]);"> + Delete</a> </td> </tr> @@ -59,13 +65,23 @@ </tr> </table> - <script language="JavaScript"> - function confirmDelete() + function confirmDelete(attachcount, name, id) { - return confirm('Are you sure you want to permanently delete ' + - 'this attachment status? All attachments ' + - 'with this status will have it unset.'); + if (attachcount > 0) { + msg = attachcount + ' attachments have the status ' + + name + '. If you delete it, those attachments ' + + 'will lose this status. Do you really want to ' + + 'delete this status?'; + } + else { + msg = 'Are you sure you want to delete attachment status ' + + name + '?'; + } + if (confirm(msg)) { + location.href = "editattachstatuses.cgi?action=delete&id=" + id; + } + return false; } </script> |