6 use lib
"$FindBin::Bin/../lib";
9 use NonameTV
::DataStore
;
10 use NonameTV
::Config qw
/ReadConfig/;
13 use POSIX qw
/strftime/;
17 my $conf = ReadConfig
();
20 my $ds = NonameTV
::DataStore
->new( $conf->{DataStore
} );
28 # Retrieve a list of all batches that have been aborted due to errors.
29 my( $res, $sth ) = $ds->sa->Sql(
30 "select * from batches where abort_message!='' order by name" );
32 while( my $d = $sth->fetchrow_hashref() ) {
33 push @
{$data->{errors
}}, $d;
38 # Retrieve a list of all batches that generated a warning.
39 ( $res, $sth ) = $ds->sa->Sql(
40 "select * from batches where message!='' order by name" );
42 while( my $d = $sth->fetchrow_hashref() )
44 push @
{$data->{warnings
}}, $d;
49 # Retrieve a list of all files with that generated a message
50 ( $res, $sth ) = $ds->sa->Sql(
51 "select * from files where message!='' order by channelid, filename" );
53 while( my $d = $sth->fetchrow_hashref() )
55 push @
{$data->{files
}}, $d;
60 GeneratePage
( 'batchlog', $data );
63 my( $templatename, $data ) = @_;
67 $config->{INCLUDE_PATH
} = [ "$FindBin::Bin/../templates/" ];
68 if( defined( $NonameTV::Conf
->{TemplateCountry
} ) ) {
69 unshift( @
{$config->{INCLUDE_PATH
}},
70 "$FindBin::Bin/../templates/$NonameTV::Conf->{TemplateCountry}" );
74 # create Template object
75 my $template = Template
->new($config);
77 $template->process( $templatename, $data );