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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/erm/erm.tt (+5 lines)
Lines 5-10 Link Here
5
[% USE TablesSettings %]
5
[% USE TablesSettings %]
6
[% PROCESS 'i18n.inc' %]
6
[% PROCESS 'i18n.inc' %]
7
[% SET footerjs = 1 %]
7
[% SET footerjs = 1 %]
8
[% PROCESS 'patron-search.inc' %]
8
[% INCLUDE 'doc-head-open.inc' %]
9
[% INCLUDE 'doc-head-open.inc' %]
9
<title>[% FILTER collapse %]
10
<title>[% FILTER collapse %]
10
    [% t("E-resource management") | html %] &rsaquo;
11
    [% t("E-resource management") | html %] &rsaquo;
Lines 48-53 Link Here
48
    </script>
49
    </script>
49
50
50
    [% Asset.js("js/vue/dist/erm.js") | $raw %]
51
    [% Asset.js("js/vue/dist/erm.js") | $raw %]
52
    [% INCLUDE 'select2.inc' %]
53
    [% SET columns = ['cardnumber','name','category','branch','action'] %]
54
    [% PROCESS patron_search_modal columns => columns, modal_title => t("Select user") %]
55
    [% PROCESS patron_search_js columns => columns, filter => erm_users, actions => ["select"], preview_on_name_click => 1 %]
51
56
52
[% END %]
57
[% END %]
53
[% INCLUDE 'intranet-bottom.inc' %]
58
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UserRoles.vue (-15 / +9 lines)
Lines 22-31 Link Here
22
                        {{ user_role.patron_str }}
22
                        {{ user_role.patron_str }}
23
                    </span>
23
                    </span>
24
                    (<a
24
                    (<a
25
                        href="#"
25
                        href="#patron_search_modal"
26
                        @click="selectUser(counter)"
26
                        @click="selectUser(counter)"
27
                        class="btn btn-default"
27
                        class="btn btn-default"
28
                        >{{ $__("Select user") }}</a
28
                        data-toggle="modal"
29
                        ><i class="fa fa-plus"></i> {{ $__("Select user") }}</a
29
                    >)
30
                    >)
30
                    <span class="required">{{ $__("Required") }}</span>
31
                    <span class="required">{{ $__("Required") }}</span>
31
                </li>
32
                </li>
Lines 91-113 export default { Link Here
91
            this.user_roles.splice(counter, 1)
92
            this.user_roles.splice(counter, 1)
92
        },
93
        },
93
        selectUser(counter) {
94
        selectUser(counter) {
94
            let select_user_window = window.open(
95
                "/cgi-bin/koha/members/search.pl?columns=cardnumber,name,category,branch,action&selection_type=select&filter=erm_users",
96
                "PatronPopup",
97
                "width=740,height=450,location=yes,toolbar=no," +
98
                    "scrollbars=yes,resize=yes"
99
            )
100
            // This is a bit dirty, the "select user" window should be rewritten and be a Vue component
95
            // This is a bit dirty, the "select user" window should be rewritten and be a Vue component
101
            // but that's not for now...
96
            // but that's not for now...
102
            select_user_window.addEventListener(
97
            $(document).on(
103
                "beforeunload",
98
                "hidden.bs.modal",
104
                this.newUserSelected,
99
                "#patron_search_modal",
105
                false
100
                this.newUserSelected
106
            )
101
            )
107
            select_user_window.counter = counter
102
            this.selected_user_counter = counter
108
        },
103
        },
109
        newUserSelected(e) {
104
        newUserSelected(e) {
110
            let c = e.currentTarget.counter
105
            let c = this.selected_user_counter
111
            let selected_patron_id =
106
            let selected_patron_id =
112
                document.getElementById("selected_patron_id").value
107
                document.getElementById("selected_patron_id").value
113
            let patron
108
            let patron
114
- 

Return to bug 35329