From 41cf435522beb4759d5fab1c7db6bab84e8b2abf Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 3 Nov 2014 17:23:22 +0100 Subject: [PATCH] Bug 13190: Reintroduce the checkouts export feature Bug 11703 breaks the checkouts export feature. To reproduce: Fill the ExportWithCsvProfile pref and go on the circ/circulation.pl page. The export column appears, but not the export button. Test plan: Go on the checkout list (circ/circulation.pl and members/moremember.pl) and verify the export column and the export button appears. If you click on the button, a file should be generated. --- circ/circulation.pl | 2 - .../intranet-tmpl/prog/en/js/pages/circulation.js | 5 - .../prog/en/modules/circ/circulation.tt | 119 +++++++++++++-------- .../prog/en/modules/members/moremember.tt | 7 ++ 4 files changed, 81 insertions(+), 52 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 2a1f211..0955cfa 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -596,8 +596,6 @@ $template->param( SpecifyDueDate => $duedatespec_allow, CircAutocompl => C4::Context->preference("CircAutocompl"), AllowRenewalLimitOverride => C4::Context->preference("AllowRenewalLimitOverride"), - export_remove_fields => C4::Context->preference("ExportRemoveFields"), - export_with_csv_profile => C4::Context->preference("ExportWithCsvProfile"), canned_bor_notes_loop => $canned_notes, debarments => GetDebarments({ borrowernumber => $borrowernumber }), todaysdate => dt_from_string()->set(hour => 23)->set(minute => 59), diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/pages/circulation.js b/koha-tmpl/intranet-tmpl/prog/en/js/pages/circulation.js index 8ab4d17..43a9805 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/pages/circulation.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/pages/circulation.js @@ -45,11 +45,6 @@ $(document).ready(function() { export_checkouts(export_format); return false; }); - - toggle_onsite_checkout(); - $("#onsite_checkout").click(function(){ - toggle_onsite_checkout(); - }); }); function export_checkouts(format) { 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 7421979..3f66e7a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -1,7 +1,7 @@ [% USE Koha %] [% USE Branches %] [% USE KohaDates %] -[% IF ( export_remove_fields OR export_with_csv_profile ) %] +[% IF Koha.Preference('ExportRemoveFields') OR Koha.Preference('ExportWithCsvProfile') %] [% SET exports_enabled = 1 %] [% END %] [% USE AuthorisedValues %] @@ -45,17 +45,6 @@ var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); [% IF ( borrowernumber ) %]if($.cookie("holdfor") != [% borrowernumber %]){ $.cookie("holdfor",null, { path: "/", expires: 0 }); }[% ELSE %]$.cookie("holdfor",null, { path: "/", expires: 0 });[% END %] [% UNLESS ( borrowernumber ) %][% UNLESS ( selectborrower ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %][% END %] -$(document).ready(function() { - [% IF !( CircAutoPrintQuickSlip == 'clear' ) %] - // listen submit to trigger qslip on empty checkout - $('#mainform').bind('submit',function() { - if ($('#barcode').val() == '') { - return printx_window( '[% CircAutoPrintQuickSlip %]' ); - } - }); - [% END %] -}); - // On-site checkout function toggle_onsite_checkout(){ if ( $("#onsite_checkout").attr('checked') ) { @@ -70,6 +59,21 @@ function toggle_onsite_checkout(){ } } +$(document).ready(function() { + [% 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(); + }); +}); + //]]> @@ -770,41 +774,66 @@ No patron matched [% message %]

- - - - - - - - - - - - - - - - - - - - [% INCLUDE 'checkouts-table-footer.inc' %] -
  Due dateDue dateTitleItem typeChecked out onChecked out fromCall noChargePriceRenew

select all | none

Check in

select all | none

Export

select all | none

- - - - -
- [% IF ( CAN_user_circulate_override_renewals ) %] - [% IF ( AllowRenewalLimitOverride ) %] - - +
+ + + + + + + + + + + + + + + + + + + + [% INCLUDE 'checkouts-table-footer.inc' %] +
  Due dateDue dateTitleItem typeChecked out onChecked out fromCall noChargePriceRenew

select all | none

Check in

select all | none

Export

select all | none

+ + + + +
+ [% IF ( CAN_user_circulate_override_renewals ) %] + [% IF ( AllowRenewalLimitOverride ) %] + + + [% END %] + [% END %] + + +
+ + [% IF issuecount %] + [% IF ( exports_enabled ) %] +
+ + + + + + + + + +
[% END %] [% END %] - - -
+ + [% ELSE %]

Patron has nothing checked out.

[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index 24408ca..1e63fea 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -1,5 +1,8 @@ [% USE Koha %] [% USE KohaDates %] +[% IF Koha.Preference('ExportRemoveFields') OR Koha.Preference('ExportWithCsvProfile') %] + [% SET exports_enabled = 1 %] +[% END %] [% INCLUDE 'doc-head-open.inc' %] Koha › Patrons › [% IF ( unknowuser ) %] @@ -17,6 +20,7 @@ <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="[% themelang %]/js/pages/circulation.js"></script> <script type="text/javascript" src="[% themelang %]/js/checkouts.js"></script> <script type="text/javascript" src="[% themelang %]/js/holds.js"></script> <script type="text/JavaScript"> @@ -34,6 +38,9 @@ var relatives_borrowernumbers = new Array(); relatives_borrowernumbers.push("[% b %]"); [% END %] +var MSG_ADD_MESSAGE = _("Add a new message"); +var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); + $(document).ready(function() { $('#finesholdsissues').tabs({ // Correct table sizing for tables hidden in tabs -- 2.1.0