add draft status to events

This commit is contained in:
Milan
2018-01-25 20:50:44 +01:00
parent 459d36b7c7
commit 6222e2a63f
12 changed files with 101 additions and 28 deletions

View File

@@ -40,6 +40,5 @@ if ($0=~/comments.*?\.cgi$/){
print $output;
}
#do not delete last line
1;

View File

@@ -245,6 +245,8 @@ sub showCalendar {
delete $options->{till_date} if ( $params->{list} == 1 );
delete $options->{date_range_include} if ( $params->{list} == 1 );
}
$options->{draft}=0 unless $params->{list}==1;
#get events sorted by date
$events = getSeriesEvents( $config, $request, $options, $params );
@@ -723,6 +725,7 @@ sub showEventList {
<th class="episode">$params->{loc}->{label_episode}</th>
<th class="rerun" title="$params->{loc}->{label_rerun}"><img src="image/32/rerun.png"></th>
<th class="live" title="$params->{loc}->{label_live}"><img src="image/32/live.png"></th>
<th class="draft" title="$params->{loc}->{label_draft}"><img src="image/32/draft.png"></th>
<th class="archive" title="$params->{loc}->{label_archived}"><img src="image/32/archived.png"></th>
</tr>
</thead>
@@ -754,7 +757,7 @@ sub showEventList {
$class .= ' error' if defined $event->{error};
$class .= ' no_series' if ( ( $class eq 'event' ) && ( $event->{series_id} eq '-1' ) );
for my $filter ( 'rerun', 'archived', 'playout', 'published', 'live', 'disable_event_sync' ) {
for my $filter ( 'rerun', 'archived', 'playout', 'published', 'live', 'disable_event_sync', 'draft' ) {
$class .= ' ' . $filter if ( ( defined $event->{$filter} ) && ( $event->{$filter} eq '1' ) );
}
$class .= ' preproduced' unless ( ( defined $event->{'live'} ) && ( $event->{'live'} eq '1' ) );
@@ -772,7 +775,8 @@ sub showEventList {
$event->{user_title} ||= '';
$event->{episode} ||= '';
$event->{rerun} ||= '';
$id ||= '';
$event->{draft} ||= '';
$id ||= '';
$class ||= '';
my $archived = $event->{archived} || '-';
@@ -790,6 +794,11 @@ sub showEventList {
$rerun = " [" . markup::base26( $event->{recurrence_count} + 1 ) . "]"
if ( defined $event->{recurrence_count} ) && ( $event->{recurrence_count} ne '' ) && ( $event->{recurrence_count} > 0 );
my $draft = $event->{draft} || '0';
$draft='-' if $draft eq '0';
$draft='x' if $draft eq '1';
my $title = $event->{title};
$title .= ': ' . $event->{user_title} if $event->{user_title} ne '';
@@ -804,6 +813,7 @@ sub showEventList {
. qq!<td class="title">$title</td>!
. qq!<td class="episode">$event->{episode}</td>!
. qq!<td class="rerun">$rerun</td>!
. qq!<td class="draft">$draft</td>!
. qq!<td class="live">$live</td>!
. qq!<td class="archived">$archived</td>!
. qq!</tr>! . "\n";
@@ -1358,7 +1368,7 @@ sub print_event {
$class .= ' no_series' if ( ( $class eq 'event' ) && ( $event->{series_id} eq '-1' ) );
$class .= " error x$event->{error}" if defined $event->{error};
for my $filter ( 'rerun', 'archived', 'playout', 'published', 'live', 'disable_event_sync' ) {
for my $filter ( 'rerun', 'archived', 'playout', 'published', 'live', 'disable_event_sync', 'draft' ) {
$class .= ' ' . $filter if ( ( defined $event->{$filter} ) && ( $event->{$filter} eq '1' ) );
}
$class .= ' preproduced' unless ( ( defined $event->{'live'} ) && ( $event->{'live'} eq '1' ) );
@@ -1455,6 +1465,7 @@ sub find_errors {
next if defined $event->{grid};
next if defined $event->{work};
next if defined $event->{play};
next if (defined $event->{draft}) && ($event->{draft} == 1);
next unless defined $event->{ystart};
next unless defined $event->{yend};
$event->{check_errors} = 1;
@@ -1583,7 +1594,7 @@ sub printToolbar {
<select id="filter" name="filter" onchange="reloadCalendar()">
};
for my $filter ( 'no markup', 'conflicts', 'rerun', 'archived', 'playout', 'published', 'live', 'disable_event_sync' ) {
for my $filter ( 'no markup', 'conflicts', 'rerun', 'archived', 'playout', 'published', 'live', 'disable_event_sync', 'draft' ) {
my $key = $filter;
$key =~ s/ /_/g;
@@ -1733,6 +1744,7 @@ sub getSeriesEvents {
permissions => $request->{permissions}
};
$request2->{params}->{checked}->{published} = 'all';
$request2->{params}->{checked}->{draft} = '1' if $params->{list}==1;
delete $request2->{params}->{checked}->{exclude_locations}
if ( ( $params->{studio_id} == -1 ) && ( defined $request2->{params}->{checked}->{exclude_locations} ) );

View File

@@ -166,6 +166,7 @@ sub show_event {
unless ( defined $event ) {
uac::print_error("event not found");
}
#print STDERR "show:".Dumper($event->{draft});
my $editLock = 1;
if ( ( defined $permissions->{update_event_after_week} ) && ( $permissions->{update_event_after_week} eq '1' ) ) {
@@ -196,7 +197,8 @@ sub show_event {
#project_id => $params->{project_id},
#studio_id => $params->{studio_id},
#series_id => $params->{series_id},
event_id => $params->{source_event_id}
event_id => $params->{source_event_id},
draft => 0,
}
);
if ( defined $event2 ) {
@@ -582,6 +584,7 @@ sub save_event {
studio_id => $params->{studio_id},
series_id => $params->{series_id},
event_id => $params->{event_id},
draft => $params->{draft},
start => $start,
end => $end,
};
@@ -616,7 +619,7 @@ sub save_event {
}
#status field
for my $key ( 'live', 'published', 'playout', 'archived', 'rerun', 'disable_event_sync' ) {
for my $key ( 'live', 'published', 'playout', 'archived', 'rerun', 'disable_event_sync', 'draft' ) {
next unless defined $permissions->{ 'update_event_status_' . $key };
if ( $permissions->{ 'update_event_status_' . $key } eq '1' ) {
$entry->{$key} = $params->{$key} || 0;
@@ -717,8 +720,9 @@ sub create_event {
studio_id => $params->{studio_id},
series_id => $params->{series_id},
start_date => $params->{start_date},
draft => $params->{draft},
start => $start,
end => $end
end => $end,
}
);
@@ -942,9 +946,10 @@ sub check_params {
}
#checkboxes
for my $param ( 'live', 'published', 'playout', 'archived', 'rerun', 'disable_event_sync', 'get_rerun' ) {
for my $param ( 'live', 'published', 'playout', 'archived', 'rerun', 'draft', 'disable_event_sync', 'get_rerun' ) {
if ( ( defined $params->{$param} ) && ( $params->{$param} =~ /([01])/ ) ) {
$checked->{$param} = $1;
# print STDERR "check $param = $1\n";
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 B

View File

@@ -111,6 +111,8 @@ sub show_events {
studio_id => $params->{studio_id},
from_date => time::time_to_date(),
till_date => time::time_to_date( time() + $duration * 24 * 60 * 60 ),
draft => 0,
published => 1
};
my $events = series::get_events( $config, $options );
@@ -158,6 +160,8 @@ sub sendMail {
studio_id => $params->{studio_id},
series_id => $params->{series_id},
event_id => $params->{event_id},
draft => 0,
published => 0,
};
my $events = series::get_events( $config, $options );

View File

@@ -69,6 +69,7 @@ print "Content-type:text/html; charset=UTF-8;\n\n";
return unless uac::check( $config, $params, $user_presets ) == 1;
show_events( $config, $request );
#TODO: filter by published, draft
sub show_events {
my $config = shift;
my $request = shift;