Lines 161-166
canned reports and writing custom SQL reports.</p>
Link Here
|
161 |
</div> |
161 |
</div> |
162 |
</div> |
162 |
</div> |
163 |
|
163 |
|
|
|
164 |
[% IF report_converted %] |
165 |
<div class="dialog message"> |
166 |
The report "[% report_converted %]" has been converted. |
167 |
</div> |
168 |
[% END %] |
169 |
|
170 |
|
164 |
[% IF ( saved1 ) %] |
171 |
[% IF ( saved1 ) %] |
165 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
172 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
166 |
|
173 |
|
Lines 185-198
canned reports and writing custom SQL reports.</p>
Link Here
|
185 |
</div> |
192 |
</div> |
186 |
[% END %] |
193 |
[% END %] |
187 |
|
194 |
|
188 |
[% IF (Koha.Preference('Mana') == 1) %] |
|
|
189 |
<div id="mana_search" class="dialog message"> |
190 |
<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> |
191 |
</div> |
192 |
[% END %] |
193 |
|
194 |
</script> |
195 |
</script> |
195 |
<h1> [% savedreport.sql %]</h1> |
196 |
|
196 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
197 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
197 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
198 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
198 |
<table id="table_reports"> |
199 |
<table id="table_reports"> |
Lines 224-230
canned reports and writing custom SQL reports.</p>
Link Here
|
224 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
225 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
225 |
<input type="checkbox" name="ids" value="[% savedreport.id %]" /> |
226 |
<input type="checkbox" name="ids" value="[% savedreport.id %]" /> |
226 |
[% END %] |
227 |
[% END %] |
227 |
<input hidden class="report_sql" value="[% savedreport.savedsql %]"> |
228 |
<input hidden class="report_sql" value="[% savedreport.savedsql |html %]"> |
228 |
</td> |
229 |
</td> |
229 |
<td class="report_id"><label for="ids">[% savedreport.id %]</label></td> |
230 |
<td class="report_id"><label for="ids">[% savedreport.id %]</label></td> |
230 |
<td class="report_name"> |
231 |
<td class="report_name"> |
Lines 1152-1161
Sub report:<select name="subreport">
Link Here
|
1152 |
window.history.back(); |
1153 |
window.history.back(); |
1153 |
}); |
1154 |
}); |
1154 |
|
1155 |
|
1155 |
$(".mana_search_button").on("click",function(){ |
|
|
1156 |
mana_search($(this).prev().val()); |
1157 |
}); |
1158 |
|
1159 |
$(".ShareButton").on("click", function(){ |
1156 |
$(".ShareButton").on("click", function(){ |
1160 |
if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){ |
1157 |
if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){ |
1161 |
$("#shared_infos").hide(); |
1158 |
$("#shared_infos").hide(); |
Lines 1172-1181
Sub report:<select name="subreport">
Link Here
|
1172 |
} |
1169 |
} |
1173 |
}); |
1170 |
}); |
1174 |
|
1171 |
|
1175 |
$('#search_form').submit(function () { |
|
|
1176 |
return false; |
1177 |
}); |
1178 |
|
1179 |
$("#addColumn").on("click",function(){ |
1172 |
$("#addColumn").on("click",function(){ |
1180 |
addColumn(); |
1173 |
addColumn(); |
1181 |
}); |
1174 |
}); |
Lines 1360-1462
Sub report:<select name="subreport">
Link Here
|
1360 |
return confirmDelete(MSG_CONFIRM_DELETE); |
1353 |
return confirmDelete(MSG_CONFIRM_DELETE); |
1361 |
}); |
1354 |
}); |
1362 |
}); |
1355 |
}); |
1363 |
function mana_increment(mana_id, resourcename, fieldvalue, stepvalue = 1){ |
|
|
1364 |
$.ajax( { |
1365 |
type: "POST", |
1366 |
url: "/cgi-bin/koha/svc/mana/addvaluetofield", |
1367 |
data: {id: mana_id, field: fieldvalue, resource: resourcename, step: stepvalue}, |
1368 |
datatype: "json", |
1369 |
}).done( function() { |
1370 |
}).fail( function(){ }); |
1371 |
} |
1372 |
|
1373 |
function mana_use( mana_id ){ |
1374 |
$.ajax( { |
1375 |
type:"POST", |
1376 |
url: "/cgi-bin/koha/svc/mana/use", |
1377 |
data: {id:mana_id, resource: 'report', saveinbase: 1}, |
1378 |
dataType: "json", |
1379 |
}) |
1380 |
.done( function (result){ |
1381 |
window.location = ("/cgi-bin/koha/reports/guided_reports.pl?reports=").concat(result.id).concat("&phase=Show%20SQL"); |
1382 |
}) |
1383 |
.fail( function ( foo, msg, longmsg){ |
1384 |
}); |
1385 |
} |
1386 |
|
1387 |
function mana_search( textquery ){ |
1388 |
$.ajax({ |
1389 |
type: "POST", |
1390 |
url: "/cgi-bin/koha/svc/mana/search", |
1391 |
data: {biblionumber: $("#biblionumber").val(), resource: 'report', id: textquery, usecomments: 1}, |
1392 |
dataType: "html", |
1393 |
}) |
1394 |
.done( function( result ) { |
1395 |
$("#mana_search_result .modal-body").html(result); |
1396 |
$("#mana_search_result_label").text("Results from Mana Knowledge Base"); |
1397 |
$("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults,{ |
1398 |
"sPaginationType":"four_button", |
1399 |
"autoWidth": false, |
1400 |
"columnDefs": [ |
1401 |
{ "width": "35%", "targets": 1 } |
1402 |
], |
1403 |
"aoColumnDefs": [ |
1404 |
{ 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, |
1405 |
{ "sType": "title-string", "aTargets" : [ "title-string" ] }, |
1406 |
{ 'sType': "anti-the", 'aTargets' : [ 'anti-the'] } |
1407 |
] |
1408 |
})); |
1409 |
if($("td.dataTables_empty").length == 0){ |
1410 |
$("#mana_search").show(); |
1411 |
} |
1412 |
|
1413 |
$( "select[class='actionreport1']" ).show(); |
1414 |
$( "button[class='actionreport2']" ).hide(); |
1415 |
$("#CommentButton").on("click", function(){ |
1416 |
var resource_type = "report"; |
1417 |
var target_id = $("#selected_id").val(); |
1418 |
var manamsg = $("#manamsg").val(); |
1419 |
mana_comment(target_id, manamsg, resource_type); |
1420 |
$("#comment_box").modal("hide"); |
1421 |
}); |
1422 |
|
1423 |
$(".showbutton").on("click", function(){ |
1424 |
$(this).parent().hide(); |
1425 |
$(this).parent().next().show(); |
1426 |
}); |
1427 |
|
1428 |
$("a[class='hidebutton']").on("click", function(){ |
1429 |
$(this).parent().hide(); |
1430 |
$(this).parent().prev().show(); |
1431 |
}); |
1432 |
|
1433 |
$("#commentCloseButton").on("click", function(){ |
1434 |
$("#comment_box").modal("hide"); |
1435 |
}); |
1436 |
|
1437 |
$(".actionreport1").on("click", function(){ |
1438 |
$("#selectedcomment").val($(this).val()); |
1439 |
$(this).parent("select").hide(); |
1440 |
$(this).parent("select").next().show(); |
1441 |
}); |
1442 |
|
1443 |
$(".actionreport2").on("click", function(){ |
1444 |
$(this).hide(); |
1445 |
$(this).prev().show(); |
1446 |
mana_increment($("#selectedcomment").val(), 'resource_comment', 'nb', -1); |
1447 |
}); |
1448 |
}).fail( function( result ){ |
1449 |
}); |
1450 |
} |
1451 |
|
1452 |
function mana_comment( target_id, manamsg, resource_type ){ |
1453 |
$.ajax( { |
1454 |
type: "POST", |
1455 |
url: "/cgi-bin/koha/svc/mana/share", |
1456 |
data: {message: manamsg, resource: resource_type , resource_id: target_id}, |
1457 |
datatype: "json", |
1458 |
}) |
1459 |
} |
1460 |
|
1356 |
|
1461 |
function addColumn() { |
1357 |
function addColumn() { |
1462 |
$("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected"); |
1358 |
$("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected"); |