Lines 129-134
canned reports and writing custom SQL reports.</p>
Link Here
|
129 |
</div> |
129 |
</div> |
130 |
[% END %] |
130 |
[% END %] |
131 |
|
131 |
|
|
|
132 |
<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;"> |
133 |
<div class="modal-dialog modal-lg"> |
134 |
<div class="modal-content"> |
135 |
<div class="modal-header"> |
136 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
137 |
<h3 id="mana_search_result_label"> Mana Search</h3> |
138 |
</div> |
139 |
<div> |
140 |
<form id="search_form" style="margin-left: 5%"> |
141 |
Please enter a few key words: |
142 |
<input type=text id=mana_search_field> |
143 |
<input type=button class="mana_search_button" value="Search"> |
144 |
</form> |
145 |
<div class="modal-body"> |
146 |
</div> |
147 |
</div> |
148 |
</div> |
149 |
</div> |
150 |
</div> |
151 |
|
132 |
[% IF ( saved1 ) %] |
152 |
[% IF ( saved1 ) %] |
133 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
153 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
134 |
|
154 |
|
Lines 163-168
canned reports and writing custom SQL reports.</p>
Link Here
|
163 |
<option value="">All</option> |
183 |
<option value="">All</option> |
164 |
</select> |
184 |
</select> |
165 |
</div> |
185 |
</div> |
|
|
186 |
<div style="display:inline-block"> |
187 |
[% IF (manamsg == 'success') %] |
188 |
<div id="mana_search" class="dialog message"> |
189 |
<p> Shared successfully! Thanks for your help.</p> |
190 |
</div> |
191 |
[% ELSIF (manamsg == 'fail') %] |
192 |
<div id="mana_search" class="dialog message"> |
193 |
<p> An error occured while sharing, please try again later.</p> |
194 |
</div> |
195 |
[% END %] |
196 |
|
197 |
[% IF (Koha.Preference('Mana') == 1) %] |
198 |
<div id="mana_search" class="dialog message"> |
199 |
<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> |
200 |
</div> |
201 |
[% END %] |
202 |
|
203 |
</script> |
204 |
<h1> [% savedreport.sql %]</h1> |
166 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
205 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
167 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
206 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
168 |
<table id="table_reports"> |
207 |
<table id="table_reports"> |
Lines 198-220
canned reports and writing custom SQL reports.</p>
Link Here
|
198 |
<tbody> |
237 |
<tbody> |
199 |
[% FOREACH savedreport IN savedreports %] |
238 |
[% FOREACH savedreport IN savedreports %] |
200 |
[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %] |
239 |
[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %] |
201 |
<td> |
240 |
<td class="report_checkbox"> |
202 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
241 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
203 |
<input type="checkbox" name="ids" value="[% savedreport.id | html %]" /> |
242 |
<input type="checkbox" name="ids" value="[% savedreport.id | html %]" /> |
204 |
[% END %] |
243 |
[% END %] |
|
|
244 |
<input hidden class="report_sql" value="[% savedreport.savedsql %]"> |
205 |
</td> |
245 |
</td> |
206 |
<td><label for="ids">[% savedreport.id | html %]</label></td> |
246 |
<td class="report_id"><label for="ids">[% savedreport.id | html %]</label></td> |
207 |
<td> |
247 |
<td class="report_name"> |
208 |
[% IF ( savedreport.report_name ) %] |
248 |
[% IF ( savedreport.report_name ) %] |
209 |
[% savedreport.report_name | html %] |
249 |
[% savedreport.report_name | html %] |
210 |
[% ELSE %] |
250 |
[% ELSE %] |
211 |
[ no name ] |
251 |
[ no name ] |
212 |
[% END %] |
252 |
[% END %] |
213 |
</td> |
253 |
</td> |
214 |
<td>[% savedreport.type | html %]</td> |
254 |
<td class="report_type">[% savedreport.type | html %]</td> |
215 |
<td>[% savedreport.groupname | html %]</td> |
255 |
<td class="report_group">[% savedreport.groupname | html %]</td> |
216 |
<td>[% savedreport.subgroupname | html %]</td> |
256 |
<td>[% savedreport.subgroupname | html %]</td> |
217 |
<td>[% savedreport.notes | html %]</td> |
257 |
<td class="report_notes">[% savedreport.notes | html %]</td> |
218 |
<td>[% savedreport.borrowersurname | html %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname | html %][% END %] ([% savedreport.borrowernumber | html %])</td> |
258 |
<td>[% savedreport.borrowersurname | html %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname | html %][% END %] ([% savedreport.borrowernumber | html %])</td> |
219 |
<td><span title="[% savedreport.date_created | html %]">[% savedreport.date_created | $KohaDates %]</span></td> |
259 |
<td><span title="[% savedreport.date_created | html %]">[% savedreport.date_created | $KohaDates %]</span></td> |
220 |
<td><span title="[% savedreport.last_modified | html %]">[% savedreport.last_modified | $KohaDates with_hours => 1 | html %]</span></td> |
260 |
<td><span title="[% savedreport.last_modified | html %]">[% savedreport.last_modified | $KohaDates with_hours => 1 | html %]</span></td> |
Lines 261-266
canned reports and writing custom SQL reports.</p>
Link Here
|
261 |
<li><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id | html %]&phase=Edit%20SQL"><i class="fa fa-pencil"></i> Edit</a></li> |
301 |
<li><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id | html %]&phase=Edit%20SQL"><i class="fa fa-pencil"></i> Edit</a></li> |
262 |
<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> |
302 |
<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> |
263 |
[% END %] |
303 |
[% END %] |
|
|
304 |
[% IF (Koha.Preference('Mana') == 1) %] |
305 |
<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> |
306 |
[% END %] |
264 |
<li><a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id | html %]"><i class="fa fa-clock-o"></i> Schedule</a></li> |
307 |
<li><a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id | html %]"><i class="fa fa-clock-o"></i> Schedule</a></li> |
265 |
[% IF ( CAN_user_reports_delete_reports ) %] |
308 |
[% IF ( CAN_user_reports_delete_reports ) %] |
266 |
<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> |
309 |
<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 273-278
canned reports and writing custom SQL reports.</p>
Link Here
|
273 |
[% END %] |
316 |
[% END %] |
274 |
</tbody> |
317 |
</tbody> |
275 |
</table> |
318 |
</table> |
|
|
319 |
</div> |
276 |
[% IF ( CAN_user_reports_delete_reports ) %] |
320 |
[% IF ( CAN_user_reports_delete_reports ) %] |
277 |
<fieldset class="action"> |
321 |
<fieldset class="action"> |
278 |
<input type="submit" value="Delete selected" /> |
322 |
<input type="submit" value="Delete selected" /> |
Lines 313-318
canned reports and writing custom SQL reports.</p>
Link Here
|
313 |
[% END %] |
357 |
[% END %] |
314 |
[% END %] |
358 |
[% END %] |
315 |
|
359 |
|
|
|
360 |
<div id="mana_share_report" class="modal fade" tabindex="-1" role="dialog" arialabelledby="mana_share_modal_label" style="display: none;"> |
361 |
<div class="modal-dialog"> |
362 |
<div class="modal-content"> |
363 |
<div class="modal-header"> |
364 |
<h3 id="mana_share_modal_label">Share with Mana</h3> |
365 |
</div> |
366 |
<div class="modal-body"> |
367 |
[% IF (mana_id) %] |
368 |
<div class="alert"> |
369 |
<p>Your subscription is already linked with a Mana subscription model. Share it if you have made modifications, otherwise it will do nothing.</p> |
370 |
</div> |
371 |
[% END %] |
372 |
[% IF ( languages_loop ) %] |
373 |
[% UNLESS ( one_language_enabled ) %] |
374 |
<label id="noteerror" type="hidden">Please enter a report name and descriptive note before sharing (minimum 20 characters)</label> |
375 |
<div id="shared_infos" class="rows"> |
376 |
<li> <span class="label">Id: </span><div id="shared_id"></div> |
377 |
</li> |
378 |
<li> <span class="label">Name: </span><div id="shared_name"></div> |
379 |
</li> |
380 |
<li> <span class="label">SQL: </span><div id="shared_sql"></div> |
381 |
</li> |
382 |
<li> <span class="label">Group: </span><div id="shared_group"></div> |
383 |
</li> |
384 |
<li> <span class="label">Type: </span><div id="shared_type"></div> |
385 |
</li> |
386 |
<li> <span class="label">Notes: </span><div id="shared_notes"></div> |
387 |
</li> |
388 |
|
389 |
</div> |
390 |
<div class="rows"> |
391 |
<form method="post" id="mana_share_form" action="/cgi-bin/koha/reports/guided_reports.pl?phase=Share" class="validated" > |
392 |
<input type="hidden" name="phase" value="Share"> |
393 |
|
394 |
<fieldset> |
395 |
<label for="mana_language">Language:</label> |
396 |
<select id="mana_language" name="mana_language"> |
397 |
[% FOREACH languages_loo IN languages_loop %] |
398 |
[% IF ( languages_loo.group_enabled ) %] |
399 |
[% IF ( languages_loo.plural ) %] |
400 |
[% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %] |
401 |
[% IF ( sublanguages_loo.enabled ) %] |
402 |
[% IF ( sublanguages_loo.sublanguage_current ) %] |
403 |
<option value="[% languages_loo.rfc4646_subtag %]" selected> |
404 |
[% sublanguages_loo.native_description %] |
405 |
[% sublanguages_loo.script_description %] |
406 |
[% sublanguages_loo.region_description %] |
407 |
|
408 |
[% sublanguages_loo.variant_description %] |
409 |
([% sublanguages_loo.rfc4646_subtag %]) |
410 |
</option> |
411 |
[% ELSE %] |
412 |
<option value="[% languages_loo.rfc4646_subtag %]"> |
413 |
[% sublanguages_loo.native_description %] |
414 |
[% sublanguages_loo.script_description %] |
415 |
[% sublanguages_loo.region_description %] |
416 |
[% sublanguages_loo.variant_description %] |
417 |
([% sublanguages_loo.rfc4646_subtag %]) |
418 |
</option> |
419 |
[% END %] |
420 |
[% END %] |
421 |
[% END %] |
422 |
[% ELSE %] |
423 |
[% IF ( languages_loo.group_enabled ) %] |
424 |
[% IF ( languages_loo.current ) %] |
425 |
<option value="[% languages_loo.rfc4646_subtag %]" selected> |
426 |
[% IF ( languages_loo.native_description ) %] |
427 |
[% languages_loo.native_description %] |
428 |
[% ELSE %] |
429 |
[% languages_loo.rfc4646_subtag %] |
430 |
[% END %] |
431 |
</option> |
432 |
[% ELSE %] |
433 |
<option value="[% languages_loo.rfc4646_subtag %]"> |
434 |
[% IF ( languages_loo.native_description ) %] |
435 |
[% languages_loo.native_description %] |
436 |
[% ELSE %] |
437 |
[% languages_loo.rfc4646_subtag %] |
438 |
[% END %] |
439 |
</option> |
440 |
[% END %] |
441 |
[% END %] |
442 |
[% END %] |
443 |
[% END %] |
444 |
[% END %] |
445 |
</select> |
446 |
<input type="hidden" id="reportid" name="reportid" value="[% savedreport.id %]"/> |
447 |
</fieldset> |
448 |
</form> |
449 |
</div> |
450 |
[% END %] |
451 |
[% END %] |
452 |
</div> |
453 |
<div class="modal-footer"> |
454 |
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button> |
455 |
[% IF one_language_enabled==0 %] |
456 |
<button id="ManaShareButton" type="submit" form="mana_share_form" class="btn btn-primary">Share</button> |
457 |
[% ELSE %] |
458 |
<div id="ManaShareButton" class="btn-group"><a class="btn btn-primary"'onclick="share()">Share</a></div> |
459 |
[% END %] |
460 |
</div> |
461 |
</div> |
462 |
</div> |
463 |
</div> |
464 |
|
316 |
|
465 |
|
317 |
[% IF ( build1 ) %] |
466 |
[% IF ( build1 ) %] |
318 |
[% IF ( cache_error) %] |
467 |
[% IF ( cache_error) %] |
Lines 1001-1006
$(document).ready(function() {
Link Here
|
1001 |
} |
1150 |
} |
1002 |
} |
1151 |
} |
1003 |
|
1152 |
|
|
|
1153 |
function share() { |
1154 |
window.location="/cgi-bin/koha/reports/guided_reports.pl?phase=Save"; |
1155 |
} |
1156 |
|
1004 |
$(document).ready(function(){ |
1157 |
$(document).ready(function(){ |
1005 |
|
1158 |
|
1006 |
hide_bar_element(); |
1159 |
hide_bar_element(); |
Lines 1124-1129
$(document).ready(function() {
Link Here
|
1124 |
window.history.back(); |
1277 |
window.history.back(); |
1125 |
}); |
1278 |
}); |
1126 |
|
1279 |
|
|
|
1280 |
$(".mana_search_button").on("click",function(){ |
1281 |
mana_search($(this).prev().val()); |
1282 |
}); |
1283 |
|
1284 |
$(".ShareButton").on("click", function(){ |
1285 |
if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){ |
1286 |
$("#shared_infos").hide(); |
1287 |
$("#ManaShareButton").hide(); |
1288 |
$("#noterror").show(); |
1289 |
} |
1290 |
else{ |
1291 |
$("#shared_id").html($(this).closest("tr").find(".report_id").text()); |
1292 |
$("#shared_name").html($(this).closest("tr").find(".report_name").text()); |
1293 |
$("#shared_sql").html($(this).closest("tr").find(".report_sql").val()); |
1294 |
$("#shared_type").html($(this).closest("tr").find(".report_type").text()); |
1295 |
$("#shared_group").html($(this).closest("tr").find(".report_group").text()); |
1296 |
$("#shared_notes").html($(this).closest("tr").find(".report_notes").text()); |
1297 |
} |
1298 |
}); |
1299 |
|
1300 |
$('#search_form').submit(function () { |
1301 |
return false; |
1302 |
}); |
1303 |
|
1127 |
$("#addColumn").on("click",function(){ |
1304 |
$("#addColumn").on("click",function(){ |
1128 |
addColumn(); |
1305 |
addColumn(); |
1129 |
}); |
1306 |
}); |
Lines 1315-1320
$(document).ready(function() {
Link Here
|
1315 |
return confirmDelete(MSG_CONFIRM_DELETE); |
1492 |
return confirmDelete(MSG_CONFIRM_DELETE); |
1316 |
}); |
1493 |
}); |
1317 |
}); |
1494 |
}); |
|
|
1495 |
function mana_increment(mana_id, resourcename, fieldvalue, stepvalue = 1){ |
1496 |
$.ajax( { |
1497 |
type: "POST", |
1498 |
url: "/cgi-bin/koha/svc/mana/addvaluetofield", |
1499 |
data: {id: mana_id, field: fieldvalue, resource: resourcename, step: stepvalue}, |
1500 |
datatype: "json", |
1501 |
}).done( function() { |
1502 |
}).fail( function(){ }); |
1503 |
} |
1504 |
|
1505 |
function mana_use( mana_id ){ |
1506 |
$.ajax( { |
1507 |
type:"POST", |
1508 |
url: "/cgi-bin/koha/svc/mana/use", |
1509 |
data: {id:mana_id, resource: 'report', saveinbase: 1}, |
1510 |
dataType: "json", |
1511 |
}) |
1512 |
.done( function (result){ |
1513 |
window.location = ("/cgi-bin/koha/reports/guided_reports.pl?reports=").concat(result.id).concat("&phase=Show%20SQL"); |
1514 |
}) |
1515 |
.fail( function ( foo, msg, longmsg){ |
1516 |
}); |
1517 |
} |
1518 |
|
1519 |
function mana_search( textquery ){ |
1520 |
$.ajax({ |
1521 |
type: "POST", |
1522 |
url: "/cgi-bin/koha/svc/mana/search", |
1523 |
data: {biblionumber: $("#biblionumber").val(), resource: 'report', id: textquery, usecomments: 1}, |
1524 |
dataType: "html", |
1525 |
}) |
1526 |
.done( function( result ) { |
1527 |
$("#mana_search_result .modal-body").html(result); |
1528 |
$("#mana_search_result_label").text("Results from Mana Knowledge Base"); |
1529 |
$("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults,{ |
1530 |
"sPaginationType":"four_button", |
1531 |
"autoWidth": false, |
1532 |
"columnDefs": [ |
1533 |
{ "width": "35%", "targets": 1 } |
1534 |
], |
1535 |
"aoColumnDefs": [ |
1536 |
{ 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, |
1537 |
{ "sType": "title-string", "aTargets" : [ "title-string" ] }, |
1538 |
{ 'sType': "anti-the", 'aTargets' : [ 'anti-the'] } |
1539 |
] |
1540 |
})); |
1541 |
if($("td.dataTables_empty").length == 0){ |
1542 |
$("#mana_search").show(); |
1543 |
} |
1544 |
|
1545 |
$( "select[class='actionreport1']" ).show(); |
1546 |
$( "button[class='actionreport2']" ).hide(); |
1547 |
$("#CommentButton").on("click", function(){ |
1548 |
var resource_type = "report"; |
1549 |
var target_id = $("#selected_id").val(); |
1550 |
var manamsg = $("#manamsg").val(); |
1551 |
mana_comment(target_id, manamsg, resource_type); |
1552 |
$("#comment_box").modal("hide"); |
1553 |
}); |
1554 |
|
1555 |
$(".showbutton").on("click", function(){ |
1556 |
$(this).parent().hide(); |
1557 |
$(this).parent().next().show(); |
1558 |
}); |
1559 |
|
1560 |
$("a[class='hidebutton']").on("click", function(){ |
1561 |
$(this).parent().hide(); |
1562 |
$(this).parent().prev().show(); |
1563 |
}); |
1564 |
|
1565 |
$("#commentCloseButton").on("click", function(){ |
1566 |
$("#comment_box").modal("hide"); |
1567 |
}); |
1568 |
|
1569 |
$(".actionreport1").on("click", function(){ |
1570 |
$("#selectedcomment").val($(this).val()); |
1571 |
$(this).parent("select").hide(); |
1572 |
$(this).parent("select").next().show(); |
1573 |
}); |
1574 |
|
1575 |
$(".actionreport2").on("click", function(){ |
1576 |
$(this).hide(); |
1577 |
$(this).prev().show(); |
1578 |
mana_increment($("#selectedcomment").val(), 'resource_comment', 'nb', -1); |
1579 |
}); |
1580 |
}).fail( function( result ){ |
1581 |
}); |
1582 |
} |
1583 |
|
1584 |
function mana_comment( target_id, manamsg, resource_type ){ |
1585 |
$.ajax( { |
1586 |
type: "POST", |
1587 |
url: "/cgi-bin/koha/svc/mana/share", |
1588 |
data: {message: manamsg, resource: resource_type , resource_id: target_id}, |
1589 |
datatype: "json", |
1590 |
}) |
1591 |
} |
1592 |
|
1318 |
function addColumn() { |
1593 |
function addColumn() { |
1319 |
$("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected"); |
1594 |
$("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected"); |
1320 |
} |
1595 |
} |