|
Lines 11-30
Link Here
|
| 11 |
//<![CDATA[ |
11 |
//<![CDATA[ |
| 12 |
$(document).ready(function() { |
12 |
$(document).ready(function() { |
| 13 |
tTable = $('#club-templates-table').dataTable($.extend(true, {}, dataTablesDefaults, { |
13 |
tTable = $('#club-templates-table').dataTable($.extend(true, {}, dataTablesDefaults, { |
|
|
14 |
"sPaginationType": "four_button", |
| 15 |
"sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>', |
| 14 |
"aoColumnDefs": [ |
16 |
"aoColumnDefs": [ |
| 15 |
{ "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false }, |
17 |
{ "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false }, |
| 16 |
] |
18 |
] |
| 17 |
} )); |
19 |
} )); |
| 18 |
|
20 |
|
| 19 |
cTable = $('#clubs-table').dataTable($.extend(true, {}, dataTablesDefaults, { |
21 |
cTable = $('#clubs-table').dataTable($.extend(true, {}, dataTablesDefaults, { |
|
|
22 |
"sPaginationType": "four_button", |
| 23 |
"sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>', |
| 20 |
"aoColumnDefs": [ |
24 |
"aoColumnDefs": [ |
| 21 |
{ "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false }, |
25 |
{ "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false }, |
| 22 |
] |
26 |
] |
| 23 |
} )); |
27 |
} )); |
| 24 |
}); |
28 |
}); |
| 25 |
|
29 |
|
| 26 |
function ConfirmDeleteTemplate( id, name, a ) { |
30 |
function ConfirmDeleteTemplate( id, name, a ) { |
| 27 |
if ( confirm( _("Are you sure you want to delete the club template") + name + "?" ) ) { |
31 |
if ( confirm( _("Are you sure you want to delete the club template %s?" ).format(name) ) ) { |
| 28 |
$.ajax({ |
32 |
$.ajax({ |
| 29 |
type: "POST", |
33 |
type: "POST", |
| 30 |
url: '/cgi-bin/koha/svc/club/template/delete', |
34 |
url: '/cgi-bin/koha/svc/club/template/delete', |
|
Lines 42-48
Link Here
|
| 42 |
} |
46 |
} |
| 43 |
|
47 |
|
| 44 |
function ConfirmDeleteClub( id, name, a ) { |
48 |
function ConfirmDeleteClub( id, name, a ) { |
| 45 |
if ( confirm( _("Are you sure you want to delete the club ") + name + "?" ) ) { |
49 |
if ( confirm( _("Are you sure you want to delete the club %s?" ).format(name) ) ) { |
| 46 |
$.ajax({ |
50 |
$.ajax({ |
| 47 |
type: "POST", |
51 |
type: "POST", |
| 48 |
url: '/cgi-bin/koha/svc/club/delete', |
52 |
url: '/cgi-bin/koha/svc/club/delete', |
|
Lines 68-206
Link Here
|
| 68 |
[% INCLUDE 'cat-search.inc' %] |
72 |
[% INCLUDE 'cat-search.inc' %] |
| 69 |
<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> |
73 |
<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> |
| 70 |
|
74 |
|
| 71 |
<div class="yui-t7"> |
75 |
<div id="doc3" class="yui-t2"> |
| 72 |
<div class="yui-main"> |
76 |
<div id="bd"> |
| 73 |
<h1>Patron clubs</h1> |
77 |
<div id="yui-main"> |
|
|
78 |
<div class="yui-b"> |
| 79 |
<h1>Patron clubs</h1> |
| 74 |
|
80 |
|
|
|
81 |
<h3>Club templates</h3> |
| 75 |
|
82 |
|
| 76 |
<h3>Club templates</h3> |
83 |
[% IF CAN_user_clubs_edit_templates %] |
|
|
84 |
<div class="btn-toolbar"> |
| 85 |
<div class="btn-group"> |
| 86 |
<a class="btn" href="templates-add-modify.pl"><i class="fa fa-plus"></i> New club template</a> |
| 87 |
</div> |
| 88 |
</div> |
| 89 |
[% END %] |
| 77 |
|
90 |
|
| 78 |
[% IF CAN_user_clubs_edit_templates %] |
91 |
<table id="club-templates-table"> |
| 79 |
<div class="btn-group"> |
92 |
<thead> |
| 80 |
<a class="btn" href="templates-add-modify.pl"><i class="fa fa-plus"></i> New club template</a> |
93 |
<tr> |
| 81 |
</div> |
94 |
<th>Name</th> |
| 82 |
[% END %] |
95 |
<th>Description</th> |
| 83 |
|
96 |
<th>Public enrollment</th> |
| 84 |
<table id="club-templates-table"> |
97 |
<th>Email required</th> |
| 85 |
<thead> |
98 |
<th>Library</th> |
| 86 |
<tr> |
99 |
<th> </th> |
| 87 |
<th>Name</th> |
100 |
<th> </th> |
| 88 |
<th>Description</th> |
101 |
</tr> |
| 89 |
<th>Public enrollment</th> |
102 |
</thead> |
| 90 |
<th>Email required</th> |
103 |
|
| 91 |
<th>Library</th> |
104 |
<tbody> |
| 92 |
<th> </th> |
105 |
[% IF club_templates %] |
| 93 |
<th> </th> |
106 |
[% FOREACH t IN club_templates %] |
| 94 |
</tr> |
107 |
<tr> |
| 95 |
</thead> |
108 |
<td>[% t.name %]</td> |
| 96 |
|
109 |
<td>[% t.description %]</td> |
| 97 |
<tbody> |
110 |
<td> |
| 98 |
[% FOREACH t IN club_templates %] |
111 |
[% IF t.is_enrollable_from_opac %] |
| 99 |
<tr> |
112 |
Yes |
| 100 |
<td>[% t.name %]</td> |
113 |
[% ELSE %] |
| 101 |
<td>[% t.description %]</td> |
114 |
No |
| 102 |
<td> |
115 |
[% END %] |
| 103 |
[% IF t.is_enrollable_from_opac %] |
116 |
</td> |
| 104 |
Yes |
117 |
<td> |
| 105 |
[% ELSE %] |
118 |
[% IF t.is_email_required %] |
| 106 |
No |
119 |
Yes |
| 107 |
[% END %] |
120 |
[% ELSE %] |
| 108 |
</td> |
121 |
No |
| 109 |
<td> |
122 |
[% END %] |
| 110 |
[% IF t.is_email_required %] |
123 |
</td> |
| 111 |
Yes |
124 |
<td>[% Branches.GetName( t.branchcode ) %]</td> |
| 112 |
[% ELSE %] |
125 |
<td> |
| 113 |
No |
126 |
[% IF CAN_user_clubs_edit_templates %] |
| 114 |
[% END %] |
127 |
<a class="btn" style="white-space:nowrap" href="templates-add-modify.pl?id=[% t.id %]"> |
| 115 |
</td> |
128 |
<i class="fa fa-edit"></i> Edit |
| 116 |
<td>[% Branches.GetName( t.branchcode ) %]</td> |
129 |
</a> |
| 117 |
<td> |
130 |
[% END %] |
| 118 |
[% IF CAN_user_clubs_edit_templates %] |
131 |
</td> |
| 119 |
<a class="btn" style="white-space:nowrap" href="templates-add-modify.pl?id=[% t.id %]"> |
132 |
<td> |
| 120 |
<i class="fa fa-edit"></i> Edit |
133 |
[% IF CAN_user_clubs_edit_templates %] |
| 121 |
</a> |
134 |
<a class="btn" href="#" onclick='ConfirmDeleteTemplate([% t.id %], "[% t.name | html %]", $(this) ); return false;'> |
|
|
135 |
<i class="fa fa-trash"></i> Delete |
| 136 |
</a> |
| 137 |
[% END %] |
| 138 |
</td> |
| 139 |
</tr> |
| 122 |
[% END %] |
140 |
[% END %] |
| 123 |
</td> |
141 |
[% ELSE %] |
| 124 |
<td> |
142 |
<tr> |
| 125 |
[% IF CAN_user_clubs_edit_templates %] |
143 |
<td colspan="7"> |
| 126 |
<a class="btn" href="#" onclick='ConfirmDeleteTemplate([% t.id %], "[% t.name | html %]", $(this) ); return false;'> |
144 |
No club templates defined. |
| 127 |
<i class="fa fa-trash"></i> Delete |
145 |
</td> |
| 128 |
</a> |
146 |
</td> |
| 129 |
[% END %] |
147 |
[% END %] |
| 130 |
</td> |
148 |
</tbody> |
| 131 |
</tr> |
149 |
</table> |
|
|
150 |
|
| 151 |
<h3>Clubs</h3> |
| 152 |
|
| 153 |
[% IF CAN_user_clubs_edit_clubs %] |
| 154 |
<div class="btn-toolbar"> |
| 155 |
<div class="btn-group"> |
| 156 |
<button class="btn dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New club <span class="caret"></span></button> |
| 157 |
<ul class="dropdown-menu"> |
| 158 |
[% FOREACH t IN club_templates %] |
| 159 |
<li><a href="/cgi-bin/koha/clubs/clubs-add-modify.pl?club_template_id=[% t.id %]">[% t.name %]</a></li> |
| 160 |
[% END %] |
| 161 |
</ul> |
| 162 |
</div> |
| 163 |
</div> |
| 132 |
[% END %] |
164 |
[% END %] |
| 133 |
</tbody> |
165 |
|
| 134 |
</table> |
166 |
<table id="clubs-table"> |
| 135 |
|
167 |
<thead> |
| 136 |
<h3>Clubs</h3> |
168 |
<tr> |
| 137 |
|
169 |
<th>Name</th> |
| 138 |
[% IF CAN_user_clubs_edit_clubs %] |
170 |
<th>Template</th> |
| 139 |
<div class="btn-group"> |
171 |
<th>Description</th> |
| 140 |
<div class="btn-group"> |
172 |
<th>Public enrollment</th> |
| 141 |
<button class="btn dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New club <span class="caret"></span></button> |
173 |
<th>Email required</th> |
| 142 |
<ul class="dropdown-menu"> |
174 |
<th>Library</th> |
| 143 |
[% FOREACH t IN club_templates %] |
175 |
<th> </th> |
| 144 |
<li><a href="/cgi-bin/koha/clubs/clubs-add-modify.pl?club_template_id=[% t.id %]">[% t.name %]</a></li> |
176 |
<th> </th> |
|
|
177 |
</tr> |
| 178 |
</thead> |
| 179 |
|
| 180 |
<tbody> |
| 181 |
[% IF clubs %] |
| 182 |
[% FOREACH c IN clubs %] |
| 183 |
<tr> |
| 184 |
<td>[% c.name %]</td> |
| 185 |
<td>[% c.club_template.name %]</td> |
| 186 |
<td>[% c.description %]</td> |
| 187 |
<td> |
| 188 |
[% IF c.club_template.is_enrollable_from_opac %] |
| 189 |
Yes |
| 190 |
[% ELSE %] |
| 191 |
No |
| 192 |
[% END %] |
| 193 |
</td> |
| 194 |
<td> |
| 195 |
[% IF c.club_template.is_email_required %] |
| 196 |
Yes |
| 197 |
[% ELSE %] |
| 198 |
No |
| 199 |
[% END %] |
| 200 |
</td> |
| 201 |
<td>[% Branches.GetName( c.branchcode ) %]</td> |
| 202 |
<td> |
| 203 |
[% IF CAN_user_clubs_edit_clubs %] |
| 204 |
<a class="btn" style="white-space:nowrap" href="clubs-add-modify.pl?id=[% c.id %]"> |
| 205 |
<i class="fa fa-edit"></i> Edit |
| 206 |
</a> |
| 207 |
[% END %] |
| 208 |
</td> |
| 209 |
<td> |
| 210 |
[% IF CAN_user_clubs_edit_clubs %] |
| 211 |
<a class="btn" href="#" onclick='ConfirmDeleteClub([% c.id %], "[% c.name | html %]", $(this) ); return false;'> |
| 212 |
<i class="fa fa-trash"></i> Delete |
| 213 |
</a> |
| 214 |
[% END %] |
| 215 |
</td> |
| 216 |
</tr> |
| 217 |
[% END %] |
| 218 |
[% ELSE %] |
| 219 |
<tr> |
| 220 |
<td colspan="8"> |
| 221 |
No club templates defined. |
| 222 |
</td> |
| 223 |
</td> |
| 145 |
[% END %] |
224 |
[% END %] |
| 146 |
</ul> |
225 |
</tbody> |
| 147 |
</div> |
226 |
</table> |
| 148 |
</div> |
227 |
</div> |
| 149 |
[% END %] |
228 |
</div> |
| 150 |
|
229 |
<div class="yui-b noprint"> |
| 151 |
<table id="clubs-table"> |
230 |
[% INCLUDE 'tools-menu.inc' %] |
| 152 |
<thead> |
231 |
</div> |
| 153 |
<tr> |
|
|
| 154 |
<th>Name</th> |
| 155 |
<th>Template</th> |
| 156 |
<th>Description</th> |
| 157 |
<th>Public enrollment</th> |
| 158 |
<th>Email required</th> |
| 159 |
<th>Library</th> |
| 160 |
<th> </th> |
| 161 |
<th> </th> |
| 162 |
</tr> |
| 163 |
</thead> |
| 164 |
|
| 165 |
<tbody> |
| 166 |
[% FOREACH c IN clubs %] |
| 167 |
<tr> |
| 168 |
<td>[% c.name %]</td> |
| 169 |
<td>[% c.club_template.name %]</td> |
| 170 |
<td>[% c.description %]</td> |
| 171 |
<td> |
| 172 |
[% IF c.club_template.is_enrollable_from_opac %] |
| 173 |
Yes |
| 174 |
[% ELSE %] |
| 175 |
No |
| 176 |
[% END %] |
| 177 |
</td> |
| 178 |
<td> |
| 179 |
[% IF c.club_template.is_email_required %] |
| 180 |
Yes |
| 181 |
[% ELSE %] |
| 182 |
No |
| 183 |
[% END %] |
| 184 |
</td> |
| 185 |
<td>[% Branches.GetName( c.branchcode ) %]</td> |
| 186 |
<td> |
| 187 |
[% IF CAN_user_clubs_edit_clubs %] |
| 188 |
<a class="btn" style="white-space:nowrap" href="clubs-add-modify.pl?id=[% c.id %]"> |
| 189 |
<i class="fa fa-edit"></i> Edit |
| 190 |
</a> |
| 191 |
[% END %] |
| 192 |
</td> |
| 193 |
<td> |
| 194 |
[% IF CAN_user_clubs_edit_clubs %] |
| 195 |
<a class="btn" href="#" onclick='ConfirmDeleteClub([% c.id %], "[% c.name | html %]", $(this) ); return false;'> |
| 196 |
<i class="fa fa-trash"></i> Delete |
| 197 |
</a> |
| 198 |
[% END %] |
| 199 |
</td> |
| 200 |
</tr> |
| 201 |
[% END %] |
| 202 |
</tbody> |
| 203 |
</table> |
| 204 |
</div> |
232 |
</div> |
| 205 |
</div> |
233 |
</div> |
| 206 |
[% INCLUDE 'intranet-bottom.inc' %] |
234 |
[% INCLUDE 'intranet-bottom.inc' %] |