LP#1154579: explicitly alert if copy location failed to be deleted
authorGalen Charlton <gmc@esilibrary.com>
Mon, 23 Feb 2015 20:25:02 +0000 (20:25 +0000)
committerBen Shum <bshum@biblio.org>
Mon, 23 Feb 2015 22:07:45 +0000 (17:07 -0500)
This patch adds an alert if the act of deleting a copy
location in the staff interface fails -- which would
most commonly happen if there are still active items
attached to the location to be deleted.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/xul/staff_client/server/admin/copy_locations.js

index 6ce174f..da25abc 100644 (file)
@@ -288,7 +288,10 @@ function clDelete( cl, tbody, row ) {
     var req = new Request( DELETE_CL, SESSION, cl.id() );
     req.send(true);
     var res = req.result();
-    if(checkILSEvent(res)) throw res;
+    if (checkILSEvent(res)) {
+        alertILSEvent(res);
+        return;
+    }
     alertId('cl_update_success');
     clGo();
 }