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 id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
20 <ol 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">
28 <a href="#" aria-current="page">Request article</a>
31 </nav> <!-- /#breadcrumbs -->
33 <div class="container-fluid maincontent">
36 [% IF error_message %]
37 <h1 class="title">[% biblio.title | html %]</h1>
38 <div class="alert alert-info">
39 [% SWITCH error_message %]
40 [% CASE 'article_request_limit_reached' %]You reached your open article requests limit.
41 [% CASE 'article_request_unhandled_exception' %]An error has occurred.
44 [% ELSIF biblio.can_article_request( patron ) %]
45 <h1>Place article request for [% biblio.title | html %]</h1>
46 [% IF ( disclaimer && !action) %]
47 <div class="alert alert-warning">
48 [% PROCESS koha_news_block news => disclaimer %]
49 <a href="/cgi-bin/koha/opac-request-article.pl?biblionumber=[% biblio.biblionumber | uri %]&action=accept"
50 class="btn btn-sm btn-primary"><i class="fa fa-check" aria-hidden="true"></i> Accept</a>
53 [% SET article_request_type = biblio.article_request_type( patron ) %]
55 [% IF article_request_type == 'yes' %] [% SET mandatory_fields = Koha.Preference('ArticleRequestsMandatoryFields') %] [% END %]
56 [% IF article_request_type == 'bib_only' %] [% SET mandatory_fields = Koha.Preference('ArticleRequestsMandatoryFieldsRecordOnly') %] [% END %]
57 [% IF article_request_type == 'item_only' %] [% SET mandatory_fields = Koha.Preference('ArticleRequestsMandatoryFieldsItemOnly') %] [% END %]
60 <form id="place-article-request" method="post" action="/cgi-bin/koha/opac-request-article.pl">
61 <legend class="sr-only">Place article request</legend>
62 <input type="hidden" name="action" value="create" />
63 <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblio.biblionumber | html %]" />
65 <fieldset class="rows">
68 [% IF mandatory_fields.search('title') %]
69 <label for="title" class="required">Title:</label>
70 <input type="text" required="required" name="title" id="title" size="50" value="[% title | html %]"/>
72 <label for="title">Title:</label>
73 <input type="text" name="title" id="title" size="50" value="[% title | html %]"/>
78 [% IF mandatory_fields.search('author') %]
79 <label for="author" class="required">Author:</label>
80 <input type="text" required="required" name="author" id="author" size="50" value="[% author | html %]"/>
82 <label for="author">Author:</label>
83 <input type="text" name="author" id="author" size="50" value="[% author | html %]"/>
88 [% IF mandatory_fields.search('volume') %]
89 <label for="volume" class="required">Volume:</label>
90 <input type="text" required="required" name="volume" id="volume" size="50"/>
92 <label for="volume">Volume:</label>
93 <input type="text" name="volume" id="volume" size="50"/>
98 [% IF mandatory_fields.search('issue') %]
99 <label for="issue" class="required">Issue:</label>
100 <input type="text" required="required" name="issue" id="issue" size="50"/>
102 <label for="issue">Issue:</label>
103 <input type="text" name="issue" id="issue" size="50"/>
108 [% IF mandatory_fields.search('date') %]
109 <label for="date" class="required">Date:</label>
110 <input type="text" required="required" name="date" id="date" size="50"/>
112 <label for="date">Date:</label>
113 <input type="text" name="date" id="date" size="50"/>
118 <label for="toc_request">Table of contents:</label>
119 <input type="checkbox" name="toc_request" value="1"/>
123 [% IF mandatory_fields.search('pages') %]
124 <label for="pages" class="required">Pages:</label>
125 <input type="text" required="required" name="pages" id="pages" size="50" value="[% pageinfo | html %]"/>
127 <label for="pages">Pages:</label>
128 <input type="text" name="pages" id="pages" size="50" value="[% pageinfo | html %]"/>
133 [% IF mandatory_fields.search('chapters') %]
134 <label for="chapters" class="required">Chapters:</label>
135 <input type="text" required="required" name="chapters" id="chapters" size="50"/>
137 <label for="chapters">Chapters:</label>
138 <input type="text" name="chapters" id="chapters" size="50"/>
143 <label for="patron_notes">Notes:</label>
144 <input type="text" name="patron_notes" id="patron_notes" size="50"/>
148 <label for="format">Format:</label>
149 <select name="format" id="format">
150 <option value="PHOTOCOPY">Photocopy</option>
151 <option value="SCAN">Digital scan</option>
156 <label for="branchcode">Pickup library:</label>
157 <select name="branchcode" id="branchcode" required="required">
158 [% FOREACH b IN Branches.all %]
159 [% IF b.branchcode == Branches.GetLoggedInBranchcode %]
160 <option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
162 <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
170 [% IF article_request_type != 'bib_only' %]
171 <table class="copiesrow table table-bordered table-striped">
172 <caption>Select a specific item:</caption>
178 <th>Home library</th>
185 [% FOREACH item IN biblio.items %]
186 [% IF item.can_article_request( patron ) %]
189 [% IF article_request_type == 'item_only' && !checked %]
190 [% SET checked = 1 %]
191 <input type="radio" name="itemnumber" value="[% item.itemnumber | html %]" checked="checked" />
193 <input type="radio" name="itemnumber" value="[% item.itemnumber | html %]" />
197 [% ItemTypes.GetDescription( item.itype ) | html %]
200 [% item.barcode | html %]
203 [% Branches.GetName( item.homebranch ) | html %]
206 [% item.itemcallnumber | html %]
209 [% item.enumchron | html %]
215 [% IF article_request_type != 'item_only' %]
218 <input type="radio" name="itemnumber" value="" checked="checked"/>
229 <input type="submit" class="btn btn-primary" value="Place request" />
233 <h1 class="title">[% biblio.title | html %]</h1>
234 <div class="alert alert-info">
235 No article requests can be made for this record.
238 </div> <!-- /.col -->
239 </div> <!-- /.row -->
240 </div> <!-- / .container-fluid -->
241 </div> <!-- / .main -->
243 [% INCLUDE 'opac-bottom.inc' %]
245 [% BLOCK jsinclude %]
247 $(document).ready( function() {
248 allow_submit = false;
249 $('#place-article-request').on('submit', function( event ){
250 if ( ! allow_submit ) {
251 event.preventDefault();
253 [% IF article_request_type == 'item_only' %]
254 if ( ! $("input:radio[name='itemnumber']").is(":checked") ) {
255 alert( _("Please select a specific item for this article request.") );
260 var mandatory_fields = "[% mandatory_fields | html %]";
262 if ( mandatory_fields ) m = mandatory_fields.split(",");
265 for (i = 0; i < m.length; i++) {
266 if ( ! $("#" + m[i]).val() ) {
272 alert( _("The following fields are required and not filled in: ") + f.join(", ") );
276 // Check if all fields are blank
277 if( m.length == 0 && $('#title').val()=='' && $('#author').val()=='' && $('#volume').val()=='' && $('#issue').val()=='' && $('#date').val()=='' && $('#pages').val()=='' && $('#chapters').val()=='' && $('#patron_notes').val()=='' && !$('input[name="toc_request"]').prop('checked') ) {
278 alert( _("Please fill in at least one field.") );
283 $('#place-article-request').submit();
287 // Initialize format(s)
288 var supported_formats = "[% Koha.Preference('ArticleRequestsSupportedFormats') | $raw %]";
289 if( !supported_formats.match(/PHOTOCOPY/) )
290 $('#format option[value="PHOTOCOPY"]').remove();
291 if( !supported_formats.match(/SCAN/) )
292 $('#format option[value="SCAN"]').remove();
294 if( $('#format option').length > 1 ) {
295 // Select first listed format
296 var first_format = supported_formats.split('|')[0].replace(/^\s*|\s*$/g, '');
297 $('#format option[value="'+first_format+'"]').attr('selected', true);