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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/member-search-box.inc (-19 / +1 lines)
Lines 6-30 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" onsubmit="return validatePatronSearch(this);">
9
        <form id="patron_header_search" method="get" action="/cgi-bin/koha/members/member.pl">
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
                        $(form.searchmember)
18
                            .tooltip({ trigger: "manual", placement: "bottom", title: _("Please enter a card number or name") })
19
                            .tooltip("show");
20
                        $(document).on("click", function () {
21
                            $(form.searchmember).tooltip("hide");
22
                        });
23
                        return false;
24
                    }
25
                    return true;
26
                }
27
            </script>
28
            <input type="hidden" name="quicksearch" value="1" />
10
            <input type="hidden" name="quicksearch" value="1" />
29
11
30
            <div class="form-title">
12
            <div class="form-title">
(-)a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js (-2 / +29 lines)
Lines 1-5 Link Here
1
/* global shortcut delBasket AUDIO_ALERT_PATH Cookies */
1
/* global shortcut delBasket AUDIO_ALERT_PATH Cookies */
2
/* exported addBibToContext delBibToContext escape_str escape_price openWindow _ removeFocus toUC confirmDelete confirmClone playSound */
2
/* exported addBibToContext delBibToContext escape_str escape_price openWindow _ removeFocus toUC confirmDelete confirmClone playSound validatePatronSearch */
3
if (KOHA === undefined) var KOHA = {};
3
if (KOHA === undefined) var KOHA = {};
4
4
5
function _(s) {
5
function _(s) {
Lines 477-482 $(document).ready(function () { Link Here
477
        e.preventDefault();
477
        e.preventDefault();
478
        togglePanel($(this));
478
        togglePanel($(this));
479
    });
479
    });
480
481
    $("#patron_header_search").on("submit", function (e) {
482
        e.preventDefault();
483
        validatePatronSearch($(this)[0]);
484
    });
480
});
485
});
481
486
482
function removeLastBorrower() {
487
function removeLastBorrower() {
Lines 1066-1068 function getScrollto(target, elemid) { Link Here
1066
    }
1071
    }
1067
    return yoffset.top - elem_height - 20;
1072
    return yoffset.top - elem_height - 20;
1068
}
1073
}
1069
- 
1074
1075
function validatePatronSearch(form) {
1076
    const searchTerm = form.searchmember.value.trim();
1077
    const branchSelected =
1078
        form.branchcode_filter && form.branchcode_filter.value !== "";
1079
    const categorySelected =
1080
        form.categorycode_filter && form.categorycode_filter.value !== "";
1081
1082
    if (!searchTerm && !branchSelected && !categorySelected) {
1083
        $(form.searchmember)
1084
            .tooltip({
1085
                trigger: "manual",
1086
                placement: "bottom",
1087
                title: __("Please enter a card number or name"),
1088
            })
1089
            .tooltip("show");
1090
        $(document).on("click", function () {
1091
            $(form.searchmember).tooltip("hide");
1092
        });
1093
        return false;
1094
    }
1095
    return true;
1096
}

Return to bug 41040