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

(-)a/admin/categories.pl (+3 lines)
Lines 91-96 elsif ( $op eq 'add_validate' ) { Link Here
91
    my $category_type = $input->param('category_type');
91
    my $category_type = $input->param('category_type');
92
    my $BlockExpiredPatronOpacActions = $input->param('BlockExpiredPatronOpacActions');
92
    my $BlockExpiredPatronOpacActions = $input->param('BlockExpiredPatronOpacActions');
93
    my $checkPrevCheckout = $input->param('checkprevcheckout');
93
    my $checkPrevCheckout = $input->param('checkprevcheckout');
94
    my $canplaceill = $input->param('canplaceill');
94
    my $default_privacy = $input->param('default_privacy');
95
    my $default_privacy = $input->param('default_privacy');
95
    my @branches = grep { $_ ne q{} } $input->multi_param('branches');
96
    my @branches = grep { $_ ne q{} } $input->multi_param('branches');
96
97
Lines 121-126 elsif ( $op eq 'add_validate' ) { Link Here
121
        $category->category_type($category_type);
122
        $category->category_type($category_type);
122
        $category->BlockExpiredPatronOpacActions($BlockExpiredPatronOpacActions);
123
        $category->BlockExpiredPatronOpacActions($BlockExpiredPatronOpacActions);
123
        $category->checkprevcheckout($checkPrevCheckout);
124
        $category->checkprevcheckout($checkPrevCheckout);
125
        $category->canplaceill($canplaceill);
124
        $category->default_privacy($default_privacy);
126
        $category->default_privacy($default_privacy);
125
        eval {
127
        eval {
126
            $category->store;
128
            $category->store;
Lines 147-152 elsif ( $op eq 'add_validate' ) { Link Here
147
            category_type => $category_type,
149
            category_type => $category_type,
148
            BlockExpiredPatronOpacActions => $BlockExpiredPatronOpacActions,
150
            BlockExpiredPatronOpacActions => $BlockExpiredPatronOpacActions,
149
            checkprevcheckout => $checkPrevCheckout,
151
            checkprevcheckout => $checkPrevCheckout,
152
            canplaceill => $canplaceill,
150
            default_privacy => $default_privacy,
153
            default_privacy => $default_privacy,
151
        });
154
        });
152
        eval {
155
        eval {
(-)a/ill/ill-requests.pl (+2 lines)
Lines 219-224 my $ir = Koha::Illrequest->new; Link Here
219
219
220
$template->param(
220
$template->param(
221
    backends    => $ir->available_backends,
221
    backends    => $ir->available_backends,
222
    canplaceill => Koha::Patrons->find($patronnumber)
223
        ->_result->categorycode->canplaceill,
222
    media       => [ "Book", "Article", "Journal" ],
224
    media       => [ "Book", "Article", "Journal" ],
223
    query_type  => $op,
225
    query_type  => $op,
224
    branches    => Koha::Libraries->search->unblessed,
226
    branches    => Koha::Libraries->search->unblessed,
(-)a/installer/data/mysql/atomicupdate/ill_cat_permission.sql (+4 lines)
Line 0 Link Here
1
-- Add new column to categories table
2
ALTER TABLE categories
3
ADD COLUMN `canplaceill` tinyint(1) NOT NULL default '0'
4
AFTER `checkprevcheckout`;
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 330-335 CREATE TABLE `categories` ( -- this table shows information related to Koha patr Link Here
330
  `BlockExpiredPatronOpacActions` tinyint(1) NOT NULL default '-1', -- 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
330
  `BlockExpiredPatronOpacActions` tinyint(1) NOT NULL default '-1', -- 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
331
  `default_privacy` ENUM( 'default', 'never', 'forever' ) NOT NULL DEFAULT 'default', -- Default privacy setting for this patron category
331
  `default_privacy` ENUM( 'default', 'never', 'forever' ) NOT NULL DEFAULT 'default', -- Default privacy setting for this patron category
332
  `checkprevcheckout` varchar(7) NOT NULL default 'inherit', -- 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'.
332
  `checkprevcheckout` varchar(7) NOT NULL default 'inherit', -- 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'.
333
  `canplaceill` tinyint(1) NOT NULL default '0', -- can this patron category place interlibrary loan requests
333
  PRIMARY KEY  (`categorycode`),
334
  PRIMARY KEY  (`categorycode`),
334
  UNIQUE KEY `categorycode` (`categorycode`)
335
  UNIQUE KEY `categorycode` (`categorycode`)
335
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
336
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-toolbar.inc (-15 / +17 lines)
Lines 1-21 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 canplaceill %]
5
            <div class="dropdown btn-group">
5
            [% IF backends.size > 1 %]
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">
6
                <div class="dropdown btn-group">
7
                    <i class="fa fa-plus"></i> New ILL request <span class="caret"></span>
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">
8
                </button>
8
                        <i class="fa fa-plus"></i> New ILL request <span class="caret"></span>
9
                <ul class="dropdown-menu" aria-labelledby="ill-backend-dropdown">
9
                    </button>
10
                    [% FOREACH backend IN backends %]
10
                    <ul class="dropdown-menu" aria-labelledby="ill-backend-dropdown">
11
                        <li><a href="/cgi-bin/koha/ill/ill-requests.pl?method=create&amp;backend=[% backend %]">[% backend %]</a></li>
11
                        [% FOREACH backend IN backends %]
12
                    [% END %]
12
                            <li><a href="/cgi-bin/koha/ill/ill-requests.pl?method=create&amp;backend=[% backend %]">[% backend %]</a></li>
13
                </ul>
13
                        [% END %]
14
            </div>
14
                    </ul>
15
        [% ELSE %]
15
                </div>
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 %]">
16
            [% ELSE %]
17
                <i class="fa fa-plus"></i> New ILL request
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 %]">
18
            </a>
18
                    <i class="fa fa-plus"></i> New ILL request
19
                </a>
20
            [% END %]
19
        [% END %]
21
        [% END %]
20
        <a id="ill-list" class="btn btn-sm btn-default btn-group" href="/cgi-bin/koha/ill/ill-requests.pl">
22
        <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
23
            <i class="fa fa-list"></i> List requests
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt (+29 lines)
Lines 211-216 Link Here
211
                      </span>
211
                      </span>
212
                  </li>
212
                  </li>
213
                [% END %]
213
                [% END %]
214
                [% IF ( Koha.Preference('ILLModule') ) %]
215
                    <li>
216
                        <label for="canplaceill">Can place ILL: </label>
217
                        <select id="canplaceill" name="canplaceill">
218
                            [% IF category.canplaceill %]
219
                                <option value="0">No</option>
220
                                <option value="1" selected="selected">Yes</option>
221
                            [% ELSE %]
222
                                <option value="0" selected="selected">No</option>
223
                                <option value="1">Yes</option>
224
                            [% END %]
225
                        </select>
226
                        <span>
227
                            Choose whether patrons of this category can create new interlibrary loan requests.
228
                        </span>
229
                    </li>
230
                [% END %]
214
                <li>
231
                <li>
215
                    <label for="default_privacy">Default privacy: </label>
232
                    <label for="default_privacy">Default privacy: </label>
216
                    <select id="default_privacy" name="default_privacy">
233
                    <select id="default_privacy" name="default_privacy">
Lines 299-304 Link Here
299
                      </td>
316
                      </td>
300
                  </tr>
317
                  </tr>
301
                [% END %]
318
                [% END %]
319
                [% IF ( Koha.Preference('ILLModule') ) %]
320
                    <tr>
321
                        <th scope="row">Can place ILL: </th>
322
                        <td>[% IF category.canplaceill %]Yes[% ELSE %]No[% END %]</td>
323
                    </tr>
324
                [% END %]
302
                <tr>
325
                <tr>
303
                    <th scope="row">Default privacy: </th>
326
                    <th scope="row">Default privacy: </th>
304
                    <td>
327
                    <td>
Lines 358-363 Link Here
358
                    [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
381
                    [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
359
                    <th scope="col">Check previous checkout?</th>
382
                    <th scope="col">Check previous checkout?</th>
360
                    [% END %]
383
                    [% END %]
384
                    [% IF ( Koha.Preference('ILLModule') ) %]
385
                    <th scope="col">Can place ILL?</th>
386
                    [% END %]
361
                    <th scope="col">Default privacy</th>
387
                    <th scope="col">Default privacy</th>
362
                    <th scope="col">Actions</th>
388
                    <th scope="col">Actions</th>
363
                </tr>
389
                </tr>
Lines 446-451 Link Here
446
                              [% END %]
472
                              [% END %]
447
                          </td>
473
                          </td>
448
                        [% END %]
474
                        [% END %]
475
                        [% IF ( Koha.Preference('ILLModule') ) %]
476
                            <td>[% IF category.canplaceill %]Yes[% ELSE %]No[% END %]</td>
477
                        [% END %]
449
                        <td>
478
                        <td>
450
                            [% SWITCH category.default_privacy %]
479
                            [% SWITCH category.default_privacy %]
451
                            [% CASE 'default' %]
480
                            [% CASE 'default' %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt (-16 / +18 lines)
Lines 74-95 Link Here
74
                    <h2>Interlibrary loan requests</h2>
74
                    <h2>Interlibrary loan requests</h2>
75
                    [% INCLUDE messages %]
75
                    [% INCLUDE messages %]
76
76
77
                    <div id="illrequests-create-button" class="dropdown btn-group">
77
                    [% IF canplaceill %]
78
                        [% IF backends.size > 1 %]
78
                        <div id="illrequests-create-button" class="dropdown btn-group">
79
                                <button class="btn btn-default dropdown-toggle" type="button" id="ill-backend-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
79
                            [% IF backends.size > 1 %]
80
                                    <i class="fa fa-plus"></i> Create a new request <span class="caret"></span>
80
                                    <button class="btn btn-default dropdown-toggle" type="button" id="ill-backend-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
81
                                </button>
81
                                        <i class="fa fa-plus"></i> Create a new request <span class="caret"></span>
82
                                <ul id="backend-dropdown-options" class="dropdown-menu nojs" aria-labelledby="ill-backend-dropdown">
82
                                    </button>
83
                                    [% FOREACH backend IN backends %]
83
                                    <ul id="backend-dropdown-options" class="dropdown-menu nojs" aria-labelledby="ill-backend-dropdown">
84
                                        <li><a href="/cgi-bin/koha/opac-illrequests.pl?method=create&amp;backend=[% backend %]">[% backend %]</a></li>
84
                                        [% FOREACH backend IN backends %]
85
                                    [% END %]
85
                                            <li><a href="/cgi-bin/koha/opac-illrequests.pl?method=create&amp;backend=[% backend %]">[% backend %]</a></li>
86
                                </ul>
86
                                        [% END %]
87
                        [% ELSE %]
87
                                    </ul>
88
                            <a id="ill-new" class="btn btn-default" href="/cgi-bin/koha/opac-illrequests.pl?method=create&amp;backend=[% backends.0 %]">
88
                            [% ELSE %]
89
                                <i class="fa fa-plus"></i> Create a new request
89
                                <a id="ill-new" class="btn btn-default" href="/cgi-bin/koha/opac-illrequests.pl?method=create&amp;backend=[% backends.0 %]">
90
                            </a>
90
                                    <i class="fa fa-plus"></i> Create a new request
91
                        [% END %]
91
                                </a>
92
                    </div>
92
                            [% END %]
93
                        </div>
94
                    [% END %]
93
95
94
                    <table id="illrequestlist" class="table table-bordered table-striped">
96
                    <table id="illrequestlist" class="table table-bordered table-striped">
95
                        <thead>
97
                        <thead>
(-)a/opac/opac-illrequests.pl (-4 / +3 lines)
Lines 49-54 my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ Link Here
49
});
49
});
50
50
51
my $op = $params->{'method'} || 'list';
51
my $op = $params->{'method'} || 'list';
52
my $patron = Koha::Patrons->find($loggedinuser);
52
53
53
if ( $op eq 'list' ) {
54
if ( $op eq 'list' ) {
54
55
Lines 102-110 if ( $op eq 'list' ) { Link Here
102
    } else {
103
    } else {
103
        my $request = Koha::Illrequest->new
104
        my $request = Koha::Illrequest->new
104
            ->load_backend($params->{backend});
105
            ->load_backend($params->{backend});
105
        $params->{cardnumber} = Koha::Patrons->find({
106
        $params->{cardnumber} = $patron->cardnumber;
106
            borrowernumber => $loggedinuser
107
        })->cardnumber;
108
        my $backend_result = $request->backend_create($params);
107
        my $backend_result = $request->backend_create($params);
109
        $template->param(
108
        $template->param(
110
            media       => [ "Book", "Article", "Journal" ],
109
            media       => [ "Book", "Article", "Journal" ],
Lines 121-126 if ( $op eq 'list' ) { Link Here
121
}
120
}
122
121
123
$template->param(
122
$template->param(
123
    canplaceill     => $patron->_result->categorycode->canplaceill,
124
    message         => $params->{message},
124
    message         => $params->{message},
125
    illrequestsview => 1,
125
    illrequestsview => 1,
126
    method              => $op
126
    method              => $op
127
- 

Return to bug 18203