Lines 125-130
canned reports and writing custom SQL reports.</p>
Link Here
|
125 |
</div> |
125 |
</div> |
126 |
[% END %] |
126 |
[% END %] |
127 |
|
127 |
|
|
|
128 |
<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;"> |
129 |
<div class="modal-dialog modal-lg"> |
130 |
<div class="modal-content"> |
131 |
<div class="modal-header"> |
132 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
133 |
<h3 id="mana_search_result_label"> Mana Search</h3> |
134 |
</div> |
135 |
<div> |
136 |
<form id="search_form" style="margin-left: 5%"> |
137 |
Please enter a few key words: |
138 |
<input type=text id=mana_search_field> |
139 |
<input type=button class="mana_search_button" value="Search"> |
140 |
</form> |
141 |
<div class="modal-body"> |
142 |
</div> |
143 |
</div> |
144 |
</div> |
145 |
</div> |
146 |
</div> |
147 |
|
128 |
[% IF ( saved1 ) %] |
148 |
[% IF ( saved1 ) %] |
129 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
149 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
130 |
|
150 |
|
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 194-216
canned reports and writing custom SQL reports.</p>
Link Here
|
194 |
<tbody> |
233 |
<tbody> |
195 |
[% FOREACH savedreport IN savedreports %] |
234 |
[% FOREACH savedreport IN savedreports %] |
196 |
[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %] |
235 |
[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %] |
197 |
<td> |
236 |
<td class="report_checkbox"> |
198 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
237 |
[% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS --> |
199 |
<input type="checkbox" name="ids" value="[% savedreport.id | html %]" /> |
238 |
<input type="checkbox" name="ids" value="[% savedreport.id | html %]" /> |
200 |
[% END %] |
239 |
[% END %] |
|
|
240 |
<input hidden class="report_sql" value="[% savedreport.savedsql %]"> |
201 |
</td> |
241 |
</td> |
202 |
<td><label for="ids">[% savedreport.id | html %]</label></td> |
242 |
<td class="report_id"><label for="ids">[% savedreport.id | html %]</label></td> |
203 |
<td> |
243 |
<td class="report_name"> |
204 |
[% IF ( savedreport.report_name ) %] |
244 |
[% IF ( savedreport.report_name ) %] |
205 |
[% savedreport.report_name | html %] |
245 |
[% savedreport.report_name | html %] |
206 |
[% ELSE %] |
246 |
[% ELSE %] |
207 |
[ no name ] |
247 |
[ no name ] |
208 |
[% END %] |
248 |
[% END %] |
209 |
</td> |
249 |
</td> |
210 |
<td>[% savedreport.type | html %]</td> |
250 |
<td class="report_type">[% savedreport.type | html %]</td> |
211 |
<td>[% savedreport.groupname | html %]</td> |
251 |
<td class="report_group">[% savedreport.groupname | html %]</td> |
212 |
<td>[% savedreport.subgroupname | html %]</td> |
252 |
<td>[% savedreport.subgroupname | html %]</td> |
213 |
<td>[% savedreport.notes | html %]</td> |
253 |
<td class="report_notes">[% savedreport.notes | html %]</td> |
214 |
<td>[% savedreport.borrowersurname | html %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname | html %][% END %] ([% savedreport.borrowernumber | html %])</td> |
254 |
<td>[% savedreport.borrowersurname | html %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname | html %][% END %] ([% savedreport.borrowernumber | html %])</td> |
215 |
<td><span title="[% savedreport.date_created | html %]">[% savedreport.date_created | $KohaDates %]</span></td> |
255 |
<td><span title="[% savedreport.date_created | html %]">[% savedreport.date_created | $KohaDates %]</span></td> |
216 |
<td><span title="[% savedreport.last_modified | html %]">[% savedreport.last_modified | $KohaDates with_hours => 1 | html %]</span></td> |
256 |
<td><span title="[% savedreport.last_modified | html %]">[% savedreport.last_modified | $KohaDates with_hours => 1 | html %]</span></td> |
Lines 257-262
canned reports and writing custom SQL reports.</p>
Link Here
|
257 |
<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> |
297 |
<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> |
258 |
<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> |
298 |
<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> |
259 |
[% END %] |
299 |
[% END %] |
|
|
300 |
[% IF (Koha.Preference('Mana') == 1) %] |
301 |
<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> |
302 |
[% END %] |
260 |
<li><a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id | html %]"><i class="fa fa-clock-o"></i> Schedule</a></li> |
303 |
<li><a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id | html %]"><i class="fa fa-clock-o"></i> Schedule</a></li> |
261 |
[% IF ( CAN_user_reports_delete_reports ) %] |
304 |
[% IF ( CAN_user_reports_delete_reports ) %] |
262 |
<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> |
305 |
<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 269-274
canned reports and writing custom SQL reports.</p>
Link Here
|
269 |
[% END %] |
312 |
[% END %] |
270 |
</tbody> |
313 |
</tbody> |
271 |
</table> |
314 |
</table> |
|
|
315 |
</div> |
272 |
[% IF ( CAN_user_reports_delete_reports ) %] |
316 |
[% IF ( CAN_user_reports_delete_reports ) %] |
273 |
<fieldset class="action"> |
317 |
<fieldset class="action"> |
274 |
<input type="submit" value="Delete selected" /> |
318 |
<input type="submit" value="Delete selected" /> |
Lines 309-314
canned reports and writing custom SQL reports.</p>
Link Here
|
309 |
[% END %] |
353 |
[% END %] |
310 |
[% END %] |
354 |
[% END %] |
311 |
|
355 |
|
|
|
356 |
<div id="mana_share_report" class="modal fade" tabindex="-1" role="dialog" arialabelledby="mana_share_modal_label" style="display: none;"> |
357 |
<div class="modal-dialog"> |
358 |
<div class="modal-content"> |
359 |
<div class="modal-header"> |
360 |
<h3 id="mana_share_modal_label">Share with Mana</h3> |
361 |
</div> |
362 |
<div class="modal-body"> |
363 |
[% IF (mana_id) %] |
364 |
<div class="alert"> |
365 |
<p>Your subscription is already linked with a Mana subscription model. Share it if you have made modifications, otherwise it will do nothing.</p> |
366 |
</div> |
367 |
[% END %] |
368 |
[% IF ( languages_loop ) %] |
369 |
[% UNLESS ( one_language_enabled ) %] |
370 |
<label id="noteerror" type="hidden">Please enter a report name and descriptive note before sharing (minimum 20 characters)</label> |
371 |
<div id="shared_infos" class="rows"> |
372 |
<li> <span class="label">Id: </span><div id="shared_id"></div> |
373 |
</li> |
374 |
<li> <span class="label">Name: </span><div id="shared_name"></div> |
375 |
</li> |
376 |
<li> <span class="label">SQL: </span><div id="shared_sql"></div> |
377 |
</li> |
378 |
<li> <span class="label">Group: </span><div id="shared_group"></div> |
379 |
</li> |
380 |
<li> <span class="label">Type: </span><div id="shared_type"></div> |
381 |
</li> |
382 |
<li> <span class="label">Notes: </span><div id="shared_notes"></div> |
383 |
</li> |
384 |
|
385 |
</div> |
386 |
<div class="rows"> |
387 |
<form method="post" id="mana_share_form" action="/cgi-bin/koha/reports/guided_reports.pl?phase=Share" class="validated" > |
388 |
<input type="hidden" name="phase" value="Share"> |
389 |
|
390 |
<fieldset> |
391 |
<label for="mana_language">Language:</label> |
392 |
<select id="mana_language" name="mana_language"> |
393 |
[% FOREACH languages_loo IN languages_loop %] |
394 |
[% IF ( languages_loo.group_enabled ) %] |
395 |
[% IF ( languages_loo.plural ) %] |
396 |
[% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %] |
397 |
[% IF ( sublanguages_loo.enabled ) %] |
398 |
[% IF ( sublanguages_loo.sublanguage_current ) %] |
399 |
<option value="[% languages_loo.rfc4646_subtag %]" selected> |
400 |
[% sublanguages_loo.native_description %] |
401 |
[% sublanguages_loo.script_description %] |
402 |
[% sublanguages_loo.region_description %] |
403 |
|
404 |
[% sublanguages_loo.variant_description %] |
405 |
([% sublanguages_loo.rfc4646_subtag %]) |
406 |
</option> |
407 |
[% ELSE %] |
408 |
<option value="[% languages_loo.rfc4646_subtag %]"> |
409 |
[% sublanguages_loo.native_description %] |
410 |
[% sublanguages_loo.script_description %] |
411 |
[% sublanguages_loo.region_description %] |
412 |
[% sublanguages_loo.variant_description %] |
413 |
([% sublanguages_loo.rfc4646_subtag %]) |
414 |
</option> |
415 |
[% END %] |
416 |
[% END %] |
417 |
[% END %] |
418 |
[% ELSE %] |
419 |
[% IF ( languages_loo.group_enabled ) %] |
420 |
[% IF ( languages_loo.current ) %] |
421 |
<option value="[% languages_loo.rfc4646_subtag %]" selected> |
422 |
[% IF ( languages_loo.native_description ) %] |
423 |
[% languages_loo.native_description %] |
424 |
[% ELSE %] |
425 |
[% languages_loo.rfc4646_subtag %] |
426 |
[% END %] |
427 |
</option> |
428 |
[% ELSE %] |
429 |
<option value="[% languages_loo.rfc4646_subtag %]"> |
430 |
[% IF ( languages_loo.native_description ) %] |
431 |
[% languages_loo.native_description %] |
432 |
[% ELSE %] |
433 |
[% languages_loo.rfc4646_subtag %] |
434 |
[% END %] |
435 |
</option> |
436 |
[% END %] |
437 |
[% END %] |
438 |
[% END %] |
439 |
[% END %] |
440 |
[% END %] |
441 |
</select> |
442 |
<input type="hidden" id="reportid" name="reportid" value="[% savedreport.id %]"/> |
443 |
</fieldset> |
444 |
</form> |
445 |
</div> |
446 |
[% END %] |
447 |
[% END %] |
448 |
</div> |
449 |
<div class="modal-footer"> |
450 |
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button> |
451 |
[% IF one_language_enabled==0 %] |
452 |
<button id="ManaShareButton" type="submit" form="mana_share_form" class="btn btn-primary">Share</button> |
453 |
[% ELSE %] |
454 |
<div id="ManaShareButton" class="btn-group"><a class="btn btn-primary"'onclick="share()">Share</a></div> |
455 |
[% END %] |
456 |
</div> |
457 |
</div> |
458 |
</div> |
459 |
</div> |
460 |
|
312 |
|
461 |
|
313 |
[% IF ( build1 ) %] |
462 |
[% IF ( build1 ) %] |
314 |
[% IF ( cache_error) %] |
463 |
[% IF ( cache_error) %] |
Lines 968-973
$(document).ready(function() {
Link Here
|
968 |
} |
1117 |
} |
969 |
} |
1118 |
} |
970 |
|
1119 |
|
|
|
1120 |
function share() { |
1121 |
window.location="/cgi-bin/koha/reports/guided_reports.pl?phase=Save"; |
1122 |
} |
1123 |
|
971 |
$(document).ready(function(){ |
1124 |
$(document).ready(function(){ |
972 |
|
1125 |
|
973 |
$('[data-toggle="tooltip"]').tooltip(); |
1126 |
$('[data-toggle="tooltip"]').tooltip(); |
Lines 986-991
$(document).ready(function() {
Link Here
|
986 |
window.history.back(); |
1139 |
window.history.back(); |
987 |
}); |
1140 |
}); |
988 |
|
1141 |
|
|
|
1142 |
$(".mana_search_button").on("click",function(){ |
1143 |
mana_search($(this).prev().val()); |
1144 |
}); |
1145 |
|
1146 |
$(".ShareButton").on("click", function(){ |
1147 |
if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){ |
1148 |
$("#shared_infos").hide(); |
1149 |
$("#ManaShareButton").hide(); |
1150 |
$("#noterror").show(); |
1151 |
} |
1152 |
else{ |
1153 |
$("#shared_id").html($(this).closest("tr").find(".report_id").text()); |
1154 |
$("#shared_name").html($(this).closest("tr").find(".report_name").text()); |
1155 |
$("#shared_sql").html($(this).closest("tr").find(".report_sql").val()); |
1156 |
$("#shared_type").html($(this).closest("tr").find(".report_type").text()); |
1157 |
$("#shared_group").html($(this).closest("tr").find(".report_group").text()); |
1158 |
$("#shared_notes").html($(this).closest("tr").find(".report_notes").text()); |
1159 |
} |
1160 |
}); |
1161 |
|
1162 |
$('#search_form').submit(function () { |
1163 |
return false; |
1164 |
}); |
1165 |
|
989 |
$("#addColumn").on("click",function(){ |
1166 |
$("#addColumn").on("click",function(){ |
990 |
addColumn(); |
1167 |
addColumn(); |
991 |
}); |
1168 |
}); |
Lines 1171-1176
$(document).ready(function() {
Link Here
|
1171 |
return confirmDelete(MSG_CONFIRM_DELETE); |
1348 |
return confirmDelete(MSG_CONFIRM_DELETE); |
1172 |
}); |
1349 |
}); |
1173 |
}); |
1350 |
}); |
|
|
1351 |
function mana_increment(mana_id, resourcename, fieldvalue, stepvalue = 1){ |
1352 |
$.ajax( { |
1353 |
type: "POST", |
1354 |
url: "/cgi-bin/koha/svc/mana/addvaluetofield", |
1355 |
data: {id: mana_id, field: fieldvalue, resource: resourcename, step: stepvalue}, |
1356 |
datatype: "json", |
1357 |
}).done( function() { |
1358 |
}).fail( function(){ }); |
1359 |
} |
1360 |
|
1361 |
function mana_use( mana_id ){ |
1362 |
$.ajax( { |
1363 |
type:"POST", |
1364 |
url: "/cgi-bin/koha/svc/mana/use", |
1365 |
data: {id:mana_id, resource: 'report', saveinbase: 1}, |
1366 |
dataType: "json", |
1367 |
}) |
1368 |
.done( function (result){ |
1369 |
window.location = ("/cgi-bin/koha/reports/guided_reports.pl?reports=").concat(result.id).concat("&phase=Show%20SQL"); |
1370 |
}) |
1371 |
.fail( function ( foo, msg, longmsg){ |
1372 |
}); |
1373 |
} |
1374 |
|
1375 |
function mana_search( textquery ){ |
1376 |
$.ajax({ |
1377 |
type: "POST", |
1378 |
url: "/cgi-bin/koha/svc/mana/search", |
1379 |
data: {biblionumber: $("#biblionumber").val(), resource: 'report', id: textquery, usecomments: 1}, |
1380 |
dataType: "html", |
1381 |
}) |
1382 |
.done( function( result ) { |
1383 |
$("#mana_search_result .modal-body").html(result); |
1384 |
$("#mana_search_result_label").text("Results from Mana Knowledge Base"); |
1385 |
$("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults,{ |
1386 |
"sPaginationType":"four_button", |
1387 |
"autoWidth": false, |
1388 |
"columnDefs": [ |
1389 |
{ "width": "35%", "targets": 1 } |
1390 |
], |
1391 |
"aoColumnDefs": [ |
1392 |
{ 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, |
1393 |
{ "sType": "title-string", "aTargets" : [ "title-string" ] }, |
1394 |
{ 'sType': "anti-the", 'aTargets' : [ 'anti-the'] } |
1395 |
] |
1396 |
})); |
1397 |
if($("td.dataTables_empty").length == 0){ |
1398 |
$("#mana_search").show(); |
1399 |
} |
1400 |
|
1401 |
$( "select[class='actionreport1']" ).show(); |
1402 |
$( "button[class='actionreport2']" ).hide(); |
1403 |
$("#CommentButton").on("click", function(){ |
1404 |
var resource_type = "report"; |
1405 |
var target_id = $("#selected_id").val(); |
1406 |
var manamsg = $("#manamsg").val(); |
1407 |
mana_comment(target_id, manamsg, resource_type); |
1408 |
$("#comment_box").modal("hide"); |
1409 |
}); |
1410 |
|
1411 |
$(".showbutton").on("click", function(){ |
1412 |
$(this).parent().hide(); |
1413 |
$(this).parent().next().show(); |
1414 |
}); |
1415 |
|
1416 |
$("a[class='hidebutton']").on("click", function(){ |
1417 |
$(this).parent().hide(); |
1418 |
$(this).parent().prev().show(); |
1419 |
}); |
1420 |
|
1421 |
$("#commentCloseButton").on("click", function(){ |
1422 |
$("#comment_box").modal("hide"); |
1423 |
}); |
1424 |
|
1425 |
$(".actionreport1").on("click", function(){ |
1426 |
$("#selectedcomment").val($(this).val()); |
1427 |
$(this).parent("select").hide(); |
1428 |
$(this).parent("select").next().show(); |
1429 |
}); |
1430 |
|
1431 |
$(".actionreport2").on("click", function(){ |
1432 |
$(this).hide(); |
1433 |
$(this).prev().show(); |
1434 |
mana_increment($("#selectedcomment").val(), 'resource_comment', 'nb', -1); |
1435 |
}); |
1436 |
}).fail( function( result ){ |
1437 |
}); |
1438 |
} |
1439 |
|
1440 |
function mana_comment( target_id, manamsg, resource_type ){ |
1441 |
$.ajax( { |
1442 |
type: "POST", |
1443 |
url: "/cgi-bin/koha/svc/mana/share", |
1444 |
data: {message: manamsg, resource: resource_type , resource_id: target_id}, |
1445 |
datatype: "json", |
1446 |
}) |
1447 |
} |
1448 |
|
1174 |
function addColumn() { |
1449 |
function addColumn() { |
1175 |
$("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected"); |
1450 |
$("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected"); |
1176 |
} |
1451 |
} |