Bug 41314: Fix column visibility on the checkouts table
Currently the column visibility is broken because the table is not using bKohaColumnsUseNames.
We should first fix that because it's a bug (and a regression certainly caused by DT's saveState, bug 33484).
Then it will be quite trivial to move it to the table's settings.
Column visibility must use bKohaColumnsUseNames when some columns are
displayed/hidden depending on sysprefs (or other variables).
Test plan:
0. Do not apply this patch
1. Check an item out for a patron
2. Turn on ExportCircHistory
3. Reload the checkouts table
=> The export column is not displayed (FAIL)
4. Open the dev console (ctrl+shift+c on Firefox), Storage tab => local
storage. Remove the 2 keys (only one may exist)
DataTables_circ_circulation_issues-table
DataTables_members_moremember_issues-table
5. Reload the checkouts table
=> The export column is displayed
6. Turn off ExportCircHistory
7. Reload the checkouts table
=> The column column is displayed (FAIL)
Well, you got the idea, the syspref's value is not taken into account
when a DataTable's state already exists in the local storage.
Now apply this patch and repeat the different steps, on the two tabs
* "Check out" (circ/circulation.pl)
* "Default" (members/moremember.pl)
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 17b3158b35)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
parent
420fb7148a
commit
17900c3021
|
|
@ -4,12 +4,7 @@
|
|||
<td id="totaldue" style="text-align: right;"></td>
|
||||
<td id="totalfine" style="text-align: right;"></td>
|
||||
<td id="totalprice" style="text-align: right;"></td>
|
||||
[% IF Koha.Preference('ExportCircHistory') %]
|
||||
[% SET td_colspan = 4 %]
|
||||
[% ELSE %]
|
||||
[% SET td_colspan = 3 %]
|
||||
[% END %]
|
||||
<td colspan="[% td_colspan | html %]">
|
||||
<td colspan="4">
|
||||
<div class="date-select">
|
||||
<p><label for="newduedate">Renewal due date:</label> <input type="text" size="20" id="newduedate" name="newduedate" value="" class="flatpickr" data-flatpickr-enable-time="true" /></p>
|
||||
<p id="newonholdduedate"
|
||||
|
|
|
|||
|
|
@ -20,32 +20,32 @@
|
|||
<table id="issues-table" style="width: 100% !Important; display: none;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"> </th>
|
||||
<th scope="col"> </th>
|
||||
<th scope="col">Due date</th>
|
||||
<th scope="col">Due date</th>
|
||||
<th scope="col">Title</th>
|
||||
<th scope="col">Record-level item type</th>
|
||||
<th scope="col">Item type</th>
|
||||
<th scope="col">Collection</th>
|
||||
<th scope="col">Location</th>
|
||||
<th scope="col">Home library</th>
|
||||
<th scope="col"> </th>
|
||||
<th scope="col">Checked out on</th>
|
||||
<th scope="col">Checked out from</th>
|
||||
<th scope="col">Call number</th>
|
||||
<th scope="col">Copy number</th>
|
||||
<th scope="col">Charge</th>
|
||||
<th scope="col">Fine</th>
|
||||
<th scope="col">Price</th>
|
||||
<th scope="col"
|
||||
<th data-colname="sort_order" scope="col"> </th>
|
||||
<th data-colname="todays_or_previous_checkouts" scope="col"> </th>
|
||||
<th data-colname="due_date_unformatted" scope="col">Due date</th>
|
||||
<th data-colname="due_date" scope="col">Due date</th>
|
||||
<th data-colname="title" scope="col">Title</th>
|
||||
<th data-colname="record_type" scope="col">Record-level item type</th>
|
||||
<th data-colname="item_type" scope="col">Item type</th>
|
||||
<th data-colname="collection" scope="col">Collection</th>
|
||||
<th data-colname="location" scope="col">Location</th>
|
||||
<th data-colname="homebranch" scope="col">Home library</th>
|
||||
<th data-colname="checkout_on_unformatted" scope="col"> </th>
|
||||
<th data-colname="checkout_on" scope="col">Checked out on</th>
|
||||
<th data-colname="checkout_from" scope="col">Checked out from</th>
|
||||
<th data-colname="callno" scope="col">Call number</th>
|
||||
<th data-colname="copynumber" scope="col">Copy number</th>
|
||||
<th data-colname="charge" scope="col">Charge</th>
|
||||
<th data-colname="fine" scope="col">Fine</th>
|
||||
<th data-colname="price" scope="col">Price</th>
|
||||
<th data-colname="renew" scope="col"
|
||||
>Renew <p class="column-tool"><a href="#" id="CheckAllRenewals">select all</a> | <a href="#" id="UncheckAllRenewals">none</a></p></th
|
||||
>
|
||||
<th scope="col"
|
||||
<th data-colname="checkin" scope="col"
|
||||
>Check in <p class="column-tool"><a href="#" id="CheckAllCheckins">select all</a> | <a href="#" id="UncheckAllCheckins">none</a></p></th
|
||||
>
|
||||
<th scope="col">Return claims</th>
|
||||
<th scope="col"
|
||||
<th data-colname="claims_returned" scope="col">Return claims</th>
|
||||
<th data-colname="export" scope="col"
|
||||
>Export <p class="column-tool"><a href="#" id="CheckAllExports">select all</a> | <a href="#" id="UncheckAllExports">none</a></p></th
|
||||
>
|
||||
</tr>
|
||||
|
|
|
|||
|
|
@ -36,24 +36,43 @@ function LoadIssuesTable() {
|
|||
$("#issues-table").show();
|
||||
$("#issues-table-actions").show();
|
||||
var msg_loading = __("Loading... you may continue scanning.");
|
||||
let renew_column = table_settings_issues_table.columns.find(
|
||||
c => c.columnname == "renew"
|
||||
);
|
||||
let checkin_column = table_settings_issues_table.columns.find(
|
||||
c => c.columnname == "checkin"
|
||||
);
|
||||
|
||||
if (!AllowCirculate) {
|
||||
table_settings_issues_table.columns.find(
|
||||
c => c.columnname == "renew"
|
||||
).is_hidden = 42;
|
||||
table_settings_issues_table.columns.find(
|
||||
c => c.columnname == "checkin"
|
||||
).is_hidden = 1;
|
||||
renew_column.is_hidden = 1;
|
||||
renew_column.force_visibility = 1;
|
||||
} else {
|
||||
renew_column.is_hidden = 0;
|
||||
checkin_column.is_hidden = 0;
|
||||
}
|
||||
renew_column.force_visibility = 1;
|
||||
checkin_column.force_visibility = 1;
|
||||
|
||||
let claims_returned_column = table_settings_issues_table.columns.find(
|
||||
c => c.columnname == "claims_returned"
|
||||
);
|
||||
if (!ClaimReturnedLostValue) {
|
||||
table_settings_issues_table.columns.find(
|
||||
c => c.columnname == "claims_returned"
|
||||
).is_hidden = 1;
|
||||
claims_returned_column.is_hidden = 1;
|
||||
} else {
|
||||
claims_returned_column.is_hidden = 0;
|
||||
}
|
||||
claims_returned_column.force_visibility = 1;
|
||||
|
||||
let export_column = table_settings_issues_table.columns.find(
|
||||
c => c.columnname == "export"
|
||||
);
|
||||
if (!exports_enabled) {
|
||||
table_settings_issues_table.columns.find(
|
||||
c => c.columnname == "export"
|
||||
).is_hidden = 1;
|
||||
export_column.is_hidden = 1;
|
||||
} else {
|
||||
export_column.is_hidden = 0;
|
||||
}
|
||||
export_column.force_visibility = 1;
|
||||
|
||||
issuesTable = $("#issues-table").kohaTable(
|
||||
{
|
||||
language: {
|
||||
|
|
@ -665,6 +684,7 @@ function LoadIssuesTable() {
|
|||
),
|
||||
},
|
||||
bKohaAjaxSVC: true,
|
||||
bKohaColumnsUseNames: true,
|
||||
rowGroup: {
|
||||
dataSrc: "issued_today",
|
||||
startRender: function (rows, group) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue