7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Koha › Tools › Patron clubs</title>
9 [% INCLUDE 'doc-head-close.inc' %]
13 <body id="clubs_clubs" class="clubs">
14 [% INCLUDE 'header.inc' %]
15 [% INCLUDE 'cat-search.inc' %]
16 <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>
18 <div class="main container-fluid">
20 <div class="col-sm-10 col-sm-push-2">
25 [% IF club_template %]
26 <div class="dialog message">
27 [% IF stored == 'updated' %]
28 <p>Club template <i>[% club_template.name | html %]</i> was updated.</p>
30 <p>Club template <i>[% club_template.name | html %]</i> was saved.</p>
34 <div class="dialog message">
35 [% IF stored == 'updated' %]
36 <p>Club <i>[% club.name | html %]</i> was updated.</p>
38 <p>Club <i>[% club.name | html %]</i> was saved.</p>
43 <h3>Club templates</h3>
45 [% IF CAN_user_clubs_edit_templates %]
46 <div class="btn-toolbar">
47 <div class="btn-group">
48 <a class="btn btn-default" href="templates-add-modify.pl"><i class="fa fa-plus"></i> New club template</a>
53 [% IF club_templates %]
54 <table id="club-templates-table">
59 <th>Public enrollment</th>
60 <th>Email required</th>
66 [% FOREACH t IN club_templates %]
68 <td>[% t.name | html %]</td>
69 <td>[% t.description | html %]</td>
71 [% IF t.is_enrollable_from_opac %]
78 [% IF t.is_email_required %]
84 <td>[% Branches.GetName( t.branchcode ) | html %]</td>
86 [% IF CAN_user_clubs_edit_templates %]
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
90 <a class="btn btn-xs btn-default" href="#" onclick='ConfirmDeleteTemplate([% t.id | html %], "[% t.name | html %]", $(this) ); return false;'>
91 <i class="fa fa-trash"></i> Delete
100 <div class="dialog message">No club templates defined.</div>
105 [% IF CAN_user_clubs_edit_clubs %]
106 <div class="btn-toolbar">
107 <div class="btn-group">
108 [% IF club_templates %]
109 <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New club <span class="caret"></span></button>
111 <button disabled="disabled" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New club <span class="caret"></span></button>
113 <ul class="dropdown-menu">
114 [% FOREACH t IN club_templates %]
115 <li><a href="/cgi-bin/koha/clubs/clubs-add-modify.pl?club_template_id=[% t.id | uri %]">[% t.name | html %]</a></li>
123 [% INCLUDE 'clubs-table.inc' %]
125 [% IF club_templates %]
126 <div class="dialog message">No clubs defined.</div>
128 <div class="dialog message">No clubs defined. A club template must be defined before a club can be defined.</div>
133 </div> <!-- /.col-sm-10.col-sm-push-2 -->
135 <div class="col-sm-2 col-sm-pull-10">
137 [% INCLUDE 'tools-menu.inc' %]
139 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
140 </div> <!-- /.row -->
142 [% MACRO jsinclude BLOCK %]
143 [% INCLUDE 'datatables.inc' %]
144 [% Asset.js("js/tools-menu.js") | $raw %]
146 $(document).ready(function() {
147 tTable = $('#club-templates-table').dataTable($.extend(true, {}, dataTablesDefaults, {
148 "sPaginationType": "full",
149 "sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>',
151 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
155 cTable = $('#clubs-table').dataTable($.extend(true, {}, dataTablesDefaults, {
156 "sPaginationType": "full",
157 "sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>',
159 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
164 function ConfirmDeleteTemplate( id, name, a ) {
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) ) ) {
168 url: '/cgi-bin/koha/svc/club/template/delete',
170 success: function( data ) {
171 if ( data.success ) {
174 alert(_("Unable to delete template!"));
182 function ConfirmDeleteClub( id, name, a ) {
183 if ( confirm( _("Are you sure you want to delete the club %s? This will cancel all patron enrollments in this club." ).format(name) ) ) {
186 url: '/cgi-bin/koha/svc/club/delete',
188 success: function( data ) {
189 if ( data.success ) {
192 alert(_("Unable to delete club!"));
200 function SearchToHold(club_id) {
201 var date = new Date();
202 date.setTime(date.getTime() + (10 * 60 * 1000));
203 $.cookie("holdforclub", club_id, { path: "/", expires: date });
204 location.href="/cgi-bin/koha/catalogue/search.pl";
209 [% INCLUDE 'intranet-bottom.inc' %]