Bugzilla – Attachment 70429 Details for
Bug 19641
Move patron templates JavaScript to the footer
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19641 (Follow-up) Update circulation.tt too
Bug-19641-Follow-up-Update-circulationtt-too.patch (text/plain), 13.37 KB, created by
Owen Leonard
on 2018-01-11 16:30:08 UTC
(
hide
)
Description:
Bug 19641 (Follow-up) Update circulation.tt too
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2018-01-11 16:30:08 UTC
Size:
13.37 KB
patch
obsolete
>From 1a34c90d9e6a58cd8fd56cf26c6d9d545e6af45c Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 11 Jan 2018 16:15:01 +0000 >Subject: [PATCH] Bug 19641 (Follow-up) Update circulation.tt too > >This patch makes the same JS-to-footer changes to circulation.tt. >Inclusion of this template in this bug is necessary because it includes >members-toolbar.inc. > >To test, apply the patch and clear your browser cache if necessary. > >- Enter a patron card for checkout >- Test any JavaScript-driven actions on the checkout page, for instance: > - Select all/clear all controls > - Datepicker/timepickers > - Datatable sorting, columns configuration > - Renewals, check-ins > - Patron message interactions, print slip, and other toolbar actions > - Checkout exports > - Search to hold > - Tab loading: Restrictions, Holds, Clubs >--- > .../prog/en/modules/circ/circulation.tt | 269 +++++++++++---------- > 1 file changed, 138 insertions(+), 131 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index 842e479..8c56021 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -6,6 +6,7 @@ > [% USE ItemTypes %] > [% USE Price %] > [% USE AuthorisedValues %] >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > [% SET destination = "circ" %] > <title>Koha › Circulation >@@ -14,118 +15,9 @@ > [% END %] > </title> > [% INCLUDE 'doc-head-close.inc' %] >-[% INCLUDE 'calendar.inc' %] >- > <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> >-[% INCLUDE 'strings.inc' %] >-[% INCLUDE 'datatables.inc' %] >-[% INCLUDE 'columns_settings.inc' %] >-<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script> >-<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min.js"></script> >-[% INCLUDE 'timepicker.inc' %] >-<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.rowGrouping.js"></script> >-<script type="text/javascript" src="[% interface %]/[% theme %]/js/pages/circulation.js"></script> >-<script type="text/javascript" src="[% interface %]/[% theme %]/js/checkouts.js"></script> >-<script type="text/javascript" src="[% interface %]/[% theme %]/js/holds.js"></script> >-<script type="text/javascript"> >-//<![CDATA[ >-/* Set some variable needed in circulation.js */ >-var MSG_DT_LOADING_RECORDS = _("Loading... you may continue scanning."); >-var interface = "[% interface %]"; >-var theme = "[% theme %]"; >-var borrowernumber = "[% borrowernumber %]"; >-var branchcode = "[% branch %]"; >-var exports_enabled = "[% Koha.Preference('ExportCircHistory') %]"; >-var AllowRenewalLimitOverride = [% (CAN_user_circulate_override_renewals && Koha.Preference('AllowRenewalLimitOverride') )? 1: 0 %]; >-var AllowCirculate = [% (CAN_user_circulate_circulate_remaining_permissions)? 1 : 0 %]; >-var script = "circulation"; >-var relatives_borrowernumbers = new Array(); >-[% FOREACH b IN relatives_borrowernumbers %] >- relatives_borrowernumbers.push("[% b %]"); >-[% END %] >- >-var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); >-var MSG_CONFIRM_DELETE_MESSAGE = _("Are you sure you want to delete this message? This cannot be undone."); >- >-columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) %] >- >-[% IF borrowernumber and borrower %] >- if($.cookie("holdfor") != [% borrowernumber %]){ >- $.removeCookie("holdfor", { path: '/' }); >- } >-[% ELSE %] >- $.removeCookie("holdfor", { path: '/' }); >-[% END %] >- >-[% UNLESS ( borrowernumber ) %][% UNLESS ( borrowers ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %][% END %] >- >-// On-site checkout >-function toggle_onsite_checkout(){ >- if ( $("#onsite_checkout").prop('checked') ) { >- $("#duedatespec").val("[% todaysdate | $KohaDates with_hours => 1%]") >- [% IF !Koha.Preference('SpecifyDueDate') %] >- $("#duedatespec").datetimepicker('destroy'); >- [% END %] >- } else { >- $("#duedatespec").datetimepicker({ >- onClose: function(dateText, inst) { >- if (validate_date(dateText, inst) ) { >- $("#barcode").focus(); >- } >- }, >- hour: 23, >- minute: 59 >- }).on("change", function(e, value) { >- if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");} >- }); >- } >-} >- >-function Dopop(link) { >- var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top'); >-} >-$(document).ready(function() { >- $('#mainform').on('submit',function() { >- if ($("#barcode") && $("#barcode").val()) { >- $('#barcode').on('keypress',function(event) { >- $('#barcodeSubmittedModal').modal(); >- event.preventDefault(); } >- ); >- } >- }); >- >- if ( $('#clubs-tab').length ) { >- $('#clubs-tab-link').on('click', function() { >- $('#clubs-tab').text(_("Loading...")); >- $('#clubs-tab').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=[% borrowernumber %]'); >- }); >- } >- >- [% IF !( CircAutoPrintQuickSlip == 'clear' ) %] >- // listen submit to trigger qslip on empty checkout >- $('#mainform').bind('submit',function() { >- if ($('#barcode').val() == '') { >- return printx_window( '[% CircAutoPrintQuickSlip %]' ); >- } >- }); >- [% END %] >- toggle_onsite_checkout(); >- $("#onsite_checkout").click(function(){ >- toggle_onsite_checkout(); >- }); >- >- $("#suspend_until").datepicker({ >- onClose: function(dateText, inst) { >- validate_date(dateText, inst); >- }, >- minDate: 1, // require that hold suspended until date is after today >- }); >- >-}); >- >-//]]> >-</script> > </head> >+ > <body id="circ_circulation" class="circ"> > > [% INCLUDE 'header.inc' %] >@@ -300,27 +192,6 @@ $(document).ready(function() { > [% END %] > </ul> > >-[% IF HIGHHOLDS %] >-<script language="JavaScript" type="text/javascript"> >-$(document).ready(function() { >- [% IF !override_high_holds %] >- $("input[name=duedatespec]:hidden").val('[% HIGHHOLDS.returndate %]'); >- if ('[% duedatespec %]' === '') { >- $("input[name=restoreduedatespec]:hidden").val('highholds_empty'); >- } else { >- $("input[name=restoreduedatespec]:hidden").val('[% duedatespec %]'); >- } >- [% END %] >- >- $("#override_high_holds_tmp").on( 'change', function() { >- if ( this.checked ) { >- $("input[name=duedatespec]:hidden").val(''); >- } >- }); >-}); >-</script> >-[% END %] >- > [% IF CAN_user_circulate_force_checkout or HIGHHOLDS %] > <form method="post" action="/cgi-bin/koha/circ/circulation.pl" autocomplete="off"> > <input type="hidden" name="restoreduedatespec" /> >@@ -1095,4 +966,140 @@ No patron matched <span class="ex">[% message | html %]</span> > </div> > </div> > </div> >+ >+[% MACRO jsinclude BLOCK %] >+ [% INCLUDE 'strings.inc' %] >+ [% INCLUDE 'calendar.inc' %] >+ [% INCLUDE 'datatables.inc' %] >+ [% INCLUDE 'columns_settings.inc' %] >+ <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script> >+ <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min.js"></script> >+ [% INCLUDE 'timepicker.inc' %] >+ <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.rowGrouping.js"></script> >+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/pages/circulation.js"></script> >+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/checkouts.js"></script> >+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/holds.js"></script> >+ <script type="text/javascript"> >+ /* Set some variable needed in circulation.js */ >+ var MSG_DT_LOADING_RECORDS = _("Loading... you may continue scanning."); >+ var interface = "[% interface %]"; >+ var theme = "[% theme %]"; >+ var borrowernumber = "[% borrowernumber %]"; >+ var branchcode = "[% branch %]"; >+ var exports_enabled = "[% Koha.Preference('ExportCircHistory') %]"; >+ var AllowRenewalLimitOverride = [% (CAN_user_circulate_override_renewals && Koha.Preference('AllowRenewalLimitOverride') )? 1: 0 %]; >+ var AllowCirculate = [% (CAN_user_circulate_circulate_remaining_permissions)? 1 : 0 %]; >+ var script = "circulation"; >+ var relatives_borrowernumbers = new Array(); >+ [% FOREACH b IN relatives_borrowernumbers %] >+ relatives_borrowernumbers.push("[% b %]"); >+ [% END %] >+ >+ var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); >+ var MSG_CONFIRM_DELETE_MESSAGE = _("Are you sure you want to delete this message? This cannot be undone."); >+ >+ /* Set some variables needed in members-menu.js */ >+ var advsearch = "[% advsearch %]"; >+ var dateformat = "[% dateformat %]"; >+ var NorwegianPatronDBEnable = "[% NorwegianPatronDBEnable %]"; >+ var CATCODE_MULTI = "[% CATCODE_MULTI %]"; >+ var catcode = "[% catcode %]"; >+ var destination = "[% destination %]"; >+ var CAN_user_borrowers = "[% CAN_user_borrowers %]"; >+ >+ columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) %] >+ >+ [% IF borrowernumber and borrower %] >+ if($.cookie("holdfor") != [% borrowernumber %]){ >+ $.removeCookie("holdfor", { path: '/' }); >+ } >+ [% ELSE %] >+ $.removeCookie("holdfor", { path: '/' }); >+ [% END %] >+ >+ [% UNLESS ( borrowernumber ) %][% UNLESS ( borrowers ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %][% END %] >+ >+ // On-site checkout >+ function toggle_onsite_checkout(){ >+ if ( $("#onsite_checkout").prop('checked') ) { >+ $("#duedatespec").val("[% todaysdate | $KohaDates with_hours => 1%]") >+ [% IF !Koha.Preference('SpecifyDueDate') %] >+ $("#duedatespec").datetimepicker('destroy'); >+ [% END %] >+ } else { >+ $("#duedatespec").datetimepicker({ >+ onClose: function(dateText, inst) { >+ if (validate_date(dateText, inst) ) { >+ $("#barcode").focus(); >+ } >+ }, >+ hour: 23, >+ minute: 59 >+ }).on("change", function(e, value) { >+ if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");} >+ }); >+ } >+ } >+ >+ function Dopop(link) { >+ var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top'); >+ } >+ $(document).ready(function() { >+ $('#mainform').on('submit',function() { >+ if ($("#barcode") && $("#barcode").val()) { >+ $('#barcode').on('keypress',function(event) { >+ $('#barcodeSubmittedModal').modal(); >+ event.preventDefault(); } >+ ); >+ } >+ }); >+ >+ if ( $('#clubs-tab').length ) { >+ $('#clubs-tab-link').on('click', function() { >+ $('#clubs-tab').text(_("Loading...")); >+ $('#clubs-tab').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=[% borrowernumber %]'); >+ }); >+ } >+ >+ [% IF !( CircAutoPrintQuickSlip == 'clear' ) %] >+ // listen submit to trigger qslip on empty checkout >+ $('#mainform').bind('submit',function() { >+ if ($('#barcode').val() == '') { >+ return printx_window( '[% CircAutoPrintQuickSlip %]' ); >+ } >+ }); >+ [% END %] >+ toggle_onsite_checkout(); >+ $("#onsite_checkout").click(function(){ >+ toggle_onsite_checkout(); >+ }); >+ >+ $("#suspend_until").datepicker({ >+ onClose: function(dateText, inst) { >+ validate_date(dateText, inst); >+ }, >+ minDate: 1, // require that hold suspended until date is after today >+ }); >+ >+ [% IF HIGHHOLDS %] >+ [% IF !override_high_holds %] >+ $("input[name=duedatespec]:hidden").val('[% HIGHHOLDS.returndate %]'); >+ if ('[% duedatespec %]' === '') { >+ $("input[name=restoreduedatespec]:hidden").val('highholds_empty'); >+ } else { >+ $("input[name=restoreduedatespec]:hidden").val('[% duedatespec %]'); >+ } >+ [% END %] >+ >+ $("#override_high_holds_tmp").on( 'change', function() { >+ if ( this.checked ) { >+ $("input[name=duedatespec]:hidden").val(''); >+ } >+ }); >+ [% END %] >+ }); >+ </script> >+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu.js"></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 19641
:
69200
|
69415
|
70428
|
70429
|
70433
|
70720
|
70723
|
70724
|
70725
|
70726
|
70953
|
71289
|
71290
|
71291
|
71292
|
71676
|
71677