| Lines 35-40
          require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
      
      
        Link Here | 
        
          | 35 |         'koha:biblioserver': { | 35 |         'koha:biblioserver': { | 
        
          | 36 |             name: _("Local catalog"), | 36 |             name: _("Local catalog"), | 
        
          | 37 |             recordtype: 'biblio', | 37 |             recordtype: 'biblio', | 
            
              |  |  | 38 |             enabled: true, | 
        
          | 38 |             checked: false, | 39 |             checked: false, | 
        
          | 39 |         }, | 40 |         }, | 
        
          | 40 |         [%- FOREACH batch = editable_batches -%] | 41 |         [%- FOREACH batch = editable_batches -%] | 
  
    | Lines 49-54
          require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
      
      
        Link Here | 
        
          | 49 |                 name: '[% server.servername %]', | 50 |                 name: '[% server.servername %]', | 
        
          | 50 |                 recordtype: '[% server.recordtype %]', | 51 |                 recordtype: '[% server.recordtype %]', | 
        
          | 51 |                 checked: [% server.checked ? 'true' : 'false' %], | 52 |                 checked: [% server.checked ? 'true' : 'false' %], | 
            
              |  |  | 53 |                 enabled: true, | 
        
          | 52 |             }, | 54 |             }, | 
        
          | 53 |         [%- END -%] | 55 |         [%- END -%] | 
        
          | 54 |     }; | 56 |     }; | 
  
    | Lines 358-363
          require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
      
      
        Link Here | 
        
          | 358 |         $( '#save-targets input[data-target-id="' + target_id + '"]' ).closest('li').toggle(enabled); | 360 |         $( '#save-targets input[data-target-id="' + target_id + '"]' ).closest('li').toggle(enabled); | 
        
          | 359 |     } | 361 |     } | 
        
          | 360 |  | 362 |  | 
            
              |  |  | 363 |     function setSearchTargetChecked( server_id, checked ) { | 
            
              | 364 |         if ( z3950Servers[server_id] == null ) return; | 
            
              | 365 |  | 
            
              | 366 |         z3950Servers[server_id].checked = checked; | 
            
              | 367 |         $( '.search-target-list li[data-server-id="' + server_id + '"] input' ).prop('checked', checked); | 
            
              | 368 |     } | 
            
              | 369 |  | 
            
              | 370 |     function setSearchTargetEnabled( server_id, enabled ) { | 
            
              | 371 |         if ( !enabled ) { | 
            
              | 372 |             setSearchTargetChecked( server_id, false ); | 
            
              | 373 |         } | 
            
              | 374 |  | 
            
              | 375 |         z3950Servers[server_id].enabled = enabled; | 
            
              | 376 |         $( '.search-target-list li[data-server-id="' + server_id + '"]' ).toggle(enabled); | 
            
              | 377 |     } | 
            
              | 378 |  | 
        
          | 361 |     function setSource(parts) { | 379 |     function setSource(parts) { | 
        
          | 362 |         state.backend = parts[0]; | 380 |         state.backend = parts[0]; | 
        
          | 363 |         state.recordID = parts[1]; | 381 |         state.recordID = parts[1]; | 
  
    | Lines 457-462
          require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
      
      
        Link Here | 
        
          | 457 |     function showAdvancedSearch() { | 475 |     function showAdvancedSearch() { | 
        
          | 458 |         $('#advanced-search-servers').empty(); | 476 |         $('#advanced-search-servers').empty(); | 
        
          | 459 |         $.each( z3950Servers, function( server_id, server ) { | 477 |         $.each( z3950Servers, function( server_id, server ) { | 
            
              |  |  | 478 |             if ( !server.enabled ) return; | 
        
          | 460 |             $('#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>' ); | 479 |             $('#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>' ); | 
        
          | 461 |         } ); | 480 |         } ); | 
        
          | 462 |         $('#advanced-search-ui').modal('show'); | 481 |         $('#advanced-search-ui').modal('show'); | 
  
    | Lines 675-683
          require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
      
      
        Link Here | 
        
          | 675 |         switch (pref) { | 694 |         switch (pref) { | 
        
          | 676 |             case 'enabledBatches': | 695 |             case 'enabledBatches': | 
        
          | 677 |                 $.each( editable_batches, function( batch_id, batch ) { | 696 |                 $.each( editable_batches, function( batch_id, batch ) { | 
          
            
              | 678 |                     $( '#batches-list li[data-batch-id=' + batch_id + '] input' )[0].checked = Preferences.user.enabledBatches[batch_id]; | 697 |                     $( '#batches-table tr[data-batch-id=' + batch_id + '] input.is-save-target' )[0].checked = Preferences.user.enabledBatches[batch_id]; | 
        
          | 679 |                     setSaveTargetEnabled( 'batch:' + batch_id + '/', Preferences.user.enabledBatches[batch_id] || false ); | 698 |                     setSaveTargetEnabled( 'batch:' + batch_id + '/', Preferences.user.enabledBatches[batch_id] || false ); | 
        
          | 680 |                 } ); | 699 |                 } ); | 
            
              |  |  | 700 |             case 'enabledSearchBatches': | 
            
              | 701 |                 $.each( editable_batches, function( batch_id, batch ) { | 
            
              | 702 |                     $( '#batches-table tr[data-batch-id=' + batch_id + '] input.is-searchable' )[0].checked = Preferences.user.enabledSearchBatches[batch_id]; | 
            
              | 703 |                     setSearchTargetEnabled( 'batch:' + batch_id, Preferences.user.enabledSearchBatches[batch_id] || false ); | 
            
              | 704 |                 } ); | 
        
          | 681 |             case 'fieldWidgets': | 705 |             case 'fieldWidgets': | 
        
          | 682 |                 $( '#set-field-widgets' ).text( value ? _("Show fields verbatim") : _("Show helpers for fixed and coded fields") ); | 706 |                 $( '#set-field-widgets' ).text( value ? _("Show fields verbatim") : _("Show helpers for fixed and coded fields") ); | 
        
          | 683 |                 break; | 707 |                 break; | 
  
    | Lines 730-737
          require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
      
      
        Link Here | 
        
          | 730 |  | 754 |  | 
        
          | 731 |         switch (pref) { | 755 |         switch (pref) { | 
        
          | 732 |             case 'enabledBatches': | 756 |             case 'enabledBatches': | 
          
            
              | 733 |                 _addLiveHandler( '#batches-list input', 'change', function() { | 757 |                 _addLiveHandler( '#batches-table input.is-save-target', 'change', function() { | 
            
              | 734 |                     Preferences.user.enabledBatches[ $( this ).closest('li').data('batch-id') ] = this.checked; | 758 |                     Preferences.user.enabledBatches[ $( this ).closest('tr').data('batch-id') ] = this.checked; | 
            
              |  |  | 759 |                 } ); | 
            
              | 760 |                 break; | 
            
              | 761 |             case 'enabledSearchBatches': | 
            
              | 762 |                 _addLiveHandler( '#batches-table input.is-searchable', 'change', function() { | 
            
              | 763 |                     Preferences.user.enabledSearchBatches[ $( this ).closest('tr').data('batch-id') ] = this.checked; | 
        
          | 735 |                 } ); | 764 |                 } ); | 
        
          | 736 |                 break; | 765 |                 break; | 
        
          | 737 |             case 'fieldWidgets': | 766 |             case 'fieldWidgets': | 
  
    | Lines 888-901
          require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
      
      
        Link Here | 
        
          | 888 |         }; | 917 |         }; | 
        
          | 889 |  | 918 |  | 
        
          | 890 |         // Build batch UI | 919 |         // Build batch UI | 
          
            
              | 891 |         var $batch_entry = $( '<li data-batch-id="' + batch.batch_id + '"><input type="checkbox" />' + batch.name + '</li>' ); | 920 |         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>' ); | 
        
          | 892 |  | 921 |  | 
          
            
              | 893 |         var $batch_buttons = $('<span class="batch-buttons"></span>').appendTo($batch_entry); | 922 |         var $batch_buttons = $('<td class="batch-buttons"></td>').appendTo($batch_entry); | 
        
          | 894 |         var $export_button = $( '<button>' + _("Export...") + '</button>' ).appendTo($batch_buttons).click( function() { | 923 |         var $export_button = $( '<button>' + _("Export...") + '</button>' ).appendTo($batch_buttons).click( function() { | 
          
            
              | 895 |             $('#batches-list .batch-export').hide(); | 924 |             $('#batches-table .batch-export').hide(); | 
        
          | 896 |             $export_screen.show(); | 925 |             $export_screen.show(); | 
        
          | 897 |         } ); | 926 |         } ); | 
        
          | 898 |  | 927 |  | 
            
              |  |  | 928 |         timestamp_pattern = '\\d{4}(0\\d|1[012])([012]\\d|3[01])(([01]\\d|2[0-3])[0-5]\\d[0-5]\\d)?' | 
            
              | 929 |  | 
        
          | 899 |         var $export_screen = $( | 930 |         var $export_screen = $( | 
        
          | 900 |             '<form class="batch-export form-horizontal" style="display: none">' | 931 |             '<form class="batch-export form-horizontal" style="display: none">' | 
        
          | 901 |             + '<div class="control-group">' | 932 |             + '<div class="control-group">' | 
  
    | Lines 903-916
          require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
      
      
        Link Here | 
        
          | 903 |             + '<div class="controls"><input class="batch-control-number-start" type="text"> - <input class="batch-control-number-end" type="text"></div>' | 934 |             + '<div class="controls"><input class="batch-control-number-start" type="text"> - <input class="batch-control-number-end" type="text"></div>' | 
        
          | 904 |             + '</div>' | 935 |             + '</div>' | 
        
          | 905 |             + '<label class="control-label">' + _("Timestamp range (YYYYMMDD or YYYMMDDHHMMSS):") + '</label>' | 936 |             + '<label class="control-label">' + _("Timestamp range (YYYYMMDD or YYYMMDDHHMMSS):") + '</label>' | 
          
            
              | 906 |             + '<div class="controls"><input class="batch-timestamp-start" type="text"> - <input class="batch-timestamp-end" type="text"></div>' | 937 |             + '<div class="controls"><input class="batch-timestamp-start" type="text" pattern="' + timestamp_pattern + '"> - <input class="batch-timestamp-end" type="text" pattern="' + timestamp_pattern + '"></div>' | 
        
          | 907 |             + '</div>' | 938 |             + '</div>' | 
        
          | 908 |             + '<div class="control-group">' | 939 |             + '<div class="control-group">' | 
        
          | 909 |             + '<div class="controls"><button class="batch-export-start">' + _("Start export") + '</div>' | 940 |             + '<div class="controls"><button class="batch-export-start">' + _("Start export") + '</div>' | 
        
          | 910 |             + '</form>' | 941 |             + '</form>' | 
          
            
              | 911 |         ).appendTo($batch_entry); | 942 |         ).appendTo($batch_buttons); | 
        
          | 912 |  | 943 |  | 
          
            
              | 913 |         $export_screen.find('.batch-export-start').click( function() { | 944 |         $export_screen.submit( function() { | 
        
          | 914 |             function getFormVal(name) { | 945 |             function getFormVal(name) { | 
        
          | 915 |                 return $export_screen.find( '.batch-' + name ).val(); | 946 |                 return $export_screen.find( '.batch-' + name ).val(); | 
        
          | 916 |             } | 947 |             } | 
  
    | Lines 925-931
          require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
      
      
        Link Here | 
        
          | 925 |             KohaBackend.StartBatchExport( batch.batch_id, options ); | 956 |             KohaBackend.StartBatchExport( batch.batch_id, options ); | 
        
          | 926 |         } ); | 957 |         } ); | 
        
          | 927 |  | 958 |  | 
          
            
              | 928 |         $('#batches-list').append( $batch_entry ); | 959 |         $('#batches-table tbody').append( $batch_entry ); | 
        
          | 929 |     } | 960 |     } | 
        
          | 930 |  | 961 |  | 
        
          | 931 |     $(document).ready( function() { | 962 |     $(document).ready( function() { |