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 173-195
canned reports and writing custom SQL reports.</p>
Link Here
|
173 |
<tbody> |
212 |
<tbody> |
174 |
[% FOREACH savedreport IN savedreports %] |
213 |
[% FOREACH savedreport IN savedreports %] |
175 |
[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %] |
214 |
[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %] |
176 |
<td> |
215 |
<td class="report_checkbox"> |
177 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
216 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
178 |
<input type="checkbox" name="ids" value="[% savedreport.id %]" /> |
217 |
<input type="checkbox" name="ids" value="[% savedreport.id %]" /> |
179 |
[% END %] |
218 |
[% END %] |
|
|
219 |
<input hidden class="report_sql" value="[% savedreport.savedsql %]"> |
180 |
</td> |
220 |
</td> |
181 |
<td><label for="ids">[% savedreport.id %]</label></td> |
221 |
<td class="report_id"><label for="ids">[% savedreport.id %]</label></td> |
182 |
<td> |
222 |
<td class="report_name"> |
183 |
[% IF ( savedreport.report_name ) %] |
223 |
[% IF ( savedreport.report_name ) %] |
184 |
[% savedreport.report_name %] |
224 |
[% savedreport.report_name %] |
185 |
[% ELSE %] |
225 |
[% ELSE %] |
186 |
[ no name ] |
226 |
[ no name ] |
187 |
[% END %] |
227 |
[% END %] |
188 |
</td> |
228 |
</td> |
189 |
<td>[% savedreport.type %]</td> |
229 |
<td class="report_type">[% savedreport.type %]</td> |
190 |
<td>[% savedreport.groupname %]</td> |
230 |
<td class="report_group">[% savedreport.groupname %]</td> |
191 |
<td>[% savedreport.subgroupname %]</td> |
231 |
<td>[% savedreport.subgroupname %]</td> |
192 |
<td>[% savedreport.notes %]</td> |
232 |
<td class="report_notes">[% savedreport.notes %]</td> |
193 |
<td>[% savedreport.borrowersurname %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname %][% END %] ([% savedreport.borrowernumber %])</td> |
233 |
<td>[% savedreport.borrowersurname %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname %][% END %] ([% savedreport.borrowernumber %])</td> |
194 |
<td><span title="[% savedreport.date_created %]">[% savedreport.date_created | $KohaDates %]</span></td> |
234 |
<td><span title="[% savedreport.date_created %]">[% savedreport.date_created | $KohaDates %]</span></td> |
195 |
<td><span title="[% savedreport.last_modified %]">[% savedreport.last_modified | $KohaDates with_hours => 1 %]</span></td> |
235 |
<td><span title="[% savedreport.last_modified %]">[% savedreport.last_modified | $KohaDates with_hours => 1 %]</span></td> |
Lines 229-234
canned reports and writing custom SQL reports.</p>
Link Here
|
229 |
<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> |
269 |
<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> |
230 |
<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> |
270 |
<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> |
231 |
[% END %] |
271 |
[% END %] |
|
|
272 |
[% IF (Koha.Preference('Mana') == 1) %] |
273 |
<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> |
274 |
[% END %] |
232 |
<li><a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id %]"><i class="fa fa-clock-o"></i> Schedule</a></li> |
275 |
<li><a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id %]"><i class="fa fa-clock-o"></i> Schedule</a></li> |
233 |
[% IF ( CAN_user_reports_delete_reports ) %] |
276 |
[% IF ( CAN_user_reports_delete_reports ) %] |
234 |
<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> |
277 |
<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 241-246
canned reports and writing custom SQL reports.</p>
Link Here
|
241 |
[% END %] |
284 |
[% END %] |
242 |
</tbody> |
285 |
</tbody> |
243 |
</table> |
286 |
</table> |
|
|
287 |
</div> |
244 |
[% IF ( CAN_user_reports_delete_reports ) %] |
288 |
[% IF ( CAN_user_reports_delete_reports ) %] |
245 |
<fieldset class="action"> |
289 |
<fieldset class="action"> |
246 |
<input type="submit" value="Delete selected" /> |
290 |
<input type="submit" value="Delete selected" /> |
Lines 281-286
canned reports and writing custom SQL reports.</p>
Link Here
|
281 |
[% END %] |
325 |
[% END %] |
282 |
[% END %] |
326 |
[% END %] |
283 |
|
327 |
|
|
|
328 |
<div id="mana_share_report" class="modal fade" tabindex="-1" role="dialog" arialabelledby="mana_share_modal_label" style="display: none;"> |
329 |
<div class="modal-dialog"> |
330 |
<div class="modal-content"> |
331 |
<div class="modal-header"> |
332 |
<h3 id="mana_share_modal_label">Share with Mana</h3> |
333 |
</div> |
334 |
<div class="modal-body"> |
335 |
[% IF (mana_id) %] |
336 |
<div class="alert"> |
337 |
<p>Your subscription is already linked with a Mana subscription model. Share it if you have made modifications, otherwise it will do nothing.</p> |
338 |
</div> |
339 |
[% END %] |
340 |
[% IF ( languages_loop ) %] |
341 |
[% UNLESS ( one_language_enabled ) %] |
342 |
<label id="noteerror" type="hidden">Please enter a report name and descriptive note before sharing (minimum 20 characters)</label> |
343 |
<div id="shared_infos" class="rows"> |
344 |
<li> <span class="label">Id: </span><div id="shared_id"></div> |
345 |
</li> |
346 |
<li> <span class="label">Name: </span><div id="shared_name"></div> |
347 |
</li> |
348 |
<li> <span class="label">SQL: </span><div id="shared_sql"></div> |
349 |
</li> |
350 |
<li> <span class="label">Group: </span><div id="shared_group"></div> |
351 |
</li> |
352 |
<li> <span class="label">Type: </span><div id="shared_type"></div> |
353 |
</li> |
354 |
<li> <span class="label">Notes: </span><div id="shared_notes"></div> |
355 |
</li> |
356 |
|
357 |
</div> |
358 |
<div class="rows"> |
359 |
<form method="post" id="mana_share_form" action="/cgi-bin/koha/reports/guided_reports.pl?phase=Share" class="validated" > |
360 |
<input type="hidden" name="phase" value="Share"> |
361 |
|
362 |
<fieldset> |
363 |
<label for="mana_language">Language:</label> |
364 |
<select id="mana_language" name="mana_language"> |
365 |
[% FOREACH languages_loo IN languages_loop %] |
366 |
[% IF ( languages_loo.group_enabled ) %] |
367 |
[% IF ( languages_loo.plural ) %] |
368 |
[% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %] |
369 |
[% IF ( sublanguages_loo.enabled ) %] |
370 |
[% IF ( sublanguages_loo.sublanguage_current ) %] |
371 |
<option value="[% languages_loo.rfc4646_subtag %]" selected> |
372 |
[% sublanguages_loo.native_description %] |
373 |
[% sublanguages_loo.script_description %] |
374 |
[% sublanguages_loo.region_description %] |
375 |
|
376 |
[% sublanguages_loo.variant_description %] |
377 |
([% sublanguages_loo.rfc4646_subtag %]) |
378 |
</option> |
379 |
[% ELSE %] |
380 |
<option value="[% languages_loo.rfc4646_subtag %]"> |
381 |
[% sublanguages_loo.native_description %] |
382 |
[% sublanguages_loo.script_description %] |
383 |
[% sublanguages_loo.region_description %] |
384 |
[% sublanguages_loo.variant_description %] |
385 |
([% sublanguages_loo.rfc4646_subtag %]) |
386 |
</option> |
387 |
[% END %] |
388 |
[% END %] |
389 |
[% END %] |
390 |
[% ELSE %] |
391 |
[% IF ( languages_loo.group_enabled ) %] |
392 |
[% IF ( languages_loo.current ) %] |
393 |
<option value="[% languages_loo.rfc4646_subtag %]" selected> |
394 |
[% IF ( languages_loo.native_description ) %] |
395 |
[% languages_loo.native_description %] |
396 |
[% ELSE %] |
397 |
[% languages_loo.rfc4646_subtag %] |
398 |
[% END %] |
399 |
</option> |
400 |
[% ELSE %] |
401 |
<option value="[% languages_loo.rfc4646_subtag %]"> |
402 |
[% IF ( languages_loo.native_description ) %] |
403 |
[% languages_loo.native_description %] |
404 |
[% ELSE %] |
405 |
[% languages_loo.rfc4646_subtag %] |
406 |
[% END %] |
407 |
</option> |
408 |
[% END %] |
409 |
[% END %] |
410 |
[% END %] |
411 |
[% END %] |
412 |
[% END %] |
413 |
</select> |
414 |
<input type="hidden" id="reportid" name="reportid" value="[% savedreport.id %]"/> |
415 |
</fieldset> |
416 |
</form> |
417 |
</div> |
418 |
[% END %] |
419 |
[% END %] |
420 |
</div> |
421 |
<div class="modal-footer"> |
422 |
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button> |
423 |
[% IF one_language_enabled==0 %] |
424 |
<button id="ManaShareButton" type="submit" form="mana_share_form" class="btn btn-primary">Share</button> |
425 |
[% ELSE %] |
426 |
<div id="ManaShareButton" class="btn-group"><a class="btn btn-primary"'onclick="share()">Share</a></div> |
427 |
[% END %] |
428 |
</div> |
429 |
</div> |
430 |
</div> |
431 |
</div> |
432 |
|
284 |
|
433 |
|
285 |
[% IF ( build1 ) %] |
434 |
[% IF ( build1 ) %] |
286 |
[% IF ( cache_error) %] |
435 |
[% IF ( cache_error) %] |
Lines 948-953
Sub report:<select name="subreport">
Link Here
|
948 |
} |
1097 |
} |
949 |
} |
1098 |
} |
950 |
|
1099 |
|
|
|
1100 |
function share() { |
1101 |
window.location="/cgi-bin/koha/reports/guided_reports.pl?phase=Save"; |
1102 |
} |
1103 |
|
951 |
$(document).ready(function(){ |
1104 |
$(document).ready(function(){ |
952 |
$('#limit').change(function() { |
1105 |
$('#limit').change(function() { |
953 |
$('#limitselect').submit(); |
1106 |
$('#limitselect').submit(); |
Lines 958-963
Sub report:<select name="subreport">
Link Here
|
958 |
window.history.back(); |
1111 |
window.history.back(); |
959 |
}); |
1112 |
}); |
960 |
|
1113 |
|
|
|
1114 |
$(".mana_search_button").on("click",function(){ |
1115 |
mana_search($(this).prev().val()); |
1116 |
}); |
1117 |
|
1118 |
$(".ShareButton").on("click", function(){ |
1119 |
if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){ |
1120 |
$("#shared_infos").hide(); |
1121 |
$("#ManaShareButton").hide(); |
1122 |
$("#noterror").show(); |
1123 |
} |
1124 |
else{ |
1125 |
$("#shared_id").html($(this).closest("tr").find(".report_id").text()); |
1126 |
$("#shared_name").html($(this).closest("tr").find(".report_name").text()); |
1127 |
$("#shared_sql").html($(this).closest("tr").find(".report_sql").val()); |
1128 |
$("#shared_type").html($(this).closest("tr").find(".report_type").text()); |
1129 |
$("#shared_group").html($(this).closest("tr").find(".report_group").text()); |
1130 |
$("#shared_notes").html($(this).closest("tr").find(".report_notes").text()); |
1131 |
} |
1132 |
}); |
1133 |
|
1134 |
$('#search_form').submit(function () { |
1135 |
return false; |
1136 |
}); |
1137 |
|
961 |
$("#addColumn").on("click",function(){ |
1138 |
$("#addColumn").on("click",function(){ |
962 |
addColumn(); |
1139 |
addColumn(); |
963 |
}); |
1140 |
}); |
Lines 1142-1147
Sub report:<select name="subreport">
Link Here
|
1142 |
return confirmDelete(MSG_CONFIRM_DELETE); |
1319 |
return confirmDelete(MSG_CONFIRM_DELETE); |
1143 |
}); |
1320 |
}); |
1144 |
}); |
1321 |
}); |
|
|
1322 |
function mana_increment(mana_id, resourcename, fieldvalue, stepvalue = 1){ |
1323 |
$.ajax( { |
1324 |
type: "POST", |
1325 |
url: "/cgi-bin/koha/svc/mana/addvaluetofield", |
1326 |
data: {id: mana_id, field: fieldvalue, resource: resourcename, step: stepvalue}, |
1327 |
datatype: "json", |
1328 |
}).done( function() { |
1329 |
}).fail( function(){ }); |
1330 |
} |
1331 |
|
1332 |
function mana_use( mana_id ){ |
1333 |
$.ajax( { |
1334 |
type:"POST", |
1335 |
url: "/cgi-bin/koha/svc/mana/use", |
1336 |
data: {id:mana_id, resource: 'report', saveinbase: 1}, |
1337 |
dataType: "json", |
1338 |
}) |
1339 |
.done( function (result){ |
1340 |
window.location = ("/cgi-bin/koha/reports/guided_reports.pl?reports=").concat(result.id).concat("&phase=Show%20SQL"); |
1341 |
}) |
1342 |
.fail( function ( foo, msg, longmsg){ |
1343 |
}); |
1344 |
} |
1345 |
|
1346 |
function mana_search( textquery ){ |
1347 |
$.ajax({ |
1348 |
type: "POST", |
1349 |
url: "/cgi-bin/koha/svc/mana/search", |
1350 |
data: {biblionumber: $("#biblionumber").val(), resource: 'report', id: textquery, usecomments: 1}, |
1351 |
dataType: "html", |
1352 |
}) |
1353 |
.done( function( result ) { |
1354 |
$("#mana_search_result .modal-body").html(result); |
1355 |
$("#mana_search_result_label").text("Results from Mana Knowledge Base"); |
1356 |
$("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults,{ |
1357 |
"sPaginationType":"four_button", |
1358 |
"autoWidth": false, |
1359 |
"columnDefs": [ |
1360 |
{ "width": "35%", "targets": 1 } |
1361 |
], |
1362 |
"aoColumnDefs": [ |
1363 |
{ 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, |
1364 |
{ "sType": "title-string", "aTargets" : [ "title-string" ] }, |
1365 |
{ 'sType': "anti-the", 'aTargets' : [ 'anti-the'] } |
1366 |
] |
1367 |
})); |
1368 |
if($("td.dataTables_empty").length == 0){ |
1369 |
$("#mana_search").show(); |
1370 |
} |
1371 |
|
1372 |
$( "select[class='actionreport1']" ).show(); |
1373 |
$( "button[class='actionreport2']" ).hide(); |
1374 |
$("#CommentButton").on("click", function(){ |
1375 |
var resource_type = "report"; |
1376 |
var target_id = $("#selected_id").val(); |
1377 |
var manamsg = $("#manamsg").val(); |
1378 |
mana_comment(target_id, manamsg, resource_type); |
1379 |
$("#comment_box").modal("hide"); |
1380 |
}); |
1381 |
|
1382 |
$(".showbutton").on("click", function(){ |
1383 |
$(this).parent().hide(); |
1384 |
$(this).parent().next().show(); |
1385 |
}); |
1386 |
|
1387 |
$("a[class='hidebutton']").on("click", function(){ |
1388 |
$(this).parent().hide(); |
1389 |
$(this).parent().prev().show(); |
1390 |
}); |
1391 |
|
1392 |
$("#commentCloseButton").on("click", function(){ |
1393 |
$("#comment_box").modal("hide"); |
1394 |
}); |
1395 |
|
1396 |
$(".actionreport1").on("click", function(){ |
1397 |
$("#selectedcomment").val($(this).val()); |
1398 |
$(this).parent("select").hide(); |
1399 |
$(this).parent("select").next().show(); |
1400 |
}); |
1401 |
|
1402 |
$(".actionreport2").on("click", function(){ |
1403 |
$(this).hide(); |
1404 |
$(this).prev().show(); |
1405 |
mana_increment($("#selectedcomment").val(), 'resource_comment', 'nb', -1); |
1406 |
}); |
1407 |
}).fail( function( result ){ |
1408 |
}); |
1409 |
} |
1410 |
|
1411 |
function mana_comment( target_id, manamsg, resource_type ){ |
1412 |
$.ajax( { |
1413 |
type: "POST", |
1414 |
url: "/cgi-bin/koha/svc/mana/share", |
1415 |
data: {message: manamsg, resource: resource_type , resource_id: target_id}, |
1416 |
datatype: "json", |
1417 |
}) |
1418 |
} |
1419 |
|
1145 |
function addColumn() { |
1420 |
function addColumn() { |
1146 |
$("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected"); |
1421 |
$("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected"); |
1147 |
} |
1422 |
} |