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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt (-153 / +164 lines)
Lines 1-4 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE raw %]
2
[% USE Branches %]
3
[% USE Branches %]
3
[% USE ItemTypes %]
4
[% USE ItemTypes %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
[% INCLUDE 'doc-head-open.inc' %]
Lines 30-200 Link Here
30
        <div class="row">
31
        <div class="row">
31
            <div class="col">
32
            <div class="col">
32
                [% IF biblio.can_article_request( patron ) %]
33
                [% IF biblio.can_article_request( patron ) %]
33
                    [% SET article_request_type = biblio.article_request_type( patron ) %]
34
                    <h1>Place article request for [% biblio.title | html %]</h1>
35
                    [% IF disclaimer %]
36
                        <div>
37
                            <p>
38
                                [% Koha.Preference('ArticleRequestsDisclaimerText') | $raw %]
39
                            </p>
40
                            <a href="/cgi-bin/koha/opac-request-article.pl?biblionumber=[% biblio.biblionumber | uri %]&amp;action=accept"
41
                            class="btn btn-sm btn-primary"><i class="fa fa-check" aria-hidden="true"></i> Accept</a>
42
                        </div>
43
                    [% ELSE %]
44
                        [% SET article_request_type = biblio.article_request_type( patron ) %]
34
45
35
                    [% IF article_request_type == 'yes' %]       [% SET mandatory_fields = Koha.Preference('ArticleRequestsMandatoryFields') %]           [% END %]
46
                        [% IF article_request_type == 'yes' %]       [% SET mandatory_fields = Koha.Preference('ArticleRequestsMandatoryFields') %]           [% END %]
36
                    [% IF article_request_type == 'bib_only' %]  [% SET mandatory_fields = Koha.Preference('ArticleRequestsMandatoryFieldsRecordOnly') %] [% END %]
47
                        [% IF article_request_type == 'bib_only' %]  [% SET mandatory_fields = Koha.Preference('ArticleRequestsMandatoryFieldsRecordOnly') %] [% END %]
37
                    [% IF article_request_type == 'item_only' %] [% SET mandatory_fields = Koha.Preference('ArticleRequestsMandatoryFieldsItemOnly') %]   [% END %]
48
                        [% IF article_request_type == 'item_only' %] [% SET mandatory_fields = Koha.Preference('ArticleRequestsMandatoryFieldsItemOnly') %]   [% END %]
38
49
39
                    <h1>Place article request for [% biblio.title | html %]</h1>
40
50
41
                    <form id="place-article-request" method="post" action="/cgi-bin/koha/opac-request-article.pl">
51
                        <form id="place-article-request" method="post" action="/cgi-bin/koha/opac-request-article.pl">
42
                        <input type="hidden" name="action" value="create" />
52
                            <input type="hidden" name="action" value="create" />
43
                        <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblio.biblionumber | html %]" />
53
                            <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblio.biblionumber | html %]" />
44
54
45
                        <fieldset class="rows">
55
                            <fieldset class="rows">
46
                            <ul>
56
                                <ul>
47
                                <li>
57
                                    <li>
48
                                    [% IF mandatory_fields.search('title') %]
58
                                        [% IF mandatory_fields.search('title') %]
49
                                        <label for="title" class="required">Title:</label>
59
                                            <label for="title" class="required">Title:</label>
50
                                        <input type="text" required="required" name="title" id="title" size="50"/>
60
                                            <input type="text" required="required" name="title" id="title" size="50"/>
51
                                    [% ELSE %]
61
                                        [% ELSE %]
52
                                        <label for="title">Title:</label>
62
                                            <label for="title">Title:</label>
53
                                        <input type="text" name="title" id="title" size="50"/>
63
                                            <input type="text" name="title" id="title" size="50"/>
54
                                    [% END %]
64
                                        [% END %]
55
                                </li>
65
                                    </li>
56
66
57
                                <li>
67
                                    <li>
58
                                    [% IF mandatory_fields.search('author') %]
68
                                        [% IF mandatory_fields.search('author') %]
59
                                        <label for="author" class="required">Author:</label>
69
                                            <label for="author" class="required">Author:</label>
60
                                        <input type="text" required="required" name="author" id="author" size="50"/>
70
                                            <input type="text" required="required" name="author" id="author" size="50"/>
61
                                    [% ELSE %]
71
                                        [% ELSE %]
62
                                        <label for="author">Author:</label>
72
                                            <label for="author">Author:</label>
63
                                        <input type="text" name="author" id="author" size="50"/>
73
                                            <input type="text" name="author" id="author" size="50"/>
64
                                    [% END %]
74
                                        [% END %]
65
                                </li>
75
                                    </li>
66
76
67
                                <li>
77
                                    <li>
68
                                    [% IF mandatory_fields.search('volume') %]
78
                                        [% IF mandatory_fields.search('volume') %]
69
                                        <label for="volume" class="required">Volume:</label>
79
                                            <label for="volume" class="required">Volume:</label>
70
                                        <input type="text" required="required" name="volume" id="volume" size="50"/>
80
                                            <input type="text" required="required" name="volume" id="volume" size="50"/>
71
                                    [% ELSE %]
81
                                        [% ELSE %]
72
                                        <label for="volume">Volume:</label>
82
                                            <label for="volume">Volume:</label>
73
                                        <input type="text" name="volume" id="volume" size="50"/>
83
                                            <input type="text" name="volume" id="volume" size="50"/>
74
                                    [% END %]
84
                                        [% END %]
75
                                </li>
85
                                    </li>
76
86
77
                                <li>
87
                                    <li>
78
                                    [% IF mandatory_fields.search('issue') %]
88
                                        [% IF mandatory_fields.search('issue') %]
79
                                        <label for="issue" class="required">Issue:</label>
89
                                            <label for="issue" class="required">Issue:</label>
80
                                        <input type="text" required="required" name="issue" id="issue" size="50"/>
90
                                            <input type="text" required="required" name="issue" id="issue" size="50"/>
81
                                    [% ELSE %]
91
                                        [% ELSE %]
82
                                        <label for="issue">Issue:</label>
92
                                            <label for="issue">Issue:</label>
83
                                        <input type="text" name="issue" id="issue" size="50"/>
93
                                            <input type="text" name="issue" id="issue" size="50"/>
84
                                    [% END %]
94
                                        [% END %]
85
                                </li>
95
                                    </li>
86
96
87
                                <li>
97
                                    <li>
88
                                    [% IF mandatory_fields.search('date') %]
98
                                        [% IF mandatory_fields.search('date') %]
89
                                        <label for="date" class="required">Date:</label>
99
                                            <label for="date" class="required">Date:</label>
90
                                        <input type="text" required="required" name="date" id="date" size="50"/>
100
                                            <input type="text" required="required" name="date" id="date" size="50"/>
91
                                    [% ELSE %]
101
                                        [% ELSE %]
92
                                        <label for="date">Date:</label>
102
                                            <label for="date">Date:</label>
93
                                        <input type="text" name="date" id="date" size="50"/>
103
                                            <input type="text" name="date" id="date" size="50"/>
94
                                    [% END %]
104
                                        [% END %]
95
                                </li>
105
                                    </li>
96
106
97
                                <li>
107
                                    <li>
98
                                    [% IF mandatory_fields.search('pages') %]
108
                                        [% IF mandatory_fields.search('pages') %]
99
                                        <label for="pages" class="required">Pages:</label>
109
                                            <label for="pages" class="required">Pages:</label>
100
                                        <input type="text" required="required" name="pages" id="pages" size="50"/>
110
                                            <input type="text" required="required" name="pages" id="pages" size="50"/>
101
                                    [% ELSE %]
111
                                        [% ELSE %]
102
                                        <label for="pages">Pages:</label>
112
                                            <label for="pages">Pages:</label>
103
                                        <input type="text" name="pages" id="pages" size="50"/>
113
                                            <input type="text" name="pages" id="pages" size="50"/>
104
                                    [% END %]
114
                                        [% END %]
105
                                </li>
115
                                    </li>
106
116
107
                                <li>
117
                                    <li>
108
                                    [% IF mandatory_fields.search('chapters') %]
118
                                        [% IF mandatory_fields.search('chapters') %]
109
                                        <label for="chapters" class="required">Chapters:</label>
119
                                            <label for="chapters" class="required">Chapters:</label>
110
                                        <input type="text" required="required" name="chapters" id="chapters" size="50"/>
120
                                            <input type="text" required="required" name="chapters" id="chapters" size="50"/>
111
                                    [% ELSE %]
121
                                        [% ELSE %]
112
                                        <label for="chapters">Chapters:</label>
122
                                            <label for="chapters">Chapters:</label>
113
                                        <input type="text" name="chapters" id="chapters" size="50"/>
123
                                            <input type="text" name="chapters" id="chapters" size="50"/>
114
                                    [% END %]
124
                                        [% END %]
115
                                </li>
125
                                    </li>
116
126
117
                                <li>
127
                                    <li>
118
                                    <label for="patron_notes">Notes:</label>
128
                                        <label for="patron_notes">Notes:</label>
119
                                    <input type="text" name="patron_notes" id="patron_notes" size="50"/>
129
                                        <input type="text" name="patron_notes" id="patron_notes" size="50"/>
120
                                </li>
130
                                    </li>
121
131
122
                                <li>
132
                                    <li>
123
                                    <label for="branchcode">Pickup library:</label>
133
                                        <label for="branchcode">Pickup library:</label>
124
                                    <select name="branchcode" id="branchcode" required="required">
134
                                        <select name="branchcode" id="branchcode" required="required">
125
                                        [% FOREACH b IN Branches.all %]
135
                                            [% FOREACH b IN Branches.all %]
126
                                            [% IF b.branchcode == Branches.GetLoggedInBranchcode %]
136
                                                [% IF b.branchcode == Branches.GetLoggedInBranchcode %]
127
                                                <option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
137
                                                    <option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
128
                                            [% ELSE %]
138
                                                [% ELSE %]
129
                                                <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
139
                                                    <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
140
                                                [% END %]
141
                                            [% END %]
142
                                        </select>
143
                                    </li>
144
                                </ul>
145
                            </fieldset>
146
147
                            [% IF article_request_type != 'bib_only' %]
148
                                <table class="copiesrow table table-bordered table-striped">
149
                                    <caption>Select a specific item:</caption>
150
                                    <thead>
151
                                        <tr>
152
                                            <th>&nbsp;</th>
153
                                            <th>Item type</th>
154
                                            <th>Barcode</th>
155
                                            <th>Home library</th>
156
                                            <th>Call number</th>
157
                                            <th>Enumeration</th>
158
                                        </tr>
159
                                    </thead>
160
161
                                    <tbody>
162
                                        [% FOREACH item IN biblio.items %]
163
                                            [% IF item.can_article_request( patron ) %]
164
                                                <tr>
165
                                                    <td>
166
                                                        [% IF article_request_type == 'item_only' && !checked %]
167
                                                            [% SET checked = 1 %]
168
                                                            <input type="radio" name="itemnumber" value="[% item.itemnumber | html %]" checked="checked" />
169
                                                        [% ELSE %]
170
                                                            <input type="radio" name="itemnumber" value="[% item.itemnumber | html %]" />
171
                                                        [% END %]
172
                                                    </td>
173
                                                    <td>
174
                                                        [% ItemTypes.GetDescription( item.itype ) | html %]
175
                                                    </td>
176
                                                    <td>
177
                                                        [% item.barcode | html %]
178
                                                    </td>
179
                                                    <td>
180
                                                        [% Branches.GetName( item.homebranch ) | html %]
181
                                                    </td>
182
                                                    <td>
183
                                                        [% item.itemcallnumber | html %]
184
                                                    </td>
185
                                                    <td>
186
                                                        [% item.enumchron | html %]
187
                                                    </td>
188
                                                </tr>
130
                                            [% END %]
189
                                            [% END %]
131
                                        [% END %]
190
                                        [% END %]
132
                                    </select>
191
133
                                </li>
192
                                        [% IF article_request_type != 'item_only' %]
134
                            </ul>
135
                        </fieldset>
136
137
                        [% IF article_request_type != 'bib_only' %]
138
                            <table class="copiesrow table table-bordered table-striped">
139
                                <caption>Select a specific item:</caption>
140
                                <thead>
141
                                    <tr>
142
                                        <th>&nbsp;</th>
143
                                        <th>Item type</th>
144
                                        <th>Barcode</th>
145
                                        <th>Home library</th>
146
                                        <th>Call number</th>
147
                                        <th>Enumeration</th>
148
                                    </tr>
149
                                </thead>
150
151
                                <tbody>
152
                                    [% FOREACH item IN biblio.items %]
153
                                        [% IF item.can_article_request( patron ) %]
154
                                            <tr>
193
                                            <tr>
155
                                                <td>
194
                                                <td>
156
                                                    [% IF article_request_type == 'item_only' && !checked %]
195
                                                    <input type="radio" name="itemnumber" value="" checked="checked"/>
157
                                                        [% SET checked = 1 %]
158
                                                        <input type="radio" name="itemnumber" value="[% item.itemnumber | html %]" checked="checked" />
159
                                                    [% ELSE %]
160
                                                        <input type="radio" name="itemnumber" value="[% item.itemnumber | html %]" />
161
                                                    [% END %]
162
                                                </td>
163
                                                <td>
164
                                                    [% ItemTypes.GetDescription( item.itype ) | html %]
165
                                                </td>
166
                                                <td>
167
                                                    [% item.barcode | html %]
168
                                                </td>
196
                                                </td>
169
                                                <td>
197
                                                <td colspan="6">
170
                                                    [% Branches.GetName( item.homebranch ) | html %]
198
                                                    Any item
171
                                                </td>
172
                                                <td>
173
                                                    [% item.itemcallnumber | html %]
174
                                                </td>
175
                                                <td>
176
                                                    [% item.enumchron | html %]
177
                                                </td>
199
                                                </td>
178
                                            </tr>
200
                                            </tr>
179
                                        [% END %]
201
                                        [% END %]
180
                                    [% END %]
202
                                    </tbody>
181
203
                                </table>
182
                                    [% IF article_request_type != 'item_only' %]
204
                            [% END %]
183
                                        <tr>
184
                                            <td>
185
                                                <input type="radio" name="itemnumber" value="" checked="checked"/>
186
                                            </td>
187
                                            <td colspan="6">
188
                                                Any item
189
                                            </td>
190
                                        </tr>
191
                                    [% END %]
192
                                </tbody>
193
                            </table>
194
                        [% END %]
195
205
196
                        <input type="submit" class="btn btn-primary" value="Place request" />
206
                            <input type="submit" class="btn btn-primary" value="Place request" />
197
                    </form>
207
                        </form>
208
                    [% END %]
198
                [% ELSE %]
209
                [% ELSE %]
199
                    <h1 class="title">[% biblio.title | html %]</h1>
210
                    <h1 class="title">[% biblio.title | html %]</h1>
200
                    <div class="alert alert-info">
211
                    <div class="alert alert-info">
(-)a/opac/opac-request-article.pl (-1 / +3 lines)
Lines 23-28 use CGI qw ( -utf8 ); Link Here
23
23
24
use C4::Auth;
24
use C4::Auth;
25
use C4::Output;
25
use C4::Output;
26
use C4::Context;
26
27
27
use Koha::Biblios;
28
use Koha::Biblios;
28
use Koha::Patrons;
29
use Koha::Patrons;
Lines 40-45 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
40
41
41
my $action = $cgi->param('action') || q{};
42
my $action = $cgi->param('action') || q{};
42
my $biblionumber = $cgi->param('biblionumber');
43
my $biblionumber = $cgi->param('biblionumber');
44
my $disclaimer = C4::Context->preference('ArticleRequestsDisclaimerText') && !$action;
43
45
44
if ( $action eq 'create' ) {
46
if ( $action eq 'create' ) {
45
    my $branchcode = $cgi->param('branchcode');
47
    my $branchcode = $cgi->param('branchcode');
Lines 81-86 my $patron = Koha::Patrons->find($borrowernumber); Link Here
81
$template->param(
83
$template->param(
82
    biblio => $biblio,
84
    biblio => $biblio,
83
    patron => $patron,
85
    patron => $patron,
86
    disclaimer => $disclaimer
84
);
87
);
85
88
86
output_html_with_http_headers $cgi, $cookie, $template->output, undef, { force_no_caching => 1 };
89
output_html_with_http_headers $cgi, $cookie, $template->output, undef, { force_no_caching => 1 };
87
- 

Return to bug 27948