View | Details | Raw Unified | Return to bug 33484
Collapse All | Expand All

(-)a/C4/Utils/DataTables/TablesSettings.pm (-3 / +8 lines)
Lines 103-109 sub get_table_settings { Link Here
103
        default_display_length => $rs ? $rs->default_display_length
103
        default_display_length => $rs ? $rs->default_display_length
104
        : $list->{modules}{$module}{$page}{$tablename}{default_display_length},
104
        : $list->{modules}{$module}{$page}{$tablename}{default_display_length},
105
        default_sort_order => $rs ? $rs->default_sort_order
105
        default_sort_order => $rs ? $rs->default_sort_order
106
        : $list->{modules}{$module}{$page}{$tablename}{default_sort_order}
106
        : $list->{modules}{$module}{$page}{$tablename}{default_sort_order},
107
        default_save_state => $rs ? $rs->default_save_state
108
        : $list->{modules}{$module}{$page}{$tablename}{default_save_state},
107
    };
109
    };
108
}
110
}
109
111
Lines 153-162 sub update_columns { Link Here
153
  C4::Utils::DataTables::TablesSettings::update_table_settings(
155
  C4::Utils::DataTables::TablesSettings::update_table_settings(
154
    {
156
    {
155
        module                 => $module,
157
        module                 => $module,
156
        pag                    => $page,
158
        page                   => $page,
157
        tablename              => $tablename,
159
        tablename              => $tablename,
158
        default_display_length => $default_display_length,
160
        default_display_length => $default_display_length,
159
        default_sort_order     => $default_sort_order
161
        default_sort_order     => $default_sort_order,
162
        default_save_state     => $default_save_state,
160
    }
163
    }
161
  );
164
  );
162
165
Lines 171-176 sub update_table_settings { Link Here
171
    my $tablename              = $params->{tablename};
174
    my $tablename              = $params->{tablename};
172
    my $default_display_length = $params->{default_display_length};
175
    my $default_display_length = $params->{default_display_length};
173
    my $default_sort_order     = $params->{default_sort_order};
176
    my $default_sort_order     = $params->{default_sort_order};
177
    my $default_save_state     = $params->{default_save_state};
174
178
175
    my $schema = Koha::Database->new->schema;
179
    my $schema = Koha::Database->new->schema;
176
180
Lines 181-186 sub update_table_settings { Link Here
181
            tablename              => $tablename,
185
            tablename              => $tablename,
182
            default_display_length => $default_display_length,
186
            default_display_length => $default_display_length,
183
            default_sort_order     => $default_sort_order,
187
            default_sort_order     => $default_sort_order,
188
            default_save_state     => $default_save_state,
184
        }
189
        }
185
    );
190
    );
186
}
191
}
(-)a/admin/columns_settings.pl (-1 / +4 lines)
Lines 50-60 if ( $action eq 'save' ) { Link Here
50
        next unless $table_id =~ m|^([^#]*)#(.*)$|;
50
        next unless $table_id =~ m|^([^#]*)#(.*)$|;
51
        my $default_display_length = $input->param( $table_id . '_default_display_length' );
51
        my $default_display_length = $input->param( $table_id . '_default_display_length' );
52
        my $default_sort_order     = $input->param( $table_id . '_default_sort_order' );
52
        my $default_sort_order     = $input->param( $table_id . '_default_sort_order' );
53
        my $default_save_state     = $input->param( $table_id . '_default_save_state' );
53
54
54
        undef $default_display_length if defined $default_display_length && $default_display_length eq "";
55
        undef $default_display_length if defined $default_display_length && $default_display_length eq "";
55
        undef $default_sort_order if defined $default_sort_order && $default_sort_order eq "";
56
        undef $default_sort_order if defined $default_sort_order && $default_sort_order eq "";
57
        $default_save_state = 0 if !defined($default_save_state);
56
58
57
        if ( defined $default_display_length || defined $default_sort_order )
59
        if ( defined $default_display_length || defined $default_sort_order || defined $default_save_state )
58
        {
60
        {
59
            C4::Utils::DataTables::TablesSettings::update_table_settings(
61
            C4::Utils::DataTables::TablesSettings::update_table_settings(
60
                {
62
                {
Lines 63-68 if ( $action eq 'save' ) { Link Here
63
                    tablename              => $2,
65
                    tablename              => $2,
64
                    default_display_length => $default_display_length,
66
                    default_display_length => $default_display_length,
65
                    default_sort_order     => $default_sort_order,
67
                    default_sort_order     => $default_sort_order,
68
                    default_save_state     => $default_save_state,
66
                }
69
                }
67
            );
70
            );
68
        }
71
        }
(-)a/admin/columns_settings.yml (+61 lines)
Lines 2-7 modules: Link Here
2
  acqui:
2
  acqui:
3
    acq_acqui-home:
3
    acq_acqui-home:
4
      accounts:
4
      accounts:
5
        default_save_state: 1
5
        columns:
6
        columns:
6
            -
7
            -
7
              columnname: active
8
              columnname: active
Lines 32-37 modules: Link Here
32
      histsearcht:
33
      histsearcht:
33
        default_display_length: 20
34
        default_display_length: 20
34
        default_sort_order: 0
35
        default_sort_order: 0
36
        default_save_state: 1
35
        columns:
37
        columns:
36
            -
38
            -
37
              columnname: order_line
39
              columnname: order_line
Lines 72-77 modules: Link Here
72
      late_orders:
74
      late_orders:
73
        default_display_length: 20
75
        default_display_length: 20
74
        default_sort_order: 0
76
        default_sort_order: 0
77
        default_save_state: 1
75
        columns:
78
        columns:
76
            -
79
            -
77
              columnname: checkbox
80
              columnname: checkbox
Lines 116-121 modules: Link Here
116
      orders:
119
      orders:
117
        default_display_length: 20
120
        default_display_length: 20
118
        default_sort_order: 0
121
        default_sort_order: 0
122
        default_save_state: 1
119
        columns:
123
        columns:
120
            -
124
            -
121
              columnname: basket_number
125
              columnname: basket_number
Lines 165-170 modules: Link Here
165
169
166
    suggestions:
170
    suggestions:
167
      suggestions:
171
      suggestions:
172
        default_save_state: 1
168
        columns:
173
        columns:
169
            -
174
            -
170
              columnname: selections
175
              columnname: selections
Lines 207-212 modules: Link Here
207
      table_cities:
212
      table_cities:
208
        default_display_length: 20
213
        default_display_length: 20
209
        default_sort_order: 0
214
        default_sort_order: 0
215
        default_save_state: 1
210
        columns:
216
        columns:
211
            -
217
            -
212
              columnname: city_id
218
              columnname: city_id
Lines 224-229 modules: Link Here
224
              cannot_be_modified: 1
230
              cannot_be_modified: 1
225
    currency:
231
    currency:
226
      currencies-table:
232
      currencies-table:
233
        default_save_state: 1
227
        columns:
234
        columns:
228
            -
235
            -
229
              columnname: currency
236
              columnname: currency
Lines 249-254 modules: Link Here
249
      patron_categories:
256
      patron_categories:
250
        default_display_length: 20
257
        default_display_length: 20
251
        default_sort_order: 1
258
        default_sort_order: 1
259
        default_save_state: 1
252
        columns:
260
        columns:
253
            -
261
            -
254
              columnname: code
262
              columnname: code
Lines 291-296 modules: Link Here
291
      table_item_type:
299
      table_item_type:
292
        default_display_length: 10
300
        default_display_length: 10
293
        default_sort_order: 1
301
        default_sort_order: 1
302
        default_save_state: 1
294
        columns:
303
        columns:
295
            -
304
            -
296
              columnname: image
305
              columnname: image
Lines 332-337 modules: Link Here
332
      libraries:
341
      libraries:
333
        default_display_length: 20
342
        default_display_length: 20
334
        default_sort_order: 0
343
        default_sort_order: 0
344
        default_save_state: 1
335
        columns:
345
        columns:
336
            -
346
            -
337
              columnname: library_name
347
              columnname: library_name
Lines 357-362 modules: Link Here
357
  catalogue:
367
  catalogue:
358
    detail:
368
    detail:
359
      holdings_table:
369
      holdings_table:
370
        default_save_state: 1
360
        columns:
371
        columns:
361
            -
372
            -
362
              columnname: holdings_checkbox
373
              columnname: holdings_checkbox
Lines 420-425 modules: Link Here
420
              cannot_be_modified: 1
431
              cannot_be_modified: 1
421
432
422
      otherholdings_table:
433
      otherholdings_table:
434
        default_save_state: 1
423
        columns:
435
        columns:
424
            -
436
            -
425
              columnname: otherholdings_checkbox
437
              columnname: otherholdings_checkbox
Lines 483-488 modules: Link Here
483
              cannot_be_modified: 1
495
              cannot_be_modified: 1
484
496
485
      acquisitiondetails-table:
497
      acquisitiondetails-table:
498
        default_save_state: 1
486
        columns:
499
        columns:
487
            -
500
            -
488
              columnname: vendor
501
              columnname: vendor
Lines 513-518 modules: Link Here
513
526
514
      checkoutshistory-table:
527
      checkoutshistory-table:
515
        default_display_length: 20
528
        default_display_length: 20
529
        default_save_state: 1
516
        columns:
530
        columns:
517
            -
531
            -
518
              columnname: patron
532
              columnname: patron
Lines 536-541 modules: Link Here
536
              columnname: checkin_on
550
              columnname: checkin_on
537
551
538
      bundle_tables:
552
      bundle_tables:
553
        default_save_state: 1
539
        columns:
554
        columns:
540
            -
555
            -
541
              columnname: title
556
              columnname: title
Lines 556-561 modules: Link Here
556
  cataloguing:
571
  cataloguing:
557
    addbooks:
572
    addbooks:
558
      reservoir-table:
573
      reservoir-table:
574
        default_save_state: 1
559
        columns:
575
        columns:
560
            -
576
            -
561
              columnname: title
577
              columnname: title
Lines 575-580 modules: Link Here
575
        # columns except for the following internal/obsolete fields: stack, more_subfields_xml,
591
        # columns except for the following internal/obsolete fields: stack, more_subfields_xml,
576
        # cn_sort, permanent_location, damaged_on itemlost_on, withdrawn_on, issues, renewals and
592
        # cn_sort, permanent_location, damaged_on itemlost_on, withdrawn_on, issues, renewals and
577
        # reserves.
593
        # reserves.
594
        default_save_state: 1
578
        columns:
595
        columns:
579
            -
596
            -
580
              columnname: barcode
597
              columnname: barcode
Lines 642-647 modules: Link Here
642
    concerns:
659
    concerns:
643
      table_concerns:
660
      table_concerns:
644
        default_sort_order: 0
661
        default_sort_order: 0
662
        default_save_state: 1
645
        columns:
663
        columns:
646
            -
664
            -
647
              columnname: reported
665
              columnname: reported
Lines 659-664 modules: Link Here
659
    z3950_search:
677
    z3950_search:
660
      resultst:
678
      resultst:
661
        default_sort_order: 1
679
        default_sort_order: 1
680
        default_save_state: 1
662
        columns:
681
        columns:
663
            -
682
            -
664
              columnname: server
683
              columnname: server
Lines 684-689 modules: Link Here
684
      course_reserves_table:
703
      course_reserves_table:
685
        default_display_length: 20
704
        default_display_length: 20
686
        default_sort_order: 0
705
        default_sort_order: 0
706
        default_save_state: 1
687
        columns:
707
        columns:
688
            -
708
            -
689
              columnname: name
709
              columnname: name
Lines 710-715 modules: Link Here
710
      course_reserves_table:
730
      course_reserves_table:
711
        default_display_length: 20
731
        default_display_length: 20
712
        default_sort_order: 0
732
        default_sort_order: 0
733
        default_save_state: 1
713
        columns:
734
        columns:
714
            -
735
            -
715
              columnname: title
736
              columnname: title
Lines 745-750 modules: Link Here
745
  erm:
766
  erm:
746
    agreements:
767
    agreements:
747
      agreements:
768
      agreements:
769
        default_save_state: 1
748
        columns:
770
        columns:
749
            -
771
            -
750
              columnname: name
772
              columnname: name
Lines 766-771 modules: Link Here
766
              cannot_be_modified: 1
788
              cannot_be_modified: 1
767
    licenses:
789
    licenses:
768
      licenses:
790
      licenses:
791
        default_save_state: 1
769
        columns:
792
        columns:
770
            -
793
            -
771
              columnname: name
794
              columnname: name
Lines 787-792 modules: Link Here
787
              cannot_be_modified: 1
810
              cannot_be_modified: 1
788
    eholdings:
811
    eholdings:
789
      packages:
812
      packages:
813
        default_save_state: 1
790
        columns:
814
        columns:
791
            -
815
            -
792
              columnname: name
816
              columnname: name
Lines 805-810 modules: Link Here
805
              cannot_be_toggled: 1
829
              cannot_be_toggled: 1
806
              cannot_be_modified: 1
830
              cannot_be_modified: 1
807
      titles:
831
      titles:
832
        default_save_state: 1
808
        columns:
833
        columns:
809
            -
834
            -
810
              columnname: title
835
              columnname: title
Lines 822-827 modules: Link Here
822
  illrequests:
847
  illrequests:
823
    ill-requests:
848
    ill-requests:
824
      ill-requests:
849
      ill-requests:
850
        default_save_state: 1
825
        columns:
851
        columns:
826
            -
852
            -
827
              columnname: illrequest_id
853
              columnname: illrequest_id
Lines 897-902 modules: Link Here
897
    fines:
923
    fines:
898
      account-fines:
924
      account-fines:
899
        default_display_length: 20
925
        default_display_length: 20
926
        default_save_state: 1
900
        columns:
927
        columns:
901
            -
928
            -
902
              columnname: date
929
              columnname: date
Lines 942-947 modules: Link Here
942
      pay-fines-table:
969
      pay-fines-table:
943
        default_display_length: 20
970
        default_display_length: 20
944
        default_sort_order: 3
971
        default_sort_order: 3
972
        default_save_state: 1
945
        columns:
973
        columns:
946
            -
974
            -
947
              columnname: checkbox
975
              columnname: checkbox
Lines 980-985 modules: Link Here
980
1008
981
    member:
1009
    member:
982
      memberresultst:
1010
      memberresultst:
1011
        default_save_state: 1
983
        columns:
1012
        columns:
984
            -
1013
            -
985
              columnname: checkbox
1014
              columnname: checkbox
Lines 1010-1015 modules: Link Here
1010
1039
1011
    moremember:
1040
    moremember:
1012
      issues-table:
1041
      issues-table:
1042
        default_save_state: 1
1013
        columns:
1043
        columns:
1014
            -
1044
            -
1015
              columnname: sort_order
1045
              columnname: sort_order
Lines 1073-1078 modules: Link Here
1073
              cannot_be_modified: 1
1103
              cannot_be_modified: 1
1074
1104
1075
      relatives-issues-table:
1105
      relatives-issues-table:
1106
        default_save_state: 1
1076
        columns:
1107
        columns:
1077
            -
1108
            -
1078
              columnname: due_date_unformatted
1109
              columnname: due_date_unformatted
Lines 1116-1121 modules: Link Here
1116
    holdshistory:
1147
    holdshistory:
1117
      holdshistory-table:
1148
      holdshistory-table:
1118
        default_display_length: 20
1149
        default_display_length: 20
1150
        default_save_state: 1
1119
        columns:
1151
        columns:
1120
            -
1152
            -
1121
              columnname: title
1153
              columnname: title
Lines 1143-1148 modules: Link Here
1143
    checkouthistory:
1175
    checkouthistory:
1144
      checkouthistory-table:
1176
      checkouthistory-table:
1145
        default_display_length: 20
1177
        default_display_length: 20
1178
        default_save_state: 1
1146
        columns:
1179
        columns:
1147
            - columnname: type
1180
            - columnname: type
1148
              cannot_be_toggled: 1
1181
              cannot_be_toggled: 1
Lines 1174-1179 modules: Link Here
1174
      patron-list-table:
1207
      patron-list-table:
1175
        default_display_length: 20
1208
        default_display_length: 20
1176
        default_sort_order: 3
1209
        default_sort_order: 3
1210
        default_save_state: 1
1177
        columns:
1211
        columns:
1178
            -
1212
            -
1179
              columnname: checkbox
1213
              columnname: checkbox
Lines 1199-1204 modules: Link Here
1199
  reports:
1233
  reports:
1200
    lostitems:
1234
    lostitems:
1201
      lostitems-table:
1235
      lostitems-table:
1236
        default_save_state: 1
1202
        columns:
1237
        columns:
1203
            -
1238
            -
1204
              columnname: title
1239
              columnname: title
Lines 1239-1244 modules: Link Here
1239
      funds-table:
1274
      funds-table:
1240
        default_display_length: 20
1275
        default_display_length: 20
1241
        default_sort_order: 0
1276
        default_sort_order: 0
1277
        default_save_state: 1
1242
        columns:
1278
        columns:
1243
            -
1279
            -
1244
              columnname: fund
1280
              columnname: fund
Lines 1279-1284 modules: Link Here
1279
      table_reports:
1315
      table_reports:
1280
        default_display_length: 20
1316
        default_display_length: 20
1281
        default_sort_order: 0
1317
        default_sort_order: 0
1318
        default_save_state: 1
1282
        columns:
1319
        columns:
1283
            -
1320
            -
1284
              columnname: selection
1321
              columnname: selection
Lines 1324-1329 modules: Link Here
1324
  circ:
1361
  circ:
1325
    circulation:
1362
    circulation:
1326
      issues-table:
1363
      issues-table:
1364
        default_save_state: 1
1327
        columns:
1365
        columns:
1328
            -
1366
            -
1329
              columnname: sort_order
1367
              columnname: sort_order
Lines 1387-1392 modules: Link Here
1387
              cannot_be_modified: 1
1425
              cannot_be_modified: 1
1388
1426
1389
      relatives-issues-table:
1427
      relatives-issues-table:
1428
        default_save_state: 1
1390
        columns:
1429
        columns:
1391
            -
1430
            -
1392
              columnname: due_date_unformatted
1431
              columnname: due_date_unformatted
Lines 1428-1433 modules: Link Here
1428
              columnname: patron
1467
              columnname: patron
1429
1468
1430
      table_borrowers:
1469
      table_borrowers:
1470
        default_save_state: 1
1431
        columns:
1471
        columns:
1432
            -
1472
            -
1433
              columnname: name
1473
              columnname: name
Lines 1449-1454 modules: Link Here
1449
1489
1450
    returns:
1490
    returns:
1451
      checkedintable:
1491
      checkedintable:
1492
        default_save_state: 1
1452
        columns:
1493
        columns:
1453
            -
1494
            -
1454
              columnname: due_date
1495
              columnname: due_date
Lines 1483-1488 modules: Link Here
1483
    view_holdsqueue:
1524
    view_holdsqueue:
1484
      holds-table:
1525
      holds-table:
1485
        default_sort_order: 3
1526
        default_sort_order: 3
1527
        default_save_state: 1
1486
        columns:
1528
        columns:
1487
            -
1529
            -
1488
              columnname: title
1530
              columnname: title
Lines 1516-1521 modules: Link Here
1516
      holds-to-pull:
1558
      holds-to-pull:
1517
        default_display_length: 20
1559
        default_display_length: 20
1518
        default_sort_order: 0
1560
        default_sort_order: 0
1561
        default_save_state: 1
1519
        columns:
1562
        columns:
1520
            -
1563
            -
1521
              columnname: pull_items
1564
              columnname: pull_items
Lines 1555-1560 modules: Link Here
1555
    holdsratios:
1598
    holdsratios:
1556
      holds-ratios:
1599
      holds-ratios:
1557
        default_display_length: 20
1600
        default_display_length: 20
1601
        default_save_state: 1
1558
        columns:
1602
        columns:
1559
            -
1603
            -
1560
              columnname: holds
1604
              columnname: holds
Lines 1579-1584 modules: Link Here
1579
1623
1580
    holds_awaiting_pickup:
1624
    holds_awaiting_pickup:
1581
      holdst:
1625
      holdst:
1626
        default_save_state: 1
1582
        columns:
1627
        columns:
1583
            -
1628
            -
1584
              columnname: checkbox
1629
              columnname: checkbox
Lines 1610-1615 modules: Link Here
1610
              columnname: action
1655
              columnname: action
1611
1656
1612
      holdso:
1657
      holdso:
1658
        default_save_state: 1
1613
        columns:
1659
        columns:
1614
            -
1660
            -
1615
              columnname: checkbox
1661
              columnname: checkbox
Lines 1641-1646 modules: Link Here
1641
              columnname: action
1687
              columnname: action
1642
1688
1643
      holdscr:
1689
      holdscr:
1690
        default_save_state: 1
1644
        columns:
1691
        columns:
1645
            -
1692
            -
1646
                columnname: checkbox
1693
                columnname: checkbox
Lines 1675-1680 modules: Link Here
1675
      circ-overdues:
1722
      circ-overdues:
1676
        default_display_length: 20
1723
        default_display_length: 20
1677
        default_sort_order: 0
1724
        default_sort_order: 0
1725
        default_save_state: 1
1678
        columns:
1726
        columns:
1679
            -
1727
            -
1680
              columnname: due_date
1728
              columnname: due_date
Lines 1762-1767 modules: Link Here
1762
  opac:
1810
  opac:
1763
    biblio-detail:
1811
    biblio-detail:
1764
      holdingst:
1812
      holdingst:
1813
        default_save_state: 1
1765
        columns:
1814
        columns:
1766
            -
1815
            -
1767
              columnname: item_cover
1816
              columnname: item_cover
Lines 1804-1809 modules: Link Here
1804
              columnname: item_coursereserves
1853
              columnname: item_coursereserves
1805
1854
1806
      course_reserves_table:
1855
      course_reserves_table:
1856
        default_save_state: 1
1807
        columns:
1857
        columns:
1808
            -
1858
            -
1809
              columnname: coursename
1859
              columnname: coursename
Lines 1821-1826 modules: Link Here
1821
              columnname: notes
1871
              columnname: notes
1822
1872
1823
      subscriptionst:
1873
      subscriptionst:
1874
        default_save_state: 1
1824
        columns:
1875
        columns:
1825
            -
1876
            -
1826
              columnname: serial_serialseq
1877
              columnname: serial_serialseq
Lines 1834-1839 modules: Link Here
1834
              columnname: serial_notes
1885
              columnname: serial_notes
1835
1886
1836
      course-items-table:
1887
      course-items-table:
1888
        default_save_state: 1
1837
        columns:
1889
        columns:
1838
            -
1890
            -
1839
              columnname: title
1891
              columnname: title
Lines 1861-1866 modules: Link Here
1861
  serials:
1913
  serials:
1862
    subscription-detail:
1914
    subscription-detail:
1863
      orders:
1915
      orders:
1916
        default_save_state: 1
1864
        columns:
1917
        columns:
1865
            -
1918
            -
1866
              columnname: invoice
1919
              columnname: invoice
Lines 1888-1893 modules: Link Here
1888
  tools:
1941
  tools:
1889
    batch_patron_modification:
1942
    batch_patron_modification:
1890
      borrowerst:
1943
      borrowerst:
1944
        default_save_state: 1
1891
        columns:
1945
        columns:
1892
            -
1946
            -
1893
              columnname: batch_patron_edit_selections
1947
              columnname: batch_patron_edit_selections
Lines 1939-1944 modules: Link Here
1939
    logviewer:
1993
    logviewer:
1940
      logst:
1994
      logst:
1941
        default_display_length: 20
1995
        default_display_length: 20
1996
        default_save_state: 1
1942
        columns:
1997
        columns:
1943
            -
1998
            -
1944
              columnname: date
1999
              columnname: date
Lines 1956-1961 modules: Link Here
1956
              columnname: interface
2011
              columnname: interface
1957
    marc-modification-templates:
2012
    marc-modification-templates:
1958
      templatest:
2013
      templatest:
2014
        default_save_state: 1
1959
        columns:
2015
        columns:
1960
            -
2016
            -
1961
              columnname: id
2017
              columnname: id
Lines 1969-1974 modules: Link Here
1969
    notices:
2025
    notices:
1970
      lettert:
2026
      lettert:
1971
        default_sort_order: 3
2027
        default_sort_order: 3
2028
        default_save_state: 1
1972
        columns:
2029
        columns:
1973
            -
2030
            -
1974
              columnname: library
2031
              columnname: library
Lines 1989-1994 modules: Link Here
1989
2046
1990
    stockrotation:
2047
    stockrotation:
1991
      stock_rotation:
2048
      stock_rotation:
2049
        default_save_state: 1
1992
        columns:
2050
        columns:
1993
            -
2051
            -
1994
              columnname: name
2052
              columnname: name
Lines 2006-2011 modules: Link Here
2006
              cannot_be_modified: 1
2064
              cannot_be_modified: 1
2007
2065
2008
      stock_rotation_manage_items:
2066
      stock_rotation_manage_items:
2067
        default_save_state: 1
2009
        columns:
2068
        columns:
2010
            -
2069
            -
2011
              columnname: barcode
2070
              columnname: barcode
Lines 2027-2032 modules: Link Here
2027
    upload:
2086
    upload:
2028
      uploadresults:
2087
      uploadresults:
2029
        default_display_length: 20
2088
        default_display_length: 20
2089
        default_save_state: 1
2030
        columns:
2090
        columns:
2031
            -
2091
            -
2032
              columnname: filename
2092
              columnname: filename
Lines 2050-2055 modules: Link Here
2050
  pos:
2110
  pos:
2051
    pay:
2111
    pay:
2052
      invoices:
2112
      invoices:
2113
        default_save_state: 1
2053
        columns:
2114
        columns:
2054
            -
2115
            -
2055
              columnname: code
2116
              columnname: code
(-)a/installer/data/mysql/atomicupdate/bug_33484.pl (+17 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "33484",
5
    description => "Add state save as an option to datatables",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        if ( !column_exists( 'tables_settings', 'default_save_state' ) ) {
10
            $dbh->do(q{
11
                ALTER TABLE tables_settings
12
                  ADD COLUMN default_save_state tinyint(1) DEFAULT NULL AFTER default_sort_order
13
            });
14
            say $out "Added column 'tables_settings.default_save_state'";
15
        }
16
    },
17
};
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 5663-5668 CREATE TABLE `tables_settings` ( Link Here
5663
  `tablename` varchar(255) NOT NULL,
5663
  `tablename` varchar(255) NOT NULL,
5664
  `default_display_length` smallint(6) DEFAULT NULL,
5664
  `default_display_length` smallint(6) DEFAULT NULL,
5665
  `default_sort_order` varchar(255) DEFAULT NULL,
5665
  `default_sort_order` varchar(255) DEFAULT NULL,
5666
  `default_save_state` tinyint(1) DEFAULT NULL,
5666
  PRIMARY KEY (`module`(191),`page`(191),`tablename`(191))
5667
  PRIMARY KEY (`module`(191),`page`(191),`tablename`(191))
5667
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
5668
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
5668
/*!40101 SET character_set_client = @saved_cs_client */;
5669
/*!40101 SET character_set_client = @saved_cs_client */;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc (+4 lines)
Lines 45-50 function KohaTable(id_selector, dt_parameters, table_settings, add_filters) { Link Here
45
            }
45
            }
46
            counter++;
46
            counter++;
47
        });
47
        });
48
49
        if ( table_settings.hasOwnProperty('default_save_state') && table_settings['default_save_state'] === 0 ) {
50
            localStorage.removeItem(table_key);
51
        }
48
    }
52
    }
49
53
50
    var exportColumns = ":visible:not(.noExport)";
54
    var exportColumns = ":visible:not(.noExport)";
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt (+10 lines)
Lines 136-141 Link Here
136
                                        </select>
136
                                        </select>
137
                                    </p>
137
                                    </p>
138
                                [% END %]
138
                                [% END %]
139
                                [% IF table_settings.default_save_state.defined %]
140
                                    <p>
141
                                        Save state on page change: 
142
                                        [%- IF table_settings.default_save_state -%]
143
                                            <input type="checkbox" name="[% pagename | html %]#[% tablename | html %]_default_save_state" value="1" checked="checked" />
144
                                        [%- ELSE -%]
145
                                            <input type="checkbox" name="[% pagename | html %]#[% tablename | html %]_default_save_state" value="1" />
146
                                        [%- END -%]
147
                                    </p>
148
                                [% END %]
139
149
140
                            </div>
150
                            </div>
141
                        [% END %]
151
                        [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/datatables.js (+3 lines)
Lines 979-984 function _dt_get_saved_state( localstorage_config, columns_settings ){ Link Here
979
            if ( table_settings.hasOwnProperty('default_sort_order') && table_settings['default_sort_order'] != null ) {
979
            if ( table_settings.hasOwnProperty('default_sort_order') && table_settings['default_sort_order'] != null ) {
980
                settings["order"] = [[ table_settings['default_sort_order'], 'asc' ]];
980
                settings["order"] = [[ table_settings['default_sort_order'], 'asc' ]];
981
            }
981
            }
982
            if ( table_settings.hasOwnProperty('default_save_state') && table_settings['default_save_state'] === 0 ) {
983
                localStorage.removeItem(table_key);
984
            }
982
        }
985
        }
983
986
984
        var table = $(this).dataTable(settings);
987
        var table = $(this).dataTable(settings);
(-)a/t/db_dependent/TablesSettings.t (-1 / +4 lines)
Lines 25-30 $module->mock( Link Here
25
                        'currencies-table' => {
25
                        'currencies-table' => {
26
                            default_display_length => 20,
26
                            default_display_length => 20,
27
                            default_sort_order => 1,
27
                            default_sort_order => 1,
28
                            default_save_state => 1,
28
                            columns => [
29
                            columns => [
29
                                {
30
                                {
30
                                    columnname         => 'currency',
31
                                    columnname         => 'currency',
Lines 125-130 my $modules_expected = { Link Here
125
            'currencies-table' => {
126
            'currencies-table' => {
126
                default_display_length => 20,
127
                default_display_length => 20,
127
                default_sort_order => 1,
128
                default_sort_order => 1,
129
                default_save_state => 1,
128
                columns => [
130
                columns => [
129
                    {
131
                    {
130
                        columnname         => 'currency',
132
                        columnname         => 'currency',
Lines 192-201 for my $m ( keys %$modules ) { Link Here
192
                {
194
                {
193
                    default_display_length => $table_settings->{default_display_length},
195
                    default_display_length => $table_settings->{default_display_length},
194
                    default_sort_order     => $table_settings->{default_sort_order}
196
                    default_sort_order     => $table_settings->{default_sort_order}
197
                    default_save_state     => $table_settings->{default_save_state}
195
                },
198
                },
196
                {
199
                {
197
                    default_display_length => $modules->{$m}{$p}{$t}{default_display_length},
200
                    default_display_length => $modules->{$m}{$p}{$t}{default_display_length},
198
                    default_sort_order     => $modules->{$m}{$p}{$t}{default_sort_order},
201
                    default_sort_order     => $modules->{$m}{$p}{$t}{default_sort_order},
202
                    default_save_state     => $modules->{$m}{$p}{$t}{default_save_state},
199
                }
203
                }
200
            );
204
            );
201
        }
205
        }
202
- 

Return to bug 33484