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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt (-8 lines)
Lines 482-488 $(document).ready(function() { Link Here
482
        //Clear all form cookies
482
        //Clear all form cookies
483
        jQuery.removeCookie("form_serialized", { path: '/'});
483
        jQuery.removeCookie("form_serialized", { path: '/'});
484
        jQuery.removeCookie("form_serialized_limits", { path: '/'});
484
        jQuery.removeCookie("form_serialized_limits", { path: '/'});
485
        jQuery.removeCookie("num_paragraph", { path: '/'});
486
        jQuery.removeCookie("search_path_code", { path: '/'});
485
        jQuery.removeCookie("search_path_code", { path: '/'});
487
    [% END %]
486
    [% END %]
488
    $('#advsearch form').submit(function() {
487
    $('#advsearch form').submit(function() {
Lines 508-523 $(document).ready(function() { Link Here
508
        ];
507
        ];
509
        jQuery.cookie("form_serialized_limits", form_serialized_limits,{ path: '/'});
508
        jQuery.cookie("form_serialized_limits", form_serialized_limits,{ path: '/'});
510
        [% IF ( expanded_options ) %]
509
        [% IF ( expanded_options ) %]
511
        var numPar = $("#booleansearch fieldset p").size();
512
        if (numPar > [% search_boxes_count | html %]){
513
            jQuery.cookie("num_paragraph", numPar,{ path: '/'});
514
        }else{
515
            jQuery.removeCookie("num_paragraph", { path: '/'});
516
        }
517
        jQuery.cookie("search_path_code", 'exs',{ path: '/'});
510
        jQuery.cookie("search_path_code", 'exs',{ path: '/'});
518
        [% ELSE %]
511
        [% ELSE %]
519
        jQuery.cookie("search_path_code", 'ads',{ path: '/'});
512
        jQuery.cookie("search_path_code", 'ads',{ path: '/'});
520
        jQuery.removeCookie("num_paragraph", { path: '/'});
521
        [% END %]
513
        [% END %]
522
    });
514
    });
523
515
(-)a/opac/opac-search.pl (-38 lines)
Lines 312-354 if ( $template_type && $template_type eq 'advsearch' ) { Link Here
312
        $template->param( sort_by => $default_sort_by );
312
        $template->param( sort_by => $default_sort_by );
313
    }
313
    }
314
314
315
    # determine what to display next to the search boxes (ie, boolean option
316
    # shouldn't appear on the first one, scan indexes should, adding a new
317
    # box should only appear on the last, etc.
318
    my @search_boxes_array;
319
    my $search_boxes_count = 3; # begin with 3 boxes
320
    $template->param( search_boxes_count => $search_boxes_count );
321
322
    if ($cgi->cookie("num_paragraph")){
323
        $search_boxes_count = $cgi->cookie("num_paragraph");
324
    }
325
326
    for (my $i=1;$i<=$search_boxes_count;$i++) {
327
        # if it's the first one, don't display boolean option, but show scan indexes
328
        if ($i==1) {
329
            push @search_boxes_array,
330
                {
331
                scan_index => 1,
332
                };
333
        
334
        }
335
        # if it's the last one, show the 'add field' box
336
        elsif ($i==$search_boxes_count) {
337
            push @search_boxes_array,
338
                {
339
                boolean => 1,
340
                add_field => 1,
341
                };
342
        }
343
        else {
344
            push @search_boxes_array,
345
                {
346
                boolean => 1,
347
                };
348
        }
349
350
    }
351
352
    my @advsearch_limits = split /,/, C4::Context->preference('OpacAdvSearchOptions');
315
    my @advsearch_limits = split /,/, C4::Context->preference('OpacAdvSearchOptions');
353
    my @advsearch_more_limits = split /,/,
316
    my @advsearch_more_limits = split /,/,
354
      C4::Context->preference('OpacAdvSearchMoreOptions');
317
      C4::Context->preference('OpacAdvSearchMoreOptions');
355
- 

Return to bug 28784