Lines 149-154
canned reports and writing custom SQL reports.</p>
Link Here
|
149 |
</div> |
149 |
</div> |
150 |
</div> |
150 |
</div> |
151 |
|
151 |
|
|
|
152 |
[% IF report_converted %] |
153 |
<div class="dialog message"> |
154 |
The report "[% report_converted %]" has been converted. |
155 |
</div> |
156 |
[% END %] |
157 |
|
158 |
|
152 |
[% IF ( saved1 ) %] |
159 |
[% IF ( saved1 ) %] |
153 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
160 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
154 |
|
161 |
|
Lines 190-203
canned reports and writing custom SQL reports.</p>
Link Here
|
190 |
</div> |
197 |
</div> |
191 |
[% END %] |
198 |
[% END %] |
192 |
|
199 |
|
193 |
[% IF (Koha.Preference('Mana') == 1) %] |
|
|
194 |
<div id="mana_search" class="dialog message"> |
195 |
<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> |
196 |
</div> |
197 |
[% END %] |
198 |
|
199 |
</script> |
200 |
</script> |
200 |
<h1> [% savedreport.sql %]</h1> |
201 |
|
201 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
202 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
202 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
203 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
203 |
<table id="table_reports"> |
204 |
<table id="table_reports"> |
Lines 237-243
canned reports and writing custom SQL reports.</p>
Link Here
|
237 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
238 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
238 |
<input type="checkbox" name="ids" value="[% savedreport.id | html %]" /> |
239 |
<input type="checkbox" name="ids" value="[% savedreport.id | html %]" /> |
239 |
[% END %] |
240 |
[% END %] |
240 |
<input hidden class="report_sql" value="[% savedreport.savedsql %]"> |
241 |
<input hidden class="report_sql" value="[% savedreport.savedsql |html %]"> |
241 |
</td> |
242 |
</td> |
242 |
<td class="report_id"><label for="ids">[% savedreport.id | html %]</label></td> |
243 |
<td class="report_id"><label for="ids">[% savedreport.id | html %]</label></td> |
243 |
<td class="report_name"> |
244 |
<td class="report_name"> |
Lines 1273-1282
$(document).ready(function() {
Link Here
|
1273 |
window.history.back(); |
1274 |
window.history.back(); |
1274 |
}); |
1275 |
}); |
1275 |
|
1276 |
|
1276 |
$(".mana_search_button").on("click",function(){ |
|
|
1277 |
mana_search($(this).prev().val()); |
1278 |
}); |
1279 |
|
1280 |
$(".ShareButton").on("click", function(){ |
1277 |
$(".ShareButton").on("click", function(){ |
1281 |
if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){ |
1278 |
if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){ |
1282 |
$("#shared_infos").hide(); |
1279 |
$("#shared_infos").hide(); |
Lines 1293-1302
$(document).ready(function() {
Link Here
|
1293 |
} |
1290 |
} |
1294 |
}); |
1291 |
}); |
1295 |
|
1292 |
|
1296 |
$('#search_form').submit(function () { |
|
|
1297 |
return false; |
1298 |
}); |
1299 |
|
1300 |
$("#addColumn").on("click",function(){ |
1293 |
$("#addColumn").on("click",function(){ |
1301 |
addColumn(); |
1294 |
addColumn(); |
1302 |
}); |
1295 |
}); |
Lines 1488-1590
$(document).ready(function() {
Link Here
|
1488 |
return confirmDelete(MSG_CONFIRM_DELETE); |
1481 |
return confirmDelete(MSG_CONFIRM_DELETE); |
1489 |
}); |
1482 |
}); |
1490 |
}); |
1483 |
}); |
1491 |
function mana_increment(mana_id, resourcename, fieldvalue, stepvalue = 1){ |
|
|
1492 |
$.ajax( { |
1493 |
type: "POST", |
1494 |
url: "/cgi-bin/koha/svc/mana/addvaluetofield", |
1495 |
data: {id: mana_id, field: fieldvalue, resource: resourcename, step: stepvalue}, |
1496 |
datatype: "json", |
1497 |
}).done( function() { |
1498 |
}).fail( function(){ }); |
1499 |
} |
1500 |
|
1501 |
function mana_use( mana_id ){ |
1502 |
$.ajax( { |
1503 |
type:"POST", |
1504 |
url: "/cgi-bin/koha/svc/mana/use", |
1505 |
data: {id:mana_id, resource: 'report', saveinbase: 1}, |
1506 |
dataType: "json", |
1507 |
}) |
1508 |
.done( function (result){ |
1509 |
window.location = ("/cgi-bin/koha/reports/guided_reports.pl?reports=").concat(result.id).concat("&phase=Show%20SQL"); |
1510 |
}) |
1511 |
.fail( function ( foo, msg, longmsg){ |
1512 |
}); |
1513 |
} |
1514 |
|
1515 |
function mana_search( textquery ){ |
1516 |
$.ajax({ |
1517 |
type: "POST", |
1518 |
url: "/cgi-bin/koha/svc/mana/search", |
1519 |
data: {biblionumber: $("#biblionumber").val(), resource: 'report', id: textquery, usecomments: 1}, |
1520 |
dataType: "html", |
1521 |
}) |
1522 |
.done( function( result ) { |
1523 |
$("#mana_search_result .modal-body").html(result); |
1524 |
$("#mana_search_result_label").text("Results from Mana Knowledge Base"); |
1525 |
$("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults,{ |
1526 |
"sPaginationType":"four_button", |
1527 |
"autoWidth": false, |
1528 |
"columnDefs": [ |
1529 |
{ "width": "35%", "targets": 1 } |
1530 |
], |
1531 |
"aoColumnDefs": [ |
1532 |
{ 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, |
1533 |
{ "sType": "title-string", "aTargets" : [ "title-string" ] }, |
1534 |
{ 'sType': "anti-the", 'aTargets' : [ 'anti-the'] } |
1535 |
] |
1536 |
})); |
1537 |
if($("td.dataTables_empty").length == 0){ |
1538 |
$("#mana_search").show(); |
1539 |
} |
1540 |
|
1541 |
$( "select[class='actionreport1']" ).show(); |
1542 |
$( "button[class='actionreport2']" ).hide(); |
1543 |
$("#CommentButton").on("click", function(){ |
1544 |
var resource_type = "report"; |
1545 |
var target_id = $("#selected_id").val(); |
1546 |
var manamsg = $("#manamsg").val(); |
1547 |
mana_comment(target_id, manamsg, resource_type); |
1548 |
$("#comment_box").modal("hide"); |
1549 |
}); |
1550 |
|
1551 |
$(".showbutton").on("click", function(){ |
1552 |
$(this).parent().hide(); |
1553 |
$(this).parent().next().show(); |
1554 |
}); |
1555 |
|
1556 |
$("a[class='hidebutton']").on("click", function(){ |
1557 |
$(this).parent().hide(); |
1558 |
$(this).parent().prev().show(); |
1559 |
}); |
1560 |
|
1561 |
$("#commentCloseButton").on("click", function(){ |
1562 |
$("#comment_box").modal("hide"); |
1563 |
}); |
1564 |
|
1565 |
$(".actionreport1").on("click", function(){ |
1566 |
$("#selectedcomment").val($(this).val()); |
1567 |
$(this).parent("select").hide(); |
1568 |
$(this).parent("select").next().show(); |
1569 |
}); |
1570 |
|
1571 |
$(".actionreport2").on("click", function(){ |
1572 |
$(this).hide(); |
1573 |
$(this).prev().show(); |
1574 |
mana_increment($("#selectedcomment").val(), 'resource_comment', 'nb', -1); |
1575 |
}); |
1576 |
}).fail( function( result ){ |
1577 |
}); |
1578 |
} |
1579 |
|
1580 |
function mana_comment( target_id, manamsg, resource_type ){ |
1581 |
$.ajax( { |
1582 |
type: "POST", |
1583 |
url: "/cgi-bin/koha/svc/mana/share", |
1584 |
data: {message: manamsg, resource: resource_type , resource_id: target_id}, |
1585 |
datatype: "json", |
1586 |
}) |
1587 |
} |
1588 |
|
1484 |
|
1589 |
function addColumn() { |
1485 |
function addColumn() { |
1590 |
$("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected"); |
1486 |
$("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected"); |