Merge branch 'master' of git+ssh://yeti.esilibrary.com/home/evergreen/evergreen-equin...
authorMike Rylander <mrylander@gmail.com>
Wed, 20 Apr 2011 23:44:37 +0000 (19:44 -0400)
committerMike Rylander <mrylander@gmail.com>
Wed, 20 Apr 2011 23:44:37 +0000 (19:44 -0400)
14 files changed:
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
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
Open-ILS/xul/staff_client/server/circ/checkin.js
Open-ILS/xul/staff_client/server/circ/checkout.js
Open-ILS/xul/staff_client/server/circ/renew.js
Open-ILS/xul/staff_client/server/circ/util.js
Open-ILS/xul/staff_client/server/locale/en-US/circ.properties
Open-ILS/xul/staff_client/server/locale/en-US/common.properties

index cd3294e..df81b27 100644 (file)
@@ -1478,7 +1478,7 @@ sub fleshed_circ_retrieve {
                                flesh                           => 4,
                                flesh_fields    => { 
                                        circ => [ qw/ target_copy / ],
-                                       acp => [ qw/ location status stat_cat_entry_copy_maps notes age_protect call_number / ],
+                                       acp => [ qw/ location status stat_cat_entry_copy_maps notes age_protect call_number parts / ],
                                        ascecm => [ qw/ stat_cat stat_cat_entry / ],
                                        acn => [ qw/ record / ],
                                }
index 20139f8..e4bb90f 100644 (file)
@@ -236,6 +236,7 @@ sub run_method {
                         $circulator->editor->update_asset_copy($copy);
                         $success_event->{"payload"}->{"record"} =
                             $U->record_to_mvr($copy->call_number->record);
+                        $success_event->{"payload"}->{"volume"} = $copy->call_number;
                         $copy->call_number($copy->call_number->id);
                         $success_event->{"payload"}->{"copy"} = $copy;
                     }
@@ -1497,6 +1498,7 @@ sub do_checkout {
         OpenILS::Event->new('SUCCESS',
             payload  => {
                 copy             => $U->unflesh_copy($self->copy),
+                volume           => $self->volume,
                 circ             => $self->circ,
                 record           => $record,
                 holds_fulfilled  => $self->fulfilled_holds,
@@ -3189,6 +3191,7 @@ sub checkin_flesh_events {
 
         my $payload         = {};
         $payload->{copy}    = $U->unflesh_copy($self->copy);
+        $payload->{volume}  = $self->volume;
         $payload->{record}  = $record,
         $payload->{circ}    = $self->circ;
         $payload->{transit} = $self->transit;
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());
index bc8ad97..7997ab5 100644 (file)
@@ -613,6 +613,7 @@ circ.checkin.prototype = {
                     'mbts' : checkin.circ ? checkin.circ.billable_transaction().summary() : null,
                     'mvr' : checkin.record,
                     'acp' : checkin.copy,
+                    'acn' : checkin.volume,
                     'au' : checkin.patron,
                     'status' : checkin.status,
                     'route_to' : checkin.route_to,
index a9319f0..9849b40 100644 (file)
@@ -426,7 +426,8 @@ circ.checkout.prototype = {
                                     'my' : {
                                     'circ' : checkout.payload.circ,
                                     'mvr' : checkout.payload.record,
-                                    'acp' : checkout.payload.copy
+                                    'acp' : checkout.payload.copy,
+                                    'acn' : checkout.payload.volume
                                     }
                                 },
                                 'to_top' : true
index b0ff2da..8dbe7c2 100644 (file)
@@ -354,6 +354,7 @@ circ.renew.prototype = {
                         'mbts' : renew.parent_circ ? renew.parent_circ.billable_transaction().summary() : null,
                         'mvr' : renew.record,
                         'acp' : renew.copy,
+                        'acn' : renew.volume,
                         'au' : renew.patron,
                         'status' : renew.status,
                         'route_to' : renew.route_to,
index a2a5789..3e13c55 100644 (file)
@@ -639,7 +639,9 @@ circ.util.columns = function(modify,params) {
             'hidden' : true,
             'editable' : false, 'render' : function(my) {
                 if (typeof my.acn == 'undefined') return '';
-                return (typeof my.acn.prefix() == 'object') ? my.acn.prefix().label() : my.acn.prefix();
+                return (typeof my.acn.prefix() == 'object')
+                    ? my.acn.prefix().label()
+                    : data.hash.acnp[ my.acn.prefix() ].label();
             },
             'persist' : 'hidden width ordinal'
         },
@@ -652,7 +654,9 @@ circ.util.columns = function(modify,params) {
             'hidden' : true,
             'editable' : false, 'render' : function(my) {
                 if (typeof my.acn == 'undefined') return '';
-                return (typeof my.acn.suffix() == 'object') ? my.acn.suffix().label() : my.acn.suffix();
+                return (typeof my.acn.suffix() == 'object')
+                    ? my.acn.suffix().label()
+                    : data.hash.acns[ my.acn.suffix() ].label();
             },
             'persist' : 'hidden width ordinal'
         },
@@ -2501,11 +2505,12 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che
         JSAN.use('util.date');
         JSAN.use('util.sound'); var sound = new util.sound();
 
-        error.sdump('D_DEBUG','check = ' + error.pretty_print( js2JSON( check ) ) );
+        dump('check = ' + error.pretty_print( js2JSON( check ) ) + '\n' );
 
         check.message = check.textcode;
 
         if (check.payload && check.payload.copy) { check.copy = check.payload.copy; }
+        if (check.payload && check.payload.volume) { check.volume = check.payload.volume; }
         if (check.payload && check.payload.record) { check.record = check.payload.record; }
         if (check.payload && check.payload.circ) { check.circ = check.payload.circ; }
         if (check.payload && check.payload.patron) { check.patron = check.payload.patron; }
index 508e404..66ed6a3 100644 (file)
@@ -238,8 +238,8 @@ staff.circ.utils.offline.use_time=Use Time
 staff.circ.utils.not_cataloged=Not Cataloged
 staff.circ.utils.retrieving=Retrieving...
 staff.circ.utils.owning_lib=Owning Library
-staff.circ.utils.prefix=Prefix
-staff.circ.utils.suffix=Suffix
+staff.circ.utils.prefix=CN Prefix
+staff.circ.utils.suffix=CN Suffix
 staff.circ.utils.label_class=Classification
 staff.circ.utils.loan_duration.short=Short
 staff.circ.utils.loan_duration.normal=Normal
index d67f83a..7f586bb 100644 (file)
@@ -157,11 +157,11 @@ staff.au_net_access_level_label=Internet Access
 staff.au_master_account_label=Group Lead
 staff.au_group_id_label=Group ID
 staff.au_id_label=User ID
-staff.au_name_prefix_label=Prefix
+staff.au_name_prefix_label=Name Prefix
 staff.au_family_name_label=Family Name
 staff.au_first_given_name_label=First Name
 staff.au_second_given_name_label=Middle Name
-staff.au_name_suffix_label=Suffix
+staff.au_name_suffix_label=Name Suffix
 staff.z39_50.search_class.author=Author
 staff.z39_50.search_class.isbn=ISBN
 staff.z39_50.search_class.issn=ISSN