From: Art Rhyno Date: Fri, 24 Jun 2011 04:06:28 +0000 (-0400) Subject: Support for suppressing items, needed for multiple copies X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=dacf17dadc18a109d467dff7bb493557f7bc78d6;p=syrup%2Fmasslnc.git Support for suppressing items, needed for multiple copies when reverting circ parameters. Signed-off-by: Art Rhyno --- diff --git a/conifer/integration/evergreen_site.py b/conifer/integration/evergreen_site.py index 32f6e76..51e3105 100644 --- a/conifer/integration/evergreen_site.py +++ b/conifer/integration/evergreen_site.py @@ -175,7 +175,7 @@ class EvergreenIntegration(object): assert self.RESERVES_DESK_NAME, 'No RESERVES_DESK_NAME specified!' try: counts = E1(OPENSRF_COPY_COUNTS, bib_id, 1, 0) - lib = desk = avail = vol = 0 + lib = desk = avail = vol = anystatus_here = 0 dueinfo = '' callno = '' circmod = '' @@ -189,6 +189,7 @@ class EvergreenIntegration(object): avail_here = stats.get(self.AVAILABLE, 0) avail_here += stats.get(self.RESHELVING, 0) anystatus_here = sum(stats.values()) + lib += anystatus_here # volume check - based on v.1, etc. in call number voltest = re.search(r'\w*v\.\s?(\d+)', callnum) @@ -214,7 +215,6 @@ class EvergreenIntegration(object): else: callno = callnum - lib += anystatus_here copyids = E1(OPENSRF_CN_CALL, bib_id, callnum, org) # we want to return the resource that will be returned first if diff --git a/conifer/syrup/views/items.py b/conifer/syrup/views/items.py index b3a36c2..3fdecb1 100644 --- a/conifer/syrup/views/items.py +++ b/conifer/syrup/views/items.py @@ -383,11 +383,19 @@ def item_edit(request, site_id, item_id): location_option = request.POST.get('location_option') modifier_option = request.POST.get('modifier_option') callno_option = request.POST.get('orig_callno') + suppress_option = request.POST.get('suppress_item') update_status = True if update_option == 'Cat': update_status = opensrf.ils_item_update(item.barcode, callno_option, modifier_option, location_option) + # we need to carry over suppress flag for instances where a call number + # is modified for a second copy - this might be a common workflow + if suppress_option == None: + item.suppress_item = False + else: + item.suppress_item = True + item.save() #leave values alone if update failed if update_status and update_option == 'One': diff --git a/conifer/templates/components/site.xhtml b/conifer/templates/components/site.xhtml index df15e54..eb1c2e6 100644 --- a/conifer/templates/components/site.xhtml +++ b/conifer/templates/components/site.xhtml @@ -30,7 +30,8 @@ searchtext = _('search this site...')