Add a speedbump to the MFHD delete workflow
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 20 Aug 2010 03:47:46 +0000 (03:47 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 20 Aug 2010 03:47:46 +0000 (03:47 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@17277 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/openils/opac/nls/opac.js
Open-ILS/web/opac/skin/default/js/rdetail.js

index 7d515bf..8478498 100644 (file)
@@ -14,6 +14,7 @@
        "CREATE_MFHD": "Add MFHD Record",
        "CREATED_MFHD_RECORD": "Created MFHD record for ${0}",
        "DELETE_MFHD": "Delete Record",
+       "DELETE_MFHD_CONFIRM": "Are you sure you want to delete this serial record?",
        "DELETED_MFHD_RECORD": "Deleted MFHD record ${0}",
        "EDIT_MFHD_RECORD": "Edit Record",
        "EDIT_MFHD_MENU": "Edit Holdings",
index 03157aa..1221a26 100644 (file)
@@ -353,6 +353,10 @@ function _holdingsDrawMFHD(holdings, entryNum) {
                var mfhd_edit = new dijit.Menu({});
                new dijit.MenuItem({onClick: function(){loadMarcEditor(holdings.sre_id())}, label:opac_strings.EDIT_MFHD_RECORD}).placeAt(mfhd_edit, "first");
                new dijit.MenuItem({onClick:function(){
+                       // Avoid accidental deletion of MFHD records
+                       if (!confirm(opac_strings.DELETE_MFHD_CONFIRM)) {
+                               return;
+                       }
                        var pcrud = new openils.PermaCrud({"authtoken": G.user.session});
                        var mfhd_rec = pcrud.retrieve("sre", holdings.sre_id());
                        if (mfhd_rec) {