7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Koha › Tools › Patron clubs</title>
9 [% INCLUDE 'doc-head-close.inc' %]
11 [% Asset.css("css/datatables.css") | $raw %]
14 <body id="clubs_clubs" class="clubs">
15 [% INCLUDE 'header.inc' %]
16 [% INCLUDE 'cat-search.inc' %]
17 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › Patron clubs</div>
19 <div class="main container-fluid">
21 <div class="col-sm-10 col-sm-push-2">
26 [% IF club_template %]
27 <div class="dialog message">
28 [% IF stored == 'updated' %]
29 <p>Club template <i>[% club_template.name | html %]</i> was updated.</p>
31 <p>Club template <i>[% club_template.name | html %]</i> was saved.</p>
35 <div class="dialog message">
36 [% IF stored == 'updated' %]
37 <p>Club <i>[% club.name | html %]</i> was updated.</p>
39 <p>Club <i>[% club.name | html %]</i> was saved.</p>
44 <h3>Club templates</h3>
46 [% IF CAN_user_clubs_edit_templates %]
47 <div class="btn-toolbar">
48 <div class="btn-group">
49 <a class="btn btn-sm btn-default" href="templates-add-modify.pl"><i class="fa fa-plus"></i> New club template</a>
54 [% IF club_templates %]
55 <table id="club-templates-table">
60 <th>Public enrollment</th>
61 <th>Email required</th>
67 [% FOREACH t IN club_templates %]
69 <td>[% t.name | html %]</td>
70 <td>[% t.description | html %]</td>
72 [% IF t.is_enrollable_from_opac %]
79 [% IF t.is_email_required %]
85 <td>[% Branches.GetName( t.branchcode ) | html %]</td>
87 [% IF CAN_user_clubs_edit_templates %]
88 <a class="btn btn-xs btn-default" style="white-space:nowrap" href="/cgi-bin/koha/clubs/templates-add-modify.pl?id=[% t.id | html %]">
89 <i class="fa fa-pencil"></i> Edit
91 <a class="btn btn-xs btn-default" href="#" onclick='ConfirmDeleteTemplate([% t.id | html %], "[% t.name | html %]", $(this) ); return false;'>
92 <i class="fa fa-trash"></i> Delete
101 <div class="dialog message">No club templates defined.</div>
106 [% IF CAN_user_clubs_edit_clubs %]
107 <div class="btn-toolbar">
108 <div class="btn-group">
109 [% IF club_templates %]
110 <button class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New club <span class="caret"></span></button>
112 <button disabled="disabled" class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New club <span class="caret"></span></button>
114 <ul class="dropdown-menu">
115 [% FOREACH t IN club_templates %]
116 <li><a href="/cgi-bin/koha/clubs/clubs-add-modify.pl?club_template_id=[% t.id | uri %]">[% t.name | html %]</a></li>
124 <table id="clubs-table">
130 <th>Public enrollment</th>
131 <th>Email required</th>
135 <th>Enrolled patrons</th>
140 [% FOREACH c IN clubs %]
142 <td>[% c.name | html %]</td>
143 <td>[% c.club_template.name | html %]</td>
144 <td>[% c.description | html %]</td>
146 [% IF c.club_template.is_enrollable_from_opac %]
153 [% IF c.club_template.is_email_required %]
159 <td>[% Branches.GetName( c.branchcode ) | html %]</td>
161 [% IF c.date_start %]
162 [% c.date_start | $KohaDates %]
167 [% c.date_end | $KohaDates %]
171 [% c.club_enrollments.count | html %]
174 <div class="dropdown">
175 <a class="btn btn-default btn-xs dropdown-toggle" id="clubactions[% c.id | html %]" role="button" data-toggle="dropdown" href="#">
176 Actions <b class="caret"></b>
178 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="clubactions[% c.id | html %]">
179 [% IF ( c.club_enrollments.count ) %]
181 <a href="club-enrollments.pl?id=[% c.id | uri %]">
182 <i class="fa fa-list-ul"></i> Enrollments
186 <li class="disabled">
187 <a href="club-enrollments.pl?id=[% c.id | uri %]">
188 <i class="fa fa-list-ul"></i> Enrollments
192 [% IF CAN_user_clubs_edit_clubs %]
194 <a href="clubs-add-modify.pl?id=[% c.id | uri %]">
195 <i class="fa fa-pencil"></i> Edit
199 <a href="#" onclick='ConfirmDeleteClub([% c.id | html %], "[% c.name | html %]", $(this) ); return false;'>
200 <i class="fa fa-trash"></i> Delete
210 </table> <!-- /.clubs-table -->
212 [% IF club_templates %]
213 <div class="dialog message">No clubs defined.</div>
215 <div class="dialog message">No clubs defined. A club template must be defined before a club can be defined.</div>
220 </div> <!-- /.col-sm-10.col-sm-push-2 -->
222 <div class="col-sm-2 col-sm-pull-10">
224 [% INCLUDE 'tools-menu.inc' %]
226 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
227 </div> <!-- /.row -->
229 [% MACRO jsinclude BLOCK %]
230 [% INCLUDE 'datatables.inc' %]
231 [% Asset.js("js/tools-menu.js") | $raw %]
233 $(document).ready(function() {
234 tTable = $('#club-templates-table').dataTable($.extend(true, {}, dataTablesDefaults, {
235 "sPaginationType": "four_button",
236 "sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>',
238 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
242 cTable = $('#clubs-table').dataTable($.extend(true, {}, dataTablesDefaults, {
243 "sPaginationType": "four_button",
244 "sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>',
246 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
251 function ConfirmDeleteTemplate( id, name, a ) {
252 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) ) ) {
255 url: '/cgi-bin/koha/svc/club/template/delete',
257 success: function( data ) {
258 if ( data.success ) {
261 alert(_("Unable to delete template!"));
269 function ConfirmDeleteClub( id, name, a ) {
270 if ( confirm( _("Are you sure you want to delete the club %s? This will cancel all patron enrollments in this club." ).format(name) ) ) {
273 url: '/cgi-bin/koha/svc/club/delete',
275 success: function( data ) {
276 if ( data.success ) {
279 alert(_("Unable to delete club!"));
289 [% INCLUDE 'intranet-bottom.inc' %]