fleshed out mockup of patron item-checkout screen.
authorgfawcett <gfawcett@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Fri, 3 Apr 2009 01:31:06 +0000 (01:31 +0000)
committergfawcett <gfawcett@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Fri, 3 Apr 2009 01:31:06 +0000 (01:31 +0000)
git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@246 6d9bc8c9-1ec2-4278-b937-99fde70a366f

conifer/libsystems/evergreen/item_status.py
conifer/syrup/views.py
conifer/templates/phys/checkout.xhtml

index f8b725b..4d5f34e 100644 (file)
@@ -23,4 +23,7 @@ def lookup_availability(bib_id):
 
 if __name__ == '__main__':
     DYLAN = 1321798
-    print lookup_availability(DYLAN)
+    #print lookup_availability(DYLAN)
+
+    MISCHIEF = 2063351
+    pprint(E1('open-ils.search.biblio.record.mods_slim.retrieve', MISCHIEF))
index dbdb7dc..f2c46ae 100644 (file)
@@ -1219,4 +1219,30 @@ def phys_index(request):
 
 @admin_only                     # fixme, is this the right permission?
 def phys_checkout(request):
-    return g.render('phys/checkout.xhtml')
+    if request.method != 'POST':
+        return g.render('phys/checkout.xhtml', step=1)
+    else:
+        post = lambda k: request.POST.get(k, '').strip()
+        patron, item = post('patron'), post('item')
+        if post('step') == '1':
+            # patron entered, need item
+            patron_descrip = 'Fred Example, Jr.' # fixme, lookup
+            return g.render('phys/checkout.xhtml', step=2, 
+                            patron=patron, 
+                            patron_descrip=patron_descrip)
+        elif post('step') == '2':
+            # patron + item. do SIP calls.
+            # log the checkout in a local table.
+            patron_descrip = 'Fred Example, Jr.' # fixme, lookup
+            item_descrip   = 'War and Peace (Reader\'s Digest edition)'
+            return g.render('phys/checkout.xhtml', step=3, 
+                            patron=patron, item=item,
+                            patron_descrip=patron_descrip,
+                            item_descrip=item_descrip)
+        elif post('step') == '3':
+            # continue after checkout. Go to 'checkout another item'.
+            patron_descrip = 'Fred Example, Jr.' # fixme, lookup
+            return g.render('phys/checkout.xhtml', step=2, 
+                            patron=patron,
+                            patron_descrip=patron_descrip)
+        
index 67b7e56..9da8221 100644 (file)
@@ -8,27 +8,46 @@ title = _('Patron Checkout of Item')
 <head>
   <title>${title}</title>
   <script>
-    $(function() { $('#patron').focus(); });
+    $(function() { $('form:last input:visible:nth(0)').focus(); });
   </script>
 </head>
 <body>
   <h1>${title}</h1>
   <form action="." method="POST">
-    <table>
-      <tr>
+    <input type="hidden" name="step" value="${step}"/>
+    <div>
+    <table class="metadata_table">
+      <tr py:choose="defined('patron')">
        <th>Patron Barcode</th>
-       <td><input type="text" id="patron" name="patron" style="width: 400;"/></td>
+       <td py:when="False">
+         <input type="text" id="patron" name="patron" style="width: 400;"/>
+       </td>
+       <td py:when="True">
+           ${patron}: ${patron_descrip}
+           <input type="hidden" name="patron" value="${patron}"/>
+       </td>
       </tr>
-      <tr>
+      <tr py:if="step>1" py:choose="defined('item')">
        <th>Item Barcode</th>
-       <td><input type="text" name="item" style="width: 400;"/></td>
+       <td py:when="False">
+         <input type="text" id="item" name="item" style="width: 400;"/>
+       </td>
+       <td py:when="True">
+         ${item}: ${item_descrip}
+         <input type="hidden" name="item" value="${item}"/>
+       </td>
+      </tr>
+      <tr py:if="step==3">
+       <th/>
+       <td><b>Success: Item Checked Out.</b></td>
       </tr>
       <tr>
        <th/>
-       <td><input type="submit" value="Request Checkout"/></td>
+       <td><input type="submit" value="Continue"/></td>
       </tr>
     </table>
-      
+  </div>
+
   </form>
 
 </body>