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 240-246
$("#delColumn").on("click",function(){
Link Here
|
240 |
}); |
268 |
}); |
241 |
[% END %] |
269 |
[% END %] |
242 |
}); |
270 |
}); |
243 |
//]]> |
271 |
|
|
|
272 |
function mana_increment(mana_id, resourcename, fieldvalue, stepvalue = 1){ |
273 |
$.ajax( { |
274 |
type: "POST", |
275 |
url: "/cgi-bin/koha/svc/mana/addvaluetofield", |
276 |
data: {id: mana_id, field: fieldvalue, resource: resourcename, step: stepvalue}, |
277 |
datatype: "json", |
278 |
}).done( function() { |
279 |
}).fail( function(){ }); |
280 |
} |
281 |
|
282 |
function mana_use( mana_id ){ |
283 |
$.ajax( { |
284 |
type:"POST", |
285 |
url: "/cgi-bin/koha/svc/mana/use", |
286 |
data: {id:mana_id, resource: 'report', saveinbase: 1}, |
287 |
dataType: "json", |
288 |
}) |
289 |
.done( function (result){ |
290 |
window.location = ("/cgi-bin/koha/reports/guided_reports.pl?reports=").concat(result.id).concat("&phase=Show%20SQL"); |
291 |
}) |
292 |
.fail( function ( foo, msg, longmsg){ |
293 |
}); |
294 |
} |
295 |
|
296 |
function mana_search( textquery ){ |
297 |
$.ajax({ |
298 |
type: "POST", |
299 |
url: "/cgi-bin/koha/svc/mana/search", |
300 |
data: {biblionumber: $("#biblionumber").val(), resource: 'report', id: textquery, usecomments: 1}, |
301 |
dataType: "html", |
302 |
}) |
303 |
.done( function( result ) { |
304 |
$("#mana_search_result .modal-body").html(result); |
305 |
$("#mana_search_result_label").text("Results from Mana Knowledge Base"); |
306 |
$("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults,{ |
307 |
"sPaginationType":"four_button", |
308 |
"autoWidth": false, |
309 |
"columnDefs": [ |
310 |
{ "width": "35%", "targets": 1 } |
311 |
], |
312 |
"aoColumnDefs": [ |
313 |
{ 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, |
314 |
{ "sType": "title-string", "aTargets" : [ "title-string" ] }, |
315 |
{ 'sType': "anti-the", 'aTargets' : [ 'anti-the'] } |
316 |
] |
317 |
})); |
318 |
if($("td.dataTables_empty").length == 0){ |
319 |
$("#mana_search").show(); |
320 |
} |
321 |
|
322 |
$( "select[class='actionreport1']" ).show(); |
323 |
$( "button[class='actionreport2']" ).hide(); |
324 |
$("#CommentButton").on("click", function(){ |
325 |
var resource_type = "report"; |
326 |
var target_id = $("#selected_id").val(); |
327 |
var manamsg = $("#manamsg").val(); |
328 |
mana_comment(target_id, manamsg, resource_type); |
329 |
$("#comment_box").modal("hide"); |
330 |
}); |
331 |
|
332 |
$(".showbutton").on("click", function(){ |
333 |
$(this).parent().hide(); |
334 |
$(this).parent().next().show(); |
335 |
}); |
336 |
|
337 |
$("a[class='hidebutton']").on("click", function(){ |
338 |
$(this).parent().hide(); |
339 |
$(this).parent().prev().show(); |
340 |
}); |
341 |
|
342 |
$("#commentCloseButton").on("click", function(){ |
343 |
$("#comment_box").modal("hide"); |
344 |
}); |
345 |
|
346 |
$(".actionreport1").on("click", function(){ |
347 |
$("#selectedcomment").val($(this).val()); |
348 |
$(this).parent("select").hide(); |
349 |
$(this).parent("select").next().show(); |
350 |
}); |
351 |
|
352 |
$(".actionreport2").on("click", function(){ |
353 |
$(this).hide(); |
354 |
$(this).prev().show(); |
355 |
mana_increment($("#selectedcomment").val(), 'resource_comment', 'nb', -1); |
356 |
}); |
357 |
}).fail( function( result ){ |
358 |
}); |
359 |
} |
360 |
|
361 |
function mana_comment( target_id, manamsg, resource_type ){ |
362 |
$.ajax( { |
363 |
type: "POST", |
364 |
url: "/cgi-bin/koha/svc/mana/share", |
365 |
data: {message: manamsg, resource: resource_type , resource_id: target_id}, |
366 |
datatype: "json", |
367 |
}) |
368 |
} |
369 |
|
370 |
|
371 |
|
244 |
</script> |
372 |
</script> |
245 |
</head> |
373 |
</head> |
246 |
<body id="rep_guided_reports_start" class="rep"> |
374 |
<body id="rep_guided_reports_start" class="rep"> |
Lines 306-311
canned reports and writing custom SQL reports.</p>
Link Here
|
306 |
</form> |
434 |
</form> |
307 |
[% END %] |
435 |
[% END %] |
308 |
|
436 |
|
|
|
437 |
<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;"> |
438 |
<div class="modal-dialog modal-lg"> |
439 |
<div class="modal-content"> |
440 |
<div class="modal-header"> |
441 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
442 |
<h3 id="mana_search_result_label"> Mana Search</h3> |
443 |
</div> |
444 |
<div> |
445 |
<form id="search_form" style="margin-left: 5%"> |
446 |
Please enter a few key words: |
447 |
<input type=text id=mana_search_field> |
448 |
<input type=button class="mana_search_button" value="Search"> |
449 |
</form> |
450 |
<div class="modal-body"> |
451 |
</div> |
452 |
</div> |
453 |
</div> |
454 |
</div> |
455 |
</div> |
456 |
|
457 |
|
309 |
[% IF ( saved1 ) %] |
458 |
[% IF ( saved1 ) %] |
310 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
459 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
311 |
|
460 |
|
Lines 323-328
canned reports and writing custom SQL reports.</p>
Link Here
|
323 |
<option value="">All</option> |
472 |
<option value="">All</option> |
324 |
</select> |
473 |
</select> |
325 |
</div> |
474 |
</div> |
|
|
475 |
<div style="display:inline-block"> |
476 |
[% IF (manamsg == 'success') %] |
477 |
<div id="mana_search" class="dialog message"> |
478 |
<p> Shared successfully! Thanks for your help.</p> |
479 |
</div> |
480 |
[% ELSIF (manamsg == 'fail') %] |
481 |
<div id="mana_search" class="dialog message"> |
482 |
<p> An error occured while sharing, please try again later.</p> |
483 |
</div> |
484 |
[% END %] |
485 |
|
486 |
[% IF (Koha.Preference('Mana') == 1) %] |
487 |
<div id="mana_search" class="dialog message"> |
488 |
<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> |
489 |
</div> |
490 |
[% END %] |
491 |
|
492 |
</script> |
493 |
<h1> [% savedreport.sql %]</h1> |
326 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
494 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
327 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
495 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
328 |
<table id="table_reports"> |
496 |
<table id="table_reports"> |
Lines 348-370
canned reports and writing custom SQL reports.</p>
Link Here
|
348 |
<tbody> |
516 |
<tbody> |
349 |
[% FOREACH savedreport IN savedreports %] |
517 |
[% FOREACH savedreport IN savedreports %] |
350 |
[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %] |
518 |
[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %] |
351 |
<td> |
519 |
<td class="report_checkbox"> |
352 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
520 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
353 |
<input type="checkbox" name="ids" value="[% savedreport.id %]" /> |
521 |
<input type="checkbox" name="ids" value="[% savedreport.id %]" /> |
354 |
[% END %] |
522 |
[% END %] |
|
|
523 |
<input hidden class="report_sql" value="[% savedreport.savedsql %]"> |
355 |
</td> |
524 |
</td> |
356 |
<td><label for="ids">[% savedreport.id %]</label></td> |
525 |
<td class="report_id"><label for="ids">[% savedreport.id %]</label></td> |
357 |
<td> |
526 |
<td class="report_name"> |
358 |
[% IF ( savedreport.report_name ) %] |
527 |
[% IF ( savedreport.report_name ) %] |
359 |
[% savedreport.report_name %] |
528 |
[% savedreport.report_name %] |
360 |
[% ELSE %] |
529 |
[% ELSE %] |
361 |
[ no name ] |
530 |
[ no name ] |
362 |
[% END %] |
531 |
[% END %] |
363 |
</td> |
532 |
</td> |
364 |
<td>[% savedreport.type %]</td> |
533 |
<td class="report_type">[% savedreport.type %]</td> |
365 |
<td>[% savedreport.groupname %]</td> |
534 |
<td class="report_group">[% savedreport.groupname %]</td> |
366 |
<td>[% savedreport.subgroupname %]</td> |
535 |
<td>[% savedreport.subgroupname %]</td> |
367 |
<td>[% savedreport.notes %]</td> |
536 |
<td class="report_notes">[% savedreport.notes %]</td> |
368 |
<td>[% savedreport.borrowersurname %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname %][% END %] ([% savedreport.borrowernumber %])</td> |
537 |
<td>[% savedreport.borrowersurname %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname %][% END %] ([% savedreport.borrowernumber %])</td> |
369 |
<td><span title="[% savedreport.date_created %]">[% savedreport.date_created | $KohaDates %]</span></td> |
538 |
<td><span title="[% savedreport.date_created %]">[% savedreport.date_created | $KohaDates %]</span></td> |
370 |
<td><span title="[% savedreport.last_modified %]">[% savedreport.last_modified | $KohaDates with_hours => 1 %]</span></td> |
539 |
<td><span title="[% savedreport.last_modified %]">[% savedreport.last_modified | $KohaDates with_hours => 1 %]</span></td> |
Lines 396-401
canned reports and writing custom SQL reports.</p>
Link Here
|
396 |
<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> |
565 |
<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> |
397 |
<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> |
566 |
<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> |
398 |
[% END %] |
567 |
[% END %] |
|
|
568 |
[% IF (Koha.Preference('Mana') == 1) %] |
569 |
<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> |
570 |
[% END %] |
399 |
<li><a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id %]"><i class="fa fa-clock-o"></i> Schedule</a></li> |
571 |
<li><a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id %]"><i class="fa fa-clock-o"></i> Schedule</a></li> |
400 |
[% IF ( CAN_user_reports_delete_reports ) %] |
572 |
[% IF ( CAN_user_reports_delete_reports ) %] |
401 |
<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> |
573 |
<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 408-413
canned reports and writing custom SQL reports.</p>
Link Here
|
408 |
[% END %] |
580 |
[% END %] |
409 |
</tbody> |
581 |
</tbody> |
410 |
</table> |
582 |
</table> |
|
|
583 |
</div> |
411 |
[% IF ( CAN_user_reports_delete_reports ) %] |
584 |
[% IF ( CAN_user_reports_delete_reports ) %] |
412 |
<fieldset class="action"> |
585 |
<fieldset class="action"> |
413 |
<input type="submit" value="Delete selected" /> |
586 |
<input type="submit" value="Delete selected" /> |
Lines 448-453
canned reports and writing custom SQL reports.</p>
Link Here
|
448 |
[% END %] |
621 |
[% END %] |
449 |
[% END %] |
622 |
[% END %] |
450 |
|
623 |
|
|
|
624 |
<div id="mana_share_report" class="modal fade" tabindex="-1" role="dialog" arialabelledby="mana_share_modal_label" style="display: none;"> |
625 |
<div class="modal-dialog"> |
626 |
<div class="modal-content"> |
627 |
<div class="modal-header"> |
628 |
<h3 id="mana_share_modal_label">Share with Mana</h3> |
629 |
</div> |
630 |
<div class="modal-body"> |
631 |
[% IF (mana_id) %] |
632 |
<div class="alert"> |
633 |
<p>Your subscription is already linked with a Mana subscription model. Share it if you have made modifications, otherwise it will do nothing.</p> |
634 |
</div> |
635 |
[% END %] |
636 |
[% IF ( languages_loop ) %] |
637 |
[% UNLESS ( one_language_enabled ) %] |
638 |
<label id="noteerror" type="hidden">Please enter a report name and descriptive note before sharing (minimum 20 characters)</label> |
639 |
<div id="shared_infos" class="rows"> |
640 |
<li> <span class="label">Id: </span><div id="shared_id"></div> |
641 |
</li> |
642 |
<li> <span class="label">Name: </span><div id="shared_name"></div> |
643 |
</li> |
644 |
<li> <span class="label">SQL: </span><div id="shared_sql"></div> |
645 |
</li> |
646 |
<li> <span class="label">Group: </span><div id="shared_group"></div> |
647 |
</li> |
648 |
<li> <span class="label">Type: </span><div id="shared_type"></div> |
649 |
</li> |
650 |
<li> <span class="label">Notes: </span><div id="shared_notes"></div> |
651 |
</li> |
652 |
|
653 |
</div> |
654 |
<div class="rows"> |
655 |
<form method="post" id="mana_share_form" action="/cgi-bin/koha/reports/guided_reports.pl?phase=Share" class="validated" > |
656 |
<input type="hidden" name="phase" value="Share"> |
657 |
|
658 |
<fieldset> |
659 |
<label for="mana_language">Language:</label> |
660 |
<select id="mana_language" name="mana_language"> |
661 |
[% FOREACH languages_loo IN languages_loop %] |
662 |
[% IF ( languages_loo.group_enabled ) %] |
663 |
[% IF ( languages_loo.plural ) %] |
664 |
[% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %] |
665 |
[% IF ( sublanguages_loo.enabled ) %] |
666 |
[% IF ( sublanguages_loo.sublanguage_current ) %] |
667 |
<option value="[% languages_loo.rfc4646_subtag %]" selected> |
668 |
[% sublanguages_loo.native_description %] |
669 |
[% sublanguages_loo.script_description %] |
670 |
[% sublanguages_loo.region_description %] |
671 |
|
672 |
[% sublanguages_loo.variant_description %] |
673 |
([% sublanguages_loo.rfc4646_subtag %]) |
674 |
</option> |
675 |
[% ELSE %] |
676 |
<option value="[% languages_loo.rfc4646_subtag %]"> |
677 |
[% sublanguages_loo.native_description %] |
678 |
[% sublanguages_loo.script_description %] |
679 |
[% sublanguages_loo.region_description %] |
680 |
[% sublanguages_loo.variant_description %] |
681 |
([% sublanguages_loo.rfc4646_subtag %]) |
682 |
</option> |
683 |
[% END %] |
684 |
[% END %] |
685 |
[% END %] |
686 |
[% ELSE %] |
687 |
[% IF ( languages_loo.group_enabled ) %] |
688 |
[% IF ( languages_loo.current ) %] |
689 |
<option value="[% languages_loo.rfc4646_subtag %]" selected> |
690 |
[% IF ( languages_loo.native_description ) %] |
691 |
[% languages_loo.native_description %] |
692 |
[% ELSE %] |
693 |
[% languages_loo.rfc4646_subtag %] |
694 |
[% END %] |
695 |
</option> |
696 |
[% ELSE %] |
697 |
<option value="[% languages_loo.rfc4646_subtag %]"> |
698 |
[% IF ( languages_loo.native_description ) %] |
699 |
[% languages_loo.native_description %] |
700 |
[% ELSE %] |
701 |
[% languages_loo.rfc4646_subtag %] |
702 |
[% END %] |
703 |
</option> |
704 |
[% END %] |
705 |
[% END %] |
706 |
[% END %] |
707 |
[% END %] |
708 |
[% END %] |
709 |
</select> |
710 |
<input type="hidden" id="reportid" name="reportid" value="[% savedreport.id %]"/> |
711 |
</fieldset> |
712 |
</form> |
713 |
</div> |
714 |
[% END %] |
715 |
[% END %] |
716 |
</div> |
717 |
<div class="modal-footer"> |
718 |
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button> |
719 |
[% IF one_language_enabled==0 %] |
720 |
<button id="ManaShareButton" type="submit" form="mana_share_form" class="btn btn-primary">Share</button> |
721 |
[% ELSE %] |
722 |
<div id="ManaShareButton" class="btn-group"><a class="btn btn-primary"'onclick="share()">Share</a></div> |
723 |
[% END %] |
724 |
</div> |
725 |
</div> |
726 |
</div> |
727 |
</div> |
728 |
|
451 |
|
729 |
|
452 |
[% IF ( build1 ) %] |
730 |
[% IF ( build1 ) %] |
453 |
[% IF ( cache_error) %] |
731 |
[% IF ( cache_error) %] |