Add org unit settings for default status of newly added copies
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 20 Apr 2011 20:14:31 +0000 (20:14 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 20 Apr 2011 20:14:31 +0000 (20:14 +0000)
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@laurentian.ca>

git-svn-id: svn://svn.open-ils.org/ILS/trunk@20263 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/0523.data.default-copy-status.sql [new file with mode: 0644]
Open-ILS/xul/staff_client/chrome/content/cat/opac.js
Open-ILS/xul/staff_client/server/cat/util.js
Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js

index e2a36bb..5bbb33d 100644 (file)
@@ -57,7 +57,7 @@ CREATE TABLE config.upgrade_log (
     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,
index 31da634..011178a 100644 (file)
@@ -7968,3 +7968,19 @@ INSERT INTO config.org_unit_setting_type ( name, label, description, datatype )
         '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'
+);
diff --git a/Open-ILS/src/sql/Pg/upgrade/0523.data.default-copy-status.sql b/Open-ILS/src/sql/Pg/upgrade/0523.data.default-copy-status.sql
new file mode 100644 (file)
index 0000000..e3072f8
--- /dev/null
@@ -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;
index 47b45ea..2cce6c2 100644 (file)
@@ -193,6 +193,9 @@ function set_marc_edit() {
                                 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 @@ function set_marc_edit() {
                             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());
index fe87355..750de17 100644 (file)
@@ -517,6 +517,7 @@ cat.util.mark_item_missing = function(copy_ids) {
 
 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 @@ cat.util.fast_item_add = function(doc_id,cn_label,cp_barcode) {
             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 @@ cat.util.fast_item_add = function(doc_id,cn_label,cp_barcode) {
         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());
index f7a6847..e394dfb 100644 (file)
@@ -917,6 +917,9 @@ g.gather_copies = function() {
         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 @@ g.gather_copies = function() {
             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());