[open-ils-commits] r17056 - in branches/seials-integration/Open-ILS: src/perlmods/OpenILS/Application xul/staff_client/chrome/content/main xul/staff_client/server/serial (dbwells)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Jul 29 16:10:40 EDT 2010


Author: dbwells
Date: 2010-07-29 16:10:34 -0400 (Thu, 29 Jul 2010)
New Revision: 17056

Modified:
   branches/seials-integration/Open-ILS/src/perlmods/OpenILS/Application/Serial.pm
   branches/seials-integration/Open-ILS/xul/staff_client/chrome/content/main/constants.js
   branches/seials-integration/Open-ILS/xul/staff_client/server/serial/manage_subs.js
Log:
Remove 'can_have_vols' restrictions for subscriptions; assorted smaller bug/typo fixes


Modified: branches/seials-integration/Open-ILS/src/perlmods/OpenILS/Application/Serial.pm
===================================================================
--- branches/seials-integration/Open-ILS/src/perlmods/OpenILS/Application/Serial.pm	2010-07-29 18:54:07 UTC (rev 17055)
+++ branches/seials-integration/Open-ILS/src/perlmods/OpenILS/Application/Serial.pm	2010-07-29 20:10:34 UTC (rev 17056)
@@ -499,10 +499,8 @@
                 'caption' => $caption_field,
                 'scap_id' => $scap->id,
                 'num_to_predict' => $args->{num_to_predict}
-                #'last_rec_date' => $args->{last_rec_date}
                 };
         if ($args->{base_issuance}) { # predict from a given issuance
-            #$options->{last_rec_date} = $args->{base_issuance}->date_expected;
             $options->{predict_from} = _revive_holding($args->{base_issuance}->holding_code, $caption_field, 1); # fresh MFHD Record, so we simply default to 1 for seqno
         } else { # default to predicting from last published
             my $last_published = $editor->search_serial_issuance([
@@ -512,8 +510,6 @@
                 );
             if ($last_published->[0]) {
                 my $last_siss = $last_published->[0];
-                #my $items_for_last_published = $editor->search_serial_item({'issuance' => $last_siss->id}, {limit => 1, order_by => { sitem => "date_expected ASC" }}); # assume later expected are exceptions, TODO: move this whole date offset idea to item creation portion, not issuance creation
-                #$options->{last_rec_date} = $items_for_last_published->[0]->date_expected;
                 $options->{predict_from} = _revive_holding($last_siss->holding_code, $caption_field, 1);
             } else {
                 #TODO: throw event (can't predict from nothing!)
@@ -1448,14 +1444,22 @@
     # create summaries too
     my $summary = new Fieldmapper::serial::basic_summary;
     $summary->distribution($sdist->id);
+    $summary->generated_coverage('');
     return $editor->event unless $editor->create_serial_basic_summary($summary);
     $summary = new Fieldmapper::serial::supplement_summary;
     $summary->distribution($sdist->id);
+    $summary->generated_coverage('');
     return $editor->event unless $editor->create_serial_supplement_summary($summary);
     $summary = new Fieldmapper::serial::index_summary;
     $summary->distribution($sdist->id);
+    $summary->generated_coverage('');
     return $editor->event unless $editor->create_serial_index_summary($summary);
 
+    # create a starter stream (TODO: reconsider this)
+    my $stream = new Fieldmapper::serial::stream;
+    $stream->distribution($sdist->id);
+    return $editor->event unless $editor->create_serial_stream($stream);
+
     return 0;
 }
 

Modified: branches/seials-integration/Open-ILS/xul/staff_client/chrome/content/main/constants.js
===================================================================
--- branches/seials-integration/Open-ILS/xul/staff_client/chrome/content/main/constants.js	2010-07-29 18:54:07 UTC (rev 17055)
+++ branches/seials-integration/Open-ILS/xul/staff_client/chrome/content/main/constants.js	2010-07-29 20:10:34 UTC (rev 17056)
@@ -423,7 +423,7 @@
     'XUL_RECORD_BUCKETS' : '/xul/server/cat/record_buckets.xul',
     'XUL_RECORD_BUCKETS_QUICK' : '/xul/server/cat/record_buckets_quick.xul',
     'XUL_REMOTE_BROWSER' : '/xul/server/util/rbrowser.xul',
-    'XUL_SERIAL_ITEM_EDITOR' : '/xul/server/serial/item_editor.xul',
+    'XUL_SERIAL_ITEM_EDITOR' : '/xul/server/serial/sitem_editor.xul',
     'XUL_SERIAL_NOTES' : '/xul/server/serial/notes.xul',
     'XUL_SERIAL_SELECT_AOU' : '/xul/server/serial/select_aou.xul',
     'XUL_SERIAL_SELECT_UNIT' : '/xul/server/serial/select_unit.xul',

Modified: branches/seials-integration/Open-ILS/xul/staff_client/server/serial/manage_subs.js
===================================================================
--- branches/seials-integration/Open-ILS/xul/staff_client/server/serial/manage_subs.js	2010-07-29 18:54:07 UTC (rev 17055)
+++ branches/seials-integration/Open-ILS/xul/staff_client/server/serial/manage_subs.js	2010-07-29 20:10:34 UTC (rev 17056)
@@ -1136,18 +1136,23 @@
 
             if (twisty) {
                 switch(row_type) {
-                    case 'aou' : obj.on_select_org(id,twisty); break;
+                    case 'aou' : obj.on_click_aou(id,twisty); break;
                     case 'ssub' : obj.on_select_ssub(id,twisty); break;
                     default: break;
                 }
             }
         }
 
+        if (!obj.focused_node_retrieve_id) return;
+
         var row_type = obj.focused_node_retrieve_id.split('_')[0];
         var id = obj.focused_node_retrieve_id.split('_')[1];
 
         if (sel_lists[row_type]) { // the type focused is in the selection (usually the case)
-            if (obj['on_click_' + row_type]) obj['on_click_' + row_type](sel_lists[row_type],twisty);
+            switch(row_type) {
+                case 'aou' : obj.on_click_aou(id,twisty); break;
+                default: if (obj['on_click_' + row_type]) obj['on_click_' + row_type](sel_lists[row_type],twisty);
+            }
         }
     },
 
@@ -1260,10 +1265,9 @@
         }
     },
 
-    'on_select_org' : function(org_id,twisty) {
+    'on_click_aou' : function(org_id,twisty) {
         var obj = this;
         var org = obj.data.hash.aou[ org_id ];
-        if (obj.data.hash.aout[ org.ou_type() ].depth() == 0 && ! get_bool( obj.data.hash.aout[ org.ou_type() ].can_have_vols() ) ) return;
         obj.funcs.push( function() { 
             document.getElementById('cmd_refresh_list').setAttribute('disabled','true'); 
             document.getElementById('cmd_show_libs_with_distributions').setAttribute('disabled','true'); 
@@ -1393,10 +1397,8 @@
             }
 
             if (document.getElementById('show_ssubs').checked) {
-                if (! ( obj.data.hash.aout[ org.ou_type() ].depth() == 0 && ! get_bool( obj.data.hash.aout[ org.ou_type() ].can_have_vols() ) )) {
-                    node.setAttribute('open','true');
-                    obj.funcs.push( function() { obj.on_select_org( org.id() ); } );
-                }
+                obj.funcs.push( function() { obj.on_click_aou( org.id() ); } );
+                node.setAttribute('open','true');
             }
 
         } catch(E) {
@@ -1609,8 +1611,10 @@
                         JSAN.use('util.functional');
                         
                         // get the actual node clicked to determine which editor to use
-                        var node = obj.list.node.contentView.getItemAtIndex(obj.list.node.view.selection.currentIndex);
-                        obj.focused_node_retrieve_id = node.getAttribute('retrieve_id');
+                        if (obj.list.node.view.selection.currentIndex > -1) {
+                            var node = obj.list.node.contentView.getItemAtIndex(obj.list.node.view.selection.currentIndex);
+                            obj.focused_node_retrieve_id = node.getAttribute('retrieve_id');
+                        }
 
                         var sel = obj.list.retrieve_selection();
                         obj.controller.view.sel_clip.disabled = sel.length < 1;
@@ -1641,14 +1645,11 @@
         var obj = this;
         try {
             var found_aou = false; var found_ssub = false; var found_sdist = false; var found_siss = false; var found_scap = false; var found_sdist_group = false; var found_siss_group = false; var found_scap_group = false;
-            var found_aou_with_can_have_vols = false;
             for (var i = 0; i < obj.sel_list.length; i++) {
                 var type = obj.sel_list[i].split(/_/)[0];
                 switch(type) {
                     case 'aou' : 
                         found_aou = true; 
-                        var org = obj.data.hash.aou[ obj.sel_list[i].split(/_/)[1] ];
-                        if ( get_bool( obj.data.hash.aout[ org.ou_type() ].can_have_vols() ) ) found_aou_with_can_have_vols = true;
                     break;
                     case 'ssub' : found_ssub = true; break;
                     case 'sdist' : found_sdist = true; break;
@@ -1672,7 +1673,7 @@
             obj.controller.view.cmd_mark_subscription.setAttribute('disabled','true');
             obj.controller.view.cmd_transfer_subscription.setAttribute('disabled','true');
             obj.controller.view.cmd_transfer_sdists.setAttribute('disabled','true');
-            if (found_aou && found_aou_with_can_have_vols) {
+            if (found_aou) {
                 obj.controller.view.cmd_add_subscriptions.setAttribute('disabled','false');
                 obj.controller.view.cmd_mark_library.setAttribute('disabled','false');
             }



More information about the open-ils-commits mailing list