From 06738461fc3096cc9d649e1a1ef949589b120465 Mon Sep 17 00:00:00 2001 From: artunit Date: Wed, 12 Jan 2011 04:42:25 +0000 Subject: [PATCH] display loan duration, change div to span for IE madness git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@1190 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- conifer/integration/uwindsor.py | 17 ++++++++++------- conifer/syrup/models.py | 2 +- conifer/templates/components/site.xhtml | 16 +++++++++++++++- conifer/templates/site_detail.xhtml | 5 +++-- 4 files changed, 29 insertions(+), 11 deletions(-) diff --git a/conifer/integration/uwindsor.py b/conifer/integration/uwindsor.py index 89bf065..72a11a6 100644 --- a/conifer/integration/uwindsor.py +++ b/conifer/integration/uwindsor.py @@ -105,6 +105,7 @@ def _item_status(bib_id): lib = desk = avail = 0 dueinfo = '' callno = '' + circmod = '' for org, callnum, loc, stats in counts: if len(callno) == 0: callno = callnum @@ -123,12 +124,14 @@ def _item_status(bib_id): we want to return the resource that will be returned first if already checked out """ - if loc == RESERVES_DESK_NAME and avail == 0: - for copyid in copyids: - circinfo = E1(OPENSRF_FLESHED2_CALL, copyid) - circs = circinfo.get("circulations") - if circs and avail==0: - if len(circs) > 0: + for copyid in copyids: + circinfo = E1(OPENSRF_FLESHED2_CALL, copyid) + if loc == RESERVES_DESK_NAME: + if len(circmod) == 0: + circmod = circinfo.get("circ_modifier") + if avail == 0: + circs = circinfo.get("circulations") + if circs and len(circs) > 0: circ = circs[0] rawdate = circ.get("due_date") #remove offset info, %z is flakey for some reason @@ -143,7 +146,7 @@ def _item_status(bib_id): dueinfo = time.strftime(DUE_FORMAT,earliestdue) callno = callnum - return (lib, desk, avail, callno, dueinfo) + return (lib, desk, avail, callno, dueinfo, circmod) except: print "due date/call problem: ", bib_id print "*** print_exc:" diff --git a/conifer/syrup/models.py b/conifer/syrup/models.py index 5cf5c7b..3cabd0b 100644 --- a/conifer/syrup/models.py +++ b/conifer/syrup/models.py @@ -750,7 +750,7 @@ class Item(BaseModel): if not stat: return (False, 'Status information not available.') else: - lib, desk, avail, callno, dueinfo = stat + lib, desk, avail, callno, dueinfo, circmod = stat return (avail > 0, '%d of %d copies available at reserves desk; ' '%d total copies in library system' diff --git a/conifer/templates/components/site.xhtml b/conifer/templates/components/site.xhtml index 90021eb..4d6e70a 100644 --- a/conifer/templates/components/site.xhtml +++ b/conifer/templates/components/site.xhtml @@ -39,11 +39,25 @@ searchtext = _('search this site...') ?>
-
${_avail and 'Available' or 'Unavailable'} (${_avail}/${_desk})
DUE: ${_dueinfo}
+
+ 2 Hour Loan + 3 Hour Loan + 4 Hour Loan + 7 Hour Loan + 1 Day Loan + 1 Hour Loan + 14 Day Loan + 2 Day Loan + 2 Hour Loan + 3 Day Loan + 4 Hour Loan + 7 Day Loan +
${_callno}
diff --git a/conifer/templates/site_detail.xhtml b/conifer/templates/site_detail.xhtml index 0573436..c7e7e58 100644 --- a/conifer/templates/site_detail.xhtml +++ b/conifer/templates/site_detail.xhtml @@ -30,9 +30,10 @@ is_joinable = site.is_joinable_by(request.user)

There are no items associated with this site yet.

-
+ + ${show_tree(item_tree, edit=is_editor)} -
+
${add_subs()}
-- 2.11.0