More handling for call no prefix/suffix parms.
authorArt Rhyno <art632000@yahoo.ca>
Sat, 9 Jul 2011 23:20:43 +0000 (19:20 -0400)
committerArt Rhyno <art632000@yahoo.ca>
Sat, 9 Jul 2011 23:20:43 +0000 (19:20 -0400)
Signed-off-by: Art Rhyno <art632000@yahoo.ca>
conifer/integration/evergreen_site.py
conifer/syrup/views/sites.py
conifer/templates/components/site.xhtml

index 284a41e..e822933 100644 (file)
@@ -169,7 +169,7 @@ class EvergreenIntegration(object):
     @memoize(timeout=CACHE_TIME)
     def _item_status(self, bib_id):
         def sort_out_status(counts, version, sort_lib, sort_desk, sort_avail, 
-            sort_callno, sort_dueinfo, sort_circmod, sort_alldues):
+            sort_callno, sort_dueinfo, sort_circmod, sort_alldues, prefix, suffix):
 
             lib = sort_lib
             desk = sort_desk
@@ -189,6 +189,11 @@ class EvergreenIntegration(object):
                 callsuffix = ''
                 if len(callno) == 0:
                     callno = callnum
+
+                if prefix:
+                    callno = prefix + callno
+                if suffix:
+                    callno = callno + suffix
                 avail_here = stats.get(self.AVAILABLE, 0)
                 avail_here += stats.get(self.RESHELVING, 0)
                 anystatus_here = sum(stats.values())
@@ -328,9 +333,13 @@ class EvergreenIntegration(object):
 
         #TODO: clean this up, a hackish workaround for now
         if version >= 2.1:
-            for org, skip1, callnum, skip2, loc, stats in counts:
+            for org, prefix, callnum, suffix, loc, stats in counts:
+                if len(prefix) > 0:
+                    prefix += ' '
+                if len(suffix) > 0:
+                    suffix = ' ' + suffix
                 lib, desk, avail, callno, dueinfo, circmod, alldues = sort_out_status(counts, 
-                    version, lib, desk, avail, callno, dueinfo, circmod, alldues)
+                    version, lib, desk, avail, callno, dueinfo, circmod, alldues, prefix, suffix)
         else:
             for org, callnum, loc, stats in counts:
                 lib, desk, avail, callno, dueinfo, circmod, alldues = sort_out_status(counts, 
index 2efc4f4..0a1736c 100644 (file)
@@ -283,6 +283,7 @@ def _revert_parms(request, source_site):
             if barcode and orig_call and orig_desk and orig_modifier:
                 update_status = opensrf.ils_item_update(barcode, orig_prefix, orig_call,
                                     orig_suffix, orig_modifier, orig_desk)
+                # print "update_status", update_status
         if update_status:
             for sub in subitems:
                 revert_item(parent, sub)
index 90ccff6..3b1e482 100644 (file)
@@ -118,12 +118,24 @@ searchtext = _('search this site...')
                <span py:if="item.source_title"><i>${item.source_title}.</i></span>
                <span py:if="item.volume or item.issue"><i>${item.volume}</i>(${item.issue}), ${item.pages}.</span>
                  <div py:if="edit and user.is_staff">
-            <span><i>Source: </i></span>
-                   <span py:if="item.circ_modifier">${item.circ_modifier}, </span>
-                   <span py:if="item.orig_prefix">${item.orig_prefix}, </span>
-                   <span py:if="item.orig_callno">${item.orig_callno}, </span>
-                   <span py:if="item.orig_suffix">${item.orig_suffix}, </span>
-                   <span py:if="item.circ_desk">desk - ${item.circ_desk}</span>
+            <span><i>Revert Parms: </i></span>
+                   <span py:for="k,v in item.CALLNO_PREFIX_CHOICES">
+                <span py:if="int(item.orig_prefix)==int(k)">
+                   ${v} 
+                </span>
+            </span>
+                   <span py:if="item.orig_callno">${item.orig_callno}</span>
+                   <span py:for="k,v in item.CALLNO_SUFFIX_CHOICES">
+                <span py:if="int(item.orig_suffix)==int(k)">
+                   ${v} 
+                </span>
+            </span>
+                   <span py:if="item.circ_modifier">(${item.circ_modifier}) </span>
+                   <span py:for="k,v in item.CIRC_DESK_CHOICES">
+                <span py:if="item.circ_desk==k">
+                   ${v} 
+                </span>
+            </span>
                  </div>
       </div>
       <div class="forbidden_notice" py:if="forbidden">Awaiting copyright clearance: Not available to students.</div>
@@ -140,7 +152,7 @@ searchtext = _('search this site...')
                  </span>
                </div>
          </div>
-      <!-- !to show a full tree, uncomment the following: -->
+      <!-- !to hide the full tree, comment the following: -->
       ${show_tree(subs, edit)}
     </li>
     </span>