Follow up changes relating to adding in new show repeat options

This commit is contained in:
Jamie Connor 2013-09-07 14:54:03 +12:00
parent 6da9b6bf42
commit f7f2cdc51c
3 changed files with 9 additions and 5 deletions

View File

@ -18,8 +18,8 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm
'multiOptions' => array( 'multiOptions' => array(
"0" => _("weekly"), "0" => _("weekly"),
"1" => _("every 2 weeks"), "1" => _("every 2 weeks"),
"3" => _("every 3 weeks"), "4" => _("every 3 weeks"),
"4" => _("every 4 weeks"), "5" => _("every 4 weeks"),
"2" => _("monthly") "2" => _("monthly")
), ),
)); ));

View File

@ -188,6 +188,10 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
$interval = 'P7D'; $interval = 'P7D';
} elseif ($formData["add_show_repeat_type"] == 1) { } elseif ($formData["add_show_repeat_type"] == 1) {
$interval = 'P14D'; $interval = 'P14D';
} elseif ($formData["add_show_repeat_type"] == 4) {
$interval = 'P21D';
} elseif ($formData["add_show_repeat_type"] == 5) {
$interval = 'P28D';
} elseif ($formData["add_show_repeat_type"] == 2) { } elseif ($formData["add_show_repeat_type"] == 2) {
$interval = 'P1M'; $interval = 'P1M';
} }

View File

@ -206,11 +206,11 @@ class Application_Service_ShowService
new DateInterval("P14D"), $daysAdded); new DateInterval("P14D"), $daysAdded);
break; break;
case REPEAT_TRI_WEEKLY: case REPEAT_TRI_WEEKLY:
$this->createWeeklyRepeatInstances($day, $populateUntil, REPEAT_BI_WEEKLY, $this->createWeeklyRepeatInstances($day, $populateUntil, REPEAT_TRI_WEEKLY,
new DateInterval("P21D"), $daysAdded); new DateInterval("P21D"), $daysAdded);
break; break;
case REPEAT_QUAD_WEEKLY: case REPEAT_QUAD_WEEKLY:
$this->createWeeklyRepeatInstances($day, $populateUntil, REPEAT_BI_WEEKLY, $this->createWeeklyRepeatInstances($day, $populateUntil, REPEAT_QUAD_WEEKLY,
new DateInterval("P28D"), $daysAdded); new DateInterval("P28D"), $daysAdded);
break; break;
case REPEAT_MONTHLY_MONTHLY: case REPEAT_MONTHLY_MONTHLY:
@ -343,7 +343,7 @@ SQL;
//if the start date changes, these are the repeat types //if the start date changes, these are the repeat types
//that require show instance deletion //that require show instance deletion
$deleteRepeatTypes = array(REPEAT_BI_WEEKLY, REPEAT_MONTHLY_MONTHLY, $deleteRepeatTypes = array(REPEAT_BI_WEEKLY, REPEAT_TRI_WEEKLY, REPEAT_QUAD_WEEKLY, REPEAT_MONTHLY_MONTHLY,
REPEAT_MONTHLY_WEEKLY); REPEAT_MONTHLY_WEEKLY);
if (in_array($this->repeatType, $deleteRepeatTypes) && if (in_array($this->repeatType, $deleteRepeatTypes) &&