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 (+29 lines)
Lines 383-388 Link Here
383
                      </div>
383
                      </div>
384
                  </li>
384
                  </li>
385
                [% END %]
385
                [% END %]
386
                [% IF ( Koha.Preference('ILLModule') ) %]
387
                    <li>
388
                        <label for="canplaceillopac">Can place ILL in OPAC: </label>
389
                        <select id="canplaceillopac" name="canplaceillopac">
390
                            [% IF category.canplaceillopac %]
391
                                <option value="0">No</option>
392
                                <option value="1" selected="selected">Yes</option>
393
                            [% ELSE %]
394
                                <option value="0" selected="selected">No</option>
395
                                <option value="1">Yes</option>
396
                            [% END %]
397
                        </select>
398
                        <div class="hint">
399
                            Choose whether patrons of this category can create new interlibrary loan requests.
400
                        </div>
401
                    </li>
402
                [% END %]
386
                <li>
403
                <li>
387
                    <label for="default_privacy">Default privacy: </label>
404
                    <label for="default_privacy">Default privacy: </label>
388
                    <select id="default_privacy" name="default_privacy">
405
                    <select id="default_privacy" name="default_privacy">
Lines 487-492 Link Here
487
                      </td>
504
                      </td>
488
                  </tr>
505
                  </tr>
489
                [% END %]
506
                [% END %]
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 %]
490
                <tr><th scope="row">Can be guarantee</th><td>[% IF category.can_be_guarantee %]Yes[% ELSE %]No[% END %]</td></tr>
513
                <tr><th scope="row">Can be guarantee</th><td>[% IF category.can_be_guarantee %]Yes[% ELSE %]No[% END %]</td></tr>
491
                <tr>
514
                <tr>
492
                    <th scope="row">Default privacy: </th>
515
                    <th scope="row">Default privacy: </th>
Lines 549-554 Link Here
549
                    [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
572
                    [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
550
                    <th scope="col">Check previous checkout?</th>
573
                    <th scope="col">Check previous checkout?</th>
551
                    [% END %]
574
                    [% END %]
575
                    [% IF ( Koha.Preference('ILLModule') ) %]
576
                    <th scope="col">Can place ILL in OPAC?</th>
577
                    [% END %]
552
                    <th scope="col">Can be guarantee</th>
578
                    <th scope="col">Can be guarantee</th>
553
                    <th scope="col">Default privacy</th>
579
                    <th scope="col">Default privacy</th>
554
                    <th scope="col">Exclude from local holds priority</th>
580
                    <th scope="col">Exclude from local holds priority</th>
Lines 667-672 Link Here
667
                              <span>Inherit</span>
693
                              <span>Inherit</span>
668
                              [% END %]
694
                              [% END %]
669
                          </td>
695
                          </td>
696
                        [% END %]
697
                         [% IF ( Koha.Preference('ILLModule') ) %]
698
                            <td>[% IF category.canplaceillopac %] Yes [% ELSE %] No [% END %]</td>
670
                        [% END %]
699
                        [% END %]
671
                        <td>[% IF category.can_be_guarantee %] Yes [% ELSE %] No [% END %]</td>
700
                        <td>[% IF category.can_be_guarantee %] Yes [% ELSE %] No [% END %]</td>
672
                        <td>
701
                        <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 56-61 my $reduced = C4::Context->preference('ILLOpacbackends'); Link Here
56
my $backends = Koha::Illrequest::Config->new->available_backends($reduced);
56
my $backends = Koha::Illrequest::Config->new->available_backends($reduced);
57
my $backends_available = ( scalar @{$backends} > 0 );
57
my $backends_available = ( scalar @{$backends} > 0 );
58
$template->param( backends_available => $backends_available );
58
$template->param( backends_available => $backends_available );
59
my $patron = Koha::Patrons->find($loggedinuser);
59
60
60
my $op = $params->{'method'} || 'list';
61
my $op = $params->{'method'} || 'list';
61
62
Lines 69-74 if ( $illrequest_id = $params->{illrequest_id} ) { Link Here
69
    }
70
    }
70
}
71
}
71
72
73
if ( ( $op eq 'create' || $op eq 'cancreq' || $op eq 'update' ) && !$patron->_result->categorycode->canplaceillopac ) {
74
    print $query->redirect('/cgi-bin/koha/errors/403.pl');
75
    exit;
76
}
77
72
if ( $op eq 'list' ) {
78
if ( $op eq 'list' ) {
73
79
74
    my $requests = Koha::Illrequests->search(
80
    my $requests = Koha::Illrequests->search(
Lines 149-157 if ( $op eq 'list' ) { Link Here
149
            }
155
            }
150
        }
156
        }
151
157
152
        $params->{cardnumber} = Koha::Patrons->find({
158
        $params->{cardnumber} = $patron->cardnumber;
153
            borrowernumber => $loggedinuser
154
        })->cardnumber;
155
        $params->{opac} = 1;
159
        $params->{opac} = 1;
156
        my $backend_result = $request->backend_create($params);
160
        my $backend_result = $request->backend_create($params);
157
        if ($backend_result->{stage} eq 'copyrightclearance') {
161
        if ($backend_result->{stage} eq 'copyrightclearance') {
Lines 176-181 if ( $op eq 'list' ) { Link Here
176
}
180
}
177
181
178
$template->param(
182
$template->param(
183
    canplaceillopac => $patron->_result->categorycode->canplaceillopac,
179
    message         => $params->{message},
184
    message         => $params->{message},
180
    illrequestsview => 1,
185
    illrequestsview => 1,
181
    method          => $op
186
    method          => $op
182
- 

Return to bug 18203