Lines 142-147
canned reports and writing custom SQL reports.</p>
Link Here
|
142 |
</div> |
142 |
</div> |
143 |
[% END %] |
143 |
[% END %] |
144 |
|
144 |
|
|
|
145 |
<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;"> |
146 |
<div class="modal-dialog modal-lg"> |
147 |
<div class="modal-content"> |
148 |
<div class="modal-header"> |
149 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
150 |
<h3 id="mana_search_result_label"> Mana Search</h3> |
151 |
</div> |
152 |
<div> |
153 |
<form id="search_form" style="margin-left: 5%"> |
154 |
Please enter a few key words: |
155 |
<input type=text id=mana_search_field> |
156 |
<input type=button class="mana_search_button" value="Search"> |
157 |
</form> |
158 |
<div class="modal-body"> |
159 |
</div> |
160 |
</div> |
161 |
</div> |
162 |
</div> |
163 |
</div> |
164 |
|
145 |
[% IF ( saved1 ) %] |
165 |
[% IF ( saved1 ) %] |
146 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
166 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
147 |
|
167 |
|
Lines 159-164
canned reports and writing custom SQL reports.</p>
Link Here
|
159 |
<option value="">All</option> |
179 |
<option value="">All</option> |
160 |
</select> |
180 |
</select> |
161 |
</div> |
181 |
</div> |
|
|
182 |
<div style="display:inline-block"> |
183 |
[% IF (manamsg == 'success') %] |
184 |
<div id="mana_search" class="dialog message"> |
185 |
<p> Shared successfully! Thanks for your help.</p> |
186 |
</div> |
187 |
[% ELSIF (manamsg == 'fail') %] |
188 |
<div id="mana_search" class="dialog message"> |
189 |
<p> An error occured while sharing, please try again later.</p> |
190 |
</div> |
191 |
[% END %] |
192 |
|
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 |
<h1> [% savedreport.sql %]</h1> |
162 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
201 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
163 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
202 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
164 |
<table id="table_reports"> |
203 |
<table id="table_reports"> |
Lines 186-208
canned reports and writing custom SQL reports.</p>
Link Here
|
186 |
<tbody> |
225 |
<tbody> |
187 |
[% FOREACH savedreport IN savedreports %] |
226 |
[% FOREACH savedreport IN savedreports %] |
188 |
[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %] |
227 |
[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %] |
189 |
<td> |
228 |
<td class="report_checkbox"> |
190 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
229 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
191 |
<input type="checkbox" name="ids" value="[% savedreport.id %]" /> |
230 |
<input type="checkbox" name="ids" value="[% savedreport.id %]" /> |
192 |
[% END %] |
231 |
[% END %] |
|
|
232 |
<input hidden class="report_sql" value="[% savedreport.savedsql %]"> |
193 |
</td> |
233 |
</td> |
194 |
<td><label for="ids">[% savedreport.id %]</label></td> |
234 |
<td class="report_id"><label for="ids">[% savedreport.id %]</label></td> |
195 |
<td> |
235 |
<td class="report_name"> |
196 |
[% IF ( savedreport.report_name ) %] |
236 |
[% IF ( savedreport.report_name ) %] |
197 |
[% savedreport.report_name %] |
237 |
[% savedreport.report_name %] |
198 |
[% ELSE %] |
238 |
[% ELSE %] |
199 |
[ no name ] |
239 |
[ no name ] |
200 |
[% END %] |
240 |
[% END %] |
201 |
</td> |
241 |
</td> |
202 |
<td>[% savedreport.type %]</td> |
242 |
<td class="report_type">[% savedreport.type %]</td> |
203 |
<td>[% savedreport.groupname %]</td> |
243 |
<td class="report_group">[% savedreport.groupname %]</td> |
204 |
<td>[% savedreport.subgroupname %]</td> |
244 |
<td>[% savedreport.subgroupname %]</td> |
205 |
<td>[% savedreport.notes %]</td> |
245 |
<td class="report_notes">[% savedreport.notes %]</td> |
206 |
<td>[% savedreport.borrowersurname %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname %][% END %] ([% savedreport.borrowernumber %])</td> |
246 |
<td>[% savedreport.borrowersurname %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname %][% END %] ([% savedreport.borrowernumber %])</td> |
207 |
<td><span title="[% savedreport.date_created %]">[% savedreport.date_created | $KohaDates %]</span></td> |
247 |
<td><span title="[% savedreport.date_created %]">[% savedreport.date_created | $KohaDates %]</span></td> |
208 |
<td><span title="[% savedreport.last_modified %]">[% savedreport.last_modified | $KohaDates with_hours => 1 %]</span></td> |
248 |
<td><span title="[% savedreport.last_modified %]">[% savedreport.last_modified | $KohaDates with_hours => 1 %]</span></td> |
Lines 251-256
canned reports and writing custom SQL reports.</p>
Link Here
|
251 |
<li><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Edit%20SQL"><i class="fa fa-pencil"></i> Edit</a></li> |
291 |
<li><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Edit%20SQL"><i class="fa fa-pencil"></i> Edit</a></li> |
252 |
<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> |
292 |
<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> |
253 |
[% END %] |
293 |
[% END %] |
|
|
294 |
[% IF (Koha.Preference('Mana') == 1) %] |
295 |
<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> |
296 |
[% END %] |
254 |
<li><a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id %]"><i class="fa fa-clock-o"></i> Schedule</a></li> |
297 |
<li><a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id %]"><i class="fa fa-clock-o"></i> Schedule</a></li> |
255 |
[% IF ( CAN_user_reports_delete_reports ) %] |
298 |
[% IF ( CAN_user_reports_delete_reports ) %] |
256 |
<li><a class="confirmdelete" title="Delete this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Delete%20Saved"><i class="fa fa-trash"></i> Delete</a></li> |
299 |
<li><a class="confirmdelete" title="Delete this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Delete%20Saved"><i class="fa fa-trash"></i> Delete</a></li> |
Lines 263-268
canned reports and writing custom SQL reports.</p>
Link Here
|
263 |
[% END %] |
306 |
[% END %] |
264 |
</tbody> |
307 |
</tbody> |
265 |
</table> |
308 |
</table> |
|
|
309 |
</div> |
266 |
[% IF ( CAN_user_reports_delete_reports ) %] |
310 |
[% IF ( CAN_user_reports_delete_reports ) %] |
267 |
<fieldset class="action"> |
311 |
<fieldset class="action"> |
268 |
<input type="submit" value="Delete selected" /> |
312 |
<input type="submit" value="Delete selected" /> |
Lines 303-308
canned reports and writing custom SQL reports.</p>
Link Here
|
303 |
[% END %] |
347 |
[% END %] |
304 |
[% END %] |
348 |
[% END %] |
305 |
|
349 |
|
|
|
350 |
<div id="mana_share_report" class="modal fade" tabindex="-1" role="dialog" arialabelledby="mana_share_modal_label" style="display: none;"> |
351 |
<div class="modal-dialog"> |
352 |
<div class="modal-content"> |
353 |
<div class="modal-header"> |
354 |
<h3 id="mana_share_modal_label">Share with Mana</h3> |
355 |
</div> |
356 |
<div class="modal-body"> |
357 |
[% IF (mana_id) %] |
358 |
<div class="alert"> |
359 |
<p>Your subscription is already linked with a Mana subscription model. Share it if you have made modifications, otherwise it will do nothing.</p> |
360 |
</div> |
361 |
[% END %] |
362 |
[% IF ( languages_loop ) %] |
363 |
[% UNLESS ( one_language_enabled ) %] |
364 |
<label id="noteerror" type="hidden">Please enter a report name and descriptive note before sharing (minimum 20 characters)</label> |
365 |
<div id="shared_infos" class="rows"> |
366 |
<li> <span class="label">Id: </span><div id="shared_id"></div> |
367 |
</li> |
368 |
<li> <span class="label">Name: </span><div id="shared_name"></div> |
369 |
</li> |
370 |
<li> <span class="label">SQL: </span><div id="shared_sql"></div> |
371 |
</li> |
372 |
<li> <span class="label">Group: </span><div id="shared_group"></div> |
373 |
</li> |
374 |
<li> <span class="label">Type: </span><div id="shared_type"></div> |
375 |
</li> |
376 |
<li> <span class="label">Notes: </span><div id="shared_notes"></div> |
377 |
</li> |
378 |
|
379 |
</div> |
380 |
<div class="rows"> |
381 |
<form method="post" id="mana_share_form" action="/cgi-bin/koha/reports/guided_reports.pl?phase=Share" class="validated" > |
382 |
<input type="hidden" name="phase" value="Share"> |
383 |
|
384 |
<fieldset> |
385 |
<label for="mana_language">Language:</label> |
386 |
<select id="mana_language" name="mana_language"> |
387 |
[% FOREACH languages_loo IN languages_loop %] |
388 |
[% IF ( languages_loo.group_enabled ) %] |
389 |
[% IF ( languages_loo.plural ) %] |
390 |
[% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %] |
391 |
[% IF ( sublanguages_loo.enabled ) %] |
392 |
[% IF ( sublanguages_loo.sublanguage_current ) %] |
393 |
<option value="[% languages_loo.rfc4646_subtag %]" selected> |
394 |
[% sublanguages_loo.native_description %] |
395 |
[% sublanguages_loo.script_description %] |
396 |
[% sublanguages_loo.region_description %] |
397 |
|
398 |
[% sublanguages_loo.variant_description %] |
399 |
([% sublanguages_loo.rfc4646_subtag %]) |
400 |
</option> |
401 |
[% ELSE %] |
402 |
<option value="[% languages_loo.rfc4646_subtag %]"> |
403 |
[% sublanguages_loo.native_description %] |
404 |
[% sublanguages_loo.script_description %] |
405 |
[% sublanguages_loo.region_description %] |
406 |
[% sublanguages_loo.variant_description %] |
407 |
([% sublanguages_loo.rfc4646_subtag %]) |
408 |
</option> |
409 |
[% END %] |
410 |
[% END %] |
411 |
[% END %] |
412 |
[% ELSE %] |
413 |
[% IF ( languages_loo.group_enabled ) %] |
414 |
[% IF ( languages_loo.current ) %] |
415 |
<option value="[% languages_loo.rfc4646_subtag %]" selected> |
416 |
[% IF ( languages_loo.native_description ) %] |
417 |
[% languages_loo.native_description %] |
418 |
[% ELSE %] |
419 |
[% languages_loo.rfc4646_subtag %] |
420 |
[% END %] |
421 |
</option> |
422 |
[% ELSE %] |
423 |
<option value="[% languages_loo.rfc4646_subtag %]"> |
424 |
[% IF ( languages_loo.native_description ) %] |
425 |
[% languages_loo.native_description %] |
426 |
[% ELSE %] |
427 |
[% languages_loo.rfc4646_subtag %] |
428 |
[% END %] |
429 |
</option> |
430 |
[% END %] |
431 |
[% END %] |
432 |
[% END %] |
433 |
[% END %] |
434 |
[% END %] |
435 |
</select> |
436 |
<input type="hidden" id="reportid" name="reportid" value="[% savedreport.id %]"/> |
437 |
</fieldset> |
438 |
</form> |
439 |
</div> |
440 |
[% END %] |
441 |
[% END %] |
442 |
</div> |
443 |
<div class="modal-footer"> |
444 |
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button> |
445 |
[% IF one_language_enabled==0 %] |
446 |
<button id="ManaShareButton" type="submit" form="mana_share_form" class="btn btn-primary">Share</button> |
447 |
[% ELSE %] |
448 |
<div id="ManaShareButton" class="btn-group"><a class="btn btn-primary"'onclick="share()">Share</a></div> |
449 |
[% END %] |
450 |
</div> |
451 |
</div> |
452 |
</div> |
453 |
</div> |
454 |
|
306 |
|
455 |
|
307 |
[% IF ( build1 ) %] |
456 |
[% IF ( build1 ) %] |
308 |
[% IF ( cache_error) %] |
457 |
[% IF ( cache_error) %] |
Lines 962-967
$(document).ready(function() {
Link Here
|
962 |
} |
1111 |
} |
963 |
} |
1112 |
} |
964 |
|
1113 |
|
|
|
1114 |
function share() { |
1115 |
window.location="/cgi-bin/koha/reports/guided_reports.pl?phase=Save"; |
1116 |
} |
1117 |
|
965 |
$(document).ready(function(){ |
1118 |
$(document).ready(function(){ |
966 |
|
1119 |
|
967 |
$('[data-toggle="tooltip"]').tooltip(); |
1120 |
$('[data-toggle="tooltip"]').tooltip(); |
Lines 980-985
$(document).ready(function() {
Link Here
|
980 |
window.history.back(); |
1133 |
window.history.back(); |
981 |
}); |
1134 |
}); |
982 |
|
1135 |
|
|
|
1136 |
$(".mana_search_button").on("click",function(){ |
1137 |
mana_search($(this).prev().val()); |
1138 |
}); |
1139 |
|
1140 |
$(".ShareButton").on("click", function(){ |
1141 |
if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){ |
1142 |
$("#shared_infos").hide(); |
1143 |
$("#ManaShareButton").hide(); |
1144 |
$("#noterror").show(); |
1145 |
} |
1146 |
else{ |
1147 |
$("#shared_id").html($(this).closest("tr").find(".report_id").text()); |
1148 |
$("#shared_name").html($(this).closest("tr").find(".report_name").text()); |
1149 |
$("#shared_sql").html($(this).closest("tr").find(".report_sql").val()); |
1150 |
$("#shared_type").html($(this).closest("tr").find(".report_type").text()); |
1151 |
$("#shared_group").html($(this).closest("tr").find(".report_group").text()); |
1152 |
$("#shared_notes").html($(this).closest("tr").find(".report_notes").text()); |
1153 |
} |
1154 |
}); |
1155 |
|
1156 |
$('#search_form').submit(function () { |
1157 |
return false; |
1158 |
}); |
1159 |
|
983 |
$("#addColumn").on("click",function(){ |
1160 |
$("#addColumn").on("click",function(){ |
984 |
addColumn(); |
1161 |
addColumn(); |
985 |
}); |
1162 |
}); |
Lines 1164-1169
$(document).ready(function() {
Link Here
|
1164 |
return confirmDelete(MSG_CONFIRM_DELETE); |
1341 |
return confirmDelete(MSG_CONFIRM_DELETE); |
1165 |
}); |
1342 |
}); |
1166 |
}); |
1343 |
}); |
|
|
1344 |
function mana_increment(mana_id, resourcename, fieldvalue, stepvalue = 1){ |
1345 |
$.ajax( { |
1346 |
type: "POST", |
1347 |
url: "/cgi-bin/koha/svc/mana/addvaluetofield", |
1348 |
data: {id: mana_id, field: fieldvalue, resource: resourcename, step: stepvalue}, |
1349 |
datatype: "json", |
1350 |
}).done( function() { |
1351 |
}).fail( function(){ }); |
1352 |
} |
1353 |
|
1354 |
function mana_use( mana_id ){ |
1355 |
$.ajax( { |
1356 |
type:"POST", |
1357 |
url: "/cgi-bin/koha/svc/mana/use", |
1358 |
data: {id:mana_id, resource: 'report', saveinbase: 1}, |
1359 |
dataType: "json", |
1360 |
}) |
1361 |
.done( function (result){ |
1362 |
window.location = ("/cgi-bin/koha/reports/guided_reports.pl?reports=").concat(result.id).concat("&phase=Show%20SQL"); |
1363 |
}) |
1364 |
.fail( function ( foo, msg, longmsg){ |
1365 |
}); |
1366 |
} |
1367 |
|
1368 |
function mana_search( textquery ){ |
1369 |
$.ajax({ |
1370 |
type: "POST", |
1371 |
url: "/cgi-bin/koha/svc/mana/search", |
1372 |
data: {biblionumber: $("#biblionumber").val(), resource: 'report', id: textquery, usecomments: 1}, |
1373 |
dataType: "html", |
1374 |
}) |
1375 |
.done( function( result ) { |
1376 |
$("#mana_search_result .modal-body").html(result); |
1377 |
$("#mana_search_result_label").text("Results from Mana Knowledge Base"); |
1378 |
$("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults,{ |
1379 |
"sPaginationType":"four_button", |
1380 |
"autoWidth": false, |
1381 |
"columnDefs": [ |
1382 |
{ "width": "35%", "targets": 1 } |
1383 |
], |
1384 |
"aoColumnDefs": [ |
1385 |
{ 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, |
1386 |
{ "sType": "title-string", "aTargets" : [ "title-string" ] }, |
1387 |
{ 'sType': "anti-the", 'aTargets' : [ 'anti-the'] } |
1388 |
] |
1389 |
})); |
1390 |
if($("td.dataTables_empty").length == 0){ |
1391 |
$("#mana_search").show(); |
1392 |
} |
1393 |
|
1394 |
$( "select[class='actionreport1']" ).show(); |
1395 |
$( "button[class='actionreport2']" ).hide(); |
1396 |
$("#CommentButton").on("click", function(){ |
1397 |
var resource_type = "report"; |
1398 |
var target_id = $("#selected_id").val(); |
1399 |
var manamsg = $("#manamsg").val(); |
1400 |
mana_comment(target_id, manamsg, resource_type); |
1401 |
$("#comment_box").modal("hide"); |
1402 |
}); |
1403 |
|
1404 |
$(".showbutton").on("click", function(){ |
1405 |
$(this).parent().hide(); |
1406 |
$(this).parent().next().show(); |
1407 |
}); |
1408 |
|
1409 |
$("a[class='hidebutton']").on("click", function(){ |
1410 |
$(this).parent().hide(); |
1411 |
$(this).parent().prev().show(); |
1412 |
}); |
1413 |
|
1414 |
$("#commentCloseButton").on("click", function(){ |
1415 |
$("#comment_box").modal("hide"); |
1416 |
}); |
1417 |
|
1418 |
$(".actionreport1").on("click", function(){ |
1419 |
$("#selectedcomment").val($(this).val()); |
1420 |
$(this).parent("select").hide(); |
1421 |
$(this).parent("select").next().show(); |
1422 |
}); |
1423 |
|
1424 |
$(".actionreport2").on("click", function(){ |
1425 |
$(this).hide(); |
1426 |
$(this).prev().show(); |
1427 |
mana_increment($("#selectedcomment").val(), 'resource_comment', 'nb', -1); |
1428 |
}); |
1429 |
}).fail( function( result ){ |
1430 |
}); |
1431 |
} |
1432 |
|
1433 |
function mana_comment( target_id, manamsg, resource_type ){ |
1434 |
$.ajax( { |
1435 |
type: "POST", |
1436 |
url: "/cgi-bin/koha/svc/mana/share", |
1437 |
data: {message: manamsg, resource: resource_type , resource_id: target_id}, |
1438 |
datatype: "json", |
1439 |
}) |
1440 |
} |
1441 |
|
1167 |
function addColumn() { |
1442 |
function addColumn() { |
1168 |
$("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected"); |
1443 |
$("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected"); |
1169 |
} |
1444 |
} |