[open-ils-commits] r1198 - in servres/trunk/conifer: integration syrup/views templates/item (artunit)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Jan 16 00:17:33 EST 2011
Author: artunit
Date: 2011-01-16 00:17:30 -0500 (Sun, 16 Jan 2011)
New Revision: 1198
Modified:
servres/trunk/conifer/integration/uwindsor.py
servres/trunk/conifer/syrup/views/items.py
servres/trunk/conifer/templates/item/common_metadata.xhtml
Log:
support for barcode searching, expose bib_id in item edit
Modified: servres/trunk/conifer/integration/uwindsor.py
===================================================================
--- servres/trunk/conifer/integration/uwindsor.py 2011-01-14 22:08:17 UTC (rev 1197)
+++ servres/trunk/conifer/integration/uwindsor.py 2011-01-16 05:17:30 UTC (rev 1198)
@@ -156,6 +156,7 @@
def cat_search(query, start=1, limit=10):
bibid=0
+ bc = re.search('\d{14}', query.strip())
if query.startswith(EG_BASE):
# query is an Evergreen URL
# snag the bibid at this point
@@ -165,6 +166,17 @@
bibid = params[key]
results = M.marcxml_to_records(I.url_to_marcxml(query))
numhits = len(results)
+ elif bc:
+ results = []
+ numhits = 0
+ bib = E1('open-ils.search.bib_id.by_barcode', bc.group(0))
+ if bib:
+ copy = E1('open-ils.supercat.record.object.retrieve', bib)
+ rec = copy[0]
+ marc = unicode(rec['marc'], 'utf-8')
+ tree = M.marcxml_to_records(marc)[0]
+ results.append(tree)
+ numhits = 1
else:
# query is an actual query
if USE_Z3950:
Modified: servres/trunk/conifer/syrup/views/items.py
===================================================================
--- servres/trunk/conifer/syrup/views/items.py 2011-01-14 22:08:17 UTC (rev 1197)
+++ servres/trunk/conifer/syrup/views/items.py 2011-01-16 05:17:30 UTC (rev 1198)
@@ -298,7 +298,6 @@
author=dublin.get('dc:creator'),
publisher=dublin.get('dc:publisher',''),
published=pubdate,
- bib_id=request.POST.get('bibid'),
marcxml=raw_pickitem,
**dct)
item.save()
Modified: servres/trunk/conifer/templates/item/common_metadata.xhtml
===================================================================
--- servres/trunk/conifer/templates/item/common_metadata.xhtml 2011-01-14 22:08:17 UTC (rev 1197)
+++ servres/trunk/conifer/templates/item/common_metadata.xhtml 2011-01-16 05:17:30 UTC (rev 1198)
@@ -23,6 +23,7 @@
<tr><th>Issue</th><td><input type="text" name="issue" value="${item.issue}"/></td></tr>
<tr><th>Pages</th><td><input type="text" name="pages" value="${item.pages}"/></td></tr>
<tr><th>ISBN</th><td><input type="text" name="isbn" value="${item.isbn}"/></td></tr>
+ <tr><th>Bib Id of Item</th><td><input type="text" name="bib_id" value="${item.bib_id}"/></td></tr>
<tr py:if="user.is_staff and item.item_type == 'ELEC'">
<th>Copyright Status</th>
<td>
@@ -36,4 +37,4 @@
</tr>
</tbody>
-</html>
\ No newline at end of file
+</html>
More information about the open-ils-commits
mailing list