Cleaner, less shameful implementation
authordbs <dbs@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Thu, 22 Jul 2010 15:09:12 +0000 (15:09 +0000)
committerdbs <dbs@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Thu, 22 Jul 2010 15:09:12 +0000 (15:09 +0000)
git-svn-id: svn://svn.open-ils.org/ILS-Contrib/conifer/branches/rel_1_6_0@932 6d9bc8c9-1ec2-4278-b937-99fde70a366f

web/js/ui/default/cat/storage/move.js
web/templates/default/cat/storage/move.tt2

index fb0c5ed..8704e63 100644 (file)
@@ -1,13 +1,5 @@
-dojo.require('dojo.data.ItemFileReadStore');
-dojo.require('dijit.form.Textarea');
-dojo.require('dijit.form.FilteringSelect');
-dojo.require('dijit.form.ComboBox');
-dojo.require('fieldmapper.IDL');
+ojo.require('fieldmapper.IDL');
 dojo.require('openils.PermaCrud');
-dojo.require('openils.widget.AutoGrid');
-dojo.require('openils.widget.AutoFieldWidget');
-dojo.require('dijit.form.CheckBox');
-dojo.require('dijit.form.Button');
 dojo.require('dojo.date');
 dojo.require('openils.CGI');
 dojo.require('openils.XUL');
@@ -34,7 +26,7 @@ function load() {
         if(xulG.usr !== null) userId = xulG.usr
         if(xulG.params) {
             var parms = xulG.params;
-            if(parms.ses) 
+            if(parms.ses)
                 openils.User.authtoken = parms.ses;
             if(parms.usr !== null)
                 userId = parms.usr
@@ -53,20 +45,27 @@ function moveCopy(barcode) {
 
     copy = pcrud.search("acp", {"barcode": barcode});
     if (!copy) {
-       alert('Barcode [' + barcode + '] was not found!');
+       dojo.place('<div class="alert">Barcode [' + barcode + '] was not found!</div>', 'resultsDiv', 'only');
        return;
     }
     copy = fieldmapper.standardRequest(
         ['open-ils.search', 'open-ils.search.asset.copy.find_by_barcode'],
         {params: [barcode]}
     );
-    copy.location(1);
+    copy.location(152);
     copy.ischanged(1);
     pcrud.update(copy);
 
     volume = pcrud.retrieve("acn", copy.call_number());
     record = pcrud.retrieve("bre", volume.record());
-    alert(copy.barcode() + " " + volume.label() + " " + record.marc());
+    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.query("datafield[tag='245'] subfield[code='a']").forEach(function(node, index, arr) {
+        dojo.place("<div class='title'>" + node.innerHTML + "</div>", 'resultsDiv', 'last')
+    });
 }
 
 function moveCopyRefresh() {
@@ -77,8 +76,9 @@ function moveCopyRefresh() {
 }
 
 function moveCopyRefreshXUL(newuser) {
-    if (window.xulG && typeof window.xulG.on_save == 'function') 
+    if (window.xulG && typeof window.xulG.on_save == 'function')
         window.xulG.on_save(newuser);
 }
 
 openils.Util.addOnLoad(load);
+                                                                                                                                                               1,1           Top
index e183bb6..a3bc69c 100644 (file)
@@ -1,52 +1,23 @@
 [% ctx.page_title = 'Move item to storage' %]
-[% WRAPPER default/base.tt2 %]
-<script src='[% ctx.media_prefix %]/js/ui/default/cat/storage/storage.js'> </script>
+[% WRAPPER base.tt2 %]
+<script src='[% ctx.media_prefix %]/js/ui/default/cat/storage/move.js'> </script>
 
 <style>
 
-    /* XXX Move me into the CSS tree XXX */
-
-    #uedit-tbody tr td {
-        padding: 5px;
-        text-align: left;
-    }
-
-
-    #uedit-save-div {
-        position: fixed;
-        top:40px;
-        right:30px;
-        width:300px;
-        border:2px solid #d9e8f9;
-        -moz-border-radius: 10px;
-        font-weight: bold;
-        padding: 12px;
-        text-align:center;
-        vertical-align:middle;
-    }
-
-    .divider td {
-        min-height:10px;
-        background-color: #e0e0e0;
-    }
-
-    .divider span { padding: 0px 5px 0px 5px; }
-
     .dijitTextBoxFocused, .dijitFocused { border:1px dashed #3e3e3e; color: #303030; font-weight:bold;}
 
 </style>
 
-<form method="get" action="/eg/cat/storage/storage">
-     <table>
+<h1 style="font-weight: bold;">Move item to storage</h1>
+<form method="get" action="/eg/cat/storage/move">
+     <table style="margin-top: 2em;">
       <tr>
-        <td><label for="barcode">Barcode</label></td>
-        <td><input type="text" id="barcode" name="barcode" dojoType="dijit.form.TextBox"/></td>
+        <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='uedit-save-div'>
-    <button dojoType='dijit.form.Button' jsId='saveButton' onClick='moveCopySubmit'>Submit</button>
-</div>
+<div id="resultsDiv"></div>
 
 [% END %]
-