4 [% USE AdditionalContents %]
6 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Request article › [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 [% BLOCK cssinclude %][% END %]
13 [% INCLUDE 'bodytag.inc' bodyid='opac-request-article' %]
14 [% INCLUDE 'masthead.inc' %]
16 [% SET disclaimer = AdditionalContents.get( location => "ArticleRequestsDisclaimerText", lang => lang, library => Branches.GetLoggedInBranchcode ) %]
19 <nav aria-label="breadcrumb">
20 <ul class="breadcrumb">
21 <li class="breadcrumb-item">
22 <a href="/cgi-bin/koha/opac-main.pl">Home</a>
24 <li class="breadcrumb-item">
25 <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | uri %]">Details for: [% biblio.title | html %]</a>
27 <li class="breadcrumb-item active" aria-current="page">
28 <a href="#">Request article</a>
33 <div class="container-fluid maincontent">
36 [% IF !error_message && biblio.can_article_request( patron ) %]
37 <h1>Place article request for [% biblio.title | html %]</h1>
38 [% IF ( disclaimer && !action) %]
39 <div class="alert alert-warning">
40 [% PROCESS koha_news_block news => disclaimer %]
41 <a href="/cgi-bin/koha/opac-request-article.pl?biblionumber=[% biblio.biblionumber | uri %]&action=accept"
42 class="btn btn-sm btn-primary"><i class="fa fa-check" aria-hidden="true"></i> Accept</a>
45 [% SET article_request_type = biblio.article_request_type( patron ) %]
47 [% IF article_request_type == 'yes' %] [% SET mandatory_fields = Koha.Preference('ArticleRequestsMandatoryFields') %] [% END %]
48 [% IF article_request_type == 'bib_only' %] [% SET mandatory_fields = Koha.Preference('ArticleRequestsMandatoryFieldsRecordOnly') %] [% END %]
49 [% IF article_request_type == 'item_only' %] [% SET mandatory_fields = Koha.Preference('ArticleRequestsMandatoryFieldsItemOnly') %] [% END %]
52 <form id="place-article-request" method="post" action="/cgi-bin/koha/opac-request-article.pl">
53 <legend class="sr-only">Place article request</legend>
54 <input type="hidden" name="action" value="create" />
55 <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblio.biblionumber | html %]" />
57 <fieldset class="rows">
60 [% IF mandatory_fields.search('title') %]
61 <label for="title" class="required">Title:</label>
62 <input type="text" required="required" name="title" id="title" size="50" value="[% title | html %]"/>
64 <label for="title">Title:</label>
65 <input type="text" name="title" id="title" size="50" value="[% title | html %]"/>
70 [% IF mandatory_fields.search('author') %]
71 <label for="author" class="required">Author:</label>
72 <input type="text" required="required" name="author" id="author" size="50" value="[% author | html %]"/>
74 <label for="author">Author:</label>
75 <input type="text" name="author" id="author" size="50" value="[% author | html %]"/>
80 [% IF mandatory_fields.search('volume') %]
81 <label for="volume" class="required">Volume:</label>
82 <input type="text" required="required" name="volume" id="volume" size="50"/>
84 <label for="volume">Volume:</label>
85 <input type="text" name="volume" id="volume" size="50"/>
90 [% IF mandatory_fields.search('issue') %]
91 <label for="issue" class="required">Issue:</label>
92 <input type="text" required="required" name="issue" id="issue" size="50"/>
94 <label for="issue">Issue:</label>
95 <input type="text" name="issue" id="issue" size="50"/>
100 [% IF mandatory_fields.search('date') %]
101 <label for="date" class="required">Date:</label>
102 <input type="text" required="required" name="date" id="date" size="50"/>
104 <label for="date">Date:</label>
105 <input type="text" name="date" id="date" size="50"/>
110 [% IF mandatory_fields.search('pages') %]
111 <label for="pages" class="required">Pages:</label>
112 <input type="text" required="required" name="pages" id="pages" size="50" value="[% pageinfo | html %]"/>
114 <label for="pages">Pages:</label>
115 <input type="text" name="pages" id="pages" size="50" value="[% pageinfo | html %]"/>
120 [% IF mandatory_fields.search('chapters') %]
121 <label for="chapters" class="required">Chapters:</label>
122 <input type="text" required="required" name="chapters" id="chapters" size="50"/>
124 <label for="chapters">Chapters:</label>
125 <input type="text" name="chapters" id="chapters" size="50"/>
130 <label for="patron_notes">Notes:</label>
131 <input type="text" name="patron_notes" id="patron_notes" size="50"/>
135 <label for="format">Format:</label>
136 <select name="format" id="format">
137 <option value="PHOTOCOPY">Photocopy</option>
138 <option value="SCAN">Digital scan</option>
143 <label for="branchcode">Pickup library:</label>
144 <select name="branchcode" id="branchcode" required="required">
145 [% FOREACH b IN Branches.all %]
146 [% IF b.branchcode == Branches.GetLoggedInBranchcode %]
147 <option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
149 <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
157 [% IF article_request_type != 'bib_only' %]
158 <table class="copiesrow table table-bordered table-striped">
159 <caption>Select a specific item:</caption>
165 <th>Home library</th>
172 [% FOREACH item IN biblio.items %]
173 [% IF item.can_article_request( patron ) %]
176 [% IF article_request_type == 'item_only' && !checked %]
177 [% SET checked = 1 %]
178 <input type="radio" name="itemnumber" value="[% item.itemnumber | html %]" checked="checked" />
180 <input type="radio" name="itemnumber" value="[% item.itemnumber | html %]" />
184 [% ItemTypes.GetDescription( item.itype ) | html %]
187 [% item.barcode | html %]
190 [% Branches.GetName( item.homebranch ) | html %]
193 [% item.itemcallnumber | html %]
196 [% item.enumchron | html %]
202 [% IF article_request_type != 'item_only' %]
205 <input type="radio" name="itemnumber" value="" checked="checked"/>
216 <input type="submit" class="btn btn-primary" value="Place request" />
219 [% ELSIF error_message %]
220 <h1 class="title">[% biblio.title | html %]</h1>
221 <div class="alert alert-info">
222 [% error_message | html %]
225 <h1 class="title">[% biblio.title | html %]</h1>
226 <div class="alert alert-info">
227 No article requests can be made for this record.
230 </div> <!-- /.col -->
231 </div> <!-- /.row -->
232 </div> <!-- / .container-fluid -->
233 </div> <!-- / .main -->
235 [% INCLUDE 'opac-bottom.inc' %]
237 [% BLOCK jsinclude %]
239 $(document).ready( function() {
240 allow_submit = false;
241 $('#place-article-request').on('submit', function( event ){
242 if ( ! allow_submit ) {
243 event.preventDefault();
245 [% IF article_request_type == 'item_only' %]
246 if ( ! $("input:radio[name='itemnumber']").is(":checked") ) {
247 alert( _("Please select a specific item for this article request.") );
252 var mandatory_fields = "[% mandatory_fields | html %]";
254 if ( mandatory_fields ) m = mandatory_fields.split(",");
257 for (i = 0; i < m.length; i++) {
258 if ( ! $("#" + m[i]).val() ) {
264 alert( _("The following fields are required and not filled in: ") + f.join(", ") );
268 // Check if all fields are blank
269 if( m.length == 0 && $('#title').val()=='' && $('#author').val()=='' && $('#volume').val()=='' && $('#issue').val()=='' && $('#date').val()=='' && $('#pages').val()=='' && $('#chapters').val()=='' && $('#patron_notes').val()=='' ) {
270 alert( _("Please fill in at least one field.") );
275 $('#place-article-request').submit();
279 // Initialize format(s)
280 var supported_formats = "[% Koha.Preference('ArticleRequestsSupportedFormats') | $raw %]";
281 if( !supported_formats.match(/PHOTOCOPY/) )
282 $('#format option[value="PHOTOCOPY"]').remove();
283 if( !supported_formats.match(/SCAN/) )
284 $('#format option[value="SCAN"]').remove();
286 if( $('#format option').length > 1 ) {
287 // Select first listed format
288 var first_format = supported_formats.split('|')[0].replace(/^\s*|\s*$/g, '');
289 $('#format option[value="'+first_format+'"]').attr('selected', true);