From 7bcd729358b81a891b4416414c2d096c632ab5f1 Mon Sep 17 00:00:00 2001 From: Owen Leonard <oleonard@myacpl.org> Date: Mon, 14 Nov 2022 18:10:07 +0000 Subject: [PATCH] Bug 32199: Add page-section to various patron pages This patch adds a .page-section div to various patron-related pages in order to provide a consistent page structure. To test, apply the patch and view the following pages to confirm that the primary page content is wrapped in a container with a white background: - Patrons -> Patron details -> - Files - Holds history - ILL request history - Notices - Purchase suggestions - Routing lists - Statistics - Staff interface home page -> Discharge requests pending Signed-off-by: David Nind <david@davidnind.com> --- .../prog/en/includes/ill-list-table.inc | 2 +- .../prog/en/modules/members/discharges.tt | 2 +- .../prog/en/modules/members/files.tt | 48 +++---- .../prog/en/modules/members/holdshistory.tt | 2 +- .../prog/en/modules/members/notices.tt | 122 ++++++++-------- .../modules/members/purchase-suggestions.tt | 130 +++++++++--------- .../prog/en/modules/members/routing-lists.tt | 2 +- .../prog/en/modules/members/statistics.tt | 90 ++++++------ 8 files changed, 203 insertions(+), 195 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-list-table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill-list-table.inc index 35a8538ec7..7b370937ce 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-list-table.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/ill-list-table.inc @@ -1,4 +1,4 @@ -<div> +<div class="page-section"> [% IF prefilters.length > 0 %] <table id="ill-requests" data-prefilters="[% prefilters | html %]"> [% ELSE %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharges.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharges.tt index d00f3cc43a..cf215eec15 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharges.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharges.tt @@ -36,7 +36,7 @@ [% IF pending_discharges %] <h1>Pending discharge requests</h1> - <div id="pending_updates"> + <div id="pending_updates" class="page-section"> <table> <thead> <tr> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/files.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/files.tt index 358d8299d7..9e04a619c1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/files.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/files.tt @@ -49,29 +49,31 @@ [% END %] [% IF ( files ) %] - <table> - <thead> - <tr> - <th>Name</th> - <th>Type</th> - <th>Description</th> - <th>Uploaded</th> - [% IF CAN_user_borrowers_edit_borrowers %]<th> </th>[% END %] - </tr> - </thead> - - <tbody> - [% FOREACH f IN files %] - <tr> - <td><a href="?borrowernumber=[% patron.borrowernumber | uri %]&op=download&file_id=[% f.file_id | uri %]">[% f.file_name | html %]</a></td> - <td>[% f.file_type | html %]</td> - <td>[% f.file_description | html %]</td> - <td>[% f.date_uploaded | $KohaDates %]</td> - [% IF CAN_user_borrowers_edit_borrowers %]<td><a class="btn btn-default btn-xs confirmdelete" href="?borrowernumber=[% patron.borrowernumber | html %]&op=delete&file_id=[% f.file_id | html %]"><i class="fa fa-trash"></i> Delete</a></td>[% END %] - </tr> - [% END %] - </tbody> - </table> + <div class="page-section"> + <table> + <thead> + <tr> + <th>Name</th> + <th>Type</th> + <th>Description</th> + <th>Uploaded</th> + [% IF CAN_user_borrowers_edit_borrowers %]<th> </th>[% END %] + </tr> + </thead> + + <tbody> + [% FOREACH f IN files %] + <tr> + <td><a href="?borrowernumber=[% patron.borrowernumber | uri %]&op=download&file_id=[% f.file_id | uri %]">[% f.file_name | html %]</a></td> + <td>[% f.file_type | html %]</td> + <td>[% f.file_description | html %]</td> + <td>[% f.date_uploaded | $KohaDates %]</td> + [% IF CAN_user_borrowers_edit_borrowers %]<td><a class="btn btn-default btn-xs confirmdelete" href="?borrowernumber=[% patron.borrowernumber | html %]&op=delete&file_id=[% f.file_id | html %]"><i class="fa fa-trash"></i> Delete</a></td>[% END %] + </tr> + [% END %] + </tbody> + </table> + </div> [% ELSE %] <div class="dialog message"> <p>This patron has no files attached.</p> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt index b8f28442c3..ce521036d1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt @@ -53,7 +53,7 @@ [% SET show_itemtype_column = Koha.Preference('AllowHoldItemTypeSelection') %] -<div id="holdshistory"> +<div id="holdshistory" class="page-section"> <table id="table_holdshistory"> <thead> <tr> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt index d72b20bb85..a68cabeef5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt @@ -45,68 +45,70 @@ <h1>Sent notices for [% INCLUDE 'patron-title.inc' %]</h1> [% IF ( QUEUED_MESSAGES ) %] - <table id="noticestable"> - <thead> - <tr> - <th>Notice</th> - <th>Type</th> - <th>Status</th> - <th>Updated on</th> - <th>Time created</th> - <th>Delivery note</th> - </tr> - </thead> - <tbody> - [% FOREACH QUEUED_MESSAGE IN QUEUED_MESSAGES %] + <div class="page-section"> + <table id="noticestable"> + <thead> <tr> - <td> - <a class="notice-title" data-noticeid="[% QUEUED_MESSAGE.message_id | html %]" href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrowernumber | uri %]&noticeid=[% QUEUED_MESSAGE.message_id | uri %]">[% QUEUED_MESSAGE.subject | html %]</a> - <iframe class="notice" id="notice[% QUEUED_MESSAGE.message_id | html %]" srcdoc="[% QUEUED_MESSAGE.content | html | html_line_break %]"></iframe> - </td> - <td> - [% IF ( QUEUED_MESSAGE.message_transport_type == 'email' ) %]<span>email</span> - [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'print' ) %]<span>print</span> - [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'feed' ) %]<span>feed</span> - [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'sms' ) %]<span>sms</span> - [% ELSE %][% QUEUED_MESSAGE.message_transport_type | html %][% END %] - </td> - <td> - [% IF ( QUEUED_MESSAGE.status == 'sent' ) %]<span>sent</span> - [% ELSIF ( QUEUED_MESSAGE.status == 'pending' ) %]<span>pending</span> - [% ELSIF ( QUEUED_MESSAGE.status == 'failed' ) %]<span>failed</span> - [% ELSIF ( QUEUED_MESSAGE.status == 'deleted' ) %]<span>deleted</span> - [% ELSE %][% QUEUED_MESSAGE.status | html %][% END %] - [% IF ( QUEUED_MESSAGE.status != 'pending' ) %] - <div class="notice"> - <form id="resend_notice[% QUEUED_MESSAGE.message_id | html %]" action="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrowernumber | html %]" method="POST"> - <input type="hidden" name="op" value="resend_notice" /> - <input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" /> - <input type="hidden" name="message_id" value="[% QUEUED_MESSAGE.message_id | html %]" /> - </form> - </div> - [% END %] - </td> - <td data-order="[% QUEUED_MESSAGE.updated_on | html %]">[% QUEUED_MESSAGE.updated_on | $KohaDates with_hours => 1 %]</td> - <td data-order="[% QUEUED_MESSAGE.time_queued | html %]">[% QUEUED_MESSAGE.time_queued | $KohaDates with_hours => 1 %]</td> - <td> - [% IF ( QUEUED_MESSAGE.failure_code ) %] - [% IF ( QUEUED_MESSAGE.failure_code == "INVALID_BORNUMBER" ) %]<span>Invalid borrowernumber [% borrowernumber | html %]</span> - [% ELSIF ( QUEUED_MESSAGE.failure_code == 'NO_EMAIL' ) %]<span>Unable to find an email address for this borrower</span> - [% ELSIF (matches = QUEUED_MESSAGE.failure_code.match('INVALID_EMAIL:(\w+)') ) %]<span>Invalid [% matches.0 | html %] email address found [% borrowernumber | html %]</span> - [% ELSIF ( QUEUED_MESSAGE.failure_code == 'NO_FROM' ) %]<span>Missing from email address</span> - [% ELSIF ( QUEUED_MESSAGE.failure_code == 'MISSING_SMS' ) %]<span>Missing SMS number</span> - [% ELSIF ( QUEUED_MESSAGE.failure_code == 'DUPLICATE_MESSAGE' ) %]<span>Message is duplicate</span> - [% ELSIF ( QUEUED_MESSAGE.failure_code == 'NO_NOTES' ) %]<span>No notes from SMS driver</span> - [% ELSIF ( QUEUED_MESSAGE.failure_code == 'SENDMAIL' ) %]<span>Unhandled email failure, check the logs for further details</span> - [% ELSIF ( QUEUED_MESSAGE.failure_code == "UNKNOWN_ERROR" ) %]<span>Unknown error</span> - [% ELSE %]<span>Error occurred while sending email.</span> - [% END %] - [% END %] - </td> + <th>Notice</th> + <th>Type</th> + <th>Status</th> + <th>Updated on</th> + <th>Time created</th> + <th>Delivery note</th> </tr> - [% END %] - </tbody> - </table> + </thead> + <tbody> + [% FOREACH QUEUED_MESSAGE IN QUEUED_MESSAGES %] + <tr> + <td> + <a class="notice-title" data-noticeid="[% QUEUED_MESSAGE.message_id | html %]" href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrowernumber | uri %]&noticeid=[% QUEUED_MESSAGE.message_id | uri %]">[% QUEUED_MESSAGE.subject | html %]</a> + <iframe class="notice" id="notice[% QUEUED_MESSAGE.message_id | html %]" srcdoc="[% QUEUED_MESSAGE.content | html | html_line_break %]"></iframe> + </td> + <td> + [% IF ( QUEUED_MESSAGE.message_transport_type == 'email' ) %]<span>email</span> + [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'print' ) %]<span>print</span> + [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'feed' ) %]<span>feed</span> + [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'sms' ) %]<span>sms</span> + [% ELSE %][% QUEUED_MESSAGE.message_transport_type | html %][% END %] + </td> + <td> + [% IF ( QUEUED_MESSAGE.status == 'sent' ) %]<span>sent</span> + [% ELSIF ( QUEUED_MESSAGE.status == 'pending' ) %]<span>pending</span> + [% ELSIF ( QUEUED_MESSAGE.status == 'failed' ) %]<span>failed</span> + [% ELSIF ( QUEUED_MESSAGE.status == 'deleted' ) %]<span>deleted</span> + [% ELSE %][% QUEUED_MESSAGE.status | html %][% END %] + [% IF ( QUEUED_MESSAGE.status != 'pending' ) %] + <div class="notice"> + <form id="resend_notice[% QUEUED_MESSAGE.message_id | html %]" action="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrowernumber | html %]" method="POST"> + <input type="hidden" name="op" value="resend_notice" /> + <input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" /> + <input type="hidden" name="message_id" value="[% QUEUED_MESSAGE.message_id | html %]" /> + </form> + </div> + [% END %] + </td> + <td data-order="[% QUEUED_MESSAGE.updated_on | html %]">[% QUEUED_MESSAGE.updated_on | $KohaDates with_hours => 1 %]</td> + <td data-order="[% QUEUED_MESSAGE.time_queued | html %]">[% QUEUED_MESSAGE.time_queued | $KohaDates with_hours => 1 %]</td> + <td> + [% IF ( QUEUED_MESSAGE.failure_code ) %] + [% IF ( QUEUED_MESSAGE.failure_code == "INVALID_BORNUMBER" ) %]<span>Invalid borrowernumber [% borrowernumber | html %]</span> + [% ELSIF ( QUEUED_MESSAGE.failure_code == 'NO_EMAIL' ) %]<span>Unable to find an email address for this borrower</span> + [% ELSIF (matches = QUEUED_MESSAGE.failure_code.match('INVALID_EMAIL:(\w+)') ) %]<span>Invalid [% matches.0 | html %] email address found [% borrowernumber | html %]</span> + [% ELSIF ( QUEUED_MESSAGE.failure_code == 'NO_FROM' ) %]<span>Missing from email address</span> + [% ELSIF ( QUEUED_MESSAGE.failure_code == 'MISSING_SMS' ) %]<span>Missing SMS number</span> + [% ELSIF ( QUEUED_MESSAGE.failure_code == 'DUPLICATE_MESSAGE' ) %]<span>Message is duplicate</span> + [% ELSIF ( QUEUED_MESSAGE.failure_code == 'NO_NOTES' ) %]<span>No notes from SMS driver</span> + [% ELSIF ( QUEUED_MESSAGE.failure_code == 'SENDMAIL' ) %]<span>Unhandled email failure, check the logs for further details</span> + [% ELSIF ( QUEUED_MESSAGE.failure_code == "UNKNOWN_ERROR" ) %]<span>Unknown error</span> + [% ELSE %]<span>Error occurred while sending email.</span> + [% END %] + [% END %] + </td> + </tr> + [% END %] + </tbody> + </table> + </div> <!-- /.page-section --> [% ELSE %] <div class="dialog message">There is no record of any messages that have been sent to this patron.</div> [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/purchase-suggestions.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/purchase-suggestions.tt index 7ac37ca60a..240bd5af26 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/purchase-suggestions.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/purchase-suggestions.tt @@ -46,72 +46,74 @@ </div> [% IF suggestions.size %] - <table id="suggestions"> - <thead> - <tr> - <th>Summary</th> - <th>Note</th> - <th>Managed by</th> - <th>Managed on</th> - <th>Suggested on</th> - <th>Status</th> - </tr> - </thead> + <div class="page-section"> + <table id="suggestions"> + <thead> + <tr> + <th>Summary</th> + <th>Note</th> + <th>Managed by</th> + <th>Managed on</th> + <th>Suggested on</th> + <th>Status</th> + </tr> + </thead> - <tbody> - [% FOREACH s IN suggestions %] - <tr> - <td> - <p> - <strong> - [% IF ( CAN_user_catalogue ) %] - <a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% s.suggestionid | uri %]&op=show">[% s.title | html %]</a> - [% ELSE %] - [% s.title | html %] + <tbody> + [% FOREACH s IN suggestions %] + <tr> + <td> + <p> + <strong> + [% IF ( CAN_user_catalogue ) %] + <a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% s.suggestionid | uri %]&op=show">[% s.title | html %]</a> + [% ELSE %] + [% s.title | html %] + [% END %] + </strong> + </p> + <p> + [% IF ( s.author ) %][% s.author | html %],[% END %] + [% IF ( s.copyrightdate ) %] - [% s.copyrightdate | html %],[% END %] + [% IF ( s.publishercode ) %] - [% s.publishercode | html %][% END %] + [% IF ( s.place ) %]([% s.place | html %])[% END %] + [% IF ( s.collectiontitle ) %] , [% s.collectiontitle | html %][% END %] + [% IF ( s.itemtype ) %] - [% s.itemtype | html %][% END %] + </p> + </td> + <td>[% s.note | html %] + <td> + [% INCLUDE 'patron-title.inc' patron => s.manager %] + </td> + <td data-order="[% s.manageddate | html %]"> + [% s.manageddate | $KohaDates %] + </td> + <td data-order="[% s.suggesteddate | html %]"> + [% s.suggesteddate | $KohaDates %] + </td> + <td> + [% SWITCH s.STATUS %] + [% CASE "ASKED" %]<span>Requested</span> + [% CASE "CHECKED" %]<span>Checked by the library</span> + [% CASE "ACCEPTED" %]<span>Accepted by the library</span> + [% CASE "ORDERED" %]<span>Ordered by the library</span> + [% CASE "REJECTED" %]<span>Suggestion declined<span> + [% CASE "AVAILABLE" %]<span>Available in the library</span> + [% CASE %] + [% SET status_description = AuthorisedValues.GetByCode('SUGGEST_STATUS', s.STATUS) %] + [% IF status_description %] + [% status_description | html %] + [% ELSE %] + <span>Unknown</span> + [% END %] [% END %] - </strong> - </p> - <p> - [% IF ( s.author ) %][% s.author | html %],[% END %] - [% IF ( s.copyrightdate ) %] - [% s.copyrightdate | html %],[% END %] - [% IF ( s.publishercode ) %] - [% s.publishercode | html %][% END %] - [% IF ( s.place ) %]([% s.place | html %])[% END %] - [% IF ( s.collectiontitle ) %] , [% s.collectiontitle | html %][% END %] - [% IF ( s.itemtype ) %] - [% s.itemtype | html %][% END %] - </p> - </td> - <td>[% s.note | html %] - <td> - [% INCLUDE 'patron-title.inc' patron => s.manager %] - </td> - <td data-order="[% s.manageddate | html %]"> - [% s.manageddate | $KohaDates %] - </td> - <td data-order="[% s.suggesteddate | html %]"> - [% s.suggesteddate | $KohaDates %] - </td> - <td> - [% SWITCH s.STATUS %] - [% CASE "ASKED" %]<span>Requested</span> - [% CASE "CHECKED" %]<span>Checked by the library</span> - [% CASE "ACCEPTED" %]<span>Accepted by the library</span> - [% CASE "ORDERED" %]<span>Ordered by the library</span> - [% CASE "REJECTED" %]<span>Suggestion declined<span> - [% CASE "AVAILABLE" %]<span>Available in the library</span> - [% CASE %] - [% SET status_description = AuthorisedValues.GetByCode('SUGGEST_STATUS', s.STATUS) %] - [% IF status_description %] - [% status_description | html %] - [% ELSE %] - <span>Unknown</span> - [% END %] - [% END %] - [% IF s.reason %]([% s.reason | html %])[% END %] - </td> - </tr> - [% END %] - </tbody> - </table> + [% IF s.reason %]([% s.reason | html %])[% END %] + </td> + </tr> + [% END %] + </tbody> + </table> + </div> <!-- /.page-section --> [% ELSE %] <div class="dialog message"> <p>This patron has not submitted any purchase suggestions</p> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/routing-lists.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/routing-lists.tt index aa5c0c4894..e4f5204eaf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/routing-lists.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/routing-lists.tt @@ -57,7 +57,7 @@ [% END %] </h2> -<div id="subscriptions"> +<div id="subscriptions" class="page-section"> [% IF ( routinglists ) %] <table id="subscriptiont"> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt index d5385b2470..14e283adec 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt @@ -56,53 +56,55 @@ <h1>Statistics for [% INCLUDE 'patron-title.inc' %]</h1> [% IF ( datas.size ) %] - <table id="statistics"> - <thead> - <tr> - [% FOREACH cn IN column_names %] - <th> - [% SWITCH cn %] - [% CASE 'itype' %] - <span>Item type</span> - [% CASE 'ccode' %] - <span>Collection</span> - [% CASE 'location' %] - <span>Shelving location</span> - [% CASE 'homebranch' %] - <span>Home library</span> - [% CASE 'holdingbranch' %] - <span>Holding library</span> - [% CASE %] - <span>[% cn | html %]</span> - [% END %] - </th> - [% END %] - <th>Total checkouts as of yesterday</th> - <th>Today's checkouts</th> - <th>Today's checkins</th> - <th>Total checkouts</th> - </tr> - </thead> + <div class="page-section"> + <table id="statistics"> + <thead> + <tr> + [% FOREACH cn IN column_names %] + <th> + [% SWITCH cn %] + [% CASE 'itype' %] + <span>Item type</span> + [% CASE 'ccode' %] + <span>Collection</span> + [% CASE 'location' %] + <span>Shelving location</span> + [% CASE 'homebranch' %] + <span>Home library</span> + [% CASE 'holdingbranch' %] + <span>Holding library</span> + [% CASE %] + <span>[% cn | html %]</span> + [% END %] + </th> + [% END %] + <th>Total checkouts as of yesterday</th> + <th>Today's checkouts</th> + <th>Today's checkins</th> + <th>Total checkouts</th> + </tr> + </thead> - <tbody> - [% FOREACH r IN datas %] + <tbody> + [% FOREACH r IN datas %] + <tr> + [% FOREACH c IN r %] + <td>[% c | html %]</td> + [% END %] + </tr> + [% END %] + </tbody> + <tfoot> <tr> - [% FOREACH c IN r %] - <td>[% c | html %]</td> - [% END %] + <td colspan="[% column_names.size | html %]">TOTAL</td> + <td>[% count_total_precedent_state | html %]</td> + <td>[% count_total_issues | html %]</td> + <td>[% count_total_issues_returned | html %]</td> + <td>[% count_total_actual_state | html %]</td> </tr> - [% END %] - </tbody> - <tfoot> - <tr> - <td colspan="[% column_names.size | html %]">TOTAL</td> - <td>[% count_total_precedent_state | html %]</td> - <td>[% count_total_issues | html %]</td> - <td>[% count_total_issues_returned | html %]</td> - <td>[% count_total_actual_state | html %]</td> - </tr> - </tfoot> - </table> + </tfoot> + </table> + </div> <!-- /.page-section --> [% ELSE %] <div class="dialog message">There are no statistics for this patron.</div> [% END %] -- 2.30.2