[open-ils-commits] r1189 - servres/trunk/conifer/integration (artunit)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Jan 10 23:01:26 EST 2011


Author: artunit
Date: 2011-01-10 23:01:23 -0500 (Mon, 10 Jan 2011)
New Revision: 1189

Modified:
   servres/trunk/conifer/integration/uwindsor.py
Log:
reshelving means available at reserves desk

Modified: servres/trunk/conifer/integration/uwindsor.py
===================================================================
--- servres/trunk/conifer/integration/uwindsor.py	2011-01-11 02:13:32 UTC (rev 1188)
+++ servres/trunk/conifer/integration/uwindsor.py	2011-01-11 04:01:23 UTC (rev 1189)
@@ -71,6 +71,7 @@
 STATUS_DECODE = [(str(x['id']), x['name']) 
                  for x in E1('open-ils.search.config.copy_status.retrieve.all')]
 AVAILABLE = [id for id, name in STATUS_DECODE if name == 'Available'][0]
+RESHELVING = [id for id, name in STATUS_DECODE if name == 'Reshelving'][0]
 
 RESERVES_DESK_NAME = 'Leddy: Course Reserves - Main Bldng - 1st Flr - Reserve Counter at Circulation Desk'
 
@@ -108,6 +109,7 @@
 		if len(callno) == 0:
 			callno = callnum
                 avail_here = stats.get(AVAILABLE, 0)
+                avail_here += stats.get(RESHELVING, 0)
                 anystatus_here = sum(stats.values())
                 if loc == RESERVES_DESK_NAME:
                     desk += anystatus_here
@@ -121,24 +123,25 @@
 		we want to return the resource that will be returned first if
 		already checked out
 		"""
-		for copyid in copyids:
-			circinfo = E1(OPENSRF_FLESHED2_CALL, copyid)
-			circs = circinfo.get("circulations")
-			if circs and avail==0:
-				if len(circs) > 0:
-					circ = circs[0]
-					rawdate = circ.get("due_date")
-					#remove offset info, %z is flakey for some reason
-					rawdate = rawdate[:-5]
-					duetime = time.strptime(rawdate, TIME_FORMAT)
-					if len(dueinfo) == 0:
-						earliestdue = duetime
-						dueinfo = time.strftime(DUE_FORMAT,earliestdue)
-						callno = callnum
-					if duetime < earliestdue:
-						earliestdue = duetime
-						dueinfo = time.strftime(DUE_FORMAT,earliestdue)
-						callno = callnum
+                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:
+						circ = circs[0]
+						rawdate = circ.get("due_date")
+						#remove offset info, %z is flakey for some reason
+						rawdate = rawdate[:-5]
+						duetime = time.strptime(rawdate, TIME_FORMAT)
+						if len(dueinfo) == 0:
+							earliestdue = duetime
+							dueinfo = time.strftime(DUE_FORMAT,earliestdue)
+							callno = callnum
+						if duetime < earliestdue:
+							earliestdue = duetime
+							dueinfo = time.strftime(DUE_FORMAT,earliestdue)
+							callno = callnum
 					
             return (lib, desk, avail, callno, dueinfo)
 	except:



More information about the open-ils-commits mailing list