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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (+1 lines)
Lines 1151-1156 Link Here
1151
    [% Asset.js("js/members-menu.js") | $raw %]
1151
    [% Asset.js("js/members-menu.js") | $raw %]
1152
    [% Asset.js("js/tables/bookings.js") | $raw %]
1152
    [% Asset.js("js/tables/bookings.js") | $raw %]
1153
    [% Asset.js("js/recalls.js") | $raw %]
1153
    [% Asset.js("js/recalls.js") | $raw %]
1154
    [% Asset.js("js/form-submit.js") | $raw %]
1154
[% END %]
1155
[% END %]
1155
1156
1156
[% INCLUDE 'intranet-bottom.inc' %]
1157
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (+1 lines)
Lines 772-777 Link Here
772
    [% INCLUDE 'str/members-menu.inc' %]
772
    [% INCLUDE 'str/members-menu.inc' %]
773
    [% Asset.js("js/members-menu.js") | $raw %]
773
    [% Asset.js("js/members-menu.js") | $raw %]
774
    [% Asset.js("js/recalls.js") | $raw %]
774
    [% Asset.js("js/recalls.js") | $raw %]
775
    [% Asset.js("js/form-submit.js") | $raw %]
775
    <script>
776
    <script>
776
        const LoadCheckoutsTableDelay = 0;
777
        const LoadCheckoutsTableDelay = 0;
777
778
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt (-30 / +42 lines)
Lines 44-54 Link Here
44
44
45
        [% IF ( lists ) %]
45
        [% IF ( lists ) %]
46
46
47
        <form action="/cgi-bin/koha/patron_lists/delete.pl" method="post" id="patrons_lists_form">
48
            [% INCLUDE 'csrf-token.inc' %]
49
            <input type="hidden" name="op" value="cud-delete" />
50
            <div id="searchheader" class="searchheader noprint sticky">
51
                <div class="btn-group">
52
                    <button type="submit" class="btn btn-default btn-sm disabled" id="delete_selected_lists"><i class="fa fa-trash" aria-hidden="true"></i> Delete selected lists</button>
53
                </div>
54
            </div>
55
47
        <div class="page-section">
56
        <div class="page-section">
48
            <table id="patron-lists-table">
57
            <table id="patron-lists-table">
49
                <thead>
58
                <thead>
50
                    <tr>
59
                    <tr>
51
                        <input type="button" type="submit" class="btn btn-default btn-sm disabled" value="Delete selected lists" id="delete_selected_lists"/>
60
                        <th class="NoSort"></th>
52
                        <th>Name</th>
61
                        <th>Name</th>
53
                        <th>Patrons in list</th>
62
                        <th>Patrons in list</th>
54
                        <th>Shared</th>
63
                        <th>Shared</th>
Lines 61-67 Link Here
61
                        [% SET shared_by_other = l.owner.id != logged_in_user.id %]
70
                        [% SET shared_by_other = l.owner.id != logged_in_user.id %]
62
                        <tr>
71
                        <tr>
63
                            <td>
72
                            <td>
64
                                <input class="select_patron" type="checkbox" autocomplete="off" data-patron-list-id="[% l.patron_list_id | html %]">
73
                                <input class="select_list" name="patron_lists_ids" value="[% l.patron_list_id | html %]" type="checkbox" autocomplete="off" data-patron-list-id="[% l.patron_list_id | html %]" />
74
                            </td>
75
                            <td>
65
                                <a href="/cgi-bin/koha/patron_lists/list.pl?patron_list_id=[% l.patron_list_id | uri %]">[% l.name | html %]</a>
76
                                <a href="/cgi-bin/koha/patron_lists/list.pl?patron_list_id=[% l.patron_list_id | uri %]">[% l.name | html %]</a>
66
                            </td>
77
                            </td>
67
                            <td>[% l.patron_list_patrons_rs.count || 0 | html %]</td>
78
                            <td>[% l.patron_list_patrons_rs.count || 0 | html %]</td>
Lines 84-90 Link Here
84
                                        <li><a href="/cgi-bin/koha/patron_lists/list.pl?patron_list_id=[% l.patron_list_id | uri %]"><i class="fa fa-user"></i> Add patrons</a></li>
95
                                        <li><a href="/cgi-bin/koha/patron_lists/list.pl?patron_list_id=[% l.patron_list_id | uri %]"><i class="fa fa-user"></i> Add patrons</a></li>
85
                                        [% UNLESS shared_by_other %]
96
                                        [% UNLESS shared_by_other %]
86
                                            <li><a href="/cgi-bin/koha/patron_lists/add-modify.pl?patron_list_id=[% l.patron_list_id | uri %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit list</a></li>
97
                                            <li><a href="/cgi-bin/koha/patron_lists/add-modify.pl?patron_list_id=[% l.patron_list_id | uri %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit list</a></li>
87
                                            <li><a class="delete_patron" href="/cgi-bin/koha/patron_lists/delete.pl?patron_list_id=[% l.patron_list_id | html %]" data-list-name="[% l.name | html %]"><i class="fa fa-trash-can"></i> Delete list</a></li>
98
                                            <li>
99
                                                <a class="dropdown-item submit-form-link" href="#" data-patron_list_id="[% l.patron_list_id | html %]" data-action="delete.pl" data-method="post" data-op="cud-delete" data-confirmation-msg="Are you sure you want to delete this list?" ><i class="fa fa-trash-can"></i> Delete list</a>
100
                                            </li>
88
                                        [% END %]
101
                                        [% END %]
89
                                        [% IF ( l.patron_list_patrons_rs.count ) %]
102
                                        [% IF ( l.patron_list_patrons_rs.count ) %]
90
                                            <li class="divider"></li>
103
                                            <li class="divider"></li>
Lines 114-119 Link Here
114
                </tbody>
127
                </tbody>
115
            </table>
128
            </table>
116
        </div> <!-- /.page-section -->
129
        </div> <!-- /.page-section -->
130
        </form>
131
        <!-- /#patron_lists_form -->
117
132
118
            <!-- Modal to print patron cards -->
133
            <!-- Modal to print patron cards -->
119
            <div class="modal" id="patronExportModal" tabindex="-1" role="dialog" aria-labelledby="patronExportModal_label" aria-hidden="true">
134
            <div class="modal" id="patronExportModal" tabindex="-1" role="dialog" aria-labelledby="patronExportModal_label" aria-hidden="true">
Lines 146-151 Link Here
146
161
147
[% MACRO jsinclude BLOCK %]
162
[% MACRO jsinclude BLOCK %]
148
    [% Asset.js("js/tools-menu.js") | $raw %]
163
    [% Asset.js("js/tools-menu.js") | $raw %]
164
    [% Asset.js("js/form-submit.js") | $raw %]
149
    [% INCLUDE 'datatables.inc' %]
165
    [% INCLUDE 'datatables.inc' %]
150
166
151
    <script>
167
    <script>
Lines 160-194 Link Here
160
                "columnDefs": [
176
                "columnDefs": [
161
                    { "orderable": false, "searchable":  false, "targets": [ 'NoSort' ] }
177
                    { "orderable": false, "searchable":  false, "targets": [ 'NoSort' ] }
162
                ],
178
                ],
163
                "pagingType": "full"
179
                "pagingType": "full",
180
                "sorting": [[ 1, "asc" ]]
164
            } ));
181
            } ));
165
            $(".delete_patron").on("click", function(){
166
                $(".dropdown").removeClass("open");
167
                var list = $(this).data("list-name");
168
                return confirmDelete( _("Are you sure you want to delete the list %s?").format(list));
169
            });
170
182
171
            $("#delete_selected_lists").on("click", function() {
183
            $("#patrons_lists_form").submit(function(){
172
                if (selectedPatronLists.length != 0) {
184
                var checkedItems = $("input[name=patron_lists_ids]:checked");
173
                    if (confirm(_("Are you sure you want to delete the selected lists ?"))) {
185
                if ( checkedItems.size() == 0) {
174
                    var delete_lists_url = '/cgi-bin/koha/patron_lists/delete.pl?patron_lists_ids=' + selectedPatronLists.join("&patron_lists_ids=");
186
                    alert(_("You must select one or more lists to delete"));
175
                    window.location.href = delete_lists_url;
187
                    return false;
176
                    }
188
                 }
177
                }
189
                if( confirm(_("Are you sure you want to delete the selected lists?")) ) {
178
            });
190
                    return true;
179
191
                } else {
180
            $(document).on("click", ".select_patron", function() {
192
                    return false;
181
                if($(this).is(':checked')){
193
                 }
182
                    $("#delete_selected_lists").attr("class","btn btn-default btn-sm");
194
             });
183
                    selectedPatronLists.push($(this).data("patron-list-id"));
195
184
                }
196
            $(document).on("click", ".select_list", function() {
185
                else {
197
                var checkedItems = $("input[name=patron_lists_ids]:checked");
186
                    selectedPatronLists = selectedPatronLists.filter(item => item !== $(this).data("patron-list-id"));
198
                if ( checkedItems.size() == 0 ) {
187
                    if(selectedPatronLists.length === 0){
199
                    $("#delete_selected_lists").addClass("disabled").prop("disabled", true);
188
                        $("#delete_selected_lists").attr("class","btn btn-default btn-sm disabled");
200
                } else {
189
                    }
201
                    $("#delete_selected_lists").removeClass("disabled").prop("disabled", false);
190
                }
202
                 }
191
            });
203
             });
192
204
193
            $(".print_cards").on("click", function(e){
205
            $(".print_cards").on("click", function(e){
194
                e.preventDefault();
206
                e.preventDefault();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/patron-lists-tab.tt (-1 / +6 lines)
Lines 1-3 Link Here
1
[% USE raw %]
2
[% USE Koha %]
3
[% USE Asset %]
1
[% USE KohaDates %]
4
[% USE KohaDates %]
2
5
3
[% IF no_access_to_patron %]
6
[% IF no_access_to_patron %]
Lines 53-59 Link Here
53
                                    <li><a href="/cgi-bin/koha/patron_lists/list.pl?patron_list_id=[% l.patron_list_id | uri %]"><i class="fa fa-user"></i> Add patrons</a></li>
56
                                    <li><a href="/cgi-bin/koha/patron_lists/list.pl?patron_list_id=[% l.patron_list_id | uri %]"><i class="fa fa-user"></i> Add patrons</a></li>
54
                                    [% UNLESS shared_by_other %]
57
                                    [% UNLESS shared_by_other %]
55
                                        <li><a href="/cgi-bin/koha/patron_lists/add-modify.pl?patron_list_id=[% l.patron_list_id | uri %]"><i class="fa fa-pencil"></i> Edit list</a></li>
58
                                        <li><a href="/cgi-bin/koha/patron_lists/add-modify.pl?patron_list_id=[% l.patron_list_id | uri %]"><i class="fa fa-pencil"></i> Edit list</a></li>
56
                                        <li><a class="delete_patron" href="/cgi-bin/koha/patron_lists/delete.pl?patron_list_id=[% l.patron_list_id | html %]" data-list-name="[% l.name | html %]"><i class="fa fa-trash"></i> Delete list</a></li>
59
                                        <li>
60
                                            <a class="dropdown-item submit-form-link" href="#" data-patron_list_id="[% l.patron_list_id | html %]" data-action="/cgi-bin/koha/patron_lists/delete.pl" data-method="post" data-op="cud-delete" data-confirmation-msg="Are you sure you want to delete this list?" ><i class="fa fa-trash-can"></i> Delete list</a>
61
                                        </li>
57
                                    [% END %]
62
                                    [% END %]
58
                                    [% IF ( l.patron_list_patrons_rs.count ) %]
63
                                    [% IF ( l.patron_list_patrons_rs.count ) %]
59
                                        <li class="divider"></li>
64
                                        <li class="divider"></li>
(-)a/patron_lists/delete.pl (-7 / +9 lines)
Lines 26-31 use C4::Output; Link Here
26
use Koha::List::Patron qw( DelPatronList );
26
use Koha::List::Patron qw( DelPatronList );
27
27
28
my $cgi = CGI->new;
28
my $cgi = CGI->new;
29
my $op  = $cgi->param('op') // q{};
29
30
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
    {
32
    {
Lines 39-50 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
39
my $id        = $cgi->param('patron_list_id');
40
my $id        = $cgi->param('patron_list_id');
40
my @lists_ids = $cgi->multi_param('patron_lists_ids');
41
my @lists_ids = $cgi->multi_param('patron_lists_ids');
41
42
42
if ( defined $id && $id ne '' ) {
43
if ( $op eq 'cud-delete' ) {
43
    DelPatronList( { patron_list_id => $id } );
44
    if ( defined $id && $id ne '' ) {
44
}
45
        DelPatronList( { patron_list_id => $id } );
45
if (@lists_ids) {
46
    }
46
    foreach my $list_id (@lists_ids) {
47
    if (@lists_ids) {
47
        DelPatronList( { patron_list_id => $list_id } );
48
        foreach my $list_id (@lists_ids) {
49
            DelPatronList( { patron_list_id => $list_id } );
50
        }
48
    }
51
    }
49
}
52
}
50
53
51
- 

Return to bug 37266