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 294-397
$("#delColumn").on("click",function(){
Link Here
|
294 |
[% END %] |
287 |
[% END %] |
295 |
}); |
288 |
}); |
296 |
|
289 |
|
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 |
|
290 |
|
396 |
|
291 |
|
397 |
</script> |
292 |
</script> |
Lines 503-508
canned reports and writing custom SQL reports.</p>
Link Here
|
503 |
</div> |
398 |
</div> |
504 |
</div> |
399 |
</div> |
505 |
|
400 |
|
|
|
401 |
[% IF report_converted %] |
402 |
<div class="dialog message"> |
403 |
The report "[% report_converted %]" has been converted. |
404 |
</div> |
405 |
[% END %] |
406 |
|
407 |
|
506 |
[% IF ( saved1 ) %] |
408 |
[% IF ( saved1 ) %] |
507 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
409 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
508 |
|
410 |
|
Lines 527-540
canned reports and writing custom SQL reports.</p>
Link Here
|
527 |
</div> |
429 |
</div> |
528 |
[% END %] |
430 |
[% END %] |
529 |
|
431 |
|
530 |
[% IF (Koha.Preference('Mana') == 1) %] |
|
|
531 |
<div id="mana_search" class="dialog message"> |
532 |
<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> |
533 |
</div> |
534 |
[% END %] |
535 |
|
536 |
</script> |
432 |
</script> |
537 |
<h1> [% savedreport.sql %]</h1> |
433 |
|
538 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
434 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
539 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
435 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
540 |
<table id="table_reports"> |
436 |
<table id="table_reports"> |
Lines 565-571
canned reports and writing custom SQL reports.</p>
Link Here
|
565 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
461 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
566 |
<input type="checkbox" name="ids" value="[% savedreport.id %]" /> |
462 |
<input type="checkbox" name="ids" value="[% savedreport.id %]" /> |
567 |
[% END %] |
463 |
[% END %] |
568 |
<input hidden class="report_sql" value="[% savedreport.savedsql %]"> |
464 |
<input hidden class="report_sql" value="[% savedreport.savedsql |html %]"> |
569 |
</td> |
465 |
</td> |
570 |
<td class="report_id"><label for="ids">[% savedreport.id %]</label></td> |
466 |
<td class="report_id"><label for="ids">[% savedreport.id %]</label></td> |
571 |
<td class="report_name"> |
467 |
<td class="report_name"> |
Lines 1291-1296
Sub report:<select name="subreport">
Link Here
|
1291 |
[% END %] |
1187 |
[% END %] |
1292 |
|
1188 |
|
1293 |
[% IF ( showsql ) %] |
1189 |
[% IF ( showsql ) %] |
|
|
1190 |
[% IF mana_success %] |
1191 |
<fieldset> |
1192 |
Shared Successfully, thanks for your contribution! |
1193 |
</fieldset> |
1194 |
[% END %] |
1294 |
<fieldset class="rows"> |
1195 |
<fieldset class="rows"> |
1295 |
<legend>[% reportname %]</legend> |
1196 |
<legend>[% reportname %]</legend> |
1296 |
<ol> |
1197 |
<ol> |