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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/clubs-table.inc (-2 / +2 lines)
Lines 89-102 Link Here
89
                                        </a>
89
                                        </a>
90
                                    </li>
90
                                    </li>
91
                                    <li>
91
                                    <li>
92
                                        <a href="#" onclick='ConfirmDeleteClub([% c.id | html %], "[% c.name | html %]", $(this) ); return false;'>
92
                                        <a href="#" class="delete_club" data-id="[% c.id | html %]" data-name="[% c.name | html %]">
93
                                            <i class="fa fa-trash"></i> Delete
93
                                            <i class="fa fa-trash"></i> Delete
94
                                        </a>
94
                                        </a>
95
                                    </li>
95
                                    </li>
96
                                [% END %]
96
                                [% END %]
97
                                [% IF ( c.club_enrollments.count ) %]
97
                                [% IF ( c.club_enrollments.count ) %]
98
                                    <li>
98
                                    <li>
99
                                        <a href="#" onclick="SearchToHold([% c.id | html %])">
99
                                        <a href="#" class="club_hold_search" data-id="[% c.id | html %]">
100
                                            <i class="fa fa-search"></i> Search to hold
100
                                            <i class="fa fa-search"></i> Search to hold
101
                                        </a>
101
                                        </a>
102
                                    </li>
102
                                    </li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt (-4 / +23 lines)
Lines 87-93 Link Here
87
                                            <a class="btn btn-xs btn-default" style="white-space:nowrap"  href="/cgi-bin/koha/clubs/templates-add-modify.pl?id=[% t.id | html %]">
87
                                            <a class="btn btn-xs btn-default" style="white-space:nowrap"  href="/cgi-bin/koha/clubs/templates-add-modify.pl?id=[% t.id | html %]">
88
                                                <i class="fa fa-pencil"></i> Edit
88
                                                <i class="fa fa-pencil"></i> Edit
89
                                            </a>
89
                                            </a>
90
                                            <a class="btn btn-xs btn-default" href="#" onclick='ConfirmDeleteTemplate([% t.id | html %], "[% t.name | html %]", $(this) ); return false;'>
90
                                            <a class="btn btn-xs btn-default delete_template" href="#" data-id="[% t.id | html %]" data-name="[% t.name | html %]">
91
                                                <i class="fa fa-trash"></i> Delete
91
                                                <i class="fa fa-trash"></i> Delete
92
                                            </a>
92
                                            </a>
93
                                        [% END %]
93
                                        [% END %]
Lines 159-167 Link Here
159
                    { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
159
                    { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
160
                ]
160
                ]
161
            } ));
161
            } ));
162
163
            $(".delete_club").on("click", function(e){
164
                e.preventDefault();
165
                var club_id = $(this).data("id");
166
                var club_name = $(this).data("name");
167
                ConfirmDeleteClub( club_id, club_name );
168
            });
169
170
            $(".delete_template").on("click", function(e){
171
                e.preventDefault();
172
                var template_id = $(this).data("id");
173
                var template_name = $(this).data("name");
174
                ConfirmDeleteTemplate( template_id, template_name );
175
            });
176
177
            $(".club_hold_search").on("click", function(e){
178
                e.preventDefault;
179
                var club_id = $(this).data("id");
180
                SearchToHold( club_id );
181
            });
162
        });
182
        });
163
183
164
        function ConfirmDeleteTemplate( id, name, a ) {
184
        function ConfirmDeleteTemplate( id, name ) {
165
            if ( confirm( _("Are you sure you want to delete the club template %s? This will delete all clubs using this template and cancel patron enrollments" ).format(name) ) ) {
185
            if ( confirm( _("Are you sure you want to delete the club template %s? This will delete all clubs using this template and cancel patron enrollments" ).format(name) ) ) {
166
                $.ajax({
186
                $.ajax({
167
                    type: "POST",
187
                    type: "POST",
Lines 179-185 Link Here
179
            }
199
            }
180
        }
200
        }
181
201
182
        function ConfirmDeleteClub( id, name, a ) {
202
        function ConfirmDeleteClub( id, name ) {
183
            if ( confirm( _("Are you sure you want to delete the club %s? This will cancel all patron enrollments in this club." ).format(name) ) ) {
203
            if ( confirm( _("Are you sure you want to delete the club %s? This will cancel all patron enrollments in this club." ).format(name) ) ) {
184
                $.ajax({
204
                $.ajax({
185
                    type: "POST",
205
                    type: "POST",
186
- 

Return to bug 24393