Bugzilla – Attachment 134031 Details for
Bug 29648
Make KohaTable tables 'default length' and 'default sort' configurable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29648: Catalogue detail - no default_display_length
Bug-29648-Catalogue-detail---no-defaultdisplayleng.patch (text/plain), 4.90 KB, created by
Jonathan Druart
on 2022-04-27 10:49:17 UTC
(
hide
)
Description:
Bug 29648: Catalogue detail - no default_display_length
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-04-27 10:49:17 UTC
Size:
4.90 KB
patch
obsolete
>From f8e45041b087d0828b278dd7e2a0f0fe412c7d74 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 16 Dec 2021 12:48:57 +0100 >Subject: [PATCH] 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> >--- > admin/columns_settings.pl | 8 ++++++-- > admin/columns_settings.yml | 2 ++ > .../intranet-tmpl/prog/en/modules/catalogue/detail.tt | 10 +++++----- > 3 files changed, 13 insertions(+), 7 deletions(-) > >diff --git a/admin/columns_settings.pl b/admin/columns_settings.pl >index 55d312d4f96..d5b0df9dca7 100755 >--- a/admin/columns_settings.pl >+++ b/admin/columns_settings.pl >@@ -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, >diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml >index 79674077ee2..f58b95d8b14 100644 >--- a/admin/columns_settings.yml >+++ b/admin/columns_settings.yml >@@ -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 >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index 320408596c5..95a889f90a4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -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 %] >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29648
:
128592
|
128593
|
128594
|
128595
|
128596
|
128597
|
128598
|
128599
|
128600
|
128601
|
128602
|
128603
|
128604
|
128605
|
128606
|
128607
|
128608
|
128609
|
128610
|
128611
|
128612
|
128613
|
128614
|
128615
|
128616
|
128617
|
128618
|
128619
|
128620
|
128621
|
128622
|
128623
|
128624
|
128625
|
128626
|
129084
|
129085
|
129089
|
129352
|
129685
|
129686
|
129770
|
129771
|
129772
|
129773
|
129774
|
129775
|
129776
|
129777
|
129778
|
129779
|
129780
|
129781
|
129782
|
129783
|
129784
|
129785
|
129786
|
129787
|
129788
|
129789
|
129790
|
129791
|
129792
|
129793
|
129794
|
129795
|
129796
|
129797
|
129798
|
129799
|
129800
|
129801
|
129802
|
129803
|
129804
|
129805
|
129806
|
131703
|
131875
|
131876
|
133001
|
133002
|
133003
|
133004
|
133005
|
133006
|
133007
|
133008
|
133009
|
133010
|
133011
|
133012
|
133013
|
133014
|
133015
|
133016
|
133017
|
133018
|
133019
|
133020
|
133021
|
133022
|
133023
|
133024
|
133025
|
133026
|
133027
|
134018
|
134019
|
134020
|
134021
|
134022
|
134023
|
134024
|
134025
|
134026
|
134027
|
134028
|
134029
|
134030
|
134031
|
134032
|
134033
|
134034
|
134035
|
134036
|
134037
|
134038
|
134039
|
134040
|
134041
|
134042
|
134043
|
134044
|
134045
|
134046
|
134047
|
134048
|
134049
|
134050
|
134051
|
134052
|
134053
|
134054
|
134086
|
134087
|
134088
|
134089
|
134090
|
134091
|
134092
|
134093
|
134094
|
134095
|
134096
|
134097
|
134098
|
134099
|
134100
|
134101
|
134102
|
134103
|
134104
|
134105
|
134106
|
134107
|
134108
|
134109
|
134110
|
134111
|
134112
|
134113
|
134114
|
134115
|
134116
|
134117
|
134118
|
134119
|
134120
|
134121
|
134122
|
134123
|
134133
|
134134
|
134135
|
134136
|
134137
|
134138
|
134139
|
134140
|
134141
|
134142
|
134143
|
134144
|
134145
|
134146
|
134147
|
134148
|
134149
|
134150
|
134151
|
134152
|
134153
|
134154
|
134155
|
134156
|
134157
|
134158
|
134159
|
134160
|
134161
|
134162
|
134163
|
134164
|
134165
|
134166
|
134167
|
134168
|
134169
|
134170
|
134171
|
134194