From f90cd00be05c706087f62e9c4173c6c43a48ddb1 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Mon, 30 Dec 2013 01:47:19 -0500 Subject: [PATCH] TPAC: Display public hold notes in user holds list If a given hold has a note marked as public, and not marked for staff, then display the note in the My Account -> Holds list. This enhancement also includes sample notes for each hold, to include data that ensures that the TPAC does not display any hold notes that are not marked public, or which are marked for staff. Signed-off-by: Dan Scott Signed-off-by: Lebbeous Fogle-Weekley --- Open-ILS/src/templates/opac/css/style.css.tt2 | 7 +++++++ Open-ILS/src/templates/opac/myopac/holds.tt2 | 12 ++++++++++++ Open-ILS/tests/datasets/sql/env_create.sql | 16 ++++++++++++++++ 3 files changed, 35 insertions(+) diff --git a/Open-ILS/src/templates/opac/css/style.css.tt2 b/Open-ILS/src/templates/opac/css/style.css.tt2 index 7f2107138e..a1384abecd 100644 --- a/Open-ILS/src/templates/opac/css/style.css.tt2 +++ b/Open-ILS/src/templates/opac/css/style.css.tt2 @@ -873,6 +873,13 @@ table.acct_notes th { border-collapse: collapse; } +.hold_notes { + text-transform: none; + font-weight: normal; +} + +.hold_note_title { font-weight: bold; } + #acct_checked_main_header td, #acct_holds_main_header td, #acct_checked_hist_header td, #acct_list_header td, #acct_list_header_anon td, #temp_list_holds td { background: [% css_colors.accent_lighter2 %]; padding: 10px; diff --git a/Open-ILS/src/templates/opac/myopac/holds.tt2 b/Open-ILS/src/templates/opac/myopac/holds.tt2 index e6ddb5a199..18eadc2fe4 100644 --- a/Open-ILS/src/templates/opac/myopac/holds.tt2 +++ b/Open-ILS/src/templates/opac/myopac/holds.tt2 @@ -121,6 +121,7 @@ [% l('Cancel if not filled by') %] [% l('Active') %] [% l('Status') %] + [% l('Notes') %] @@ -179,6 +180,17 @@ [% PROCESS get_hold_status hold=hold; %] + + [%- FOREACH pubnote IN ahr.notes; + IF pubnote.pub == 't'; + %] +
+ [% pubnote.title | html %] +
+ [% pubnote.body | html %] +
+ [%- END; END; %] + Edit diff --git a/Open-ILS/tests/datasets/sql/env_create.sql b/Open-ILS/tests/datasets/sql/env_create.sql index b1ef2ac299..52c36035e7 100644 --- a/Open-ILS/tests/datasets/sql/env_create.sql +++ b/Open-ILS/tests/datasets/sql/env_create.sql @@ -194,6 +194,22 @@ BEGIN frozen, thawdate ); + + -- Create hold notes for staff-placed holds: 1 public, 1 private + IF requestor != patron_id THEN + INSERT INTO action.hold_request_note (hold, title, body, pub, staff) + VALUES ( + currval('action.hold_request_id_seq'), + 'Public: Title of hold# ' || currval('action.hold_request_id_seq'), + 'Public: Hold note body for ' || currval('action.hold_request_id_seq'), + TRUE, TRUE + ), ( + currval('action.hold_request_id_seq'), + 'Private: title of hold# ' || currval('action.hold_request_id_seq'), + 'Private: Hold note body for ' || currval('action.hold_request_id_seq'), + FALSE, TRUE + ); + END IF; END; $$ LANGUAGE PLPGSQL; -- 2.11.0