Lines 74-79
function load_group_subgroups () {
Link Here
|
74 |
} |
74 |
} |
75 |
} |
75 |
} |
76 |
|
76 |
|
|
|
77 |
function share() { |
78 |
window.location="/cgi-bin/koha/reports/guided_reports.pl?phase=Save"; |
79 |
} |
80 |
|
77 |
$(document).ready(function(){ |
81 |
$(document).ready(function(){ |
78 |
$('#limit').change(function() { |
82 |
$('#limit').change(function() { |
79 |
$('#limitselect').submit(); |
83 |
$('#limitselect').submit(); |
Lines 84-89
$(".goback").on("click",function(e){
Link Here
|
84 |
window.history.back(); |
88 |
window.history.back(); |
85 |
}); |
89 |
}); |
86 |
|
90 |
|
|
|
91 |
$(".mana_search_button").on("click",function(){ |
92 |
mana_search($(this).prev().val()); |
93 |
}); |
94 |
|
95 |
$(".ShareButton").on("click", function(){ |
96 |
if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){ |
97 |
$("#shared_infos").hide(); |
98 |
$("#ManaShareButton").hide(); |
99 |
$("#noterror").show(); |
100 |
} |
101 |
else{ |
102 |
$("#shared_id").html($(this).closest("tr").find(".report_id").text()); |
103 |
$("#shared_name").html($(this).closest("tr").find(".report_name").text()); |
104 |
$("#shared_sql").html($(this).closest("tr").find(".report_sql").val()); |
105 |
$("#shared_type").html($(this).closest("tr").find(".report_type").text()); |
106 |
$("#shared_group").html($(this).closest("tr").find(".report_group").text()); |
107 |
$("#shared_notes").html($(this).closest("tr").find(".report_notes").text()); |
108 |
} |
109 |
}); |
110 |
|
111 |
$('#search_form').submit(function () { |
112 |
return false; |
113 |
}); |
114 |
|
87 |
$("#addColumn").on("click",function(){ |
115 |
$("#addColumn").on("click",function(){ |
88 |
addColumn(); |
116 |
addColumn(); |
89 |
}); |
117 |
}); |
Lines 267-273
$("#delColumn").on("click",function(){
Link Here
|
267 |
}); |
295 |
}); |
268 |
[% END %] |
296 |
[% END %] |
269 |
}); |
297 |
}); |
270 |
//]]> |
298 |
|
|
|
299 |
function mana_increment(mana_id, resourcename, fieldvalue, stepvalue = 1){ |
300 |
$.ajax( { |
301 |
type: "POST", |
302 |
url: "/cgi-bin/koha/svc/mana/addvaluetofield", |
303 |
data: {id: mana_id, field: fieldvalue, resource: resourcename, step: stepvalue}, |
304 |
datatype: "json", |
305 |
}).done( function() { |
306 |
}).fail( function(){ }); |
307 |
} |
308 |
|
309 |
function mana_use( mana_id ){ |
310 |
$.ajax( { |
311 |
type:"POST", |
312 |
url: "/cgi-bin/koha/svc/mana/use", |
313 |
data: {id:mana_id, resource: 'report', saveinbase: 1}, |
314 |
dataType: "json", |
315 |
}) |
316 |
.done( function (result){ |
317 |
window.location = ("/cgi-bin/koha/reports/guided_reports.pl?reports=").concat(result.id).concat("&phase=Show%20SQL"); |
318 |
}) |
319 |
.fail( function ( foo, msg, longmsg){ |
320 |
}); |
321 |
} |
322 |
|
323 |
function mana_search( textquery ){ |
324 |
$.ajax({ |
325 |
type: "POST", |
326 |
url: "/cgi-bin/koha/svc/mana/search", |
327 |
data: {biblionumber: $("#biblionumber").val(), resource: 'report', id: textquery, usecomments: 1}, |
328 |
dataType: "html", |
329 |
}) |
330 |
.done( function( result ) { |
331 |
$("#mana_search_result .modal-body").html(result); |
332 |
$("#mana_search_result_label").text("Results from Mana Knowledge Base"); |
333 |
$("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults,{ |
334 |
"sPaginationType":"four_button", |
335 |
"autoWidth": false, |
336 |
"columnDefs": [ |
337 |
{ "width": "35%", "targets": 1 } |
338 |
], |
339 |
"aoColumnDefs": [ |
340 |
{ 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, |
341 |
{ "sType": "title-string", "aTargets" : [ "title-string" ] }, |
342 |
{ 'sType': "anti-the", 'aTargets' : [ 'anti-the'] } |
343 |
] |
344 |
})); |
345 |
if($("td.dataTables_empty").length == 0){ |
346 |
$("#mana_search").show(); |
347 |
} |
348 |
|
349 |
$( "select[class='actionreport1']" ).show(); |
350 |
$( "button[class='actionreport2']" ).hide(); |
351 |
$("#CommentButton").on("click", function(){ |
352 |
var resource_type = "report"; |
353 |
var target_id = $("#selected_id").val(); |
354 |
var manamsg = $("#manamsg").val(); |
355 |
mana_comment(target_id, manamsg, resource_type); |
356 |
$("#comment_box").modal("hide"); |
357 |
}); |
358 |
|
359 |
$(".showbutton").on("click", function(){ |
360 |
$(this).parent().hide(); |
361 |
$(this).parent().next().show(); |
362 |
}); |
363 |
|
364 |
$("a[class='hidebutton']").on("click", function(){ |
365 |
$(this).parent().hide(); |
366 |
$(this).parent().prev().show(); |
367 |
}); |
368 |
|
369 |
$("#commentCloseButton").on("click", function(){ |
370 |
$("#comment_box").modal("hide"); |
371 |
}); |
372 |
|
373 |
$(".actionreport1").on("click", function(){ |
374 |
$("#selectedcomment").val($(this).val()); |
375 |
$(this).parent("select").hide(); |
376 |
$(this).parent("select").next().show(); |
377 |
}); |
378 |
|
379 |
$(".actionreport2").on("click", function(){ |
380 |
$(this).hide(); |
381 |
$(this).prev().show(); |
382 |
mana_increment($("#selectedcomment").val(), 'resource_comment', 'nb', -1); |
383 |
}); |
384 |
}).fail( function( result ){ |
385 |
}); |
386 |
} |
387 |
|
388 |
function mana_comment( target_id, manamsg, resource_type ){ |
389 |
$.ajax( { |
390 |
type: "POST", |
391 |
url: "/cgi-bin/koha/svc/mana/share", |
392 |
data: {message: manamsg, resource: resource_type , resource_id: target_id}, |
393 |
datatype: "json", |
394 |
}) |
395 |
} |
396 |
|
397 |
|
398 |
|
271 |
</script> |
399 |
</script> |
272 |
</head> |
400 |
</head> |
273 |
<body id="rep_guided_reports_start" class="rep"> |
401 |
<body id="rep_guided_reports_start" class="rep"> |
Lines 357-362
canned reports and writing custom SQL reports.</p>
Link Here
|
357 |
</div> |
485 |
</div> |
358 |
[% END %] |
486 |
[% END %] |
359 |
|
487 |
|
|
|
488 |
<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;"> |
489 |
<div class="modal-dialog modal-lg"> |
490 |
<div class="modal-content"> |
491 |
<div class="modal-header"> |
492 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
493 |
<h3 id="mana_search_result_label"> Mana Search</h3> |
494 |
</div> |
495 |
<div> |
496 |
<form id="search_form" style="margin-left: 5%"> |
497 |
Please enter a few key words: |
498 |
<input type=text id=mana_search_field> |
499 |
<input type=button class="mana_search_button" value="Search"> |
500 |
</form> |
501 |
<div class="modal-body"> |
502 |
</div> |
503 |
</div> |
504 |
</div> |
505 |
</div> |
506 |
</div> |
507 |
|
360 |
[% IF ( saved1 ) %] |
508 |
[% IF ( saved1 ) %] |
361 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
509 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
362 |
|
510 |
|
Lines 374-379
canned reports and writing custom SQL reports.</p>
Link Here
|
374 |
<option value="">All</option> |
522 |
<option value="">All</option> |
375 |
</select> |
523 |
</select> |
376 |
</div> |
524 |
</div> |
|
|
525 |
<div style="display:inline-block"> |
526 |
[% IF (manamsg == 'success') %] |
527 |
<div id="mana_search" class="dialog message"> |
528 |
<p> Shared successfully! Thanks for your help.</p> |
529 |
</div> |
530 |
[% ELSIF (manamsg == 'fail') %] |
531 |
<div id="mana_search" class="dialog message"> |
532 |
<p> An error occured while sharing, please try again later.</p> |
533 |
</div> |
534 |
[% END %] |
535 |
|
536 |
[% IF (Koha.Preference('Mana') == 1) %] |
537 |
<div id="mana_search" class="dialog message"> |
538 |
<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> |
539 |
</div> |
540 |
[% END %] |
541 |
|
542 |
</script> |
543 |
<h1> [% savedreport.sql %]</h1> |
377 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
544 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
378 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
545 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
379 |
<table id="table_reports"> |
546 |
<table id="table_reports"> |
Lines 400-422
canned reports and writing custom SQL reports.</p>
Link Here
|
400 |
<tbody> |
567 |
<tbody> |
401 |
[% FOREACH savedreport IN savedreports %] |
568 |
[% FOREACH savedreport IN savedreports %] |
402 |
[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %] |
569 |
[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %] |
403 |
<td> |
570 |
<td class="report_checkbox"> |
404 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
571 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
405 |
<input type="checkbox" name="ids" value="[% savedreport.id %]" /> |
572 |
<input type="checkbox" name="ids" value="[% savedreport.id %]" /> |
406 |
[% END %] |
573 |
[% END %] |
|
|
574 |
<input hidden class="report_sql" value="[% savedreport.savedsql %]"> |
407 |
</td> |
575 |
</td> |
408 |
<td><label for="ids">[% savedreport.id %]</label></td> |
576 |
<td class="report_id"><label for="ids">[% savedreport.id %]</label></td> |
409 |
<td> |
577 |
<td class="report_name"> |
410 |
[% IF ( savedreport.report_name ) %] |
578 |
[% IF ( savedreport.report_name ) %] |
411 |
[% savedreport.report_name %] |
579 |
[% savedreport.report_name %] |
412 |
[% ELSE %] |
580 |
[% ELSE %] |
413 |
[ no name ] |
581 |
[ no name ] |
414 |
[% END %] |
582 |
[% END %] |
415 |
</td> |
583 |
</td> |
416 |
<td>[% savedreport.type %]</td> |
584 |
<td class="report_type">[% savedreport.type %]</td> |
417 |
<td>[% savedreport.groupname %]</td> |
585 |
<td class="report_group">[% savedreport.groupname %]</td> |
418 |
<td>[% savedreport.subgroupname %]</td> |
586 |
<td>[% savedreport.subgroupname %]</td> |
419 |
<td>[% savedreport.notes %]</td> |
587 |
<td class="report_notes">[% savedreport.notes %]</td> |
420 |
<td>[% savedreport.borrowersurname %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname %][% END %] ([% savedreport.borrowernumber %])</td> |
588 |
<td>[% savedreport.borrowersurname %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname %][% END %] ([% savedreport.borrowernumber %])</td> |
421 |
<td><span title="[% savedreport.date_created %]">[% savedreport.date_created | $KohaDates %]</span></td> |
589 |
<td><span title="[% savedreport.date_created %]">[% savedreport.date_created | $KohaDates %]</span></td> |
422 |
<td><span title="[% savedreport.last_modified %]">[% savedreport.last_modified | $KohaDates with_hours => 1 %]</span></td> |
590 |
<td><span title="[% savedreport.last_modified %]">[% savedreport.last_modified | $KohaDates with_hours => 1 %]</span></td> |
Lines 456-461
canned reports and writing custom SQL reports.</p>
Link Here
|
456 |
<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> |
624 |
<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> |
457 |
<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> |
625 |
<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> |
458 |
[% END %] |
626 |
[% END %] |
|
|
627 |
[% IF (Koha.Preference('Mana') == 1) %] |
628 |
<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> |
629 |
[% END %] |
459 |
<li><a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id %]"><i class="fa fa-clock-o"></i> Schedule</a></li> |
630 |
<li><a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id %]"><i class="fa fa-clock-o"></i> Schedule</a></li> |
460 |
[% IF ( CAN_user_reports_delete_reports ) %] |
631 |
[% IF ( CAN_user_reports_delete_reports ) %] |
461 |
<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> |
632 |
<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 468-473
canned reports and writing custom SQL reports.</p>
Link Here
|
468 |
[% END %] |
639 |
[% END %] |
469 |
</tbody> |
640 |
</tbody> |
470 |
</table> |
641 |
</table> |
|
|
642 |
</div> |
471 |
[% IF ( CAN_user_reports_delete_reports ) %] |
643 |
[% IF ( CAN_user_reports_delete_reports ) %] |
472 |
<fieldset class="action"> |
644 |
<fieldset class="action"> |
473 |
<input type="submit" value="Delete selected" /> |
645 |
<input type="submit" value="Delete selected" /> |
Lines 508-513
canned reports and writing custom SQL reports.</p>
Link Here
|
508 |
[% END %] |
680 |
[% END %] |
509 |
[% END %] |
681 |
[% END %] |
510 |
|
682 |
|
|
|
683 |
<div id="mana_share_report" class="modal fade" tabindex="-1" role="dialog" arialabelledby="mana_share_modal_label" style="display: none;"> |
684 |
<div class="modal-dialog"> |
685 |
<div class="modal-content"> |
686 |
<div class="modal-header"> |
687 |
<h3 id="mana_share_modal_label">Share with Mana</h3> |
688 |
</div> |
689 |
<div class="modal-body"> |
690 |
[% IF (mana_id) %] |
691 |
<div class="alert"> |
692 |
<p>Your subscription is already linked with a Mana subscription model. Share it if you have made modifications, otherwise it will do nothing.</p> |
693 |
</div> |
694 |
[% END %] |
695 |
[% IF ( languages_loop ) %] |
696 |
[% UNLESS ( one_language_enabled ) %] |
697 |
<label id="noteerror" type="hidden">Please enter a report name and descriptive note before sharing (minimum 20 characters)</label> |
698 |
<div id="shared_infos" class="rows"> |
699 |
<li> <span class="label">Id: </span><div id="shared_id"></div> |
700 |
</li> |
701 |
<li> <span class="label">Name: </span><div id="shared_name"></div> |
702 |
</li> |
703 |
<li> <span class="label">SQL: </span><div id="shared_sql"></div> |
704 |
</li> |
705 |
<li> <span class="label">Group: </span><div id="shared_group"></div> |
706 |
</li> |
707 |
<li> <span class="label">Type: </span><div id="shared_type"></div> |
708 |
</li> |
709 |
<li> <span class="label">Notes: </span><div id="shared_notes"></div> |
710 |
</li> |
711 |
|
712 |
</div> |
713 |
<div class="rows"> |
714 |
<form method="post" id="mana_share_form" action="/cgi-bin/koha/reports/guided_reports.pl?phase=Share" class="validated" > |
715 |
<input type="hidden" name="phase" value="Share"> |
716 |
|
717 |
<fieldset> |
718 |
<label for="mana_language">Language:</label> |
719 |
<select id="mana_language" name="mana_language"> |
720 |
[% FOREACH languages_loo IN languages_loop %] |
721 |
[% IF ( languages_loo.group_enabled ) %] |
722 |
[% IF ( languages_loo.plural ) %] |
723 |
[% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %] |
724 |
[% IF ( sublanguages_loo.enabled ) %] |
725 |
[% IF ( sublanguages_loo.sublanguage_current ) %] |
726 |
<option value="[% languages_loo.rfc4646_subtag %]" selected> |
727 |
[% sublanguages_loo.native_description %] |
728 |
[% sublanguages_loo.script_description %] |
729 |
[% sublanguages_loo.region_description %] |
730 |
|
731 |
[% sublanguages_loo.variant_description %] |
732 |
([% sublanguages_loo.rfc4646_subtag %]) |
733 |
</option> |
734 |
[% ELSE %] |
735 |
<option value="[% languages_loo.rfc4646_subtag %]"> |
736 |
[% sublanguages_loo.native_description %] |
737 |
[% sublanguages_loo.script_description %] |
738 |
[% sublanguages_loo.region_description %] |
739 |
[% sublanguages_loo.variant_description %] |
740 |
([% sublanguages_loo.rfc4646_subtag %]) |
741 |
</option> |
742 |
[% END %] |
743 |
[% END %] |
744 |
[% END %] |
745 |
[% ELSE %] |
746 |
[% IF ( languages_loo.group_enabled ) %] |
747 |
[% IF ( languages_loo.current ) %] |
748 |
<option value="[% languages_loo.rfc4646_subtag %]" selected> |
749 |
[% IF ( languages_loo.native_description ) %] |
750 |
[% languages_loo.native_description %] |
751 |
[% ELSE %] |
752 |
[% languages_loo.rfc4646_subtag %] |
753 |
[% END %] |
754 |
</option> |
755 |
[% ELSE %] |
756 |
<option value="[% languages_loo.rfc4646_subtag %]"> |
757 |
[% IF ( languages_loo.native_description ) %] |
758 |
[% languages_loo.native_description %] |
759 |
[% ELSE %] |
760 |
[% languages_loo.rfc4646_subtag %] |
761 |
[% END %] |
762 |
</option> |
763 |
[% END %] |
764 |
[% END %] |
765 |
[% END %] |
766 |
[% END %] |
767 |
[% END %] |
768 |
</select> |
769 |
<input type="hidden" id="reportid" name="reportid" value="[% savedreport.id %]"/> |
770 |
</fieldset> |
771 |
</form> |
772 |
</div> |
773 |
[% END %] |
774 |
[% END %] |
775 |
</div> |
776 |
<div class="modal-footer"> |
777 |
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button> |
778 |
[% IF one_language_enabled==0 %] |
779 |
<button id="ManaShareButton" type="submit" form="mana_share_form" class="btn btn-primary">Share</button> |
780 |
[% ELSE %] |
781 |
<div id="ManaShareButton" class="btn-group"><a class="btn btn-primary"'onclick="share()">Share</a></div> |
782 |
[% END %] |
783 |
</div> |
784 |
</div> |
785 |
</div> |
786 |
</div> |
787 |
|
511 |
|
788 |
|
512 |
[% IF ( build1 ) %] |
789 |
[% IF ( build1 ) %] |
513 |
[% IF ( cache_error) %] |
790 |
[% IF ( cache_error) %] |