lib/calcms: remove dead code
This commit is contained in:
@@ -18,7 +18,6 @@ sub get_list($$) {
|
|||||||
my $request = shift;
|
my $request = shift;
|
||||||
|
|
||||||
my $params = $request->{params}->{checked};
|
my $params = $request->{params}->{checked};
|
||||||
my $debug = $config->{system}->{debug};
|
|
||||||
|
|
||||||
#customize prefiltered request parameters
|
#customize prefiltered request parameters
|
||||||
$request->{params}->{original}->{date} = $request->{params}->{checked}->{date};
|
$request->{params}->{original}->{date} = $request->{params}->{checked}->{date};
|
||||||
@@ -101,7 +100,6 @@ sub get_calendar($$$) {
|
|||||||
my $date = shift;
|
my $date = shift;
|
||||||
|
|
||||||
my $params = $request->{params}->{checked};
|
my $params = $request->{params}->{checked};
|
||||||
my $debug = $config->{system}->{debug};
|
|
||||||
|
|
||||||
$request->{params}->{original}->{template} = 'calendar.html';
|
$request->{params}->{original}->{template} = 'calendar.html';
|
||||||
$request->{params}->{original}->{date} = $date if defined $date;
|
$request->{params}->{original}->{date} = $date if defined $date;
|
||||||
@@ -160,13 +158,10 @@ sub check_params($$) {
|
|||||||
$date = time::time_to_date( time() ) if $date eq '';
|
$date = time::time_to_date( time() ) if $date eq '';
|
||||||
$date = time::get_event_date($config) if $date eq 'today';
|
$date = time::get_event_date($config) if $date eq 'today';
|
||||||
|
|
||||||
# $date =$config->{date}->{start_date} if ($date lt $config->{date}->{start_date});
|
|
||||||
# $date =$config->{date}->{end_date} if ($date gt $config->{date}->{end_date});
|
|
||||||
$date = $start_date if $date lt $start_date;
|
$date = $start_date if $date lt $start_date;
|
||||||
$date = $end_date if $date gt $end_date;
|
$date = $end_date if $date gt $end_date;
|
||||||
|
|
||||||
#filter for date
|
#filter for date
|
||||||
# my $date=time::check_date($params->{date});
|
|
||||||
my $time = time::check_time( $params->{time} );
|
my $time = time::check_time( $params->{time} );
|
||||||
if ( ( defined $params->{today} ) && ( $params->{today} eq '1' ) ) {
|
if ( ( defined $params->{today} ) && ( $params->{today} eq '1' ) ) {
|
||||||
$date = time::time_to_date( time() );
|
$date = time::time_to_date( time() );
|
||||||
@@ -222,11 +217,6 @@ sub check_params($$) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
my $debug = $params->{debug} || '';
|
|
||||||
if ( $debug =~ /([a-z\_\,]+)/ ) {
|
|
||||||
$debug = $1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#set query string for caching
|
#set query string for caching
|
||||||
if ( ( !exists $ENV{QUERY_STRING} ) || ( $ENV{QUERY_STRING} eq '' ) ) {
|
if ( ( !exists $ENV{QUERY_STRING} ) || ( $ENV{QUERY_STRING} eq '' ) ) {
|
||||||
my $options = [];
|
my $options = [];
|
||||||
@@ -243,7 +233,6 @@ sub check_params($$) {
|
|||||||
from_date => $from_date,
|
from_date => $from_date,
|
||||||
till_date => $till_date,
|
till_date => $till_date,
|
||||||
event_id => $event_id,
|
event_id => $event_id,
|
||||||
debug => $debug,
|
|
||||||
ro => $params->{ro}//'' ? 1 : 0
|
ro => $params->{ro}//'' ? 1 : 0
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ sub connect($;$) {
|
|||||||
return $request->{connection} if ( defined $request ) && ( defined $request->{connection} );
|
return $request->{connection} if ( defined $request ) && ( defined $request->{connection} );
|
||||||
|
|
||||||
my $access_options = $options->{access};
|
my $access_options = $options->{access};
|
||||||
|
|
||||||
my $hostname = $access_options->{hostname};
|
my $hostname = $access_options->{hostname};
|
||||||
my $port = $access_options->{port};
|
my $port = $access_options->{port};
|
||||||
my $database = $access_options->{database};
|
my $database = $access_options->{database};
|
||||||
@@ -53,14 +52,11 @@ sub connect($;$) {
|
|||||||
|
|
||||||
my $dbh = DBI->connect( $dsn, $username, $password, { mysql_enable_utf8 => 1 } )
|
my $dbh = DBI->connect( $dsn, $username, $password, { mysql_enable_utf8 => 1 } )
|
||||||
|| die "could not connect to database: $DBI::errstr";
|
|| die "could not connect to database: $DBI::errstr";
|
||||||
|
|
||||||
$dbh->{RaiseError} = 1;
|
$dbh->{RaiseError} = 1;
|
||||||
|
|
||||||
$dbh->{'mysql_enable_utf8'} = 1;
|
$dbh->{'mysql_enable_utf8'} = 1;
|
||||||
put( $dbh, "set character set utf8" );
|
put( $dbh, "set character set utf8" );
|
||||||
put( $dbh, "set names utf8" );
|
put( $dbh, "set names utf8" );
|
||||||
put( $dbh, "set time_zone='" . $options->{date}->{time_zone} . "'" );
|
put( $dbh, "set time_zone='" . $options->{date}->{time_zone} . "'" );
|
||||||
|
|
||||||
$request->{connection} = $dbh;
|
$request->{connection} = $dbh;
|
||||||
$options->{connections}->{$key} = $dbh;
|
$options->{connections}->{$key} = $dbh;
|
||||||
return $dbh;
|
return $dbh;
|
||||||
@@ -78,14 +74,8 @@ sub disconnect ($){
|
|||||||
sub get($$;$) {
|
sub get($$;$) {
|
||||||
my ( $dbh, $sql, $bind_values ) = @_;
|
my ( $dbh, $sql, $bind_values ) = @_;
|
||||||
|
|
||||||
if ( $debug_read == 1 ) {
|
|
||||||
print STDERR $sql . "\n";
|
|
||||||
print STDERR Dumper($bind_values) . "\n" if defined $bind_values;
|
|
||||||
}
|
|
||||||
|
|
||||||
my $sth = $dbh->prepare($sql);
|
my $sth = $dbh->prepare($sql);
|
||||||
if ( ( defined $bind_values ) && ( ref($bind_values) eq 'ARRAY' ) ) {
|
if ( ( defined $bind_values ) && ( ref($bind_values) eq 'ARRAY' ) ) {
|
||||||
|
|
||||||
my $result = $sth->execute(@$bind_values);
|
my $result = $sth->execute(@$bind_values);
|
||||||
unless ($result) {
|
unless ($result) {
|
||||||
print STDERR $sql . "\n";
|
print STDERR $sql . "\n";
|
||||||
|
|||||||
@@ -113,9 +113,6 @@ sub initTemplate($) {
|
|||||||
default_escape => $default_escape,
|
default_escape => $default_escape,
|
||||||
cache => 1,
|
cache => 1,
|
||||||
utf8 => 1,
|
utf8 => 1,
|
||||||
|
|
||||||
#pre_chomp => 1,
|
|
||||||
#post_chomp => 1,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user