Add production moveto interfaces
authorDan Scott <dscott@laurentian.ca>
Fri, 20 Apr 2018 16:24:57 +0000 (12:24 -0400)
committerDan Scott <dscott@laurentian.ca>
Fri, 25 May 2018 21:25:46 +0000 (17:25 -0400)
Signed-off-by: Dan Scott <dscott@laurentian.ca>
16 files changed:
Open-ILS/src/templates/cat/moveto/back_reference.tt2 [new file with mode: 0644]
Open-ILS/src/templates/cat/moveto/circ.tt2 [new file with mode: 0644]
Open-ILS/src/templates/cat/moveto/delete.tt2 [new file with mode: 0644]
Open-ILS/src/templates/cat/moveto/faculty_authors.tt2 [new file with mode: 0644]
Open-ILS/src/templates/cat/moveto/lal_circ.tt2 [new file with mode: 0644]
Open-ILS/src/templates/cat/moveto/live_lakes.tt2 [new file with mode: 0644]
Open-ILS/src/templates/cat/moveto/storage.tt2 [new file with mode: 0644]
Open-ILS/src/templates/cat/moveto/strip.tt2 [new file with mode: 0644]
Open-ILS/web/js/ui/default/cat/moveto/back_reference.js [new file with mode: 0644]
Open-ILS/web/js/ui/default/cat/moveto/circ.js [new file with mode: 0644]
Open-ILS/web/js/ui/default/cat/moveto/delete.js [new file with mode: 0644]
Open-ILS/web/js/ui/default/cat/moveto/faculty_authors.js [new file with mode: 0644]
Open-ILS/web/js/ui/default/cat/moveto/lal_circ.js [new file with mode: 0644]
Open-ILS/web/js/ui/default/cat/moveto/live_lakes.js [new file with mode: 0644]
Open-ILS/web/js/ui/default/cat/moveto/storage.js [new file with mode: 0644]
Open-ILS/web/js/ui/default/cat/moveto/strip.js [new file with mode: 0644]

diff --git a/Open-ILS/src/templates/cat/moveto/back_reference.tt2 b/Open-ILS/src/templates/cat/moveto/back_reference.tt2
new file mode 100644 (file)
index 0000000..c04faa1
--- /dev/null
@@ -0,0 +1,30 @@
+[% ctx.page_title = 'Move item to Back Reference' %]
+[% WRAPPER base.tt2 %]
+<script src='[% ctx.media_prefix %]/js/ui/default/cat/moveto/back_reference.js'> </script>
+
+<style>
+    label { margin-left: 2em; }
+    .dijitTextBoxFocused, .dijitFocused { border:1px dashed #3e3e3e; color: #303030; font-weight:bold;}
+    .alert { color: red; font-weight: bold; }
+    #resultsDiv { font-size: larger; margin-top: 3em; margin-left: 2em; }
+    h1 { margin-left: 1em; font-weight: bold; }
+    #barcodeForm { margin-top: 2em; }
+
+</style>
+
+<h1>Move item to Back Reference</h1>
+
+<form method="get" action="/eg/cat/moveto/back_reference">
+     <table id="barcodeForm">
+      <tr>
+        <td><label for="barcode" style="font-size: larger;">Barcode</label></td>
+        <td><input type="text" id="barcode" name="barcode" dojoType="dijit.form.TextBox" style="margin-left: 1em;"/></td>
+      </tr>
+     </table>
+</form>
+
+<div id="resultsDiv"></div>
+
+[% END %]
+
+
diff --git a/Open-ILS/src/templates/cat/moveto/circ.tt2 b/Open-ILS/src/templates/cat/moveto/circ.tt2
new file mode 100644 (file)
index 0000000..814daca
--- /dev/null
@@ -0,0 +1,30 @@
+[% ctx.page_title = 'Move item to Back Reference' %]
+[% WRAPPER base.tt2 %]
+<script src='[% ctx.media_prefix %]/js/ui/default/cat/moveto/circ.js'> </script>
+
+<style>
+    label { margin-left: 2em; }
+    .dijitTextBoxFocused, .dijitFocused { border:1px dashed #3e3e3e; color: #303030; font-weight:bold;}
+    .alert { color: red; font-weight: bold; }
+    #resultsDiv { font-size: larger; margin-top: 3em; margin-left: 2em; }
+    h1 { margin-left: 1em; font-weight: bold; }
+    #barcodeForm { margin-top: 2em; }
+
+</style>
+
+<h1>Move item to Circulation</h1>
+
+<form method="get" action="/eg/cat/moveto/circ">
+     <table id="barcodeForm">
+      <tr>
+        <td><label for="barcode" style="font-size: larger;">Barcode</label></td>
+        <td><input type="text" id="barcode" name="barcode" dojoType="dijit.form.TextBox" style="margin-left: 1em;"/></td>
+      </tr>
+     </table>
+</form>
+
+<div id="resultsDiv"></div>
+
+[% END %]
+
+
diff --git a/Open-ILS/src/templates/cat/moveto/delete.tt2 b/Open-ILS/src/templates/cat/moveto/delete.tt2
new file mode 100644 (file)
index 0000000..373ec8a
--- /dev/null
@@ -0,0 +1,30 @@
+[% ctx.page_title = 'Delete item' %]
+[% WRAPPER base.tt2 %]
+<script src='[% ctx.media_prefix %]/js/ui/default/cat/moveto/delete.js'> </script>
+
+<style>
+    label { margin-left: 2em; }
+    .dijitTextBoxFocused, .dijitFocused { border:1px dashed #3e3e3e; color: #303030; font-weight:bold;}
+    .alert { color: red; font-weight: bold; }
+    #resultsDiv { font-size: larger; margin-top: 3em; margin-left: 2em; }
+    h1 { margin-left: 1em; font-weight: bold; }
+    #barcodeForm { margin-top: 2em; }
+
+</style>
+
+<h1>Delete item</h1>
+
+<form method="get" action="/eg/cat/moveto/delete">
+     <table id="barcodeForm">
+      <tr>
+        <td><label for="barcode" style="font-size: larger;">Barcode</label></td>
+        <td><input type="text" id="barcode" name="barcode" dojoType="dijit.form.TextBox" style="margin-left: 1em;"/></td>
+      </tr>
+     </table>
+</form>
+
+<div id="resultsDiv"></div>
+
+[% END %]
+
+
diff --git a/Open-ILS/src/templates/cat/moveto/faculty_authors.tt2 b/Open-ILS/src/templates/cat/moveto/faculty_authors.tt2
new file mode 100644 (file)
index 0000000..d6a767d
--- /dev/null
@@ -0,0 +1,30 @@
+[% ctx.page_title = 'Move item to Faculty Authors collection' %]
+[% WRAPPER base.tt2 %]
+<script src='[% ctx.media_prefix %]/js/ui/default/cat/moveto/faculty_authors.js'> </script>
+
+<style>
+    label { margin-left: 2em; }
+    .dijitTextBoxFocused, .dijitFocused { border:1px dashed #3e3e3e; color: #303030; font-weight:bold;}
+    .alert { color: red; font-weight: bold; }
+    #resultsDiv { font-size: larger; margin-top: 3em; margin-left: 2em; }
+    h1 { margin-left: 1em; font-weight: bold; }
+    #barcodeForm { margin-top: 2em; }
+
+</style>
+
+<h1>[% ctx.page_title %]</h1>
+
+<form method="get" action="/eg/cat/moveto/faculty_authors">
+     <table id="barcodeForm">
+      <tr>
+        <td><label for="barcode" style="font-size: larger;">Barcode</label></td>
+        <td><input type="text" id="barcode" name="barcode" dojoType="dijit.form.TextBox" style="margin-left: 1em;"/></td>
+      </tr>
+     </table>
+</form>
+
+<div id="resultsDiv"></div>
+
+[% END %]
+
+
diff --git a/Open-ILS/src/templates/cat/moveto/lal_circ.tt2 b/Open-ILS/src/templates/cat/moveto/lal_circ.tt2
new file mode 100644 (file)
index 0000000..67d954c
--- /dev/null
@@ -0,0 +1,30 @@
+[% ctx.page_title = 'Move item to LAL Circulation' %]
+[% WRAPPER base.tt2 %]
+<script src='[% ctx.media_prefix %]/js/ui/default/cat/moveto/lal_circ.js'> </script>
+
+<style>
+    label { margin-left: 2em; }
+    .dijitTextBoxFocused, .dijitFocused { border:1px dashed #3e3e3e; color: #303030; font-weight:bold;}
+    .alert { color: red; font-weight: bold; }
+    #resultsDiv { font-size: larger; margin-top: 3em; margin-left: 2em; }
+    h1 { margin-left: 1em; font-weight: bold; }
+    #barcodeForm { margin-top: 2em; }
+
+</style>
+
+<h1>Move item to LAL Circulation</h1>
+
+<form method="get" action="/eg/cat/moveto/lal_circ">
+     <table id="barcodeForm">
+      <tr>
+        <td><label for="barcode" style="font-size: larger;">Barcode</label></td>
+        <td><input type="text" id="barcode" name="barcode" dojoType="dijit.form.TextBox" style="margin-left: 1em;"/></td>
+      </tr>
+     </table>
+</form>
+
+<div id="resultsDiv"></div>
+
+[% END %]
+
+
diff --git a/Open-ILS/src/templates/cat/moveto/live_lakes.tt2 b/Open-ILS/src/templates/cat/moveto/live_lakes.tt2
new file mode 100644 (file)
index 0000000..363b131
--- /dev/null
@@ -0,0 +1,30 @@
+[% ctx.page_title = 'Move item to Living with Lakes Centre' %]
+[% WRAPPER base.tt2 %]
+<script src='[% ctx.media_prefix %]/js/ui/default/cat/moveto/live_lakes.js'> </script>
+
+<style>
+    label { margin-left: 2em; }
+    .dijitTextBoxFocused, .dijitFocused { border:1px dashed #3e3e3e; color: #303030; font-weight:bold;}
+    .alert { color: red; font-weight: bold; }
+    #resultsDiv { font-size: larger; margin-top: 3em; margin-left: 2em; }
+    h1 { margin-left: 1em; font-weight: bold; }
+    #barcodeForm { margin-top: 2em; }
+
+</style>
+
+<h1>[% ctx.page_title %]</h1>
+
+<form method="get" action="/eg/cat/moveto/live_lakes">
+     <table id="barcodeForm">
+      <tr>
+        <td><label for="barcode" style="font-size: larger;">Barcode</label></td>
+        <td><input type="text" id="barcode" name="barcode" dojoType="dijit.form.TextBox" style="margin-left: 1em;"/></td>
+      </tr>
+     </table>
+</form>
+
+<div id="resultsDiv"></div>
+
+[% END %]
+
+
diff --git a/Open-ILS/src/templates/cat/moveto/storage.tt2 b/Open-ILS/src/templates/cat/moveto/storage.tt2
new file mode 100644 (file)
index 0000000..d014c50
--- /dev/null
@@ -0,0 +1,27 @@
+[% ctx.page_title = 'Move item to storage' %]
+[% WRAPPER base.tt2 %]
+<script src='[% ctx.media_prefix %]/js/ui/default/cat/moveto/storage.js'> </script>
+
+<style>
+    label { margin-left: 2em; }
+    .dijitTextBoxFocused, .dijitFocused { border:1px dashed #3e3e3e; color: #303030; font-weight:bold;}
+    .alert { color: red; font-weight: bold; }
+    #resultsDiv { font-size: larger; margin-top: 3em; margin-left: 2em; }
+    h1 { margin-left: 1em; font-weight: bold; }
+    #barcodeForm { margin-top: 2em; }
+
+</style>
+
+<h1>Move item to storage</h1>
+<form method="get" action="/eg/cat/moveto/storage" id="barcodeForm">
+     <table style="margin-top: 2em;">
+      <tr>
+        <td><label for="barcode" style="font-size: larger;">Barcode</label></td>
+        <td><input type="text" id="barcode" name="barcode" dojoType="dijit.form.TextBox" style="margin-left: 1em;"/></td>
+      </tr>
+     </table>
+</form>
+
+<div id="resultsDiv"></div>
+
+[% END %]
diff --git a/Open-ILS/src/templates/cat/moveto/strip.tt2 b/Open-ILS/src/templates/cat/moveto/strip.tt2
new file mode 100644 (file)
index 0000000..085d38d
--- /dev/null
@@ -0,0 +1,30 @@
+[% ctx.page_title = 'Move item to storage' %]
+[% WRAPPER base.tt2 %]
+<script src='[% ctx.media_prefix %]/js/ui/default/cat/moveto/strip.js'> </script>
+
+<style>
+    label { margin-left: 2em; }
+    .dijitTextBoxFocused, .dijitFocused { border:1px dashed #3e3e3e; color: #303030; font-weight:bold;}
+    .alert { color: red; font-weight: bold; }
+    #resultsDiv { font-size: larger; margin-top: 3em; margin-left: 2em; }
+    h1 { margin-left: 1em; font-weight: bold; }
+    #barcodeForm { margin-top: 2em; }
+
+</style>
+
+<h1>Move item to storage</h1>
+
+<form method="get" action="/eg/cat/moveto/strip">
+     <table id="barcodeForm">
+      <tr>
+        <td><label for="barcode" style="font-size: larger;">Barcode</label></td>
+        <td><input type="text" id="barcode" name="barcode" dojoType="dijit.form.TextBox" style="margin-left: 1em;"/></td>
+      </tr>
+     </table>
+</form>
+
+<div id="resultsDiv"></div>
+
+[% END %]
+
+
diff --git a/Open-ILS/web/js/ui/default/cat/moveto/back_reference.js b/Open-ILS/web/js/ui/default/cat/moveto/back_reference.js
new file mode 100644 (file)
index 0000000..d7146c5
--- /dev/null
@@ -0,0 +1,89 @@
+dojo.require('fieldmapper.IDL');
+dojo.require('openils.PermaCrud');
+dojo.require('dojo.date');
+dojo.require('openils.CGI');
+dojo.require('openils.XUL');
+
+var pcrud;
+var pcrudReader;
+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();
+    pcrudReader = 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 = fieldmapper.standardRequest(
+        ['open-ils.search', 'open-ils.search.asset.copy.find_by_barcode'],
+        {params: [barcode]}
+    );
+*/
+    /* Get rid of non-numeric barcode characters - probably need to configure the cheapo scanner */
+    barcode = barcode.replace(/[^0-9]/g, '');
+    copy = pcrud.search('acp', {"barcode":barcode});
+    // There can be only one copy
+    copy = copy[0];
+    if (!copy.location) {
+       dojo.place('<div class="alert">Barcode [' + barcode + '] was not found!</div>', 'resultsDiv', 'only');
+       return;
+    }
+    copy.location(837);
+    copy.ischanged(true);
+    pcrud.update(copy);
+
+    volume = pcrudReader.retrieve("acn", copy.call_number());
+    record = pcrudReader.retrieve("bre", volume.record());
+    dojo.place("<div class='barcode'>" + copy.barcode() + "</div>", 'resultsDiv', 'only');
+    dojo.place("<div class='call_number'>" + volume.label() + "</div>", 'resultsDiv', 'last');
+    dojo.place("<div style='display:none'>" + record.marc() + "</div>", dojo.body(), 'last');
+    dojo.place("<div class='title' id='titleDiv'></div>", 'resultsDiv', 'last');
+    dojo.query("datafield[tag='245'] subfield").forEach(function(node, index, arr) {
+        dojo.place("<span class='title'>" + node.innerHTML + " </span>", '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);
diff --git a/Open-ILS/web/js/ui/default/cat/moveto/circ.js b/Open-ILS/web/js/ui/default/cat/moveto/circ.js
new file mode 100644 (file)
index 0000000..ef1cb17
--- /dev/null
@@ -0,0 +1,89 @@
+dojo.require('fieldmapper.IDL');
+dojo.require('openils.PermaCrud');
+dojo.require('dojo.date');
+dojo.require('openils.CGI');
+dojo.require('openils.XUL');
+
+var pcrud;
+var pcrudReader;
+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();
+    pcrudReader = 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 = fieldmapper.standardRequest(
+        ['open-ils.search', 'open-ils.search.asset.copy.find_by_barcode'],
+        {params: [barcode]}
+    );
+*/
+    /* Get rid of non-numeric barcode characters - probably need to configure the cheapo scanner */
+    barcode = barcode.replace(/[^0-9]/g, '');
+    copy = pcrud.search('acp', {"barcode":barcode});
+    // There can be only one copy
+    copy = copy[0];
+    if (!copy.location) {
+       dojo.place('<div class="alert">Barcode [' + barcode + '] was not found!</div>', 'resultsDiv', 'only');
+       return;
+    }
+    copy.location(142);
+    copy.ischanged(true);
+    pcrud.update(copy);
+
+    volume = pcrudReader.retrieve("acn", copy.call_number());
+    record = pcrudReader.retrieve("bre", volume.record());
+    dojo.place("<div class='barcode'>" + copy.barcode() + "</div>", 'resultsDiv', 'only');
+    dojo.place("<div class='call_number'>" + volume.label() + "</div>", 'resultsDiv', 'last');
+    dojo.place("<div style='display:none'>" + record.marc() + "</div>", dojo.body(), 'last');
+    dojo.place("<div class='title' id='titleDiv'></div>", 'resultsDiv', 'last');
+    dojo.query("datafield[tag='245'] subfield").forEach(function(node, index, arr) {
+        dojo.place("<span class='title'>" + node.innerHTML + " </span>", '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);
diff --git a/Open-ILS/web/js/ui/default/cat/moveto/delete.js b/Open-ILS/web/js/ui/default/cat/moveto/delete.js
new file mode 100644 (file)
index 0000000..3d54246
--- /dev/null
@@ -0,0 +1,90 @@
+dojo.require('fieldmapper.IDL');
+dojo.require('openils.PermaCrud');
+dojo.require('dojo.date');
+dojo.require('openils.CGI');
+dojo.require('openils.XUL');
+
+var pcrud;
+var pcrudReader;
+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();
+    pcrudReader = 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 = fieldmapper.standardRequest(
+        ['open-ils.search', 'open-ils.search.asset.copy.find_by_barcode'],
+        {params: [barcode]}
+    );
+*/
+    /* Get rid of non-numeric barcode characters - probably need to configure the cheapo scanner */
+    barcode = barcode.replace(/[^0-9]/g, '');
+    copy = pcrud.search('acp', {"barcode":barcode});
+    // There can be only one copy
+    copy = copy[0];
+    if (!copy.location) {
+       dojo.place('<div class="alert">Barcode [' + barcode + '] was not found!</div>', 'resultsDiv', 'only');
+       return;
+    }
+    copy.deleted(true);
+    copy.ischanged(true);
+    copy.isdeleted(true);
+    pcrud.update(copy);
+
+    volume = pcrudReader.retrieve("acn", copy.call_number());
+    record = pcrudReader.retrieve("bre", volume.record());
+    dojo.place("<div class='barcode'>" + copy.barcode() + "</div>", 'resultsDiv', 'only');
+    dojo.place("<div class='call_number'>" + volume.label() + "</div>", 'resultsDiv', 'last');
+    dojo.place("<div style='display:none'>" + record.marc() + "</div>", dojo.body(), 'last');
+    dojo.place("<div class='title' id='titleDiv'></div>", 'resultsDiv', 'last');
+    dojo.query("datafield[tag='245'] subfield").forEach(function(node, index, arr) {
+        dojo.place("<span class='title'>" + node.innerHTML + " </span>", '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);
diff --git a/Open-ILS/web/js/ui/default/cat/moveto/faculty_authors.js b/Open-ILS/web/js/ui/default/cat/moveto/faculty_authors.js
new file mode 100644 (file)
index 0000000..807dfc7
--- /dev/null
@@ -0,0 +1,89 @@
+dojo.require('fieldmapper.IDL');
+dojo.require('openils.PermaCrud');
+dojo.require('dojo.date');
+dojo.require('openils.CGI');
+dojo.require('openils.XUL');
+
+var pcrud;
+var pcrudReader;
+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();
+    pcrudReader = 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 = fieldmapper.standardRequest(
+        ['open-ils.search', 'open-ils.search.asset.copy.find_by_barcode'],
+        {params: [barcode]}
+    );
+*/
+    /* Get rid of non-numeric barcode characters - probably need to configure the cheapo scanner */
+    barcode = barcode.replace(/[^0-9]/g, '');
+    copy = pcrud.search('acp', {"barcode":barcode});
+    // There can be only one copy
+    copy = copy[0];
+    if (!copy.location) {
+       dojo.place('<div class="alert">Barcode [' + barcode + '] was not found!</div>', 'resultsDiv', 'only');
+       return;
+    }
+    copy.location(158);
+    copy.ischanged(true);
+    pcrud.update(copy);
+
+    volume = pcrudReader.retrieve("acn", copy.call_number());
+    record = pcrudReader.retrieve("bre", volume.record());
+    dojo.place("<div class='barcode'>" + copy.barcode() + "</div>", 'resultsDiv', 'only');
+    dojo.place("<div class='call_number'>" + volume.label() + "</div>", 'resultsDiv', 'last');
+    dojo.place("<div style='display:none'>" + record.marc() + "</div>", dojo.body(), 'last');
+    dojo.place("<div class='title' id='titleDiv'></div>", 'resultsDiv', 'last');
+    dojo.query("datafield[tag='245'] subfield").forEach(function(node, index, arr) {
+        dojo.place("<span class='title'>" + node.innerHTML + " </span>", '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);
diff --git a/Open-ILS/web/js/ui/default/cat/moveto/lal_circ.js b/Open-ILS/web/js/ui/default/cat/moveto/lal_circ.js
new file mode 100644 (file)
index 0000000..f601bcd
--- /dev/null
@@ -0,0 +1,93 @@
+dojo.require('fieldmapper.IDL');
+dojo.require('openils.PermaCrud');
+dojo.require('dojo.date');
+dojo.require('openils.CGI');
+dojo.require('openils.XUL');
+
+var pcrud;
+var pcrudReader;
+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();
+    pcrudReader = 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 = fieldmapper.standardRequest(
+        ['open-ils.search', 'open-ils.search.asset.copy.find_by_barcode'],
+        {params: [barcode]}
+    );
+*/
+    /* Get rid of non-numeric barcode characters - probably need to configure the cheapo scanner */
+    barcode = barcode.replace(/[^0-9]/g, '');
+    copy = pcrud.search('acp', {"barcode":barcode});
+    // There can be only one copy
+    copy = copy[0];
+    if (!copy.location) {
+       dojo.place('<div class="alert">Barcode [' + barcode + '] was not found!</div>', 'resultsDiv', 'only');
+       return;
+    }
+    copy.location(1);
+    copy.circ_lib(150);
+    copy.ischanged(true);
+    pcrud.update(copy);
+
+    volume = pcrudReader.retrieve("acn", copy.call_number());
+    volume.owning_lib(150);
+    pcrud.update(volume);
+
+    record = pcrudReader.retrieve("bre", volume.record());
+    dojo.place("<div class='barcode'>" + copy.barcode() + "</div>", 'resultsDiv', 'only');
+    dojo.place("<div class='call_number'>" + volume.label() + "</div>", 'resultsDiv', 'last');
+    dojo.place("<div style='display:none'>" + record.marc() + "</div>", dojo.body(), 'last');
+    dojo.place("<div class='title' id='titleDiv'></div>", 'resultsDiv', 'last');
+    dojo.query("datafield[tag='245'] subfield").forEach(function(node, index, arr) {
+        dojo.place("<span class='title'>" + node.innerHTML + " </span>", '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);
diff --git a/Open-ILS/web/js/ui/default/cat/moveto/live_lakes.js b/Open-ILS/web/js/ui/default/cat/moveto/live_lakes.js
new file mode 100644 (file)
index 0000000..1645161
--- /dev/null
@@ -0,0 +1,89 @@
+dojo.require('fieldmapper.IDL');
+dojo.require('openils.PermaCrud');
+dojo.require('dojo.date');
+dojo.require('openils.CGI');
+dojo.require('openils.XUL');
+
+var pcrud;
+var pcrudReader;
+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();
+    pcrudReader = 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 = fieldmapper.standardRequest(
+        ['open-ils.search', 'open-ils.search.asset.copy.find_by_barcode'],
+        {params: [barcode]}
+    );
+*/
+    /* Get rid of non-numeric barcode characters - probably need to configure the cheapo scanner */
+    barcode = barcode.replace(/[^0-9]/g, '');
+    copy = pcrud.search('acp', {"barcode":barcode});
+    // There can be only one copy
+    copy = copy[0];
+    if (!copy.location) {
+       dojo.place('<div class="alert">Barcode [' + barcode + '] was not found!</div>', 'resultsDiv', 'only');
+       return;
+    }
+    copy.location(1230);
+    copy.ischanged(true);
+    pcrud.update(copy);
+
+    volume = pcrudReader.retrieve("acn", copy.call_number());
+    record = pcrudReader.retrieve("bre", volume.record());
+    dojo.place("<div class='barcode'>" + copy.barcode() + "</div>", 'resultsDiv', 'only');
+    dojo.place("<div class='call_number'>" + volume.label() + "</div>", 'resultsDiv', 'last');
+    dojo.place("<div style='display:none'>" + record.marc() + "</div>", dojo.body(), 'last');
+    dojo.place("<div class='title' id='titleDiv'></div>", 'resultsDiv', 'last');
+    dojo.query("datafield[tag='245'] subfield").forEach(function(node, index, arr) {
+        dojo.place("<span class='title'>" + node.innerHTML + " </span>", '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);
diff --git a/Open-ILS/web/js/ui/default/cat/moveto/storage.js b/Open-ILS/web/js/ui/default/cat/moveto/storage.js
new file mode 100644 (file)
index 0000000..0b0681c
--- /dev/null
@@ -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('<div class="alert">Barcode [' + barcode + '] was not found!</div>', '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("<div class='barcode'>" + copy.barcode() + "</div>", 'resultsDiv', 'only');
+    dojo.place("<div class='call_number'>" + volume.label() + "</div>", 'resultsDiv', 'last');
+    dojo.place("<div style='display:none'>" + record.marc() + "</div>", dojo.body(), 'last');
+
+    // Totally dumb title display. Oh well!
+    dojo.place("<div class='title' id='titleDiv'></div>", 'resultsDiv', 'last');
+    dojo.query("datafield[tag='245'] subfield").forEach(function(node, index, arr) {
+        dojo.place("<span class='title'>" + node.innerHTML + " </span>", '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/js/ui/default/cat/moveto/strip.js b/Open-ILS/web/js/ui/default/cat/moveto/strip.js
new file mode 100644 (file)
index 0000000..9a5e645
--- /dev/null
@@ -0,0 +1,90 @@
+dojo.require('fieldmapper.IDL');
+dojo.require('openils.PermaCrud');
+dojo.require('dojo.date');
+dojo.require('openils.CGI');
+dojo.require('openils.XUL');
+
+var pcrud;
+var pcrudReader;
+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();
+    pcrudReader = 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 = fieldmapper.standardRequest(
+        ['open-ils.search', 'open-ils.search.asset.copy.find_by_barcode'],
+        {params: [barcode]}
+    );
+*/
+    /* Get rid of non-numeric barcode characters - probably need to configure the cheapo scanner */
+    barcode = barcode.replace(/[^0-9]/g, '');
+    alert(barcode);
+    copy = pcrud.search('acp', {"barcode":barcode});
+    // There can be only one copy
+    copy = copy[0];
+    if (!copy.location) {
+       dojo.place('<div class="alert">Barcode [' + barcode + '] was not found!</div>', 'resultsDiv', 'only');
+       return;
+    }
+    copy.location(152);
+    copy.ischanged(true);
+    pcrud.update(copy);
+
+    volume = pcrudReader.retrieve("acn", copy.call_number());
+    record = pcrudReader.retrieve("bre", volume.record());
+    dojo.place("<div class='barcode'>" + copy.barcode() + "</div>", 'resultsDiv', 'only');
+    dojo.place("<div class='call_number'>" + volume.label() + "</div>", 'resultsDiv', 'last');
+    dojo.place("<div style='display:none'>" + record.marc() + "</div>", dojo.body(), 'last');
+    dojo.place("<div class='title' id='titleDiv'></div>", 'resultsDiv', 'last');
+    dojo.query("datafield[tag='245'] subfield").forEach(function(node, index, arr) {
+        dojo.place("<span class='title'>" + node.innerHTML + " </span>", '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);