From 2b76d31c6d7fccac8333037b33e1d3fe54518dbc Mon Sep 17 00:00:00 2001 From: Chris Nighswonger Date: Mon, 20 Feb 2012 14:43:01 -0500 Subject: [PATCH] Revert "Bug 6836 follow-up fixing POD" This reverts commit 03e1c36dce6dc37f47c0927517b8bf646c214557. -Part of Enh 6836 --- C4/Utils/DataTables.pm | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/C4/Utils/DataTables.pm b/C4/Utils/DataTables.pm index 9a8e4e4bf8..23656004ba 100644 --- a/C4/Utils/DataTables.pm +++ b/C4/Utils/DataTables.pm @@ -70,14 +70,20 @@ C4::Utils::DataTables - Utility subs for building query when DataTables source i =head1 FUNCTIONS -=head2 dt_build_orderby +=over 2 + +=item dt_build_orderby my $orderby = dt_build_orderby($dt_param); + This function takes a reference to a hash containing DataTables parameters and build the corresponding 'ORDER BY' clause. This hash must contains the following keys: + iSortCol_N, where N is a number from 0 to the number of columns to sort on minus 1 + sSortDir_N is the sorting order ('asc' or 'desc) for the corresponding column + mDataProp_N is a mapping between the column index, and the name of a SQL field =cut @@ -107,19 +113,26 @@ sub dt_build_orderby { return $orderby; } -=head2 dt_build_having +=item dt_build_having my ($having, $having_params) = dt_build_having($dt_params) This function takes a reference to a hash containing DataTables parameters and build the corresponding 'HAVING' clause. This hash must contains the following keys: + sSearch is the text entered in the global filter + iColumns is the number of columns + bSearchable_N is a boolean value that is true if the column is searchable + mDataProp_N is a mapping between the column index, and the name of a SQL field + sSearch_N is the text entered in individual filter for column N +=back + =cut sub dt_build_having { @@ -183,12 +196,16 @@ sub dt_build_having { return (\@filters, \@params); } -=head2 dt_get_params +=item dt_get_params my %dtparam = = dt_get_params( $input ) + This function takes a reference to a new CGI object. + It prepares a hash containing Datatable parameters. +=back + =cut sub dt_get_params { my $input = shift; @@ -210,7 +227,7 @@ sub dt_get_params { return %dtparam; } -=head2 dt_build_query_simple +=item dt_build_query_simple my ( $query, $params )= dt_build_query_simple( $value, $field ) @@ -220,6 +237,8 @@ sub dt_get_params { Else, returns a SQL where string and an arrayref containing parameters for the execute method of the statement. +=back + =cut sub dt_build_query_simple { my ( $value, $field ) = @_; @@ -232,7 +251,7 @@ sub dt_build_query_simple { return ( $query, \@params ); } -=head2 dt_build_query_dates +=item dt_build_query_dates my ( $query, $params )= dt_build_query_dates( $datefrom, $dateto, $field) @@ -242,6 +261,8 @@ sub dt_build_query_simple { Else, returns a SQL where string and an arrayref containing parameters for the execute method of the statement. +=back + =cut sub dt_build_query_dates { my ( $datefrom, $dateto, $field ) = @_; @@ -258,7 +279,7 @@ sub dt_build_query_dates { return ( $query, \@params ); } -=head2 dt_build_query +=item dt_build_query my ( $query, $filter ) = dt_build_query( $type, @params ) @@ -268,6 +289,8 @@ sub dt_build_query_dates { $type can be 'simple' or 'rage_dates'. +=back + =cut sub dt_build_query { my ( $type, @params ) = @_; -- 2.39.5