CC-5323: User's Timezone Can Improperly Edit Show

-overlapping show check was using the user's local timezone to compare new
 shows instead of the show's timezone
This commit is contained in:
denise 2013-09-25 14:40:09 -04:00
parent 2666e97b7e
commit 3439611ef3
1 changed files with 6 additions and 6 deletions

View File

@ -167,7 +167,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
*/ */
if ($valid) { if ($valid) {
$utc = new DateTimeZone('UTC'); $utc = new DateTimeZone('UTC');
$localTimezone = new DateTimeZone(Application_Model_Preference::GetTimezone()); $showTimezone = new DateTimeZone($formData["add_show_timezone"]);
$show_start = new DateTime($start_time); $show_start = new DateTime($start_time);
$show_start->setTimezone($utc); $show_start->setTimezone($utc);
$show_end = new DateTime($end_time); $show_end = new DateTime($end_time);
@ -233,8 +233,8 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
* adding the interval for the next repeating show * adding the interval for the next repeating show
*/ */
$repeatShowStart->setTimezone($localTimezone); $repeatShowStart->setTimezone($showTimezone);
$repeatShowEnd->setTimezone($localTimezone); $repeatShowEnd->setTimezone($showTimezone);
$repeatShowStart->add(new DateInterval("P".$daysAdd."D")); $repeatShowStart->add(new DateInterval("P".$daysAdd."D"));
$repeatShowEnd->add(new DateInterval("P".$daysAdd."D")); $repeatShowEnd->add(new DateInterval("P".$daysAdd."D"));
//set back to UTC //set back to UTC
@ -273,8 +273,8 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
$this->getElement('add_show_duration')->setErrors(array(_('Cannot schedule overlapping shows'))); $this->getElement('add_show_duration')->setErrors(array(_('Cannot schedule overlapping shows')));
break 1; break 1;
} else { } else {
$repeatShowStart->setTimezone($localTimezone); $repeatShowStart->setTimezone($showTimezone);
$repeatShowEnd->setTimezone($localTimezone); $repeatShowEnd->setTimezone($showTimezone);
$repeatShowStart->add(new DateInterval($interval)); $repeatShowStart->add(new DateInterval($interval));
$repeatShowEnd->add(new DateInterval($interval)); $repeatShowEnd->add(new DateInterval($interval));
$repeatShowStart->setTimezone($utc); $repeatShowStart->setTimezone($utc);
@ -337,7 +337,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
* show start back to local time * show start back to local time
*/ */
$rebroadcastShowStart->setTimezone(new DateTimeZone( $rebroadcastShowStart->setTimezone(new DateTimeZone(
Application_Model_Preference::GetTimezone())); $formData["add_show_timezone"]));
$rebroadcastWhenDays = explode(" ", $formData["add_show_rebroadcast_date_".$i]); $rebroadcastWhenDays = explode(" ", $formData["add_show_rebroadcast_date_".$i]);
$rebroadcastWhenTime = explode(":", $formData["add_show_rebroadcast_time_".$i]); $rebroadcastWhenTime = explode(":", $formData["add_show_rebroadcast_time_".$i]);
$rebroadcastShowStart->add(new DateInterval("P".$rebroadcastWhenDays[0]."D")); $rebroadcastShowStart->add(new DateInterval("P".$rebroadcastWhenDays[0]."D"));