|
Lines 150-155
canned reports and writing custom SQL reports.</p>
Link Here
|
| 150 |
</div> |
150 |
</div> |
| 151 |
</div> |
151 |
</div> |
| 152 |
|
152 |
|
|
|
153 |
[% IF report_converted %] |
| 154 |
<div class="dialog message"> |
| 155 |
The report "[% report_converted %]" has been converted. |
| 156 |
</div> |
| 157 |
[% END %] |
| 158 |
|
| 159 |
|
| 153 |
[% IF ( saved1 ) %] |
160 |
[% IF ( saved1 ) %] |
| 154 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
161 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
| 155 |
|
162 |
|
|
Lines 174-187
canned reports and writing custom SQL reports.</p>
Link Here
|
| 174 |
</div> |
181 |
</div> |
| 175 |
[% END %] |
182 |
[% END %] |
| 176 |
|
183 |
|
| 177 |
[% IF (Koha.Preference('Mana') == 1) %] |
|
|
| 178 |
<div id="mana_search" class="dialog message"> |
| 179 |
<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> |
| 180 |
</div> |
| 181 |
[% END %] |
| 182 |
|
| 183 |
</script> |
184 |
</script> |
| 184 |
<h1> [% savedreport.sql %]</h1> |
185 |
|
| 185 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
186 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
| 186 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
187 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
| 187 |
<table id="table_reports"> |
188 |
<table id="table_reports"> |
|
Lines 213-219
canned reports and writing custom SQL reports.</p>
Link Here
|
| 213 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
214 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
| 214 |
<input type="checkbox" name="ids" value="[% savedreport.id %]" /> |
215 |
<input type="checkbox" name="ids" value="[% savedreport.id %]" /> |
| 215 |
[% END %] |
216 |
[% END %] |
| 216 |
<input hidden class="report_sql" value="[% savedreport.savedsql %]"> |
217 |
<input hidden class="report_sql" value="[% savedreport.savedsql |html %]"> |
| 217 |
</td> |
218 |
</td> |
| 218 |
<td class="report_id"><label for="ids">[% savedreport.id %]</label></td> |
219 |
<td class="report_id"><label for="ids">[% savedreport.id %]</label></td> |
| 219 |
<td class="report_name"> |
220 |
<td class="report_name"> |
|
Lines 1117-1126
Sub report:<select name="subreport">
Link Here
|
| 1117 |
window.history.back(); |
1118 |
window.history.back(); |
| 1118 |
}); |
1119 |
}); |
| 1119 |
|
1120 |
|
| 1120 |
$(".mana_search_button").on("click",function(){ |
|
|
| 1121 |
mana_search($(this).prev().val()); |
| 1122 |
}); |
| 1123 |
|
| 1124 |
$(".ShareButton").on("click", function(){ |
1121 |
$(".ShareButton").on("click", function(){ |
| 1125 |
if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){ |
1122 |
if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){ |
| 1126 |
$("#shared_infos").hide(); |
1123 |
$("#shared_infos").hide(); |
|
Lines 1137-1146
Sub report:<select name="subreport">
Link Here
|
| 1137 |
} |
1134 |
} |
| 1138 |
}); |
1135 |
}); |
| 1139 |
|
1136 |
|
| 1140 |
$('#search_form').submit(function () { |
|
|
| 1141 |
return false; |
| 1142 |
}); |
| 1143 |
|
| 1144 |
$("#addColumn").on("click",function(){ |
1137 |
$("#addColumn").on("click",function(){ |
| 1145 |
addColumn(); |
1138 |
addColumn(); |
| 1146 |
}); |
1139 |
}); |
|
Lines 1325-1427
Sub report:<select name="subreport">
Link Here
|
| 1325 |
return confirmDelete(MSG_CONFIRM_DELETE); |
1318 |
return confirmDelete(MSG_CONFIRM_DELETE); |
| 1326 |
}); |
1319 |
}); |
| 1327 |
}); |
1320 |
}); |
| 1328 |
function mana_increment(mana_id, resourcename, fieldvalue, stepvalue = 1){ |
|
|
| 1329 |
$.ajax( { |
| 1330 |
type: "POST", |
| 1331 |
url: "/cgi-bin/koha/svc/mana/addvaluetofield", |
| 1332 |
data: {id: mana_id, field: fieldvalue, resource: resourcename, step: stepvalue}, |
| 1333 |
datatype: "json", |
| 1334 |
}).done( function() { |
| 1335 |
}).fail( function(){ }); |
| 1336 |
} |
| 1337 |
|
| 1338 |
function mana_use( mana_id ){ |
| 1339 |
$.ajax( { |
| 1340 |
type:"POST", |
| 1341 |
url: "/cgi-bin/koha/svc/mana/use", |
| 1342 |
data: {id:mana_id, resource: 'report', saveinbase: 1}, |
| 1343 |
dataType: "json", |
| 1344 |
}) |
| 1345 |
.done( function (result){ |
| 1346 |
window.location = ("/cgi-bin/koha/reports/guided_reports.pl?reports=").concat(result.id).concat("&phase=Show%20SQL"); |
| 1347 |
}) |
| 1348 |
.fail( function ( foo, msg, longmsg){ |
| 1349 |
}); |
| 1350 |
} |
| 1351 |
|
| 1352 |
function mana_search( textquery ){ |
| 1353 |
$.ajax({ |
| 1354 |
type: "POST", |
| 1355 |
url: "/cgi-bin/koha/svc/mana/search", |
| 1356 |
data: {biblionumber: $("#biblionumber").val(), resource: 'report', id: textquery, usecomments: 1}, |
| 1357 |
dataType: "html", |
| 1358 |
}) |
| 1359 |
.done( function( result ) { |
| 1360 |
$("#mana_search_result .modal-body").html(result); |
| 1361 |
$("#mana_search_result_label").text("Results from Mana Knowledge Base"); |
| 1362 |
$("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults,{ |
| 1363 |
"sPaginationType":"four_button", |
| 1364 |
"autoWidth": false, |
| 1365 |
"columnDefs": [ |
| 1366 |
{ "width": "35%", "targets": 1 } |
| 1367 |
], |
| 1368 |
"aoColumnDefs": [ |
| 1369 |
{ 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, |
| 1370 |
{ "sType": "title-string", "aTargets" : [ "title-string" ] }, |
| 1371 |
{ 'sType': "anti-the", 'aTargets' : [ 'anti-the'] } |
| 1372 |
] |
| 1373 |
})); |
| 1374 |
if($("td.dataTables_empty").length == 0){ |
| 1375 |
$("#mana_search").show(); |
| 1376 |
} |
| 1377 |
|
| 1378 |
$( "select[class='actionreport1']" ).show(); |
| 1379 |
$( "button[class='actionreport2']" ).hide(); |
| 1380 |
$("#CommentButton").on("click", function(){ |
| 1381 |
var resource_type = "report"; |
| 1382 |
var target_id = $("#selected_id").val(); |
| 1383 |
var manamsg = $("#manamsg").val(); |
| 1384 |
mana_comment(target_id, manamsg, resource_type); |
| 1385 |
$("#comment_box").modal("hide"); |
| 1386 |
}); |
| 1387 |
|
| 1388 |
$(".showbutton").on("click", function(){ |
| 1389 |
$(this).parent().hide(); |
| 1390 |
$(this).parent().next().show(); |
| 1391 |
}); |
| 1392 |
|
| 1393 |
$("a[class='hidebutton']").on("click", function(){ |
| 1394 |
$(this).parent().hide(); |
| 1395 |
$(this).parent().prev().show(); |
| 1396 |
}); |
| 1397 |
|
| 1398 |
$("#commentCloseButton").on("click", function(){ |
| 1399 |
$("#comment_box").modal("hide"); |
| 1400 |
}); |
| 1401 |
|
| 1402 |
$(".actionreport1").on("click", function(){ |
| 1403 |
$("#selectedcomment").val($(this).val()); |
| 1404 |
$(this).parent("select").hide(); |
| 1405 |
$(this).parent("select").next().show(); |
| 1406 |
}); |
| 1407 |
|
| 1408 |
$(".actionreport2").on("click", function(){ |
| 1409 |
$(this).hide(); |
| 1410 |
$(this).prev().show(); |
| 1411 |
mana_increment($("#selectedcomment").val(), 'resource_comment', 'nb', -1); |
| 1412 |
}); |
| 1413 |
}).fail( function( result ){ |
| 1414 |
}); |
| 1415 |
} |
| 1416 |
|
| 1417 |
function mana_comment( target_id, manamsg, resource_type ){ |
| 1418 |
$.ajax( { |
| 1419 |
type: "POST", |
| 1420 |
url: "/cgi-bin/koha/svc/mana/share", |
| 1421 |
data: {message: manamsg, resource: resource_type , resource_id: target_id}, |
| 1422 |
datatype: "json", |
| 1423 |
}) |
| 1424 |
} |
| 1425 |
|
1321 |
|
| 1426 |
function addColumn() { |
1322 |
function addColumn() { |
| 1427 |
$("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected"); |
1323 |
$("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected"); |