Lines 88-97
$(".goback").on("click",function(e){
Link Here
|
88 |
window.history.back(); |
88 |
window.history.back(); |
89 |
}); |
89 |
}); |
90 |
|
90 |
|
91 |
$(".mana_search_button").on("click",function(){ |
|
|
92 |
mana_search($(this).prev().val()); |
93 |
}); |
94 |
|
95 |
$(".ShareButton").on("click", function(){ |
91 |
$(".ShareButton").on("click", function(){ |
96 |
if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){ |
92 |
if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){ |
97 |
$("#shared_infos").hide(); |
93 |
$("#shared_infos").hide(); |
Lines 108-116
$(".ShareButton").on("click", function(){
Link Here
|
108 |
} |
104 |
} |
109 |
}); |
105 |
}); |
110 |
|
106 |
|
111 |
$('#search_form').submit(function () { |
|
|
112 |
return false; |
113 |
}); |
114 |
|
107 |
|
115 |
$("#addColumn").on("click",function(){ |
108 |
$("#addColumn").on("click",function(){ |
116 |
addColumn(); |
109 |
addColumn(); |
Lines 296-399
$("#delColumn").on("click",function(){
Link Here
|
296 |
[% END %] |
289 |
[% END %] |
297 |
}); |
290 |
}); |
298 |
|
291 |
|
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 |
|
292 |
|
398 |
|
293 |
|
399 |
</script> |
294 |
</script> |
Lines 505-510
canned reports and writing custom SQL reports.</p>
Link Here
|
505 |
</div> |
400 |
</div> |
506 |
</div> |
401 |
</div> |
507 |
|
402 |
|
|
|
403 |
[% IF report_converted %] |
404 |
<div class="dialog message"> |
405 |
The report "[% report_converted %]" has been converted. |
406 |
</div> |
407 |
[% END %] |
408 |
|
409 |
|
508 |
[% IF ( saved1 ) %] |
410 |
[% IF ( saved1 ) %] |
509 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
411 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
510 |
|
412 |
|
Lines 529-542
canned reports and writing custom SQL reports.</p>
Link Here
|
529 |
</div> |
431 |
</div> |
530 |
[% END %] |
432 |
[% END %] |
531 |
|
433 |
|
532 |
[% IF (Koha.Preference('Mana') == 1) %] |
|
|
533 |
<div id="mana_search" class="dialog message"> |
534 |
<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> |
535 |
</div> |
536 |
[% END %] |
537 |
|
538 |
</script> |
434 |
</script> |
539 |
<h1> [% savedreport.sql %]</h1> |
435 |
|
540 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
436 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
541 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
437 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
542 |
<table id="table_reports"> |
438 |
<table id="table_reports"> |
Lines 567-573
canned reports and writing custom SQL reports.</p>
Link Here
|
567 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
463 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
568 |
<input type="checkbox" name="ids" value="[% savedreport.id %]" /> |
464 |
<input type="checkbox" name="ids" value="[% savedreport.id %]" /> |
569 |
[% END %] |
465 |
[% END %] |
570 |
<input hidden class="report_sql" value="[% savedreport.savedsql %]"> |
466 |
<input hidden class="report_sql" value="[% savedreport.savedsql |html %]"> |
571 |
</td> |
467 |
</td> |
572 |
<td class="report_id"><label for="ids">[% savedreport.id %]</label></td> |
468 |
<td class="report_id"><label for="ids">[% savedreport.id %]</label></td> |
573 |
<td class="report_name"> |
469 |
<td class="report_name"> |
Lines 1293-1298
Sub report:<select name="subreport">
Link Here
|
1293 |
[% END %] |
1189 |
[% END %] |
1294 |
|
1190 |
|
1295 |
[% IF ( showsql ) %] |
1191 |
[% IF ( showsql ) %] |
|
|
1192 |
[% IF mana_success %] |
1193 |
<fieldset> |
1194 |
Shared Successfully, thanks for your contribution! |
1195 |
</fieldset> |
1196 |
[% END %] |
1296 |
<fieldset class="rows"> |
1197 |
<fieldset class="rows"> |
1297 |
<legend>[% reportname %]</legend> |
1198 |
<legend>[% reportname %]</legend> |
1298 |
<ol> |
1199 |
<ol> |