From c036b58ae295d817643f876210e5434f7f3fd977 Mon Sep 17 00:00:00 2001 From: dbs Date: Thu, 2 Sep 2010 03:29:51 +0000 Subject: [PATCH] Backport spine label editing and printing enhancements from trunk * Automatically add prefix and/or suffix to a spine label if set in the copy locations editor * Set default font size, family, and weight along with label height, width, and left margin for each library via library settings editor. * Navigate up and down using cursor keys and insert/delete lines with the insert/delete keys. * Provide some basic LC formatting for line wrapping. * Use different print strategies depending on whether we're using xulrunner 1.9.0 or 1.9.2. git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_2_0@17437 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +- Open-ILS/src/sql/Pg/040.schema.asset.sql | 2 + Open-ILS/src/sql/Pg/950.data.seed-values.sql | 61 +++++++++++++++++++++- .../src/sql/Pg/upgrade/0380.data.spine_label.sql | 56 ++++++++++++++++++++ .../upgrade/0381.data.spine_label_font_weight.sql | 21 ++++++++ .../0382.schema.asset_copy_location_callnums.sql | 10 ++++ Open-ILS/web/opac/locale/en-US/lang.dtd | 9 ++++ 7 files changed, 159 insertions(+), 2 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/0380.data.spine_label.sql create mode 100644 Open-ILS/src/sql/Pg/upgrade/0381.data.spine_label_font_weight.sql create mode 100644 Open-ILS/src/sql/Pg/upgrade/0382.schema.asset_copy_location_callnums.sql diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 46cfd93fb0..8d57dbdb8c 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -68,7 +68,7 @@ CREATE TABLE config.upgrade_log ( install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() ); -INSERT INTO config.upgrade_log (version) VALUES ('0379'); -- phasefx +INSERT INTO config.upgrade_log (version) VALUES ('0381'); -- dbs CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/040.schema.asset.sql b/Open-ILS/src/sql/Pg/040.schema.asset.sql index c09d080cfb..a3fb73dd4c 100644 --- a/Open-ILS/src/sql/Pg/040.schema.asset.sql +++ b/Open-ILS/src/sql/Pg/040.schema.asset.sql @@ -29,6 +29,8 @@ CREATE TABLE asset.copy_location ( hold_verify BOOL NOT NULL DEFAULT FALSE, opac_visible BOOL NOT NULL DEFAULT TRUE, circulate BOOL NOT NULL DEFAULT TRUE, + label_prefix TEXT, + label_suffix TEXT, CONSTRAINT acl_name_once_per_lib UNIQUE (name, owning_lib) ); 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 c735b3d6d3..384b341aa2 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -6640,7 +6640,57 @@ INSERT INTO config.org_unit_setting_type ( name, label, description, datatype, f 'ccs' ); --- 0383.data.org-setting-circ.do_not_tally_claims_returned.sql +-- 0380.data.spine_label.sql Add spine label preferences +INSERT INTO config.org_unit_setting_type (name, label, description, datatype) + VALUES + ('cat.label.font.size', + oils_i18n_gettext('cat.label.font.size', + 'Cataloging: Spine and pocket label font size', 'coust', 'label'), + oils_i18n_gettext('cat.label.font.size', + 'Set the default font size for spine and pocket labels', 'coust', 'description'), + 'integer' + ) + ,('cat.label.font.family', + oils_i18n_gettext('cat.label.font.family', + 'Cataloging: Spine and pocket label font family', 'coust', 'label'), + oils_i18n_gettext('cat.label.font.family', + 'Set the preferred font family for spine and pocket labels. You can specify a list of fonts, separated by commas, in order of preference; the system will use the first font it finds with a matching name. For example, "Arial, Helvetica, serif".', + 'coust', 'description'), + 'string' + ) + ,('cat.spine.line.width', + oils_i18n_gettext('cat.spine.line.width', + 'Cataloging: Spine label line width', 'coust', 'label'), + oils_i18n_gettext('cat.spine.line.width', + 'Set the default line width for spine labels in number of characters. This specifies the boundary at which lines must be wrapped.', + 'coust', 'description'), + 'integer' + ) + ,('cat.spine.line.height', + oils_i18n_gettext('cat.spine.line.height', + 'Cataloging: Spine label maximum lines', 'coust', 'label'), + oils_i18n_gettext('cat.spine.line.height', + 'Set the default maximum number of lines for spine labels.', + 'coust', 'description'), + 'integer' + ) + ,('cat.spine.line.margin', + oils_i18n_gettext('cat.spine.line.margin', + 'Cataloging: Spine label left margin', 'coust', 'label'), + oils_i18n_gettext('cat.spine.line.margin', + 'Set the left margin for spine labels in number of characters.', + 'coust', 'description'), + 'integer' + ) + ,('cat.label.font.weight', + oils_i18n_gettext('cat.label.font.weight', + 'Cataloging: Spine and pocket label font weight', 'coust', 'label'), + oils_i18n_gettext('cat.label.font.weight', + 'Set the preferred font weight for spine and pocket labels. You can specify "normal", "bold", "bolder", or "lighter".', + 'coust', 'description'), + 'string' + ) +; INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) VALUES ( 'circ.do_not_tally_claims_returned', @@ -6656,4 +6706,13 @@ INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) 'description'), 'bool' ); +INSERT INTO actor.org_unit_setting (org_unit, name, value) VALUES + (1, 'cat.spine.line.margin', 0) + ,(1, 'cat.spine.line.height', 9) + ,(1, 'cat.spine.line.width', 8) + ,(1, 'cat.label.font.family', '"monospace"') + ,(1, 'cat.label.font.size', 10) + ,(1, 'cat.label.font.weight', '"normal"') +; + diff --git a/Open-ILS/src/sql/Pg/upgrade/0380.data.spine_label.sql b/Open-ILS/src/sql/Pg/upgrade/0380.data.spine_label.sql new file mode 100644 index 0000000000..ae414d105e --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0380.data.spine_label.sql @@ -0,0 +1,56 @@ +BEGIN; + +INSERT INTO config.upgrade_log (version) VALUES ('0380'); -- dbs + +INSERT INTO config.org_unit_setting_type (name, label, description, datatype) + VALUES + ('cat.label.font.size', + oils_i18n_gettext('cat.label.font.size', + 'Cataloging: Spine and pocket label font size', 'coust', 'label'), + oils_i18n_gettext('cat.label.font.size', + 'Set the default font size for spine and pocket labels', 'coust', 'description'), + 'integer' + ) + ,('cat.label.font.family', + oils_i18n_gettext('cat.label.font.family', + 'Cataloging: Spine and pocket label font family', 'coust', 'label'), + oils_i18n_gettext('cat.label.font.family', + 'Set the preferred font family for spine and pocket labels. You can specify a list of fonts, separated by commas, in order of preference; the system will use the first font it finds with a matching name. For example, "Arial, Helvetica, serif".', + 'coust', 'description'), + 'string' + ) + ,('cat.spine.line.width', + oils_i18n_gettext('cat.spine.line.width', + 'Cataloging: Spine label line width', 'coust', 'label'), + oils_i18n_gettext('cat.spine.line.width', + 'Set the default line width for spine labels in number of characters. This specifies the boundary at which lines must be wrapped.', + 'coust', 'description'), + 'integer' + ) + ,('cat.spine.line.height', + oils_i18n_gettext('cat.spine.line.height', + 'Cataloging: Spine label maximum lines', 'coust', 'label'), + oils_i18n_gettext('cat.spine.line.height', + 'Set the default maximum number of lines for spine labels.', + 'coust', 'description'), + 'integer' + ) + ,('cat.spine.line.margin', + oils_i18n_gettext('cat.spine.line.margin', + 'Cataloging: Spine label left margin', 'coust', 'label'), + oils_i18n_gettext('cat.spine.line.margin', + 'Set the left margin for spine labels in number of characters.', + 'coust', 'description'), + 'integer' + ) +; + +INSERT INTO actor.org_unit_setting (org_unit, name, value) VALUES + (1, 'cat.spine.line.margin', 0) + ,(1, 'cat.spine.line.height', 9) + ,(1, 'cat.spine.line.width', 8) + ,(1, 'cat.label.font.family', '"monospace"') + ,(1, 'cat.label.font.size', 10) +; + +COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/0381.data.spine_label_font_weight.sql b/Open-ILS/src/sql/Pg/upgrade/0381.data.spine_label_font_weight.sql new file mode 100644 index 0000000000..a8952c7748 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0381.data.spine_label_font_weight.sql @@ -0,0 +1,21 @@ +BEGIN; + +INSERT INTO config.upgrade_log (version) VALUES ('0381'); -- dbs + +INSERT INTO config.org_unit_setting_type (name, label, description, datatype) + VALUES + ('cat.label.font.weight', + oils_i18n_gettext('cat.label.font.weight', + 'Cataloging: Spine and pocket label font weight', 'coust', 'label'), + oils_i18n_gettext('cat.label.font.weight', + 'Set the preferred font weight for spine and pocket labels. You can specify "normal", "bold", "bolder", or "lighter".', + 'coust', 'description'), + 'string' + ) +; + +INSERT INTO actor.org_unit_setting (org_unit, name, value) VALUES + (1, 'cat.label.font.weight', '"normal"') +; + +COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/0382.schema.asset_copy_location_callnums.sql b/Open-ILS/src/sql/Pg/upgrade/0382.schema.asset_copy_location_callnums.sql new file mode 100644 index 0000000000..0df40bd1db --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0382.schema.asset_copy_location_callnums.sql @@ -0,0 +1,10 @@ +BEGIN; + +INSERT INTO config.upgrade_log (version) VALUES ('0382'); -- dbs + +-- Start picking up call number label prefixes and suffixes +-- from asset.copy_location +ALTER TABLE asset.copy_location ADD COLUMN label_prefix TEXT; +ALTER TABLE asset.copy_location ADD COLUMN label_suffix TEXT; + +COMMIT; diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index bff5a6fa30..466cb6af4b 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -1817,10 +1817,14 @@ + + + + @@ -2560,6 +2564,8 @@ + + @@ -2651,16 +2657,19 @@ + + + -- 2.11.0