|
Lines 240-417
Link Here
|
| 240 |
[% END %] |
240 |
[% END %] |
| 241 |
|
241 |
|
| 242 |
<div id="tabs" class="toptabs"> |
242 |
<div id="tabs" class="toptabs"> |
| 243 |
<ul> |
243 |
<ul class="nav nav-tabs" role="tablist"> |
| 244 |
<li><a href="#reports">All</a></li> |
244 |
<li role="presentation" class="active"> |
|
|
245 |
<a href="#reports" aria-controls="reports" role="tab" data-toggle="tab">All</a> |
| 246 |
</li> |
| 245 |
[% FOREACH group IN groups_with_subgroups %] |
247 |
[% FOREACH group IN groups_with_subgroups %] |
| 246 |
<li><a id="[% group.id | html %]" href="#reports">[% group.name | html %]</a></li> |
248 |
<li role="presentation"> |
|
|
249 |
<a id="[% group.id | html %]" href="#reports" aria-controls="reports" role="tab" data-toggle="tab">[% group.name | html %]</a> |
| 250 |
</li> |
| 247 |
[% END %] |
251 |
[% END %] |
| 248 |
</ul> |
252 |
</ul> |
| 249 |
<div id="reports"> |
|
|
| 250 |
<div id="subgroup_filter_block"> |
| 251 |
<label for="subgroup_filter">Subgroup:</label> |
| 252 |
<select id="subgroup_filter"> |
| 253 |
<option value="">All</option> |
| 254 |
</select> |
| 255 |
</div> |
| 256 |
|
253 |
|
| 257 |
[% IF (Koha.Preference('Mana') == 1) %] |
254 |
<div class="tab-content"> |
| 258 |
[% IF manamsg %] |
255 |
<div id="reports" role="tabpanel" class="tab-pane active"> |
| 259 |
<div id="mana_search_message" class="dialog message"> |
256 |
<div id="subgroup_filter_block"> |
| 260 |
<p> [% manamsg | html %] </p> |
257 |
<label for="subgroup_filter">Subgroup:</label> |
| 261 |
</div> |
258 |
<select id="subgroup_filter"> |
|
|
259 |
<option value="">All</option> |
| 260 |
</select> |
| 261 |
</div> |
| 262 |
|
| 263 |
[% IF (Koha.Preference('Mana') == 1) %] |
| 264 |
[% IF manamsg %] |
| 265 |
<div id="mana_search_message" class="dialog message"> |
| 266 |
<p> [% manamsg | html %] </p> |
| 267 |
</div> |
| 268 |
[% END %] |
| 262 |
[% END %] |
269 |
[% END %] |
| 263 |
[% END %] |
|
|
| 264 |
|
270 |
|
| 265 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
271 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
| 266 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
272 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
| 267 |
<table id="table_reports"> |
273 |
<table id="table_reports"> |
| 268 |
<thead> |
274 |
<thead> |
| 269 |
<tr> |
275 |
<tr> |
| 270 |
<th class="NoSort"> </th> |
276 |
<th class="NoSort"> </th> |
| 271 |
<th>ID</th> |
277 |
<th>ID</th> |
| 272 |
<th>Report name</th> |
278 |
<th>Report name</th> |
| 273 |
<th>Type</th> |
279 |
<th>Type</th> |
| 274 |
<th>Group</th> |
280 |
<th>Group</th> |
| 275 |
<th>Subgroup</th> |
281 |
<th>Subgroup</th> |
| 276 |
<th>Notes</th> |
282 |
<th>Notes</th> |
| 277 |
<th>Author</th> |
283 |
<th>Author</th> |
| 278 |
<th>Creation date</th> |
284 |
<th>Creation date</th> |
| 279 |
<th>Last edit</th> |
285 |
<th>Last edit</th> |
| 280 |
<th>Last run</th> |
286 |
<th>Last run</th> |
| 281 |
<th class="report_public">Public</th> |
287 |
<th class="report_public">Public</th> |
| 282 |
<th class="report_json_url">JSON URL</th> |
288 |
<th class="report_json_url">JSON URL</th> |
| 283 |
[% IF (usecache) %] |
289 |
[% IF (usecache) %] |
| 284 |
<th>Cache expiry (seconds)</th> |
290 |
<th>Cache expiry (seconds)</th> |
| 285 |
[% ELSE %] |
291 |
[% ELSE %] |
| 286 |
<th class="NoVisible">Cache expiry (seconds)</th> |
292 |
<th class="NoVisible">Cache expiry (seconds)</th> |
| 287 |
[% END %] |
293 |
[% END %] |
| 288 |
<th>Saved results</th> |
294 |
<th>Saved results</th> |
| 289 |
[% IF has_obsolete_reports %] |
295 |
[% IF has_obsolete_reports %] |
| 290 |
<th>Update</th> |
296 |
<th>Update</th> |
| 291 |
[% ELSE %] |
297 |
[% ELSE %] |
| 292 |
<th class="NoVisible">Update</th> |
298 |
<th class="NoVisible">Update</th> |
| 293 |
[% END %] |
299 |
[% END %] |
| 294 |
<th class="NoSort noExport">Actions</th> |
300 |
<th class="NoSort noExport">Actions</th> |
| 295 |
</tr> |
|
|
| 296 |
</thead> |
| 297 |
<tbody> |
| 298 |
[% FOREACH savedreport IN savedreports %] |
| 299 |
[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %] |
| 300 |
<td class="report_checkbox"> |
| 301 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
| 302 |
<input type="checkbox" name="ids" id="ids[% savedreport.id | html %]" value="[% savedreport.id | html %]" /> |
| 303 |
[% END %] |
| 304 |
<input type="hidden" class="report_sql" value="[% savedreport.savedsql |html %]"> |
| 305 |
</td> |
| 306 |
<td class="report_id"> |
| 307 |
<label for="ids[% savedreport.id | html %]">[% savedreport.id | html %]</label> |
| 308 |
</td> |
| 309 |
<td class="report_name"> |
| 310 |
[% IF ( savedreport.report_name ) %] |
| 311 |
[% savedreport.report_name | html %] |
| 312 |
[% ELSE %] |
| 313 |
[ no name ] |
| 314 |
[% END %] |
| 315 |
</td> |
| 316 |
<td class="report_type"> |
| 317 |
[% savedreport.type | html %] |
| 318 |
</td> |
| 319 |
<td class="report_group"> |
| 320 |
[% savedreport.groupname | html %] |
| 321 |
</td> |
| 322 |
<td> |
| 323 |
[% savedreport.subgroupname | html %] |
| 324 |
</td> |
| 325 |
<td class="report_notes"> |
| 326 |
[% savedreport.notes | html %] |
| 327 |
</td> |
| 328 |
<td> |
| 329 |
[% savedreport.borrowersurname | html %] |
| 330 |
[% IF ( savedreport.borrowerfirstname ) %] |
| 331 |
, [% savedreport.borrowerfirstname | html %] |
| 332 |
[% END %] |
| 333 |
([% savedreport.borrowernumber | html %]) |
| 334 |
</td> |
| 335 |
<td data-order="[% savedreport.date_created | html %]"> |
| 336 |
[% savedreport.date_created | $KohaDates %] |
| 337 |
</td> |
| 338 |
<td data-order="[% savedreport.last_modified | html %]"> |
| 339 |
[% savedreport.last_modified | $KohaDates with_hours => 1 %] |
| 340 |
</td> |
| 341 |
<td data-order="[% savedreport.last_run | html %]"> |
| 342 |
[% savedreport.last_run | $KohaDates with_hours => 1 %] |
| 343 |
</td> |
| 344 |
<td class="report_public"> |
| 345 |
[% IF (savedreport.public) %] |
| 346 |
Yes |
| 347 |
[% ELSE %] |
| 348 |
No |
| 349 |
[% END %] |
| 350 |
</td> |
| 351 |
<td class="report_json_url"> |
| 352 |
[% IF (savedreport.public) %] |
| 353 |
<a href="[% OPACBaseURL | url %]/cgi-bin/koha/svc/report?id=[% savedreport.id | uri %]">[% OPACBaseURL | html %]/cgi-bin/koha/svc/report?id=[% savedreport.id | html %]</a> |
| 354 |
[% ELSE %] |
| 355 |
<a href="/cgi-bin/koha/svc/report?id=[% savedreport.id | uri %]">[% Koha.Preference('staffClientBaseURL') | html %]/cgi-bin/koha/svc/report?id=[% savedreport.id | html %]</a> |
| 356 |
[% END %] |
| 357 |
</td> |
| 358 |
<td> |
| 359 |
[% savedreport.cache_expiry | html %] |
| 360 |
</td> |
| 361 |
<td> |
| 362 |
[% FOR result IN savedreport.results %] |
| 363 |
<a href="/cgi-bin/koha/reports/guided_reports.pl?phase=retrieve%20results&id=[% result.id | uri %]">[% result.date_run | html %]</a> |
| 364 |
<br/> |
| 365 |
[% END %] |
| 366 |
</td> |
| 367 |
<td> |
| 368 |
[% IF savedreport.seems_obsolete %] |
| 369 |
This report seems obsolete, it uses biblioitems.marcxml field. |
| 370 |
<a href="/cgi-bin/koha/svc/convert_report?report_id=[% savedreport.id | uri %]" data-report_id="[% savedreport.id | html %]" class="update_sql btn btn-default btn-xs" title="Update SQL"><i class="fa fa-eye"></i> Update SQL</a> |
| 371 |
[% END %] |
| 372 |
</td> |
| 373 |
<td> |
| 374 |
<div class="btn-group dropup"> |
| 375 |
[%# There should be no space between these two buttons, it would render badly %] |
| 376 |
<a class="btn btn-default btn-xs" role="button" |
| 377 |
href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id | html %]&phase=Run%20this%20report"><i |
| 378 |
class="fa fa-play"></i> Run</a><a |
| 379 |
class="btn btn-default btn-xs dropdown-toggle" id="reportactions[% savedreport.id | html %]" role="button" data-toggle="dropdown" |
| 380 |
href="#"><b class="caret"></b></a> |
| 381 |
<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="reportactions[% savedreport.id | html %]"> |
| 382 |
<li><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id | uri %]&phase=Show%20SQL"><i class="fa fa-search"></i> View</a></li> |
| 383 |
<li> |
| 384 |
<a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id | uri %]&phase=Show%20SQL" class="preview_sql" data-reportid="[% savedreport.id | html %]"> |
| 385 |
<i class="fa fa-eye"></i> Preview SQL |
| 386 |
</a> |
| 387 |
</li> |
| 388 |
[% IF ( CAN_user_reports_create_reports ) %] |
| 389 |
<li><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id | uri %]&phase=Edit%20SQL"><i class="fa fa-pencil"></i> Edit</a></li> |
| 390 |
<li><a title="Duplicate this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?phase=Create report from existing&report_id=[% savedreport.id | uri %]"><i class="fa fa-copy"></i> Duplicate</a></li> |
| 391 |
[% END %] |
| 392 |
[% IF (Koha.Preference('Mana') == 1) %] |
| 393 |
<li><a class="ShareButton" data-toggle="modal" href="#mana_share_report" title="Share your report with Mana Knowledge Base"><i class="fa fa-share-alt"></i> Share</a></li> |
| 394 |
[% END %] |
| 395 |
<li><a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id | uri %]"><i class="fa fa-clock-o"></i> Schedule</a></li> |
| 396 |
[% IF ( CAN_user_reports_delete_reports ) %] |
| 397 |
<li><a class="confirmdelete" title="Delete this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id | html %]&phase=Delete%20Saved"><i class="fa fa-trash"></i> Delete</a></li> |
| 398 |
[% END %] |
| 399 |
</ul> |
| 400 |
</div> |
| 401 |
<input type="hidden" id="previewSql[% savedreport.id | html %]" value="[% savedreport.savedsql | html %]" data-title="[% savedreport.report_name | html %]" /> |
| 402 |
</td> |
| 403 |
</tr> |
301 |
</tr> |
| 404 |
[% END %] |
302 |
</thead> |
| 405 |
</tbody> |
303 |
<tbody> |
| 406 |
</table> |
304 |
[% FOREACH savedreport IN savedreports %] |
|
|
305 |
[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %] |
| 306 |
<td class="report_checkbox"> |
| 307 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
| 308 |
<input type="checkbox" name="ids" id="ids[% savedreport.id | html %]" value="[% savedreport.id | html %]" /> |
| 309 |
[% END %] |
| 310 |
<input type="hidden" class="report_sql" value="[% savedreport.savedsql |html %]"> |
| 311 |
</td> |
| 312 |
<td class="report_id"> |
| 313 |
<label for="ids[% savedreport.id | html %]">[% savedreport.id | html %]</label> |
| 314 |
</td> |
| 315 |
<td class="report_name"> |
| 316 |
[% IF ( savedreport.report_name ) %] |
| 317 |
[% savedreport.report_name | html %] |
| 318 |
[% ELSE %] |
| 319 |
[ no name ] |
| 320 |
[% END %] |
| 321 |
</td> |
| 322 |
<td class="report_type"> |
| 323 |
[% savedreport.type | html %] |
| 324 |
</td> |
| 325 |
<td class="report_group"> |
| 326 |
[% savedreport.groupname | html %] |
| 327 |
</td> |
| 328 |
<td> |
| 329 |
[% savedreport.subgroupname | html %] |
| 330 |
</td> |
| 331 |
<td class="report_notes"> |
| 332 |
[% savedreport.notes | html %] |
| 333 |
</td> |
| 334 |
<td> |
| 335 |
[% savedreport.borrowersurname | html %] |
| 336 |
[% IF ( savedreport.borrowerfirstname ) %] |
| 337 |
, [% savedreport.borrowerfirstname | html %] |
| 338 |
[% END %] |
| 339 |
([% savedreport.borrowernumber | html %]) |
| 340 |
</td> |
| 341 |
<td data-order="[% savedreport.date_created | html %]"> |
| 342 |
[% savedreport.date_created | $KohaDates %] |
| 343 |
</td> |
| 344 |
<td data-order="[% savedreport.last_modified | html %]"> |
| 345 |
[% savedreport.last_modified | $KohaDates with_hours => 1 %] |
| 346 |
</td> |
| 347 |
<td data-order="[% savedreport.last_run | html %]"> |
| 348 |
[% savedreport.last_run | $KohaDates with_hours => 1 %] |
| 349 |
</td> |
| 350 |
<td class="report_public"> |
| 351 |
[% IF (savedreport.public) %] |
| 352 |
Yes |
| 353 |
[% ELSE %] |
| 354 |
No |
| 355 |
[% END %] |
| 356 |
</td> |
| 357 |
<td class="report_json_url"> |
| 358 |
[% IF (savedreport.public) %] |
| 359 |
<a href="[% OPACBaseURL | url %]/cgi-bin/koha/svc/report?id=[% savedreport.id | uri %]">[% OPACBaseURL | html %]/cgi-bin/koha/svc/report?id=[% savedreport.id | html %]</a> |
| 360 |
[% ELSE %] |
| 361 |
<a href="/cgi-bin/koha/svc/report?id=[% savedreport.id | uri %]">[% Koha.Preference('staffClientBaseURL') | html %]/cgi-bin/koha/svc/report?id=[% savedreport.id | html %]</a> |
| 362 |
[% END %] |
| 363 |
</td> |
| 364 |
<td> |
| 365 |
[% savedreport.cache_expiry | html %] |
| 366 |
</td> |
| 367 |
<td> |
| 368 |
[% FOR result IN savedreport.results %] |
| 369 |
<a href="/cgi-bin/koha/reports/guided_reports.pl?phase=retrieve%20results&id=[% result.id | uri %]">[% result.date_run | html %]</a> |
| 370 |
<br/> |
| 371 |
[% END %] |
| 372 |
</td> |
| 373 |
<td> |
| 374 |
[% IF savedreport.seems_obsolete %] |
| 375 |
This report seems obsolete, it uses biblioitems.marcxml field. |
| 376 |
<a href="/cgi-bin/koha/svc/convert_report?report_id=[% savedreport.id | uri %]" data-report_id="[% savedreport.id | html %]" class="update_sql btn btn-default btn-xs" title="Update SQL"><i class="fa fa-eye"></i> Update SQL</a> |
| 377 |
[% END %] |
| 378 |
</td> |
| 379 |
<td> |
| 380 |
<div class="btn-group dropup"> |
| 381 |
[%# There should be no space between these two buttons, it would render badly %] |
| 382 |
<a class="btn btn-default btn-xs" role="button" |
| 383 |
href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id | html %]&phase=Run%20this%20report"><i |
| 384 |
class="fa fa-play"></i> Run</a><a |
| 385 |
class="btn btn-default btn-xs dropdown-toggle" id="reportactions[% savedreport.id | html %]" role="button" data-toggle="dropdown" |
| 386 |
href="#"><b class="caret"></b></a> |
| 387 |
<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="reportactions[% savedreport.id | html %]"> |
| 388 |
<li><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id | uri %]&phase=Show%20SQL"><i class="fa fa-search"></i> View</a></li> |
| 389 |
<li> |
| 390 |
<a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id | uri %]&phase=Show%20SQL" class="preview_sql" data-reportid="[% savedreport.id | html %]"> |
| 391 |
<i class="fa fa-eye"></i> Preview SQL |
| 392 |
</a> |
| 393 |
</li> |
| 394 |
[% IF ( CAN_user_reports_create_reports ) %] |
| 395 |
<li><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id | uri %]&phase=Edit%20SQL"><i class="fa fa-pencil"></i> Edit</a></li> |
| 396 |
<li><a title="Duplicate this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?phase=Create report from existing&report_id=[% savedreport.id | uri %]"><i class="fa fa-copy"></i> Duplicate</a></li> |
| 397 |
[% END %] |
| 398 |
[% IF (Koha.Preference('Mana') == 1) %] |
| 399 |
<li><a class="ShareButton" data-toggle="modal" href="#mana_share_report" title="Share your report with Mana Knowledge Base"><i class="fa fa-share-alt"></i> Share</a></li> |
| 400 |
[% END %] |
| 401 |
<li><a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id | uri %]"><i class="fa fa-clock-o"></i> Schedule</a></li> |
| 402 |
[% IF ( CAN_user_reports_delete_reports ) %] |
| 403 |
<li><a class="confirmdelete" title="Delete this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id | html %]&phase=Delete%20Saved"><i class="fa fa-trash"></i> Delete</a></li> |
| 404 |
[% END %] |
| 405 |
</ul> |
| 406 |
</div> |
| 407 |
<input type="hidden" id="previewSql[% savedreport.id | html %]" value="[% savedreport.savedsql | html %]" data-title="[% savedreport.report_name | html %]" /> |
| 408 |
</td> |
| 409 |
</tr> |
| 410 |
[% END %] |
| 411 |
</tbody> |
| 412 |
</table> |
| 407 |
|
413 |
|
| 408 |
[% IF ( CAN_user_reports_delete_reports ) %] |
414 |
[% IF ( CAN_user_reports_delete_reports ) %] |
| 409 |
<fieldset class="action"> |
415 |
<fieldset class="action"> |
| 410 |
<input type="submit" value="Delete selected" /> |
416 |
<input type="submit" value="Delete selected" /> |
| 411 |
</fieldset> |
417 |
</fieldset> |
| 412 |
[% END %] |
418 |
[% END %] |
| 413 |
</form> |
419 |
</form> |
| 414 |
</div> |
420 |
</div> <!-- /#reports --> |
|
|
421 |
</div> <!-- /.tab-content --> |
| 415 |
</div> |
422 |
</div> |
| 416 |
[% ELSE # IF ( savedreports ) %] |
423 |
[% ELSE # IF ( savedreports ) %] |
| 417 |
<div class="dialog message"> |
424 |
<div class="dialog message"> |
|
Lines 1912-1927
Link Here
|
| 1912 |
} |
1919 |
} |
| 1913 |
}, columns_settings); |
1920 |
}, columns_settings); |
| 1914 |
|
1921 |
|
| 1915 |
var rtabs = $("#tabs").tabs({ |
1922 |
$("#tabs a[data-toggle='tab']").on("shown.bs.tab", function (e) { |
| 1916 |
create: function( e, ui ){ |
1923 |
tabsInit( $(e.target).parent(), rtable ); |
| 1917 |
tabsInit( ui, rtable ); |
|
|
| 1918 |
}, |
| 1919 |
activate: function( e, ui ){ |
| 1920 |
tabsInit( ui, rtable ); |
| 1921 |
} |
| 1922 |
}); |
1924 |
}); |
|
|
1925 |
|
| 1923 |
if( activeTab ){ |
1926 |
if( activeTab ){ |
| 1924 |
$("#tabs").tabs("option","active", activeTab ); |
1927 |
$("#tabs li:eq(" + activeTab + ") a").tab("show"); |
| 1925 |
} |
1928 |
} |
| 1926 |
|
1929 |
|
| 1927 |
$("#subgroup_filter").change(function() { |
1930 |
$("#subgroup_filter").change(function() { |
|
Lines 2217-2224
Link Here
|
| 2217 |
$("#toggle_auto_links").click(); |
2220 |
$("#toggle_auto_links").click(); |
| 2218 |
} |
2221 |
} |
| 2219 |
|
2222 |
|
| 2220 |
function tabsInit( ui, rtable ){ |
2223 |
function tabsInit( tab, rtable ){ |
| 2221 |
var thisTab = ui.newTab ? ui.newTab : ui.tab; |
2224 |
var thisTab = tab; // ui.newTab ? ui.newTab : ui.tab; |
| 2222 |
var activeTab = thisTab.index(); |
2225 |
var activeTab = thisTab.index(); |
| 2223 |
localStorage.setItem("sql_reports_activetab", activeTab ); |
2226 |
localStorage.setItem("sql_reports_activetab", activeTab ); |
| 2224 |
|
2227 |
|
|
Lines 2232-2239
Link Here
|
| 2232 |
rtable.fnSetColumnVis(4, true); |
2235 |
rtable.fnSetColumnVis(4, true); |
| 2233 |
rtable.fnSetColumnVis(5, true); |
2236 |
rtable.fnSetColumnVis(5, true); |
| 2234 |
|
2237 |
|
| 2235 |
var g_id = $(ui.newTab).children().attr('id'); |
2238 |
var g_id = $( tab ).children().attr('id'); |
| 2236 |
var g_name = $(ui.newTab).text(); |
2239 |
var g_name = $( tab ).children().text(); |
| 2237 |
if ( g_name == _("All") ) { |
2240 |
if ( g_name == _("All") ) { |
| 2238 |
g_id = ""; |
2241 |
g_id = ""; |
| 2239 |
g_name = ""; |
2242 |
g_name = ""; |
| 2240 |
- |
|
|