Fixed minor bugs
This commit is contained in:
parent
ef8af1b724
commit
a164416c84
|
@ -151,7 +151,11 @@ class Application_Service_CalendarService
|
||||||
"name" => _("Edit This Instance"),
|
"name" => _("Edit This Instance"),
|
||||||
"icon" => "edit",
|
"icon" => "edit",
|
||||||
"url" => $baseUrl."Schedule/populate-repeating-show-instance-form");
|
"url" => $baseUrl."Schedule/populate-repeating-show-instance-form");
|
||||||
|
} elseif ($populateInstance) {
|
||||||
|
$menu["edit"] = array(
|
||||||
|
"name" => _("Edit Show"),
|
||||||
|
"icon" => "edit",
|
||||||
|
"url" => $baseUrl."Schedule/populate-repeating-show-instance-form");
|
||||||
} else {
|
} else {
|
||||||
$menu["edit"] = array(
|
$menu["edit"] = array(
|
||||||
"name"=> _("Edit Show"),
|
"name"=> _("Edit Show"),
|
||||||
|
|
|
@ -83,12 +83,6 @@ class Application_Service_ShowService
|
||||||
}
|
}
|
||||||
/****** UPDATE SCHEDULE START TIME ENDS******/
|
/****** UPDATE SCHEDULE START TIME ENDS******/
|
||||||
|
|
||||||
/*
|
|
||||||
* Set the new cc_show_day record
|
|
||||||
* Associates it with the current show_id and sets it to non-repeating
|
|
||||||
*/
|
|
||||||
$this->setCcShowDays($showData);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* In the case where an instance is being edited for a second
|
* In the case where an instance is being edited for a second
|
||||||
* (or third, fourth, etc.) time we need to delete the old
|
* (or third, fourth, etc.) time we need to delete the old
|
||||||
|
@ -108,6 +102,18 @@ class Application_Service_ShowService
|
||||||
->filterByDbStartTime($origLocalStartDateTime->format("H:i:s"))
|
->filterByDbStartTime($origLocalStartDateTime->format("H:i:s"))
|
||||||
->delete();
|
->delete();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set the new cc_show_day record
|
||||||
|
* Associates it with the current show_id and sets it to non-repeating
|
||||||
|
*/
|
||||||
|
$this->setCcShowDays($showData);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set the new cc_show_day record
|
||||||
|
* Associates it with the current show_id and sets it to non-repeating
|
||||||
|
*/
|
||||||
|
$this->setCcShowDays($showData);
|
||||||
|
|
||||||
// DO WE NEED THIS?
|
// DO WE NEED THIS?
|
||||||
$this->setCcShowHosts($showData);
|
$this->setCcShowHosts($showData);
|
||||||
|
|
||||||
|
@ -120,7 +126,7 @@ class Application_Service_ShowService
|
||||||
->filterByDbShowId($showId)
|
->filterByDbShowId($showId)
|
||||||
->filterByDbRepeatType(-1)
|
->filterByDbRepeatType(-1)
|
||||||
->filterByDbFirstShow($showData["add_show_start_date"])
|
->filterByDbFirstShow($showData["add_show_start_date"])
|
||||||
->filterByDbStartTime($showData["add_show_start_time"])
|
->filterByDbStartTime($showData["add_show_start_time"].":00")
|
||||||
->findOne();
|
->findOne();
|
||||||
|
|
||||||
$ccShowInstance = $this->createNonRepeatingInstance($showDay,
|
$ccShowInstance = $this->createNonRepeatingInstance($showDay,
|
||||||
|
@ -138,6 +144,7 @@ class Application_Service_ShowService
|
||||||
->setDbLastScheduled(gmdate("Y-m-d H:i:s"))
|
->setDbLastScheduled(gmdate("Y-m-d H:i:s"))
|
||||||
->save();
|
->save();
|
||||||
$ccShowInstance->updateDbTimeFilled($con);
|
$ccShowInstance->updateDbTimeFilled($con);
|
||||||
|
$ccShowInstance->updateScheduleStatus($con);
|
||||||
|
|
||||||
//delete the edited instance from the repeating sequence
|
//delete the edited instance from the repeating sequence
|
||||||
$ccShowInstanceOrig->setDbModifiedInstance(true)->save();
|
$ccShowInstanceOrig->setDbModifiedInstance(true)->save();
|
||||||
|
@ -190,6 +197,7 @@ class Application_Service_ShowService
|
||||||
$this->setCcShow($showData);
|
$this->setCcShow($showData);
|
||||||
|
|
||||||
$daysAdded = array();
|
$daysAdded = array();
|
||||||
|
|
||||||
if ($this->isUpdate) {
|
if ($this->isUpdate) {
|
||||||
$daysAdded = $this->delegateInstanceCleanup($showData);
|
$daysAdded = $this->delegateInstanceCleanup($showData);
|
||||||
|
|
||||||
|
@ -456,7 +464,8 @@ SQL;
|
||||||
//and the repeat type changed
|
//and the repeat type changed
|
||||||
if ($currentRepeatType != -1 && $this->repeatType != $currentRepeatType) {
|
if ($currentRepeatType != -1 && $this->repeatType != $currentRepeatType) {
|
||||||
$this->deleteAllInstances($showId);
|
$this->deleteAllInstances($showId);
|
||||||
} else {
|
// when repeating by day of the month (1st, 2nd, etc.) we do not store the repeat week days
|
||||||
|
} elseif ($currentRepeatType != 2) {
|
||||||
//repeat type is the same, check if the days of the week are the same
|
//repeat type is the same, check if the days of the week are the same
|
||||||
$repeatingDaysChanged = false;
|
$repeatingDaysChanged = false;
|
||||||
|
|
||||||
|
@ -1018,7 +1027,9 @@ SQL;
|
||||||
if ($this->isUpdate) {
|
if ($this->isUpdate) {
|
||||||
if ($this->hasInstance($utcStartDateTime)) {
|
if ($this->hasInstance($utcStartDateTime)) {
|
||||||
$ccShowInstance = $this->getInstance($utcStartDateTime);
|
$ccShowInstance = $this->getInstance($utcStartDateTime);
|
||||||
if ($ccShowInstance->getDbModifiedInstance()) {
|
// don't update instances that have been edited out of the repeating sequence
|
||||||
|
if ($ccShowInstance->getDbModifiedInstance() ||
|
||||||
|
in_array($ccShowInstance->getDbId(), $this->ccShow->getEditedRepeatingInstanceIds())) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$newInstance = false;
|
$newInstance = false;
|
||||||
|
@ -1114,6 +1125,11 @@ SQL;
|
||||||
*/
|
*/
|
||||||
if ($this->isUpdate && $this->hasInstance($utcStartDateTime)) {
|
if ($this->isUpdate && $this->hasInstance($utcStartDateTime)) {
|
||||||
$ccShowInstance = $this->getInstance($utcStartDateTime);
|
$ccShowInstance = $this->getInstance($utcStartDateTime);
|
||||||
|
// don't update instances that have been edited out of the repeating sequence
|
||||||
|
if ($ccShowInstance->getDbModifiedInstance() ||
|
||||||
|
in_array($ccShowInstance->getDbId(), $this->ccShow->getEditedRepeatingInstanceIds())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$newInstance = false;
|
$newInstance = false;
|
||||||
$updateScheduleStatus = true;
|
$updateScheduleStatus = true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1395,8 +1411,6 @@ SQL;
|
||||||
*/
|
*/
|
||||||
private function setCcShowDays($showData)
|
private function setCcShowDays($showData)
|
||||||
{
|
{
|
||||||
Logging::info($showData);
|
|
||||||
Logging::info($this->repeatType);
|
|
||||||
$showId = $this->ccShow->getDbId();
|
$showId = $this->ccShow->getDbId();
|
||||||
|
|
||||||
$startDateTime = new DateTime($showData['add_show_start_date']." ".$showData['add_show_start_time']);
|
$startDateTime = new DateTime($showData['add_show_start_date']." ".$showData['add_show_start_time']);
|
||||||
|
@ -1424,6 +1438,7 @@ SQL;
|
||||||
if ($showData['add_show_repeats'] && $showData['add_show_repeat_type'] == 2) {
|
if ($showData['add_show_repeats'] && $showData['add_show_repeat_type'] == 2) {
|
||||||
|
|
||||||
if ($this->isUpdate) {
|
if ($this->isUpdate) {
|
||||||
|
//Logging::info(CcShowDaysQuery::create()->find());
|
||||||
$showDay = CcShowDaysQuery::create()
|
$showDay = CcShowDaysQuery::create()
|
||||||
->filterByDbShowId($showId)
|
->filterByDbShowId($showId)
|
||||||
->filterByDbRepeatType($showData['add_show_repeat_type'])
|
->filterByDbRepeatType($showData['add_show_repeat_type'])
|
||||||
|
|
Loading…
Reference in New Issue