4 [% USE AdditionalContents %]
7 [% INCLUDE 'doc-head-open.inc' %]
9 <title>Request article › [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
10 [% INCLUDE 'doc-head-close.inc' %]
11 [% BLOCK cssinclude %][% END %]
14 [% INCLUDE 'bodytag.inc' bodyid='opac-request-article' %]
15 [% INCLUDE 'masthead.inc' %]
17 [% SET disclaimer = AdditionalContents.get( location => "ArticleRequestsDisclaimerText", lang => lang, library => logged_in_user.branchcode || default_branch ) %]
20 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
21 <ol class="breadcrumb">
22 <li class="breadcrumb-item">
23 <a href="/cgi-bin/koha/opac-main.pl">Home</a>
25 <li class="breadcrumb-item">
26 <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | uri %]">Details for: [% biblio.title | html %]</a>
28 <li class="breadcrumb-item active">
29 <a href="#" aria-current="page">Request article</a>
32 </nav> <!-- /#breadcrumbs -->
34 <div class="container-fluid maincontent">
37 [% IF error_message %]
38 <h1 class="title">[% biblio.title | html %]</h1>
39 <div class="alert alert-info">
40 [% SWITCH error_message %]
41 [% CASE 'article_request_limit_reached' %]You reached your open article requests limit.
42 [% CASE 'article_request_unhandled_exception' %]An error has occurred.
45 [% ELSIF biblio.can_article_request( patron ) %]
46 <h1>Place article request for [% biblio.title | html %]</h1>
47 [% IF ( disclaimer && !action) %]
48 <div class="alert alert-warning">
49 [% PROCESS koha_news_block news => disclaimer %]
50 <a href="/cgi-bin/koha/opac-request-article.pl?biblionumber=[% biblio.biblionumber | uri %]&action=accept"
51 class="btn btn-sm btn-primary"><i class="fa fa-check" aria-hidden="true"></i> Accept</a>
54 [% SET article_request_type = biblio.article_request_type( patron ) %]
56 [% IF article_request_type == 'yes' %] [% SET mandatory_fields = Koha.Preference('ArticleRequestsMandatoryFields') %] [% END %]
57 [% IF article_request_type == 'bib_only' %] [% SET mandatory_fields = Koha.Preference('ArticleRequestsMandatoryFieldsRecordOnly') %] [% END %]
58 [% IF article_request_type == 'item_only' %] [% SET mandatory_fields = Koha.Preference('ArticleRequestsMandatoryFieldsItemOnly') %] [% END %]
61 [% IF article_request_fee > 0 %]
62 <div class="alert alert-warning">
63 You will be charged with <strong>[% article_request_fee | $Price %]</strong> for every request
67 <form id="place-article-request" method="post" action="/cgi-bin/koha/opac-request-article.pl">
68 <legend class="sr-only">Place article request</legend>
69 <input type="hidden" name="action" value="create" />
70 <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblio.biblionumber | html %]" />
72 <fieldset class="rows">
75 [% IF mandatory_fields.search('title') %]
76 <label for="title" class="required">Title:</label>
77 <input type="text" required="required" name="title" id="title" size="50" value="[% title | html %]"/>
79 <label for="title">Title:</label>
80 <input type="text" name="title" id="title" size="50" value="[% title | html %]"/>
85 [% IF mandatory_fields.search('author') %]
86 <label for="author" class="required">Author:</label>
87 <input type="text" required="required" name="author" id="author" size="50" value="[% author | html %]"/>
89 <label for="author">Author:</label>
90 <input type="text" name="author" id="author" size="50" value="[% author | html %]"/>
95 [% IF mandatory_fields.search('volume') %]
96 <label for="volume" class="required">Volume:</label>
97 <input type="text" required="required" name="volume" id="volume" size="50"/>
99 <label for="volume">Volume:</label>
100 <input type="text" name="volume" id="volume" size="50"/>
105 [% IF mandatory_fields.search('issue') %]
106 <label for="issue" class="required">Issue:</label>
107 <input type="text" required="required" name="issue" id="issue" size="50"/>
109 <label for="issue">Issue:</label>
110 <input type="text" name="issue" id="issue" size="50"/>
115 [% IF mandatory_fields.search('date') %]
116 <label for="date" class="required">Date:</label>
117 <input type="text" required="required" name="date" id="date" size="50"/>
119 <label for="date">Date:</label>
120 <input type="text" name="date" id="date" size="50"/>
125 <label for="toc_request">Table of contents:</label>
126 <input type="checkbox" name="toc_request" value="1"/>
130 [% IF mandatory_fields.search('pages') %]
131 <label for="pages" class="required">Pages:</label>
132 <input type="text" required="required" name="pages" id="pages" size="50" value="[% pageinfo | html %]"/>
134 <label for="pages">Pages:</label>
135 <input type="text" name="pages" id="pages" size="50" value="[% pageinfo | html %]"/>
140 [% IF mandatory_fields.search('chapters') %]
141 <label for="chapters" class="required">Chapters:</label>
142 <input type="text" required="required" name="chapters" id="chapters" size="50"/>
144 <label for="chapters">Chapters:</label>
145 <input type="text" name="chapters" id="chapters" size="50"/>
150 <label for="patron_notes">Notes:</label>
151 <input type="text" name="patron_notes" id="patron_notes" size="50"/>
155 <label for="format">Format:</label>
156 <select name="format" id="format">
157 <option value="PHOTOCOPY">Photocopy</option>
158 <option value="SCAN">Digital scan</option>
163 <label for="branchcode">Pickup library:</label>
164 <select name="branchcode" id="branchcode" required="required">
165 [% FOREACH b IN Branches.all %]
166 [% IF b.branchcode == Branches.GetLoggedInBranchcode %]
167 <option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
169 <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
177 [% IF article_request_type != 'bib_only' %]
178 <table class="copiesrow table table-bordered table-striped">
179 <caption>Select a specific item:</caption>
185 <th>Home library</th>
192 [% FOREACH item IN biblio.items %]
193 [% IF item.can_article_request( patron ) %]
196 [% IF article_request_type == 'item_only' && !checked %]
197 [% SET checked = 1 %]
198 <input type="radio" name="itemnumber" value="[% item.itemnumber | html %]" checked="checked" />
200 <input type="radio" name="itemnumber" value="[% item.itemnumber | html %]" />
204 [% ItemTypes.GetDescription( item.itype ) | html %]
207 [% item.barcode | html %]
210 [% Branches.GetName( item.homebranch ) | html %]
213 [% item.itemcallnumber | html %]
216 [% item.enumchron | html %]
222 [% IF article_request_type != 'item_only' %]
225 <input type="radio" name="itemnumber" value="" checked="checked"/>
236 <input type="submit" class="btn btn-primary" value="Place request" />
240 <h1 class="title">[% biblio.title | html %]</h1>
241 <div class="alert alert-info">
242 No article requests can be made for this record.
245 </div> <!-- /.col -->
246 </div> <!-- /.row -->
247 </div> <!-- / .container-fluid -->
248 </div> <!-- / .main -->
250 [% INCLUDE 'opac-bottom.inc' %]
252 [% BLOCK jsinclude %]
254 $(document).ready( function() {
255 allow_submit = false;
256 $('#place-article-request').on('submit', function( event ){
257 if ( ! allow_submit ) {
258 event.preventDefault();
260 [% IF article_request_type == 'item_only' %]
261 if ( ! $("input:radio[name='itemnumber']").is(":checked") ) {
262 alert( _("Please select a specific item for this article request.") );
267 var mandatory_fields = "[% mandatory_fields | html %]";
269 if ( mandatory_fields ) m = mandatory_fields.split(",");
272 for (i = 0; i < m.length; i++) {
273 if ( ! $("#" + m[i]).val() ) {
279 alert( _("The following fields are required and not filled in: ") + f.join(", ") );
283 // Check if all fields are blank
284 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') ) {
285 alert( _("Please fill in at least one field.") );
290 $('#place-article-request').submit();
294 // Initialize format(s)
295 var supported_formats = "[% Koha.Preference('ArticleRequestsSupportedFormats') | $raw %]";
296 if( !supported_formats.match(/PHOTOCOPY/) )
297 $('#format option[value="PHOTOCOPY"]').remove();
298 if( !supported_formats.match(/SCAN/) )
299 $('#format option[value="SCAN"]').remove();
301 if( $('#format option').length > 1 ) {
302 // Select first listed format
303 var first_format = supported_formats.split('|')[0].replace(/^\s*|\s*$/g, '');
304 $('#format option[value="'+first_format+'"]').attr('selected', true);