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 %]
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 [% IF mandatory_fields.search('pages') %]
119 <label for="pages" class="required">Pages:</label>
120 <input type="text" required="required" name="pages" id="pages" size="50" value="[% pageinfo | html %]"/>
122 <label for="pages">Pages:</label>
123 <input type="text" name="pages" id="pages" size="50" value="[% pageinfo | html %]"/>
128 [% IF mandatory_fields.search('chapters') %]
129 <label for="chapters" class="required">Chapters:</label>
130 <input type="text" required="required" name="chapters" id="chapters" size="50"/>
132 <label for="chapters">Chapters:</label>
133 <input type="text" name="chapters" id="chapters" size="50"/>
138 <label for="patron_notes">Notes:</label>
139 <input type="text" name="patron_notes" id="patron_notes" size="50"/>
143 <label for="format">Format:</label>
144 <select name="format" id="format">
145 <option value="PHOTOCOPY">Photocopy</option>
146 <option value="SCAN">Digital scan</option>
151 <label for="branchcode">Pickup library:</label>
152 <select name="branchcode" id="branchcode" required="required">
153 [% FOREACH b IN Branches.all %]
154 [% IF b.branchcode == Branches.GetLoggedInBranchcode %]
155 <option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
157 <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
165 [% IF article_request_type != 'bib_only' %]
166 <table class="copiesrow table table-bordered table-striped">
167 <caption>Select a specific item:</caption>
173 <th>Home library</th>
180 [% FOREACH item IN biblio.items %]
181 [% IF item.can_article_request( patron ) %]
184 [% IF article_request_type == 'item_only' && !checked %]
185 [% SET checked = 1 %]
186 <input type="radio" name="itemnumber" value="[% item.itemnumber | html %]" checked="checked" />
188 <input type="radio" name="itemnumber" value="[% item.itemnumber | html %]" />
192 [% ItemTypes.GetDescription( item.itype ) | html %]
195 [% item.barcode | html %]
198 [% Branches.GetName( item.homebranch ) | html %]
201 [% item.itemcallnumber | html %]
204 [% item.enumchron | html %]
210 [% IF article_request_type != 'item_only' %]
213 <input type="radio" name="itemnumber" value="" checked="checked"/>
224 <input type="submit" class="btn btn-primary" value="Place request" />
228 <h1 class="title">[% biblio.title | html %]</h1>
229 <div class="alert alert-info">
230 No article requests can be made for this record.
233 </div> <!-- /.col -->
234 </div> <!-- /.row -->
235 </div> <!-- / .container-fluid -->
236 </div> <!-- / .main -->
238 [% INCLUDE 'opac-bottom.inc' %]
240 [% BLOCK jsinclude %]
242 $(document).ready( function() {
243 allow_submit = false;
244 $('#place-article-request').on('submit', function( event ){
245 if ( ! allow_submit ) {
246 event.preventDefault();
248 [% IF article_request_type == 'item_only' %]
249 if ( ! $("input:radio[name='itemnumber']").is(":checked") ) {
250 alert( _("Please select a specific item for this article request.") );
255 var mandatory_fields = "[% mandatory_fields | html %]";
257 if ( mandatory_fields ) m = mandatory_fields.split(",");
260 for (i = 0; i < m.length; i++) {
261 if ( ! $("#" + m[i]).val() ) {
267 alert( _("The following fields are required and not filled in: ") + f.join(", ") );
271 // Check if all fields are blank
272 if( m.length == 0 && $('#title').val()=='' && $('#author').val()=='' && $('#volume').val()=='' && $('#issue').val()=='' && $('#date').val()=='' && $('#pages').val()=='' && $('#chapters').val()=='' && $('#patron_notes').val()=='' ) {
273 alert( _("Please fill in at least one field.") );
278 $('#place-article-request').submit();
282 // Initialize format(s)
283 var supported_formats = "[% Koha.Preference('ArticleRequestsSupportedFormats') | $raw %]";
284 if( !supported_formats.match(/PHOTOCOPY/) )
285 $('#format option[value="PHOTOCOPY"]').remove();
286 if( !supported_formats.match(/SCAN/) )
287 $('#format option[value="SCAN"]').remove();
289 if( $('#format option').length > 1 ) {
290 // Select first listed format
291 var first_format = supported_formats.split('|')[0].replace(/^\s*|\s*$/g, '');
292 $('#format option[value="'+first_format+'"]').attr('selected', true);