Bugzilla – Attachment 68877 Details for
Bug 7317
Add an Interlibrary Loan Module to Circulation and OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7317: QA followup
Bug-7317-QA-followup.patch (text/plain), 13.94 KB, created by
Magnus Enger
on 2017-11-01 10:53:14 UTC
(
hide
)
Description:
Bug 7317: QA followup
Filename:
MIME Type:
Creator:
Magnus Enger
Created:
2017-11-01 10:53:14 UTC
Size:
13.94 KB
patch
obsolete
>From 374d770c4e77e044e10a58953853c860be4aefcc Mon Sep 17 00:00:00 2001 >From: Magnus Enger <magnus@libriotech.no> >Date: Tue, 31 Oct 2017 12:07:00 +0000 >Subject: [PATCH] Bug 7317: QA followup > >This fixes some of the issues reported by the QA script, but not all. >--- > Koha/Illrequest.pm | 70 ++++++++++++++++++---- > Koha/Illrequestattributes.pm | 6 +- > Koha/Illrequests.pm | 8 ++- > Koha/REST/V1/Illrequests.pm | 12 ++++ > .../prog/en/modules/ill/ill-requests.tt | 9 +-- > .../bootstrap/en/modules/opac-results-grouped.tt | 9 +-- > .../opac-tmpl/bootstrap/en/modules/opac-results.tt | 9 +-- > t/db_dependent/Illrequestattributes.t | 23 ++++--- > t/db_dependent/Illrequests.t | 23 ++++--- > 9 files changed, 106 insertions(+), 63 deletions(-) > >diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm >index 2b34b88..5adecb5 100644 >--- a/Koha/Illrequest.pm >+++ b/Koha/Illrequest.pm >@@ -18,8 +18,6 @@ package Koha::Illrequest; > # Koha; if not, write to the Free Software Foundation, Inc., 51 Franklin > # Street, Fifth Floor, Boston, MA 02110-1301 USA. > >-# use Modern::Perl; >- > use Clone 'clone'; > use File::Basename qw/basename/; > use Koha::Database; >@@ -29,6 +27,7 @@ use Koha::Illrequestattributes; > use Koha::Patron; > use Mail::Sendmail; > use Try::Tiny; >+use Modern::Perl; > > use base qw(Koha::Object); > >@@ -59,6 +58,8 @@ TODO: > > All methods should return a hashref in the following format: > >+=over >+ > =item * error > > This should be set to 1 if an error was encountered. >@@ -75,7 +76,7 @@ The message is a free text field that can be passed on to the end user. > > The value returned by the method. > >-=over >+=back > > =head2 Interface Status Messages > >@@ -100,8 +101,12 @@ the API. > The interface's request method returned saying that the desired item is not > available for request. > >+=back >+ > =head2 Class methods > >+=head3 illrequestattributes >+ > =cut > > sub illrequestattributes { >@@ -111,6 +116,10 @@ sub illrequestattributes { > ); > } > >+=head3 patron >+ >+=cut >+ > sub patron { > my ( $self ) = @_; > return Koha::Patron->_new_from_dbic( >@@ -118,14 +127,20 @@ sub patron { > ); > } > >+=head3 load_backend >+ >+Require "Base.pm" from the relevant ILL backend. >+ >+=cut >+ > sub load_backend { > my ( $self, $backend_id ) = @_; > > my @raw = qw/Koha Illbackends/; # Base Path > > my $backend_name = $backend_id || $self->backend; >- $location = join "/", @raw, $backend_name, "Base.pm"; # File to load >- $backend_class = join "::", @raw, $backend_name, "Base"; # Package name >+ my $location = join "/", @raw, $backend_name, "Base.pm"; # File to load >+ my $backend_class = join "::", @raw, $backend_name, "Base"; # Package name > require $location; > $self->{_my_backend} = $backend_class->new({ config => $self->_config }); > return $self; >@@ -342,7 +357,7 @@ sub _status_graph_union { > my $status_graph = clone($core_status_graph); > > foreach my $backend_status_key ( keys %{$backend_status_graph} ) { >- $backend_status = $backend_status_graph->{$backend_status_key}; >+ my $backend_status = $backend_status_graph->{$backend_status_key}; > # Add to new status graph > $status_graph->{$backend_status_key} = $backend_status; > # Update all core methods' next_actions. >@@ -445,15 +460,27 @@ sub custom_capability { > return 0; > } > >+=head3 available_backends >+ >+Return a list of available backends. >+ >+=cut >+ > sub available_backends { > my ( $self ) = @_; > my $backend_dir = $self->_config->backend_dir; > my @backends = (); >- @backends = <$backend_dir/*> if ( $backend_dir ); >+ @backends = glob "$backend_dir/*" if ( $backend_dir ); > @backends = map { basename($_) } @backends; > return \@backends; > } > >+=head3 available_actions >+ >+Return a list of available actions. >+ >+=cut >+ > sub available_actions { > my ( $self ) = @_; > my $current_action = $self->capabilities($self->status); >@@ -462,6 +489,12 @@ sub available_actions { > return \@available_actions; > } > >+=head3 mark_completed >+ >+Mark a request as completed (status = COMP). >+ >+=cut >+ > sub mark_completed { > my ( $self ) = @_; > $self->status('COMP')->store; >@@ -475,12 +508,23 @@ sub mark_completed { > }; > } > >+=head2 backend_confirm >+ >+Confirm a request. The backend handles setting of mandatory fields in the commit stage: >+ >+=over >+ >+=item * orderid >+ >+=item * accessurl, cost (if available). >+ >+=back >+ >+=cut >+ > sub backend_confirm { > my ( $self, $params ) = @_; > >- # The backend handles setting of mandatory fields in the commit stage: >- # - orderid >- # - accessurl, cost (if available). > my $response = $self->_backend->confirm({ > request => $self, > other => $params, >@@ -488,6 +532,10 @@ sub backend_confirm { > return $self->expandTemplate($response); > } > >+=head3 backend_update_status >+ >+=cut >+ > sub backend_update_status { > my ( $self, $params ) = @_; > return $self->expandTemplate($self->_backend->update_status($params)); >@@ -739,7 +787,7 @@ sub _limit_counter { > } else { # assume 'active' > # XXX: This status list is ugly. There should be a method in config > # to return these. >- $where = { status => { -not_in => [ 'QUEUED', 'COMP' ] } }; >+ my $where = { status => { -not_in => [ 'QUEUED', 'COMP' ] } }; > $resultset = Koha::Illrequests->search({ %{$target}, %{$where} }); > } > >diff --git a/Koha/Illrequestattributes.pm b/Koha/Illrequestattributes.pm >index e05fa6e..1d87a90 100644 >--- a/Koha/Illrequestattributes.pm >+++ b/Koha/Illrequestattributes.pm >@@ -32,8 +32,6 @@ Koha::Illrequestattributes - Koha Illrequestattributes Object class > > =head2 Class Methods > >-=cut >- > =head3 type > > =cut >@@ -42,6 +40,10 @@ sub _type { > return 'Illrequestattribute'; > } > >+=head3 object_class >+ >+=cut >+ > sub object_class { > return 'Koha::Illrequestattribute'; > } >diff --git a/Koha/Illrequests.pm b/Koha/Illrequests.pm >index 85cc711..f09660e 100644 >--- a/Koha/Illrequests.pm >+++ b/Koha/Illrequests.pm >@@ -33,9 +33,7 @@ Koha::Illrequests - Koha Illrequests Object class > > =head2 Class Methods > >-=cut >- >-=head3 type >+=head3 _type > > =cut > >@@ -43,6 +41,10 @@ sub _type { > return 'Illrequest'; > } > >+=head3 object_class >+ >+=cut >+ > sub object_class { > return 'Koha::Illrequest'; > } >diff --git a/Koha/REST/V1/Illrequests.pm b/Koha/REST/V1/Illrequests.pm >index 947fb79..6e3eace 100644 >--- a/Koha/REST/V1/Illrequests.pm >+++ b/Koha/REST/V1/Illrequests.pm >@@ -22,6 +22,18 @@ use Mojo::Base 'Mojolicious::Controller'; > use Koha::Illrequests; > use Koha::Libraries; > >+=head1 NAME >+ >+Koha::REST::V1::Illrequests >+ >+=head2 Operations >+ >+=head3 list >+ >+Return a list of ILL requests, after applying filters. >+ >+=cut >+ > sub list { > my $c = shift->openapi->valid_input or return; > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt >index 6d1b9a7..96943c1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt >@@ -348,7 +348,6 @@ > filterNames.forEach(function(thisFilter) { > var filterName = toColumnName(thisFilter) + ':name'; > var regex = '^'+filters[thisFilter]+'$'; >- console.log(regex); > myTable.columns(filterName).search(regex, true, false); > }); > myTable.draw(); >@@ -586,13 +585,9 @@ > </div> > <div class="borrowernumber"> > <span class="label borrowernumber">Borrower:</span> >- [% borrowerlink = "/cgi-bin/koha/members/moremember.pl" >- _ "?borrowernumber=" _ request.patron.borrowernumber %] >+ [% borrowerlink = "/cgi-bin/koha/members/moremember.pl" _ "?borrowernumber=" _ request.patron.borrowernumber %] > <a href="[% borrowerlink %]" title="View borrower details"> >- [% request.patron.firstname _ " " >- _ request.patron.surname _ " [" >- _ request.patron.cardnumber >- _ "]" %] >+ [% request.patron.firstname _ " " _ request.patron.surname _ " [" _ request.patron.cardnumber _ "]" %] > </a> > </div> > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt >index eaa20b3..f24c04c 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt >@@ -253,14 +253,7 @@ href="/cgi-bin/koha/opac-rss.pl?[% query_cgi %][% limit_cgi |html %]" /> > [% INCLUDE 'page-numbers.inc' %] > [% END # / IF total %] > >- [% IF >- Koha.Preference( 'suggestion' ) == 1 && >- ( >- Koha.Preference( 'AnonSuggestions' ) == 1 || >- loggedinusername || >- Koha.Preference( 'ILLModule' ) == 1 >- ) >- %] >+ [% IF Koha.Preference( 'suggestion' ) == 1 && ( Koha.Preference( 'AnonSuggestions' ) == 1 || loggedinusername || Koha.Preference( 'ILLModule' ) == 1 ) %] > <div class="suggestion"> > Not finding what you're looking for? > <ul> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >index 11cf98e..085f6c5 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >@@ -562,14 +562,7 @@ > > [% END # / IF total %] > >- [% IF >- Koha.Preference( 'suggestion' ) == 1 && >- ( >- Koha.Preference( 'AnonSuggestions' ) == 1 || >- loggedinusername || >- Koha.Preference( 'ILLModule' ) == 1 >- ) >- %] >+ [% IF Koha.Preference( 'suggestion' ) == 1 && ( Koha.Preference( 'AnonSuggestions' ) == 1 || loggedinusername || Koha.Preference( 'ILLModule' ) == 1 ) %] > <div class="suggestion"> > Not finding what you're looking for? > <ul> >diff --git a/t/db_dependent/Illrequestattributes.t b/t/db_dependent/Illrequestattributes.t >index ceb0474..0eb5d5c 100644 >--- a/t/db_dependent/Illrequestattributes.t >+++ b/t/db_dependent/Illrequestattributes.t >@@ -1,20 +1,19 @@ > #!/usr/bin/perl >-# >+ > # This file is part of Koha. > # >-# Koha is free software; you can redistribute it and/or modify it under the >-# terms of the GNU General Public License as published by the Free Software >-# Foundation; either version 2 of the License, or (at your option) any later >-# version. >-# >-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >-# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. > # >-# You should have received a copy of the GNU General Public License along >-# with Koha; if not, write to the Free Software Foundation, Inc., >-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. > # >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; > >diff --git a/t/db_dependent/Illrequests.t b/t/db_dependent/Illrequests.t >index b65dc08..c778bad 100644 >--- a/t/db_dependent/Illrequests.t >+++ b/t/db_dependent/Illrequests.t >@@ -1,20 +1,19 @@ > #!/usr/bin/perl >-# >+ > # This file is part of Koha. > # >-# Koha is free software; you can redistribute it and/or modify it under the >-# terms of the GNU General Public License as published by the Free Software >-# Foundation; either version 2 of the License, or (at your option) any later >-# version. >-# >-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >-# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. > # >-# You should have received a copy of the GNU General Public License along >-# with Koha; if not, write to the Free Software Foundation, Inc., >-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. > # >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; > >-- >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 7317
:
59893
|
59894
|
59895
|
59920
|
60485
|
60486
|
60487
|
60488
|
63081
|
63082
|
63083
|
63084
|
63085
|
63086
|
63087
|
63088
|
63089
|
63090
|
63113
|
63175
|
63176
|
63354
|
63421
|
63472
|
63475
|
65469
|
65470
|
65471
|
65472
|
65473
|
65474
|
65475
|
65476
|
66266
|
67242
|
67243
|
67244
|
67245
|
67246
|
67247
|
67248
|
67249
|
67250
|
67251
|
67252
|
67253
|
67254
|
67255
|
67256
|
67257
|
67258
|
67259
|
67260
|
67261
|
67262
|
67263
|
67264
|
67281
|
67282
|
67283
|
67284
|
67285
|
67286
|
67287
|
67288
|
67289
|
67290
|
67291
|
67292
|
67293
|
67294
|
67295
|
67296
|
67297
|
67298
|
67299
|
67300
|
67301
|
67302
|
67303
|
68185
|
68186
|
68328
|
68391
|
68406
|
68407
|
68408
|
68409
|
68418
|
68444
|
68445
|
68483
|
68484
|
68485
|
68487
|
68516
|
68517
|
68518
|
68519
|
68520
|
68521
|
68522
|
68523
|
68524
|
68525
|
68542
|
68543
|
68544
|
68545
|
68546
|
68547
|
68548
|
68549
|
68550
|
68551
|
68552
|
68558
|
68559
|
68560
|
68561
|
68562
|
68563
|
68564
|
68565
|
68566
|
68567
|
68858
|
68874
| 68877 |
68878
|
68885
|
68886
|
68921
|
68922
|
68926
|
68927
|
68928
|
68929
|
68931
|
68932
|
68933
|
68988
|
68989
|
68999
|
69000
|
69006
|
69008
|
69009
|
69012
|
69014
|
69044
|
69045
|
69046
|
69056
|
69059
|
69060
|
69061
|
69063
|
69064
|
69065
|
69066
|
69069
|
69070
|
69071
|
69074