Lines 1-4
Link Here
|
1 |
[% USE KohaDates %] |
1 |
[% USE KohaDates %] |
|
|
2 |
[% USE Koha %] |
2 |
|
3 |
|
3 |
[%- BLOCK area_name -%] |
4 |
[%- BLOCK area_name -%] |
4 |
[%- SWITCH area -%] |
5 |
[%- SWITCH area -%] |
Lines 66-71
function load_group_subgroups () {
Link Here
|
66 |
} |
67 |
} |
67 |
} |
68 |
} |
68 |
|
69 |
|
|
|
70 |
function share() { |
71 |
window.location="/cgi-bin/koha/reports/guided_reports.pl?phase=Save"; |
72 |
} |
73 |
|
69 |
$(document).ready(function(){ |
74 |
$(document).ready(function(){ |
70 |
$('#limit').change(function() { |
75 |
$('#limit').change(function() { |
71 |
$('#limitselect').submit(); |
76 |
$('#limitselect').submit(); |
Lines 76-81
$(".goback").on("click",function(e){
Link Here
|
76 |
window.history.back(); |
81 |
window.history.back(); |
77 |
}); |
82 |
}); |
78 |
|
83 |
|
|
|
84 |
$(".mana_search_button").on("click",function(){ |
85 |
mana_search($(this).prev().val()); |
86 |
}); |
87 |
|
88 |
$(".ShareButton").on("click", function(){ |
89 |
if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){ |
90 |
$("#shared_infos").hide(); |
91 |
$("#ManaShareButton").hide(); |
92 |
$("#noterror").show(); |
93 |
} |
94 |
else{ |
95 |
$("#shared_id").html($(this).closest("tr").find(".report_id").text()); |
96 |
$("#shared_name").html($(this).closest("tr").find(".report_name").text()); |
97 |
$("#shared_sql").html($(this).closest("tr").find(".report_sql").val()); |
98 |
$("#shared_type").html($(this).closest("tr").find(".report_type").text()); |
99 |
$("#shared_group").html($(this).closest("tr").find(".report_group").text()); |
100 |
$("#shared_notes").html($(this).closest("tr").find(".report_notes").text()); |
101 |
} |
102 |
}); |
103 |
|
104 |
$('#search_form').submit(function () { |
105 |
return false; |
106 |
}); |
107 |
|
79 |
$("#addColumn").on("click",function(){ |
108 |
$("#addColumn").on("click",function(){ |
80 |
addColumn(); |
109 |
addColumn(); |
81 |
}); |
110 |
}); |
Lines 238-244
$("#delColumn").on("click",function(){
Link Here
|
238 |
}); |
267 |
}); |
239 |
[% END %] |
268 |
[% END %] |
240 |
}); |
269 |
}); |
241 |
//]]> |
270 |
|
|
|
271 |
function mana_increment(mana_id, resourcename, fieldvalue, stepvalue = 1){ |
272 |
$.ajax( { |
273 |
type: "POST", |
274 |
url: "/cgi-bin/koha/svc/mana/addvaluetofield", |
275 |
data: {id: mana_id, field: fieldvalue, resource: resourcename, step: stepvalue}, |
276 |
datatype: "json", |
277 |
}).done( function() { |
278 |
}).fail( function(){ }); |
279 |
} |
280 |
|
281 |
function mana_use( mana_id ){ |
282 |
$.ajax( { |
283 |
type:"POST", |
284 |
url: "/cgi-bin/koha/svc/mana/use", |
285 |
data: {id:mana_id, resource: 'report', saveinbase: 1}, |
286 |
dataType: "json", |
287 |
}) |
288 |
} |
289 |
|
290 |
function mana_search( textquery ){ |
291 |
$.ajax({ |
292 |
type: "POST", |
293 |
url: "/cgi-bin/koha/svc/mana/search", |
294 |
data: {biblionumber: $("#biblionumber").val(), resource: 'report', id: textquery, usecomments: 1}, |
295 |
dataType: "html", |
296 |
}) |
297 |
.done( function( result ) { |
298 |
$("#mana_search_result .modal-body").html(result); |
299 |
$("#mana_search_result_label").text("Results from Mana Knowledge Base"); |
300 |
$("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults,{ |
301 |
"sPaginationType":"four_button", |
302 |
"autoWidth": false, |
303 |
"columnDefs": [ |
304 |
{ "width": "35%", "targets": 1 } |
305 |
], |
306 |
"aoColumnDefs": [ |
307 |
{ 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, |
308 |
{ "sType": "title-string", "aTargets" : [ "title-string" ] }, |
309 |
{ 'sType': "anti-the", 'aTargets' : [ 'anti-the'] } |
310 |
] |
311 |
})); |
312 |
if($("td.dataTables_empty").length == 0){ |
313 |
$("#mana_search").show(); |
314 |
} |
315 |
|
316 |
$( "select[class='actionreport1']" ).show(); |
317 |
$( "button[class='actionreport2']" ).hide(); |
318 |
$("#CommentButton").on("click", function(){ |
319 |
var resource_type = "report"; |
320 |
var target_id = $("#selected_id").val(); |
321 |
var manamsg = $("#manamsg").val(); |
322 |
mana_comment(target_id, manamsg, resource_type); |
323 |
$("#comment_box").modal("hide"); |
324 |
}); |
325 |
|
326 |
$(".showbutton").on("click", function(){ |
327 |
$(this).parent().hide(); |
328 |
$(this).parent().next().show(); |
329 |
}); |
330 |
|
331 |
$("a[class='hidebutton']").on("click", function(){ |
332 |
$(this).parent().hide(); |
333 |
$(this).parent().prev().show(); |
334 |
}); |
335 |
|
336 |
$("#commentCloseButton").on("click", function(){ |
337 |
$("#comment_box").modal("hide"); |
338 |
}); |
339 |
|
340 |
$(".actionreport1").on("click", function(){ |
341 |
$("#selectedcomment").val($(this).val()); |
342 |
$(this).parent("select").hide(); |
343 |
$(this).parent("select").next().show(); |
344 |
}); |
345 |
|
346 |
$(".actionreport2").on("click", function(){ |
347 |
$(this).hide(); |
348 |
$(this).prev().show(); |
349 |
mana_increment($("#selectedcomment").val(), 'resource_comment', 'nb', -1); |
350 |
}); |
351 |
}).fail( function( result ){ |
352 |
}); |
353 |
} |
354 |
|
355 |
function mana_comment( target_id, manamsg, resource_type ){ |
356 |
$.ajax( { |
357 |
type: "POST", |
358 |
url: "/cgi-bin/koha/svc/mana/share", |
359 |
data: {message: manamsg, resource: resource_type , resource_id: target_id}, |
360 |
datatype: "json", |
361 |
}) |
362 |
} |
363 |
|
364 |
|
365 |
|
242 |
</script> |
366 |
</script> |
243 |
</head> |
367 |
</head> |
244 |
<body id="rep_guided_reports_start" class="rep"> |
368 |
<body id="rep_guided_reports_start" class="rep"> |
Lines 304-309
canned reports and writing custom SQL reports.</p>
Link Here
|
304 |
</form> |
428 |
</form> |
305 |
[% END %] |
429 |
[% END %] |
306 |
|
430 |
|
|
|
431 |
<div id="mana_search_result" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="mana_search_result_label" style="width: 100%; left:0%; margin-left: auto; display: none;"> |
432 |
<div class="modal-dialog modal-lg"> |
433 |
<div class="modal-content"> |
434 |
<div class="modal-header"> |
435 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
436 |
<h3 id="mana_search_result_label"> Mana Search</h3> |
437 |
</div> |
438 |
<div> |
439 |
<form id="search_form" style="margin-left: 5%"> |
440 |
Please enter a few key words: |
441 |
<input type=text id=mana_search_field> |
442 |
<input type=button class="mana_search_button" value="Search"> |
443 |
</form> |
444 |
<div class="modal-body"> |
445 |
</div> |
446 |
</div> |
447 |
</div> |
448 |
</div> |
449 |
</div> |
450 |
|
451 |
|
307 |
[% IF ( saved1 ) %] |
452 |
[% IF ( saved1 ) %] |
308 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
453 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
309 |
|
454 |
|
Lines 321-326
canned reports and writing custom SQL reports.</p>
Link Here
|
321 |
<option value="">All</option> |
466 |
<option value="">All</option> |
322 |
</select> |
467 |
</select> |
323 |
</div> |
468 |
</div> |
|
|
469 |
<div style="display:inline-block"> |
470 |
[% IF (manamsg == 'success') %] |
471 |
<div id="mana_search" class="dialog message"> |
472 |
<p> Shared successfully! Thanks for your help.</p> |
473 |
</div> |
474 |
[% ELSIF (manamsg == 'fail') %] |
475 |
<div id="mana_search" class="dialog message"> |
476 |
<p> An error occured while sharing, please try again later.</p> |
477 |
</div> |
478 |
[% END %] |
479 |
|
480 |
[% IF (Koha.Preference('Mana') == 1) %] |
481 |
<div id="mana_search" class="dialog message"> |
482 |
<p> You want more reports? Check the Mana Knowledge Base <p> <a style="cursor:pointer" data-toggle="modal" data-target="#mana_search_result">Quick Search</a></p> |
483 |
</div> |
484 |
[% END %] |
485 |
|
486 |
</script> |
487 |
<h1> [% savedreport.sql %]</h1> |
324 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
488 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
325 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
489 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
326 |
<table id="table_reports"> |
490 |
<table id="table_reports"> |
Lines 346-368
canned reports and writing custom SQL reports.</p>
Link Here
|
346 |
<tbody> |
510 |
<tbody> |
347 |
[% FOREACH savedreport IN savedreports %] |
511 |
[% FOREACH savedreport IN savedreports %] |
348 |
[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %] |
512 |
[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %] |
349 |
<td> |
513 |
<td class="report_checkbox"> |
350 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
514 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
351 |
<input type="checkbox" name="ids" value="[% savedreport.id %]" /> |
515 |
<input type="checkbox" name="ids" value="[% savedreport.id %]" /> |
352 |
[% END %] |
516 |
[% END %] |
|
|
517 |
<input hidden class="report_sql" value="[% savedreport.savedsql %]"> |
353 |
</td> |
518 |
</td> |
354 |
<td><label for="ids">[% savedreport.id %]</label></td> |
519 |
<td class="report_id"><label for="ids">[% savedreport.id %]</label></td> |
355 |
<td> |
520 |
<td class="report_name"> |
356 |
[% IF ( savedreport.report_name ) %] |
521 |
[% IF ( savedreport.report_name ) %] |
357 |
[% savedreport.report_name %] |
522 |
[% savedreport.report_name %] |
358 |
[% ELSE %] |
523 |
[% ELSE %] |
359 |
[ no name ] |
524 |
[ no name ] |
360 |
[% END %] |
525 |
[% END %] |
361 |
</td> |
526 |
</td> |
362 |
<td>[% savedreport.type %]</td> |
527 |
<td class="report_type">[% savedreport.type %]</td> |
363 |
<td>[% savedreport.groupname %]</td> |
528 |
<td class="report_group">[% savedreport.groupname %]</td> |
364 |
<td>[% savedreport.subgroupname %]</td> |
529 |
<td>[% savedreport.subgroupname %]</td> |
365 |
<td>[% savedreport.notes %]</td> |
530 |
<td class="report_notes">[% savedreport.notes %]</td> |
366 |
<td>[% savedreport.borrowersurname %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname %][% END %] ([% savedreport.borrowernumber %])</td> |
531 |
<td>[% savedreport.borrowersurname %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname %][% END %] ([% savedreport.borrowernumber %])</td> |
367 |
<td><span title="[% savedreport.date_created %]">[% savedreport.date_created | $KohaDates %]</span></td> |
532 |
<td><span title="[% savedreport.date_created %]">[% savedreport.date_created | $KohaDates %]</span></td> |
368 |
<td><span title="[% savedreport.last_modified %]">[% savedreport.last_modified | $KohaDates with_hours => 1 %]</span></td> |
533 |
<td><span title="[% savedreport.last_modified %]">[% savedreport.last_modified | $KohaDates with_hours => 1 %]</span></td> |
Lines 394-399
canned reports and writing custom SQL reports.</p>
Link Here
|
394 |
<li><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Edit%20SQL"><i class="fa fa-pencil"></i> Edit</a></li> |
559 |
<li><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Edit%20SQL"><i class="fa fa-pencil"></i> Edit</a></li> |
395 |
<li><a title="Duplicate this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?phase=Create report from SQL&sql=[% savedreport.savedsql |uri %]&reportname=[% savedreport.report_name |uri %]&notes=[% savedreport.notes |uri %]"><i class="fa fa-copy"></i> Duplicate</a></li> |
560 |
<li><a title="Duplicate this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?phase=Create report from SQL&sql=[% savedreport.savedsql |uri %]&reportname=[% savedreport.report_name |uri %]&notes=[% savedreport.notes |uri %]"><i class="fa fa-copy"></i> Duplicate</a></li> |
396 |
[% END %] |
561 |
[% END %] |
|
|
562 |
[% IF (Koha.Preference('Mana') == 1) %] |
563 |
<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> |
564 |
[% END %] |
397 |
<li><a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id %]"><i class="fa fa-clock-o"></i> Schedule</a></li> |
565 |
<li><a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id %]"><i class="fa fa-clock-o"></i> Schedule</a></li> |
398 |
[% IF ( CAN_user_reports_delete_reports ) %] |
566 |
[% IF ( CAN_user_reports_delete_reports ) %] |
399 |
<li><a class="confirmdelete" title="Delete this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Delete%20Saved"><i class="fa fa-trash"></i> Delete</a></li> |
567 |
<li><a class="confirmdelete" title="Delete this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Delete%20Saved"><i class="fa fa-trash"></i> Delete</a></li> |
Lines 406-411
canned reports and writing custom SQL reports.</p>
Link Here
|
406 |
[% END %] |
574 |
[% END %] |
407 |
</tbody> |
575 |
</tbody> |
408 |
</table> |
576 |
</table> |
|
|
577 |
</div> |
409 |
[% IF ( CAN_user_reports_delete_reports ) %] |
578 |
[% IF ( CAN_user_reports_delete_reports ) %] |
410 |
<fieldset class="action"> |
579 |
<fieldset class="action"> |
411 |
<input type="submit" value="Delete selected" /> |
580 |
<input type="submit" value="Delete selected" /> |
Lines 446-451
canned reports and writing custom SQL reports.</p>
Link Here
|
446 |
[% END %] |
615 |
[% END %] |
447 |
[% END %] |
616 |
[% END %] |
448 |
|
617 |
|
|
|
618 |
<div id="mana_share_report" class="modal fade" tabindex="-1" role="dialog" arialabelledby="mana_share_modal_label" style="display: none;"> |
619 |
<div class="modal-dialog"> |
620 |
<div class="modal-content"> |
621 |
<div class="modal-header"> |
622 |
<h3 id="mana_share_modal_label">Share with Mana</h3> |
623 |
</div> |
624 |
<div class="modal-body"> |
625 |
[% IF (mana_id) %] |
626 |
<div class="alert"> |
627 |
<p>Your subscription is already linked with a Mana subscription model. Share it if you have made modifications, otherwise it will do nothing.</p> |
628 |
</div> |
629 |
[% END %] |
630 |
[% IF ( languages_loop ) %] |
631 |
[% UNLESS ( one_language_enabled ) %] |
632 |
<label id="noteerror" type="hidden">Please enter a report name and descriptive note before sharing (minimum 20 characters)</label> |
633 |
<div id="shared_infos" class="rows"> |
634 |
<li> <span class="label">Id: </span><div id="shared_id"></div> |
635 |
</li> |
636 |
<li> <span class="label">Name: </span><div id="shared_name"></div> |
637 |
</li> |
638 |
<li> <span class="label">SQL: </span><div id="shared_sql"></div> |
639 |
</li> |
640 |
<li> <span class="label">Group: </span><div id="shared_group"></div> |
641 |
</li> |
642 |
<li> <span class="label">Type: </span><div id="shared_type"></div> |
643 |
</li> |
644 |
<li> <span class="label">Notes: </span><div id="shared_notes"></div> |
645 |
</li> |
646 |
|
647 |
</div> |
648 |
<div class="rows"> |
649 |
<form method="post" id="mana_share_form" action="/cgi-bin/koha/reports/guided_reports.pl?phase=Share" class="validated" > |
650 |
<input type="hidden" name="phase" value="Share"> |
651 |
|
652 |
<fieldset> |
653 |
<label for="mana_language">Language:</label> |
654 |
<select id="mana_language" name="mana_language"> |
655 |
[% FOREACH languages_loo IN languages_loop %] |
656 |
[% IF ( languages_loo.group_enabled ) %] |
657 |
[% IF ( languages_loo.plural ) %] |
658 |
[% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %] |
659 |
[% IF ( sublanguages_loo.enabled ) %] |
660 |
[% IF ( sublanguages_loo.sublanguage_current ) %] |
661 |
<option value="[% languages_loo.rfc4646_subtag %]" selected> |
662 |
[% sublanguages_loo.native_description %] |
663 |
[% sublanguages_loo.script_description %] |
664 |
[% sublanguages_loo.region_description %] |
665 |
|
666 |
[% sublanguages_loo.variant_description %] |
667 |
([% sublanguages_loo.rfc4646_subtag %]) |
668 |
</option> |
669 |
[% ELSE %] |
670 |
<option value="[% languages_loo.rfc4646_subtag %]"> |
671 |
[% sublanguages_loo.native_description %] |
672 |
[% sublanguages_loo.script_description %] |
673 |
[% sublanguages_loo.region_description %] |
674 |
[% sublanguages_loo.variant_description %] |
675 |
([% sublanguages_loo.rfc4646_subtag %]) |
676 |
</option> |
677 |
[% END %] |
678 |
[% END %] |
679 |
[% END %] |
680 |
[% ELSE %] |
681 |
[% IF ( languages_loo.group_enabled ) %] |
682 |
[% IF ( languages_loo.current ) %] |
683 |
<option value="[% languages_loo.rfc4646_subtag %]" selected> |
684 |
[% IF ( languages_loo.native_description ) %] |
685 |
[% languages_loo.native_description %] |
686 |
[% ELSE %] |
687 |
[% languages_loo.rfc4646_subtag %] |
688 |
[% END %] |
689 |
</option> |
690 |
[% ELSE %] |
691 |
<option value="[% languages_loo.rfc4646_subtag %]"> |
692 |
[% IF ( languages_loo.native_description ) %] |
693 |
[% languages_loo.native_description %] |
694 |
[% ELSE %] |
695 |
[% languages_loo.rfc4646_subtag %] |
696 |
[% END %] |
697 |
</option> |
698 |
[% END %] |
699 |
[% END %] |
700 |
[% END %] |
701 |
[% END %] |
702 |
[% END %] |
703 |
</select> |
704 |
<input type="hidden" id="reportid" name="reportid" value="[% savedreport.id %]"/> |
705 |
</fieldset> |
706 |
</form> |
707 |
</div> |
708 |
[% END %] |
709 |
[% END %] |
710 |
</div> |
711 |
<div class="modal-footer"> |
712 |
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button> |
713 |
[% IF one_language_enabled==0 %] |
714 |
<button id="ManaShareButton" type="submit" form="mana_share_form" class="btn btn-primary">Share</button> |
715 |
[% ELSE %] |
716 |
<div id="ManaShareButton" class="btn-group"><a class="btn btn-primary"'onclick="share()">Share</a></div> |
717 |
[% END %] |
718 |
</div> |
719 |
</div> |
720 |
</div> |
721 |
</div> |
722 |
|
449 |
|
723 |
|
450 |
[% IF ( build1 ) %] |
724 |
[% IF ( build1 ) %] |
451 |
[% IF ( cache_error) %] |
725 |
[% IF ( cache_error) %] |