From 76f148adde58d91bf86896e6f0436884944311ab Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 22 Oct 2014 02:18:03 -0400 Subject: [PATCH] Bug 10860 [QA Followup] - Fix misc issues --- C4/Circulation.pm | 5 ++--- koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js | 10 +++++----- .../prog/en/modules/circ/circulation.tt | 2 +- .../prog/en/modules/members/readingrec.tt | 13 ++++++------- t/db_dependent/Circulation.t | 2 +- 5 files changed, 15 insertions(+), 17 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index e5619de..7ec5c5e 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1189,11 +1189,10 @@ AddIssue does the following things : sub AddIssue { my ( $borrower, $barcode, $datedue, $cancelreserve, $issuedate, $sipmode, $params ) = @_; - my $onsite_checkout = $params->{onsite_checkout}; - my $auto_renew = $params->{auto_renew}; + my $onsite_checkout = $params && $params->{onsite_checkout} ? 1 : 0; + my $auto_renew = $params && $params->{auto_renew}; my $dbh = C4::Context->dbh; my $barcodecheck=CheckValidBarcode($barcode); - $onsite_checkout = ( $onsite_checkout ? 1 : 0 ); if ($datedue && ref $datedue ne 'DateTime') { $datedue = dt_from_string($datedue); diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js index 65dab64..e333776 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js @@ -307,11 +307,11 @@ $(document).ready(function() { span_class = "renewals-allowed"; } - content += "" - + "" - + ""; + if ( oObj.renewals_remaining && oObj.onsite_checkout == 0 ) { + content += "" + + "" + + ""; - if ( oObj.renewals_remaining && onsite_checkout == 0 ) { content += "(" + RENEWALS_REMAINING.format( oObj.renewals_remaining, oObj.renewals_allowed ) + ")"; @@ -444,7 +444,7 @@ $(document).ready(function() { var onsite_checkout = ''; if ( oObj.onsite_checkout == 1 ) { - onsite_checkout += " ("+INHOUSE_USE+")"; + onsite_checkout += " (" + INHOUSE_USE + ")"; } title += " " 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 8513a16..e439cb5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -533,7 +533,7 @@ No patron matched [% message %] [% END %] - [% IF onsite_checkout_feature %] + [% IF Koha.Preference('On-site checkouts') %]
[% IF noissues %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt index 33823a2..53e7373 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt @@ -17,11 +17,11 @@ ] })); var tabs = $("#tabs").tabs({ - select: function(e, ui) { - var id = $(ui.tab).attr("id"); - if ( id == "tab_checkout" ) { - table.fnFilter("checkout", 0); - } else if ( id == "tab_onsite_checkout" ) { + activate: function(e, ui) { + var active = tabs.tabs("option", "active" ); + if ( active == 1 ) { + table.fnFilter("standard_checkout", 0); + } else if ( active == 2 ) { table.fnFilter("onsite_checkout", 0); } else { // all table.fnFilter('', 0); @@ -82,7 +82,7 @@ [% IF issue.onsite_checkout %] onsite_checkout [% ELSE %] - checkout + standard_checkout [% END %] @@ -105,7 +105,6 @@ [% issue.issuedate | $KohaDates %] - [% issue.issuedate | $KohaDates %] [% issue.issuingbranch %] [% IF issue.date_due %] diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t index 1740795..494a841 100755 --- a/t/db_dependent/Circulation.t +++ b/t/db_dependent/Circulation.t @@ -338,7 +338,7 @@ C4::Context->dbh->do("DELETE FROM accountlines"); $biblionumber ); - AddIssue( $renewing_borrower, $barcode4, undef, undef, undef, undef, 1 ); + AddIssue( $renewing_borrower, $barcode4, undef, undef, undef, undef, { auto_renew => 1 } ); ( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $itemnumber4 ); is( $renewokay, 0, 'Cannot renew, renewal is automatic' ); -- 1.7.2.5