From d9f7a20150f01071d36e4f9057b6cb63aca24953 Mon Sep 17 00:00:00 2001 From: miker Date: Thu, 19 Jun 2008 03:07:33 +0000 Subject: [PATCH] add opac_visible flag to config.copy_status; make Reserves status "available" in counts git-svn-id: svn://svn.open-ils.org/ILS/trunk@9864 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/examples/fm_IDL.xml | 1 + .../Application/Storage/CDBI/config.pm | 2 +- .../Application/Storage/Publisher/biblio.pm | 4 +-- .../Application/Storage/Publisher/metabib.pm | 8 +++--- Open-ILS/src/sql/Pg/002.schema.config.sql | 3 ++- .../src/sql/Pg/300.schema.staged_search.sql | 3 +-- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 16 +++++------ .../web/conify/global/config/copy_status.html | 27 ++++++++++++++----- 8 files changed, 40 insertions(+), 24 deletions(-) diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index be53ae1c74..9d2b981ceb 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -1532,6 +1532,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/config.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/config.pm index a2e1fa5fa2..64fb180726 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/config.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/config.pm @@ -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; diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/biblio.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/biblio.pm index cb5a66c56c..6dece0a196 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/biblio.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/biblio.pm @@ -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 diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm index 0beac85852..797d4ee0ee 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm @@ -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}) { diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 7b5aeac889..e29a62d2f1 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -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 $$ /* diff --git a/Open-ILS/src/sql/Pg/300.schema.staged_search.sql b/Open-ILS/src/sql/Pg/300.schema.staged_search.sql index c663f5b894..8c91ba61b2 100644 --- a/Open-ILS/src/sql/Pg/300.schema.staged_search.sql +++ b/Open-ILS/src/sql/Pg/300.schema.staged_search.sql @@ -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 ) ) diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index 22d3fb7318..3dadb7d116 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -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')); diff --git a/Open-ILS/web/conify/global/config/copy_status.html b/Open-ILS/web/conify/global/config/copy_status.html index 21d88cb3f3..8b6f062888 100644 --- a/Open-ILS/web/conify/global/config/copy_status.html +++ b/Open-ILS/web/conify/global/config/copy_status.html @@ -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) { @@ -203,14 +206,26 @@ { 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; + } + } } ] ] -- 2.43.2