Bugzilla – Attachment 69160 Details for
Bug 19627
Move patron clubs templates JS to the footer
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19627: Move patron clubs templates JS to the footer
Bug-19627-Move-patron-clubs-templates-JS-to-the-fo.patch (text/plain), 8.90 KB, created by
Owen Leonard
on 2017-11-15 14:22:32 UTC
(
hide
)
Description:
Bug 19627: Move patron clubs templates JS to the footer
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2017-11-15 14:22:32 UTC
Size:
8.90 KB
patch
obsolete
>From 272db0c00e577bd34636bd703d64b54b17855039 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 15 Nov 2017 14:13:46 +0000 >Subject: [PATCH] Bug 19627: Move patron clubs templates JS to the footer > >This patch modifies the staff client's patron clubs templates 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 page: All button controls, DataTables functionality, tabs, etc. >--- > .../prog/en/modules/clubs/club-enrollments.tt | 34 +++--- > .../prog/en/modules/clubs/clubs-add-modify.tt | 6 +- > .../intranet-tmpl/prog/en/modules/clubs/clubs.tt | 121 +++++++++++---------- > 3 files changed, 83 insertions(+), 78 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/club-enrollments.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/club-enrollments.tt >index 94e7148..daf07d0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/club-enrollments.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/club-enrollments.tt >@@ -1,27 +1,11 @@ > [% USE KohaDates %] > [% USE Branches %] > [% USE Koha %] >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Tools › Patron clubs › Club enrollments</title> > [% INCLUDE 'doc-head-close.inc' %] >- > <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> >-[% INCLUDE 'datatables.inc' %] >- >-<script type="text/javascript"> >-//<![CDATA[ >- $(document).ready(function() { >- eTable = $('#enrollments-table').dataTable($.extend(true, {}, dataTablesDefaults, { >- "sPaginationType": "four_button", >- "sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>', >- "aoColumnDefs": [ >- { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false }, >- ] >- } )); >- }); >-//]]> >-</script> >- > </head> > > <body id="club_enrollments" class="clubs"> >@@ -64,4 +48,20 @@ > </div> > </div> > </div> >+ >+[% MACRO jsinclude BLOCK %] >+ [% INCLUDE 'datatables.inc' %] >+ <script type="text/javascript"> >+ $(document).ready(function() { >+ eTable = $('#enrollments-table').dataTable($.extend(true, {}, dataTablesDefaults, { >+ "sPaginationType": "four_button", >+ "sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>', >+ "aoColumnDefs": [ >+ { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false }, >+ ] >+ } )); >+ }); >+ </script> >+[% END %] >+ > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt >index ec76ded..3d7da82 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt >@@ -2,6 +2,7 @@ > [% USE Branches %] > [% USE AuthorisedValues %] > [% SET AuthorisedValuesCategories = AuthorisedValues.GetCategories %] >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Tools › Patron clubs › > [% IF club %] >@@ -11,7 +12,6 @@ > [% END %] > </title> > [% INCLUDE 'doc-head-close.inc' %] >-[% INCLUDE 'calendar.inc' %] > </head> > > <body id="clubs_add_modify" class="clubs"> >@@ -125,4 +125,8 @@ > </div> > </div> > >+[% MACRO jsinclude BLOCK %] >+ [% INCLUDE 'calendar.inc' %] >+[% END %] >+ > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt >index 0c96f79..318d821 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt >@@ -1,71 +1,12 @@ > [% USE KohaDates %] > [% USE Branches %] > [% USE Koha %] >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Tools › Patron clubs</title> > [% INCLUDE 'doc-head-close.inc' %] > > <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> >-[% INCLUDE 'datatables.inc' %] >- >-<script type="text/javascript"> >-//<![CDATA[ >- $(document).ready(function() { >- tTable = $('#club-templates-table').dataTable($.extend(true, {}, dataTablesDefaults, { >- "sPaginationType": "four_button", >- "sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>', >- "aoColumnDefs": [ >- { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, >- ] >- } )); >- >- cTable = $('#clubs-table').dataTable($.extend(true, {}, dataTablesDefaults, { >- "sPaginationType": "four_button", >- "sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>', >- "aoColumnDefs": [ >- { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, >- ] >- } )); >- }); >- >- function ConfirmDeleteTemplate( id, name, a ) { >- if ( confirm( _("Are you sure you want to delete the club template %s? This will delete all clubs using this template and cancel patron enrollments" ).format(name) ) ) { >- $.ajax({ >- type: "POST", >- url: '/cgi-bin/koha/svc/club/template/delete', >- data: { id: id }, >- success: function( data ) { >- if ( data.success ) { >- location.reload(); >- } else { >- alert(_("Unable to delete template!")); >- } >- }, >- dataType: 'json' >- }); >- } >- } >- >- function ConfirmDeleteClub( id, name, a ) { >- if ( confirm( _("Are you sure you want to delete the club %s? This will cancel all patron enrollments in this club." ).format(name) ) ) { >- $.ajax({ >- type: "POST", >- url: '/cgi-bin/koha/svc/club/delete', >- data: { id: id }, >- success: function( data ) { >- if ( data.success ) { >- location.reload(); >- } else { >- alert(_("Unable to delete club!")); >- } >- }, >- dataType: 'json' >- }); >- } >- } >-//]]> >-</script> >- > </head> > > <body id="clubs_clubs" class="clubs"> >@@ -278,4 +219,64 @@ > </div> > </div> <!-- /#bd --> > >+[% MACRO jsinclude BLOCK %] >+ [% INCLUDE 'datatables.inc' %] >+ >+ <script type="text/javascript"> >+ $(document).ready(function() { >+ tTable = $('#club-templates-table').dataTable($.extend(true, {}, dataTablesDefaults, { >+ "sPaginationType": "four_button", >+ "sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>', >+ "aoColumnDefs": [ >+ { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, >+ ] >+ } )); >+ >+ cTable = $('#clubs-table').dataTable($.extend(true, {}, dataTablesDefaults, { >+ "sPaginationType": "four_button", >+ "sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>', >+ "aoColumnDefs": [ >+ { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, >+ ] >+ } )); >+ }); >+ >+ function ConfirmDeleteTemplate( id, name, a ) { >+ if ( confirm( _("Are you sure you want to delete the club template %s? This will delete all clubs using this template and cancel patron enrollments" ).format(name) ) ) { >+ $.ajax({ >+ type: "POST", >+ url: '/cgi-bin/koha/svc/club/template/delete', >+ data: { id: id }, >+ success: function( data ) { >+ if ( data.success ) { >+ location.reload(); >+ } else { >+ alert(_("Unable to delete template!")); >+ } >+ }, >+ dataType: 'json' >+ }); >+ } >+ } >+ >+ function ConfirmDeleteClub( id, name, a ) { >+ if ( confirm( _("Are you sure you want to delete the club %s? This will cancel all patron enrollments in this club." ).format(name) ) ) { >+ $.ajax({ >+ type: "POST", >+ url: '/cgi-bin/koha/svc/club/delete', >+ data: { id: id }, >+ success: function( data ) { >+ if ( data.success ) { >+ location.reload(); >+ } else { >+ alert(_("Unable to delete club!")); >+ } >+ }, >+ dataType: 'json' >+ }); >+ } >+ } >+ </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 19627
:
69160
|
69162
|
69608
|
69630
|
69631
|
69772
|
69773