Lines 35-57
This plugin allows to get the column configuration for a table.
Link Here
|
35 |
First, include the line '[% USE Tables %]' at the top |
35 |
First, include the line '[% USE Tables %]' at the top |
36 |
of the template to enable the plugin. |
36 |
of the template to enable the plugin. |
37 |
|
37 |
|
38 |
To use, call ColumnsSettings.GetTables with the module and the page where the template is called. |
38 |
To use, call ColumnsSettings.GetColumns with the module, the page and the table where the template is called. |
39 |
|
39 |
|
40 |
For example: [% ColumnsSettings.GetTables( 'circ', 'circulation' ) %] |
40 |
For example: [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'holdst' ) %] |
41 |
|
41 |
|
42 |
=cut |
42 |
=cut |
43 |
|
43 |
|
44 |
sub GetTables { |
|
|
45 |
my ( $self, $module, $page, $format ) = @_; |
46 |
$format //= q{}; |
47 |
|
48 |
my $columns = C4::Utils::DataTables::ColumnsSettings::get_tables( $module, $page ); |
49 |
|
50 |
return $format eq 'json' |
51 |
? to_json( $columns ) |
52 |
: $columns |
53 |
} |
54 |
|
55 |
sub GetColumns { |
44 |
sub GetColumns { |
56 |
my ( $self, $module, $page, $table, $format ) = @_; |
45 |
my ( $self, $module, $page, $table, $format ) = @_; |
57 |
$format //= q{}; |
46 |
$format //= q{}; |
58 |
- |
|
|