Lines 67-72
function load_group_subgroups () {
Link Here
|
67 |
} |
67 |
} |
68 |
} |
68 |
} |
69 |
|
69 |
|
|
|
70 |
function share() { |
71 |
window.location="/cgi-bin/koha/reports/guided_reports.pl?phase=Save"; |
72 |
} |
73 |
|
70 |
$(document).ready(function(){ |
74 |
$(document).ready(function(){ |
71 |
$('#limit').change(function() { |
75 |
$('#limit').change(function() { |
72 |
$('#limitselect').submit(); |
76 |
$('#limitselect').submit(); |
Lines 77-82
$(".goback").on("click",function(e){
Link Here
|
77 |
window.history.back(); |
81 |
window.history.back(); |
78 |
}); |
82 |
}); |
79 |
|
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 |
|
80 |
$("#addColumn").on("click",function(){ |
108 |
$("#addColumn").on("click",function(){ |
81 |
addColumn(); |
109 |
addColumn(); |
82 |
}); |
110 |
}); |
Lines 254-260
$("#delColumn").on("click",function(){
Link Here
|
254 |
}); |
282 |
}); |
255 |
[% END %] |
283 |
[% END %] |
256 |
}); |
284 |
}); |
257 |
//]]> |
285 |
|
|
|
286 |
function mana_increment(mana_id, resourcename, fieldvalue, stepvalue = 1){ |
287 |
$.ajax( { |
288 |
type: "POST", |
289 |
url: "/cgi-bin/koha/svc/mana/addvaluetofield", |
290 |
data: {id: mana_id, field: fieldvalue, resource: resourcename, step: stepvalue}, |
291 |
datatype: "json", |
292 |
}).done( function() { |
293 |
}).fail( function(){ }); |
294 |
} |
295 |
|
296 |
function mana_use( mana_id ){ |
297 |
$.ajax( { |
298 |
type:"POST", |
299 |
url: "/cgi-bin/koha/svc/mana/use", |
300 |
data: {id:mana_id, resource: 'report', saveinbase: 1}, |
301 |
dataType: "json", |
302 |
}) |
303 |
.done( function (result){ |
304 |
window.location = ("/cgi-bin/koha/reports/guided_reports.pl?reports=").concat(result.id).concat("&phase=Show%20SQL"); |
305 |
}) |
306 |
.fail( function ( foo, msg, longmsg){ |
307 |
}); |
308 |
} |
309 |
|
310 |
function mana_search( textquery ){ |
311 |
$.ajax({ |
312 |
type: "POST", |
313 |
url: "/cgi-bin/koha/svc/mana/search", |
314 |
data: {biblionumber: $("#biblionumber").val(), resource: 'report', id: textquery, usecomments: 1}, |
315 |
dataType: "html", |
316 |
}) |
317 |
.done( function( result ) { |
318 |
$("#mana_search_result .modal-body").html(result); |
319 |
$("#mana_search_result_label").text("Results from Mana Knowledge Base"); |
320 |
$("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults,{ |
321 |
"sPaginationType":"four_button", |
322 |
"autoWidth": false, |
323 |
"columnDefs": [ |
324 |
{ "width": "35%", "targets": 1 } |
325 |
], |
326 |
"aoColumnDefs": [ |
327 |
{ 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, |
328 |
{ "sType": "title-string", "aTargets" : [ "title-string" ] }, |
329 |
{ 'sType': "anti-the", 'aTargets' : [ 'anti-the'] } |
330 |
] |
331 |
})); |
332 |
if($("td.dataTables_empty").length == 0){ |
333 |
$("#mana_search").show(); |
334 |
} |
335 |
|
336 |
$( "select[class='actionreport1']" ).show(); |
337 |
$( "button[class='actionreport2']" ).hide(); |
338 |
$("#CommentButton").on("click", function(){ |
339 |
var resource_type = "report"; |
340 |
var target_id = $("#selected_id").val(); |
341 |
var manamsg = $("#manamsg").val(); |
342 |
mana_comment(target_id, manamsg, resource_type); |
343 |
$("#comment_box").modal("hide"); |
344 |
}); |
345 |
|
346 |
$(".showbutton").on("click", function(){ |
347 |
$(this).parent().hide(); |
348 |
$(this).parent().next().show(); |
349 |
}); |
350 |
|
351 |
$("a[class='hidebutton']").on("click", function(){ |
352 |
$(this).parent().hide(); |
353 |
$(this).parent().prev().show(); |
354 |
}); |
355 |
|
356 |
$("#commentCloseButton").on("click", function(){ |
357 |
$("#comment_box").modal("hide"); |
358 |
}); |
359 |
|
360 |
$(".actionreport1").on("click", function(){ |
361 |
$("#selectedcomment").val($(this).val()); |
362 |
$(this).parent("select").hide(); |
363 |
$(this).parent("select").next().show(); |
364 |
}); |
365 |
|
366 |
$(".actionreport2").on("click", function(){ |
367 |
$(this).hide(); |
368 |
$(this).prev().show(); |
369 |
mana_increment($("#selectedcomment").val(), 'resource_comment', 'nb', -1); |
370 |
}); |
371 |
}).fail( function( result ){ |
372 |
}); |
373 |
} |
374 |
|
375 |
function mana_comment( target_id, manamsg, resource_type ){ |
376 |
$.ajax( { |
377 |
type: "POST", |
378 |
url: "/cgi-bin/koha/svc/mana/share", |
379 |
data: {message: manamsg, resource: resource_type , resource_id: target_id}, |
380 |
datatype: "json", |
381 |
}) |
382 |
} |
383 |
|
384 |
|
385 |
|
258 |
</script> |
386 |
</script> |
259 |
</head> |
387 |
</head> |
260 |
<body id="rep_guided_reports_start" class="rep"> |
388 |
<body id="rep_guided_reports_start" class="rep"> |
Lines 344-349
canned reports and writing custom SQL reports.</p>
Link Here
|
344 |
</div> |
472 |
</div> |
345 |
[% END %] |
473 |
[% END %] |
346 |
|
474 |
|
|
|
475 |
<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;"> |
476 |
<div class="modal-dialog modal-lg"> |
477 |
<div class="modal-content"> |
478 |
<div class="modal-header"> |
479 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
480 |
<h3 id="mana_search_result_label"> Mana Search</h3> |
481 |
</div> |
482 |
<div> |
483 |
<form id="search_form" style="margin-left: 5%"> |
484 |
Please enter a few key words: |
485 |
<input type=text id=mana_search_field> |
486 |
<input type=button class="mana_search_button" value="Search"> |
487 |
</form> |
488 |
<div class="modal-body"> |
489 |
</div> |
490 |
</div> |
491 |
</div> |
492 |
</div> |
493 |
</div> |
494 |
|
347 |
[% IF ( saved1 ) %] |
495 |
[% IF ( saved1 ) %] |
348 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
496 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
349 |
|
497 |
|
Lines 361-366
canned reports and writing custom SQL reports.</p>
Link Here
|
361 |
<option value="">All</option> |
509 |
<option value="">All</option> |
362 |
</select> |
510 |
</select> |
363 |
</div> |
511 |
</div> |
|
|
512 |
<div style="display:inline-block"> |
513 |
[% IF (manamsg == 'success') %] |
514 |
<div id="mana_search" class="dialog message"> |
515 |
<p> Shared successfully! Thanks for your help.</p> |
516 |
</div> |
517 |
[% ELSIF (manamsg == 'fail') %] |
518 |
<div id="mana_search" class="dialog message"> |
519 |
<p> An error occured while sharing, please try again later.</p> |
520 |
</div> |
521 |
[% END %] |
522 |
|
523 |
[% IF (Koha.Preference('Mana') == 1) %] |
524 |
<div id="mana_search" class="dialog message"> |
525 |
<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> |
526 |
</div> |
527 |
[% END %] |
528 |
|
529 |
</script> |
530 |
<h1> [% savedreport.sql %]</h1> |
364 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
531 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
365 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
532 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
366 |
<table id="table_reports"> |
533 |
<table id="table_reports"> |
Lines 387-409
canned reports and writing custom SQL reports.</p>
Link Here
|
387 |
<tbody> |
554 |
<tbody> |
388 |
[% FOREACH savedreport IN savedreports %] |
555 |
[% FOREACH savedreport IN savedreports %] |
389 |
[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %] |
556 |
[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %] |
390 |
<td> |
557 |
<td class="report_checkbox"> |
391 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
558 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
392 |
<input type="checkbox" name="ids" value="[% savedreport.id %]" /> |
559 |
<input type="checkbox" name="ids" value="[% savedreport.id %]" /> |
393 |
[% END %] |
560 |
[% END %] |
|
|
561 |
<input hidden class="report_sql" value="[% savedreport.savedsql %]"> |
394 |
</td> |
562 |
</td> |
395 |
<td><label for="ids">[% savedreport.id %]</label></td> |
563 |
<td class="report_id"><label for="ids">[% savedreport.id %]</label></td> |
396 |
<td> |
564 |
<td class="report_name"> |
397 |
[% IF ( savedreport.report_name ) %] |
565 |
[% IF ( savedreport.report_name ) %] |
398 |
[% savedreport.report_name %] |
566 |
[% savedreport.report_name %] |
399 |
[% ELSE %] |
567 |
[% ELSE %] |
400 |
[ no name ] |
568 |
[ no name ] |
401 |
[% END %] |
569 |
[% END %] |
402 |
</td> |
570 |
</td> |
403 |
<td>[% savedreport.type %]</td> |
571 |
<td class="report_type">[% savedreport.type %]</td> |
404 |
<td>[% savedreport.groupname %]</td> |
572 |
<td class="report_group">[% savedreport.groupname %]</td> |
405 |
<td>[% savedreport.subgroupname %]</td> |
573 |
<td>[% savedreport.subgroupname %]</td> |
406 |
<td>[% savedreport.notes %]</td> |
574 |
<td class="report_notes">[% savedreport.notes %]</td> |
407 |
<td>[% savedreport.borrowersurname %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname %][% END %] ([% savedreport.borrowernumber %])</td> |
575 |
<td>[% savedreport.borrowersurname %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname %][% END %] ([% savedreport.borrowernumber %])</td> |
408 |
<td><span title="[% savedreport.date_created %]">[% savedreport.date_created | $KohaDates %]</span></td> |
576 |
<td><span title="[% savedreport.date_created %]">[% savedreport.date_created | $KohaDates %]</span></td> |
409 |
<td><span title="[% savedreport.last_modified %]">[% savedreport.last_modified | $KohaDates with_hours => 1 %]</span></td> |
577 |
<td><span title="[% savedreport.last_modified %]">[% savedreport.last_modified | $KohaDates with_hours => 1 %]</span></td> |
Lines 443-448
canned reports and writing custom SQL reports.</p>
Link Here
|
443 |
<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> |
611 |
<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> |
444 |
<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> |
612 |
<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> |
445 |
[% END %] |
613 |
[% END %] |
|
|
614 |
[% IF (Koha.Preference('Mana') == 1) %] |
615 |
<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> |
616 |
[% END %] |
446 |
<li><a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id %]"><i class="fa fa-clock-o"></i> Schedule</a></li> |
617 |
<li><a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id %]"><i class="fa fa-clock-o"></i> Schedule</a></li> |
447 |
[% IF ( CAN_user_reports_delete_reports ) %] |
618 |
[% IF ( CAN_user_reports_delete_reports ) %] |
448 |
<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> |
619 |
<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 455-460
canned reports and writing custom SQL reports.</p>
Link Here
|
455 |
[% END %] |
626 |
[% END %] |
456 |
</tbody> |
627 |
</tbody> |
457 |
</table> |
628 |
</table> |
|
|
629 |
</div> |
458 |
[% IF ( CAN_user_reports_delete_reports ) %] |
630 |
[% IF ( CAN_user_reports_delete_reports ) %] |
459 |
<fieldset class="action"> |
631 |
<fieldset class="action"> |
460 |
<input type="submit" value="Delete selected" /> |
632 |
<input type="submit" value="Delete selected" /> |
Lines 495-500
canned reports and writing custom SQL reports.</p>
Link Here
|
495 |
[% END %] |
667 |
[% END %] |
496 |
[% END %] |
668 |
[% END %] |
497 |
|
669 |
|
|
|
670 |
<div id="mana_share_report" class="modal fade" tabindex="-1" role="dialog" arialabelledby="mana_share_modal_label" style="display: none;"> |
671 |
<div class="modal-dialog"> |
672 |
<div class="modal-content"> |
673 |
<div class="modal-header"> |
674 |
<h3 id="mana_share_modal_label">Share with Mana</h3> |
675 |
</div> |
676 |
<div class="modal-body"> |
677 |
[% IF (mana_id) %] |
678 |
<div class="alert"> |
679 |
<p>Your subscription is already linked with a Mana subscription model. Share it if you have made modifications, otherwise it will do nothing.</p> |
680 |
</div> |
681 |
[% END %] |
682 |
[% IF ( languages_loop ) %] |
683 |
[% UNLESS ( one_language_enabled ) %] |
684 |
<label id="noteerror" type="hidden">Please enter a report name and descriptive note before sharing (minimum 20 characters)</label> |
685 |
<div id="shared_infos" class="rows"> |
686 |
<li> <span class="label">Id: </span><div id="shared_id"></div> |
687 |
</li> |
688 |
<li> <span class="label">Name: </span><div id="shared_name"></div> |
689 |
</li> |
690 |
<li> <span class="label">SQL: </span><div id="shared_sql"></div> |
691 |
</li> |
692 |
<li> <span class="label">Group: </span><div id="shared_group"></div> |
693 |
</li> |
694 |
<li> <span class="label">Type: </span><div id="shared_type"></div> |
695 |
</li> |
696 |
<li> <span class="label">Notes: </span><div id="shared_notes"></div> |
697 |
</li> |
698 |
|
699 |
</div> |
700 |
<div class="rows"> |
701 |
<form method="post" id="mana_share_form" action="/cgi-bin/koha/reports/guided_reports.pl?phase=Share" class="validated" > |
702 |
<input type="hidden" name="phase" value="Share"> |
703 |
|
704 |
<fieldset> |
705 |
<label for="mana_language">Language:</label> |
706 |
<select id="mana_language" name="mana_language"> |
707 |
[% FOREACH languages_loo IN languages_loop %] |
708 |
[% IF ( languages_loo.group_enabled ) %] |
709 |
[% IF ( languages_loo.plural ) %] |
710 |
[% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %] |
711 |
[% IF ( sublanguages_loo.enabled ) %] |
712 |
[% IF ( sublanguages_loo.sublanguage_current ) %] |
713 |
<option value="[% languages_loo.rfc4646_subtag %]" selected> |
714 |
[% sublanguages_loo.native_description %] |
715 |
[% sublanguages_loo.script_description %] |
716 |
[% sublanguages_loo.region_description %] |
717 |
|
718 |
[% sublanguages_loo.variant_description %] |
719 |
([% sublanguages_loo.rfc4646_subtag %]) |
720 |
</option> |
721 |
[% ELSE %] |
722 |
<option value="[% languages_loo.rfc4646_subtag %]"> |
723 |
[% sublanguages_loo.native_description %] |
724 |
[% sublanguages_loo.script_description %] |
725 |
[% sublanguages_loo.region_description %] |
726 |
[% sublanguages_loo.variant_description %] |
727 |
([% sublanguages_loo.rfc4646_subtag %]) |
728 |
</option> |
729 |
[% END %] |
730 |
[% END %] |
731 |
[% END %] |
732 |
[% ELSE %] |
733 |
[% IF ( languages_loo.group_enabled ) %] |
734 |
[% IF ( languages_loo.current ) %] |
735 |
<option value="[% languages_loo.rfc4646_subtag %]" selected> |
736 |
[% IF ( languages_loo.native_description ) %] |
737 |
[% languages_loo.native_description %] |
738 |
[% ELSE %] |
739 |
[% languages_loo.rfc4646_subtag %] |
740 |
[% END %] |
741 |
</option> |
742 |
[% ELSE %] |
743 |
<option value="[% languages_loo.rfc4646_subtag %]"> |
744 |
[% IF ( languages_loo.native_description ) %] |
745 |
[% languages_loo.native_description %] |
746 |
[% ELSE %] |
747 |
[% languages_loo.rfc4646_subtag %] |
748 |
[% END %] |
749 |
</option> |
750 |
[% END %] |
751 |
[% END %] |
752 |
[% END %] |
753 |
[% END %] |
754 |
[% END %] |
755 |
</select> |
756 |
<input type="hidden" id="reportid" name="reportid" value="[% savedreport.id %]"/> |
757 |
</fieldset> |
758 |
</form> |
759 |
</div> |
760 |
[% END %] |
761 |
[% END %] |
762 |
</div> |
763 |
<div class="modal-footer"> |
764 |
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button> |
765 |
[% IF one_language_enabled==0 %] |
766 |
<button id="ManaShareButton" type="submit" form="mana_share_form" class="btn btn-primary">Share</button> |
767 |
[% ELSE %] |
768 |
<div id="ManaShareButton" class="btn-group"><a class="btn btn-primary"'onclick="share()">Share</a></div> |
769 |
[% END %] |
770 |
</div> |
771 |
</div> |
772 |
</div> |
773 |
</div> |
774 |
|
498 |
|
775 |
|
499 |
[% IF ( build1 ) %] |
776 |
[% IF ( build1 ) %] |
500 |
[% IF ( cache_error) %] |
777 |
[% IF ( cache_error) %] |