From c9bc6b538697cb642f05e75052113e3b4f881b62 Mon Sep 17 00:00:00 2001 From: dbs Date: Fri, 27 Aug 2010 21:11:05 +0000 Subject: [PATCH] Add label_prefix and label_suffix columns to asset.copy_location These columns will be used to (optionally) set label prefixes and suffixes when printing spine labels for copies at a given copy location. The copy location editor has been taught to be aware of these new columns, but right now a NULL prefix or suffix will be turned into an empty string once the copy location has been edited. That might not be a big deal, but I'm a foolish hobgoblin and like consistency. git-svn-id: svn://svn.open-ils.org/ILS/trunk@17363 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/examples/fm_IDL.xml | 2 ++ Open-ILS/src/sql/Pg/040.schema.asset.sql | 2 ++ .../xul/staff_client/server/admin/copy_locations.js | 20 ++++++++++++++++++++ .../staff_client/server/admin/copy_locations.xhtml | 6 ++++++ 4 files changed, 30 insertions(+) diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index eb79fa0a6..639018dc6 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -3058,6 +3058,8 @@ SELECT usr, + + diff --git a/Open-ILS/src/sql/Pg/040.schema.asset.sql b/Open-ILS/src/sql/Pg/040.schema.asset.sql index c09d080cf..a3fb73dd4 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/xul/staff_client/server/admin/copy_locations.js b/Open-ILS/xul/staff_client/server/admin/copy_locations.js index 51e5da0a2..32d406e4d 100644 --- a/Open-ILS/xul/staff_client/server/admin/copy_locations.js +++ b/Open-ILS/xul/staff_client/server/admin/copy_locations.js @@ -160,6 +160,8 @@ function clBuildRow( tbody, row, cl ) { appendClear($n( row, 'cl_hold_verify'), (isTrue(cl.hold_verify())) ? _TRUE.cloneNode(true) : _FALSE.cloneNode(true) ); appendClear($n( row, 'cl_visible'), (isTrue(cl.opac_visible())) ? _TRUE.cloneNode(true) : _FALSE.cloneNode(true) ); appendClear($n( row, 'cl_circulate'), (isTrue(cl.circulate())) ? _TRUE.cloneNode(true) : _FALSE.cloneNode(true) ); + $n( row, 'cl_label_prefix').appendChild(text(cl.label_prefix())); + $n( row, 'cl_label_suffix').appendChild(text(cl.label_suffix())); var edit = $n( row, 'cl_edit'); edit.onclick = function() { clEdit( cl, tbody, row ); }; @@ -201,6 +203,22 @@ function clEdit( cl, tbody, row ) { if(isTrue(cl.hold_verify())) arr[6].checked = true; else arr[7].checked = true; + var label_prefix = $n(r, 'cl_edit_label_prefix'); + if (cl.label_prefix()) { + label_prefix.setAttribute('size', cl.label_prefix().length + 3); + } else { + label_prefix.setAttribute('size', 3); + } + label_prefix.value = cl.label_prefix(); + + var label_suffix = $n(r, 'cl_edit_label_suffix'); + if (cl.label_suffix()) { + label_suffix.setAttribute('size', cl.label_suffix().length + 3); + } else { + label_suffix.setAttribute('size', 3); + } + label_suffix.value = cl.label_suffix(); + $n(r, 'cl_edit_cancel').onclick = function(){cleanTbody(tbody,'edit');} $n(r, 'cl_edit_commit').onclick = function(){clEditCommit( tbody, r, cl ); } @@ -234,6 +252,8 @@ function clEditCommit( tbody, r, cl ) { if(arr[6].checked) cl.hold_verify(1); else cl.hold_verify(0); cl.name($n(r, 'cl_edit_name').value); + cl.label_prefix($n(r, 'cl_edit_label_prefix').value); + cl.label_suffix($n(r, 'cl_edit_label_suffix').value); var req = new Request( UPDATE_CL, SESSION, cl ); req.send(true); diff --git a/Open-ILS/xul/staff_client/server/admin/copy_locations.xhtml b/Open-ILS/xul/staff_client/server/admin/copy_locations.xhtml index b1f590655..2a1ff8eae 100644 --- a/Open-ILS/xul/staff_client/server/admin/copy_locations.xhtml +++ b/Open-ILS/xul/staff_client/server/admin/copy_locations.xhtml @@ -116,6 +116,8 @@ &staff.server.admin.copy_locations.editor.hold_verify; &staff.server.admin.copy_locations.editor.opac_visible; &staff.server.admin.copy_locations.editor.circulate; + Label prefix + Label suffix &staff.server.admin.copy_locations.editor.edit; &staff.server.admin.copy_locations.editor.delete; @@ -131,6 +133,8 @@ + + @@ -194,6 +198,8 @@ + + -- 2.11.0