From 948691ca0d9ef2d653cbc7be0959e24cb1b76921 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Mon, 30 May 2011 15:23:09 -0400 Subject: [PATCH] Add "Move to storage" quick UI for bulk location moves This simplistic interface accepts a barcode and immediately returns some bibliographic information if the barcode was found - and the item is moved immediately to the specified location. Goal was to minimize clicking, this pretty much requires just scan scan scan. Signed-off-by: Dan Scott --- Open-ILS/web/js/ui/default/cat/storage/move.js | 87 ++++++++++++++++++++++ .../web/templates/default/cat/storage/move.tt2 | 27 +++++++ 2 files changed, 114 insertions(+) create mode 100644 Open-ILS/web/js/ui/default/cat/storage/move.js create mode 100644 Open-ILS/web/templates/default/cat/storage/move.tt2 diff --git a/Open-ILS/web/js/ui/default/cat/storage/move.js b/Open-ILS/web/js/ui/default/cat/storage/move.js new file mode 100644 index 0000000000..0b0681ce1e --- /dev/null +++ b/Open-ILS/web/js/ui/default/cat/storage/move.js @@ -0,0 +1,87 @@ +dojo.require('fieldmapper.IDL'); +dojo.require('openils.PermaCrud'); +dojo.require('dojo.date'); +dojo.require('openils.CGI'); +dojo.require('openils.XUL'); + +var pcrud; +var pcrudRead; +var staff; +var copy; +var volume; +var record; +var rmsr; +var tbody; +var cgi; + +if(!window.xulG) var xulG = null; + +function load() { + staff = new openils.User().user; + pcrud = new openils.PermaCrud(); + pcrudRead = new openils.PermaCrud(); + cgi = new openils.CGI(); + var barcode = cgi.param('barcode'); + + if(xulG) { + if(xulG.ses) openils.User.authtoken = xulG.ses; + if(xulG.usr !== null) userId = xulG.usr + if(xulG.params) { + var parms = xulG.params; + if(parms.ses) + openils.User.authtoken = parms.ses; + if(parms.usr !== null) + userId = parms.usr + } + } + + dojo.byId("barcode").focus(); + moveCopy(barcode); +} + +function moveCopy(barcode) { + if (!barcode) { + // Just display the barcode entry form + return; + } + + copy = pcrud.search('acp', {"barcode":barcode}); + // There can be only one copy + copy = copy[0]; + if (!copy.location) { + dojo.place('
Barcode [' + barcode + '] was not found!
', 'resultsDiv', 'only'); + return; + } + + copy.location(152); + copy.ischanged(1); + pcrud.update(copy); + + volume = pcrudRead.retrieve("acn", copy.call_number()); + record = pcrudRead.retrieve("bre", volume.record()); + + dojo.place("
" + copy.barcode() + "
", 'resultsDiv', 'only'); + dojo.place("
" + volume.label() + "
", 'resultsDiv', 'last'); + dojo.place("
" + record.marc() + "
", dojo.body(), 'last'); + + // Totally dumb title display. Oh well! + dojo.place("
", 'resultsDiv', 'last'); + dojo.query("datafield[tag='245'] subfield").forEach(function(node, index, arr) { + dojo.place("" + node.innerHTML + " ", 'titleDiv', 'last'); + }); +} + +function moveCopyRefresh() { + var usr = cgi.param('barcode'); + var href = location.href.replace(/\?.*/, ''); + href += ((usr) ? '?barcode=' + barcode : ''); + location.href = href; +} + +function moveCopyRefreshXUL(newuser) { + if (window.xulG && typeof window.xulG.on_save == 'function') + window.xulG.on_save(newuser); +} + +openils.Util.addOnLoad(load); + 1,1 Top diff --git a/Open-ILS/web/templates/default/cat/storage/move.tt2 b/Open-ILS/web/templates/default/cat/storage/move.tt2 new file mode 100644 index 0000000000..cfd17d2dd2 --- /dev/null +++ b/Open-ILS/web/templates/default/cat/storage/move.tt2 @@ -0,0 +1,27 @@ +[% ctx.page_title = 'Move item to storage' %] +[% WRAPPER base.tt2 %] + + + + +

Move item to storage

+
+ + + + + +
+
+ +
+ +[% END %] -- 2.11.0