|
Lines 27-32
require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
Link Here
|
| 27 |
'koha:biblioserver': { |
27 |
'koha:biblioserver': { |
| 28 |
name: _("Local catalog"), |
28 |
name: _("Local catalog"), |
| 29 |
recordtype: 'biblio', |
29 |
recordtype: 'biblio', |
|
|
30 |
enabled: true, |
| 30 |
checked: false, |
31 |
checked: false, |
| 31 |
}, |
32 |
}, |
| 32 |
[%- FOREACH batch = editable_batches -%] |
33 |
[%- FOREACH batch = editable_batches -%] |
|
Lines 41-46
require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
Link Here
|
| 41 |
name: '[% server.servername %]', |
42 |
name: '[% server.servername %]', |
| 42 |
recordtype: '[% server.recordtype %]', |
43 |
recordtype: '[% server.recordtype %]', |
| 43 |
checked: [% server.checked ? 'true' : 'false' %], |
44 |
checked: [% server.checked ? 'true' : 'false' %], |
|
|
45 |
enabled: true, |
| 44 |
}, |
46 |
}, |
| 45 |
[%- END -%] |
47 |
[%- END -%] |
| 46 |
}; |
48 |
}; |
|
Lines 350-355
require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
Link Here
|
| 350 |
$( '#save-targets input[data-target-id="' + target_id + '"]' ).closest('li').toggle(enabled); |
352 |
$( '#save-targets input[data-target-id="' + target_id + '"]' ).closest('li').toggle(enabled); |
| 351 |
} |
353 |
} |
| 352 |
|
354 |
|
|
|
355 |
function setSearchTargetChecked( server_id, checked ) { |
| 356 |
if ( z3950Servers[server_id] == null ) return; |
| 357 |
|
| 358 |
z3950Servers[server_id].checked = checked; |
| 359 |
$( '.search-target-list li[data-server-id="' + server_id + '"] input' ).prop('checked', checked); |
| 360 |
} |
| 361 |
|
| 362 |
function setSearchTargetEnabled( server_id, enabled ) { |
| 363 |
if ( !enabled ) { |
| 364 |
setSearchTargetChecked( server_id, false ); |
| 365 |
} |
| 366 |
|
| 367 |
z3950Servers[server_id].enabled = enabled; |
| 368 |
$( '.search-target-list li[data-server-id="' + server_id + '"]' ).toggle(enabled); |
| 369 |
} |
| 370 |
|
| 353 |
function setSource(parts) { |
371 |
function setSource(parts) { |
| 354 |
state.backend = parts[0]; |
372 |
state.backend = parts[0]; |
| 355 |
state.recordID = parts[1]; |
373 |
state.recordID = parts[1]; |
|
Lines 449-454
require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
Link Here
|
| 449 |
function showAdvancedSearch() { |
467 |
function showAdvancedSearch() { |
| 450 |
$('#advanced-search-servers').empty(); |
468 |
$('#advanced-search-servers').empty(); |
| 451 |
$.each( z3950Servers, function( server_id, server ) { |
469 |
$.each( z3950Servers, function( server_id, server ) { |
|
|
470 |
if ( !server.enabled ) return; |
| 452 |
$('#advanced-search-servers').append( '<li data-server-id="' + server_id + '"><label><input class="search-toggle-server" type="checkbox"' + ( server.checked ? ' checked="checked">' : '>' ) + server.name + '</label></li>' ); |
471 |
$('#advanced-search-servers').append( '<li data-server-id="' + server_id + '"><label><input class="search-toggle-server" type="checkbox"' + ( server.checked ? ' checked="checked">' : '>' ) + server.name + '</label></li>' ); |
| 453 |
} ); |
472 |
} ); |
| 454 |
$('#advanced-search-ui').modal('show'); |
473 |
$('#advanced-search-ui').modal('show'); |
|
Lines 667-675
require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
Link Here
|
| 667 |
switch (pref) { |
686 |
switch (pref) { |
| 668 |
case 'enabledBatches': |
687 |
case 'enabledBatches': |
| 669 |
$.each( editable_batches, function( batch_id, batch ) { |
688 |
$.each( editable_batches, function( batch_id, batch ) { |
| 670 |
$( '#batches-list li[data-batch-id=' + batch_id + '] input' )[0].checked = Preferences.user.enabledBatches[batch_id]; |
689 |
$( '#batches-table tr[data-batch-id=' + batch_id + '] input.is-save-target' )[0].checked = Preferences.user.enabledBatches[batch_id]; |
| 671 |
setSaveTargetEnabled( 'batch:' + batch_id + '/', Preferences.user.enabledBatches[batch_id] || false ); |
690 |
setSaveTargetEnabled( 'batch:' + batch_id + '/', Preferences.user.enabledBatches[batch_id] || false ); |
| 672 |
} ); |
691 |
} ); |
|
|
692 |
case 'enabledSearchBatches': |
| 693 |
$.each( editable_batches, function( batch_id, batch ) { |
| 694 |
$( '#batches-table tr[data-batch-id=' + batch_id + '] input.is-searchable' )[0].checked = Preferences.user.enabledSearchBatches[batch_id]; |
| 695 |
setSearchTargetEnabled( 'batch:' + batch_id, Preferences.user.enabledSearchBatches[batch_id] || false ); |
| 696 |
} ); |
| 673 |
case 'fieldWidgets': |
697 |
case 'fieldWidgets': |
| 674 |
$( '#set-field-widgets' ).text( value ? _("Show fields verbatim") : _("Show helpers for fixed and coded fields") ); |
698 |
$( '#set-field-widgets' ).text( value ? _("Show fields verbatim") : _("Show helpers for fixed and coded fields") ); |
| 675 |
break; |
699 |
break; |
|
Lines 722-729
require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
Link Here
|
| 722 |
|
746 |
|
| 723 |
switch (pref) { |
747 |
switch (pref) { |
| 724 |
case 'enabledBatches': |
748 |
case 'enabledBatches': |
| 725 |
_addLiveHandler( '#batches-list input', 'change', function() { |
749 |
_addLiveHandler( '#batches-table input.is-save-target', 'change', function() { |
| 726 |
Preferences.user.enabledBatches[ $( this ).closest('li').data('batch-id') ] = this.checked; |
750 |
Preferences.user.enabledBatches[ $( this ).closest('tr').data('batch-id') ] = this.checked; |
|
|
751 |
} ); |
| 752 |
break; |
| 753 |
case 'enabledSearchBatches': |
| 754 |
_addLiveHandler( '#batches-table input.is-searchable', 'change', function() { |
| 755 |
Preferences.user.enabledSearchBatches[ $( this ).closest('tr').data('batch-id') ] = this.checked; |
| 727 |
} ); |
756 |
} ); |
| 728 |
break; |
757 |
break; |
| 729 |
case 'fieldWidgets': |
758 |
case 'fieldWidgets': |
|
Lines 880-893
require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
Link Here
|
| 880 |
}; |
909 |
}; |
| 881 |
|
910 |
|
| 882 |
// Build batch UI |
911 |
// Build batch UI |
| 883 |
var $batch_entry = $( '<li data-batch-id="' + batch.batch_id + '"><input type="checkbox" />' + batch.name + '</li>' ); |
912 |
var $batch_entry = $( '<tr data-batch-id="' + batch.batch_id + '"><td>' + batch.name + '</td><td><input type="checkbox" class="is-searchable" /></td><td><input type="checkbox" class="is-save-target" /></td></tr>' ); |
| 884 |
|
913 |
|
| 885 |
var $batch_buttons = $('<span class="batch-buttons"></span>').appendTo($batch_entry); |
914 |
var $batch_buttons = $('<td class="batch-buttons"></td>').appendTo($batch_entry); |
| 886 |
var $export_button = $( '<button>' + _("Export...") + '</button>' ).appendTo($batch_buttons).click( function() { |
915 |
var $export_button = $( '<button>' + _("Export...") + '</button>' ).appendTo($batch_buttons).click( function() { |
| 887 |
$('#batches-list .batch-export').hide(); |
916 |
$('#batches-table .batch-export').hide(); |
| 888 |
$export_screen.show(); |
917 |
$export_screen.show(); |
| 889 |
} ); |
918 |
} ); |
| 890 |
|
919 |
|
|
|
920 |
timestamp_pattern = '\\d{4}(0\\d|1[012])([012]\\d|3[01])(([01]\\d|2[0-3])[0-5]\\d[0-5]\\d)?' |
| 921 |
|
| 891 |
var $export_screen = $( |
922 |
var $export_screen = $( |
| 892 |
'<form class="batch-export form-horizontal" style="display: none">' |
923 |
'<form class="batch-export form-horizontal" style="display: none">' |
| 893 |
+ '<div class="control-group">' |
924 |
+ '<div class="control-group">' |
|
Lines 895-908
require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
Link Here
|
| 895 |
+ '<div class="controls"><input class="batch-control-number-start" type="text"> - <input class="batch-control-number-end" type="text"></div>' |
926 |
+ '<div class="controls"><input class="batch-control-number-start" type="text"> - <input class="batch-control-number-end" type="text"></div>' |
| 896 |
+ '</div>' |
927 |
+ '</div>' |
| 897 |
+ '<label class="control-label">' + _("Timestamp range (YYYYMMDD or YYYMMDDHHMMSS):") + '</label>' |
928 |
+ '<label class="control-label">' + _("Timestamp range (YYYYMMDD or YYYMMDDHHMMSS):") + '</label>' |
| 898 |
+ '<div class="controls"><input class="batch-timestamp-start" type="text"> - <input class="batch-timestamp-end" type="text"></div>' |
929 |
+ '<div class="controls"><input class="batch-timestamp-start" type="text" pattern="' + timestamp_pattern + '"> - <input class="batch-timestamp-end" type="text" pattern="' + timestamp_pattern + '"></div>' |
| 899 |
+ '</div>' |
930 |
+ '</div>' |
| 900 |
+ '<div class="control-group">' |
931 |
+ '<div class="control-group">' |
| 901 |
+ '<div class="controls"><button class="batch-export-start">' + _("Start export") + '</div>' |
932 |
+ '<div class="controls"><button class="batch-export-start">' + _("Start export") + '</div>' |
| 902 |
+ '</form>' |
933 |
+ '</form>' |
| 903 |
).appendTo($batch_entry); |
934 |
).appendTo($batch_buttons); |
| 904 |
|
935 |
|
| 905 |
$export_screen.find('.batch-export-start').click( function() { |
936 |
$export_screen.submit( function() { |
| 906 |
function getFormVal(name) { |
937 |
function getFormVal(name) { |
| 907 |
return $export_screen.find( '.batch-' + name ).val(); |
938 |
return $export_screen.find( '.batch-' + name ).val(); |
| 908 |
} |
939 |
} |
|
Lines 917-923
require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
Link Here
|
| 917 |
KohaBackend.StartBatchExport( batch.batch_id, options ); |
948 |
KohaBackend.StartBatchExport( batch.batch_id, options ); |
| 918 |
} ); |
949 |
} ); |
| 919 |
|
950 |
|
| 920 |
$('#batches-list').append( $batch_entry ); |
951 |
$('#batches-table tbody').append( $batch_entry ); |
| 921 |
} |
952 |
} |
| 922 |
|
953 |
|
| 923 |
$(document).ready( function() { |
954 |
$(document).ready( function() { |