View | Details | Raw Unified | Return to bug 7317
Collapse All | Expand All

(-)a/Koha/Exceptions/Ill.pm (+16 lines)
Line 0 Link Here
1
package Koha::Exceptions::Ill;
2
3
use Modern::Perl;
4
5
use Exception::Class (
6
7
    'Koha::Exceptions::Ill' => {
8
        description => 'Something went wrong!',
9
    },
10
    'Koha::Exceptions::Ill::InvalidBackendId' => {
11
        isa => 'Koha::Exceptions::Ill',
12
        description => "Invalid backend name required",
13
    }
14
);
15
16
1;
(-)a/Koha/Illrequest.pm (-2 / +10 lines)
Lines 18-33 package Koha::Illrequest; Link Here
18
# Koha; if not, write to the Free Software Foundation, Inc., 51 Franklin
18
# Koha; if not, write to the Free Software Foundation, Inc., 51 Franklin
19
# Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
# Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
20
21
use Modern::Perl;
22
21
use Clone 'clone';
23
use Clone 'clone';
22
use File::Basename qw/basename/;
24
use File::Basename qw/basename/;
23
use Koha::Database;
25
use Koha::Database;
24
use Koha::Email;
26
use Koha::Email;
27
use Koha::Exceptions::Ill;
25
use Koha::Illrequest;
28
use Koha::Illrequest;
26
use Koha::Illrequestattributes;
29
use Koha::Illrequestattributes;
27
use Koha::Patron;
30
use Koha::Patron;
28
use Mail::Sendmail;
31
use Mail::Sendmail;
29
use Try::Tiny;
32
use Try::Tiny;
30
use Modern::Perl;
31
33
32
use base qw(Koha::Object);
34
use base qw(Koha::Object);
33
35
Lines 138-151 sub load_backend { Link Here
138
140
139
    my @raw = qw/Koha Illbackends/; # Base Path
141
    my @raw = qw/Koha Illbackends/; # Base Path
140
142
143
    unless ( defined $backend_id && $backend_id ne '' ) {
144
        Koha::Exceptions::Ill::InvalidBackendId->throw(
145
            "An invalid backend ID was requested ('')");
146
    }
147
141
    my $backend_name = $backend_id || $self->backend;
148
    my $backend_name = $backend_id || $self->backend;
142
    my $location = join "/", @raw, $backend_name, "Base.pm"; # File to load
149
    my $location = join "/", @raw, $backend_name, "Base.pm";    # File to load
143
    my $backend_class = join "::", @raw, $backend_name, "Base"; # Package name
150
    my $backend_class = join "::", @raw, $backend_name, "Base"; # Package name
144
    require $location;
151
    require $location;
145
    $self->{_my_backend} = $backend_class->new({ config => $self->_config });
152
    $self->{_my_backend} = $backend_class->new({ config => $self->_config });
146
    return $self;
153
    return $self;
147
}
154
}
148
155
156
149
=head3 _backend
157
=head3 _backend
150
158
151
    my $backend = $abstract->_backend($new_backend);
159
    my $backend = $abstract->_backend($new_backend);
(-)a/ill/ill-requests.pl (-6 / +7 lines)
Lines 224-237 if ( $op eq 'illview' ) { Link Here
224
}
224
}
225
225
226
# Get a list of backends
226
# Get a list of backends
227
my $ir = Koha::Illrequest->new;
227
my $available_backends = Koha::Illrequest->new->available_backends;
228
228
229
$template->param(
229
$template->param(
230
    backends    => $ir->available_backends,
230
    backends_available => ( scalar $available_backends > 0 ),
231
    media       => [ "Book", "Article", "Journal" ],
231
    backends           => $available_backends,
232
    query_type  => $op,
232
    media              => [ "Book", "Article", "Journal" ],
233
    branches    => Koha::Libraries->search->unblessed,
233
    query_type         => $op,
234
    here_link   => "/cgi-bin/koha/ill/ill-requests.pl"
234
    branches           => Koha::Libraries->search,
235
    here_link          => "/cgi-bin/koha/ill/ill-requests.pl"
235
);
236
);
236
237
237
output_html_with_http_headers( $cgi, $cookie, $template->output );
238
output_html_with_http_headers( $cgi, $cookie, $template->output );
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-toolbar.inc (-2 / +8 lines)
Lines 1-7 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% IF Koha.Preference('ILLModule ') %]
2
[% IF Koha.Preference('ILLModule ') %]
3
    <div id="toolbar" class="btn-toolbar">
3
    <div id="toolbar" class="btn-toolbar">
4
        [% IF backends.size > 1 %]
4
        [% IF available_backends %]
5
          [% IF backends.size > 1 %]
5
            <div class="dropdown btn-group">
6
            <div class="dropdown btn-group">
6
                <button class="btn btn-sm btn-default dropdown-toggle" type="button" id="ill-backend-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
7
                <button class="btn btn-sm btn-default dropdown-toggle" type="button" id="ill-backend-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
7
                    <i class="fa fa-plus"></i> New ILL request <span class="caret"></span>
8
                    <i class="fa fa-plus"></i> New ILL request <span class="caret"></span>
Lines 12-21 Link Here
12
                    [% END %]
13
                    [% END %]
13
                </ul>
14
                </ul>
14
            </div>
15
            </div>
15
        [% ELSE %]
16
          [% ELSE %]
16
            <a id="ill-new" class="btn btn-sm btn-default" href="/cgi-bin/koha/ill/ill-requests.pl?method=create&amp;backend=[% backends.0 %]">
17
            <a id="ill-new" class="btn btn-sm btn-default" href="/cgi-bin/koha/ill/ill-requests.pl?method=create&amp;backend=[% backends.0 %]">
17
                <i class="fa fa-plus"></i> New ILL request
18
                <i class="fa fa-plus"></i> New ILL request
18
            </a>
19
            </a>
20
          [% END %]
21
        [% ELSE %]
22
            <a id="ill-new" class="btn btn-sm btn-default disabled" href="">
23
                <i class="fa fa-plus"></i> New ILL request
24
            </a>
19
        [% END %]
25
        [% END %]
20
        <a id="ill-list" class="btn btn-sm btn-default btn-group" href="/cgi-bin/koha/ill/ill-requests.pl">
26
        <a id="ill-list" class="btn btn-sm btn-default btn-group" href="/cgi-bin/koha/ill/ill-requests.pl">
21
            <i class="fa fa-list"></i> List requests
27
            <i class="fa fa-list"></i> List requests
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt (-3 / +1 lines)
Lines 4-11 Link Here
4
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
<title>Koha &rsaquo; ILL requests  &rsaquo;</title>
5
<title>Koha &rsaquo; ILL requests  &rsaquo;</title>
6
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
7
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
7
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
8
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
9
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css">
8
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css">
10
[% INCLUDE 'datatables.inc' %]
9
[% INCLUDE 'datatables.inc' %]
11
<script type="text/javascript">
10
<script type="text/javascript">
12
- 

Return to bug 7317