[open-ils-commits] r246 - in servres/trunk/conifer: libsystems/evergreen syrup templates/phys (gfawcett)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Apr 2 21:31:07 EDT 2009
Author: gfawcett
Date: 2009-04-02 21:31:06 -0400 (Thu, 02 Apr 2009)
New Revision: 246
Modified:
servres/trunk/conifer/libsystems/evergreen/item_status.py
servres/trunk/conifer/syrup/views.py
servres/trunk/conifer/templates/phys/checkout.xhtml
Log:
fleshed out mockup of patron item-checkout screen.
Modified: servres/trunk/conifer/libsystems/evergreen/item_status.py
===================================================================
--- servres/trunk/conifer/libsystems/evergreen/item_status.py 2009-04-03 01:30:56 UTC (rev 245)
+++ servres/trunk/conifer/libsystems/evergreen/item_status.py 2009-04-03 01:31:06 UTC (rev 246)
@@ -23,4 +23,7 @@
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))
Modified: servres/trunk/conifer/syrup/views.py
===================================================================
--- servres/trunk/conifer/syrup/views.py 2009-04-03 01:30:56 UTC (rev 245)
+++ servres/trunk/conifer/syrup/views.py 2009-04-03 01:31:06 UTC (rev 246)
@@ -1219,4 +1219,30 @@
@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)
+
Modified: servres/trunk/conifer/templates/phys/checkout.xhtml
===================================================================
--- servres/trunk/conifer/templates/phys/checkout.xhtml 2009-04-03 01:30:56 UTC (rev 245)
+++ servres/trunk/conifer/templates/phys/checkout.xhtml 2009-04-03 01:31:06 UTC (rev 246)
@@ -8,27 +8,46 @@
<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>
More information about the open-ils-commits
mailing list