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

(-)a/admin/categories.pl (+3 lines)
Lines 72-77 elsif ( $op eq 'add_validate' ) { Link Here
72
    my $category_type = $input->param('category_type');
72
    my $category_type = $input->param('category_type');
73
    my $BlockExpiredPatronOpacActions = $input->param('BlockExpiredPatronOpacActions');
73
    my $BlockExpiredPatronOpacActions = $input->param('BlockExpiredPatronOpacActions');
74
    my $checkPrevCheckout = $input->param('checkprevcheckout');
74
    my $checkPrevCheckout = $input->param('checkprevcheckout');
75
    my $canplaceillopac = $input->param('canplaceillopac');
75
    my $default_privacy = $input->param('default_privacy');
76
    my $default_privacy = $input->param('default_privacy');
76
    my $reset_password = $input->param('reset_password');
77
    my $reset_password = $input->param('reset_password');
77
    my $change_password = $input->param('change_password');
78
    my $change_password = $input->param('change_password');
Lines 105-110 elsif ( $op eq 'add_validate' ) { Link Here
105
        $category->can_be_guarantee($can_be_guarantee);
106
        $category->can_be_guarantee($can_be_guarantee);
106
        $category->BlockExpiredPatronOpacActions($BlockExpiredPatronOpacActions);
107
        $category->BlockExpiredPatronOpacActions($BlockExpiredPatronOpacActions);
107
        $category->checkprevcheckout($checkPrevCheckout);
108
        $category->checkprevcheckout($checkPrevCheckout);
109
        $category->canplaceillopac($canplaceillopac);
108
        $category->default_privacy($default_privacy);
110
        $category->default_privacy($default_privacy);
109
        $category->reset_password($reset_password);
111
        $category->reset_password($reset_password);
110
        $category->change_password($change_password);
112
        $category->change_password($change_password);
Lines 138-143 elsif ( $op eq 'add_validate' ) { Link Here
138
            can_be_guarantee => $can_be_guarantee,
140
            can_be_guarantee => $can_be_guarantee,
139
            BlockExpiredPatronOpacActions => $BlockExpiredPatronOpacActions,
141
            BlockExpiredPatronOpacActions => $BlockExpiredPatronOpacActions,
140
            checkprevcheckout => $checkPrevCheckout,
142
            checkprevcheckout => $checkPrevCheckout,
143
            canplaceillopac => $canplaceillopac,
141
            default_privacy => $default_privacy,
144
            default_privacy => $default_privacy,
142
            reset_password => $reset_password,
145
            reset_password => $reset_password,
143
            change_password => $change_password,
146
            change_password => $change_password,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt (+30 lines)
Lines 384-389 Link Here
384
                      </div>
384
                      </div>
385
                  </li>
385
                  </li>
386
                [% END %]
386
                [% END %]
387
                [% IF ( Koha.Preference('ILLModule') ) %]
388
                    <li>
389
                        <label for="canplaceillopac">Can place ILL in OPAC: </label>
390
                        <select id="canplaceillopac" name="canplaceillopac">
391
                            [% IF category.canplaceillopac %]
392
                                <option value="0">No</option>
393
                                <option value="1" selected="selected">Yes</option>
394
                            [% ELSE %]
395
                                <option value="0" selected="selected">No</option>
396
                                <option value="1">Yes</option>
397
                            [% END %]
398
                        </select>
399
                        <div class="hint">
400
                            Choose whether patrons of this category can create new interlibrary loan requests.
401
                        </div>
402
                    </li>
403
                [% END %]
387
                <li>
404
                <li>
388
                    <label for="default_privacy">Default privacy: </label>
405
                    <label for="default_privacy">Default privacy: </label>
389
                    <select id="default_privacy" name="default_privacy">
406
                    <select id="default_privacy" name="default_privacy">
Lines 487-492 Link Here
487
            </tr>
504
            </tr>
488
            [% END %]
505
            [% END %]
489
            <tr><th scope="row">Can be guarantee:</th><td>[% IF category.can_be_guarantee %]Yes[% ELSE %]No[% END %]</td></tr>
506
            <tr><th scope="row">Can be guarantee:</th><td>[% IF category.can_be_guarantee %]Yes[% ELSE %]No[% END %]</td></tr>
507
            [% IF ( Koha.Preference('ILLModule') ) %]
508
                <tr>
509
                    <th scope="row">Can place ILL in OPAC: </th>
510
                    <td>[% IF category.canplaceillopac %]Yes[% ELSE %]No[% END %]</td>
511
                </tr>
512
            [% END %]
513
            <tr><th scope="row">Can be guarantee</th><td>[% IF category.can_be_guarantee %]Yes[% ELSE %]No[% END %]</td></tr>
490
            <tr>
514
            <tr>
491
                <th scope="row">Default privacy: </th>
515
                <th scope="row">Default privacy: </th>
492
                <td>
516
                <td>
Lines 550-555 Link Here
550
                    [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
574
                    [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
551
                    <th scope="col">Check previous checkout?</th>
575
                    <th scope="col">Check previous checkout?</th>
552
                    [% END %]
576
                    [% END %]
577
                    [% IF ( Koha.Preference('ILLModule') ) %]
578
                    <th scope="col">Can place ILL in OPAC?</th>
579
                    [% END %]
553
                    <th scope="col">Can be guarantee</th>
580
                    <th scope="col">Can be guarantee</th>
554
                    <th scope="col">Default privacy</th>
581
                    <th scope="col">Default privacy</th>
555
                    <th scope="col">Exclude from local holds priority</th>
582
                    <th scope="col">Exclude from local holds priority</th>
Lines 668-673 Link Here
668
                              <span>Inherit</span>
695
                              <span>Inherit</span>
669
                              [% END %]
696
                              [% END %]
670
                          </td>
697
                          </td>
698
                        [% END %]
699
                         [% IF ( Koha.Preference('ILLModule') ) %]
700
                            <td>[% IF category.canplaceillopac %] Yes [% ELSE %] No [% END %]</td>
671
                        [% END %]
701
                        [% END %]
672
                        <td>[% IF category.can_be_guarantee %] Yes [% ELSE %] No [% END %]</td>
702
                        <td>[% IF category.can_be_guarantee %] Yes [% ELSE %] No [% END %]</td>
673
                        <td>
703
                        <td>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt (-8 / +12 lines)
Lines 112-119 Link Here
112
                            <h1>Interlibrary loan requests</h1>
112
                            <h1>Interlibrary loan requests</h1>
113
                            [% INCLUDE messages %]
113
                            [% INCLUDE messages %]
114
114
115
                            <div id="illrequests-create-button" class="dropdown btn-group">
115
                            [% IF canplaceillopac %]
116
                                [% IF backends.size > 1 %]
116
                                <div id="illrequests-create-button" class="dropdown btn-group">
117
                                    [% IF backends.size > 1 %]
117
                                        <button class="btn btn-primary dropdown-toggle" type="button" id="ill-backend-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
118
                                        <button class="btn btn-primary dropdown-toggle" type="button" id="ill-backend-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
118
                                            <i class="fa fa-plus" aria-hidden="true"></i> Create a new request <span class="caret"></span>
119
                                            <i class="fa fa-plus" aria-hidden="true"></i> Create a new request <span class="caret"></span>
119
                                        </button>
120
                                        </button>
Lines 122-133 Link Here
122
                                                <a class="dropdown-item" href="/cgi-bin/koha/opac-illrequests.pl?method=create&amp;backend=[% backend | uri %]">[% backend | html %]</a>
123
                                                <a class="dropdown-item" href="/cgi-bin/koha/opac-illrequests.pl?method=create&amp;backend=[% backend | uri %]">[% backend | html %]</a>
123
                                            [% END %]
124
                                            [% END %]
124
                                        </div>
125
                                        </div>
125
                                [% ELSE %]
126
                                    [% ELSE %]
126
                                    <a id="ill-new" class="btn btn-primary" href="/cgi-bin/koha/opac-illrequests.pl?method=create&amp;backend=[% backends.0 | html %]">
127
                                        <a id="ill-new" class="btn btn-primary" href="/cgi-bin/koha/opac-illrequests.pl?method=create&amp;backend=[% backends.0 | html %]">
127
                                        <i class="fa fa-plus" aria-hidden="true"></i> Create a new request
128
                                            <i class="fa fa-plus" aria-hidden="true"></i> Create a new request
128
                                    </a>
129
                                        </a>
129
                                [% END %]
130
                                    [% END %]
130
                            </div>
131
                                </div>
132
                            [% END %]
131
133
132
                            <table id="illrequestlist" class="table table-bordered table-striped">
134
                            <table id="illrequestlist" class="table table-bordered table-striped">
133
                                <caption class="sr-only">Requests</caption>
135
                                <caption class="sr-only">Requests</caption>
Lines 232-237 Link Here
232
                                        </div>
234
                                        </div>
233
                                    [% END %]
235
                                    [% END %]
234
                                </div>
236
                                </div>
237
                            [% IF canplaceillopac %]
235
                                <fieldset class="action illrequest-actions">
238
                                <fieldset class="action illrequest-actions">
236
                                    <input type="hidden" name="illrequest_id" value="[% request.illrequest_id | html %]" />
239
                                    <input type="hidden" name="illrequest_id" value="[% request.illrequest_id | html %]" />
237
                                    <input type="hidden" name="method" value="update" />
240
                                    <input type="hidden" name="method" value="update" />
Lines 243-248 Link Here
243
                                    [% END %]
246
                                    [% END %]
244
                                    <span class="cancel"><a href="/cgi-bin/koha/opac-illrequests.pl">Cancel</a></span>
247
                                    <span class="cancel"><a href="/cgi-bin/koha/opac-illrequests.pl">Cancel</a></span>
245
                                </fieldset>
248
                                </fieldset>
249
                            [% END %]
246
                            </form>
250
                            </form>
247
                        [% ELSIF method == 'availability' %]
251
                        [% ELSIF method == 'availability' %]
248
                            <h1>Interlibrary loan item availability</h1>
252
                            <h1>Interlibrary loan item availability</h1>
(-)a/opac/opac-illrequests.pl (-4 / +8 lines)
Lines 58-63 my $reduced = C4::Context->preference('ILLOpacbackends'); Link Here
58
my $backends = Koha::Illrequest::Config->new->available_backends($reduced);
58
my $backends = Koha::Illrequest::Config->new->available_backends($reduced);
59
my $backends_available = ( scalar @{$backends} > 0 );
59
my $backends_available = ( scalar @{$backends} > 0 );
60
$template->param( backends_available => $backends_available );
60
$template->param( backends_available => $backends_available );
61
my $patron = Koha::Patrons->find($loggedinuser);
61
62
62
my $op = $params->{'method'} || 'list';
63
my $op = $params->{'method'} || 'list';
63
64
Lines 71-76 if ( $illrequest_id = $params->{illrequest_id} ) { Link Here
71
    }
72
    }
72
}
73
}
73
74
75
if ( ( $op eq 'create' || $op eq 'cancreq' || $op eq 'update' ) && !$patron->_result->categorycode->canplaceillopac ) {
76
    print $query->redirect('/cgi-bin/koha/errors/403.pl');
77
    exit;
78
}
79
74
if ( $op eq 'list' ) {
80
if ( $op eq 'list' ) {
75
81
76
    my $requests = Koha::Illrequests->search(
82
    my $requests = Koha::Illrequests->search(
Lines 140-148 if ( $op eq 'list' ) { Link Here
140
            exit;
146
            exit;
141
        }
147
        }
142
148
143
        $params->{cardnumber} = Koha::Patrons->find({
149
        $params->{cardnumber} = $patron->cardnumber;
144
            borrowernumber => $loggedinuser
145
        })->cardnumber;
146
        $params->{opac} = 1;
150
        $params->{opac} = 1;
147
        my $backend_result = $request->backend_create($params);
151
        my $backend_result = $request->backend_create($params);
148
152
Lines 175-180 if ( $op eq 'list' ) { Link Here
175
}
179
}
176
180
177
$template->param(
181
$template->param(
182
    canplaceillopac => $patron->_result->categorycode->canplaceillopac,
178
    message         => $params->{message},
183
    message         => $params->{message},
179
    illrequestsview => 1,
184
    illrequestsview => 1,
180
    method          => $op
185
    method          => $op
181
- 

Return to bug 18203