From a193b4ddb069fbd0d38c80ebb324143356fcf103 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 16 Nov 2017 16:08:07 +0000 Subject: [PATCH] Bug 19641: Move patron templates to the footer This patch modifies the staff client patron module templates so that JavaScript is included in the footer instead of the header. This patch touches a lot of files because the changes are all interdependent, affecting a couple of module-wide include files. To test, apply the patch and test the JavaScript-driven features of the modified templates: All button controls, DataTables functionality, tabs, etc. Patrons -> Patrons home, patron search results -> Manage pending modification requests -> Patron detail page -> Edit patron -> Set guarantor -> Fines -> Account, Pay fines, Create manual invoice, Create manual credit -> Print receipts for different kinds of charges -> Routing lists -> Circulation history -> Holds history -> Notices -> Statistics -> Files -> Purchase suggestions -> Discharges -> Housebound -> Set permissions -> Change password -> Print summary, slips, and overdues -> Update child to adult patron type Patron toolbar and patron search bar operations should work correctly on all pages. This patch also updates the template for searching the Norwegian national patron database, but it has NOT been tested. Signed-off-by: Claire Gravely --- .../prog/en/includes/borrower_debarments.inc | 28 - .../prog/en/includes/members-toolbar.inc | 128 ----- .../prog/en/includes/messaging-preference-form.inc | 25 +- .../prog/en/includes/patron-search.inc | 44 +- .../prog/en/modules/admin/categories.tt | 1 + .../prog/en/modules/common/patron_search.tt | 331 +++++------ .../prog/en/modules/members/boraccount.tt | 73 +-- .../prog/en/modules/members/deletemem.tt | 6 + .../prog/en/modules/members/discharge.tt | 6 + .../prog/en/modules/members/discharges.tt | 6 + .../intranet-tmpl/prog/en/modules/members/files.tt | 33 +- .../prog/en/modules/members/holdshistory.tt | 42 +- .../prog/en/modules/members/housebound.tt | 25 +- .../prog/en/modules/members/mancredit.tt | 21 +- .../prog/en/modules/members/maninvoice.tt | 37 +- .../prog/en/modules/members/member-flags.tt | 212 +++---- .../prog/en/modules/members/member-password.tt | 129 +++-- .../prog/en/modules/members/member.tt | 623 +++++++++++---------- .../prog/en/modules/members/memberentrygen.tt | 418 +++++++------- .../prog/en/modules/members/members-update.tt | 17 +- .../prog/en/modules/members/moremember-brief.tt | 2 + .../prog/en/modules/members/moremember-print.tt | 7 +- .../prog/en/modules/members/moremember-receipt.tt | 9 +- .../prog/en/modules/members/moremember.tt | 249 ++++---- .../prog/en/modules/members/nl-search.tt | 6 + .../prog/en/modules/members/notices.tt | 44 +- .../intranet-tmpl/prog/en/modules/members/pay.tt | 82 +-- .../prog/en/modules/members/paycollect.tt | 124 ++-- .../prog/en/modules/members/printfeercpt.tt | 10 +- .../prog/en/modules/members/printinvoice.tt | 8 +- .../en/modules/members/purchase-suggestions.tt | 28 +- .../prog/en/modules/members/readingrec.tt | 60 +- .../prog/en/modules/members/routing-lists.tt | 7 + .../prog/en/modules/members/statistics.tt | 25 +- .../prog/en/modules/members/update-child.tt | 85 ++- koha-tmpl/intranet-tmpl/prog/js/members-menu.js | 154 +++++ .../prog/js/messaging-preference-form.js | 20 + .../intranet-tmpl/prog/js/pages/circulation.js | 24 + 38 files changed, 1649 insertions(+), 1500 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/js/members-menu.js create mode 100644 koha-tmpl/intranet-tmpl/prog/js/messaging-preference-form.js diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc index 7b4b25d..bdf7fad 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc @@ -1,31 +1,3 @@ - -
[% IF ( not debarments.defined || debarments.size < 1 ) %]

Patron is currently unrestricted.

diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc index 7b91418..7dd97f2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc @@ -3,134 +3,6 @@ [% USE Branches %] [% USE AuthorisedValues %] [% SET NorwegianPatronDBEnable = Koha.Preference( 'NorwegianPatronDBEnable' ) %] - -
[% IF ( CAN_user_borrowers ) %] [% IF ( guarantor ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc index 70761a0..1f2ac94 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc @@ -1,28 +1,5 @@ [% USE Koha %] - @@ -32,7 +9,7 @@ $(document).ready(function(){ [% IF Koha.Preference('SMSSendDriver') %]SMS[% END %] [% IF Koha.Preference('TalkingTechItivaPhoneNotification') %]Phone[% END %] Email - Digests only + Digests only [% UNLESS ( messaging_form_inactive ) %]Do not notify[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc index a10fc2f..2766b71 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc @@ -155,37 +155,15 @@
- + + \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt index d017e9f..1dccb7e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt @@ -492,6 +492,7 @@ [% MACRO jsinclude BLOCK %] + [% INCLUDE 'calendar.inc' %] [% INCLUDE 'datatables.inc' %] - + + +[% MACRO jsinclude BLOCK %] + [% INCLUDE 'datatables.inc' %] + + +[% END %] + [% SET popup_window = 1 %] [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt index ef4354a..0ff77e7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt @@ -2,42 +2,13 @@ [% USE KohaDates %] [% USE ColumnsSettings %] [% USE Price %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Patrons › Account for [% INCLUDE 'patron-title.inc' %] [% INCLUDE 'doc-head-close.inc' %] -[% INCLUDE 'datatables.inc' %] -[% INCLUDE 'columns_settings.inc' %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'patron-search.inc' %] @@ -45,7 +16,6 @@ $(document).ready(function() {
-
@@ -121,7 +91,7 @@ $(document).ready(function() { [% IF ( reverse_col) %] [% IF ( account.payment ) %] Reverse - [% ELSE %] + [% ELSE %][% SET footerjs = 1 %]   [% END %] [% END %] @@ -150,4 +120,41 @@ $(document).ready(function() { [% INCLUDE 'circ-menu.inc' %]
+ +[% MACRO jsinclude BLOCK %] + [% INCLUDE 'datatables.inc' %] + [% INCLUDE 'columns_settings.inc' %] + + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/deletemem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/deletemem.tt index 82ba917..52ed315 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/deletemem.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/deletemem.tt @@ -1,3 +1,4 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Delete patron [% firstname %] [% surname %] [% INCLUDE 'doc-head-close.inc' %] @@ -57,4 +58,9 @@ [% INCLUDE 'circ-menu.inc' %]
+ +[% MACRO jsinclude BLOCK %] + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt index 577d56c..937d26c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt @@ -1,6 +1,7 @@ [% USE KohaDates %] [% USE AuthorisedValues %] [% USE Branches %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Patrons › [% IF (unknowuser) %]Patron does not exist[% ELSE %]Discharge for [% firstname %] [% surname %] ([% cardnumber %])[% END %] [% INCLUDE 'doc-head-close.inc' %] @@ -70,4 +71,9 @@ [% INCLUDE 'circ-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] 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 0998acd..18dfb53 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharges.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharges.tt @@ -1,4 +1,5 @@ [% USE Branches %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Patrons › Pending discharge requests [% INCLUDE 'doc-head-close.inc' %] @@ -39,4 +40,9 @@ [% END %] + +[% MACRO jsinclude BLOCK %] + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] 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 ba4cc1f..ee2eef5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/files.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/files.tt @@ -1,22 +1,11 @@ [% USE KohaDates %] [% USE AuthorisedValues %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Files for [% INCLUDE 'patron-title.inc' %] [% INCLUDE 'doc-head-close.inc' %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'patron-search.inc' %] @@ -93,4 +82,22 @@ [% INCLUDE 'circ-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] 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 811c545..f1d4393 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt @@ -3,30 +3,13 @@ [% USE AuthorisedValues %] [% USE Branches %] [% USE ColumnsSettings %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Holds history for [% INCLUDE 'patron-title.inc' %] [% INCLUDE 'doc-head-close.inc' %] -[% INCLUDE 'datatables.inc' %] -[% INCLUDE 'columns_settings.inc' %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'patron-search.inc' %] @@ -118,4 +101,25 @@ [% INCLUDE 'circ-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + [% INCLUDE 'datatables.inc' %] + [% INCLUDE 'columns_settings.inc' %] + + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/housebound.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/housebound.tt index c17363f..2068f11 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/housebound.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/housebound.tt @@ -1,20 +1,12 @@ [% USE Koha %] [% USE KohaDates %] [% USE AuthorisedValues %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Housebound › Details for [% INCLUDE 'patron-title.inc' %] [% INCLUDE 'doc-head-close.inc' %] -[% INCLUDE 'calendar.inc' %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'patron-search.inc' %] @@ -434,4 +426,17 @@ [% INCLUDE 'circ-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + [% INCLUDE 'calendar.inc' %] + + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt index 65a61a5..21d6c55 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt @@ -1,16 +1,10 @@ [% USE Koha %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Patrons › Create manual credit [% INCLUDE 'doc-head-close.inc' %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'patron-search.inc' %] @@ -61,4 +55,15 @@ $(document).ready(function(){ [% INCLUDE 'circ-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt index 8fc1f68..cbcf298 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt @@ -1,24 +1,10 @@ [% USE Koha %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Patrons › Create manual invoice [% INCLUDE 'doc-head-close.inc' %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'patron-search.inc' %] @@ -82,4 +68,23 @@ $(document).ready(function(){ [% INCLUDE 'circ-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt index 524c0a1..8269f38 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt @@ -1,113 +1,12 @@ [% USE Branches %] +[% SET footerjs = 1 %] [% PROCESS 'permissions.inc' %] [% INCLUDE 'doc-head-open.inc' %] Koha › Patrons › Set permissions for [% surname %], [% firstname %] [% INCLUDE 'doc-head-close.inc' %] - - - + [% INCLUDE 'header.inc' %] [% INCLUDE 'patron-search.inc' %] @@ -175,4 +74,111 @@ [% INCLUDE 'circ-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + + + + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt index a80d89c..aaa1110 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt @@ -1,69 +1,11 @@ [% USE Koha %] [% USE Branches %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Patrons › [% IF ( newpassword ) %]Password updated [% ELSE %]Update password for [% surname %], [% firstname %][% END %] [% INCLUDE 'doc-head-close.inc' %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'patron-search.inc' %] @@ -146,6 +88,69 @@ [% INCLUDE 'circ-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + + + [% PROCESS 'password_check.inc' %] + [% PROCESS 'add_password_check' new_password => 'newpassword' %] +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] -[% PROCESS 'password_check.inc' %] -[% PROCESS 'add_password_check' new_password => 'newpassword' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt index 0c5e044..cde2052 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt @@ -2,320 +2,13 @@ [% USE ColumnsSettings %] [% USE Branches %] [% USE Categories %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Patrons [% IF ( searching ) %]› Search results[% END %] [% INCLUDE 'doc-head-close.inc' %] -[% INCLUDE 'datatables.inc' %] -[% INCLUDE 'columns_settings.inc' %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'patron-search.inc' %] @@ -527,4 +220,316 @@ function filterByFirstLetterSurname(letter) { [% INCLUDE 'members-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + [% INCLUDE 'datatables.inc' %] + [% INCLUDE 'columns_settings.inc' %] + + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index 8a17653..6a42deb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -1,152 +1,12 @@ [% USE Koha %] [% USE KohaDates %] [% USE Branches %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Patrons › [% IF ( opadd ) %]Add[% ELSIF ( opduplicate ) %]Duplicate[% ELSE %] Modify[% END %] patron [% IF (firstname) %][% firstname %] [% END %][% IF (surname) %][% surname %] [% END %]([%IF ( categoryname ) %][% categoryname %][% ELSE %][% IF ( I ) %]Organization[% END %][% IF ( A ) %]Adult[% END %][% IF ( C ) %]Child[% END %][% IF ( P ) %]Professional[% END %][% IF ( S ) %]Staff[% END %][% END %]) [% INCLUDE 'doc-head-close.inc' %] - -[% INCLUDE 'calendar.inc' %] - - + [% INCLUDE 'header.inc' %] [% INCLUDE 'patron-search.inc' %] @@ -1189,6 +1049,50 @@ $(document).ready(function() { [% IF ( step_5 ) %][% IF ( EnhancedMessagingPreferences ) %]
Patron messaging preferences + + [% INCLUDE 'messaging-preference-form.inc' %] + [% IF ( SMSSendDriver ) %] +

+ +

+

+ + +

+ [% END %] +
+[% END %] [% END %] + + + +[% IF quickadd && opadd && !check_member %] +
+
Quick add +
    +
+
+
+[% END %] + + + +[% UNLESS ( opadd ) %]
+[% INCLUDE 'members-menu.inc' %] +
[% END %] +[% END %] + + +[% MACRO jsinclude BLOCK %] + [% IF ( opadd ) %]