[% USE KohaDates %]
[% USE Koha %]
+[% USE ColumnsSettings %]
[% SET footerjs = 1 %]
[%- BLOCK area_name -%]
[%- SWITCH area -%]
#col1, #col2 { width:45%; float:left; }
#col1 ins, #col2 del { display: none; }
.show_sql { font-family: monospace; }
+ .send_to_item_mod {
+ background-color: #EBF3FF;
+ border: 1px solid #88b0e8;
+ border-radius: 5px;
+ display: inline-block;
+ font-size: 75%;
+ margin: 3px 5px;
+ padding: 3px 5px;
+ white-space: nowrap;
+ }
</style>
[% IF ( saved1 ) %]
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
[% IF (usecache) %] <th>Cache expiry (seconds)</th> [% END %]
<th>Saved results</th>
[% IF has_obsolete_reports %]<th>Update</th>[% END %]
- <th> </th>
+ <th>Actions</th>
</tr>
</thead>
<tbody>
<div class="pages">[% pagination_bar %]</div>
[% UNLESS ( errors ) %]
-<table>
-<tr>[% FOREACH header_ro IN header_row %]<th>[% header_ro.cell %]</th>[% END %]</tr>
-[% FOREACH result IN results %]
-<tr>
- [% FOREACH cell IN result.cells %]<td>[% cell.cell %]</td>[% END %]
-</tr>
-[% END %]
-</table>
+ <form method="POST" action="/cgi-bin/koha/tools/batchMod.pl" id="report_results">
+ <input type="hidden" name="op" value="show" />
+ <table>
+ <tr>
+ [% FOREACH header_ro IN header_row %]
+ [% IF header_ro.cell == 'itemnumber' %]
+ <th>
+ [% header_ro.cell %] <button type="submit" data-toggle="tooltip" title="Send visible items to batch modification" class="btn btn-xs btn-default send_to_item_mod"><i class="fa fa-pencil"></i> Batch modify</button>
+ </th>
+ [% ELSE %]
+ <th>[% header_ro.cell %]</th>
+ [% END %]
+ [% END %]
+ </tr>
+ [% FOREACH result IN results %]
+ <tr>
+ [% FOREACH cells IN result.cells %]
+ [% place = loop.index %]
+ [% IF header_row.$place.cell == 'itemnumber' %]
+ <input type="hidden" name="[% header_row.$place.cell | html %]" value="[% cells.cell | html %]" />
+ [% END %]
+ <td>[% cells.cell %]</td>
+ [% END %]
+ </tr>
+ [% END %]
+ </table>
+ </form>
[% END %]
[% END %]
</fieldset>
[% END %]
+[% IF ( save_successful ) %]
+[% UNLESS ( errors ) %]
+</br>
+<div id="report_updated">
+ <div class="dialog message">
+ <p>Your report "[% reportname %]" has been saved</p>
+ </div>
+</div>
+[% END %]
+[% END %]
+
[% IF ( editsql ) %]
<form action="/cgi-bin/koha/reports/guided_reports.pl" method="post" class="validated">
<input type="hidden" name="phase" value="Update SQL" />
[% END %]
-[% IF ( save_successful ) %]
-[% UNLESS ( errors ) %]
-<h2>Your report has been saved</h2>
-<h4>[% reportname %]</h4>
-<ul>
- [% IF ( id ) %]
- <li><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% id %]&phase=Run%20this%20report">Run this report</a></li>
- [% END %]
- <li>Access this report from the: <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Saved reports page</a></li>
- <li>Schedule this report to run using the: <a href="/cgi-bin/koha/tools/scheduler.pl">Scheduler tool</a></li>
- <li>Return to: <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Guided reports</a></li>
-</ul>
-[% END %]
-[% END %]
-
[% IF ( errors ) %]
<form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
<div class="dialog alert">
[% INCLUDE 'calendar.inc' %]
[% IF ( saved1 ) %]
[% INCLUDE 'datatables.inc' %]
+ [% INCLUDE 'columns_settings.inc' %]
[% END %]
- <script type="text/javascript">
+ <script>
var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this report? This cannot be undone.");
var group_subgroups = {};
[% FOREACH group IN groups_with_subgroups %]
}
$(document).ready(function(){
+
+ $('[data-toggle="tooltip"]').tooltip();
+ var columns_settings = [% ColumnsSettings.GetColumns( 'reports', 'saved-sql', 'table_reports', 'json' ) %];
+
$('#limit').change(function() {
$('#limitselect').submit();
});
+ $(document).click(function() {
+ $('#report_updated').hide();
+ });
+
$(".goback").on("click",function(e){
e.preventDefault();
window.history.back();
});
[% IF (saved1) %]
- var rtable = $("#table_reports").dataTable($.extend(true, {}, dataTablesDefaults, {
+ var rtable = KohaTable("table_reports", {
'iDisplayLength': [% Koha.Preference('NumSavedReports') %],
'bAutoWidth': false,
'sPaginationType': 'four_button',
],
'oLanguage': {
'sZeroRecords': _("No matching reports found")
- }
- }));
+ },
+ }, columns_settings);
var rtabs = $("#tabs").tabs();
rtabs.on("tabsactivate", function(e, ui) {