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