check hide image definition, show ongoing uploads in calendar, reenable working times

This commit is contained in:
Milan
2018-04-18 00:59:01 +02:00
parent 777a49c371
commit fffd6e4192
8 changed files with 32 additions and 4 deletions

View File

@@ -1211,7 +1211,7 @@ sub render {
if ( $project->{name} ne '' );
$template_parameters->{controllers} = $config->{controllers};
$template_parameters->{hide_event_images}=1 if $config->{permissions}->{hide_event_images} == 1;
$template_parameters->{hide_event_images}=1 if (defined $config->{permissions}->{hide_event_images}) && ($config->{permissions}->{hide_event_images} == 1);
# use Data::Dumper;print STDERR Dumper($template_parameters)."\n";
template::process( $_[0], $params->{template}, $template_parameters );

View File

@@ -145,7 +145,7 @@ sub get_series{
my $condition=shift;
my $date_range_include=0;
$date_range_include=1 if $condition->{date_range_include}==1;
$date_range_include=1 if (defined $condition->{date_range_include}) && ($condition->{date_range_include}==1);
my $dbh=db::connect($config);

View File

@@ -35,7 +35,7 @@ sub get{
my $condition=shift;
my $date_range_include=0;
$date_range_include=1 if $condition->{date_range_include}==1;
$date_range_include=1 if (defined $condition->{date_range_include}) && ($condition->{date_range_include}==1);
my $dbh=db::connect($config);

View File

@@ -40,7 +40,7 @@ sub get{
my $condition=shift;
my $date_range_include=0;
$date_range_include=1 if $condition->{date_range_include}==1;
$date_range_include=1 if (defined $condition->{date_range_include}) && ($condition->{date_range_include}==1);
my $dbh=db::connect($config);

View File

@@ -28,6 +28,7 @@ use markup;
use user_settings;
use localization;
use DateTime;
use audio_recordings;
binmode STDOUT, ":utf8";
@@ -423,9 +424,12 @@ sub showCalendar {
$events_by_start->{ $date->{start} }->{duration} = $date->{duration} || 0;
$events_by_start->{ $date->{start} }->{rms_left} = $date->{rms_left} || 0;
$events_by_start->{ $date->{start} }->{rms_right} = $date->{rms_right} || 0;
$events_by_start->{ $date->{start} }->{playout_modified_at} = $date->{modified_at};
$events_by_start->{ $date->{start} }->{playout_updated_at} = $date->{updated_at} ;
}
push @$events, $date;
}
}
#output
@@ -490,6 +494,15 @@ sub showCalendar {
}
}
for my $event (@$events){
next unless defined $event->{uploaded_at};
#print STDERR "uploadAt=$event->{uploaded_at}, playoutModified:$event->{playout_modified_at}, playoutUpdatedAt:$event->{playout_updated_at}\n";
next if (defined $event->{playout_updated_at}) && ( $event->{uploaded_at} lt $event->{playout_updated_at} );
#print STDERR Dumper($event);
$event->{upload} ='pending' ;
#$event->{title}.='<br>pending';
}
if ( $params->{list} == 1 ) {
showEventList( $config, $permissions, $params, $events_by_day );
} else {
@@ -1405,6 +1418,10 @@ sub print_event {
$attr .= ' start="' . $event->{start} . '"' if defined $event->{start};
}
if (defined $event->{upload}){
$content.='<br>uploading <progress max="10" ></progress> ';
}
if ($showIcons) {
$content = '<div class="text">' . $content . '</div><div class="icons"></div>';
}
@@ -1734,6 +1751,7 @@ sub getSeriesEvents {
#get events (directly from database to get the ones, not assigned, yet)
delete $options->{studio_id};
delete $options->{project_id};
$options->{recordings}=1;
my $request2 = {
params => {

View File

@@ -52,3 +52,6 @@ msgstr "Hilfe"
msgid "images"
msgstr "Bilder"
msgid "schedule"
msgstr "Dienstplan"

View File

@@ -52,3 +52,6 @@ msgstr "Help"
msgid "images"
msgstr "Images"
msgid "schedule"
msgstr "roster"

View File

@@ -37,6 +37,10 @@
<div> <a href="projects.cgi?project_id=<TMPL_VAR project_id>&studio_id=<TMPL_VAR default_studio_id>"><TMPL_VAR .loc.projects></a> </div>
</TMPL_IF>
<TMPL_IF .allow.read_schedule>
<div> <a href="work_time.cgi?project_id=<TMPL_VAR project_id>&studio_id=<TMPL_VAR default_studio_id>"><TMPL_VAR .loc.schedule></a> </div>
</TMPL_IF>
<TMPL_IF .allow.update_image_others>
<div> <a href="image.cgi?project_id=<TMPL_VAR project_id>&studio_id=<TMPL_VAR default_studio_id>"><TMPL_VAR .loc.images></a> </div>
</TMPL_IF>