Lines 155-160
canned reports and writing custom SQL reports.</p>
Link Here
|
155 |
</div> |
155 |
</div> |
156 |
</div> |
156 |
</div> |
157 |
|
157 |
|
|
|
158 |
[% IF report_converted %] |
159 |
<div class="dialog message"> |
160 |
The report "[% report_converted %]" has been converted. |
161 |
</div> |
162 |
[% END %] |
163 |
|
164 |
|
158 |
[% IF ( saved1 ) %] |
165 |
[% IF ( saved1 ) %] |
159 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
166 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
160 |
|
167 |
|
Lines 196-209
canned reports and writing custom SQL reports.</p>
Link Here
|
196 |
</div> |
203 |
</div> |
197 |
[% END %] |
204 |
[% END %] |
198 |
|
205 |
|
199 |
[% IF (Koha.Preference('Mana') == 1) %] |
|
|
200 |
<div id="mana_search" class="dialog message"> |
201 |
<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> |
202 |
</div> |
203 |
[% END %] |
204 |
|
205 |
</script> |
206 |
</script> |
206 |
<h1> [% savedreport.sql %]</h1> |
207 |
|
207 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
208 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
208 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
209 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
209 |
<table id="table_reports"> |
210 |
<table id="table_reports"> |
Lines 243-249
canned reports and writing custom SQL reports.</p>
Link Here
|
243 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
244 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
244 |
<input type="checkbox" name="ids" value="[% savedreport.id | html %]" /> |
245 |
<input type="checkbox" name="ids" value="[% savedreport.id | html %]" /> |
245 |
[% END %] |
246 |
[% END %] |
246 |
<input hidden class="report_sql" value="[% savedreport.savedsql %]"> |
247 |
<input hidden class="report_sql" value="[% savedreport.savedsql |html %]"> |
247 |
</td> |
248 |
</td> |
248 |
<td class="report_id"><label for="ids">[% savedreport.id | html %]</label></td> |
249 |
<td class="report_id"><label for="ids">[% savedreport.id | html %]</label></td> |
249 |
<td class="report_name"> |
250 |
<td class="report_name"> |
Lines 1300-1309
canned reports and writing custom SQL reports.</p>
Link Here
|
1300 |
window.history.back(); |
1301 |
window.history.back(); |
1301 |
}); |
1302 |
}); |
1302 |
|
1303 |
|
1303 |
$(".mana_search_button").on("click",function(){ |
|
|
1304 |
mana_search($(this).prev().val()); |
1305 |
}); |
1306 |
|
1307 |
$(".ShareButton").on("click", function(){ |
1304 |
$(".ShareButton").on("click", function(){ |
1308 |
if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){ |
1305 |
if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){ |
1309 |
$("#shared_infos").hide(); |
1306 |
$("#shared_infos").hide(); |
Lines 1320-1329
canned reports and writing custom SQL reports.</p>
Link Here
|
1320 |
} |
1317 |
} |
1321 |
}); |
1318 |
}); |
1322 |
|
1319 |
|
1323 |
$('#search_form').submit(function () { |
|
|
1324 |
return false; |
1325 |
}); |
1326 |
|
1327 |
$("#addColumn").on("click",function(){ |
1320 |
$("#addColumn").on("click",function(){ |
1328 |
addColumn(); |
1321 |
addColumn(); |
1329 |
}); |
1322 |
}); |
Lines 1515-1617
canned reports and writing custom SQL reports.</p>
Link Here
|
1515 |
return confirmDelete(MSG_CONFIRM_DELETE); |
1508 |
return confirmDelete(MSG_CONFIRM_DELETE); |
1516 |
}); |
1509 |
}); |
1517 |
}); |
1510 |
}); |
1518 |
function mana_increment(mana_id, resourcename, fieldvalue, stepvalue = 1){ |
|
|
1519 |
$.ajax( { |
1520 |
type: "POST", |
1521 |
url: "/cgi-bin/koha/svc/mana/addvaluetofield", |
1522 |
data: {id: mana_id, field: fieldvalue, resource: resourcename, step: stepvalue}, |
1523 |
datatype: "json", |
1524 |
}).done( function() { |
1525 |
}).fail( function(){ }); |
1526 |
} |
1527 |
|
1528 |
function mana_use( mana_id ){ |
1529 |
$.ajax( { |
1530 |
type:"POST", |
1531 |
url: "/cgi-bin/koha/svc/mana/use", |
1532 |
data: {id:mana_id, resource: 'report', saveinbase: 1}, |
1533 |
dataType: "json", |
1534 |
}) |
1535 |
.done( function (result){ |
1536 |
window.location = ("/cgi-bin/koha/reports/guided_reports.pl?reports=").concat(result.id).concat("&phase=Show%20SQL"); |
1537 |
}) |
1538 |
.fail( function ( foo, msg, longmsg){ |
1539 |
}); |
1540 |
} |
1541 |
|
1542 |
function mana_search( textquery ){ |
1543 |
$.ajax({ |
1544 |
type: "POST", |
1545 |
url: "/cgi-bin/koha/svc/mana/search", |
1546 |
data: {biblionumber: $("#biblionumber").val(), resource: 'report', id: textquery, usecomments: 1}, |
1547 |
dataType: "html", |
1548 |
}) |
1549 |
.done( function( result ) { |
1550 |
$("#mana_search_result .modal-body").html(result); |
1551 |
$("#mana_search_result_label").text("Results from Mana Knowledge Base"); |
1552 |
$("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults,{ |
1553 |
"sPaginationType":"four_button", |
1554 |
"autoWidth": false, |
1555 |
"columnDefs": [ |
1556 |
{ "width": "35%", "targets": 1 } |
1557 |
], |
1558 |
"aoColumnDefs": [ |
1559 |
{ 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, |
1560 |
{ "sType": "title-string", "aTargets" : [ "title-string" ] }, |
1561 |
{ 'sType': "anti-the", 'aTargets' : [ 'anti-the'] } |
1562 |
] |
1563 |
})); |
1564 |
if($("td.dataTables_empty").length == 0){ |
1565 |
$("#mana_search").show(); |
1566 |
} |
1567 |
|
1568 |
$( "select[class='actionreport1']" ).show(); |
1569 |
$( "button[class='actionreport2']" ).hide(); |
1570 |
$("#CommentButton").on("click", function(){ |
1571 |
var resource_type = "report"; |
1572 |
var target_id = $("#selected_id").val(); |
1573 |
var manamsg = $("#manamsg").val(); |
1574 |
mana_comment(target_id, manamsg, resource_type); |
1575 |
$("#comment_box").modal("hide"); |
1576 |
}); |
1577 |
|
1578 |
$(".showbutton").on("click", function(){ |
1579 |
$(this).parent().hide(); |
1580 |
$(this).parent().next().show(); |
1581 |
}); |
1582 |
|
1583 |
$("a[class='hidebutton']").on("click", function(){ |
1584 |
$(this).parent().hide(); |
1585 |
$(this).parent().prev().show(); |
1586 |
}); |
1587 |
|
1588 |
$("#commentCloseButton").on("click", function(){ |
1589 |
$("#comment_box").modal("hide"); |
1590 |
}); |
1591 |
|
1592 |
$(".actionreport1").on("click", function(){ |
1593 |
$("#selectedcomment").val($(this).val()); |
1594 |
$(this).parent("select").hide(); |
1595 |
$(this).parent("select").next().show(); |
1596 |
}); |
1597 |
|
1598 |
$(".actionreport2").on("click", function(){ |
1599 |
$(this).hide(); |
1600 |
$(this).prev().show(); |
1601 |
mana_increment($("#selectedcomment").val(), 'resource_comment', 'nb', -1); |
1602 |
}); |
1603 |
}).fail( function( result ){ |
1604 |
}); |
1605 |
} |
1606 |
|
1607 |
function mana_comment( target_id, manamsg, resource_type ){ |
1608 |
$.ajax( { |
1609 |
type: "POST", |
1610 |
url: "/cgi-bin/koha/svc/mana/share", |
1611 |
data: {message: manamsg, resource: resource_type , resource_id: target_id}, |
1612 |
datatype: "json", |
1613 |
}) |
1614 |
} |
1615 |
|
1511 |
|
1616 |
function addColumn() { |
1512 |
function addColumn() { |
1617 |
$("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected"); |
1513 |
$("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected"); |