[open-ils-commits] r20264 - in branches/rel_2_1/Open-ILS: src/sql/Pg src/sql/Pg/upgrade xul/staff_client/chrome/content/cat xul/staff_client/server/cat (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Apr 20 16:18:54 EDT 2011


Author: dbs
Date: 2011-04-20 16:18:48 -0400 (Wed, 20 Apr 2011)
New Revision: 20264

Added:
   branches/rel_2_1/Open-ILS/src/sql/Pg/upgrade/0523.data.default-copy-status.sql
Modified:
   branches/rel_2_1/Open-ILS/src/sql/Pg/002.schema.config.sql
   branches/rel_2_1/Open-ILS/src/sql/Pg/950.data.seed-values.sql
   branches/rel_2_1/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
   branches/rel_2_1/Open-ILS/xul/staff_client/server/cat/util.js
   branches/rel_2_1/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
Log:
Add org unit settings for default status of newly added copies

These two new org unit settings enable sites to control the
default status of newly added copies. The defaults match
the behaviour of the "Add Volumes" ("In Process") and 
"Fast Add" ("Available") interfaces as of Evergreen 1.6.1,
but sites can choose to have the copies go directly to
"Reshelving", "Available", or any other status defined in
config.copy_status.

The org unit settings are:

  * cat.default_copy_status_fast (for "Fast Add")
  * cat.default_copy_status_normal (for "Add Volumes")

Signed-off-by: Dan Scott <dscott at laurentian.ca>


Modified: branches/rel_2_1/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- branches/rel_2_1/Open-ILS/src/sql/Pg/002.schema.config.sql	2011-04-20 20:14:31 UTC (rev 20263)
+++ branches/rel_2_1/Open-ILS/src/sql/Pg/002.schema.config.sql	2011-04-20 20:18:48 UTC (rev 20264)
@@ -57,7 +57,7 @@
     install_date    TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
 );
 
-INSERT INTO config.upgrade_log (version) VALUES ('0522'); -- tsbere/phasefx
+INSERT INTO config.upgrade_log (version) VALUES ('0523'); -- dbs
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,

Modified: branches/rel_2_1/Open-ILS/src/sql/Pg/950.data.seed-values.sql
===================================================================
--- branches/rel_2_1/Open-ILS/src/sql/Pg/950.data.seed-values.sql	2011-04-20 20:14:31 UTC (rev 20263)
+++ branches/rel_2_1/Open-ILS/src/sql/Pg/950.data.seed-values.sql	2011-04-20 20:18:48 UTC (rev 20264)
@@ -7968,3 +7968,19 @@
         'coust', 'description'),
     'bool'
 );
+
+INSERT into config.org_unit_setting_type
+( name, label, description, datatype, fm_class ) VALUES
+( 'cat.default_copy_status_fast',
+  oils_i18n_gettext( 'cat.default_copy_status_fast', 'Cataloging: Default copy status (fast add)', 'coust', 'label'),
+  oils_i18n_gettext( 'cat.default_copy_status_fast', 'Default status when a copy is created using the "Fast Add" interface.', 'coust', 'description'),
+  'link', 'ccs'
+);
+
+INSERT into config.org_unit_setting_type
+( name, label, description, datatype, fm_class ) VALUES
+( 'cat.default_copy_status_normal',
+  oils_i18n_gettext( 'cat.default_copy_status_normal', 'Cataloging: Default copy status (normal)', 'coust', 'label'),
+  oils_i18n_gettext( 'cat.default_copy_status_normal', 'Default status when a copy is created using the normal volume/copy creator interface.', 'coust', 'description'),
+  'link', 'ccs'
+);

Copied: branches/rel_2_1/Open-ILS/src/sql/Pg/upgrade/0523.data.default-copy-status.sql (from rev 20263, trunk/Open-ILS/src/sql/Pg/upgrade/0523.data.default-copy-status.sql)
===================================================================
--- branches/rel_2_1/Open-ILS/src/sql/Pg/upgrade/0523.data.default-copy-status.sql	                        (rev 0)
+++ branches/rel_2_1/Open-ILS/src/sql/Pg/upgrade/0523.data.default-copy-status.sql	2011-04-20 20:18:48 UTC (rev 20264)
@@ -0,0 +1,21 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0523'); -- dbs
+
+INSERT into config.org_unit_setting_type
+( name, label, description, datatype, fm_class ) VALUES
+( 'cat.default_copy_status_fast',
+  oils_i18n_gettext( 'cat.default_copy_status_fast', 'Cataloging: Default copy status (fast add)', 'coust', 'label'),
+  oils_i18n_gettext( 'cat.default_copy_status_fast', 'Default status when a copy is created using the "Fast Add" interface.', 'coust', 'description'),
+  'link', 'ccs'
+);
+
+INSERT into config.org_unit_setting_type
+( name, label, description, datatype, fm_class ) VALUES
+( 'cat.default_copy_status_normal',
+  oils_i18n_gettext( 'cat.default_copy_status_normal', 'Cataloging: Default copy status (normal)', 'coust', 'label'),
+  oils_i18n_gettext( 'cat.default_copy_status_normal', 'Default status when a copy is created using the normal volume/copy creator interface.', 'coust', 'description'),
+  'link', 'ccs'
+);
+
+COMMIT;

Modified: branches/rel_2_1/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
===================================================================
--- branches/rel_2_1/Open-ILS/xul/staff_client/chrome/content/cat/opac.js	2011-04-20 20:14:31 UTC (rev 20263)
+++ branches/rel_2_1/Open-ILS/xul/staff_client/chrome/content/cat/opac.js	2011-04-20 20:18:48 UTC (rev 20264)
@@ -193,6 +193,9 @@
                                 return;
                             }
 
+                            // Get the default copy status; default to available if unset, per 1.6
+                            var fast_ccs = g.data.hash.aous['cat.default_copy_status_fast'] || 0;
+
                             var copy_obj = new acp();
                             copy_obj.id( -1 );
                             copy_obj.isnew('1');
@@ -206,7 +209,7 @@
                             copy_obj.fine_level(2); // Normal
                             copy_obj.loan_duration(2); // Normal
                             copy_obj.location(1); // Stacks
-                            copy_obj.status(5); // In Process
+                            copy_obj.status(fast_ccs);
                             copy_obj.circulate(get_db_true());
                             copy_obj.holdable(get_db_true());
                             copy_obj.opac_visible(get_db_true());

Modified: branches/rel_2_1/Open-ILS/xul/staff_client/server/cat/util.js
===================================================================
--- branches/rel_2_1/Open-ILS/xul/staff_client/server/cat/util.js	2011-04-20 20:14:31 UTC (rev 20263)
+++ branches/rel_2_1/Open-ILS/xul/staff_client/server/cat/util.js	2011-04-20 20:18:48 UTC (rev 20264)
@@ -517,6 +517,7 @@
 
 cat.util.fast_item_add = function(doc_id,cn_label,cp_barcode) {
     var error;
+    JSAN.use('OpenILS.data'); var data = new OpenILS.data();
     try {
 
         JSAN.use('util.error'); error = new util.error();
@@ -532,6 +533,9 @@
             return;
         }
 
+        // Get the default copy status; default to available if unset, per 1.6
+        var fast_ccs = data.hash.aous['cat.default_copy_status_fast'] || 0;
+
         var copy_obj = new acp();
         copy_obj.id( -1 );
         copy_obj.isnew('1');
@@ -545,7 +549,7 @@
         copy_obj.fine_level(2); // Normal
         copy_obj.loan_duration(2); // Normal
         copy_obj.location(1); // Stacks
-        copy_obj.status(5); // In Process
+        copy_obj.status(fast_ccs);
         copy_obj.circulate(get_db_true());
         copy_obj.holdable(get_db_true());
         copy_obj.opac_visible(get_db_true());

Modified: branches/rel_2_1/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
===================================================================
--- branches/rel_2_1/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js	2011-04-20 20:14:31 UTC (rev 20263)
+++ branches/rel_2_1/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js	2011-04-20 20:18:48 UTC (rev 20264)
@@ -917,6 +917,9 @@
         var copies = [];
         var volume_data = {};
 
+        // Get the default copy status; default to "In Process" if unset, per 1.6
+        var normal_ccs = g.data.hash.aous['cat.default_copy_status_normal'] || 5;
+
         function new_copy(acp_id,ou_id,acn_id,barcode) {
             var copy = new acp();
             copy.id( acp_id );
@@ -931,7 +934,7 @@
             copy.fine_level(2); // Normal
             copy.loan_duration(2); // Normal
             copy.location(1); // Stacks
-            copy.status(5); // In Process
+            copy.status(normal_ccs);
             copy.circulate(get_db_true());
             copy.holdable(get_db_true());
             copy.opac_visible(get_db_true());



More information about the open-ils-commits mailing list