remove debug output in comments
This commit is contained in:
@@ -100,8 +100,6 @@ sub get($$) {
|
||||
$whereClause
|
||||
order by created_at desc
|
||||
};
|
||||
|
||||
#print STDERR Dumper($query).Dumper($bind_values);
|
||||
my $entries = db::get( $dbh, $query, $bind_values );
|
||||
return $entries;
|
||||
}
|
||||
@@ -112,8 +110,6 @@ sub update($$$) {
|
||||
my $dbh = shift;
|
||||
my $entry = shift;
|
||||
|
||||
#print STDERR "update:".Dumper($entry);
|
||||
|
||||
my $day_start = $config->{date}->{day_starting_hour};
|
||||
|
||||
my $bind_values = [
|
||||
@@ -140,8 +136,6 @@ sub update($$$) {
|
||||
$query .= ' and id=?';
|
||||
push @$bind_values, $entry->{id};
|
||||
}
|
||||
|
||||
#print STDERR Dumper($query).Dumper($bind_values);
|
||||
return db::put( $dbh, $query, $bind_values );
|
||||
}
|
||||
|
||||
@@ -156,7 +150,6 @@ sub insert ($$$) {
|
||||
return undef unless defined $entry->{event_id};
|
||||
return undef unless defined $entry->{path};
|
||||
|
||||
#print STDERR "insert into audio_recordings:".Dumper($entry);
|
||||
return db::insert(
|
||||
$dbh,
|
||||
'calcms_audio_recordings',
|
||||
|
||||
@@ -26,14 +26,10 @@ sub get_cached_or_render($$$;$) {
|
||||
my $mark_locked = $_[3];
|
||||
|
||||
my $params = $request->{params}->{checked};
|
||||
|
||||
#print STDERR Dumper($params);
|
||||
$config->{app_name} = $config->{controllers}->{comments};
|
||||
|
||||
my $comment = $request->{params}->{checked};
|
||||
|
||||
my $filename = '';
|
||||
|
||||
my $results = comments::get( $config, $request );
|
||||
|
||||
if ( ( defined $mark_locked ) && ( $mark_locked eq 'mark_locked' ) ) {
|
||||
@@ -78,16 +74,9 @@ sub get($$) {
|
||||
my $request = shift;
|
||||
|
||||
my $params = $request->{params}->{checked};
|
||||
|
||||
my $dbh = db::connect( $config, $request );
|
||||
|
||||
( my $query, my $bind_values ) = comments::get_query( $dbh, $config, $request );
|
||||
|
||||
#print STDERR Dumper($$query);
|
||||
#print STDERR Dumper($bind_values);
|
||||
my $results = db::get( $dbh, $$query, $bind_values );
|
||||
|
||||
#print STDERR Dumper($results);
|
||||
return $results;
|
||||
}
|
||||
|
||||
@@ -349,10 +338,7 @@ sub get_by_event($$$) {
|
||||
order by created_at $sort_order
|
||||
$limit
|
||||
};
|
||||
|
||||
#print STDERR $query."\n";
|
||||
my $comments = db::get( $dbh, $query, $bind_values );
|
||||
|
||||
return $comments;
|
||||
}
|
||||
|
||||
@@ -593,8 +579,6 @@ sub sort($$) {
|
||||
push @root_nodes, $node if ( $node->{level} == 0 );
|
||||
}
|
||||
|
||||
#print STDERR Dumper(\@root_nodes);
|
||||
|
||||
#sort root nodes from newest to oldest
|
||||
my $sorted_nodes = [];
|
||||
for my $node (@root_nodes) {
|
||||
|
||||
@@ -75,8 +75,6 @@ sub get ($$){
|
||||
$limit
|
||||
};
|
||||
|
||||
#print STDERR Dumper($query).Dumper(\@bind_values);
|
||||
|
||||
my $changes = db::get( $dbh, $query, \@bind_values );
|
||||
|
||||
for my $change (@$changes) {
|
||||
|
||||
@@ -62,14 +62,8 @@ sub get($$) {
|
||||
my $dbh = db::connect( $config, $request );
|
||||
|
||||
( my $query, my $bind_values ) = events::get_query( $dbh, $config, $request );
|
||||
|
||||
#print STDERR Dumper($query).Dumper($bind_values)."\n";
|
||||
|
||||
my $results = db::get( $dbh, $$query, $bind_values );
|
||||
|
||||
#$results = events::add_recordings($dbh, $config, $request, $results);
|
||||
|
||||
#print STDERR Dumper($results);
|
||||
$results = events::modify_results( $dbh, $config, $request, $results );
|
||||
|
||||
return $results;
|
||||
@@ -301,10 +295,6 @@ sub modify_results ($$$$) {
|
||||
|
||||
#$result->{'project_title'}=$project->{title} if (defined $project->{title} && $project->{title} ne '');
|
||||
|
||||
#print STDERR "project:'$project_name'\n";
|
||||
#print STDERR "title:'$result->{project_title}'\n";
|
||||
#use Data::Dumper;print STDERR Dumper($result);
|
||||
|
||||
for my $name ( keys %{ $config->{mapping}->{events} } ) {
|
||||
my $val = '';
|
||||
if ( ( defined $name )
|
||||
@@ -323,8 +313,6 @@ sub modify_results ($$$$) {
|
||||
|
||||
$previous_result = $result;
|
||||
|
||||
#print "Content-type:text/text\n\n";
|
||||
#use Data::Dumper;print STDERR Dumper($result);
|
||||
$result->{ 'counter_' . $counter } = 1;
|
||||
$counter++;
|
||||
|
||||
@@ -418,8 +406,6 @@ sub add_recurrence_dates {
|
||||
where id in ($conditions)
|
||||
};
|
||||
|
||||
#print STDERR Dumper($query);
|
||||
#return;
|
||||
my $dbh = db::connect($config);
|
||||
my $events = db::get( $dbh, $query, $bind_values );
|
||||
|
||||
@@ -436,7 +422,6 @@ sub add_recurrence_dates {
|
||||
$recurrence_dates->{ $result->{recurrence} };
|
||||
}
|
||||
|
||||
#print STDERR Dumper($recurrence_dates);
|
||||
}
|
||||
|
||||
sub calc_dates {
|
||||
@@ -549,7 +534,6 @@ sub add_recordings($$$$) {
|
||||
my $request = shift;
|
||||
my $events = shift;
|
||||
|
||||
# print STDERR Dumper($results);
|
||||
return $events unless defined $events;
|
||||
|
||||
my $params = $request->{params}->{checked};
|
||||
@@ -580,8 +564,6 @@ sub add_recordings($$$$) {
|
||||
$dbh = db::connect($config) unless defined $dbh;
|
||||
my $recordings = db::get( $dbh, $query, $bindValues );
|
||||
|
||||
#print STDERR Dumper($recordings);
|
||||
|
||||
for my $entry (@$recordings) {
|
||||
my $eventId = $entry->{event_id};
|
||||
my $event = $eventsById->{$eventId};
|
||||
|
||||
@@ -91,8 +91,6 @@ sub get($$) {
|
||||
$limit
|
||||
};
|
||||
|
||||
#print STDERR Dumper($query).Dumper($bind_values);
|
||||
|
||||
my $dbh = db::connect($config);
|
||||
my $results = db::get( $dbh, $query, $bind_values );
|
||||
|
||||
@@ -147,8 +145,6 @@ sub insert ($$) {
|
||||
values( } . join( ', ', ( map { '?' } @sql_columns ) ) . q{ )
|
||||
};
|
||||
my @bind_values = map { $image->{$_} } @sql_columns;
|
||||
|
||||
#print STDERR Dumper($query).Dumper(\@bind_values);
|
||||
my $result = db::put( $dbh, $query, \@bind_values );
|
||||
|
||||
images::setSeriesLabels( $dbh, $image );
|
||||
@@ -208,8 +204,6 @@ sub update($$) {
|
||||
set $set
|
||||
where $conditions
|
||||
};
|
||||
|
||||
#print STDERR Dumper($query) . Dumper($bind_values);
|
||||
my $result = db::put( $dbh, $query, $bind_values );
|
||||
|
||||
images::setSeriesLabels( $dbh, $image );
|
||||
@@ -253,8 +247,6 @@ sub delete($$) {
|
||||
delete from calcms_images
|
||||
where $conditions
|
||||
};
|
||||
|
||||
#print STDERR Dumper($query).Dumper($bind_values);
|
||||
return db::put( $dbh, $query, $bind_values );
|
||||
}
|
||||
|
||||
@@ -499,12 +491,7 @@ sub setEventLabels($$) {
|
||||
where image=?
|
||||
};
|
||||
my $bind_values = [ $image->{licence}, $image->{filename} ];
|
||||
|
||||
#print STDERR Dumper($query) . Dumper($bind_values);
|
||||
|
||||
my $results = db::put( $dbh, $query, $bind_values );
|
||||
|
||||
#print STDERR Dumper($results) . " changes\n";
|
||||
return $results;
|
||||
}
|
||||
|
||||
@@ -531,12 +518,7 @@ sub setSeriesLabels($$) {
|
||||
where series_image=?
|
||||
};
|
||||
my $bind_values = [ $image->{licence}, $image->{filename} ];
|
||||
|
||||
#print STDERR Dumper($query) . Dumper($bind_values);
|
||||
|
||||
my $results = db::put( $dbh, $query, $bind_values );
|
||||
|
||||
#print STDERR Dumper($results) . " changes\n";
|
||||
return $results;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,8 +22,6 @@ sub get($$) {
|
||||
my $config = shift;
|
||||
my $options = shift;
|
||||
|
||||
#print STDERR Dumper($options);
|
||||
|
||||
#get pot file
|
||||
unless ( defined $options->{file} ) {
|
||||
print STDERR "missing po file\n";
|
||||
|
||||
@@ -129,7 +129,6 @@ sub get_scheduled($$) {
|
||||
$limit
|
||||
};
|
||||
|
||||
#print STDERR Dumper($query).Dumper(\@bind_values);
|
||||
my $entries = db::get( $dbh, $query, \@bind_values );
|
||||
return $entries;
|
||||
}
|
||||
@@ -230,7 +229,6 @@ sub get($$) {
|
||||
$limit
|
||||
};
|
||||
|
||||
#print STDERR Dumper($query).Dumper(\@bind_values);
|
||||
my $entries = db::get( $dbh, $query, \@bind_values );
|
||||
return $entries;
|
||||
}
|
||||
@@ -241,7 +239,6 @@ sub sync ($$) {
|
||||
my $config = shift;
|
||||
my $options = shift;
|
||||
|
||||
#print STDERR Dumper($config);
|
||||
print STDERR "upload " . Dumper($options);
|
||||
return undef unless defined $options->{project_id};
|
||||
return undef unless defined $options->{studio_id};
|
||||
@@ -489,14 +486,11 @@ sub getEnd ($$) {
|
||||
my @start = @{ time::datetime_to_array($start) };
|
||||
next unless @start >= 6;
|
||||
|
||||
#print STDERR Dumper(\@start);
|
||||
my @end_datetime = Date::Calc::Add_Delta_DHMS(
|
||||
$start[0], $start[1], $start[2], # start date
|
||||
$start[3], $start[4], $start[5], # start time
|
||||
0, 0, 0, int($duration) # delta days, hours, minutes, seconds
|
||||
);
|
||||
|
||||
#print STDERR Dumper(\@end_datetime);
|
||||
return time::array_to_datetime( \@end_datetime );
|
||||
}
|
||||
|
||||
|
||||
@@ -73,8 +73,6 @@ sub get ($;$) {
|
||||
$limit
|
||||
};
|
||||
|
||||
#print STDERR Dumper($query).Dumper(\@bind_values);
|
||||
|
||||
my $projects = db::get( $dbh, $query, \@bind_values );
|
||||
return $projects;
|
||||
}
|
||||
@@ -144,8 +142,6 @@ sub update($$) {
|
||||
set $values
|
||||
where project_id=?
|
||||
};
|
||||
|
||||
#print STDERR Dumper($query).Dumper(\@bind_values);
|
||||
my $dbh = db::connect($config);
|
||||
db::put( $dbh, $query, \@bind_values );
|
||||
}
|
||||
|
||||
@@ -122,13 +122,10 @@ sub get ($$) {
|
||||
my $dbh = db::connect($config);
|
||||
my $series = db::get( $dbh, $query, \@bind_values );
|
||||
|
||||
#print STDERR Dumper(time());
|
||||
for my $serie (@$series) {
|
||||
$serie->{series_id} = $serie->{id};
|
||||
delete $serie->{id};
|
||||
}
|
||||
|
||||
#print STDERR Dumper($series);
|
||||
return $series;
|
||||
}
|
||||
|
||||
@@ -137,7 +134,6 @@ sub insert ($$) {
|
||||
my $config = shift;
|
||||
my $series = shift;
|
||||
|
||||
#print STDERR Dumper($series);
|
||||
return undef unless defined $series->{project_id};
|
||||
return undef unless defined $series->{studio_id};
|
||||
|
||||
@@ -155,8 +151,6 @@ sub insert ($$) {
|
||||
$entry->{created_at} = time::time_to_datetime( time() );
|
||||
$entry->{modified_at} = time::time_to_datetime( time() );
|
||||
|
||||
#print STDERR Dumper($entry);
|
||||
|
||||
my $dbh = db::connect($config);
|
||||
my $series_id = db::insert( $dbh, 'calcms_series', $entry );
|
||||
|
||||
@@ -204,8 +198,6 @@ sub update ($$) {
|
||||
where id=?
|
||||
};
|
||||
|
||||
#print STDERR Dumper($query).Dumper(\@bind_values);
|
||||
|
||||
my $dbh = db::connect($config);
|
||||
return db::put( $dbh, $query, \@bind_values );
|
||||
}
|
||||
@@ -453,8 +445,6 @@ sub search_events ($$$) {
|
||||
}
|
||||
|
||||
my $checked_params = events::check_params( $config, $params );
|
||||
|
||||
#print STDERR '<pre>'.Dumper($checked_params).'</pre>';
|
||||
my $request2 = {
|
||||
params => {
|
||||
checked => $checked_params
|
||||
@@ -464,10 +454,7 @@ sub search_events ($$$) {
|
||||
};
|
||||
|
||||
#my $debug=1;
|
||||
#print STDERR Dumper($request2->{params});
|
||||
my $events = events::get( $config, $request2 );
|
||||
|
||||
#print Dumper($events);
|
||||
return $events;
|
||||
}
|
||||
|
||||
@@ -476,7 +463,6 @@ sub get_events ($$) {
|
||||
my $config = shift;
|
||||
my $options = shift;
|
||||
|
||||
#print STDERR Dumper($options);
|
||||
return [] if defined( $options->{series_id} ) && ( $options->{series_id} <= 0 );
|
||||
|
||||
my @conditions = ();
|
||||
@@ -545,13 +531,8 @@ sub get_events ($$) {
|
||||
$limit
|
||||
};
|
||||
|
||||
#print STDERR '<pre>'.$query.Dumper(\@bind_values).'</pre>';
|
||||
|
||||
my $dbh = db::connect($config);
|
||||
my $results = db::get( $dbh, $query, \@bind_values );
|
||||
|
||||
#print STDERR Dumper($results);
|
||||
|
||||
$results = events::modify_results(
|
||||
$dbh, $config,
|
||||
{
|
||||
@@ -576,7 +557,6 @@ sub get_events ($$) {
|
||||
$result->{studio_id} = $studio_id_by_location->{ $result->{location} };
|
||||
}
|
||||
|
||||
#print STDERR Dumper($results);
|
||||
return $results;
|
||||
}
|
||||
|
||||
@@ -652,7 +632,6 @@ sub get_event_age($$) {
|
||||
my $config = shift;
|
||||
my $options = shift;
|
||||
|
||||
#print STDERR Dumper($options);
|
||||
return undef unless defined $options->{project_id};
|
||||
return undef unless defined $options->{studio_id};
|
||||
|
||||
@@ -709,8 +688,6 @@ sub is_event_older_than_days ($$) {
|
||||
my $config = shift;
|
||||
my $options = shift;
|
||||
|
||||
#print STDERR Dumper($options);
|
||||
|
||||
return 1 unless defined $options->{project_id};
|
||||
return 1 unless defined $options->{studio_id};
|
||||
return 1 unless defined $options->{series_id};
|
||||
@@ -733,8 +710,6 @@ sub is_event_older_than_days ($$) {
|
||||
return 1;
|
||||
}
|
||||
my $event = $events->[0];
|
||||
|
||||
#print STDERR Dumper($event);
|
||||
return 1 if $event->{days_over} > $options->{max_age};
|
||||
return 0;
|
||||
}
|
||||
@@ -759,8 +734,6 @@ sub get_next_episode($$) {
|
||||
return 0 if ( @$results != 1 );
|
||||
return 0 if ( $results->[0]->{count_episodes} eq '0' );
|
||||
|
||||
#print STDERR Dumper($results);
|
||||
|
||||
#get all
|
||||
$query = q{
|
||||
select title,episode from calcms_events e, calcms_series_events se
|
||||
@@ -836,10 +809,7 @@ sub get_images ($$) {
|
||||
$limit
|
||||
};
|
||||
|
||||
#print STDERR Dumper($query).Dumper($bind_values);
|
||||
my $results = db::get( $dbh, $query, $bind_values );
|
||||
|
||||
#print STDERR @$results."\n";
|
||||
return $results;
|
||||
}
|
||||
|
||||
@@ -849,7 +819,6 @@ sub assign_event($$) {
|
||||
my $config = shift;
|
||||
my $entry = shift;
|
||||
|
||||
#print STDERR Dumper($entry);
|
||||
return undef unless defined $entry->{project_id};
|
||||
return undef unless defined $entry->{studio_id};
|
||||
return undef unless defined $entry->{series_id};
|
||||
@@ -1147,7 +1116,6 @@ sub is_event_assigned_to_user ($$) {
|
||||
}
|
||||
);
|
||||
|
||||
#print STDERR Dumper(@$events);
|
||||
return
|
||||
"no event found for"
|
||||
. " project $options->{project_id},"
|
||||
@@ -1206,7 +1174,6 @@ sub get_rebuilt_episodes ($$) {
|
||||
$done->{$event2->{id}}=1;
|
||||
};
|
||||
}
|
||||
#print STDERR Dumper($events);
|
||||
return $events;
|
||||
}
|
||||
|
||||
|
||||
@@ -104,9 +104,6 @@ sub get ($;$) {
|
||||
order by start
|
||||
};
|
||||
|
||||
#print STDERR $query."\n";
|
||||
#print STDERR Dumper(\@bind_values);
|
||||
|
||||
my $entries = db::get( $dbh, $query, \@bind_values );
|
||||
for my $entry (@$entries) {
|
||||
$entry->{weekday} = substr( $entry->{weekday}, 0, 2 );
|
||||
@@ -331,8 +328,6 @@ sub update($$) {
|
||||
for my $date (@$dates) {
|
||||
$date->{exclude} = 0;
|
||||
$series_dates->{ $date->{start} } = $date;
|
||||
|
||||
#print STDERR Dumper($date)."\n" if ($date->{start} eq'2014-02-05 19:00:00');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -342,13 +337,9 @@ sub update($$) {
|
||||
for my $date (@$dates) {
|
||||
$date->{exclude} = 1;
|
||||
$series_dates->{ $date->{start} } = $date;
|
||||
|
||||
#print STDERR Dumper($date)."\n" if ($date->{start} eq'2014-02-05 19:00:00');
|
||||
}
|
||||
}
|
||||
|
||||
#print STDERR Dumper($series_dates->{'2014-02-05 19:00:00'});
|
||||
|
||||
my $request = { config => $config };
|
||||
|
||||
my $i = 0;
|
||||
@@ -370,13 +361,9 @@ sub update($$) {
|
||||
$entry->{start_date} = time::add_hours_to_datetime( $entry->{start}, -$day_start );
|
||||
$entry->{end_date} = time::add_hours_to_datetime( $entry->{end}, -$day_start );
|
||||
db::insert( $dbh, 'calcms_series_dates', $entry );
|
||||
|
||||
#print STDERR "$entry->{start_date}\n";
|
||||
$i++;
|
||||
} else {
|
||||
$j++;
|
||||
|
||||
#print STDERR Dumper($entry);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,6 @@ sub save_content($$) {
|
||||
$entry->{$attr} = images::normalizeName( $entry->{$attr} ) if defined $entry->{$attr};
|
||||
}
|
||||
|
||||
#print STDERR Dumper(\$entry->{content});
|
||||
for my $attr ( 'content', 'topic' ) {
|
||||
if ( defined $entry->{$attr} ) {
|
||||
$entry->{ 'html_' . $attr } = markup::creole_to_html( $entry->{$attr} );
|
||||
@@ -64,12 +63,7 @@ sub save_content($$) {
|
||||
}
|
||||
}
|
||||
|
||||
#print STDERR Dumper(\$entry->{series_image});
|
||||
#print STDERR "ok2\n";
|
||||
#return;
|
||||
$entry->{modified_at} = time::time_to_datetime( time() );
|
||||
|
||||
#return;
|
||||
#update only existing atributes
|
||||
|
||||
#TODO: double check series_name (needed for reassignment but not for editing...)
|
||||
@@ -207,10 +201,7 @@ sub set_playout_status ($$) {
|
||||
};
|
||||
my $bind_values = [ $entry->{start}, $entry->{project_id}, $entry->{studio_id} ];
|
||||
|
||||
#print STDERR Dumper($sql).Dumper($bind_values);
|
||||
my $events = db::get( $dbh, $sql, $bind_values );
|
||||
|
||||
#print STDERR Dumper($events);
|
||||
return undef if scalar(@$events) != 1;
|
||||
my $event_id = $events->[0]->{event_id};
|
||||
$sql = qq{
|
||||
@@ -220,8 +211,6 @@ sub set_playout_status ($$) {
|
||||
and start=?
|
||||
};
|
||||
$bind_values = [ $entry->{playout}, $event_id, $entry->{start} ];
|
||||
|
||||
#print STDERR $sql."\n".Dumper($bind_values)."\n";
|
||||
my $result = db::put( $dbh, $sql, $bind_values );
|
||||
return $result;
|
||||
}
|
||||
@@ -498,7 +487,6 @@ sub insert_event ($$) {
|
||||
$event->{created_at} = time::time_to_datetime( time() );
|
||||
$event->{modified_by} = $user;
|
||||
|
||||
#print STDERR Dumper($event);
|
||||
my $dbh = db::connect($config);
|
||||
my $event_id = db::insert( $dbh, 'calcms_events', $event );
|
||||
|
||||
|
||||
@@ -97,15 +97,11 @@ sub get($$) {
|
||||
order by exclude, start
|
||||
};
|
||||
|
||||
#print STDERR $query."\n".Dumper(\@bind_values);
|
||||
|
||||
my $entries = db::get( $dbh, $query, \@bind_values );
|
||||
for my $entry (@$entries) {
|
||||
$entry->{schedule_id} = $entry->{id};
|
||||
delete $entry->{id};
|
||||
}
|
||||
|
||||
#print STDERR Dumper($entries);
|
||||
return $entries;
|
||||
}
|
||||
|
||||
@@ -151,7 +147,6 @@ sub update($$) {
|
||||
where project_id=? and studio_id=? and id=?
|
||||
};
|
||||
|
||||
#print STDERR Dumper($query).Dumper(\@bind_values);
|
||||
db::put( $dbh, $query, \@bind_values );
|
||||
print "done\n";
|
||||
}
|
||||
|
||||
@@ -109,16 +109,12 @@ sub get ($$){
|
||||
order by start
|
||||
};
|
||||
|
||||
#print STDERR $query."\n";
|
||||
#print STDERR Dumper(\@bind_values);
|
||||
|
||||
my $entries = db::get( $dbh, $query, \@bind_values );
|
||||
for my $entry (@$entries) {
|
||||
$entry->{start_weekday} = substr( $entry->{start_weekday}, 0, 2 );
|
||||
$entry->{end_weekday} = substr( $entry->{end_weekday}, 0, 2 );
|
||||
}
|
||||
|
||||
#print STDERR Dumper($entries);
|
||||
return $entries;
|
||||
}
|
||||
|
||||
@@ -152,9 +148,7 @@ sub update {
|
||||
#calculate dates from start to end_date
|
||||
my $dateList = get_dates( $schedule->{start}, $schedule->{end}, $schedule->{end_date}, $schedule->{frequency} );
|
||||
|
||||
#print STDERR Dumper($dateList);
|
||||
for my $date (@$dateList) {
|
||||
|
||||
#set studio i from
|
||||
$date->{project_id} = $schedule->{project_id};
|
||||
$date->{studio_id} = $schedule->{studio_id};
|
||||
@@ -177,12 +171,8 @@ sub update {
|
||||
$entry->{start_date} = time::add_hours_to_datetime( $entry->{start}, -$day_start );
|
||||
$entry->{end_date} = time::add_hours_to_datetime( $entry->{end}, -$day_start );
|
||||
db::insert( $dbh, 'calcms_studio_timeslot_dates', $entry );
|
||||
|
||||
#print STDERR "$entry->{start_date}\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
#print STDERR "$i studio_timeslot_dates updates\n";
|
||||
return $i;
|
||||
}
|
||||
|
||||
@@ -266,8 +256,6 @@ sub get_dates {
|
||||
my @start_date = Date::Calc::Add_Delta_Days( $start[0], $start[1], $start[2], $i );
|
||||
my @end_date = Date::Calc::Add_Delta_Days( $end[0], $end[1], $end[2], $i );
|
||||
|
||||
#print STDERR Dumper(\@start_date);
|
||||
#print STDERR Dumper(\@end_date);
|
||||
my $start_date = sprintf( "%04d-%02d-%02d", @start_date );
|
||||
my $end_date = sprintf( "%04d-%02d-%02d", @end_date );
|
||||
push @$dates,
|
||||
@@ -350,11 +338,8 @@ sub can_studio_edit_events {
|
||||
$conditions
|
||||
};
|
||||
|
||||
#print STDERR Dumper($query).Dumper(\@bind_values);
|
||||
|
||||
my $entries = db::get( $dbh, $query, \@bind_values );
|
||||
|
||||
#print STDERR Dumper($entries);
|
||||
return 0 if scalar(@$entries) == 0;
|
||||
return 1 if $entries->[0]->{permission} > 0;
|
||||
|
||||
|
||||
@@ -74,8 +74,6 @@ sub get($;$) {
|
||||
};
|
||||
}
|
||||
my $dbh = db::connect($config);
|
||||
|
||||
#print STDERR Dumper($query).Dumper(\@bind_values);
|
||||
my $studios = db::get( $dbh, $query, \@bind_values );
|
||||
return $studios;
|
||||
}
|
||||
@@ -129,8 +127,6 @@ sub update ($$) {
|
||||
};
|
||||
|
||||
my $dbh = db::connect($config);
|
||||
|
||||
#print STDERR Dumper($query)." ".Dumper(\@bind_values);
|
||||
db::put( $dbh, $query, \@bind_values );
|
||||
}
|
||||
|
||||
|
||||
@@ -221,7 +221,6 @@ sub add_days_to_datetime($;$) {
|
||||
$days = 0 unless defined $days;
|
||||
my $time = datetime_to_array($datetime);
|
||||
|
||||
#print STDERR Dumper($time);
|
||||
( $time->[0], $time->[1], $time->[2] ) = Date::Calc::Add_Delta_Days( $time->[0] + 0, $time->[1] + 0, $time->[2] + 0, $days );
|
||||
return array_to_datetime($time);
|
||||
}
|
||||
|
||||
@@ -352,8 +352,6 @@ sub update_role($$) {
|
||||
where id=?
|
||||
};
|
||||
|
||||
# print $query."<br>\n".Dumper(\@bind_values)."<br>\ņ";
|
||||
|
||||
db::put( $dbh, $query, \@bind_values );
|
||||
}
|
||||
|
||||
@@ -554,7 +552,6 @@ sub assign_user_role($$) {
|
||||
my $config = shift;
|
||||
my $options = shift;
|
||||
|
||||
#print STDERR Dumper($options);
|
||||
return undef unless defined $options->{project_id};
|
||||
return undef unless defined $options->{studio_id};
|
||||
return undef unless defined $options->{user_id};
|
||||
@@ -600,10 +597,8 @@ sub remove_user_role($$) {
|
||||
};
|
||||
my $bind_values = [ $options->{project_id}, $options->{studio_id}, $options->{user_id}, $options->{role_id} ];
|
||||
|
||||
#print STDERR Dumper($query).Dumper($bind_values);
|
||||
my $dbh = db::connect($config);
|
||||
my $result = db::put( $dbh, $query, $bind_values );
|
||||
|
||||
# successfully return even if no entry exists
|
||||
return 1;
|
||||
}
|
||||
@@ -767,7 +762,6 @@ sub get_user_presets($$) {
|
||||
|
||||
my $logout_url = ( split( /\//, $0 ) )[-1];
|
||||
|
||||
#print STDERR "ok\n";
|
||||
my $result = {
|
||||
user => $user,
|
||||
logout_url => $logout_url,
|
||||
|
||||
@@ -200,7 +200,6 @@ sub update($$) {
|
||||
where user=?
|
||||
};
|
||||
|
||||
#print STDERR Dumper($query).Dumper(\@bind_values);
|
||||
db::put( $dbh, $query, \@bind_values );
|
||||
print "done\n";
|
||||
}
|
||||
|
||||
@@ -115,9 +115,6 @@ sub get ($$) {
|
||||
order by start
|
||||
};
|
||||
|
||||
#print STDERR $query."\n";
|
||||
#print STDERR Dumper(\@bind_values);
|
||||
|
||||
my $entries = db::get( $dbh, $query, \@bind_values );
|
||||
for my $entry (@$entries) {
|
||||
$entry->{weekday} = substr( $entry->{weekday}, 0, 2 );
|
||||
@@ -162,8 +159,6 @@ sub update($$) {
|
||||
for my $date (@$dates) {
|
||||
$date->{exclude} = 0;
|
||||
$work_dates->{ $date->{start} } = $date;
|
||||
|
||||
#print STDERR Dumper($date)."\n" if ($date->{start} eq'2014-02-05 19:00:00');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,15 +168,10 @@ sub update($$) {
|
||||
for my $date (@$dates) {
|
||||
$date->{exclude} = 1;
|
||||
$work_dates->{ $date->{start} } = $date;
|
||||
|
||||
#print STDERR Dumper($date)."\n" if ($date->{start} eq'2014-02-05 19:00:00');
|
||||
}
|
||||
}
|
||||
|
||||
#print STDERR Dumper($work_dates->{'2014-02-05 19:00:00'});
|
||||
|
||||
my $request = { config => $config };
|
||||
|
||||
my $i = 0;
|
||||
my $j = 0;
|
||||
for my $date ( keys %$work_dates ) {
|
||||
@@ -208,8 +198,6 @@ sub update($$) {
|
||||
$i++;
|
||||
} else {
|
||||
$j++;
|
||||
|
||||
#print STDERR Dumper($entry);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -382,8 +370,6 @@ sub delete($$) {
|
||||
where project_id=? and studio_id=? and schedule_id=?
|
||||
};
|
||||
my $bind_values = [ $entry->{project_id}, $entry->{studio_id}, $entry->{schedule_id} ];
|
||||
|
||||
#print '<pre>$query'.$query.Dumper($bind_values).'</pre>';
|
||||
return db::put( $dbh, $query, $bind_values );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user