'Bindery' item status rethink - this status should eventually be tracked at the unit...
authordbwells <dbwells@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 21 Dec 2010 22:54:15 +0000 (22:54 +0000)
committerdbwells <dbwells@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 21 Dec 2010 22:54:15 +0000 (22:54 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@19036 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Serial.pm
Open-ILS/xul/staff_client/server/serial/manage_items.js

index e55632f..6607b08 100644 (file)
@@ -999,8 +999,6 @@ sub unitize_items {
         if ($mode eq 'receive') {
             $item->date_received('now');
             $item->status('Received');
-        } else {
-            $item->status('Bindery');
         }
 
         # check for types to trigger summary updates
@@ -1064,6 +1062,7 @@ sub unitize_items {
     foreach my $unit_id (keys %found_unit_ids) {
 
         # get all the needed issuances for unit
+        # TODO remove 'Bindery' from this search (leaving it in for now for backwards compatibility with any current test environment data)
         my $issuances = $editor->search_serial_issuance([ {"+sitem" => {"unit" => $unit_id, "status" => ["Received", "Bindery"]}}, {"join" => {"sitem" => {}}, "order_by" => {"siss" => "date_published"}} ]);
         #TODO: evt on search failure
 
@@ -1099,10 +1098,6 @@ sub unitize_items {
         $sort_key =~ s/(\d+)/sprintf '%06d', $1/eg; # this may need improvement
         $sunit->sort_key($sort_key);
         
-        if ($mode eq 'bind') {
-            $sunit->status(2); # set to 'Bindery' status
-        }
-
         my $evt = _update_sunit($editor, undef, $sunit);
         return $evt if $evt;
     }
index 4e757be..66ca3d8 100644 (file)
@@ -577,15 +577,16 @@ serial.manage_items.prototype = {
             if ($('serial_manage_items_show_all').checked) {
                 obj.lists.main.sitem_retrieve_params = {};
             } else {
-                obj.lists.main.sitem_retrieve_params = {'date_received' : {'!=' : null}, 'status' : {'!=' : 'Bindery'} };
+                obj.lists.main.sitem_retrieve_params = {'date_received' : {'!=' : null}}; // unit set dynamically in 'retrieve'
             }
             obj.lists.main.sitem_extra_params ={'order_by' : {'sitem' : 'date_expected ASC, stream ASC'}};
 
-            obj.lists.workarea.sitem_retrieve_params = {'status' : 'Bindery'}; // unit set dynamically in 'retrieve'
+            obj.lists.workarea.sitem_retrieve_params = {}; // unit set dynamically in 'retrieve'
             obj.lists.workarea.sitem_extra_params ={'order_by' : {'sitem' : 'date_received DESC'}};
 
             // default to **NEW UNIT**
-            obj.set_sunit(-2, 'New Unit', '', '');
+            // For now, keep the unit static.  TODO: Eventually, keep track of and store the last used unit value for both receive and bind separately
+            // obj.set_sunit(-2, 'New Unit', '', '');
         }
     },
 
@@ -715,8 +716,12 @@ serial.manage_items.prototype = {
         var robj;
         rparams['+sstr'] = { "distribution" : obj.sdist_ids };
 
-        if (obj.mode == 'bind' && list_name == 'workarea') {
-             rparams['unit'] = obj.current_sunit_id;
+        if (obj.mode == 'bind') {
+            if (list_name == 'workarea') {
+                rparams['unit'] = obj.current_sunit_id;
+            } else if (!$('serial_manage_items_show_all').checked){
+                rparams['unit'] = {"<>" : obj.current_sunit_id};
+            }
         }
 
         var other_params = list.sitem_extra_params;