|
Lines 135-140
canned reports and writing custom SQL reports.</p>
Link Here
|
| 135 |
</div> |
135 |
</div> |
| 136 |
[% END %] |
136 |
[% END %] |
| 137 |
|
137 |
|
|
|
138 |
<div id="mana_search_result" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="mana_search_result_label" style="width: 100%; left:0%; margin-left: auto; display: none;"> |
| 139 |
<div class="modal-dialog modal-lg"> |
| 140 |
<div class="modal-content"> |
| 141 |
<div class="modal-header"> |
| 142 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
| 143 |
<h3 id="mana_search_result_label"> Mana Search</h3> |
| 144 |
</div> |
| 145 |
<div> |
| 146 |
<form id="search_form" style="margin-left: 5%"> |
| 147 |
Please enter a few key words: |
| 148 |
<input type=text id=mana_search_field> |
| 149 |
<input type=button class="mana_search_button" value="Search"> |
| 150 |
</form> |
| 151 |
<div class="modal-body"> |
| 152 |
</div> |
| 153 |
</div> |
| 154 |
</div> |
| 155 |
</div> |
| 156 |
</div> |
| 157 |
|
| 138 |
[% IF ( saved1 ) %] |
158 |
[% IF ( saved1 ) %] |
| 139 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
159 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
| 140 |
|
160 |
|
|
Lines 169-174
canned reports and writing custom SQL reports.</p>
Link Here
|
| 169 |
<option value="">All</option> |
189 |
<option value="">All</option> |
| 170 |
</select> |
190 |
</select> |
| 171 |
</div> |
191 |
</div> |
|
|
192 |
<div style="display:inline-block"> |
| 193 |
[% IF (manamsg == 'success') %] |
| 194 |
<div id="mana_search" class="dialog message"> |
| 195 |
<p> Shared successfully! Thanks for your help.</p> |
| 196 |
</div> |
| 197 |
[% ELSIF (manamsg == 'fail') %] |
| 198 |
<div id="mana_search" class="dialog message"> |
| 199 |
<p> An error occured while sharing, please try again later.</p> |
| 200 |
</div> |
| 201 |
[% END %] |
| 202 |
|
| 203 |
[% IF (Koha.Preference('Mana') == 1) %] |
| 204 |
<div id="mana_search" class="dialog message"> |
| 205 |
<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> |
| 206 |
</div> |
| 207 |
[% END %] |
| 208 |
|
| 209 |
</script> |
| 210 |
<h1> [% savedreport.sql %]</h1> |
| 172 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
211 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
| 173 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
212 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
| 174 |
<table id="table_reports"> |
213 |
<table id="table_reports"> |
|
Lines 204-226
canned reports and writing custom SQL reports.</p>
Link Here
|
| 204 |
<tbody> |
243 |
<tbody> |
| 205 |
[% FOREACH savedreport IN savedreports %] |
244 |
[% FOREACH savedreport IN savedreports %] |
| 206 |
[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %] |
245 |
[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %] |
| 207 |
<td> |
246 |
<td class="report_checkbox"> |
| 208 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
247 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
| 209 |
<input type="checkbox" name="ids" value="[% savedreport.id | html %]" /> |
248 |
<input type="checkbox" name="ids" value="[% savedreport.id | html %]" /> |
| 210 |
[% END %] |
249 |
[% END %] |
|
|
250 |
<input hidden class="report_sql" value="[% savedreport.savedsql %]"> |
| 211 |
</td> |
251 |
</td> |
| 212 |
<td><label for="ids">[% savedreport.id | html %]</label></td> |
252 |
<td class="report_id"><label for="ids">[% savedreport.id | html %]</label></td> |
| 213 |
<td> |
253 |
<td class="report_name"> |
| 214 |
[% IF ( savedreport.report_name ) %] |
254 |
[% IF ( savedreport.report_name ) %] |
| 215 |
[% savedreport.report_name | html %] |
255 |
[% savedreport.report_name | html %] |
| 216 |
[% ELSE %] |
256 |
[% ELSE %] |
| 217 |
[ no name ] |
257 |
[ no name ] |
| 218 |
[% END %] |
258 |
[% END %] |
| 219 |
</td> |
259 |
</td> |
| 220 |
<td>[% savedreport.type | html %]</td> |
260 |
<td class="report_type">[% savedreport.type | html %]</td> |
| 221 |
<td>[% savedreport.groupname | html %]</td> |
261 |
<td class="report_group">[% savedreport.groupname | html %]</td> |
| 222 |
<td>[% savedreport.subgroupname | html %]</td> |
262 |
<td>[% savedreport.subgroupname | html %]</td> |
| 223 |
<td>[% savedreport.notes | html %]</td> |
263 |
<td class="report_notes">[% savedreport.notes | html %]</td> |
| 224 |
<td>[% savedreport.borrowersurname | html %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname | html %][% END %] ([% savedreport.borrowernumber | html %])</td> |
264 |
<td>[% savedreport.borrowersurname | html %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname | html %][% END %] ([% savedreport.borrowernumber | html %])</td> |
| 225 |
<td><span title="[% savedreport.date_created | html %]">[% savedreport.date_created | $KohaDates %]</span></td> |
265 |
<td><span title="[% savedreport.date_created | html %]">[% savedreport.date_created | $KohaDates %]</span></td> |
| 226 |
<td><span title="[% savedreport.last_modified | html %]">[% savedreport.last_modified | $KohaDates with_hours => 1 %]</span></td> |
266 |
<td><span title="[% savedreport.last_modified | html %]">[% savedreport.last_modified | $KohaDates with_hours => 1 %]</span></td> |
|
Lines 267-272
canned reports and writing custom SQL reports.</p>
Link Here
|
| 267 |
<li><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id | uri %]&phase=Edit%20SQL"><i class="fa fa-pencil"></i> Edit</a></li> |
307 |
<li><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id | uri %]&phase=Edit%20SQL"><i class="fa fa-pencil"></i> Edit</a></li> |
| 268 |
<li><a title="Duplicate this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?phase=Create report from SQL&sql=[% savedreport.savedsql |uri %]&reportname=[% savedreport.report_name |uri %]&notes=[% savedreport.notes |uri %]"><i class="fa fa-copy"></i> Duplicate</a></li> |
308 |
<li><a title="Duplicate this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?phase=Create report from SQL&sql=[% savedreport.savedsql |uri %]&reportname=[% savedreport.report_name |uri %]&notes=[% savedreport.notes |uri %]"><i class="fa fa-copy"></i> Duplicate</a></li> |
| 269 |
[% END %] |
309 |
[% END %] |
|
|
310 |
[% IF (Koha.Preference('Mana') == 1) %] |
| 311 |
<li><a class="ShareButton" data-toggle="modal" href="#mana_share_report" title="Share your report with Mana Knowledge Base"><i class="fa fa-share-alt"></i> Share</a></li> |
| 312 |
[% END %] |
| 270 |
<li><a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id | uri %]"><i class="fa fa-clock-o"></i> Schedule</a></li> |
313 |
<li><a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id | uri %]"><i class="fa fa-clock-o"></i> Schedule</a></li> |
| 271 |
[% IF ( CAN_user_reports_delete_reports ) %] |
314 |
[% IF ( CAN_user_reports_delete_reports ) %] |
| 272 |
<li><a class="confirmdelete" title="Delete this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id | html %]&phase=Delete%20Saved"><i class="fa fa-trash"></i> Delete</a></li> |
315 |
<li><a class="confirmdelete" title="Delete this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id | html %]&phase=Delete%20Saved"><i class="fa fa-trash"></i> Delete</a></li> |
|
Lines 279-284
canned reports and writing custom SQL reports.</p>
Link Here
|
| 279 |
[% END %] |
322 |
[% END %] |
| 280 |
</tbody> |
323 |
</tbody> |
| 281 |
</table> |
324 |
</table> |
|
|
325 |
</div> |
| 282 |
[% IF ( CAN_user_reports_delete_reports ) %] |
326 |
[% IF ( CAN_user_reports_delete_reports ) %] |
| 283 |
<fieldset class="action"> |
327 |
<fieldset class="action"> |
| 284 |
<input type="submit" value="Delete selected" /> |
328 |
<input type="submit" value="Delete selected" /> |
|
Lines 319-324
canned reports and writing custom SQL reports.</p>
Link Here
|
| 319 |
[% END %] |
363 |
[% END %] |
| 320 |
[% END %] |
364 |
[% END %] |
| 321 |
|
365 |
|
|
|
366 |
<div id="mana_share_report" class="modal fade" tabindex="-1" role="dialog" arialabelledby="mana_share_modal_label" style="display: none;"> |
| 367 |
<div class="modal-dialog"> |
| 368 |
<div class="modal-content"> |
| 369 |
<div class="modal-header"> |
| 370 |
<h3 id="mana_share_modal_label">Share with Mana</h3> |
| 371 |
</div> |
| 372 |
<div class="modal-body"> |
| 373 |
[% IF (mana_id) %] |
| 374 |
<div class="alert"> |
| 375 |
<p>Your subscription is already linked with a Mana subscription model. Share it if you have made modifications, otherwise it will do nothing.</p> |
| 376 |
</div> |
| 377 |
[% END %] |
| 378 |
[% IF ( languages_loop ) %] |
| 379 |
[% UNLESS ( one_language_enabled ) %] |
| 380 |
<label id="noteerror" type="hidden">Please enter a report name and descriptive note before sharing (minimum 20 characters)</label> |
| 381 |
<div id="shared_infos" class="rows"> |
| 382 |
<li> <span class="label">Id: </span><div id="shared_id"></div> |
| 383 |
</li> |
| 384 |
<li> <span class="label">Name: </span><div id="shared_name"></div> |
| 385 |
</li> |
| 386 |
<li> <span class="label">SQL: </span><div id="shared_sql"></div> |
| 387 |
</li> |
| 388 |
<li> <span class="label">Group: </span><div id="shared_group"></div> |
| 389 |
</li> |
| 390 |
<li> <span class="label">Type: </span><div id="shared_type"></div> |
| 391 |
</li> |
| 392 |
<li> <span class="label">Notes: </span><div id="shared_notes"></div> |
| 393 |
</li> |
| 394 |
|
| 395 |
</div> |
| 396 |
<div class="rows"> |
| 397 |
<form method="post" id="mana_share_form" action="/cgi-bin/koha/reports/guided_reports.pl?phase=Share" class="validated" > |
| 398 |
<input type="hidden" name="phase" value="Share"> |
| 399 |
|
| 400 |
<fieldset> |
| 401 |
<label for="mana_language">Language:</label> |
| 402 |
<select id="mana_language" name="mana_language"> |
| 403 |
[% FOREACH languages_loo IN languages_loop %] |
| 404 |
[% IF ( languages_loo.group_enabled ) %] |
| 405 |
[% IF ( languages_loo.plural ) %] |
| 406 |
[% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %] |
| 407 |
[% IF ( sublanguages_loo.enabled ) %] |
| 408 |
[% IF ( sublanguages_loo.sublanguage_current ) %] |
| 409 |
<option value="[% languages_loo.rfc4646_subtag %]" selected> |
| 410 |
[% sublanguages_loo.native_description %] |
| 411 |
[% sublanguages_loo.script_description %] |
| 412 |
[% sublanguages_loo.region_description %] |
| 413 |
|
| 414 |
[% sublanguages_loo.variant_description %] |
| 415 |
([% sublanguages_loo.rfc4646_subtag %]) |
| 416 |
</option> |
| 417 |
[% ELSE %] |
| 418 |
<option value="[% languages_loo.rfc4646_subtag %]"> |
| 419 |
[% sublanguages_loo.native_description %] |
| 420 |
[% sublanguages_loo.script_description %] |
| 421 |
[% sublanguages_loo.region_description %] |
| 422 |
[% sublanguages_loo.variant_description %] |
| 423 |
([% sublanguages_loo.rfc4646_subtag %]) |
| 424 |
</option> |
| 425 |
[% END %] |
| 426 |
[% END %] |
| 427 |
[% END %] |
| 428 |
[% ELSE %] |
| 429 |
[% IF ( languages_loo.group_enabled ) %] |
| 430 |
[% IF ( languages_loo.current ) %] |
| 431 |
<option value="[% languages_loo.rfc4646_subtag %]" selected> |
| 432 |
[% IF ( languages_loo.native_description ) %] |
| 433 |
[% languages_loo.native_description %] |
| 434 |
[% ELSE %] |
| 435 |
[% languages_loo.rfc4646_subtag %] |
| 436 |
[% END %] |
| 437 |
</option> |
| 438 |
[% ELSE %] |
| 439 |
<option value="[% languages_loo.rfc4646_subtag %]"> |
| 440 |
[% IF ( languages_loo.native_description ) %] |
| 441 |
[% languages_loo.native_description %] |
| 442 |
[% ELSE %] |
| 443 |
[% languages_loo.rfc4646_subtag %] |
| 444 |
[% END %] |
| 445 |
</option> |
| 446 |
[% END %] |
| 447 |
[% END %] |
| 448 |
[% END %] |
| 449 |
[% END %] |
| 450 |
[% END %] |
| 451 |
</select> |
| 452 |
<input type="hidden" id="reportid" name="reportid" value="[% savedreport.id %]"/> |
| 453 |
</fieldset> |
| 454 |
</form> |
| 455 |
</div> |
| 456 |
[% END %] |
| 457 |
[% END %] |
| 458 |
</div> |
| 459 |
<div class="modal-footer"> |
| 460 |
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button> |
| 461 |
[% IF one_language_enabled==0 %] |
| 462 |
<button id="ManaShareButton" type="submit" form="mana_share_form" class="btn btn-primary">Share</button> |
| 463 |
[% ELSE %] |
| 464 |
<div id="ManaShareButton" class="btn-group"><a class="btn btn-primary"'onclick="share()">Share</a></div> |
| 465 |
[% END %] |
| 466 |
</div> |
| 467 |
</div> |
| 468 |
</div> |
| 469 |
</div> |
| 470 |
|
| 322 |
|
471 |
|
| 323 |
[% IF ( build1 ) %] |
472 |
[% IF ( build1 ) %] |
| 324 |
[% IF ( cache_error) %] |
473 |
[% IF ( cache_error) %] |
|
Lines 1025-1030
canned reports and writing custom SQL reports.</p>
Link Here
|
| 1025 |
} |
1174 |
} |
| 1026 |
} |
1175 |
} |
| 1027 |
|
1176 |
|
|
|
1177 |
function share() { |
| 1178 |
window.location="/cgi-bin/koha/reports/guided_reports.pl?phase=Save"; |
| 1179 |
} |
| 1180 |
|
| 1028 |
$(document).ready(function(){ |
1181 |
$(document).ready(function(){ |
| 1029 |
|
1182 |
|
| 1030 |
hide_bar_element(); |
1183 |
hide_bar_element(); |
|
Lines 1151-1156
canned reports and writing custom SQL reports.</p>
Link Here
|
| 1151 |
window.history.back(); |
1304 |
window.history.back(); |
| 1152 |
}); |
1305 |
}); |
| 1153 |
|
1306 |
|
|
|
1307 |
$(".mana_search_button").on("click",function(){ |
| 1308 |
mana_search($(this).prev().val()); |
| 1309 |
}); |
| 1310 |
|
| 1311 |
$(".ShareButton").on("click", function(){ |
| 1312 |
if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){ |
| 1313 |
$("#shared_infos").hide(); |
| 1314 |
$("#ManaShareButton").hide(); |
| 1315 |
$("#noterror").show(); |
| 1316 |
} |
| 1317 |
else{ |
| 1318 |
$("#shared_id").html($(this).closest("tr").find(".report_id").text()); |
| 1319 |
$("#shared_name").html($(this).closest("tr").find(".report_name").text()); |
| 1320 |
$("#shared_sql").html($(this).closest("tr").find(".report_sql").val()); |
| 1321 |
$("#shared_type").html($(this).closest("tr").find(".report_type").text()); |
| 1322 |
$("#shared_group").html($(this).closest("tr").find(".report_group").text()); |
| 1323 |
$("#shared_notes").html($(this).closest("tr").find(".report_notes").text()); |
| 1324 |
} |
| 1325 |
}); |
| 1326 |
|
| 1327 |
$('#search_form').submit(function () { |
| 1328 |
return false; |
| 1329 |
}); |
| 1330 |
|
| 1154 |
$("#addColumn").on("click",function(){ |
1331 |
$("#addColumn").on("click",function(){ |
| 1155 |
addColumn(); |
1332 |
addColumn(); |
| 1156 |
}); |
1333 |
}); |
|
Lines 1342-1347
canned reports and writing custom SQL reports.</p>
Link Here
|
| 1342 |
return confirmDelete(MSG_CONFIRM_DELETE); |
1519 |
return confirmDelete(MSG_CONFIRM_DELETE); |
| 1343 |
}); |
1520 |
}); |
| 1344 |
}); |
1521 |
}); |
|
|
1522 |
function mana_increment(mana_id, resourcename, fieldvalue, stepvalue = 1){ |
| 1523 |
$.ajax( { |
| 1524 |
type: "POST", |
| 1525 |
url: "/cgi-bin/koha/svc/mana/addvaluetofield", |
| 1526 |
data: {id: mana_id, field: fieldvalue, resource: resourcename, step: stepvalue}, |
| 1527 |
datatype: "json", |
| 1528 |
}).done( function() { |
| 1529 |
}).fail( function(){ }); |
| 1530 |
} |
| 1531 |
|
| 1532 |
function mana_use( mana_id ){ |
| 1533 |
$.ajax( { |
| 1534 |
type:"POST", |
| 1535 |
url: "/cgi-bin/koha/svc/mana/use", |
| 1536 |
data: {id:mana_id, resource: 'report', saveinbase: 1}, |
| 1537 |
dataType: "json", |
| 1538 |
}) |
| 1539 |
.done( function (result){ |
| 1540 |
window.location = ("/cgi-bin/koha/reports/guided_reports.pl?reports=").concat(result.id).concat("&phase=Show%20SQL"); |
| 1541 |
}) |
| 1542 |
.fail( function ( foo, msg, longmsg){ |
| 1543 |
}); |
| 1544 |
} |
| 1545 |
|
| 1546 |
function mana_search( textquery ){ |
| 1547 |
$.ajax({ |
| 1548 |
type: "POST", |
| 1549 |
url: "/cgi-bin/koha/svc/mana/search", |
| 1550 |
data: {biblionumber: $("#biblionumber").val(), resource: 'report', id: textquery, usecomments: 1}, |
| 1551 |
dataType: "html", |
| 1552 |
}) |
| 1553 |
.done( function( result ) { |
| 1554 |
$("#mana_search_result .modal-body").html(result); |
| 1555 |
$("#mana_search_result_label").text("Results from Mana Knowledge Base"); |
| 1556 |
$("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults,{ |
| 1557 |
"sPaginationType":"four_button", |
| 1558 |
"autoWidth": false, |
| 1559 |
"columnDefs": [ |
| 1560 |
{ "width": "35%", "targets": 1 } |
| 1561 |
], |
| 1562 |
"aoColumnDefs": [ |
| 1563 |
{ 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, |
| 1564 |
{ "sType": "title-string", "aTargets" : [ "title-string" ] }, |
| 1565 |
{ 'sType': "anti-the", 'aTargets' : [ 'anti-the'] } |
| 1566 |
] |
| 1567 |
})); |
| 1568 |
if($("td.dataTables_empty").length == 0){ |
| 1569 |
$("#mana_search").show(); |
| 1570 |
} |
| 1571 |
|
| 1572 |
$( "select[class='actionreport1']" ).show(); |
| 1573 |
$( "button[class='actionreport2']" ).hide(); |
| 1574 |
$("#CommentButton").on("click", function(){ |
| 1575 |
var resource_type = "report"; |
| 1576 |
var target_id = $("#selected_id").val(); |
| 1577 |
var manamsg = $("#manamsg").val(); |
| 1578 |
mana_comment(target_id, manamsg, resource_type); |
| 1579 |
$("#comment_box").modal("hide"); |
| 1580 |
}); |
| 1581 |
|
| 1582 |
$(".showbutton").on("click", function(){ |
| 1583 |
$(this).parent().hide(); |
| 1584 |
$(this).parent().next().show(); |
| 1585 |
}); |
| 1586 |
|
| 1587 |
$("a[class='hidebutton']").on("click", function(){ |
| 1588 |
$(this).parent().hide(); |
| 1589 |
$(this).parent().prev().show(); |
| 1590 |
}); |
| 1591 |
|
| 1592 |
$("#commentCloseButton").on("click", function(){ |
| 1593 |
$("#comment_box").modal("hide"); |
| 1594 |
}); |
| 1595 |
|
| 1596 |
$(".actionreport1").on("click", function(){ |
| 1597 |
$("#selectedcomment").val($(this).val()); |
| 1598 |
$(this).parent("select").hide(); |
| 1599 |
$(this).parent("select").next().show(); |
| 1600 |
}); |
| 1601 |
|
| 1602 |
$(".actionreport2").on("click", function(){ |
| 1603 |
$(this).hide(); |
| 1604 |
$(this).prev().show(); |
| 1605 |
mana_increment($("#selectedcomment").val(), 'resource_comment', 'nb', -1); |
| 1606 |
}); |
| 1607 |
}).fail( function( result ){ |
| 1608 |
}); |
| 1609 |
} |
| 1610 |
|
| 1611 |
function mana_comment( target_id, manamsg, resource_type ){ |
| 1612 |
$.ajax( { |
| 1613 |
type: "POST", |
| 1614 |
url: "/cgi-bin/koha/svc/mana/share", |
| 1615 |
data: {message: manamsg, resource: resource_type , resource_id: target_id}, |
| 1616 |
datatype: "json", |
| 1617 |
}) |
| 1618 |
} |
| 1619 |
|
| 1345 |
function addColumn() { |
1620 |
function addColumn() { |
| 1346 |
$("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected"); |
1621 |
$("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected"); |
| 1347 |
} |
1622 |
} |