LP#1613374 - Set item status to 'Canceled Transit' when transit is canceled.
authorChris Sharp <csharp@georgialibraries.org>
Wed, 24 Aug 2016 18:12:04 +0000 (14:12 -0400)
committerMike Rylander <mrylander@gmail.com>
Wed, 24 Aug 2016 22:05:40 +0000 (18:05 -0400)
I opened a separate bug report on this issue (bug 1613374) before realizing
bug 1306666 was reported.  This commit creates a new 'Canceled Transit' status
that signals to staff what happened to an item when a transit is aborted/canceled.

Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Conflicts:
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Transit.pm

Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Transit.pm
Open-ILS/src/perlmods/lib/OpenILS/Const.pm
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.data.canceled-transit-item-status.sql [new file with mode: 0644]

index 73abe82..88b706b 100644 (file)
@@ -246,18 +246,13 @@ sub __abort_transit {
     # Only change the copy status if the copy status is "In Transit."
     if ($copy->status == OILS_COPY_STATUS_IN_TRANSIT) {
         # recover the copy status
-        $copy->status( $transit->copy_status );
+        $copy->status( OILS_COPY_STATUS_CANCELED_TRANSIT );
         $copy->editor( $e->requestor->id );
         $copy->edit_date('now');
 
-        if ( $holdtransit ) {
-            $logger->info("setting copy to reshelving on hold transit abort");
-            $copy->status( OILS_COPY_STATUS_RESHELVING );
-        }
         return $e->die_event unless $e->update_asset_copy($copy);
     }
 
-
     $e->commit unless $no_commit;
 
     # if this is a hold transit, un-capture/un-target the hold
index cd82e83..c568d89 100644 (file)
@@ -44,7 +44,7 @@ econst OILS_COPY_STATUS_DAMAGED       => 14;
 econst OILS_COPY_STATUS_ON_RESV_SHELF => 15;
 econst OILS_COPY_STATUS_LONG_OVERDUE  => 16;
 econst OILS_COPY_STATUS_LOST_AND_PAID => 17;
-
+econst OILS_COPY_STATUS_CANCELED_TRANSIT => 18;
 
 # ---------------------------------------------------------------------
 # Circ defaults for pre-cataloged copies
index 72b7029..1ffa333 100644 (file)
@@ -328,6 +328,7 @@ INSERT INTO config.copy_status
 INSERT INTO config.copy_status
 (id, name, holdable, opac_visible, copy_active, restrict_copy_delete)
 VALUES (17, 'Lost and Paid', FALSE, FALSE, FALSE, TRUE);
+INSERT INTO config.copy_status(id,name) VALUES (18,oils_i18n_gettext(18, 'Canceled Transit', 'ccs', 'name'));
 
 
 SELECT SETVAL('config.copy_status_id_seq'::TEXT, 100);
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.canceled-transit-item-status.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.canceled-transit-item-status.sql
new file mode 100644 (file)
index 0000000..0ce261e
--- /dev/null
@@ -0,0 +1,7 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+INSERT INTO config.copy_status (id, name) VALUES (18,oils_i18n_gettext(18, 'Canceled Transit', 'ccs', 'name'));
+
+COMMIT;