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

Evergreen Git git at git.evergreen-ils.org
Wed Aug 2 11:44:24 EDT 2017


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  ccb7382c52346f513c4a14d8b15d3506f042531a (commit)
       via  64008ef2f43d4d7c964e9b1f49639713a16e322f (commit)
       via  901bb58e5b0bd4dcd365207fdbb2dd59b108f532 (commit)
       via  fcdcab1d2904f46d2d9ff0e15087fad81efa90a1 (commit)
       via  1c88f4cefa9a7945b3520b7249f7134d26f8fa4b (commit)
       via  b3d4bb5f364cca24d02b64ace7de884290f21992 (commit)
      from  a073b5a441576e3348391669a6e6ea94a304a5ce (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 ccb7382c52346f513c4a14d8b15d3506f042531a
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Wed Aug 2 11:55:12 2017 -0400

    LP#1189989: (follow-up) normalize capitalization of "onclick"
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/templates/opac/parts/place_hold.tt2 b/Open-ILS/src/templates/opac/parts/place_hold.tt2
index 1ec5862..c7bffb1 100644
--- a/Open-ILS/src/templates/opac/parts/place_hold.tt2
+++ b/Open-ILS/src/templates/opac/parts/place_hold.tt2
@@ -235,7 +235,7 @@ function toggleActivationDate() {
                      title="[% l('A suspended hold will retain its place in the queue, but will not be fulfilled until it has been activated.') %]" />
                 <br/>
                 <input type="checkbox" name="hold_suspend" id="hold_suspend" value="t"/> [% l('Yes') %]
-                <a id="actDateToggle" href="#toggled-block-suspend" onClick="return toggleActivationDate();">[% l('Set activation date') %]</a>
+                <a id="actDateToggle" href="#toggled-block-suspend" onclick="return toggleActivationDate();">[% l('Set activation date') %]</a>
             </blockquote>
             <blockquote id="toggled-block-suspend">
                 <label for="thaw_date">[% l('Activate on') %]</label>

commit 64008ef2f43d4d7c964e9b1f49639713a16e322f
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Wed Aug 2 11:49:08 2017 -0400

    LP#1189989: (follow-up) ignore invalid thaw date
    
    This patch ensures that the specified thaw date is valid,
    as otherwise specifying a thaw date of "13/08/2017" (when,
    at present, only dates of the form mm/dd/yyyy are accepted)
    would result in an Apache internal server error.
    
    If an invalid date is supplied, the thaw date is ignored, meaning
    that the hold request will be placed as suspended but will not
    automatically reactivate.
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
index 9c5f14d..765ecf3 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
@@ -12,6 +12,7 @@ use Digest::MD5 qw(md5_hex);
 use Data::Dumper;
 $Data::Dumper::Indent = 0;
 use DateTime;
+use DateTime::Format::ISO8601;
 my $U = 'OpenILS::Application::AppUtils';
 
 sub prepare_extended_user_info {
@@ -1040,7 +1041,13 @@ sub load_place_hold {
         # We should use a date input type on the forms once it is supported by Firefox.
         # I didn't do that now because it is not available in a general release.
         if ($cgi->param('thaw_date') =~ m:^(\d{2})/(\d{2})/(\d{4})$:){
-            $ctx->{thaw_date} = "$3-$1-$2";
+            eval {
+                my $dt = DateTime::Format::ISO8601->parse_datetime("$3-$1-$2");
+                $ctx->{thaw_date} = $dt->ymd;
+            };
+            if ($@) {
+                $logger->warn("ignoring invalid thaw_date when placing hold request");
+            }
         }
     }
 

commit 901bb58e5b0bd4dcd365207fdbb2dd59b108f532
Author: Kathy Lussier <klussier at masslnc.org>
Date:   Tue Aug 1 16:48:19 2017 -0400

    LP#1189989: Release notes entry for suspend option when placing hold
    
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/docs/RELEASE_NOTES_NEXT/OPAC/suspended_holds.adoc b/docs/RELEASE_NOTES_NEXT/OPAC/suspended_holds.adoc
new file mode 100644
index 0000000..503a22f
--- /dev/null
+++ b/docs/RELEASE_NOTES_NEXT/OPAC/suspended_holds.adoc
@@ -0,0 +1,9 @@
+Option to Suspend Holds at the Time They are Placed
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Users now have the option to suspend a hold at the same time they place the
+hold. The _Place Hold_ screen has a checkbox that can be enabled for users
+who want to suspend a hold at the time it is placed. There is also an option
+to set the activation date at the same time. This option is also available
+when placing holds on a batch of titles from _My List_ and will apply to
+all the titles in the batch.
+

commit fcdcab1d2904f46d2d9ff0e15087fad81efa90a1
Author: Jason Stephenson <jason at sigio.com>
Date:   Fri Jul 21 12:47:14 2017 -0400

    LP 1189989: Add suspend option when placing hold
    
    This commit adds some bells and whistles to the basic functionality:
    
    1. Adds two new styles in style.css.tt2 for toggled blocks and inline
    text.  These styles allow text with id attributes beginnging with
    certain strings to be normally hidden and then shown when they are the
    target of an active anchor.  Only the block form is currently used,
    but the inline text version may prove useful in the near future.
    
    2. Moves the "Suspend this hold?" language above the checkbox and adds
    a variant to make it clear that all of the holds will be suspended
    when multiple holds are placed.
    
    3. Adds the question mark graphic with mouseover help text indicating
    that a suspended hold will not be fulfilled until it has been
    activated.
    
    4. Adds a "Set activation date" anchor to toggle the appearance of the
    text input for the optional thaw date.
    
    5. Adds a script block with a JavaScript function to toggle the
    appearance of the text input for the optional thaw date and to check
    the suspend hold check box when first toggled.  This function returns
    false to prohibit the href of the anchor from firing and toggling the
    appearance via CSS.  If JavaScript is disabled, the input's appearance
    will be toggled via CSS, but the checkbox will not be checked
    automatically.
    
    6. Adds language to the place hold results page to indicate if the
    hold is suspended and adds the reactive date if supplied.
    
    7. Modifies the backend holds code to not set the expire time on a
    hold if it is suspended.  This is a logical extension of code added
    for Lp bug #1076399: Activating an expired hold cancels the hold.
    
    PLEASE NOTE: I would very much like to keep this branch in three
    commits because the first commit is Bill Ott's initial implementation
    from 2013.  The second commit is a fix to Bill's work required to make
    it work with modern ttopac.  This third commit overs the expansion of
    the functionality to meet MassLNC requirements.  I think it would
    behoove us to keep these three pieces of work in distinct commits.
    
    Signed-off-by: Jason Stephenson <jason at sigio.com>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
index a331fac..c46ad21 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
@@ -342,7 +342,7 @@ sub create_hold {
         $hold->expire_time(undef) if ($hold->expire_time && $U->datecmp($hold->expire_time) == -1);
 
     # set the configured expire time
-    unless($hold->expire_time) {
+    unless($hold->expire_time || $U->is_true($hold->frozen)) {
         $hold->expire_time(calculate_expire_time($recipient->home_ou));
     }
 
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
index 95bad4a..9c5f14d 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
@@ -1036,6 +1036,9 @@ sub load_place_hold {
     }
     if ($cgi->param('hold_suspend')) {
         $ctx->{frozen} = 1;
+        # TODO: Make this support other date formats, not just mm/dd/yyyy.
+        # We should use a date input type on the forms once it is supported by Firefox.
+        # I didn't do that now because it is not available in a general release.
         if ($cgi->param('thaw_date') =~ m:^(\d{2})/(\d{2})/(\d{4})$:){
             $ctx->{thaw_date} = "$3-$1-$2";
         }
diff --git a/Open-ILS/src/templates/opac/css/style.css.tt2 b/Open-ILS/src/templates/opac/css/style.css.tt2
index 226b294..bdbb2d3 100644
--- a/Open-ILS/src/templates/opac/css/style.css.tt2
+++ b/Open-ILS/src/templates/opac/css/style.css.tt2
@@ -3235,3 +3235,19 @@ label[for*=expert_]
 }
 .metarecord_filter_container select{padding: 2px;width: 13em; /* consistent w/ adv search selectors */}
 .metarecord_filter_header{padding-bottom: 5px;}
+
+/* Toggled items. */
+/* A block that is initially hidden and shown by clicking an anchor. */
+[id^="toggled-block-"]{
+    display: none;
+}
+[id^="toggled-block-"]:target{
+    display: block;
+}
+/* Inline text that is initially hidden and shown by clicking an anchor. Useful on a span. */
+[id^="toggled-inline-"]{
+    display: none;
+}
+[id^="toggled-inline-"]:target{
+    display: inline;
+}
diff --git a/Open-ILS/src/templates/opac/parts/place_hold.tt2 b/Open-ILS/src/templates/opac/parts/place_hold.tt2
index 0a759f0..1ec5862 100644
--- a/Open-ILS/src/templates/opac/parts/place_hold.tt2
+++ b/Open-ILS/src/templates/opac/parts/place_hold.tt2
@@ -2,7 +2,29 @@
     PROCESS "opac/parts/hold_error_messages.tt2";
     PROCESS "opac/parts/metarecord_hold_filters.tt2";
 %]
-
+<script>
+// Toggle the activation date input and check the suspend checkbox.
+// If JavaScript is disabled, the CSS will handle the former, but
+// the latter will not happen.
+function toggleActivationDate() {
+    var cb = document.getElementById("hold_suspend");
+    var block = document.getElementById("toggled-block-suspend");
+    var anchor = document.getElementById("actDateToggle");
+    var actText = "[%- l('Hide activation date') -%]";
+    var inActText = "[%- l('Set activation date') -%]";
+    // Check for not equal to block so it works on first click.
+    if (block.style.display != "block") {
+        block.style.display = "block";
+        anchor.innerHTML = actText;
+        if (cb.checked != true) cb.checked = true;
+    } else {
+        block.style.display = "none";
+        anchor.innerHTML = inActText;
+    }
+    // Prevent the href from being followed, thus overriding the CSS.
+    return false;
+}
+</script>
 <div id='holds_box' class='canvas' style='margin-top: 6px;'>
     <h1>[% l('Place Hold') %]</h1>
 
@@ -203,12 +225,22 @@
                 [% END %]
             </blockquote>
             <blockquote>
-                <input type="checkbox" name="hold_suspend" value="t"/>[% l('Suspend This Hold?') %]
+                [% IF ctx.hold_data.size == 1;
+		       l('Suspend this hold?');
+		   ELSE;
+		       l('Suspend these holds?');
+		   END %]
+                <img src="[% ctx.media_prefix %]/images/question-mark.png"
+                     alt="[% l('Suspend Hold Help') %]"
+                     title="[% l('A suspended hold will retain its place in the queue, but will not be fulfilled until it has been activated.') %]" />
+                <br/>
+                <input type="checkbox" name="hold_suspend" id="hold_suspend" value="t"/> [% l('Yes') %]
+                <a id="actDateToggle" href="#toggled-block-suspend" onClick="return toggleActivationDate();">[% l('Set activation date') %]</a>
             </blockquote>
-            <blockquote>
-                [% l('If suspended, activate on') %]
-		<input type="text" name="thaw_date" value="[% thaw_date | html %]" />
-		<em>[% l('Enter date in MM/DD/YYYY format') %]</em>
+            <blockquote id="toggled-block-suspend">
+                <label for="thaw_date">[% l('Activate on') %]</label>
+                <input type="text" id="thaw_date" name="thaw_date" />
+                <em>[% l('Enter date in MM/DD/YYYY format') %]</em>
             </blockquote>
         </p>
         <input id="place_hold_submit" type="submit" name="submit" 
diff --git a/Open-ILS/src/templates/opac/parts/place_hold_result.tt2 b/Open-ILS/src/templates/opac/parts/place_hold_result.tt2
index d158e86..b2513a6 100644
--- a/Open-ILS/src/templates/opac/parts/place_hold_result.tt2
+++ b/Open-ILS/src/templates/opac/parts/place_hold_result.tt2
@@ -54,6 +54,16 @@
 
                         <div class='success'>[% l("Hold was successfully placed"); %]</div>
 
+                        [% IF hdata.frozen %]
+                        <div>
+                        [% l("Hold is suspended") %]
+                        [% IF hdata.thaw_date %]
+                        <br/>
+                        [% l("Reactivate on [_1]", date.format(ctx.parse_datetime(hdata.thaw_date), DATE_FORMAT));
+                           END %]
+                        </div>
+                        [% END %]
+
                         [% IF ctx.is_staff %]
                             <script>
                                 window.addEventListener(

commit 1c88f4cefa9a7945b3520b7249f7134d26f8fa4b
Author: Jason Stephenson <jason at sigio.com>
Date:   Sun Apr 23 15:54:12 2017 -0400

    LP 1189989: Add suspend option when placing hold
    
    Fix the Apache Internal Server error caused by the previous patch.
    
    Signed-off-by: Jason Stephenson <jason at sigio.com>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
index 91edcb6..95bad4a 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
@@ -1034,6 +1034,13 @@ sub load_place_hold {
     } else {
         $ctx->{default_sms_notify} = '';
     }
+    if ($cgi->param('hold_suspend')) {
+        $ctx->{frozen} = 1;
+        if ($cgi->param('thaw_date') =~ m:^(\d{2})/(\d{2})/(\d{4})$:){
+            $ctx->{thaw_date} = "$3-$1-$2";
+        }
+    }
+
 
     # If we have a default pickup location, grab it
     if ($$user_setting_map{'opac.default_pickup_location'}) {
@@ -1050,6 +1057,8 @@ sub load_place_hold {
         if ($ctx->{phone_notify}) { $hdata->{phone_notify} = $ctx->{phone_notify}; }
         if ($ctx->{sms_notify}) { $hdata->{sms_notify} = $ctx->{sms_notify}; }
         if ($ctx->{sms_carrier}) { $hdata->{sms_carrier} = $ctx->{sms_carrier}; }
+        if ($ctx->{frozen}) { $hdata->{frozen} = 1; }
+        if ($ctx->{thaw_date}) { $hdata->{thaw_date} = $ctx->{thaw_date}; }
         return $hdata;
     };
 
@@ -1289,10 +1298,6 @@ sub attempt_hold_placement {
 
     my @create_targets = map {$_->{target_id}} (grep { !$_->{hold_failed} } @hold_data);
 
-    my $thaw_date;
-    if ($cgi->param('hold_suspend') && $cgi->param('thaw_date') =~ m:^(\d{2})/(\d{2})/(\d{4})$:){
-        $thaw_date = "$3-$1-$2";
-    }
 
     if(@create_targets) {
 
@@ -1313,8 +1318,6 @@ sub attempt_hold_placement {
                 pickup_lib => $pickup_lib,
                 hold_type => $hold_type,
                 holdable_formats_map => $holdable_formats,
-                frozen => $cgi->param('hold_suspend'),
-                thaw_date => $thaw_date
             }),
             \@create_targets
         );

commit b3d4bb5f364cca24d02b64ace7de884290f21992
Author: Bill Ott <bott at grpl.org>
Date:   Tue Aug 20 11:19:27 2013 -0400

    LP 1189989: Add suspend option when placing hold
    
    Return of an option from JSPAC, the ability to immediately suspend a
    hold when it's placed.
    
    TODO: As noted in the code for editing a hold, a calendar selection
    would be preferred to requiring users to enter a valid date manually.
    
    This commit was a patch submitted by Bill Ott to Launchpad in August
    2013.  Jason Stephenson applied the patch on April 22, 2017 and
    resolved conflicts caused by the addition of a metarecords hold
    feature in the TPAC.  The revised patch was committed with the
    original author and commit timestamp.
    
    Signed-off-by: Bill Ott <bott at grpl.org>
    Signed-off-by: Jason Stephenson <jason at sigio.com>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
index 9f96bfd..91edcb6 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
@@ -1289,6 +1289,11 @@ sub attempt_hold_placement {
 
     my @create_targets = map {$_->{target_id}} (grep { !$_->{hold_failed} } @hold_data);
 
+    my $thaw_date;
+    if ($cgi->param('hold_suspend') && $cgi->param('thaw_date') =~ m:^(\d{2})/(\d{2})/(\d{4})$:){
+        $thaw_date = "$3-$1-$2";
+    }
+
     if(@create_targets) {
 
         # holdable formats may be different for each MR hold.
@@ -1307,7 +1312,9 @@ sub attempt_hold_placement {
                 patronid => $usr,
                 pickup_lib => $pickup_lib,
                 hold_type => $hold_type,
-                holdable_formats_map => $holdable_formats
+                holdable_formats_map => $holdable_formats,
+                frozen => $cgi->param('hold_suspend'),
+                thaw_date => $thaw_date
             }),
             \@create_targets
         );
diff --git a/Open-ILS/src/templates/opac/parts/place_hold.tt2 b/Open-ILS/src/templates/opac/parts/place_hold.tt2
index 8bf1713..0a759f0 100644
--- a/Open-ILS/src/templates/opac/parts/place_hold.tt2
+++ b/Open-ILS/src/templates/opac/parts/place_hold.tt2
@@ -202,6 +202,14 @@
                 </blockquote>
                 [% END %]
             </blockquote>
+            <blockquote>
+                <input type="checkbox" name="hold_suspend" value="t"/>[% l('Suspend This Hold?') %]
+            </blockquote>
+            <blockquote>
+                [% l('If suspended, activate on') %]
+		<input type="text" name="thaw_date" value="[% thaw_date | html %]" />
+		<em>[% l('Enter date in MM/DD/YYYY format') %]</em>
+            </blockquote>
         </p>
         <input id="place_hold_submit" type="submit" name="submit" 
             value="[% l('Submit') %]" title="[% l('Submit') %]"

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

Summary of changes:
 .../perlmods/lib/OpenILS/Application/Circ/Holds.pm |    2 +-
 .../lib/OpenILS/WWW/EGCatLoader/Account.pm         |   22 ++++++++++-
 Open-ILS/src/templates/opac/css/style.css.tt2      |   16 +++++++
 Open-ILS/src/templates/opac/parts/place_hold.tt2   |   42 +++++++++++++++++++-
 .../src/templates/opac/parts/place_hold_result.tt2 |   10 +++++
 docs/RELEASE_NOTES_NEXT/OPAC/suspended_holds.adoc  |    9 ++++
 6 files changed, 98 insertions(+), 3 deletions(-)
 create mode 100644 docs/RELEASE_NOTES_NEXT/OPAC/suspended_holds.adoc


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list