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 $canplaceill = $input->param('canplaceill');
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->canplaceill($canplaceill);
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
            canplaceill => $canplaceill,
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/ill/ill-requests.pl (+1 lines)
Lines 433-438 if ( $backends_available ) { Link Here
433
433
434
$template->param(
434
$template->param(
435
    backends   => $backends,
435
    backends   => $backends,
436
    canplaceill => Koha::Patrons->find($patronnumber)->_result->categorycode->canplaceill,
436
    types      => [ "Book", "Article", "Journal" ],
437
    types      => [ "Book", "Article", "Journal" ],
437
    query_type => $op,
438
    query_type => $op,
438
    branches   => Koha::Libraries->search,
439
    branches   => Koha::Libraries->search,
(-)a/installer/data/mysql/atomicupdate/bug_18203.pl (+17 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "18203",
5
    description => "Add per borrower category restrictions on ILL placement",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        unless ( column_exists('categories', 'canplaceill') ) {
10
            $dbh->do(q{
11
                ALTER TABLE `categories`
12
                ADD COLUMN `canplaceill` TINYINT(1) NOT NULL DEFAULT 0 COMMENT 'can this patron category place interlibrary loan requests'
13
                AFTER `checkprevcheckout`;
14
            });
15
        }
16
    },
17
};
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 1672-1677 CREATE TABLE `categories` ( Link Here
1672
  `BlockExpiredPatronOpacActions` tinyint(1) NOT NULL DEFAULT -1 COMMENT 'wheither or not a patron of this category can renew books or place holds once their card has expired. 0 means they can, 1 means they cannot, -1 means use syspref BlockExpiredPatronOpacActions',
1672
  `BlockExpiredPatronOpacActions` tinyint(1) NOT NULL DEFAULT -1 COMMENT 'wheither or not a patron of this category can renew books or place holds once their card has expired. 0 means they can, 1 means they cannot, -1 means use syspref BlockExpiredPatronOpacActions',
1673
  `default_privacy` enum('default','never','forever') NOT NULL DEFAULT 'default' COMMENT 'Default privacy setting for this patron category',
1673
  `default_privacy` enum('default','never','forever') NOT NULL DEFAULT 'default' COMMENT 'Default privacy setting for this patron category',
1674
  `checkprevcheckout` varchar(7) NOT NULL DEFAULT 'inherit' COMMENT 'produce a warning for this patron category if this item has previously been checked out to this patron if ''yes'', not if ''no'', defer to syspref setting if ''inherit''.',
1674
  `checkprevcheckout` varchar(7) NOT NULL DEFAULT 'inherit' COMMENT 'produce a warning for this patron category if this item has previously been checked out to this patron if ''yes'', not if ''no'', defer to syspref setting if ''inherit''.',
1675
  `canplaceill` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'can this patron category place interlibrary loan requests',
1675
  `can_be_guarantee` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'if patrons of this category can be guarantees',
1676
  `can_be_guarantee` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'if patrons of this category can be guarantees',
1676
  `reset_password` tinyint(1) DEFAULT NULL COMMENT 'if patrons of this category can do the password reset flow,',
1677
  `reset_password` tinyint(1) DEFAULT NULL COMMENT 'if patrons of this category can do the password reset flow,',
1677
  `change_password` tinyint(1) DEFAULT NULL COMMENT 'if patrons of this category can change their passwords in the OAPC',
1678
  `change_password` tinyint(1) DEFAULT NULL COMMENT 'if patrons of this category can change their passwords in the OAPC',
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-toolbar.inc (-16 / +18 lines)
Lines 2-23 Link Here
2
[% IF Koha.Preference('ILLModule ') && CAN_user_ill %]
2
[% IF Koha.Preference('ILLModule ') && CAN_user_ill %]
3
    <div id="toolbar" class="btn-toolbar">
3
    <div id="toolbar" class="btn-toolbar">
4
        [% IF backends_available %]
4
        [% IF backends_available %]
5
          [% IF backends.size > 1 %]
5
            [% IF canplaceill %]
6
            <div class="dropdown btn-group">
6
                [% IF backends.size > 1 %]
7
                <button class="btn btn-default dropdown-toggle" type="button" id="ill-backend-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
7
                    <div class="dropdown btn-group">
8
                    <i class="fa fa-plus"></i> New ILL request <span class="caret"></span>
8
                        <button class="btn btn-default dropdown-toggle" type="button" id="ill-backend-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
9
                </button>
9
                            <i class="fa fa-plus"></i> New ILL request <span class="caret"></span>
10
                <ul class="dropdown-menu" aria-labelledby="ill-backend-dropdown">
10
                        </button>
11
                    [% FOREACH backend IN backends %]
11
                        <ul class="dropdown-menu" aria-labelledby="ill-backend-dropdown">
12
                        <li><a href="/cgi-bin/koha/ill/ill-requests.pl?method=create&amp;backend=[% backend | uri %]">[% backend | html %]</a></li>
12
                            [% FOREACH backend IN backends %]
13
                    [% END %]
13
                                <li><a href="/cgi-bin/koha/ill/ill-requests.pl?method=create&amp;backend=[% backend | uri %]">[% backend | html %]</a></li>
14
                </ul>
14
                            [% END %]
15
            </div>
15
                        </ul>
16
          [% ELSE %]
16
                    </div>
17
            <a id="ill-new" class="btn btn-default" href="/cgi-bin/koha/ill/ill-requests.pl?method=create&amp;backend=[% backends.0 | html %]">
17
                [% ELSE %]
18
                <i class="fa fa-plus"></i> New ILL request
18
                    <a id="ill-new" class="btn btn-default" href="/cgi-bin/koha/ill/ill-requests.pl?method=create&amp;backend=[% backends.0 | html %]">
19
            </a>
19
                        <i class="fa fa-plus"></i> New ILL request
20
          [% END %]
20
                    </a>
21
                [% END %]
22
            [% END %]
21
        [% ELSE %]
23
        [% ELSE %]
22
            <a id="ill-new" class="btn btn-default disabled" href="">
24
            <a id="ill-new" class="btn btn-default disabled" href="">
23
                <i class="fa fa-plus"></i> New ILL request
25
                <i class="fa fa-plus"></i> New ILL request
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt (+26 lines)
Lines 405-410 Link Here
405
                      </div>
405
                      </div>
406
                  </li>
406
                  </li>
407
                [% END %]
407
                [% END %]
408
                [% IF ( Koha.Preference('ILLModule') ) %]
409
                    <li>
410
                        <label for="canplaceill">Can place ILL: </label>
411
                        <select id="canplaceill" name="canplaceill">
412
                            [% IF category.canplaceill %]
413
                                <option value="0">No</option>
414
                                <option value="1" selected="selected">Yes</option>
415
                            [% ELSE %]
416
                                <option value="0" selected="selected">No</option>
417
                                <option value="1">Yes</option>
418
                            [% END %]
419
                        </select>
420
                        <div class="hint">
421
                            Choose whether patrons of this category can create new interlibrary loan requests.
422
                        </div>
423
                    </li>
424
                [% END %]
408
                <li>
425
                <li>
409
                    <label for="default_privacy">Default privacy: </label>
426
                    <label for="default_privacy">Default privacy: </label>
410
                    <select id="default_privacy" name="default_privacy">
427
                    <select id="default_privacy" name="default_privacy">
Lines 509-514 Link Here
509
                      </td>
526
                      </td>
510
                  </tr>
527
                  </tr>
511
                [% END %]
528
                [% END %]
529
                [% IF ( Koha.Preference('ILLModule') ) %]
530
                    <tr>
531
                        <th scope="row">Can place ILL: </th>
532
                        <td>[% IF category.canplaceill %]Yes[% ELSE %]No[% END %]</td>
533
                    </tr>
534
                [% END %]
512
                <tr><th scope="row">Can be guarantee</th><td>[% IF category.can_be_guarantee %]Yes[% ELSE %]No[% END %]</td></tr>
535
                <tr><th scope="row">Can be guarantee</th><td>[% IF category.can_be_guarantee %]Yes[% ELSE %]No[% END %]</td></tr>
513
                <tr>
536
                <tr>
514
                    <th scope="row">Default privacy: </th>
537
                    <th scope="row">Default privacy: </th>
Lines 571-576 Link Here
571
                    [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
594
                    [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
572
                    <th scope="col">Check previous checkout?</th>
595
                    <th scope="col">Check previous checkout?</th>
573
                    [% END %]
596
                    [% END %]
597
                    [% IF ( Koha.Preference('ILLModule') ) %]
598
                    <th scope="col">Can place ILL?</th>
599
                    [% END %]
574
                    <th scope="col">Can be guarantee</th>
600
                    <th scope="col">Can be guarantee</th>
575
                    <th scope="col">Default privacy</th>
601
                    <th scope="col">Default privacy</th>
576
                    <th scope="col">Exclude from local holds priority</th>
602
                    <th scope="col">Exclude from local holds priority</th>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt (-8 / +10 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 canplaceill %]
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>
(-)a/opac/opac-illrequests.pl (-4 / +3 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 154-162 if ( $op eq 'list' ) { Link Here
154
            }
155
            }
155
        }
156
        }
156
157
157
        $params->{cardnumber} = Koha::Patrons->find({
158
        $params->{cardnumber} = $patron->cardnumber;
158
            borrowernumber => $loggedinuser
159
        })->cardnumber;
160
        $params->{opac} = 1;
159
        $params->{opac} = 1;
161
        my $backend_result = $request->backend_create($params);
160
        my $backend_result = $request->backend_create($params);
162
        if ($backend_result->{stage} eq 'copyrightclearance') {
161
        if ($backend_result->{stage} eq 'copyrightclearance') {
Lines 181-186 if ( $op eq 'list' ) { Link Here
181
}
180
}
182
181
183
$template->param(
182
$template->param(
183
    canplaceill     => $patron->_result->categorycode->canplaceill,
184
    message         => $params->{message},
184
    message         => $params->{message},
185
    illrequestsview => 1,
185
    illrequestsview => 1,
186
    method          => $op
186
    method          => $op
187
- 

Return to bug 18203