Bug 29648: Catalogue detail - no default_display_length
On the acquisition table the sort option is not available as we don't offer the ability to selection asc/desc and default to asc. We cannot offer default_display_length for those tables. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
7374d29525
commit
04db082e71
|
|
@ -50,8 +50,12 @@ if ( $action eq 'save' ) {
|
|||
next unless $table_id =~ m|^([^#]*)#(.*)$|;
|
||||
my $default_display_length = $input->param( $table_id . '_default_display_length' );
|
||||
my $default_sort_order = $input->param( $table_id . '_default_sort_order' );
|
||||
if ( defined $default_display_length && $default_display_length ne ""
|
||||
&& defined $default_sort_order && $default_sort_order ne "" ) {
|
||||
|
||||
undef $default_display_length if defined $default_display_length && $default_display_length eq "";
|
||||
undef $default_sort_order if defined $default_sort_order && $default_sort_order eq "";
|
||||
|
||||
if ( defined $default_display_length || defined $default_sort_order )
|
||||
{
|
||||
C4::Utils::DataTables::TablesSettings::update_table_settings(
|
||||
{
|
||||
module => $module,
|
||||
|
|
|
|||
|
|
@ -341,6 +341,7 @@ modules:
|
|||
catalogue:
|
||||
detail:
|
||||
holdings_table:
|
||||
default_sort_order: 0
|
||||
columns:
|
||||
-
|
||||
columnname: holdings_checkbox
|
||||
|
|
@ -398,6 +399,7 @@ modules:
|
|||
cannot_be_modified: 1
|
||||
|
||||
otherholdings_table:
|
||||
default_sort_order: 0
|
||||
columns:
|
||||
-
|
||||
columnname: otherholdings_checkbox
|
||||
|
|
|
|||
|
|
@ -1367,12 +1367,12 @@ Note that permanent location is a code, and location may be an authval.
|
|||
|
||||
$(document).ready(function() {
|
||||
var ids = ['holdings_table', 'otherholdings_table'];
|
||||
var columns_settings = [ [% TablesSettings.GetColumns('catalogue', 'detail','holdings_table','json') | $raw %], [% TablesSettings.GetColumns('catalogue', 'detail','otherholdings_table','json') | $raw %] ];
|
||||
var table_settings = [ [% TablesSettings.GetTableSettings('catalogue', 'detail','holdings_table','json') | $raw %], [% TablesSettings.GetTableSettings('catalogue', 'detail','otherholdings_table','json') | $raw %] ];
|
||||
var has_images = ["[% itemloop_has_images | html %]", "[% otheritemloop_has_images | html %]"];
|
||||
for (var i in ids) {
|
||||
var id = ids[i];
|
||||
if ( !has_images[i] ) { // remove the cover_image column
|
||||
columns_settings.splice(1,1);
|
||||
table_settings.splice(1,1);
|
||||
}
|
||||
var dt_parameters = {
|
||||
'sDom': 't',
|
||||
|
|
@ -1381,17 +1381,17 @@ Note that permanent location is a code, and location may be an authval.
|
|||
"bKohaColumnsUseNames": true,
|
||||
"sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
|
||||
};
|
||||
var table = KohaTable(id, dt_parameters, columns_settings[i], 'with_filters');
|
||||
var table = KohaTable(id, dt_parameters, table_settings[i], 'with_filters');
|
||||
}
|
||||
|
||||
[% IF Koha.Preference('AcquisitionDetails') %]
|
||||
var columns_settings = [% TablesSettings.GetColumns('catalogue', 'detail', 'acquisitiondetails-table', 'json') %];
|
||||
var table_settings = [% TablesSettings.GetTableSettings('catalogue', 'detail', 'acquisitiondetails-table', 'json') %];
|
||||
var acquisitiondetails_table = KohaTable("orders", {
|
||||
"sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
|
||||
'bPaginate': false,
|
||||
'bAutoWidth': false,
|
||||
"aaSorting": [[ 4, "desc" ]],
|
||||
}, columns_settings);
|
||||
}, table_settings);
|
||||
[% END %]
|
||||
|
||||
[% IF suggestions.count %]
|
||||
|
|
|
|||
Loading…
Reference in New Issue