Bugzilla – Attachment 104401 Details for
Bug 23547
Add column configuration to course reserves table in the OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23547: (follow-up) Improve POD for template plugin
Bug-23547-follow-up-Improve-POD-for-template-plugi.patch (text/plain), 3.17 KB, created by
Martin Renvoize (ashimema)
on 2020-05-06 07:29:43 UTC
(
hide
)
Description:
Bug 23547: (follow-up) Improve POD for template plugin
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-05-06 07:29:43 UTC
Size:
3.17 KB
patch
obsolete
>From 582a51deddcc1f7915bf5d2805dd2e8891a424c0 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 6 May 2020 08:26:39 +0100 >Subject: [PATCH] Bug 23547: (follow-up) Improve POD for template plugin > >--- > Koha/Template/Plugin/ColumnsSettings.pm | 58 ++++++++++++++++++++++--- > 1 file changed, 51 insertions(+), 7 deletions(-) > >diff --git a/Koha/Template/Plugin/ColumnsSettings.pm b/Koha/Template/Plugin/ColumnsSettings.pm >index ee9febe1ce..50c2131ece 100644 >--- a/Koha/Template/Plugin/ColumnsSettings.pm >+++ b/Koha/Template/Plugin/ColumnsSettings.pm >@@ -17,6 +17,38 @@ package Koha::Template::Plugin::ColumnsSettings; > # You should have received a copy of the GNU General Public License > # along with Koha; if not, see <http://www.gnu.org/licenses>. > >+=head1 NAME >+ >+Koha::Template::Plugin::ColumnsSettings >+ >+=head2 SYNOPSYS >+ >+ [% USE ColumnsSettings %] >+ >+ . . . >+ >+ [% UNLESS ColumnsSettings.is_hidden( 'module', 'page', 'table', 'column') %] >+ <th id="column" data-colname="column">Column title</th> >+ [% END %] >+ >+ . . . >+ >+ [% UNLESS ColumnsSettings.is_hidden( 'module', 'page', 'table', 'column') %] >+ <td>[% row.column %]</td> >+ [% END %] >+ >+ . . . >+ >+ <script> >+ var columns_settings = [% ColumnsSettings.GetColumns( 'module', 'page', 'table', 'json' ) | $raw %]; >+ var table = KohaTable("id", { "bAutoWidth": false }, columns_settings ); >+ </script> >+ >+This plugin allows to get the column configuration for a table. It should be used both in table markup >+and as the input for datatables visibility settings to take full effect. >+ >+=cut >+ > use Modern::Perl; > > use Template::Plugin; >@@ -28,16 +60,17 @@ use JSON qw( to_json ); > use C4::Context qw( config ); > use C4::Utils::DataTables::ColumnsSettings; > >-=pod >+=head1 FUNCTIONS > >-This plugin allows to get the column configuration for a table. >+=head2 GetColumns > >-First, include the line '[% USE Tables %]' at the top >-of the template to enable the plugin. >+ <script> >+ var columns_settings = [% ColumnsSettings.GetColumns( 'module', 'page', 'table', 'json' ) | $raw %]; >+ var table = KohaTable("id", { "bAutoWidth": false }, columns_settings ); >+ </script> > >-To use, call ColumnsSettings.GetColumns with the module, the page and the table where the template is called. >- >-For example: [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'holdst' ) %] >+Used to get the full column settings configuration for datatables, usually requires a format of 'json' to pass into >+datatables instantiator. > > =cut > >@@ -52,6 +85,17 @@ sub GetColumns { > : $columns > } > >+=head2 is_hidden >+ >+ [% UNLESS ColumnsSettings.is_hidden( 'module', 'page', 'table', 'column') %] >+ <th id="column" data-colname="column">Column title</th> >+ [% END %] >+ >+Used to fetch an individual columns display status so we can fully hide a column in the markup for cases where >+it may contain confidential information and should be fully hidden rather than just hidden from display. >+ >+=cut >+ > sub is_hidden { > my ( $self, $module, $page, $table, $column_name ) = @_; > my $columns = C4::Utils::DataTables::ColumnsSettings::get_columns( $module, $page, $table ); >-- >2.20.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 23547
:
99268
|
99339
|
99471
|
99705
|
99830
|
104401