Koha/koha-tmpl/intranet-tmpl/prog/js/serials-toolbar.js
Owen Leonard 666a1b2760 Bug 19777: Move template JavaScript to the footer: Serials, part 3
This patch modifies even more staff client serials templates so
that JavaScript is included in the footer instead of the header.

This patch adds a new JavaScript include, serials-toolbar.js, which is
required on pages which include serials-toolbar.inc.

To test, apply the patch and test the JavaScript-driven features of the
modified templates: All button controls, DataTables functionality, tabs,
etc.

 - Serials
   - Search for a subscription
     - Tabs, datatables, date pickers
     - Open a subscription for viewing
       - Tabs, toolbar buttons for delete, renew, and close.
   - Serial collection (in the sidebar menu)
     - Select all / clear all
     - Datatable
     - Print slip
     - Generate next

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>
2017-12-14 16:58:13 -03:00

43 lines
1.3 KiB
JavaScript

/* global MSG_CLOSE_SUBSCRIPTION MSG_REOPEN_SUBSCRIPTION CONFIRM_DELETE_SUBSCRIPTION subscriptionid */
function confirm_close() {
var is_confirmed = confirm( MSG_CLOSE_SUBSCRIPTION );
if (is_confirmed) {
window.location="subscription-detail.pl?subscriptionid=" + subscriptionid + "&op=close";
}
}
function confirm_reopen() {
var is_confirmed = confirm( MSG_REOPEN_SUBSCRIPTION );
if (is_confirmed) {
window.location="subscription-detail.pl?subscriptionid=" + subscriptionid + "&op=reopen";
}
}
function confirm_deletion() {
var is_confirmed = confirm( CONFIRM_DELETE_SUBSCRIPTION );
if (is_confirmed) {
window.location="subscription-detail.pl?subscriptionid=[% subscriptionid %]&op=del";
}
}
function popup(subscriptionid) {
newin=window.open("subscription-renew.pl?mode=popup&subscriptionid="+subscriptionid,'popup','width=590,height=440,toolbar=false,scrollbars=yes');
}
$(document).ready(function() {
$("#deletesub").click(function(){
confirm_deletion();
return false;
});
$("#reopen").click(function(){
confirm_reopen();
return false;
});
$("#close").click(function(){
confirm_close();
return false;
});
$("#renew").click(function(){
popup( subscriptionid );
return false;
});
});