@@ -, +, @@ --- C4/Templates.pm | 47 ------------------- .../prog/en/modules/tools/import_borrowers.tt | 29 ++++++------ .../prog/js/pages/preferences.js | 2 +- t/db_dependent/Templates.t | 35 ++++++-------- tools/import_borrowers.pl | 6 +-- 5 files changed, 31 insertions(+), 88 deletions(-) --- a/C4/Templates.pm +++ a/C4/Templates.pm @@ -348,51 +348,4 @@ sub getlanguagecookie { return $cookie; } -=head2 GetColumnDefs - - my $columns = GetColumnDefs( $cgi ) - -It is passed a CGI object and returns a hash of hashes containing -the column names and descriptions for each table defined in the -columns.def file corresponding to the CGI object. - -=cut - -sub GetColumnDefs { - - my $query = shift; - - my $columns = {}; - - my $htdocs = C4::Context->config('intrahtdocs'); - my $columns_file = 'columns.def'; - - # Get theme and language to build the path to columns.def - my ($theme, $lang, $availablethemes) = - themelanguage($htdocs, 'about.tt', 'intranet', $query); - # Build columns.def path - my $path = "$htdocs/$theme/$lang/$columns_file"; - my $fh; - if ( ! open ( $fh, q{<:encoding(utf-8)}, $path ) ) { - carp "Error opening $path. Check your templates."; - return; - } - # Loop through the columns.def file - while ( my $input = <$fh> ){ - chomp $input; - if ( $input =~ m|(.*)| ) { - my ( $table, $column ) = split( '\.', $1); - my $description = $2; - # Initialize the table array if needed. - @{$columns->{ $table }} = () if ! defined $columns->{ $table }; - # Push field and description - push @{$columns->{ $table }}, - { field => $column, description => $description }; - } - } - close $fh; - - return $columns; -} - 1; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt @@ -246,36 +246,35 @@