From 33d285599f843cf260d64f1bea3966aa8e97d8eb 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 Signed-off-by: Tomas Cohen Arazi --- 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 e5619de5d8..7ec5c5ea60 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 65dab64851..e3337760eb 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 4c7d3db6f4..aef6da98d6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -549,7 +549,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 33823a2ce4..53e73735f9 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 1740795a95..494a84138d 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' ); -- 2.39.5