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 | html %]</span></td> |
266 |
<td><span title="[% savedreport.last_modified | html %]">[% savedreport.last_modified | $KohaDates with_hours => 1 | html %]</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 1022-1027
canned reports and writing custom SQL reports.</p>
Link Here
|
1022 |
} |
1171 |
} |
1023 |
} |
1172 |
} |
1024 |
|
1173 |
|
|
|
1174 |
function share() { |
1175 |
window.location="/cgi-bin/koha/reports/guided_reports.pl?phase=Save"; |
1176 |
} |
1177 |
|
1025 |
$(document).ready(function(){ |
1178 |
$(document).ready(function(){ |
1026 |
|
1179 |
|
1027 |
hide_bar_element(); |
1180 |
hide_bar_element(); |
Lines 1148-1153
canned reports and writing custom SQL reports.</p>
Link Here
|
1148 |
window.history.back(); |
1301 |
window.history.back(); |
1149 |
}); |
1302 |
}); |
1150 |
|
1303 |
|
|
|
1304 |
$(".mana_search_button").on("click",function(){ |
1305 |
mana_search($(this).prev().val()); |
1306 |
}); |
1307 |
|
1308 |
$(".ShareButton").on("click", function(){ |
1309 |
if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){ |
1310 |
$("#shared_infos").hide(); |
1311 |
$("#ManaShareButton").hide(); |
1312 |
$("#noterror").show(); |
1313 |
} |
1314 |
else{ |
1315 |
$("#shared_id").html($(this).closest("tr").find(".report_id").text()); |
1316 |
$("#shared_name").html($(this).closest("tr").find(".report_name").text()); |
1317 |
$("#shared_sql").html($(this).closest("tr").find(".report_sql").val()); |
1318 |
$("#shared_type").html($(this).closest("tr").find(".report_type").text()); |
1319 |
$("#shared_group").html($(this).closest("tr").find(".report_group").text()); |
1320 |
$("#shared_notes").html($(this).closest("tr").find(".report_notes").text()); |
1321 |
} |
1322 |
}); |
1323 |
|
1324 |
$('#search_form').submit(function () { |
1325 |
return false; |
1326 |
}); |
1327 |
|
1151 |
$("#addColumn").on("click",function(){ |
1328 |
$("#addColumn").on("click",function(){ |
1152 |
addColumn(); |
1329 |
addColumn(); |
1153 |
}); |
1330 |
}); |
Lines 1339-1344
canned reports and writing custom SQL reports.</p>
Link Here
|
1339 |
return confirmDelete(MSG_CONFIRM_DELETE); |
1516 |
return confirmDelete(MSG_CONFIRM_DELETE); |
1340 |
}); |
1517 |
}); |
1341 |
}); |
1518 |
}); |
|
|
1519 |
function mana_increment(mana_id, resourcename, fieldvalue, stepvalue = 1){ |
1520 |
$.ajax( { |
1521 |
type: "POST", |
1522 |
url: "/cgi-bin/koha/svc/mana/addvaluetofield", |
1523 |
data: {id: mana_id, field: fieldvalue, resource: resourcename, step: stepvalue}, |
1524 |
datatype: "json", |
1525 |
}).done( function() { |
1526 |
}).fail( function(){ }); |
1527 |
} |
1528 |
|
1529 |
function mana_use( mana_id ){ |
1530 |
$.ajax( { |
1531 |
type:"POST", |
1532 |
url: "/cgi-bin/koha/svc/mana/use", |
1533 |
data: {id:mana_id, resource: 'report', saveinbase: 1}, |
1534 |
dataType: "json", |
1535 |
}) |
1536 |
.done( function (result){ |
1537 |
window.location = ("/cgi-bin/koha/reports/guided_reports.pl?reports=").concat(result.id).concat("&phase=Show%20SQL"); |
1538 |
}) |
1539 |
.fail( function ( foo, msg, longmsg){ |
1540 |
}); |
1541 |
} |
1542 |
|
1543 |
function mana_search( textquery ){ |
1544 |
$.ajax({ |
1545 |
type: "POST", |
1546 |
url: "/cgi-bin/koha/svc/mana/search", |
1547 |
data: {biblionumber: $("#biblionumber").val(), resource: 'report', id: textquery, usecomments: 1}, |
1548 |
dataType: "html", |
1549 |
}) |
1550 |
.done( function( result ) { |
1551 |
$("#mana_search_result .modal-body").html(result); |
1552 |
$("#mana_search_result_label").text("Results from Mana Knowledge Base"); |
1553 |
$("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults,{ |
1554 |
"sPaginationType":"four_button", |
1555 |
"autoWidth": false, |
1556 |
"columnDefs": [ |
1557 |
{ "width": "35%", "targets": 1 } |
1558 |
], |
1559 |
"aoColumnDefs": [ |
1560 |
{ 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, |
1561 |
{ "sType": "title-string", "aTargets" : [ "title-string" ] }, |
1562 |
{ 'sType': "anti-the", 'aTargets' : [ 'anti-the'] } |
1563 |
] |
1564 |
})); |
1565 |
if($("td.dataTables_empty").length == 0){ |
1566 |
$("#mana_search").show(); |
1567 |
} |
1568 |
|
1569 |
$( "select[class='actionreport1']" ).show(); |
1570 |
$( "button[class='actionreport2']" ).hide(); |
1571 |
$("#CommentButton").on("click", function(){ |
1572 |
var resource_type = "report"; |
1573 |
var target_id = $("#selected_id").val(); |
1574 |
var manamsg = $("#manamsg").val(); |
1575 |
mana_comment(target_id, manamsg, resource_type); |
1576 |
$("#comment_box").modal("hide"); |
1577 |
}); |
1578 |
|
1579 |
$(".showbutton").on("click", function(){ |
1580 |
$(this).parent().hide(); |
1581 |
$(this).parent().next().show(); |
1582 |
}); |
1583 |
|
1584 |
$("a[class='hidebutton']").on("click", function(){ |
1585 |
$(this).parent().hide(); |
1586 |
$(this).parent().prev().show(); |
1587 |
}); |
1588 |
|
1589 |
$("#commentCloseButton").on("click", function(){ |
1590 |
$("#comment_box").modal("hide"); |
1591 |
}); |
1592 |
|
1593 |
$(".actionreport1").on("click", function(){ |
1594 |
$("#selectedcomment").val($(this).val()); |
1595 |
$(this).parent("select").hide(); |
1596 |
$(this).parent("select").next().show(); |
1597 |
}); |
1598 |
|
1599 |
$(".actionreport2").on("click", function(){ |
1600 |
$(this).hide(); |
1601 |
$(this).prev().show(); |
1602 |
mana_increment($("#selectedcomment").val(), 'resource_comment', 'nb', -1); |
1603 |
}); |
1604 |
}).fail( function( result ){ |
1605 |
}); |
1606 |
} |
1607 |
|
1608 |
function mana_comment( target_id, manamsg, resource_type ){ |
1609 |
$.ajax( { |
1610 |
type: "POST", |
1611 |
url: "/cgi-bin/koha/svc/mana/share", |
1612 |
data: {message: manamsg, resource: resource_type , resource_id: target_id}, |
1613 |
datatype: "json", |
1614 |
}) |
1615 |
} |
1616 |
|
1342 |
function addColumn() { |
1617 |
function addColumn() { |
1343 |
$("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected"); |
1618 |
$("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected"); |
1344 |
} |
1619 |
} |