Lines 130-135
canned reports and writing custom SQL reports.</p>
Link Here
|
130 |
</div> |
130 |
</div> |
131 |
[% END %] |
131 |
[% END %] |
132 |
|
132 |
|
|
|
133 |
<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;"> |
134 |
<div class="modal-dialog modal-lg"> |
135 |
<div class="modal-content"> |
136 |
<div class="modal-header"> |
137 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
138 |
<h3 id="mana_search_result_label"> Mana Search</h3> |
139 |
</div> |
140 |
<div> |
141 |
<form id="search_form" style="margin-left: 5%"> |
142 |
Please enter a few key words: |
143 |
<input type=text id=mana_search_field> |
144 |
<input type=button class="mana_search_button" value="Search"> |
145 |
</form> |
146 |
<div class="modal-body"> |
147 |
</div> |
148 |
</div> |
149 |
</div> |
150 |
</div> |
151 |
</div> |
152 |
|
133 |
[% IF ( saved1 ) %] |
153 |
[% IF ( saved1 ) %] |
134 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
154 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
135 |
|
155 |
|
Lines 147-152
canned reports and writing custom SQL reports.</p>
Link Here
|
147 |
<option value="">All</option> |
167 |
<option value="">All</option> |
148 |
</select> |
168 |
</select> |
149 |
</div> |
169 |
</div> |
|
|
170 |
<div style="display:inline-block"> |
171 |
[% IF (manamsg == 'success') %] |
172 |
<div id="mana_search" class="dialog message"> |
173 |
<p> Shared successfully! Thanks for your help.</p> |
174 |
</div> |
175 |
[% ELSIF (manamsg == 'fail') %] |
176 |
<div id="mana_search" class="dialog message"> |
177 |
<p> An error occured while sharing, please try again later.</p> |
178 |
</div> |
179 |
[% END %] |
180 |
|
181 |
[% IF (Koha.Preference('Mana') == 1) %] |
182 |
<div id="mana_search" class="dialog message"> |
183 |
<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> |
184 |
</div> |
185 |
[% END %] |
186 |
|
187 |
</script> |
188 |
<h1> [% savedreport.sql %]</h1> |
150 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
189 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post"> |
151 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
190 |
<input type="hidden" name="phase" value="Delete Multiple" /> |
152 |
<table id="table_reports"> |
191 |
<table id="table_reports"> |
Lines 174-196
canned reports and writing custom SQL reports.</p>
Link Here
|
174 |
<tbody> |
213 |
<tbody> |
175 |
[% FOREACH savedreport IN savedreports %] |
214 |
[% FOREACH savedreport IN savedreports %] |
176 |
[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %] |
215 |
[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %] |
177 |
<td> |
216 |
<td class="report_checkbox"> |
178 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
217 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
179 |
<input type="checkbox" name="ids" value="[% savedreport.id %]" /> |
218 |
<input type="checkbox" name="ids" value="[% savedreport.id %]" /> |
180 |
[% END %] |
219 |
[% END %] |
|
|
220 |
<input hidden class="report_sql" value="[% savedreport.savedsql %]"> |
181 |
</td> |
221 |
</td> |
182 |
<td><label for="ids">[% savedreport.id %]</label></td> |
222 |
<td class="report_id"><label for="ids">[% savedreport.id %]</label></td> |
183 |
<td> |
223 |
<td class="report_name"> |
184 |
[% IF ( savedreport.report_name ) %] |
224 |
[% IF ( savedreport.report_name ) %] |
185 |
[% savedreport.report_name %] |
225 |
[% savedreport.report_name %] |
186 |
[% ELSE %] |
226 |
[% ELSE %] |
187 |
[ no name ] |
227 |
[ no name ] |
188 |
[% END %] |
228 |
[% END %] |
189 |
</td> |
229 |
</td> |
190 |
<td>[% savedreport.type %]</td> |
230 |
<td class="report_type">[% savedreport.type %]</td> |
191 |
<td>[% savedreport.groupname %]</td> |
231 |
<td class="report_group">[% savedreport.groupname %]</td> |
192 |
<td>[% savedreport.subgroupname %]</td> |
232 |
<td>[% savedreport.subgroupname %]</td> |
193 |
<td>[% savedreport.notes %]</td> |
233 |
<td class="report_notes">[% savedreport.notes %]</td> |
194 |
<td>[% savedreport.borrowersurname %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname %][% END %] ([% savedreport.borrowernumber %])</td> |
234 |
<td>[% savedreport.borrowersurname %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname %][% END %] ([% savedreport.borrowernumber %])</td> |
195 |
<td><span title="[% savedreport.date_created %]">[% savedreport.date_created | $KohaDates %]</span></td> |
235 |
<td><span title="[% savedreport.date_created %]">[% savedreport.date_created | $KohaDates %]</span></td> |
196 |
<td><span title="[% savedreport.last_modified %]">[% savedreport.last_modified | $KohaDates with_hours => 1 %]</span></td> |
236 |
<td><span title="[% savedreport.last_modified %]">[% savedreport.last_modified | $KohaDates with_hours => 1 %]</span></td> |
Lines 239-244
canned reports and writing custom SQL reports.</p>
Link Here
|
239 |
<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> |
279 |
<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> |
240 |
<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> |
280 |
<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> |
241 |
[% END %] |
281 |
[% END %] |
|
|
282 |
[% IF (Koha.Preference('Mana') == 1) %] |
283 |
<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> |
284 |
[% END %] |
242 |
<li><a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id %]"><i class="fa fa-clock-o"></i> Schedule</a></li> |
285 |
<li><a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id %]"><i class="fa fa-clock-o"></i> Schedule</a></li> |
243 |
[% IF ( CAN_user_reports_delete_reports ) %] |
286 |
[% IF ( CAN_user_reports_delete_reports ) %] |
244 |
<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> |
287 |
<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 251-256
canned reports and writing custom SQL reports.</p>
Link Here
|
251 |
[% END %] |
294 |
[% END %] |
252 |
</tbody> |
295 |
</tbody> |
253 |
</table> |
296 |
</table> |
|
|
297 |
</div> |
254 |
[% IF ( CAN_user_reports_delete_reports ) %] |
298 |
[% IF ( CAN_user_reports_delete_reports ) %] |
255 |
<fieldset class="action"> |
299 |
<fieldset class="action"> |
256 |
<input type="submit" value="Delete selected" /> |
300 |
<input type="submit" value="Delete selected" /> |
Lines 291-296
canned reports and writing custom SQL reports.</p>
Link Here
|
291 |
[% END %] |
335 |
[% END %] |
292 |
[% END %] |
336 |
[% END %] |
293 |
|
337 |
|
|
|
338 |
<div id="mana_share_report" class="modal fade" tabindex="-1" role="dialog" arialabelledby="mana_share_modal_label" style="display: none;"> |
339 |
<div class="modal-dialog"> |
340 |
<div class="modal-content"> |
341 |
<div class="modal-header"> |
342 |
<h3 id="mana_share_modal_label">Share with Mana</h3> |
343 |
</div> |
344 |
<div class="modal-body"> |
345 |
[% IF (mana_id) %] |
346 |
<div class="alert"> |
347 |
<p>Your subscription is already linked with a Mana subscription model. Share it if you have made modifications, otherwise it will do nothing.</p> |
348 |
</div> |
349 |
[% END %] |
350 |
[% IF ( languages_loop ) %] |
351 |
[% UNLESS ( one_language_enabled ) %] |
352 |
<label id="noteerror" type="hidden">Please enter a report name and descriptive note before sharing (minimum 20 characters)</label> |
353 |
<div id="shared_infos" class="rows"> |
354 |
<li> <span class="label">Id: </span><div id="shared_id"></div> |
355 |
</li> |
356 |
<li> <span class="label">Name: </span><div id="shared_name"></div> |
357 |
</li> |
358 |
<li> <span class="label">SQL: </span><div id="shared_sql"></div> |
359 |
</li> |
360 |
<li> <span class="label">Group: </span><div id="shared_group"></div> |
361 |
</li> |
362 |
<li> <span class="label">Type: </span><div id="shared_type"></div> |
363 |
</li> |
364 |
<li> <span class="label">Notes: </span><div id="shared_notes"></div> |
365 |
</li> |
366 |
|
367 |
</div> |
368 |
<div class="rows"> |
369 |
<form method="post" id="mana_share_form" action="/cgi-bin/koha/reports/guided_reports.pl?phase=Share" class="validated" > |
370 |
<input type="hidden" name="phase" value="Share"> |
371 |
|
372 |
<fieldset> |
373 |
<label for="mana_language">Language:</label> |
374 |
<select id="mana_language" name="mana_language"> |
375 |
[% FOREACH languages_loo IN languages_loop %] |
376 |
[% IF ( languages_loo.group_enabled ) %] |
377 |
[% IF ( languages_loo.plural ) %] |
378 |
[% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %] |
379 |
[% IF ( sublanguages_loo.enabled ) %] |
380 |
[% IF ( sublanguages_loo.sublanguage_current ) %] |
381 |
<option value="[% languages_loo.rfc4646_subtag %]" selected> |
382 |
[% sublanguages_loo.native_description %] |
383 |
[% sublanguages_loo.script_description %] |
384 |
[% sublanguages_loo.region_description %] |
385 |
|
386 |
[% sublanguages_loo.variant_description %] |
387 |
([% sublanguages_loo.rfc4646_subtag %]) |
388 |
</option> |
389 |
[% ELSE %] |
390 |
<option value="[% languages_loo.rfc4646_subtag %]"> |
391 |
[% sublanguages_loo.native_description %] |
392 |
[% sublanguages_loo.script_description %] |
393 |
[% sublanguages_loo.region_description %] |
394 |
[% sublanguages_loo.variant_description %] |
395 |
([% sublanguages_loo.rfc4646_subtag %]) |
396 |
</option> |
397 |
[% END %] |
398 |
[% END %] |
399 |
[% END %] |
400 |
[% ELSE %] |
401 |
[% IF ( languages_loo.group_enabled ) %] |
402 |
[% IF ( languages_loo.current ) %] |
403 |
<option value="[% languages_loo.rfc4646_subtag %]" selected> |
404 |
[% IF ( languages_loo.native_description ) %] |
405 |
[% languages_loo.native_description %] |
406 |
[% ELSE %] |
407 |
[% languages_loo.rfc4646_subtag %] |
408 |
[% END %] |
409 |
</option> |
410 |
[% ELSE %] |
411 |
<option value="[% languages_loo.rfc4646_subtag %]"> |
412 |
[% IF ( languages_loo.native_description ) %] |
413 |
[% languages_loo.native_description %] |
414 |
[% ELSE %] |
415 |
[% languages_loo.rfc4646_subtag %] |
416 |
[% END %] |
417 |
</option> |
418 |
[% END %] |
419 |
[% END %] |
420 |
[% END %] |
421 |
[% END %] |
422 |
[% END %] |
423 |
</select> |
424 |
<input type="hidden" id="reportid" name="reportid" value="[% savedreport.id %]"/> |
425 |
</fieldset> |
426 |
</form> |
427 |
</div> |
428 |
[% END %] |
429 |
[% END %] |
430 |
</div> |
431 |
<div class="modal-footer"> |
432 |
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button> |
433 |
[% IF one_language_enabled==0 %] |
434 |
<button id="ManaShareButton" type="submit" form="mana_share_form" class="btn btn-primary">Share</button> |
435 |
[% ELSE %] |
436 |
<div id="ManaShareButton" class="btn-group"><a class="btn btn-primary"'onclick="share()">Share</a></div> |
437 |
[% END %] |
438 |
</div> |
439 |
</div> |
440 |
</div> |
441 |
</div> |
442 |
|
294 |
|
443 |
|
295 |
[% IF ( build1 ) %] |
444 |
[% IF ( build1 ) %] |
296 |
[% IF ( cache_error) %] |
445 |
[% IF ( cache_error) %] |
Lines 958-963
Sub report:<select name="subreport">
Link Here
|
958 |
} |
1107 |
} |
959 |
} |
1108 |
} |
960 |
|
1109 |
|
|
|
1110 |
function share() { |
1111 |
window.location="/cgi-bin/koha/reports/guided_reports.pl?phase=Save"; |
1112 |
} |
1113 |
|
961 |
$(document).ready(function(){ |
1114 |
$(document).ready(function(){ |
962 |
$('#limit').change(function() { |
1115 |
$('#limit').change(function() { |
963 |
$('#limitselect').submit(); |
1116 |
$('#limitselect').submit(); |
Lines 968-973
Sub report:<select name="subreport">
Link Here
|
968 |
window.history.back(); |
1121 |
window.history.back(); |
969 |
}); |
1122 |
}); |
970 |
|
1123 |
|
|
|
1124 |
$(".mana_search_button").on("click",function(){ |
1125 |
mana_search($(this).prev().val()); |
1126 |
}); |
1127 |
|
1128 |
$(".ShareButton").on("click", function(){ |
1129 |
if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){ |
1130 |
$("#shared_infos").hide(); |
1131 |
$("#ManaShareButton").hide(); |
1132 |
$("#noterror").show(); |
1133 |
} |
1134 |
else{ |
1135 |
$("#shared_id").html($(this).closest("tr").find(".report_id").text()); |
1136 |
$("#shared_name").html($(this).closest("tr").find(".report_name").text()); |
1137 |
$("#shared_sql").html($(this).closest("tr").find(".report_sql").val()); |
1138 |
$("#shared_type").html($(this).closest("tr").find(".report_type").text()); |
1139 |
$("#shared_group").html($(this).closest("tr").find(".report_group").text()); |
1140 |
$("#shared_notes").html($(this).closest("tr").find(".report_notes").text()); |
1141 |
} |
1142 |
}); |
1143 |
|
1144 |
$('#search_form').submit(function () { |
1145 |
return false; |
1146 |
}); |
1147 |
|
971 |
$("#addColumn").on("click",function(){ |
1148 |
$("#addColumn").on("click",function(){ |
972 |
addColumn(); |
1149 |
addColumn(); |
973 |
}); |
1150 |
}); |
Lines 1152-1157
Sub report:<select name="subreport">
Link Here
|
1152 |
return confirmDelete(MSG_CONFIRM_DELETE); |
1329 |
return confirmDelete(MSG_CONFIRM_DELETE); |
1153 |
}); |
1330 |
}); |
1154 |
}); |
1331 |
}); |
|
|
1332 |
function mana_increment(mana_id, resourcename, fieldvalue, stepvalue = 1){ |
1333 |
$.ajax( { |
1334 |
type: "POST", |
1335 |
url: "/cgi-bin/koha/svc/mana/addvaluetofield", |
1336 |
data: {id: mana_id, field: fieldvalue, resource: resourcename, step: stepvalue}, |
1337 |
datatype: "json", |
1338 |
}).done( function() { |
1339 |
}).fail( function(){ }); |
1340 |
} |
1341 |
|
1342 |
function mana_use( mana_id ){ |
1343 |
$.ajax( { |
1344 |
type:"POST", |
1345 |
url: "/cgi-bin/koha/svc/mana/use", |
1346 |
data: {id:mana_id, resource: 'report', saveinbase: 1}, |
1347 |
dataType: "json", |
1348 |
}) |
1349 |
.done( function (result){ |
1350 |
window.location = ("/cgi-bin/koha/reports/guided_reports.pl?reports=").concat(result.id).concat("&phase=Show%20SQL"); |
1351 |
}) |
1352 |
.fail( function ( foo, msg, longmsg){ |
1353 |
}); |
1354 |
} |
1355 |
|
1356 |
function mana_search( textquery ){ |
1357 |
$.ajax({ |
1358 |
type: "POST", |
1359 |
url: "/cgi-bin/koha/svc/mana/search", |
1360 |
data: {biblionumber: $("#biblionumber").val(), resource: 'report', id: textquery, usecomments: 1}, |
1361 |
dataType: "html", |
1362 |
}) |
1363 |
.done( function( result ) { |
1364 |
$("#mana_search_result .modal-body").html(result); |
1365 |
$("#mana_search_result_label").text("Results from Mana Knowledge Base"); |
1366 |
$("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults,{ |
1367 |
"sPaginationType":"four_button", |
1368 |
"autoWidth": false, |
1369 |
"columnDefs": [ |
1370 |
{ "width": "35%", "targets": 1 } |
1371 |
], |
1372 |
"aoColumnDefs": [ |
1373 |
{ 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, |
1374 |
{ "sType": "title-string", "aTargets" : [ "title-string" ] }, |
1375 |
{ 'sType': "anti-the", 'aTargets' : [ 'anti-the'] } |
1376 |
] |
1377 |
})); |
1378 |
if($("td.dataTables_empty").length == 0){ |
1379 |
$("#mana_search").show(); |
1380 |
} |
1381 |
|
1382 |
$( "select[class='actionreport1']" ).show(); |
1383 |
$( "button[class='actionreport2']" ).hide(); |
1384 |
$("#CommentButton").on("click", function(){ |
1385 |
var resource_type = "report"; |
1386 |
var target_id = $("#selected_id").val(); |
1387 |
var manamsg = $("#manamsg").val(); |
1388 |
mana_comment(target_id, manamsg, resource_type); |
1389 |
$("#comment_box").modal("hide"); |
1390 |
}); |
1391 |
|
1392 |
$(".showbutton").on("click", function(){ |
1393 |
$(this).parent().hide(); |
1394 |
$(this).parent().next().show(); |
1395 |
}); |
1396 |
|
1397 |
$("a[class='hidebutton']").on("click", function(){ |
1398 |
$(this).parent().hide(); |
1399 |
$(this).parent().prev().show(); |
1400 |
}); |
1401 |
|
1402 |
$("#commentCloseButton").on("click", function(){ |
1403 |
$("#comment_box").modal("hide"); |
1404 |
}); |
1405 |
|
1406 |
$(".actionreport1").on("click", function(){ |
1407 |
$("#selectedcomment").val($(this).val()); |
1408 |
$(this).parent("select").hide(); |
1409 |
$(this).parent("select").next().show(); |
1410 |
}); |
1411 |
|
1412 |
$(".actionreport2").on("click", function(){ |
1413 |
$(this).hide(); |
1414 |
$(this).prev().show(); |
1415 |
mana_increment($("#selectedcomment").val(), 'resource_comment', 'nb', -1); |
1416 |
}); |
1417 |
}).fail( function( result ){ |
1418 |
}); |
1419 |
} |
1420 |
|
1421 |
function mana_comment( target_id, manamsg, resource_type ){ |
1422 |
$.ajax( { |
1423 |
type: "POST", |
1424 |
url: "/cgi-bin/koha/svc/mana/share", |
1425 |
data: {message: manamsg, resource: resource_type , resource_id: target_id}, |
1426 |
datatype: "json", |
1427 |
}) |
1428 |
} |
1429 |
|
1155 |
function addColumn() { |
1430 |
function addColumn() { |
1156 |
$("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected"); |
1431 |
$("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected"); |
1157 |
} |
1432 |
} |