|
Lines 300-305
Link Here
|
| 300 |
var first_format = supported_formats.split('|')[0].replace(/^\s*|\s*$/g, ''); |
300 |
var first_format = supported_formats.split('|')[0].replace(/^\s*|\s*$/g, ''); |
| 301 |
$('#format option[value="'+first_format+'"]').attr('selected', true); |
301 |
$('#format option[value="'+first_format+'"]').attr('selected', true); |
| 302 |
} |
302 |
} |
| 303 |
}); |
303 |
|
| 304 |
</script> |
304 |
if ( f.length ) { |
|
|
305 |
alert( _("The following fields are required and not filled in: ") + f.join(", ") ); |
| 306 |
return 0; |
| 307 |
} |
| 308 |
|
| 309 |
// Check if all fields are blank |
| 310 |
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') ) { |
| 311 |
alert( _("Please fill in at least one field.") ); |
| 312 |
return 0; |
| 313 |
} |
| 314 |
|
| 315 |
allow_submit = true; |
| 316 |
$('#place-article-request').submit(); |
| 317 |
} |
| 318 |
}); |
| 319 |
|
| 320 |
// Initialize format(s) |
| 321 |
var supported_formats = "[% Koha.Preference('ArticleRequestsSupportedFormats') | html %]"; |
| 322 |
if( !supported_formats.match(/PHOTOCOPY/) ) |
| 323 |
$('#format option[value="PHOTOCOPY"]').remove(); |
| 324 |
if( !supported_formats.match(/SCAN/) ) |
| 325 |
$('#format option[value="SCAN"]').remove(); |
| 326 |
|
| 327 |
if( $('#format option').length > 1 ) { |
| 328 |
// Select first listed format |
| 329 |
var first_format = supported_formats.split('|')[0].replace(/^\s*|\s*$/g, ''); |
| 330 |
$('#format option[value="'+first_format+'"]').attr('selected', true); |
| 331 |
} |
| 332 |
}); |
| 333 |
</script> |
| 305 |
[% END %] |
334 |
[% END %] |