Mercurial > hg > fapweb
changeset 432:07d0dab94cdc
Add confirmation for deleting rotation lists.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 05 Dec 2013 21:52:06 +0200 |
parents | 55affc680c2b |
children | 5c85316adfad |
files | admin.php |
diffstat | 1 files changed, 13 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/admin.php Thu Dec 05 21:49:03 2013 +0200 +++ b/admin.php Thu Dec 05 21:52:06 2013 +0200 @@ -607,11 +607,17 @@ } +function refreshRotationListSel() +{ + jsRefreshItems("ctrlRotationListsSel", "infoRotationLists", ""); +} + + function newRotationList() { var msuccess = function(txt) { - jsRefreshItems("ctrlRotationListsSel", "infoRotationLists", ""); + refreshRotationListSel(); jsOpenAdminPopup(txt); } @@ -621,14 +627,17 @@ function deleteRotationList() { - var msuccess = function(txt) + var mcb_ok = function(txt) { - jsRefreshItems("ctrlRotationListsSel", "infoRotationLists", ""); + jsSendPOSTRequest("action=ctrl&type=deleteRotationList&id="+id, refreshRotationListSel); } var id = jsGetValue("ctrlRotationListsSel", 4); if (id > 0) - jsSendPOSTRequest("action=ctrl&type=deleteRotationList&id="+id, msuccess); + { + jsConfirmBox("Are you <b>sure</b> you want to delete rotation list #"+id+"?", + mcb_ok, 0, 0); + } else jsMessageBox("No rotation list selected?"); }