Bugzilla – Attachment 66884 Details for
Bug 18823
Advanced editor - Rancor - add ability to edit records in import batches
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18823: Rancor - Allow searching of batches to be enabled/disabled
Bug-18823-Rancor---Allow-searching-of-batches-to-b.patch (text/plain), 10.36 KB, created by
Nick Clemens (kidclamp)
on 2017-09-06 14:38:39 UTC
(
hide
)
Description:
Bug 18823: Rancor - Allow searching of batches to be enabled/disabled
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2017-09-06 14:38:39 UTC
Size:
10.36 KB
patch
obsolete
>From feae7989f696e41f73d64d84d192de3c877ecfb1 Mon Sep 17 00:00:00 2001 >From: Jesse Weaver <jweaver@bywatersolutions.com> >Date: Mon, 14 Mar 2016 10:38:53 -0600 >Subject: [PATCH] Bug 18823: Rancor - Allow searching of batches to be > enabled/disabled > >To test: >1 - Open advanced cataloging editor (rancor) >2 - Under settings select 'import batches' >3 - Select some branches for search and some as save targets >4 - Verify the options work as expected >(Note: empty batches cannot be searched) >--- > .../lib/koha/cateditor/preferences.js | 1 + > .../prog/en/includes/cateditor-ui.inc | 51 +++++++++++++++++----- > .../prog/en/modules/cataloguing/editor.tt | 17 ++++++-- > 3 files changed, 56 insertions(+), 13 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/preferences.js b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/preferences.js >index d684934..00121d8 100644 >--- a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/preferences.js >+++ b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/preferences.js >@@ -30,6 +30,7 @@ define( function() { > Preferences.user = $.extend( { > // Preference defaults > enabledBatches: {}, >+ enabledSearchBatches: {}, > fieldWidgets: true, > font: 'monospace', > fontSize: '1em', >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc >index 584f0c0..44571ef 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc >@@ -27,6 +27,7 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr > 'koha:biblioserver': { > name: _("Local catalog"), > recordtype: 'biblio', >+ enabled: true, > checked: false, > }, > [%- FOREACH batch = editable_batches -%] >@@ -41,6 +42,7 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr > name: '[% server.servername %]', > recordtype: '[% server.recordtype %]', > checked: [% server.checked ? 'true' : 'false' %], >+ enabled: true, > }, > [%- END -%] > }; >@@ -350,6 +352,22 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr > $( '#save-targets input[data-target-id="' + target_id + '"]' ).closest('li').toggle(enabled); > } > >+ function setSearchTargetChecked( server_id, checked ) { >+ if ( z3950Servers[server_id] == null ) return; >+ >+ z3950Servers[server_id].checked = checked; >+ $( '.search-target-list li[data-server-id="' + server_id + '"] input' ).prop('checked', checked); >+ } >+ >+ function setSearchTargetEnabled( server_id, enabled ) { >+ if ( !enabled ) { >+ setSearchTargetChecked( server_id, false ); >+ } >+ >+ z3950Servers[server_id].enabled = enabled; >+ $( '.search-target-list li[data-server-id="' + server_id + '"]' ).toggle(enabled); >+ } >+ > function setSource(parts) { > state.backend = parts[0]; > state.recordID = parts[1]; >@@ -449,6 +467,7 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr > function showAdvancedSearch() { > $('#advanced-search-servers').empty(); > $.each( z3950Servers, function( server_id, server ) { >+ if ( !server.enabled ) return; > $('#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>' ); > } ); > $('#advanced-search-ui').modal('show'); >@@ -667,9 +686,14 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr > switch (pref) { > case 'enabledBatches': > $.each( editable_batches, function( batch_id, batch ) { >- $( '#batches-list li[data-batch-id=' + batch_id + '] input' )[0].checked = Preferences.user.enabledBatches[batch_id]; >+ $( '#batches-table tr[data-batch-id=' + batch_id + '] input.is-save-target' )[0].checked = Preferences.user.enabledBatches[batch_id]; > setSaveTargetEnabled( 'batch:' + batch_id + '/', Preferences.user.enabledBatches[batch_id] || false ); > } ); >+ case 'enabledSearchBatches': >+ $.each( editable_batches, function( batch_id, batch ) { >+ $( '#batches-table tr[data-batch-id=' + batch_id + '] input.is-searchable' )[0].checked = Preferences.user.enabledSearchBatches[batch_id]; >+ setSearchTargetEnabled( 'batch:' + batch_id, Preferences.user.enabledSearchBatches[batch_id] || false ); >+ } ); > case 'fieldWidgets': > $( '#set-field-widgets' ).text( value ? _("Show fields verbatim") : _("Show helpers for fixed and coded fields") ); > break; >@@ -722,8 +746,13 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr > > switch (pref) { > case 'enabledBatches': >- _addLiveHandler( '#batches-list input', 'change', function() { >- Preferences.user.enabledBatches[ $( this ).closest('li').data('batch-id') ] = this.checked; >+ _addLiveHandler( '#batches-table input.is-save-target', 'change', function() { >+ Preferences.user.enabledBatches[ $( this ).closest('tr').data('batch-id') ] = this.checked; >+ } ); >+ break; >+ case 'enabledSearchBatches': >+ _addLiveHandler( '#batches-table input.is-searchable', 'change', function() { >+ Preferences.user.enabledSearchBatches[ $( this ).closest('tr').data('batch-id') ] = this.checked; > } ); > break; > case 'fieldWidgets': >@@ -880,14 +909,16 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr > }; > > // Build batch UI >- var $batch_entry = $( '<li data-batch-id="' + batch.batch_id + '"><input type="checkbox" />' + batch.name + '</li>' ); >+ 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>' ); > >- var $batch_buttons = $('<span class="batch-buttons"></span>').appendTo($batch_entry); >+ var $batch_buttons = $('<td class="batch-buttons"></td>').appendTo($batch_entry); > var $export_button = $( '<button>' + _("Export...") + '</button>' ).appendTo($batch_buttons).click( function() { >- $('#batches-list .batch-export').hide(); >+ $('#batches-table .batch-export').hide(); > $export_screen.show(); > } ); > >+ timestamp_pattern = '\\d{4}(0\\d|1[012])([012]\\d|3[01])(([01]\\d|2[0-3])[0-5]\\d[0-5]\\d)?' >+ > var $export_screen = $( > '<form class="batch-export form-horizontal" style="display: none">' > + '<div class="control-group">' >@@ -895,14 +926,14 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr > + '<div class="controls"><input class="batch-control-number-start" type="text"> - <input class="batch-control-number-end" type="text"></div>' > + '</div>' > + '<label class="control-label">' + _("Timestamp range (YYYYMMDD or YYYMMDDHHMMSS):") + '</label>' >- + '<div class="controls"><input class="batch-timestamp-start" type="text"> - <input class="batch-timestamp-end" type="text"></div>' >+ + '<div class="controls"><input class="batch-timestamp-start" type="text" pattern="' + timestamp_pattern + '"> - <input class="batch-timestamp-end" type="text" pattern="' + timestamp_pattern + '"></div>' > + '</div>' > + '<div class="control-group">' > + '<div class="controls"><button class="batch-export-start">' + _("Start export") + '</div>' > + '</form>' >- ).appendTo($batch_entry); >+ ).appendTo($batch_buttons); > >- $export_screen.find('.batch-export-start').click( function() { >+ $export_screen.submit( function() { > function getFormVal(name) { > return $export_screen.find( '.batch-' + name ).val(); > } >@@ -917,7 +948,7 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr > KohaBackend.StartBatchExport( batch.batch_id, options ); > } ); > >- $('#batches-list').append( $batch_entry ); >+ $('#batches-table tbody').append( $batch_entry ); > } > > $(document).ready( function() { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/editor.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/editor.tt >index e6441cb..d3e8e3d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/editor.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/editor.tt >@@ -119,7 +119,7 @@ > <div class="col-md-3"> > <div id="search-facets"> > <ul> >- <li>Servers:<ul id="advanced-search-servers"></ul></li> >+ <li>Servers:<ul id="advanced-search-servers" class="search-target-list"></ul></li> > </ul> > </div> > </div> >@@ -200,7 +200,7 @@ > <div class="col-md-3"> > <div id="search-facets"> > <ul> >- <li>Servers:<ul id="search-serversinfo"></ul></li> >+ <li>Servers:<ul id="search-serversinfo" class="search-target-list"></ul></li> > </ul> > </div> > </div> >@@ -272,7 +272,18 @@ > <button class="btn btn-small" type="submit" id="create-batch"><i class="icon-plus"></i> <span>Create new batch...</span></button> > <button class="btn btn-small" type="submit" id="manage-batches"><i class="icon-list"></i> <span>Manage import batches...</span></button> > </div> >- <ul id="batches-list"></ul> >+ <table id="batches-table"> >+ <thead> >+ <tr> >+ <th>Batch</th> >+ <th>Searchable?</th> >+ <th>Save target?</th> >+ <th> </th> >+ </tr> >+ </thead> >+ <tbody> >+ </tbody> >+ </table> > </div> > <div class="span3"> > </div> >-- >2.7.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18823
:
64434
|
66882
|
66883
|
66884
|
66885
|
66919
|
77240
|
77241
|
77242
|
77243
|
77244
|
79240
|
79241
|
79242
|
79243
|
79244
|
80519
|
80536
|
80604
|
80606
|
80608
|
80613
|
80626
|
80627
|
80628
|
80637
|
80639
|
80651
|
80861
|
80866
|
80868
|
80869
|
80870
|
80871
|
80872
|
80873
|
80947
|
85355
|
85356
|
85357
|
85358
|
85359
|
85376
|
85719
|
85720
|
85785
|
85828
|
86087
|
86173
|
86174
|
86175
|
86176
|
86177
|
86178
|
86179
|
86180
|
86181
|
86182
|
86183
|
86791
|
86792
|
86793
|
86794
|
86795
|
86796
|
86797
|
86798
|
86799
|
88417
|
88418
|
88419
|
88420
|
88421
|
88422
|
88423
|
88424
|
88425
|
88426
|
88427
|
88428
|
88429
|
88430
|
88431
|
88432
|
88493
|
88494
|
88495
|
88496
|
88497
|
88498
|
88499
|
88500
|
88501
|
88502
|
88503
|
88504
|
88505
|
88506
|
88507
|
88508
|
91205
|
91206
|
91207
|
91208
|
91209
|
91210
|
91211
|
91212
|
91213
|
91214
|
91215
|
91216
|
91217
|
91218
|
91219
|
92051
|
92120
|
92124
|
94436
|
94437
|
94438
|
94439
|
94440
|
94441
|
94442
|
94443
|
94444
|
94445
|
94446
|
94447
|
94448
|
94449
|
94450
|
94451
|
94452
|
99092
|
99093
|
99094
|
99095
|
99096
|
99097
|
99098
|
99099
|
99100
|
99101
|
99102
|
99103
|
99104
|
99105
|
99106
|
99107
|
99108
|
99109