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>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
cc4cf2bde4
commit
512c5f0c0d
|
|
@ -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' %]
|
||||
|
|
|
|||
|
|
@ -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' %]
|
||||
|
|
|
|||
|
|
@ -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' %]
|
||||
|
|
|
|||
Loading…
Reference in New Issue