Lines 29-37
Link Here
|
29 |
<h1>Enter a new purchase suggestion</h1> |
29 |
<h1>Enter a new purchase suggestion</h1> |
30 |
|
30 |
|
31 |
<p>Please fill out this form to make a purchase suggestion. You will receive an email when the library processes your suggestion</p> |
31 |
<p>Please fill out this form to make a purchase suggestion. You will receive an email when the library processes your suggestion</p> |
32 |
<p>Only the title is required, but the more information you enter the easier it will be for the librarians to find the title you're requesting. The "Notes" field can be used to provide any additional information.</p> |
32 |
[% IF (mandatoryfields) %] |
|
|
33 |
<p>Form fields labeled in red are mandatory. The more information you enter the easier it will be for the librarians to find the title you're requesting. |
34 |
[% ELSE %] |
35 |
<p>Only the title is required, but the more information you enter the easier it will be for the librarians to find the title you're requesting. |
36 |
[% END %] |
37 |
The "Notes" field can be used to provide any additional information.</p> |
33 |
|
38 |
|
34 |
<form action="/cgi-bin/koha/opac-suggestions.pl" method="post"> |
39 |
<form action="/cgi-bin/koha/opac-suggestions.pl" id="newsuggestionform" onsubmit="return Check(this);" method="post"> |
35 |
<fieldset class="rows"> |
40 |
<fieldset class="rows"> |
36 |
<ol> |
41 |
<ol> |
37 |
<li><label class="required" for="title">Title:</label><input type="text" id="title" name="title" maxlength="255" /></li> |
42 |
<li><label class="required" for="title">Title:</label><input type="text" id="title" name="title" maxlength="255" /></li> |
Lines 94-100
Link Here
|
94 |
<fieldset class="action"> |
99 |
<fieldset class="action"> |
95 |
<input type="hidden" name="suggestedby" value="[% suggestedbyme %]" /> |
100 |
<input type="hidden" name="suggestedby" value="[% suggestedbyme %]" /> |
96 |
<input type="hidden" name="op" value="add_confirm" /> |
101 |
<input type="hidden" name="op" value="add_confirm" /> |
97 |
<input type="submit" onclick="Check(this.form); return false;" class="btn" value="Submit your suggestion" /> <a class="action" href="/cgi-bin/koha/opac-suggestions.pl">Cancel</a> |
102 |
<input type="submit" class="btn" value="Submit your suggestion" /> <a class="action" href="/cgi-bin/koha/opac-suggestions.pl">Cancel</a> |
98 |
</fieldset> |
103 |
</fieldset> |
99 |
</form> |
104 |
</form> |
100 |
[% END # IF op_add %] |
105 |
[% END # IF op_add %] |
Lines 304-326
Link Here
|
304 |
return true; |
309 |
return true; |
305 |
}); |
310 |
}); |
306 |
[% END %] |
311 |
[% END %] |
|
|
312 |
[% IF ( op_add && mandatoryfields ) %] |
313 |
var FldsRequired = [[% mandatoryfields %]]; |
314 |
for (var i = 0; i < FldsRequired.length; i++) { |
315 |
var rqinput = $('#' + FldsRequired[i]); |
316 |
if (rqinput.length != 1) continue; |
317 |
$(rqinput).attr("required", "required"); |
318 |
var rqlabel = $("label[for=" + rqinput.attr("id") + "]"); |
319 |
if (rqlabel.length != 1) continue; |
320 |
$(rqlabel).addClass('required'); |
321 |
} |
322 |
[% END %] |
307 |
}); |
323 |
}); |
308 |
|
324 |
|
309 |
function Check(f) { |
325 |
function Check(f) { |
310 |
var _alertString=""; |
326 |
var _alertString=""; |
311 |
var alertString2; |
327 |
var alertString2; |
312 |
|
328 |
|
313 |
if(f.title.value.length ==0){ |
329 |
var FieldsRequired = [[% mandatoryfields %]]; |
314 |
_alertString += _("- You must enter a Title") + "\n"; |
330 |
FieldsRequired.unshift("title"); |
|
|
331 |
|
332 |
for (var i = 0; i < FieldsRequired.length; i++) { |
333 |
var lbl = FieldsRequired[i]; |
334 |
if (!f[lbl] || (f[lbl].value.length != 0)) continue; |
335 |
_alertString += _("- Some mandatory fields are missing") + "\n"; |
336 |
break; |
315 |
} |
337 |
} |
316 |
|
338 |
|
317 |
if (_alertString.length==0) { |
339 |
if (_alertString.length == 0) { |
318 |
f.submit(); |
340 |
return true; |
319 |
} else { |
341 |
} else { |
320 |
alertString2 = _("Form not submitted because of the following problem(s)"); |
342 |
alertString2 = _("Form not submitted because of the following problem(s)"); |
321 |
alertString2 += "\n------------------------------------------------------------------------------------\n\n"; |
343 |
alertString2 += "\n------------------------------------------------------------------------------------\n\n"; |
322 |
alertString2 += _alertString; |
344 |
alertString2 += _alertString; |
323 |
alert(alertString2); |
345 |
alert(alertString2); |
|
|
346 |
return false; |
324 |
} |
347 |
} |
325 |
} |
348 |
} |
326 |
//]]> |
349 |
//]]> |