[open-ils-commits] [GIT] Evergreen ILS branch master updated. 01c32c5c1c7fc3a5e99b7c5fb50129ca051886d5

Evergreen Git git at git.evergreen-ils.org
Thu Nov 5 10:03:29 EST 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  01c32c5c1c7fc3a5e99b7c5fb50129ca051886d5 (commit)
      from  6c213488d321398e252394c7d33b1ec775ac829d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 01c32c5c1c7fc3a5e99b7c5fb50129ca051886d5
Author: Adam Bowling <abowling at emeralddata.net>
Date:   Mon Jan 19 12:05:19 2015 -0500

    LP#1406387 Fix for Holds Placement Advanced Options
    
    In the staff client, when placing a hold and clicking
    Advanced Hold Options, the barcode input will populate
    with the staff member's barcode if it was previously
    empty, regardless of whether the radio input for the
    hold was specified for a patron or the staff member.
    
    This patch corrects that behavior, and also populates
    the input radio on load after clicking Advanced Hold
    Options.
    
    Signed-off-by: Adam Bowling <abowling at emeralddata>
    Signed-off-by: Michael Peters <mpeters at emeralddata.net>
    Signed-off-by: Terran McCanna <tmccanna at georgialibraries.org>
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/Open-ILS/src/templates/opac/parts/place_hold.tt2 b/Open-ILS/src/templates/opac/parts/place_hold.tt2
index 467e02b..e9fc008 100644
--- a/Open-ILS/src/templates/opac/parts/place_hold.tt2
+++ b/Open-ILS/src/templates/opac/parts/place_hold.tt2
@@ -16,7 +16,18 @@
             redirect = redirect.replace('^http:', 'https:') 
         %]
         <input type="hidden" name="redirect_to" value="[% redirect | html %]" />
-        <input type="hidden" name="hold_source_page" value="[% CGI.param('hold_source_page') | html %]" />
+        [%
+            usr_barcode = CGI.param('usr_barcode') | html;
+            is_requestor = CGI.param('is_requestor');
+
+           IF is_requestor == '';
+               is_requestor = '0';
+           END;
+
+           IF is_requestor == '0' && usr_barcode == ctx.staff_recipient.card.barcode;
+               usr_barcode = '';
+           END;
+        %]
 
         [% IF ctx.is_staff %]
         <p class="staff-hold">
@@ -28,7 +39,7 @@
                 [% l("Place hold for patron by barcode:") %]
             </label>
             <input type="text" name="hold_usr" id="hold_usr_input" 
-              value="[% CGI.param('usr_barcode') | html %]"
+              value="[% usr_barcode | html %]" 
               onchange="staff_hold_usr_barcode_changed();" 
               onpaste="setTimeout(staff_hold_usr_barcode_changed,1);" 
               onkeypress="return no_hold_submit(event)" autofocus /> 
diff --git a/Open-ILS/web/js/ui/default/opac/staff.js b/Open-ILS/web/js/ui/default/opac/staff.js
index d281ca2..fff3aea 100644
--- a/Open-ILS/web/js/ui/default/opac/staff.js
+++ b/Open-ILS/web/js/ui/default/opac/staff.js
@@ -42,6 +42,13 @@ function staff_hold_usr_barcode_changed(isload) {
     }
 
     if (!window.xulG) return;
+ 
+    var adv_link = document.getElementById('advanced_hold_link');
+    if (adv_link) {
+        adv_link.setAttribute('href', adv_link.getAttribute('href').replace(/&?is_requestor=[01]/,''));
+        var is_requestor = document.getElementById('hold_usr_is_requestor').checked ? 1 : 0;
+        adv_link.setAttribute('href', adv_link.getAttribute('href') + '&is_requestor=' + is_requestor.toString());
+    }
 
     var cur_hold_barcode = undefined;
     var barcode = isload;
@@ -156,6 +163,21 @@ window.onload = function() {
     // record details page events
 
     setTimeout(function() {
+
+        if (location.href.match(/is_requestor=[01]/)) {
+            var loc = location.href;
+            var is_req_match = new RegExp("is_requestor=[01]");
+            var is_req = is_req_match.exec(loc).toString();
+            is_req = is_req.replace(/is_requestor=/, '');
+            if (is_req == "1") {
+                document.getElementById('hold_usr_is_requestor').checked = 'checked';
+                document.getElementById('hold_usr_input').disabled = true;
+            } else {
+                document.getElementById('hold_usr_is_requestor_not').checked = 'checked';
+                document.getElementById('hold_usr_input').disabled = false;
+            }
+        }
+
         var rec = location.href.match(/\/opac\/record\/(\d+)/);
         if(rec && rec[1]) { 
             runEvt('rdetail', 'recordRetrieved', rec[1]); 

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/templates/opac/parts/place_hold.tt2 |   15 +++++++++++++--
 Open-ILS/web/js/ui/default/opac/staff.js         |   22 ++++++++++++++++++++++
 2 files changed, 35 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list