Bugzilla – Attachment 69789 Details for
Bug 19761
Move template JavaScript to the footer: Serials, part 2
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19761: Move template JavaScript to the footer: Serials, part 2
Bug-19761-Move-template-JavaScript-to-the-footer-S.patch (text/plain), 7.59 KB, created by
Josef Moravec
on 2017-12-14 08:03:20 UTC
(
hide
)
Description:
Bug 19761: Move template JavaScript to the footer: Serials, part 2
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2017-12-14 08:03:20 UTC
Size:
7.59 KB
patch
obsolete
>From bd6527988e85a47846cd79db5e8d48b971fa960f Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 7 Dec 2017 17:20:48 +0000 >Subject: [PATCH] Bug 19761: Move template JavaScript to the footer: Serials, > part 2 > >This patch modifies more staff client serials 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 the >modified templates: All button controls, DataTables functionality, tabs, >etc. > > - Serials -> Subscription detail -> Edit routing list > - Add recipients > - Save > - "Save and preview routing slip" should trigger preview > - In preview popup: Print and Close buttons should work correctly > >Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de> > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > .../en/modules/serials/routing-preview-slip.tt | 23 +++++--- > .../prog/en/modules/serials/routing-preview.tt | 32 ++++++----- > .../prog/en/modules/serials/routing.tt | 65 ++++++++++++---------- > 3 files changed, 68 insertions(+), 52 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview-slip.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview-slip.tt >index 5019820..e04b780 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview-slip.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview-slip.tt >@@ -1,15 +1,7 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Serials › Routing slip preview</title> > [% INCLUDE 'doc-head-close.inc' %] >-<script type="text/javascript"> >- $(document).ready(function(){ >- $("#print_slip").on("click",function(e){ >- e.preventDefault(); >- window.print(); >- self.close(); >- }); >- }); >-</script> > <style type="text/css"> > #custom-doc { width:38.46em;*width:37.53em;min-width:500px; margin:auto; text-align:left; } > </style> >@@ -17,6 +9,7 @@ > .yui-t7, #custom-doc { min-width:0; width:auto; } > </style> > </head> >+ > <body id="ser_routing-preview-slip" class="ser"> > > <div id="custom-doc" class="yui-t7"> >@@ -50,4 +43,16 @@ > > </div> > >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript"> >+ $(document).ready(function(){ >+ $("#print_slip").on("click",function(e){ >+ e.preventDefault(); >+ window.print(); >+ self.close(); >+ }); >+ }); >+ </script> >+[% END %] >+ > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview.tt >index 7478b11..7fb8410 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview.tt >@@ -1,20 +1,9 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Serials › Preview routing list</title> > [% INCLUDE 'doc-head-close.inc' %] >-<script type="text/javascript"> >- $(document).ready(function(){ >- $("#save_and_preview").on("click",function(e){ >- e.preventDefault(); >- print_slip( $("#subscriptionid").val(), $("#issue_escaped").val() ); >- }); >- }); >-function print_slip(subscriptionid,issue){ >- var myurl = 'routing-preview.pl?ok=1&subscriptionid='+subscriptionid+'&issue='+issue; >- window.open(myurl,'PrintSlip','width=500,height=500,toolbar=no,scrollbars=yes'); >- window.location.href='subscription-detail.pl?subscriptionid=' + subscriptionid; >-} >-</script> > </head> >+ > <body id="ser_routing-preview" class="ser"> > [% INCLUDE 'header.inc' %] > [% INCLUDE 'serials-search.inc' %] >@@ -58,4 +47,21 @@ function print_slip(subscriptionid,issue){ > [% INCLUDE 'serials-menu.inc' %] > </div> > </div> >+ >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript"> >+ $(document).ready(function(){ >+ $("#save_and_preview").on("click",function(e){ >+ e.preventDefault(); >+ print_slip( $("#subscriptionid").val(), $("#issue_escaped").val() ); >+ }); >+ }); >+ function print_slip(subscriptionid,issue){ >+ var myurl = 'routing-preview.pl?ok=1&subscriptionid='+subscriptionid+'&issue='+issue; >+ window.open(myurl,'PrintSlip','width=500,height=500,toolbar=no,scrollbars=yes'); >+ window.location.href='subscription-detail.pl?subscriptionid=' + subscriptionid; >+ } >+ </script> >+[% END %] >+ > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tt >index b0b32ad..5ed4c75 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tt >@@ -1,36 +1,7 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Serials › [% title |html %] › [% IF ( op ) %]Create Routing List[% ELSE %]Edit routing list[% END %]</title> > [% INCLUDE 'doc-head-close.inc' %] >-<script type="text/javascript"> >- $(document).ready(function(){ >- $("#add_recipients").on("click",function(e){ >- e.preventDefault(); >- userPopup(); >- }); >- $(".itemrank").on("change",function(){ >- var subscriptionid = $(this).data("subscriptionid"); >- var routingid = $(this).data("routingid"); >- reorder_item( subscriptionid, routingid, $(this).val()); >- }); >- }); >-function reorder_item(sid,rid,rank){ >- var mylocation = 'reorder_members.pl?subscriptionid='+sid+'&routingid='+rid+'&rank='+rank; >- window.location.href=mylocation; >-} >- >- function userPopup() { >- window.open("/cgi-bin/koha/serials/add_user_search.pl", >- 'PatronPopup', >- 'width=740,height=450,location=yes,toolbar=no,' >- + 'scrollbars=yes,resize=yes' >- ); >- } >- >- function add_user(borrowernumber) { >- var myurl = "routing.pl?subscriptionid="+[% subscriptionid %]+"&borrowernumber="+borrowernumber+"&op=add"; >- window.location.href = myurl; >- } >-</script> > </head> > <body id="ser_routing" class="ser"> > [% INCLUDE 'header.inc' %] >@@ -115,4 +86,38 @@ function reorder_item(sid,rid,rank){ > [% INCLUDE 'serials-menu.inc' %] > </div> > </div> >+ >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript"> >+ $(document).ready(function(){ >+ $("#add_recipients").on("click",function(e){ >+ e.preventDefault(); >+ userPopup(); >+ }); >+ $(".itemrank").on("change",function(){ >+ var subscriptionid = $(this).data("subscriptionid"); >+ var routingid = $(this).data("routingid"); >+ reorder_item( subscriptionid, routingid, $(this).val()); >+ }); >+ }); >+ function reorder_item(sid,rid,rank){ >+ var mylocation = 'reorder_members.pl?subscriptionid='+sid+'&routingid='+rid+'&rank='+rank; >+ window.location.href=mylocation; >+ } >+ >+ function userPopup() { >+ window.open("/cgi-bin/koha/serials/add_user_search.pl", >+ 'PatronPopup', >+ 'width=740,height=450,location=yes,toolbar=no,' >+ + 'scrollbars=yes,resize=yes' >+ ); >+ } >+ >+ function add_user(borrowernumber) { >+ var myurl = "routing.pl?subscriptionid="+[% subscriptionid %]+"&borrowernumber="+borrowernumber+"&op=add"; >+ window.location.href = myurl; >+ } >+ </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 19761
:
69620
|
69639
| 69789