Lines 1-159
Link Here
|
1 |
[% USE Koha %] |
|
|
2 |
[% PROCESS 'i18n.inc' %] |
3 |
[% cwd = whole.cwd %] |
4 |
[% PROCESS "${cwd}/shared-includes/form_input_helpers.inc" %] |
5 |
[% IF whole.error %] |
6 |
[% IF whole.status == 'missing_identifier' %] |
7 |
<div class="alert alert-warning"> |
8 |
<strong>Please note:</strong> Mandatory field Identifier is missing. |
9 |
</div> |
10 |
[% ELSIF whole.status == 'missing_type' %] |
11 |
<div class="alert alert-warning"> |
12 |
<strong>Please note:</strong> Type is a mandatory field. |
13 |
</div> |
14 |
[% ELSIF whole.status == 'missing_unauth_data' %] |
15 |
<div class="alert alert-warning"> |
16 |
<strong>Please note:</strong> Patron data (first name, last name and e-mail) are mandatory fields. |
17 |
</div> |
18 |
[% ELSIF whole.status == 'missing_branch' %] |
19 |
<div class="alert alert-warning"> |
20 |
<strong>Please note:</strong> Library is a mandatory field. |
21 |
</div> |
22 |
[% ELSIF whole.status == 'invalid_borrower' %] |
23 |
<div class="alert alert-warning"> |
24 |
<strong>Please note:</strong> The patron details you entered are invalid. |
25 |
</div> |
26 |
[% ELSIF whole.status == 'invalid_branch' %] |
27 |
<div class="alert alert-warning"> |
28 |
<strong>Please note:</strong> The library you chose is invalid. |
29 |
</div> |
30 |
[% ELSIF whole.status == 'failed_captcha' %] |
31 |
<div class="alert alert-warning">You typed in the wrong characters in the box before submitting. Please try again.</div> |
32 |
[% ELSE %] |
33 |
<p>Unhandled error</p> |
34 |
[% END %] |
35 |
[% END %] |
36 |
[% SET opac = whole.value.other.opac %] |
37 |
|
38 |
[% IF whole.stage == "form" %] |
39 |
<h2>Create an ILL request</h2> |
40 |
<form id="create_form" method="POST" action=""> |
41 |
[% INCLUDE 'csrf-token.inc' %] |
42 |
<fieldset class="rows"> |
43 |
<legend>Patron options</legend> |
44 |
<ol> |
45 |
[% IF unauthenticated_ill && !logged_in_user%] |
46 |
[% PROCESS ill_text_input_field required = 1 id = 'unauthenticated_first_name' label = t('First name') value = whole.value.other.unauthenticated_first_name %] |
47 |
[% PROCESS ill_text_input_field required = 1 id = 'unauthenticated_last_name' label = t('Last name') value = whole.value.other.unauthenticated_last_name %] |
48 |
[% PROCESS ill_text_input_field required = 1 id = 'unauthenticated_email' label = t('E-mail address') value = whole.value.other.unauthenticated_email %] |
49 |
[% END %] |
50 |
[% WRAPPER ill_select_field required = 1 id = 'branchcode' label = t('Destination library') %] |
51 |
<option value=""></option> |
52 |
[% FOREACH branch IN branches %] |
53 |
[% IF whole.value.other.branchcode && branch.branchcode == whole.value.other.branchcode %] |
54 |
<option value="[% branch.branchcode | html %]" selected="selected"> |
55 |
[% branch.branchname | html %] |
56 |
</option> |
57 |
[% ELSE %] |
58 |
<option value="[% branch.branchcode | html %]"> |
59 |
[% branch.branchname | html %] |
60 |
</option> |
61 |
[% END %] |
62 |
[% END %] |
63 |
[% END #ill_select_field %] |
64 |
</ol> |
65 |
</fieldset> |
66 |
<fieldset class="rows"> |
67 |
<legend>General details</legend> |
68 |
<ol id="general-standard-fields"> |
69 |
[% WRAPPER ill_select_field required = 1 id = 'type' label = t('Type') %] |
70 |
<option value=""></option> |
71 |
[% IF whole.value.other.type.lower == "book" %] |
72 |
<option value="book" selected="selected">Book</option> |
73 |
[% ELSE %] |
74 |
<option value="book">Book</option> |
75 |
[% END %] |
76 |
[% IF whole.value.other.type.lower == "chapter" %] |
77 |
<option value="chapter" selected="selected">Chapter</option> |
78 |
[% ELSE %] |
79 |
<option value="chapter">Chapter</option> |
80 |
[% END %] |
81 |
[% IF whole.value.other.type.lower == "journal" %] |
82 |
<option value="journal" selected="selected">Journal</option> |
83 |
[% ELSE %] |
84 |
<option value="journal">Journal</option> |
85 |
[% END %] |
86 |
[% IF whole.value.other.type.lower == "article" %] |
87 |
<option value="article" selected="selected">Journal article</option> |
88 |
[% ELSE %] |
89 |
<option value="article">Journal article</option> |
90 |
[% END %] |
91 |
[% IF whole.value.other.type.lower == "thesis" %] |
92 |
<option value="thesis" selected="selected">Thesis</option> |
93 |
[% ELSE %] |
94 |
<option value="thesis">Thesis</option> |
95 |
[% END %] |
96 |
[% IF whole.value.other.type.lower == "conference" %] |
97 |
<option value="conference" selected="selected">Conference</option> |
98 |
[% ELSE %] |
99 |
<option value="conference">Conference</option> |
100 |
[% END %] |
101 |
[% IF whole.value.other.type.lower == "dvd" %] |
102 |
<option value="dvd" selected="selected">DVD</option> |
103 |
[% ELSE %] |
104 |
<option value="dvd">DVD</option> |
105 |
[% END %] |
106 |
[% IF whole.value.other.type.lower == "other" %] |
107 |
<option value="other" selected="selected">Other</option> |
108 |
[% ELSE %] |
109 |
<option value="other">Other</option> |
110 |
[% END %] |
111 |
[% IF whole.value.other.type.lower == "resource" %] |
112 |
<option value="resource" selected="selected">Generic resource</option> |
113 |
[% ELSE %] |
114 |
<option value="resource">Generic resource</option> |
115 |
[% END %] |
116 |
[% END #ill_select_field %] |
117 |
</ol> |
118 |
</fieldset> |
119 |
[% type = whole.value.other.type %] |
120 |
[% IF type %] |
121 |
[% INCLUDE "${cwd}/shared-includes/forms/${type}.inc" %] |
122 |
[% END %] |
123 |
[% INCLUDE "${cwd}/shared-includes/custom_fields.inc" %] |
124 |
[% IF whole.value.other.type && unauthenticated_ill && !logged_in_user%] |
125 |
<fieldset class="rows" id="illrequest_captcha"> |
126 |
<legend>Verification</legend> |
127 |
<ol> |
128 |
<li> |
129 |
<label for="captcha" class="required">Verification:</label> |
130 |
|
131 |
<input type="text" name="captcha" id="captcha" class="form-control input-fluid" style="text-transform: uppercase;" /> |
132 |
<div class="required_label required">Required</div> |
133 |
<input type="hidden" name="captcha_digest" value="[% captcha_digest | html %]" /> |
134 |
|
135 |
<span class="hint">Please type the following characters into the preceding box: <strong>[% captcha | html %]</strong></span> |
136 |
</li> |
137 |
</ol> |
138 |
</fieldset> |
139 |
[% END %] |
140 |
<fieldset class="action"> |
141 |
<input id="ill-submit" class="btn btn-primary" type="submit" value="Create"/> |
142 |
<a class="cancel" href="/cgi-bin/koha/opac-illrequests.pl">Cancel</a> |
143 |
</fieldset> |
144 |
<input type="hidden" name="op" value="cud-create" /> |
145 |
<input type="hidden" name="stage" value="form" /> |
146 |
<input type="hidden" name="backend" value="Standard" /> |
147 |
</form> |
148 |
|
149 |
[% ELSE %] |
150 |
<p>Unknown stage. This should not have happened. |
151 |
|
152 |
[% END %] |
153 |
[% BLOCK backend_jsinclude %] |
154 |
<script> |
155 |
// <![CDATA[] |
156 |
[% INCLUDE "${cwd}/shared-includes/shared.js" %] |
157 |
// ]]> |
158 |
</script> |
159 |
[% END %] |