when reverting circ parameters.
Signed-off-by: Art Rhyno <art632000@yahoo.ca>
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 = ''
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)
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
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':
<ul py:def="show_tree(tree, edit=False)"
py:if="tree"
class="itemtree">
- <li py:for="item, subs in tree" py:with="forbidden=not item.copyright_status_ok()" class="item_${item.item_type} an_item ${forbidden and 'forbidden' or ''}"
+ <span py:for="item, subs in tree" py:with="forbidden=not item.copyright_status_ok()">
+ <li py:if="not item.suppress_item or user.is_staff" class="item_${item.item_type} an_item ${forbidden and 'forbidden' or ''}"
id="item_${item.id}">
<abbr py:if="not item.item_type=='HEADING'" class="unapi-id" title="${item.id}"/>
<?python
src="${ROOT}/static/tango/lock.png"/></span>
<a href="${item.item_url()}" class="mainlink"
py:strip="item.item_type=='ELEC' and not downloads_allowed">${item}</a>
+ <span py:if="item.suppress_item">[additional copy - not displayed]</span>
</div>
<div class="author_pub" py:if="item.author or item.publisher or item.published">
<span py:with="vt=item.video_type()"><span class="videotype" py:if="vt">[${vt}]</span></span>
<span py:if="item.published">(${item.published}).</span>
<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">
+ <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_callno">${item.orig_callno}, </span>
<!-- !to show a full tree, uncomment the following: -->
${show_tree(subs, edit)}
</li>
+ </span>
</ul>
<ul py:def="heading_tree(tree, stop_at=None)" class="heading_tree">
<tr><th>ISBN</th><td><input type="text" name="isbn" value="${item.isbn}"/></td></tr>
<tr><th>Bib Id of Item</th><td><input type="text" name="bib_id" value="${item.bib_id}"/></td></tr>
<tr><th>Item Notes</th><td><textarea rows="3" name="itemnotes">${item.itemnotes}</textarea></td></tr>
+ <tr><th>Suppress Item</th><td><input type="checkbox" name="suppress_item"
+ py:attrs="{'checked': item.suppress_item==True or None}"/></td></tr>
<tr py:if="user.is_staff and item.item_type == 'ELEC'">
<th>Copyright Status</th>
<td>