add opac_visible flag to config.copy_status; make Reserves status "available" in...
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 19 Jun 2008 03:07:33 +0000 (03:07 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 19 Jun 2008 03:07:33 +0000 (03:07 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@9864 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/examples/fm_IDL.xml
Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/config.pm
Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/biblio.pm
Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/300.schema.staged_search.sql
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/web/conify/global/config/copy_status.html

index be53ae1..9d2b981 100644 (file)
@@ -1532,6 +1532,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <field name="holdable" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field name="id" oils_obj:array_position="4" oils_persist:virtual="false" reporter:selector="name" reporter:datatype="id"/>
                        <field name="name" oils_obj:array_position="5" oils_persist:virtual="false"  reporter:datatype="text" oils_persist:i18n="true"/>
+                       <field name="opac_visible" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="bool"/>
                </fields>
                <links/>
         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
index a2e1fa5..64fb180 100644 (file)
@@ -73,7 +73,7 @@ package config::copy_status;
 use base qw/config/;
 __PACKAGE__->table('config_copy_status');
 __PACKAGE__->columns(Primary => 'id');
-__PACKAGE__->columns(Essential => qw/name holdable/);
+__PACKAGE__->columns(Essential => qw/name holdable opac_visible/);
 #-------------------------------------------------------------------------------
 
 package config::net_access_level;
index cb5a66c..6dece0a 100644 (file)
@@ -61,7 +61,7 @@ sub record_copy_count {
                                        $visible
                                        AND cn.deleted IS FALSE
                                        AND cp.deleted IS FALSE
-                                       AND cp.status IN (0,7))
+                                       AND cp.status IN (0,7,12))
                        ) AS available,
                        sum(
                                (SELECT count(cp.id)
@@ -331,7 +331,7 @@ sub global_record_copy_count {
                                        JOIN $cs_table cs ON (cs.id = cp.status)
                                        JOIN $cl_table cl ON (cl.id = cp.location)
                                  WHERE cn.record = ?
-                                       AND cp.status IN (0,7)
+                                       AND cp.status IN (0,7,12)
                                        $copies_visible
                                  GROUP BY 1
                                                UNION
index 0beac85..797d4ee 100644 (file)
@@ -335,7 +335,7 @@ sub metarecord_copy_count {
                                        JOIN $cl_table cl ON (cp.location = cl.id)
                                        JOIN $descendants a ON (cp.circ_lib = a.id)
                                  WHERE r.metarecord = ?
-                                       AND cp.status IN (0,7)
+                                       AND cp.status IN (0,7,12)
                                        AND cn.deleted IS FALSE
                                        AND cp.deleted IS FALSE
                                        $copies_visible
@@ -1467,7 +1467,7 @@ sub postfilter_search_multi_class_fts {
        my ($oa_filter, $ol_filter, $olf_filter) = ('','','');
 
        if ($args{available}) {
-               $avail_filter = ' AND cp.status IN (0,7)';
+               $avail_filter = ' AND cp.status IN (0,7,12)';
        }
 
        if (my $a = $args{audience}) {
@@ -1957,7 +1957,7 @@ sub biblio_search_multi_class_fts {
        my ($oa_filter, $ol_filter, $olf_filter) = ('','','');
 
        if ($args{available}) {
-               $avail_filter = ' AND cp.status IN (0,7)';
+               $avail_filter = ' AND cp.status IN (0,7,12)';
        }
 
        if (my $a = $args{audience}) {
@@ -2349,7 +2349,7 @@ sub staged_fts {
        my (@statuses,@locations,@types,@forms,@lang,@aud,@lit_form,@vformats,@bib_level);
 
        if ($args{available}) {
-               @statuses = (0,7);
+               @statuses = (0,7,12);
        }
 
        if (my $s = $args{locations}) {
index 7b5aeac..e29a62d 100644 (file)
@@ -355,7 +355,8 @@ $$;
 CREATE TABLE config.copy_status (
        id              SERIAL  PRIMARY KEY,
        name            TEXT    NOT NULL UNIQUE,
-       holdable        BOOL    NOT NULL DEFAULT FALSE
+       holdable        BOOL    NOT NULL DEFAULT FALSE,
+       opac_visible    BOOL    NOT NULL DEFAULT FALSE
 );
 COMMENT ON TABLE config.copy_status IS $$
 /*
index c663f5b..8c91ba6 100644 (file)
@@ -460,7 +460,7 @@ BEGIN
                     JOIN config.copy_status cs ON (cp.status = cs.id)
               WHERE NOT cn.deleted
                     AND NOT cp.deleted
-                    AND cs.holdable
+                    AND cs.opac_visible
                     AND cl.opac_visible
                     AND cp.opac_visible
                     AND a.opac_visible
@@ -481,7 +481,6 @@ BEGIN
                     JOIN asset.copy cp ON (cp.call_number = cn.id)
                     JOIN actor.org_unit a ON (cp.circ_lib = a.id)
                     JOIN asset.copy_location cl ON (cp.location = cl.id)
-                    JOIN config.copy_status cs ON (cp.status = cs.id)
               WHERE NOT cn.deleted
                     AND NOT cp.deleted
                     AND cp.circ_lib IN ( SELECT * FROM search.explode_array( search_org_list ) )
index 22d3fb7..3dadb7d 100644 (file)
@@ -97,23 +97,23 @@ INSERT INTO config.rule_recuring_fine VALUES
 INSERT INTO config.rule_age_hold_protect VALUES (DEFAULT, oils_i18n_gettext('3month'), '3 months', 0);
 INSERT INTO config.rule_age_hold_protect VALUES (DEFAULT, oils_i18n_gettext('6month'), '6 months', 2);
 
-INSERT INTO config.copy_status (id,name,holdable)              VALUES (0,oils_i18n_gettext('Available'),'t');
+INSERT INTO config.copy_status (id,name,holdable,opac_visible)         VALUES (0,oils_i18n_gettext('Available'),'t','t');
 
-INSERT INTO config.copy_status (id,name,holdable)              VALUES (1,oils_i18n_gettext('Checked out'),'t');
+INSERT INTO config.copy_status (id,name,holdable,opac_visible)         VALUES (1,oils_i18n_gettext('Checked out'),'t','t');
 
 INSERT INTO config.copy_status (id,name)                       VALUES (2,oils_i18n_gettext('Bindery'));
 INSERT INTO config.copy_status (id,name)                       VALUES (3,oils_i18n_gettext('Lost'));
 INSERT INTO config.copy_status (id,name)                       VALUES (4,oils_i18n_gettext('Missing'));
 
-INSERT INTO config.copy_status (id,name,holdable)              VALUES (5,oils_i18n_gettext('In process'),'t');
-INSERT INTO config.copy_status (id,name,holdable)              VALUES (6,oils_i18n_gettext('In transit'),'t');
-INSERT INTO config.copy_status (id,name,holdable)              VALUES (7,oils_i18n_gettext('Reshelving'),'t');
-INSERT INTO config.copy_status (id,name,holdable)              VALUES (8,oils_i18n_gettext('On holds shelf'),'t');
-INSERT INTO config.copy_status (id,name,holdable)              VALUES (9,oils_i18n_gettext('On order'),'t');
+INSERT INTO config.copy_status (id,name,holdable,opac_visible)         VALUES (5,oils_i18n_gettext('In process'),'t','t');
+INSERT INTO config.copy_status (id,name,holdable,opac_visible)         VALUES (6,oils_i18n_gettext('In transit'),'t','t');
+INSERT INTO config.copy_status (id,name,holdable,opac_visible)         VALUES (7,oils_i18n_gettext('Reshelving'),'t','t');
+INSERT INTO config.copy_status (id,name,holdable,opac_visible)         VALUES (8,oils_i18n_gettext('On holds shelf'),'t','t');
+INSERT INTO config.copy_status (id,name,holdable,opac_visible)         VALUES (9,oils_i18n_gettext('On order'),'t','t');
 
 INSERT INTO config.copy_status (id,name)                       VALUES (10,oils_i18n_gettext('ILL'));
 INSERT INTO config.copy_status (id,name)                       VALUES (11,oils_i18n_gettext('Cataloging'));
-INSERT INTO config.copy_status (id,name)                       VALUES (12,oils_i18n_gettext('Reserves'));
+INSERT INTO config.copy_status (id,name,opac_visible)                  VALUES (12,oils_i18n_gettext('Reserves'),'t');
 INSERT INTO config.copy_status (id,name)                       VALUES (13,oils_i18n_gettext('Discard/Weed'));
 INSERT INTO config.copy_status (id,name)                       VALUES (14,oils_i18n_gettext('Damaged'));
 
index 21d88cb..8b6f062 100644 (file)
@@ -88,6 +88,9 @@
                             if (attr == 'holdable' && typeof n != 'string')
                                 this.setValue(item, 'holdable', n ? 't' : 'f');
 
+                            if (attr == 'opac_visible' && typeof n != 'string')
+                                this.setValue(item, 'opac_visible', n ? 't' : 'f');
+
                         };
 
                         dojo.addOnUnload( function (event) {
                                                                                { name : "Holdable",
                                                                                  field : "holdable",
                                                                                  editor : dojox.grid.editors.bool,
-                                          get : function (row) {
-                                               var r = window.status_data_model.getRow(row);
+                                                                                 get : function (row) {
+                                                                                       var r = window.status_data_model.getRow(row);
                                                                                        if (r) {
-                                                       var h = r.holdable;
-                                                           if (h == 't' || h === true) return true;
-                                                               return false;
+                                                                                               var h = r.holdable;
+                                                                                               if (h == 't' || h === true) return true;
+                                                                                               return false;
                                                                                        }
-                                          }
+                                                                                 }
+                                                                               },
+                                                                               { name : "OPAC Visible",
+                                                                                 field : "opac_visible",
+                                                                                 editor : dojox.grid.editors.bool,
+                                                                                 get : function (row) {
+                                                                                       var r = window.status_data_model.getRow(row);
+                                                                                       if (r) {
+                                                                                               var h = r.opac_visible;
+                                                                                               if (h == 't' || h === true) return true;
+                                                                                               return false;
+                                                                                       }
+                                                                                 }
                                                                                }
                                                                        ]
                                                                ]