Lines 81-90
$(".goback").on("click",function(e){
Link Here
|
81 |
window.history.back(); |
81 |
window.history.back(); |
82 |
}); |
82 |
}); |
83 |
|
83 |
|
84 |
$(".mana_search_button").on("click",function(){ |
|
|
85 |
mana_search($(this).prev().val()); |
86 |
}); |
87 |
|
88 |
$(".ShareButton").on("click", function(){ |
84 |
$(".ShareButton").on("click", function(){ |
89 |
if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){ |
85 |
if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){ |
90 |
$("#shared_infos").hide(); |
86 |
$("#shared_infos").hide(); |
Lines 101-109
$(".ShareButton").on("click", function(){
Link Here
|
101 |
} |
97 |
} |
102 |
}); |
98 |
}); |
103 |
|
99 |
|
104 |
$('#search_form').submit(function () { |
|
|
105 |
return false; |
106 |
}); |
107 |
|
100 |
|
108 |
$("#addColumn").on("click",function(){ |
101 |
$("#addColumn").on("click",function(){ |
109 |
addColumn(); |
102 |
addColumn(); |
Lines 283-386
$("#delColumn").on("click",function(){
Link Here
|
283 |
[% END %] |
276 |
[% END %] |
284 |
}); |
277 |
}); |
285 |
|
278 |
|
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 |
|
279 |
|
385 |
|
280 |
|
386 |
</script> |
281 |
</script> |
Lines 492-497
canned reports and writing custom SQL reports.</p>
Link Here
|
492 |
</div> |
387 |
</div> |
493 |
</div> |
388 |
</div> |
494 |
|
389 |
|
|
|
390 |
[% IF report_converted %] |
391 |
<div class="dialog message"> |
392 |
The report "[% report_converted %]" has been converted. |
393 |
</div> |
394 |
[% END %] |
395 |
|
396 |
|
495 |
[% IF ( saved1 ) %] |
397 |
[% IF ( saved1 ) %] |
496 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
398 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
497 |
|
399 |
|
Lines 516-529
canned reports and writing custom SQL reports.</p>
Link Here
|
516 |
</div> |
418 |
</div> |
517 |
[% END %] |
419 |
[% END %] |
518 |
|
420 |
|
519 |
[% IF (Koha.Preference('Mana') == 1) %] |
|
|
520 |
<div id="mana_search" class="dialog message"> |
521 |
<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> |
522 |
</div> |
523 |
[% END %] |
524 |
|
525 |
</script> |
421 |
</script> |
526 |
<h1> [% savedreport.sql %]</h1> |
422 |
|
527 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
423 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
528 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
424 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
529 |
<table id="table_reports"> |
425 |
<table id="table_reports"> |
Lines 554-560
canned reports and writing custom SQL reports.</p>
Link Here
|
554 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
450 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
555 |
<input type="checkbox" name="ids" value="[% savedreport.id %]" /> |
451 |
<input type="checkbox" name="ids" value="[% savedreport.id %]" /> |
556 |
[% END %] |
452 |
[% END %] |
557 |
<input hidden class="report_sql" value="[% savedreport.savedsql %]"> |
453 |
<input hidden class="report_sql" value="[% savedreport.savedsql |html %]"> |
558 |
</td> |
454 |
</td> |
559 |
<td class="report_id"><label for="ids">[% savedreport.id %]</label></td> |
455 |
<td class="report_id"><label for="ids">[% savedreport.id %]</label></td> |
560 |
<td class="report_name"> |
456 |
<td class="report_name"> |
Lines 1280-1285
Sub report:<select name="subreport">
Link Here
|
1280 |
[% END %] |
1176 |
[% END %] |
1281 |
|
1177 |
|
1282 |
[% IF ( showsql ) %] |
1178 |
[% IF ( showsql ) %] |
|
|
1179 |
[% IF mana_success %] |
1180 |
<fieldset> |
1181 |
Shared Successfully, thanks for your contribution! |
1182 |
</fieldset> |
1183 |
[% END %] |
1283 |
<fieldset class="rows"> |
1184 |
<fieldset class="rows"> |
1284 |
<legend>[% reportname %]</legend> |
1185 |
<legend>[% reportname %]</legend> |
1285 |
<ol> |
1186 |
<ol> |