This fixes some of the issues reported by the QA script, but not all.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
# 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;
use Koha::Patron;
use Mail::Sendmail;
use Try::Tiny;
+use Modern::Perl;
use base qw(Koha::Object);
All methods should return a hashref in the following format:
+=over
+
=item * error
This should be set to 1 if an error was encountered.
The value returned by the method.
-=over
+=back
=head2 Interface Status Messages
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 {
);
}
+=head3 patron
+
+=cut
+
sub patron {
my ( $self ) = @_;
return Koha::Patron->_new_from_dbic(
);
}
+=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;
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.
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);
return \@available_actions;
}
+=head3 mark_completed
+
+Mark a request as completed (status = COMP).
+
+=cut
+
sub mark_completed {
my ( $self ) = @_;
$self->status('COMP')->store;
};
}
+=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,
return $self->expandTemplate($response);
}
+=head3 backend_update_status
+
+=cut
+
sub backend_update_status {
my ( $self, $params ) = @_;
return $self->expandTemplate($self->_backend->update_status($params));
} 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} });
}
=head2 Class Methods
-=cut
-
=head3 type
=cut
return 'Illrequestattribute';
}
+=head3 object_class
+
+=cut
+
sub object_class {
return 'Koha::Illrequestattribute';
}
=head2 Class Methods
-=cut
-
-=head3 type
+=head3 _type
=cut
return 'Illrequest';
}
+=head3 object_class
+
+=cut
+
sub object_class {
return 'Koha::Illrequest';
}
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;
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();
</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>
[% 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>
[% 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>
#!/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;
#!/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;