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 232-238
$("#delColumn").on("click",function(){
Link Here
|
232 |
}); |
261 |
}); |
233 |
[% END %] |
262 |
[% END %] |
234 |
}); |
263 |
}); |
235 |
//]]> |
264 |
|
|
|
265 |
function mana_increment(mana_id, resourcename, fieldvalue, stepvalue = 1){ |
266 |
$.ajax( { |
267 |
type: "POST", |
268 |
url: "/cgi-bin/koha/svc/mana/addvaluetofield", |
269 |
data: {id: mana_id, field: fieldvalue, resource: resourcename, step: stepvalue}, |
270 |
datatype: "json", |
271 |
}).done( function() { |
272 |
}).fail( function(){ }); |
273 |
} |
274 |
|
275 |
function mana_use( mana_id ){ |
276 |
$.ajax( { |
277 |
type:"POST", |
278 |
url: "/cgi-bin/koha/svc/mana/use", |
279 |
data: {id:mana_id, resource: 'report', saveinbase: 1}, |
280 |
dataType: "json", |
281 |
}) |
282 |
} |
283 |
|
284 |
function mana_search( textquery ){ |
285 |
$.ajax({ |
286 |
type: "POST", |
287 |
url: "/cgi-bin/koha/svc/mana/search", |
288 |
data: {biblionumber: $("#biblionumber").val(), resource: 'report', id: textquery, usecomments: 1}, |
289 |
dataType: "html", |
290 |
}) |
291 |
.done( function( result ) { |
292 |
$("#mana_search_result .modal-body").html(result); |
293 |
$("#mana_search_result_label").text("Results from Mana Knowledge Base"); |
294 |
$("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults,{ |
295 |
"sPaginationType":"four_button", |
296 |
"autoWidth": false, |
297 |
"columnDefs": [ |
298 |
{ "width": "35%", "targets": 1 } |
299 |
], |
300 |
"aoColumnDefs": [ |
301 |
{ 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, |
302 |
{ "sType": "title-string", "aTargets" : [ "title-string" ] }, |
303 |
{ 'sType': "anti-the", 'aTargets' : [ 'anti-the'] } |
304 |
] |
305 |
})); |
306 |
if($("td.dataTables_empty").length == 0){ |
307 |
$("#mana_search").show(); |
308 |
} |
309 |
|
310 |
$( "select[class='actionreport1']" ).show(); |
311 |
$( "button[class='actionreport2']" ).hide(); |
312 |
$("#CommentButton").on("click", function(){ |
313 |
var resource_type = "report"; |
314 |
var target_id = $("#selected_id").val(); |
315 |
var manamsg = $("#manamsg").val(); |
316 |
mana_comment(target_id, manamsg, resource_type); |
317 |
$("#comment_box").modal("hide"); |
318 |
}); |
319 |
|
320 |
$(".showbutton").on("click", function(){ |
321 |
$(this).parent().hide(); |
322 |
$(this).parent().next().show(); |
323 |
}); |
324 |
|
325 |
$("a[class='hidebutton']").on("click", function(){ |
326 |
$(this).parent().hide(); |
327 |
$(this).parent().prev().show(); |
328 |
}); |
329 |
|
330 |
$("#commentCloseButton").on("click", function(){ |
331 |
$("#comment_box").modal("hide"); |
332 |
}); |
333 |
|
334 |
$(".actionreport1").on("click", function(){ |
335 |
$("#selectedcomment").val($(this).val()); |
336 |
$(this).parent("select").hide(); |
337 |
$(this).parent("select").next().show(); |
338 |
}); |
339 |
|
340 |
$(".actionreport2").on("click", function(){ |
341 |
$(this).hide(); |
342 |
$(this).prev().show(); |
343 |
mana_increment($("#selectedcomment").val(), 'resource_comment', 'nb', -1); |
344 |
}); |
345 |
}).fail( function( result ){ |
346 |
}); |
347 |
} |
348 |
|
349 |
function mana_comment( target_id, manamsg, resource_type ){ |
350 |
$.ajax( { |
351 |
type: "POST", |
352 |
url: "/cgi-bin/koha/svc/mana/share", |
353 |
data: {message: manamsg, resource: resource_type , resource_id: target_id}, |
354 |
datatype: "json", |
355 |
}) |
356 |
} |
357 |
|
358 |
|
359 |
|
236 |
</script> |
360 |
</script> |
237 |
</head> |
361 |
</head> |
238 |
<body id="rep_guided_reports_start" class="rep"> |
362 |
<body id="rep_guided_reports_start" class="rep"> |
Lines 298-303
canned reports and writing custom SQL reports.</p>
Link Here
|
298 |
</form> |
422 |
</form> |
299 |
[% END %] |
423 |
[% END %] |
300 |
|
424 |
|
|
|
425 |
<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;"> |
426 |
<div class="modal-dialog modal-lg"> |
427 |
<div class="modal-content"> |
428 |
<div class="modal-header"> |
429 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
430 |
<h3 id="mana_search_result_label"> Mana Search</h3> |
431 |
</div> |
432 |
<div> |
433 |
<form id="search_form" style="margin-left: 5%"> |
434 |
Please enter a few key words: |
435 |
<input type=text id=mana_search_field> |
436 |
<input type=button class="mana_search_button" value="Search"> |
437 |
</form> |
438 |
<div class="modal-body"> |
439 |
</div> |
440 |
</div> |
441 |
</div> |
442 |
</div> |
443 |
</div> |
444 |
|
445 |
|
301 |
[% IF ( saved1 ) %] |
446 |
[% IF ( saved1 ) %] |
302 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
447 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
303 |
|
448 |
|
Lines 315-320
canned reports and writing custom SQL reports.</p>
Link Here
|
315 |
<option value="">All</option> |
460 |
<option value="">All</option> |
316 |
</select> |
461 |
</select> |
317 |
</div> |
462 |
</div> |
|
|
463 |
<div style="display:inline-block"> |
464 |
[% IF (manamsg == 'success') %] |
465 |
<div id="mana_search" class="dialog message"> |
466 |
<p> Shared successfully! Thanks for your help.</p> |
467 |
</div> |
468 |
[% ELSIF (manamsg == 'fail') %] |
469 |
<div id="mana_search" class="dialog message"> |
470 |
<p> An error occured while sharing, please try again later.</p> |
471 |
</div> |
472 |
[% END %] |
473 |
|
474 |
[% IF (Koha.Preference('Mana') == 1) %] |
475 |
<div id="mana_search" class="dialog message"> |
476 |
<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> |
477 |
</div> |
478 |
[% END %] |
479 |
|
480 |
</script> |
481 |
<h1> [% savedreport.sql %]</h1> |
318 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
482 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
319 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
483 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
320 |
<table id="table_reports"> |
484 |
<table id="table_reports"> |
Lines 338-360
canned reports and writing custom SQL reports.</p>
Link Here
|
338 |
<tbody> |
502 |
<tbody> |
339 |
[% FOREACH savedreport IN savedreports %] |
503 |
[% FOREACH savedreport IN savedreports %] |
340 |
[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %] |
504 |
[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %] |
341 |
<td> |
505 |
<td class="report_checkbox"> |
342 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
506 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
343 |
<input type="checkbox" name="ids" value="[% savedreport.id %]" /> |
507 |
<input type="checkbox" name="ids" value="[% savedreport.id %]" /> |
344 |
[% END %] |
508 |
[% END %] |
|
|
509 |
<input hidden class="report_sql" value="[% savedreport.savedsql %]"> |
345 |
</td> |
510 |
</td> |
346 |
<td><label for="ids">[% savedreport.id %]</label></td> |
511 |
<td class="report_id"><label for="ids">[% savedreport.id %]</label></td> |
347 |
<td> |
512 |
<td class="report_name"> |
348 |
[% IF ( savedreport.report_name ) %] |
513 |
[% IF ( savedreport.report_name ) %] |
349 |
[% savedreport.report_name %] |
514 |
[% savedreport.report_name %] |
350 |
[% ELSE %] |
515 |
[% ELSE %] |
351 |
[ no name ] |
516 |
[ no name ] |
352 |
[% END %] |
517 |
[% END %] |
353 |
</td> |
518 |
</td> |
354 |
<td>[% savedreport.type %]</td> |
519 |
<td class="report_type">[% savedreport.type %]</td> |
355 |
<td>[% savedreport.groupname %]</td> |
520 |
<td class="report_group">[% savedreport.groupname %]</td> |
356 |
<td>[% savedreport.subgroupname %]</td> |
521 |
<td>[% savedreport.subgroupname %]</td> |
357 |
<td>[% savedreport.notes %]</td> |
522 |
<td class="report_notes">[% savedreport.notes %]</td> |
358 |
<td>[% savedreport.borrowersurname %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname %][% END %] ([% savedreport.borrowernumber %])</td> |
523 |
<td>[% savedreport.borrowersurname %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname %][% END %] ([% savedreport.borrowernumber %])</td> |
359 |
<td><span title="[% savedreport.date_created %]">[% savedreport.date_created | $KohaDates %]</span></td> |
524 |
<td><span title="[% savedreport.date_created %]">[% savedreport.date_created | $KohaDates %]</span></td> |
360 |
[% IF (savedreport.public) %] |
525 |
[% IF (savedreport.public) %] |
Lines 384-389
canned reports and writing custom SQL reports.</p>
Link Here
|
384 |
<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> |
549 |
<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> |
385 |
<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> |
550 |
<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> |
386 |
[% END %] |
551 |
[% END %] |
|
|
552 |
[% IF (Koha.Preference('Mana') == 1) %] |
553 |
<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> |
554 |
[% END %] |
387 |
<li><a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id %]"><i class="fa fa-clock-o"></i> Schedule</a></li> |
555 |
<li><a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id %]"><i class="fa fa-clock-o"></i> Schedule</a></li> |
388 |
[% IF ( CAN_user_reports_delete_reports ) %] |
556 |
[% IF ( CAN_user_reports_delete_reports ) %] |
389 |
<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> |
557 |
<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 396-401
canned reports and writing custom SQL reports.</p>
Link Here
|
396 |
[% END %] |
564 |
[% END %] |
397 |
</tbody> |
565 |
</tbody> |
398 |
</table> |
566 |
</table> |
|
|
567 |
</div> |
399 |
[% IF ( CAN_user_reports_delete_reports ) %] |
568 |
[% IF ( CAN_user_reports_delete_reports ) %] |
400 |
<fieldset class="action"> |
569 |
<fieldset class="action"> |
401 |
<input type="submit" value="Delete selected" /> |
570 |
<input type="submit" value="Delete selected" /> |
Lines 436-441
canned reports and writing custom SQL reports.</p>
Link Here
|
436 |
[% END %] |
605 |
[% END %] |
437 |
[% END %] |
606 |
[% END %] |
438 |
|
607 |
|
|
|
608 |
<div id="mana_share_report" class="modal fade" tabindex="-1" role="dialog" arialabelledby="mana_share_modal_label" style="display: none;"> |
609 |
<div class="modal-dialog"> |
610 |
<div class="modal-content"> |
611 |
<div class="modal-header"> |
612 |
<h3 id="mana_share_modal_label">Share with Mana</h3> |
613 |
</div> |
614 |
<div class="modal-body"> |
615 |
[% IF (mana_id) %] |
616 |
<div class="alert"> |
617 |
<p>Your subscription is already linked with a Mana subscription model. Share it if you have made modifications, otherwise it will do nothing.</p> |
618 |
</div> |
619 |
[% END %] |
620 |
[% IF ( languages_loop ) %] |
621 |
[% UNLESS ( one_language_enabled ) %] |
622 |
<label id="noteerror" type="hidden">Please enter a report name and descriptive note before sharing (minimum 20 characters)</label> |
623 |
<div id="shared_infos" class="rows"> |
624 |
<li> <span class="label">Id: </span><div id="shared_id"></div> |
625 |
</li> |
626 |
<li> <span class="label">Name: </span><div id="shared_name"></div> |
627 |
</li> |
628 |
<li> <span class="label">SQL: </span><div id="shared_sql"></div> |
629 |
</li> |
630 |
<li> <span class="label">Group: </span><div id="shared_group"></div> |
631 |
</li> |
632 |
<li> <span class="label">Type: </span><div id="shared_type"></div> |
633 |
</li> |
634 |
<li> <span class="label">Notes: </span><div id="shared_notes"></div> |
635 |
</li> |
636 |
|
637 |
</div> |
638 |
<div class="rows"> |
639 |
<form method="post" id="mana_share_form" action="/cgi-bin/koha/reports/guided_reports.pl?phase=Share" class="validated" > |
640 |
<input type="hidden" name="phase" value="Share"> |
641 |
|
642 |
<fieldset> |
643 |
<label for="mana_language">Language:</label> |
644 |
<select id="mana_language" name="mana_language"> |
645 |
[% FOREACH languages_loo IN languages_loop %] |
646 |
[% IF ( languages_loo.group_enabled ) %] |
647 |
[% IF ( languages_loo.plural ) %] |
648 |
[% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %] |
649 |
[% IF ( sublanguages_loo.enabled ) %] |
650 |
[% IF ( sublanguages_loo.sublanguage_current ) %] |
651 |
<option value="[% languages_loo.rfc4646_subtag %]" selected> |
652 |
[% sublanguages_loo.native_description %] |
653 |
[% sublanguages_loo.script_description %] |
654 |
[% sublanguages_loo.region_description %] |
655 |
|
656 |
[% sublanguages_loo.variant_description %] |
657 |
([% sublanguages_loo.rfc4646_subtag %]) |
658 |
</option> |
659 |
[% ELSE %] |
660 |
<option value="[% languages_loo.rfc4646_subtag %]"> |
661 |
[% sublanguages_loo.native_description %] |
662 |
[% sublanguages_loo.script_description %] |
663 |
[% sublanguages_loo.region_description %] |
664 |
[% sublanguages_loo.variant_description %] |
665 |
([% sublanguages_loo.rfc4646_subtag %]) |
666 |
</option> |
667 |
[% END %] |
668 |
[% END %] |
669 |
[% END %] |
670 |
[% ELSE %] |
671 |
[% IF ( languages_loo.group_enabled ) %] |
672 |
[% IF ( languages_loo.current ) %] |
673 |
<option value="[% languages_loo.rfc4646_subtag %]" selected> |
674 |
[% IF ( languages_loo.native_description ) %] |
675 |
[% languages_loo.native_description %] |
676 |
[% ELSE %] |
677 |
[% languages_loo.rfc4646_subtag %] |
678 |
[% END %] |
679 |
</option> |
680 |
[% ELSE %] |
681 |
<option value="[% languages_loo.rfc4646_subtag %]"> |
682 |
[% IF ( languages_loo.native_description ) %] |
683 |
[% languages_loo.native_description %] |
684 |
[% ELSE %] |
685 |
[% languages_loo.rfc4646_subtag %] |
686 |
[% END %] |
687 |
</option> |
688 |
[% END %] |
689 |
[% END %] |
690 |
[% END %] |
691 |
[% END %] |
692 |
[% END %] |
693 |
</select> |
694 |
<input type="hidden" id="reportid" name="reportid" value="[% savedreport.id %]"/> |
695 |
</fieldset> |
696 |
</form> |
697 |
</div> |
698 |
[% END %] |
699 |
[% END %] |
700 |
</div> |
701 |
<div class="modal-footer"> |
702 |
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button> |
703 |
[% IF one_language_enabled==0 %] |
704 |
<button id="ManaShareButton" type="submit" form="mana_share_form" class="btn btn-primary">Share</button> |
705 |
[% ELSE %] |
706 |
<div id="ManaShareButton" class="btn-group"><a class="btn btn-primary"'onclick="share()">Share</a></div> |
707 |
[% END %] |
708 |
</div> |
709 |
</div> |
710 |
</div> |
711 |
</div> |
712 |
|
439 |
|
713 |
|
440 |
[% IF ( build1 ) %] |
714 |
[% IF ( build1 ) %] |
441 |
[% IF ( cache_error) %] |
715 |
[% IF ( cache_error) %] |