CC-3094 : Rebroadcast editing problems
This commit is contained in:
parent
b7a9e89095
commit
878fa3461d
2 changed files with 38 additions and 33 deletions
|
@ -566,7 +566,7 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
$i = 1;
|
$i = 1;
|
||||||
foreach ($rebroadcastsAbsolute as $rebroadcast){
|
foreach ($rebroadcastsAbsolute as $rebroadcast){
|
||||||
$rebroadcastAbsoluteFormValues["add_show_rebroadcast_date_absolute_$i"] = $rebroadcast['start_date'];
|
$rebroadcastAbsoluteFormValues["add_show_rebroadcast_date_absolute_$i"] = $rebroadcast['start_date'];
|
||||||
$rebroadcastAbsoluteFormValues["add_show_rebroadcast_time_absolute_$i"] = Application_Model_DateHelper::removeSecondsFromTime($rebroadcast['start_time']);
|
$rebroadcastAbsoluteFormValues["add_show_rebroadcast_time_absolute_$i"] = $rebroadcast['start_time'];
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$formAbsoluteRebroadcast->populate($rebroadcastAbsoluteFormValues);
|
$formAbsoluteRebroadcast->populate($rebroadcastAbsoluteFormValues);
|
||||||
|
|
|
@ -278,22 +278,27 @@ class Application_Model_Show {
|
||||||
global $CC_DBC;
|
global $CC_DBC;
|
||||||
|
|
||||||
$showId = $this->getId();
|
$showId = $this->getId();
|
||||||
$sql = "SELECT date(starts) "
|
|
||||||
."FROM cc_show_instances "
|
|
||||||
."WHERE show_id = $showId "
|
|
||||||
."AND record = 1 "
|
|
||||||
."AND modified_instance != TRUE";
|
|
||||||
$baseDate = $CC_DBC->GetOne($sql);
|
|
||||||
|
|
||||||
if (is_null($baseDate)){
|
$sql = "SELECT starts FROM cc_show_instances "
|
||||||
return array();
|
."WHERE instance_id = $showId "
|
||||||
|
."ORDER BY starts";
|
||||||
|
|
||||||
|
$rebroadcasts = $CC_DBC->GetAll($sql);
|
||||||
|
|
||||||
|
$rebroadcastsLocal = array();
|
||||||
|
//get each rebroadcast show in cc_show_instances, convert to current timezone to get start date/time.
|
||||||
|
$i = 0;
|
||||||
|
foreach ($rebroadcasts as $show) {
|
||||||
|
$startDateTime = new DateTime($show["starts"], new DateTimeZone("UTC"));
|
||||||
|
$startDateTime->setTimezone(new DateTimeZone(date_default_timezone_get()));
|
||||||
|
|
||||||
|
$rebroadcastsLocal[$i]["start_date"] = $startDateTime->format("Y-m-d");
|
||||||
|
$rebroadcastsLocal[$i]["start_time"] = $startDateTime->format("H:i");
|
||||||
|
|
||||||
|
$i = $i + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT date(DATE '$baseDate' + day_offset::INTERVAL) as start_date, start_time FROM cc_show_rebroadcast "
|
return $rebroadcastsLocal;
|
||||||
."WHERE show_id = $showId "
|
|
||||||
."ORDER BY start_date";
|
|
||||||
|
|
||||||
return $CC_DBC->GetAll($sql);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue