remove brackets from conditions that are not needed
This commit is contained in:
@@ -103,7 +103,7 @@ sub get_calendar($$$) {
|
||||
my $debug = $config->{system}->{debug};
|
||||
|
||||
$request->{params}->{original}->{template} = 'calendar.html';
|
||||
$request->{params}->{original}->{date} = $date if ( defined $date );
|
||||
$request->{params}->{original}->{date} = $date if defined $date;
|
||||
$request->{params}->{checked} = calendar::check_params( $config, $request->{params}->{original} );
|
||||
$params = $request->{params}->{checked};
|
||||
|
||||
|
||||
@@ -71,14 +71,14 @@ sub extractEventFromWikiText($;$) {
|
||||
$category =~ s/\s+/ /g;
|
||||
$category =~ s/^\s+|\s+$//g;
|
||||
$category =~ s/\&/\+/g;
|
||||
push @categories, $category if ( defined $category && $category =~ /\S/ );
|
||||
push @categories, $category if defined $category && $category =~ /\S/;
|
||||
|
||||
$category = '';
|
||||
$category = $2 if ( defined $2 );
|
||||
$category =~ s/\s+/ /g;
|
||||
$category =~ s/^\s+|\s+$//g;
|
||||
$category =~ s/\&/\+/g;
|
||||
push @categories, $category if ( defined $category && $category =~ /\S/ );
|
||||
push @categories, $category if defined $category && $category =~ /\S/;
|
||||
$title =~ s/\((.*?),(.*?)\)/\($2\)/;
|
||||
}
|
||||
if ( $title =~ /\((.*?)\)/ ) {
|
||||
@@ -87,7 +87,7 @@ sub extractEventFromWikiText($;$) {
|
||||
$category =~ s/^\s+|\s+$//g;
|
||||
$category =~ s/\&/\+/g;
|
||||
|
||||
push @categories, $category if ( defined $category && $category =~ /\S/ );
|
||||
push @categories, $category if defined $category && $category =~ /\S/;
|
||||
$title =~ s/\((.*?)\)//;
|
||||
}
|
||||
$event->{categories} = \@categories if ( @categories > 0 );
|
||||
|
||||
@@ -371,7 +371,7 @@ sub modify_results ($$$$) {
|
||||
)
|
||||
{
|
||||
for my $key ( keys %$result ) {
|
||||
$result->{$key} =~ s/\|/\\\|/g if ( defined $result->{$key} );
|
||||
$result->{$key} =~ s/\|/\\\|/g if defined $result->{$key};
|
||||
}
|
||||
|
||||
# $result->{content}='no';
|
||||
|
||||
@@ -31,7 +31,7 @@ sub get($$) {
|
||||
my $language = undef;
|
||||
|
||||
#get language from options
|
||||
$language = $options->{language} if ( defined $options->{language} );
|
||||
$language = $options->{language} if defined $options->{language};
|
||||
|
||||
#get language from user
|
||||
if ( ( !( defined $language ) ) && ( defined $options->{user} ) ) {
|
||||
|
||||
@@ -107,7 +107,7 @@ sub get_user($) {
|
||||
|
||||
my $user = $ENV{REMOTE_USER};
|
||||
my $users = $config->{users};
|
||||
return $user if ( defined $users->{$user} );
|
||||
return $user if defined $users->{$user};
|
||||
return 'nobody';
|
||||
}
|
||||
|
||||
|
||||
@@ -426,12 +426,12 @@ sub search_events ($$$) {
|
||||
template => 'no'
|
||||
};
|
||||
if ( defined $options ) {
|
||||
$params->{from_date} = $options->{from_date} if ( defined $options->{from_date} );
|
||||
$params->{till_date} = $options->{till_date} if ( defined $options->{till_date} );
|
||||
$params->{location} = $options->{location} if ( defined $options->{location} );
|
||||
$params->{limit} = $options->{limit} if ( defined $options->{limit} );
|
||||
$params->{archive} = $options->{archive} if ( defined $options->{archive} );
|
||||
$params->{get} = $options->{get} if ( defined $options->{get} );
|
||||
$params->{from_date} = $options->{from_date} if defined $options->{from_date};
|
||||
$params->{till_date} = $options->{till_date} if defined $options->{till_date};
|
||||
$params->{location} = $options->{location} if defined $options->{location};
|
||||
$params->{limit} = $options->{limit} if defined $options->{limit};
|
||||
$params->{archive} = $options->{archive} if defined $options->{archive};
|
||||
$params->{get} = $options->{get} if defined $options->{get};
|
||||
}
|
||||
|
||||
my $checked_params = events::check_params( $config, $params );
|
||||
|
||||
@@ -138,7 +138,7 @@ sub showComments {
|
||||
my $language = $config->{date}->{language} || 'en';
|
||||
for my $event (@$events) {
|
||||
$event->{start} = time::date_time_format( $config, $event->{start}, $language );
|
||||
$comment_count += $event->{comment_count} if ( defined $event->{comment_count} );
|
||||
$comment_count += $event->{comment_count} if defined $event->{comment_count};
|
||||
$event->{cache_base_url} = $config->{cache}->{base_url};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ if ( defined $r ) {
|
||||
if ( $status =~ /limit/i ) {
|
||||
$error = $status;
|
||||
} else {
|
||||
$upload = $apr->upload('image') if ( defined $params->{image} );
|
||||
$upload = $apr->upload('image') if defined $params->{image};
|
||||
}
|
||||
print STDERR "apr\n";
|
||||
} else {
|
||||
|
||||
@@ -366,7 +366,7 @@ sub show_roles {
|
||||
$out .= qq{</tr>};
|
||||
}
|
||||
$out .= '</table>';
|
||||
$out .= '<input type="submit" name="action" value="save">' if ( defined $permissions->{update_role} );
|
||||
$out .= '<input type="submit" name="action" value="save">' if defined $permissions->{update_role};
|
||||
$out .= '</form>';
|
||||
$out .= '</div>';
|
||||
print $out. "\n";
|
||||
@@ -383,10 +383,8 @@ sub sort_columns {
|
||||
my $action = shift @words;
|
||||
my $group = join( ' ', @words );
|
||||
|
||||
#print "action:'$action' group:'$group' <br>\n";
|
||||
|
||||
my $index = $groups->{$group} || 0;
|
||||
$index += $actions->{$action} if ( defined $actions->{$action} );
|
||||
$index += $actions->{$action} if defined $actions->{$action};
|
||||
$column_level->{$column} = $index;
|
||||
|
||||
# print $index."<br>";
|
||||
|
||||
@@ -148,7 +148,7 @@ sub save_schedule {
|
||||
'nextDay'
|
||||
)
|
||||
{
|
||||
$entry->{$attr} = $params->{$attr} if ( defined $params->{$attr} );
|
||||
$entry->{$attr} = $params->{$attr} if defined $params->{$attr};
|
||||
}
|
||||
|
||||
unless ( project::is_series_assigned( $config, $entry ) == 1 ) {
|
||||
|
||||
@@ -119,11 +119,11 @@ sub save_schedule {
|
||||
|
||||
my $entry = {};
|
||||
for my $attr ( 'project_id', 'start', 'end', 'end_date', 'frequency' ) {
|
||||
$entry->{$attr} = $params->{$attr} if ( defined $params->{$attr} );
|
||||
$entry->{$attr} = $params->{$attr} if defined $params->{$attr};
|
||||
}
|
||||
|
||||
#set schedule's studio to value from schedule_studio_id
|
||||
$entry->{studio_id} = $params->{schedule_studio_id} if ( defined $params->{schedule_studio_id} );
|
||||
$entry->{studio_id} = $params->{schedule_studio_id} if defined $params->{schedule_studio_id};
|
||||
|
||||
if ( ( $entry->{end} ne '' ) && ( $entry->{end} le $entry->{start} ) ) {
|
||||
uac::print_error('start date should be before end date!');
|
||||
|
||||
@@ -327,7 +327,7 @@ sub update_user_roles {
|
||||
my $message =
|
||||
"remove role '$role->{role}' (level $role->{level}) from user $user_id (level $max_user_level) for studio_id=$studio_id, project_id=$project_id. Your level is $max_level";
|
||||
my $update = 0;
|
||||
$update = 1 if ( defined $permissions->{is_admin} );
|
||||
$update = 1 if defined $permissions->{is_admin};
|
||||
$update = 1
|
||||
if ( ( $role_by_id->{ $user_role->{role_id} }->{level} < $max_level )
|
||||
&& ( $max_user_level < $max_level ) );
|
||||
@@ -365,7 +365,7 @@ sub update_user_roles {
|
||||
|
||||
# print "user role id: $role->{id}<br>\n";
|
||||
my $update = 0;
|
||||
$update = 1 if ( defined $permissions->{is_admin} );
|
||||
$update = 1 if defined $permissions->{is_admin};
|
||||
$update = 1
|
||||
if ( ( $role_by_id->{ $role->{id} }->{level} < $max_level )
|
||||
&& ( $max_user_level < $max_level ) );
|
||||
|
||||
@@ -94,7 +94,7 @@ sub save_schedule {
|
||||
'type'
|
||||
)
|
||||
{
|
||||
$entry->{$attr} = $params->{$attr} if ( defined $params->{$attr} );
|
||||
$entry->{$attr} = $params->{$attr} if defined $params->{$attr};
|
||||
}
|
||||
|
||||
my $found = 0;
|
||||
|
||||
Reference in New Issue
Block a user