Lines 162-167
canned reports and writing custom SQL reports.</p>
Link Here
|
162 |
</div> |
162 |
</div> |
163 |
</div> |
163 |
</div> |
164 |
|
164 |
|
|
|
165 |
[% IF report_converted %] |
166 |
<div class="dialog message"> |
167 |
The report "[% report_converted %]" has been converted. |
168 |
</div> |
169 |
[% END %] |
170 |
|
171 |
|
165 |
[% IF ( saved1 ) %] |
172 |
[% IF ( saved1 ) %] |
166 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
173 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
167 |
|
174 |
|
Lines 186-199
canned reports and writing custom SQL reports.</p>
Link Here
|
186 |
</div> |
193 |
</div> |
187 |
[% END %] |
194 |
[% END %] |
188 |
|
195 |
|
189 |
[% IF (Koha.Preference('Mana') == 1) %] |
|
|
190 |
<div id="mana_search" class="dialog message"> |
191 |
<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> |
192 |
</div> |
193 |
[% END %] |
194 |
|
195 |
</script> |
196 |
</script> |
196 |
<h1> [% savedreport.sql %]</h1> |
197 |
|
197 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
198 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
198 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
199 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
199 |
<table id="table_reports"> |
200 |
<table id="table_reports"> |
Lines 225-231
canned reports and writing custom SQL reports.</p>
Link Here
|
225 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
226 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
226 |
<input type="checkbox" name="ids" value="[% savedreport.id %]" /> |
227 |
<input type="checkbox" name="ids" value="[% savedreport.id %]" /> |
227 |
[% END %] |
228 |
[% END %] |
228 |
<input hidden class="report_sql" value="[% savedreport.savedsql %]"> |
229 |
<input hidden class="report_sql" value="[% savedreport.savedsql |html %]"> |
229 |
</td> |
230 |
</td> |
230 |
<td class="report_id"><label for="ids">[% savedreport.id %]</label></td> |
231 |
<td class="report_id"><label for="ids">[% savedreport.id %]</label></td> |
231 |
<td class="report_name"> |
232 |
<td class="report_name"> |
Lines 1129-1138
$(document).ready(function() {
Link Here
|
1129 |
window.history.back(); |
1130 |
window.history.back(); |
1130 |
}); |
1131 |
}); |
1131 |
|
1132 |
|
1132 |
$(".mana_search_button").on("click",function(){ |
|
|
1133 |
mana_search($(this).prev().val()); |
1134 |
}); |
1135 |
|
1136 |
$(".ShareButton").on("click", function(){ |
1133 |
$(".ShareButton").on("click", function(){ |
1137 |
if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){ |
1134 |
if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){ |
1138 |
$("#shared_infos").hide(); |
1135 |
$("#shared_infos").hide(); |
Lines 1149-1158
$(document).ready(function() {
Link Here
|
1149 |
} |
1146 |
} |
1150 |
}); |
1147 |
}); |
1151 |
|
1148 |
|
1152 |
$('#search_form').submit(function () { |
|
|
1153 |
return false; |
1154 |
}); |
1155 |
|
1156 |
$("#addColumn").on("click",function(){ |
1149 |
$("#addColumn").on("click",function(){ |
1157 |
addColumn(); |
1150 |
addColumn(); |
1158 |
}); |
1151 |
}); |
Lines 1337-1439
$(document).ready(function() {
Link Here
|
1337 |
return confirmDelete(MSG_CONFIRM_DELETE); |
1330 |
return confirmDelete(MSG_CONFIRM_DELETE); |
1338 |
}); |
1331 |
}); |
1339 |
}); |
1332 |
}); |
1340 |
function mana_increment(mana_id, resourcename, fieldvalue, stepvalue = 1){ |
|
|
1341 |
$.ajax( { |
1342 |
type: "POST", |
1343 |
url: "/cgi-bin/koha/svc/mana/addvaluetofield", |
1344 |
data: {id: mana_id, field: fieldvalue, resource: resourcename, step: stepvalue}, |
1345 |
datatype: "json", |
1346 |
}).done( function() { |
1347 |
}).fail( function(){ }); |
1348 |
} |
1349 |
|
1350 |
function mana_use( mana_id ){ |
1351 |
$.ajax( { |
1352 |
type:"POST", |
1353 |
url: "/cgi-bin/koha/svc/mana/use", |
1354 |
data: {id:mana_id, resource: 'report', saveinbase: 1}, |
1355 |
dataType: "json", |
1356 |
}) |
1357 |
.done( function (result){ |
1358 |
window.location = ("/cgi-bin/koha/reports/guided_reports.pl?reports=").concat(result.id).concat("&phase=Show%20SQL"); |
1359 |
}) |
1360 |
.fail( function ( foo, msg, longmsg){ |
1361 |
}); |
1362 |
} |
1363 |
|
1364 |
function mana_search( textquery ){ |
1365 |
$.ajax({ |
1366 |
type: "POST", |
1367 |
url: "/cgi-bin/koha/svc/mana/search", |
1368 |
data: {biblionumber: $("#biblionumber").val(), resource: 'report', id: textquery, usecomments: 1}, |
1369 |
dataType: "html", |
1370 |
}) |
1371 |
.done( function( result ) { |
1372 |
$("#mana_search_result .modal-body").html(result); |
1373 |
$("#mana_search_result_label").text("Results from Mana Knowledge Base"); |
1374 |
$("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults,{ |
1375 |
"sPaginationType":"four_button", |
1376 |
"autoWidth": false, |
1377 |
"columnDefs": [ |
1378 |
{ "width": "35%", "targets": 1 } |
1379 |
], |
1380 |
"aoColumnDefs": [ |
1381 |
{ 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, |
1382 |
{ "sType": "title-string", "aTargets" : [ "title-string" ] }, |
1383 |
{ 'sType': "anti-the", 'aTargets' : [ 'anti-the'] } |
1384 |
] |
1385 |
})); |
1386 |
if($("td.dataTables_empty").length == 0){ |
1387 |
$("#mana_search").show(); |
1388 |
} |
1389 |
|
1390 |
$( "select[class='actionreport1']" ).show(); |
1391 |
$( "button[class='actionreport2']" ).hide(); |
1392 |
$("#CommentButton").on("click", function(){ |
1393 |
var resource_type = "report"; |
1394 |
var target_id = $("#selected_id").val(); |
1395 |
var manamsg = $("#manamsg").val(); |
1396 |
mana_comment(target_id, manamsg, resource_type); |
1397 |
$("#comment_box").modal("hide"); |
1398 |
}); |
1399 |
|
1400 |
$(".showbutton").on("click", function(){ |
1401 |
$(this).parent().hide(); |
1402 |
$(this).parent().next().show(); |
1403 |
}); |
1404 |
|
1405 |
$("a[class='hidebutton']").on("click", function(){ |
1406 |
$(this).parent().hide(); |
1407 |
$(this).parent().prev().show(); |
1408 |
}); |
1409 |
|
1410 |
$("#commentCloseButton").on("click", function(){ |
1411 |
$("#comment_box").modal("hide"); |
1412 |
}); |
1413 |
|
1414 |
$(".actionreport1").on("click", function(){ |
1415 |
$("#selectedcomment").val($(this).val()); |
1416 |
$(this).parent("select").hide(); |
1417 |
$(this).parent("select").next().show(); |
1418 |
}); |
1419 |
|
1420 |
$(".actionreport2").on("click", function(){ |
1421 |
$(this).hide(); |
1422 |
$(this).prev().show(); |
1423 |
mana_increment($("#selectedcomment").val(), 'resource_comment', 'nb', -1); |
1424 |
}); |
1425 |
}).fail( function( result ){ |
1426 |
}); |
1427 |
} |
1428 |
|
1429 |
function mana_comment( target_id, manamsg, resource_type ){ |
1430 |
$.ajax( { |
1431 |
type: "POST", |
1432 |
url: "/cgi-bin/koha/svc/mana/share", |
1433 |
data: {message: manamsg, resource: resource_type , resource_id: target_id}, |
1434 |
datatype: "json", |
1435 |
}) |
1436 |
} |
1437 |
|
1333 |
|
1438 |
function addColumn() { |
1334 |
function addColumn() { |
1439 |
$("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected"); |
1335 |
$("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected"); |