From: artunit Date: Tue, 18 Jan 2011 02:25:43 +0000 (+0000) Subject: first draft of handling multi-volume sets, sync status info in full display X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3f48b6692ba7c3a9c9a5188736a6c91bcd96a828;p=syrup%2Fmasslnc.git first draft of handling multi-volume sets, sync status info in full display git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@1201 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- diff --git a/conifer/integration/uwindsor.py b/conifer/integration/uwindsor.py index 3c89bca..34c2b5a 100644 --- a/conifer/integration/uwindsor.py +++ b/conifer/integration/uwindsor.py @@ -102,20 +102,34 @@ def _item_status(bib_id): if bib_id: try: counts = E1(OPENSRF_COPY_COUNTS, bib_id, 1, 0) - lib = desk = avail = 0 + lib = desk = avail = vol = 0 dueinfo = '' callno = '' circmod = '' for org, callnum, loc, stats in counts: + callprefix = '' + callsuffix = '' if len(callno) == 0: callno = callnum avail_here = stats.get(AVAILABLE, 0) avail_here += stats.get(RESHELVING, 0) anystatus_here = sum(stats.values()) + + """ + volume check - based on v.1, etc. in call number + """ + voltest = re.search(r'\w*v\.\s?(\d+)', callnum) + if loc == RESERVES_DESK_NAME: desk += anystatus_here avail += avail_here - callno = callnum + if voltest and vol > 0: + if (int(voltest.group(1)) > vol): + callsuffix = "/" + callnum + else: + callprefix = callnum + "/" + else: + callno = callnum dueinfo = '' lib += anystatus_here copyids = E1(OPENSRF_CN_CALL, bib_id, callnum, org) @@ -129,7 +143,7 @@ def _item_status(bib_id): if loc == RESERVES_DESK_NAME: if len(circmod) == 0: circmod = circinfo.get("circ_modifier") - if avail == 0: + if avail == 0 or (voltest and callno.find(voltest.group(0)) == -1): circs = circinfo.get("circulations") if circs and len(circs) > 0: circ = circs[0] @@ -137,15 +151,34 @@ def _item_status(bib_id): #remove offset info, %z is flakey for some reason rawdate = rawdate[:-5] duetime = time.strptime(rawdate, TIME_FORMAT) - if len(dueinfo) == 0: + if len(dueinfo) == 0 or voltest: earliestdue = duetime - dueinfo = time.strftime(DUE_FORMAT,earliestdue) - callno = callnum - if duetime < earliestdue: + if voltest: + if (int(voltest.group(1)) > vol): + if len(dueinfo) > 0: + dueinfo = dueinfo + "/" + dueinfo = dueinfo + voltest.group(0) + ': ' + time.strftime(DUE_FORMAT,earliestdue) + else: + tmpinfo = dueinfo + dueinfo = voltest.group(0) + ': ' + time.strftime(DUE_FORMAT,earliestdue) + if len(tmpinfo) > 0: + dueinfo = dueinfo + "/" + dueinfo + callprefix = callsuffix = '' + else: + dueinfo = time.strftime(DUE_FORMAT,earliestdue) + + if not voltest: + callno = callnum + + # way too wacky to sort out vols for this + if duetime < earliestdue and not voltest: earliestdue = duetime dueinfo = time.strftime(DUE_FORMAT,earliestdue) callno = callnum + if voltest: + callno = callprefix + callno + callsuffix + vol = int(voltest.group(1)) return (lib, desk, avail, callno, dueinfo, circmod) except: print "due date/call problem: ", bib_id diff --git a/conifer/templates/components/site.xhtml b/conifer/templates/components/site.xhtml index 8a5e8d7..10583f1 100644 --- a/conifer/templates/components/site.xhtml +++ b/conifer/templates/components/site.xhtml @@ -44,7 +44,6 @@ searchtext = _('search this site...') class="${_avail > 0 and 'available' or 'unavailable'}" title="${_avail} of ${_desk} copies available at reserves desk; ${_lib} total copies in library system">
${_avail and 'Available' or 'Unavailable'} (${_avail}/${_desk})
-
DUE: ${_dueinfo}
2 Hour Loan 3 Day Loan @@ -60,12 +59,16 @@ searchtext = _('search this site...') 7 Day Loan
${_callno}
- -
- Availability unknown. -
${item.call_number()}
-
- +
DUE: ${_dueinfo}
+ + +
+ Availability unknown. +
${item.call_number()}
+ +
+ +
diff --git a/conifer/templates/item/item_metadata.xhtml b/conifer/templates/item/item_metadata.xhtml index 4bc550b..6788ded 100644 --- a/conifer/templates/item/item_metadata.xhtml +++ b/conifer/templates/item/item_metadata.xhtml @@ -52,9 +52,44 @@ callnum = item.call_number() Issue${item.issue} Pages${item.pages} ISBN${item.isbn} + Copyright status${item.get_copyright_status_display()} Type${item.get_item_type_display()} + + + Call Number (take this to the counter) + +
DUE: ${_dueinfo}
+
${_callno}
+
+ 2 Hour Loan + 3 Day Loan + 4 Day Loan + 7 Day 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 +
+ +
+ Availability unknown. +
${item.call_number()}
+ +
+ + Status
${status}