Bugzilla – Attachment 69292 Details for
Bug 19682
Move JS to the footer: Two patron-related tools
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19682: Move JS to the footer: Two patron-related tools
Bug-19682-Move-JS-to-the-footer-Two-patron-related.patch (text/plain), 4.98 KB, created by
Owen Leonard
on 2017-11-22 19:37:23 UTC
(
hide
)
Description:
Bug 19682: Move JS to the footer: Two patron-related tools
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2017-11-22 19:37:23 UTC
Size:
4.98 KB
patch
obsolete
>From f964cb3ca7ce44728f48a45036120f6ad0247290 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 22 Nov 2017 19:33:48 +0000 >Subject: [PATCH] Bug 19682: Move JS to the footer: Two patron-related tools > >This patch modifies two patron-related tools templates in the staff >client so that JavaScript is included in the footer instead of the >header. > >To test, apply the patch and test the JavaScript-driven features of >each modified template: All button controls, DataTables functionality, >form validation, etc. > > - Import patrons > - Upload patron images >--- > .../prog/en/modules/tools/import_borrowers.tt | 27 +++++++----- > .../prog/en/modules/tools/picture-upload.tt | 50 +++++++++++++--------- > 2 files changed, 46 insertions(+), 31 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt >index 7e8245d..8783a24 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt >@@ -1,5 +1,6 @@ > [% USE Koha %] > [% USE Branches %] >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Tools › Import patrons [% IF ( uploadborrowers ) %]› Results[% END %]</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -9,20 +10,11 @@ > .line_error { width: 100%; } > code { background-color: yellow; } > </style> >-<script type="text/javascript"> >-//<![CDATA[ >- $(document).ready(function() { >- [%# Make date fields have the datepicker %] >- $("#dateenrolled").addClass('datepicker'); >- $("#dateexpiry").addClass('datepicker'); >- $("#dateofbirth").addClass('datepicker'); >- }); >-</script> > </head> >+ > <body id="tools_import_borrowers" class="tools"> > [% INCLUDE 'header.inc' %] > [% INCLUDE 'patron-search.inc' %] >-[% INCLUDE 'calendar.inc' %] > > <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › <a href="/cgi-bin/koha/tools/import_borrowers.pl">Import patrons</a>[% IF ( uploadborrowers ) %] › Results[% END %]</div> > >@@ -245,4 +237,19 @@ Alternatively, you can supply dates in ISO format. > [% INCLUDE 'tools-menu.inc' %] > </div> > </div> >+ >+[% MACRO jsinclude BLOCK %] >+ [% INCLUDE 'calendar.inc' %] >+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/tools-menu.js"></script> >+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu.js"></script> >+ <script type="text/javascript"> >+ $(document).ready(function() { >+ [%# Make date fields have the datepicker %] >+ $("#dateenrolled").addClass('datepicker'); >+ $("#dateexpiry").addClass('datepicker'); >+ $("#dateofbirth").addClass('datepicker'); >+ }); >+ </script> >+[% END %] >+ > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/picture-upload.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/picture-upload.tt >index 958f810..fa0db25 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/picture-upload.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/picture-upload.tt >@@ -1,28 +1,9 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Tools › Upload patron images</title> > [% INCLUDE 'doc-head-close.inc' %] >-<script type="text/javascript"> >- $(document).ready(function() { >- $("#zipfile").click(function(){ >- $("#cardnum").hide(); >- }); >- $("#image").click(function(){ >- $("#cardnum").show(); >- }); >- $( "#upload_form" ).validate({ >- rules: { >- cardnumber: { >- required: { >- depends: function(element) { >- return $("#image").is(":checked"); >- } >- } >- } >- } >- }); >-}); >-</script> > </head> >+ > <body id="tools_picture-upload" class="tools"> > > [% INCLUDE 'header.inc' %] >@@ -157,4 +138,31 @@ > [% INCLUDE 'tools-menu.inc' %] > </div> > </div> >+ >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/tools-menu.js"></script> >+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu.js"></script> >+ <script type="text/javascript"> >+ $(document).ready(function() { >+ $("#zipfile").click(function(){ >+ $("#cardnum").hide(); >+ }); >+ $("#image").click(function(){ >+ $("#cardnum").show(); >+ }); >+ $( "#upload_form" ).validate({ >+ rules: { >+ cardnumber: { >+ required: { >+ depends: function(element) { >+ return $("#image").is(":checked"); >+ } >+ } >+ } >+ } >+ }); >+ }); >+ </script> >+[% END %] >+ > [% INCLUDE 'intranet-bottom.inc' %] >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19682
:
69292
|
69737
|
70467
|
71293