TPAC: Display public hold notes in user holds list user/dbs/tpac_public_hold_notes
authorDan Scott <dscott@laurentian.ca>
Mon, 30 Dec 2013 06:47:19 +0000 (01:47 -0500)
committerDan Scott <dscott@laurentian.ca>
Mon, 30 Dec 2013 07:10:22 +0000 (02:10 -0500)
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 <dscott@laurentian.ca>
Open-ILS/src/templates/opac/css/style.css.tt2
Open-ILS/src/templates/opac/myopac/holds.tt2
Open-ILS/tests/datasets/sql/env_create.sql

index a40d376..9be5bff 100644 (file)
@@ -886,6 +886,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;
index e6ddb5a..18eadc2 100644 (file)
                 <th>[% l('Cancel if not filled by') %]</th>
                 <th>[% l('Active') %]</th>
                 <th>[% l('Status') %]</th>
+                <th>[% l('Notes') %]</th>
             </tr>
             </thead>
             <tbody id="holds_temp_parent">
                             [% PROCESS get_hold_status hold=hold; %]
                         </div>
                     </td>
+                    <td class="hold_notes">
+                    [%- FOREACH pubnote IN ahr.notes;
+                        IF pubnote.pub == 't';
+                    %]
+                        <div class="hold_note">
+                            <span class="hold_note_title">[% pubnote.title | html %]</span>
+                            <br />
+                            <span class="hold_note_body">[% pubnote.body | html %]</span>
+                        </div>
+                    [%- END; END; %]
+                    </td>
                     <td class="opac-auto-161">
                         <a href="[% mkurl(ctx.opac_root _ '/myopac/holds/edit', {id => ahr.id}) %]">Edit</a>
                     </td>
index 9dedb06..d13c27f 100644 (file)
@@ -157,6 +157,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;