View | Details | Raw Unified | Return to bug 23349
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (+10 lines)
Lines 165-170 Link Here
165
                                <div class="btn-group">
165
                                <div class="btn-group">
166
                                    <a class="btn btn-default btn-xs" id="z3950submit" href="#"><i class="fa fa-search"></i> Z39.50/SRU search</a>
166
                                    <a class="btn btn-default btn-xs" id="z3950submit" href="#"><i class="fa fa-search"></i> Z39.50/SRU search</a>
167
                                </div>
167
                                </div>
168
                                <div class="btn-group">
169
                                    <button type="button" id="results_batch_ops" class="btn btn-default btn-xs dropdown-toggle disabled" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
170
                                        <i class="fa fa-pencil"></i> Edit <span class="caret"></span>
171
                                    </button>
172
                                    <ul class="dropdown-menu">
173
                                        <li><a class="results_batch_op" data-op="edit" href="#">Batch edit</a></li>
174
                                        <li><a class="results_batch_op" data-op="delete" href="#">Batch delete</a></li>
175
                                        <li><a class="results_batch_op" data-op="merge" href="#">Merge records</a></li>
176
                                    </ul>
177
                                </div>
168
                            [% END %]
178
                            [% END %]
169
179
170
                            [% IF ( searchdesc ) %]
180
                            [% IF ( searchdesc ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/pages/results.js (-2 / +67 lines)
Lines 1-4 Link Here
1
/* global KOHA biblionumber new_results_browser addMultiple vShelfAdd openWindow search_result SEARCH_RESULTS PREF_AmazonCoverImages PREF_LocalCoverImages PREF_IntranetCoce PREF_CoceProviders CoceHost CoceProviders addRecord delSingleRecord PREF_BrowseResultSelection resetSearchContext addBibToContext delBibToContext getContextBiblioNumbers MSG_NO_ITEM_SELECTED MSG_NO_ITEM_SELECTED holdfor_cardnumber holdforclub strQuery MSG_NON_RESERVES_SELECTED PREF_NotHighlightedWords PLACE_HOLD */
1
/* global KOHA biblionumber new_results_browser addMultiple vShelfAdd openWindow search_result SEARCH_RESULTS PREF_AmazonCoverImages PREF_LocalCoverImages PREF_IntranetCoce PREF_CoceProviders CoceHost CoceProviders addRecord delSingleRecord PREF_BrowseResultSelection resetSearchContext addBibToContext delBibToContext getContextBiblioNumbers MSG_NO_ITEM_SELECTED MSG_NO_ITEM_SELECTED holdfor_cardnumber holdforclub strQuery MSG_NON_RESERVES_SELECTED PREF_NotHighlightedWords PLACE_HOLD _ */
2
2
3
if( PREF_AmazonCoverImages ){
3
if( PREF_AmazonCoverImages ){
4
    $(window).load(function() {
4
    $(window).load(function() {
Lines 152-157 $(document).ready(function() { Link Here
152
    }
152
    }
153
153
154
    $(".selection").change(function(){
154
    $(".selection").change(function(){
155
        if( $(".selection:checked").length > 0 ){
156
            toggleBatchOp( true );
157
        } else {
158
            toggleBatchOp( false );
159
        }
155
        if ( $(this).is(':checked') == true ) {
160
        if ( $(this).is(':checked') == true ) {
156
            addBibToContext( $(this).val() );
161
            addBibToContext( $(this).val() );
157
        } else {
162
        } else {
Lines 170-175 $(document).ready(function() { Link Here
170
            }
175
            }
171
        }
176
        }
172
    });
177
    });
178
179
    if( $(".selection:checked") > 0 ){
180
        toggleBatchOp( true );
181
    }
182
183
    $(".results_batch_op").on("click", function(e){
184
        e.preventDefault();
185
        var op = $(this).data("op");
186
        resultsBatchProcess( op );
187
    });
173
});
188
});
174
189
175
190
Lines 306-308 function verify_images() { Link Here
306
        }
321
        }
307
    });
322
    });
308
}
323
}
309
- 
324
325
function toggleBatchOp( b ){
326
    var results_batch_ops = $("#results_batch_ops");
327
    if( b ){
328
        results_batch_ops.removeClass("disabled");
329
    } else {
330
        results_batch_ops.addClass("disabled");
331
    }
332
}
333
334
function resultsBatchProcess( op ){
335
    var selected = $(".selection:checked");
336
    var params = [];
337
    var url = "";
338
    if( op == "edit" ){
339
        // batch edit selected records
340
        if ( selected.length < 1 ){
341
            alert( _("You must select at least one record") );
342
        } else {
343
            selected.each(function() {
344
                params.push( $(this).val() );
345
            });
346
            url = "/cgi-bin/koha/tools/batch_record_modification.pl?op=list&amp;bib_list=" + params.join("/");
347
            location.href = url;
348
        }
349
    } else if( op == "delete" ){
350
        // batch delete selected records
351
        if ( selected.length < 2) {
352
            alert( _("You must select at least one record") );
353
        } else {
354
            selected.each(function() {
355
                params.push( $(this).val() );
356
            });
357
            url = "/cgi-bin/koha/tools/batch_delete_records.pl?op=list&type=biblio&bib_list=" + params.join("/");
358
            location.href = url;
359
        }
360
    } else if( op == "merge" ){
361
        // merge selected records
362
        if ( selected.length < 2) {
363
            alert( _("At least two records must be selected for merging") );
364
        } else {
365
            selected.each(function() {
366
                params.push('biblionumber=' + $(this).val());
367
            });
368
            url = "/cgi-bin/koha/cataloguing/merge.pl?" + params.join("&");
369
            location.href = url;
370
        }
371
    } else {
372
        return false;
373
    }
374
}

Return to bug 23349