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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/member-search-box.inc (-2 / +15 lines)
Lines 6-12 Link Here
6
[% IF CAN_user_borrowers_edit_borrowers || CAN_user_borrowers_list_borrowers %]
6
[% IF CAN_user_borrowers_edit_borrowers || CAN_user_borrowers_list_borrowers %]
7
    [%- SET searchtype = searchtype || Koha.Preference('DefaultPatronSearchMethod') -%]
7
    [%- SET searchtype = searchtype || Koha.Preference('DefaultPatronSearchMethod') -%]
8
    [% WRAPPER tab_panel tabname="patron_search" bt_active= bs_tab_active %]
8
    [% WRAPPER tab_panel tabname="patron_search" bt_active= bs_tab_active %]
9
        <form method="get" action="/cgi-bin/koha/members/member.pl">
9
        <form method="get" action="/cgi-bin/koha/members/member.pl" onsubmit="return validatePatronSearch(this);">
10
            <script>
11
                function validatePatronSearch(form) {
12
                    const searchTerm = form.searchmember.value.trim();
13
                    const branchSelected = form.branchcode_filter && form.branchcode_filter.value !== "";
14
                    const categorySelected = form.categorycode_filter && form.categorycode_filter.value !== "";
15
16
                    if (!searchTerm && !branchSelected && !categorySelected) {
17
                        alert("Please enter a search term or select a library/category");
18
                        return false;
19
                    }
20
                    return true;
21
                }
22
            </script>
10
            <input type="hidden" name="quicksearch" value="1" />
23
            <input type="hidden" name="quicksearch" value="1" />
11
24
12
            <div class="form-title">
25
            <div class="form-title">
Lines 23-29 Link Here
23
                <button type="button" class="form-extra-content-toggle" title="More options"><i class="form-extra-content-icon fa-solid fa-sliders" aria-hidden="true"></i></button>
36
                <button type="button" class="form-extra-content-toggle" title="More options"><i class="form-extra-content-icon fa-solid fa-sliders" aria-hidden="true"></i></button>
24
            </div>
37
            </div>
25
38
26
            <button type="submit" aria-label="Search"><i class="fa fa-arrow-right"></i></button>
39
            <button type="submit" class="btn btn-primary" aria-label="Search"><i class="fa fa-arrow-right"></i></button>
27
40
28
            <div class="form-extra-content">
41
            <div class="form-extra-content">
29
                <div> [% INCLUDE patron_fields_dropdown search_box=1 %] </div>
42
                <div> [% INCLUDE patron_fields_dropdown search_box=1 %] </div>
(-)a/members/member.pl (-4 / +6 lines)
Lines 69-84 my $searchtype = $input->param('searchtype'); Link Here
69
69
70
$template->param( 'alphabet' => C4::Context->preference('alphabet') || join ' ', 'A' .. 'Z' );
70
$template->param( 'alphabet' => C4::Context->preference('alphabet') || join ' ', 'A' .. 'Z' );
71
71
72
my $branchcode_filter   = scalar $input->param('branchcode_filter');
73
my $categorycode_filter = scalar $input->param('categorycode_filter');
74
72
$template->param(
75
$template->param(
73
    patron_lists        => [ GetPatronLists() ],
76
    patron_lists        => [ GetPatronLists() ],
74
    searchmember        => $searchmember,
77
    searchmember        => $searchmember,
75
    branchcode_filter   => scalar $input->param('branchcode_filter'),
78
    branchcode_filter   => $branchcode_filter,
76
    categorycode_filter => scalar $input->param('categorycode_filter'),
79
    categorycode_filter => $categorycode_filter,
77
    searchtype          => $searchtype,
80
    searchtype          => $searchtype,
78
    searchfieldstype    => $searchfieldstype,
81
    searchfieldstype    => $searchfieldstype,
79
    PatronsPerPage      => C4::Context->preference("PatronsPerPage") || 20,
82
    PatronsPerPage      => C4::Context->preference("PatronsPerPage") || 20,
80
    circsearch          => $circsearch,
83
    circsearch          => $circsearch,
81
    defer_loading       => $searchmember ? 0 : 1,
84
    defer_loading       => ( $searchmember || $branchcode_filter || $categorycode_filter ) ? 0 : 1,
82
);
85
);
83
86
84
output_html_with_http_headers $input, $cookie, $template->output;
87
output_html_with_http_headers $input, $cookie, $template->output;
85
- 

Return to bug 41040