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

Evergreen Git git at git.evergreen-ils.org
Wed Feb 28 16:44:55 EST 2018


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  af3545816d23502107d426a3e3d70e3cf4a96934 (commit)
       via  a5e0c10845437717d44e01496cef5fbac081c179 (commit)
       via  9183f2503a358cd73b520ebb61e93bf0dc1c7a6c (commit)
       via  c97b4ddb75823e4f5df14ec74a9d1ead95bc9c06 (commit)
       via  102eaa97e108c6479d02c8d6e1cb4536e776f714 (commit)
       via  3e9885804533b9cfea07efd0eee0ec9f889e8b37 (commit)
       via  3e081d1ee518cbfa3b53b1d261aa773831ecd365 (commit)
      from  b0a1c725e2b97e5108ad7071c8c9bd96e2ad4ef5 (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 af3545816d23502107d426a3e3d70e3cf4a96934
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Wed Feb 28 16:50:14 2018 -0500

    LP#1661688: tweak schema update
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.hold_checkout.sql b/Open-ILS/src/sql/Pg/upgrade/1104.data.hold_checkout_ou.sql
similarity index 88%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.schema.hold_checkout.sql
rename to Open-ILS/src/sql/Pg/upgrade/1104.data.hold_checkout_ou.sql
index fa7b41d..4a4bb40 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.hold_checkout.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/1104.data.hold_checkout_ou.sql
@@ -1,6 +1,6 @@
 BEGIN;
 
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('1104', :eg_version);
 
 INSERT INTO config.org_unit_setting_type
 ( name, grp, label, description, datatype )

commit a5e0c10845437717d44e01496cef5fbac081c179
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Wed Feb 28 16:30:46 2018 -0500

    LP#1661688: tweaks to release notes
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/docs/RELEASE_NOTES_NEXT/Circulation/alternate_patron_hold_pickup.adoc b/docs/RELEASE_NOTES_NEXT/Circulation/alternate_patron_hold_pickup.adoc
index d3ef60ed..7d9c266 100644
--- a/docs/RELEASE_NOTES_NEXT/Circulation/alternate_patron_hold_pickup.adoc
+++ b/docs/RELEASE_NOTES_NEXT/Circulation/alternate_patron_hold_pickup.adoc
@@ -9,12 +9,13 @@ with this item.  The "ITEM_ON_HOLDS_SHELF" message is now expanded to
  * Let you know the name of the person who had placed the hold.
  * Give you the option (in the form of a checkbox) of cancelling the
    hold placed by the above-named patron.  (Checked = Cancel the hold;
-   Uncheked = Leave the hold in place)
+   Unchecked = Leave the hold in place)
 
 The initial value of the checkbox is derived from the circ.clear_hold_on_checkout
-organizational setting.  This is found under Administration -- Server Administration -- Org Unit Setting Types
+organizational setting.
 
-If the operator has CANCEL_HOLD privilege, then if the checkbox is checked and the checkout is allowed to proceed,
-the hold will be cancelled with a note that the item was checked out to another patrron.
+If the operator has CANCEL_HOLD privilege, then if the checkbox is checked and
+the checkout is allowed to proceed, the hold will be cancelled with a note that
+the item was checked out to another patrron.
 
 This feature is available in the browser-based staff client.

commit 9183f2503a358cd73b520ebb61e93bf0dc1c7a6c
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Wed Feb 28 16:28:01 2018 -0500

    LP#1661688: tweak code for style and whitespace
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js
index d2a72f0..5a903c7 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js
@@ -31,7 +31,7 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,  egAddCopyAl
             'circ.clear_hold_on_checkout'
         ]).then(function(set) {
             service.require_initials = Boolean(set['ui.staff.require_initials.patron_standing_penalty']);
-	    service.clearHold = Boolean(set['circ.clear_hold_on_checkout']);
+            service.clearHold = Boolean(set['circ.clear_hold_on_checkout']);
 
             if (angular.isArray(set['circ.staff_client.do_not_auto_attempt_print'])) {
                 if (set['circ.staff_client.do_not_auto_attempt_print'].indexOf('Hold Slip') > 1)
@@ -738,21 +738,19 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,  egAddCopyAl
 
                 // Find the event, if any, that is for ITEM_ON_HOLDS_SHELF
                 //  and grab the patron name of the owner. 
-                $scope.holdEvent = evt.filter(
-		     function(e) {
-                        return e.textcode === 'ITEM_ON_HOLDS_SHELF'
-                     }
-                );
+                $scope.holdEvent = evt.filter(function(e) {
+                    return e.textcode === 'ITEM_ON_HOLDS_SHELF'
+                });
 
-                if ($scope.holdEvent) {
-		   // Ensure we have a scalar here 
-                   if (angular.isArray($scope.holdEvent)) {
-                       $scope.holdEvent = $scope.holdEvent[0];
-                   }
+                if ($scope.holdEvent.length > 0) {
+                    // Ensure we have a scalar here
+                    if (angular.isArray($scope.holdEvent)) {
+                        $scope.holdEvent = $scope.holdEvent[0];
+                    }
 
-                   $scope.patronName = $scope.holdEvent.payload.patron_name;
-                   $scope.holdID = $scope.holdEvent.payload.hold_id;
-                   $scope.patronID = $scope.holdEvent.payload.patron_id;
+                    $scope.patronName = $scope.holdEvent.payload.patron_name;
+                    $scope.holdID = $scope.holdEvent.payload.hold_id;
+                    $scope.patronID = $scope.holdEvent.payload.patron_id;
                 }
 
                 $scope.auto_override =
@@ -767,21 +765,18 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,  egAddCopyAl
                 $scope.formdata = {clearHold : service.clearHold};
 
                 $scope.ok = function() { 
-                        $uibModalInstance.close();
-
-                        // Handle the cancellation of the assciated hold here
-                        if ($scope.formdata.clearHold && $scope.holdID) {
-                            $scope.args = {
-                            cancel_reason : 5,
-                                note: 'Item checked out by other patron'
-			    };
-                            egCore.net.request(
-                                'open-ils.circ', 'open-ils.circ.hold.cancel',
-                                egCore.auth.token(), $scope.holdID,
-                                $scope.args.cancel_reason,
-                                $scope.args.note);
-                        }
-		}
+                    // Handle the cancellation of the assciated hold here
+                    if ($scope.formdata.clearHold && $scope.holdID) {
+                        egCore.net.request(
+                            'open-ils.circ',
+                            'open-ils.circ.hold.cancel',
+                            egCore.auth.token(), $scope.holdID,
+                            5, // staff forced
+                            'Item checked out by other patron' // FIXME I18n
+                        );
+                    }
+                    $uibModalInstance.close();
+                }
 
                 $scope.cancel = function ($event) { 
                     $uibModalInstance.dismiss();

commit c97b4ddb75823e4f5df14ec74a9d1ead95bc9c06
Author: Kathy Lussier <klussier at masslnc.org>
Date:   Wed Feb 21 15:19:34 2018 -0500

    LP#1661688: Add a link and other tweaks to alternate hold pickup feature
    
    Adding a couple of tweaks to the alternate hold pickup feature:
      * Created a link for the hold patron so that staff can easily retrieve the record and potentially verify that the user allows the alternate patron to pick
    up their holds.
      * Tweaked the language in the event dialog.
      * Removed the new OU setting from actor.org_unit_setting so that a default value is not set.
    
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/extras/ils_events.xml b/Open-ILS/src/extras/ils_events.xml
index a4573b4..473b2d6 100644
--- a/Open-ILS/src/extras/ils_events.xml
+++ b/Open-ILS/src/extras/ils_events.xml
@@ -892,7 +892,7 @@
 		<desc xml:lang="en-US">This requested action would result in a negative patron balance</desc>
 	</event>
 	<event code='7016' textcode='ITEM_ON_HOLDS_SHELF'>
-		<desc xml:lang="en-US">This item is currently on the holds shelf for another patron</desc>
+		<desc xml:lang="en-US">This item is currently on the holds shelf for another patron:</desc>
 	</event>
 	<event code='7017' textcode='ROUTE_TO_COPY_LOCATION'>
 		<desc xml:lang="en-US"> 
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
index caed8bb..deb9541 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
@@ -1135,6 +1135,7 @@ sub check_captured_holds {
 
         if ($holdau) {
             $payload->{patron_name} = $holdau->first_given_name . ' ' . $holdau->family_name;
+            $payload->{patron_id} = $holdau->id;
         } else {
             $payload->{patron_name} = "???";
         }
diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
index 65f3a70..f6c7d19 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -16739,14 +16739,6 @@ VALUES
      		'coust', 'description'),
    	'bool');
 
-INSERT INTO actor.org_unit_setting (
-    org_unit, name, value
-) VALUES (
-    (SELECT id FROM actor.org_unit WHERE parent_ou IS NULL),
-    'circ.clear_hold_on_checkout',
-    'false'
-);
-
 INSERT INTO config.org_unit_setting_type
 ( name, grp, label, description, datatype )
 VALUES
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.hold_checkout.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.hold_checkout.sql
index db79223..fa7b41d 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.hold_checkout.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.hold_checkout.sql
@@ -15,13 +15,5 @@ VALUES
      		'coust', 'description'),
    	'bool');
 
-INSERT INTO actor.org_unit_setting (
-    org_unit, name, value
-) VALUES (
-    (SELECT id FROM actor.org_unit WHERE parent_ou IS NULL),
-    'circ.clear_hold_on_checkout',
-    'false'
-);
-
 COMMIT;
 
diff --git a/Open-ILS/src/templates/staff/circ/share/t_event_override_dialog.tt2 b/Open-ILS/src/templates/staff/circ/share/t_event_override_dialog.tt2
index 0adeb11..398796f 100644
--- a/Open-ILS/src/templates/staff/circ/share/t_event_override_dialog.tt2
+++ b/Open-ILS/src/templates/staff/circ/share/t_event_override_dialog.tt2
@@ -13,8 +13,8 @@
         <div class="panel-body">
           <div ng-if="copy_barcode" class="strong-text-2">{{copy_barcode}}</div>
           {{evt.desc}}
-          <div ng-if="evt.textcode == 'ITEM_ON_HOLDS_SHELF'">
-	      [% l('for ') %] {{patronName}}.
+          <div ng-if="evt.textcode == 'ITEM_ON_HOLDS_SHELF'"> 
+	       <a target="_blank" href="[% ctx.base_path %]/staff/circ/patron/{{patronID}}/checkout">{{patronName}}</a>.
             <div>
 		<label><input type="checkbox" ng-model="formdata.clearHold"/> 
 		[% l('Cancel this hold upon checkout?') %]</label>
diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js
index 3bf866c..d2a72f0 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js
@@ -752,6 +752,7 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,  egAddCopyAl
 
                    $scope.patronName = $scope.holdEvent.payload.patron_name;
                    $scope.holdID = $scope.holdEvent.payload.hold_id;
+                   $scope.patronID = $scope.holdEvent.payload.patron_id;
                 }
 
                 $scope.auto_override =

commit 102eaa97e108c6479d02c8d6e1cb4536e776f714
Author: Jason Stephenson <jason at sigio.com>
Date:   Mon Dec 18 10:32:08 2017 -0500

    Lp 1661688: Change new setting description.
    
    Alter the circ.clear_hold_on_checkout description to be more clear
    about what it does.
    
    Signed-off-by: Jason Stephenson <jason at sigio.com>
    Signed-off-by: Dan Pearl <dpearl at cwmars.org>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
index 43bf6ae..65f3a70 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -16735,9 +16735,7 @@ VALUES
      		'Clear hold when other patron checks out item',
      		'coust', 'label'),
         oils_i18n_gettext('circ.clear_hold_on_checkout',
-                 'When patron A checks out item on hold for patron B, ' ||
-		 'automatically clear the hold for patron B. This is ' ||
-                 'desirable when checking out item for family members',
+            'Default to cancel the hold when patron A checks out item on hold for patron B.',
      		'coust', 'description'),
    	'bool');
 
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.hold_checkout.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.hold_checkout.sql
index 1541b3b..db79223 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.hold_checkout.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.hold_checkout.sql
@@ -11,9 +11,7 @@ VALUES
      		'Clear hold when other patron checks out item',
      		'coust', 'label'),
         oils_i18n_gettext('circ.clear_hold_on_checkout',
-                 'When patron A checks out item on hold for patron B, ' ||
-		 'automatically clear the hold for patron B. This is ' ||
-                 'desirable when checking out item for family members',
+            'Default to cancel the hold when patron A checks out item on hold for patron B.',
      		'coust', 'description'),
    	'bool');
 

commit 3e9885804533b9cfea07efd0eee0ec9f889e8b37
Author: Jason Stephenson <jason at sigio.com>
Date:   Fri Dec 15 11:21:43 2017 -0500

    Lp 1661688: Fix undefined value error in Circulate.pm.
    
    We needed to check that there was a hold before picking out the hold
    usr.
    
    Also, fix an error in the flesh code added by this branch.  We don't
    need to flesh text fields from actor.usr.
    
    Signed-off-by: Jason Stephenson <jason at sigio.com>
    Signed-off-by: Dan Pearl <dpearl at cwmars.org>
    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/Circulate.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
index f516381..caed8bb 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
@@ -1120,10 +1120,8 @@ sub check_captured_holds {
                 fulfillment_time    => undef 
             },
             { limit => 1,
-              flesh => 2,
-              flesh_fields => { ahr => ['usr'],
-                                au => ['family_name', 'first_given_name']
-	      }
+              flesh => 1,
+              flesh_fields => { ahr => ['usr'] }
             }
         ]
     )->[0];
@@ -1131,21 +1129,22 @@ sub check_captured_holds {
     if ($hold and $hold->usr == $patron->id) {
         $self->checkout_is_for_hold(1);
         return undef;
+    } elsif ($hold) {
+        my $payload;
+        my $holdau = $hold->usr;
+
+        if ($holdau) {
+            $payload->{patron_name} = $holdau->first_given_name . ' ' . $holdau->family_name;
+        } else {
+            $payload->{patron_name} = "???";
+        }
+        $payload->{hold_id}     = $hold->id;
+        $self->push_events(OpenILS::Event->new('ITEM_ON_HOLDS_SHELF',
+                                               payload => $payload));
     }
 
     $logger->info("circulator: this copy is needed by a different patron to fulfill a hold");
 
-    my $payload;
-    my $holdau = $hold->usr;
-
-    if ($holdau) {
-       $payload->{patron_name} = $holdau->first_given_name . ' ' . $holdau->family_name;
-    } else {
-       $payload->{patron_name} = "???";
-    }
-    $payload->{hold_id}     = $hold->id;
-    $self->push_events(OpenILS::Event->new('ITEM_ON_HOLDS_SHELF',
-           payload => $payload));
 }
 
 

commit 3e081d1ee518cbfa3b53b1d261aa773831ecd365
Author: Dan Pearl <dpearl at cwmars.org>
Date:   Tue Jan 24 13:59:01 2017 -0500

    LP##1661688 - Want easy way to clear a hold when picked up by other patron.
    
    This common action was handled previously as
        1) item is scanned - The system detects that this items is for a different
           patron, and an error message is displayed.
    
        2) Force Override was selected - If the librarian had the appropriate
           privileges, the Force Override could allow the checkout to occur.
    
        3) librarian cancels original hold - This independent operation would
           be needed to cancel the original hold, otherwise the hold would be
           targeted again.
    
    This feature provides the option to cancel the hold in step #2. An error
    message will be displayed as before, but within that message will be a checkbox to allow cancelling of the original hold which, if checked, will mean that step #3 will be automatically done.
    
    The checked/non-checked state of the checkbox is initialized with an
    organizational unit setting. The default is false (to preserve default
    prior behavior).
    
    Note: This change only affects the "web client".
    
    TO TEST THIS
    
    A. Before the Patch
    
    Hold an item for patron "A".  Attempt to check it out for patron "B".
    Observe the choices to Force Override (to allow the checkout) or to cancel.
    Do a Force Override and observe that the original hold is still active.
    
    B. After the Patch
    
    Repeat the above scenario, and observe the (blank) checkbox.  Perform the
    Force Override and observe that the original hold is still active.
    
    Repeat the scenario, except this time check the checkbox.  Observe after the checheckout is done that original hold is gone.
    
    Adjust the organizational setting (see the Release Notes) to change the default
    appearance of the checkbox.
    
    For completeness, you can verify that if you cancel out the message pop-up that the checkout is cancelled and and that the hold status is unchanged, regardless of the state of the checkbox.
    
    Signed-off-by: Dan Pearl <dpearl at cwmars.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/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
index 8dbfcc2..f516381 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
@@ -1119,7 +1119,12 @@ sub check_captured_holds {
                 cancel_time         => undef, 
                 fulfillment_time    => undef 
             },
-            { limit => 1 }
+            { limit => 1,
+              flesh => 2,
+              flesh_fields => { ahr => ['usr'],
+                                au => ['family_name', 'first_given_name']
+	      }
+            }
         ]
     )->[0];
 
@@ -1130,7 +1135,17 @@ sub check_captured_holds {
 
     $logger->info("circulator: this copy is needed by a different patron to fulfill a hold");
 
-    $self->push_events(OpenILS::Event->new('ITEM_ON_HOLDS_SHELF'));
+    my $payload;
+    my $holdau = $hold->usr;
+
+    if ($holdau) {
+       $payload->{patron_name} = $holdau->first_given_name . ' ' . $holdau->family_name;
+    } else {
+       $payload->{patron_name} = "???";
+    }
+    $payload->{hold_id}     = $hold->id;
+    $self->push_events(OpenILS::Event->new('ITEM_ON_HOLDS_SHELF',
+           payload => $payload));
 }
 
 
diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
index ab4468d..43bf6ae 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -16729,6 +16729,29 @@ INSERT INTO config.org_unit_setting_type
 INSERT INTO config.org_unit_setting_type
 ( name, grp, label, description, datatype )
 VALUES
+	('circ.clear_hold_on_checkout',
+	 'circ',
+ 	oils_i18n_gettext('circ.clear_hold_on_checkout',
+     		'Clear hold when other patron checks out item',
+     		'coust', 'label'),
+        oils_i18n_gettext('circ.clear_hold_on_checkout',
+                 'When patron A checks out item on hold for patron B, ' ||
+		 'automatically clear the hold for patron B. This is ' ||
+                 'desirable when checking out item for family members',
+     		'coust', 'description'),
+   	'bool');
+
+INSERT INTO actor.org_unit_setting (
+    org_unit, name, value
+) VALUES (
+    (SELECT id FROM actor.org_unit WHERE parent_ou IS NULL),
+    'circ.clear_hold_on_checkout',
+    'false'
+);
+
+INSERT INTO config.org_unit_setting_type
+( name, grp, label, description, datatype )
+VALUES
 ('circ.patron_search.diacritic_insensitive',
  'circ',
  oils_i18n_gettext('circ.patron_search.diacritic_insensitive',
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.hold_checkout.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.hold_checkout.sql
new file mode 100644
index 0000000..1541b3b
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.hold_checkout.sql
@@ -0,0 +1,29 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+INSERT INTO config.org_unit_setting_type
+( name, grp, label, description, datatype )
+VALUES
+	('circ.clear_hold_on_checkout',
+	 'circ',
+ 	oils_i18n_gettext('circ.clear_hold_on_checkout',
+     		'Clear hold when other patron checks out item',
+     		'coust', 'label'),
+        oils_i18n_gettext('circ.clear_hold_on_checkout',
+                 'When patron A checks out item on hold for patron B, ' ||
+		 'automatically clear the hold for patron B. This is ' ||
+                 'desirable when checking out item for family members',
+     		'coust', 'description'),
+   	'bool');
+
+INSERT INTO actor.org_unit_setting (
+    org_unit, name, value
+) VALUES (
+    (SELECT id FROM actor.org_unit WHERE parent_ou IS NULL),
+    'circ.clear_hold_on_checkout',
+    'false'
+);
+
+COMMIT;
+
diff --git a/Open-ILS/src/templates/staff/circ/share/t_event_override_dialog.tt2 b/Open-ILS/src/templates/staff/circ/share/t_event_override_dialog.tt2
index 7308145..0adeb11 100644
--- a/Open-ILS/src/templates/staff/circ/share/t_event_override_dialog.tt2
+++ b/Open-ILS/src/templates/staff/circ/share/t_event_override_dialog.tt2
@@ -13,6 +13,14 @@
         <div class="panel-body">
           <div ng-if="copy_barcode" class="strong-text-2">{{copy_barcode}}</div>
           {{evt.desc}}
+          <div ng-if="evt.textcode == 'ITEM_ON_HOLDS_SHELF'">
+	      [% l('for ') %] {{patronName}}.
+            <div>
+		<label><input type="checkbox" ng-model="formdata.clearHold"/> 
+		[% l('Cancel this hold upon checkout?') %]</label>
+	    </div>
+
+	  </div>
         </div>
       </div>
     </div>
diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js
index f749b92..3bf866c 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js
@@ -27,9 +27,12 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,  egAddCopyAl
             'ui.staff.require_initials.patron_standing_penalty',
             'ui.admin.work_log.max_entries',
             'ui.admin.patron_log.max_entries',
-            'circ.staff_client.do_not_auto_attempt_print'
+            'circ.staff_client.do_not_auto_attempt_print',
+            'circ.clear_hold_on_checkout'
         ]).then(function(set) {
             service.require_initials = Boolean(set['ui.staff.require_initials.patron_standing_penalty']);
+	    service.clearHold = Boolean(set['circ.clear_hold_on_checkout']);
+
             if (angular.isArray(set['circ.staff_client.do_not_auto_attempt_print'])) {
                 if (set['circ.staff_client.do_not_auto_attempt_print'].indexOf('Hold Slip') > 1)
                     service.never_auto_print['hold_shelf_slip'] = true;
@@ -732,12 +735,53 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,  egAddCopyAl
                 ['$scope', '$uibModalInstance', 
                 function($scope, $uibModalInstance) {
                 $scope.events = evt;
+
+                // Find the event, if any, that is for ITEM_ON_HOLDS_SHELF
+                //  and grab the patron name of the owner. 
+                $scope.holdEvent = evt.filter(
+		     function(e) {
+                        return e.textcode === 'ITEM_ON_HOLDS_SHELF'
+                     }
+                );
+
+                if ($scope.holdEvent) {
+		   // Ensure we have a scalar here 
+                   if (angular.isArray($scope.holdEvent)) {
+                       $scope.holdEvent = $scope.holdEvent[0];
+                   }
+
+                   $scope.patronName = $scope.holdEvent.payload.patron_name;
+                   $scope.holdID = $scope.holdEvent.payload.hold_id;
+                }
+
                 $scope.auto_override =
                     evt.filter(function(e){
                         return service.checkout_auto_override_after_first.indexOf(evt.textcode) > -1;
                     }).length > 0;
                 $scope.copy_barcode = params.copy_barcode; // may be null
-                $scope.ok = function() { $uibModalInstance.close() }
+
+                // Implementation note: Why not use a primitive here? It
+                // doesn't work.  See: 
+                // http://stackoverflow.com/questions/18642371/checkbox-not-binding-to-scope-in-angularjs
+                $scope.formdata = {clearHold : service.clearHold};
+
+                $scope.ok = function() { 
+                        $uibModalInstance.close();
+
+                        // Handle the cancellation of the assciated hold here
+                        if ($scope.formdata.clearHold && $scope.holdID) {
+                            $scope.args = {
+                            cancel_reason : 5,
+                                note: 'Item checked out by other patron'
+			    };
+                            egCore.net.request(
+                                'open-ils.circ', 'open-ils.circ.hold.cancel',
+                                egCore.auth.token(), $scope.holdID,
+                                $scope.args.cancel_reason,
+                                $scope.args.note);
+                        }
+		}
+
                 $scope.cancel = function ($event) { 
                     $uibModalInstance.dismiss();
                     $event.preventDefault();
diff --git a/docs/RELEASE_NOTES_NEXT/Circulation/alternate_patron_hold_pickup.adoc b/docs/RELEASE_NOTES_NEXT/Circulation/alternate_patron_hold_pickup.adoc
new file mode 100644
index 0000000..d3ef60ed
--- /dev/null
+++ b/docs/RELEASE_NOTES_NEXT/Circulation/alternate_patron_hold_pickup.adoc
@@ -0,0 +1,20 @@
+Alternate Patron Hold Pickup
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+This feature adds a bit of convenience to a common task: checking out
+an item on hold to another patron (typically a family member or helper).
+
+When you checkout the item, you will get a pop-up window with warnings associated
+with this item.  The "ITEM_ON_HOLDS_SHELF" message is now expanded to
+
+ * Let you know the name of the person who had placed the hold.
+ * Give you the option (in the form of a checkbox) of cancelling the
+   hold placed by the above-named patron.  (Checked = Cancel the hold;
+   Uncheked = Leave the hold in place)
+
+The initial value of the checkbox is derived from the circ.clear_hold_on_checkout
+organizational setting.  This is found under Administration -- Server Administration -- Org Unit Setting Types
+
+If the operator has CANCEL_HOLD privilege, then if the checkbox is checked and the checkout is allowed to proceed,
+the hold will be cancelled with a note that the item was checked out to another patrron.
+
+This feature is available in the browser-based staff client.

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

Summary of changes:
 Open-ILS/src/extras/ils_events.xml                 |    2 +-
 .../lib/OpenILS/Application/Circ/Circulate.pm      |   19 ++++++++-
 Open-ILS/src/sql/Pg/950.data.seed-values.sql       |   13 ++++++
 .../sql/Pg/upgrade/1104.data.hold_checkout_ou.sql  |   19 ++++++++
 .../staff/circ/share/t_event_override_dialog.tt2   |    8 ++++
 .../web/js/ui/default/staff/circ/services/circ.js  |   44 +++++++++++++++++++-
 .../Circulation/alternate_patron_hold_pickup.adoc  |   21 +++++++++
 7 files changed, 121 insertions(+), 5 deletions(-)
 create mode 100644 Open-ILS/src/sql/Pg/upgrade/1104.data.hold_checkout_ou.sql
 create mode 100644 docs/RELEASE_NOTES_NEXT/Circulation/alternate_patron_hold_pickup.adoc


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list