diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index 992408bf3..674e5cf23 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -348,10 +348,11 @@ class ApiController extends Zend_Controller_Action $utcDayStart = Application_Common_DateHelper::ConvertToUtcDateTimeString($dayStart); $dow = array("monday", "tuesday", "wednesday", "thursday", "friday", - "saturday", "sunday"); + "saturday", "sunday", "nextmonday", "nexttuesday", "nextwednesday", + "nextthursday", "nextfriday", "nextsaturday", "nextsunday"); $result = array(); - for ($i=0; $i<7; $i++) { + for ($i=0; $i<14; $i++) { $utcDayEnd = Application_Common_DateHelper::GetDayEndTimestamp($utcDayStart); $shows = Application_Model_Show::getNextShows($utcDayStart, "ALL", $utcDayEnd); $utcDayStart = $utcDayEnd; diff --git a/airtime_mvc/application/forms/AddShowRepeats.php b/airtime_mvc/application/forms/AddShowRepeats.php index 814102878..6045c3d78 100644 --- a/airtime_mvc/application/forms/AddShowRepeats.php +++ b/airtime_mvc/application/forms/AddShowRepeats.php @@ -17,7 +17,9 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm 'class' => ' input_select', 'multiOptions' => array( "0" => _("weekly"), - "1" => _("bi-weekly"), + "1" => _("every 2 weeks"), + "4" => _("every 3 weeks"), + "5" => _("every 4 weeks"), "2" => _("monthly") ), )); diff --git a/airtime_mvc/application/forms/AddShowWhen.php b/airtime_mvc/application/forms/AddShowWhen.php index 518b07405..a040032cb 100644 --- a/airtime_mvc/application/forms/AddShowWhen.php +++ b/airtime_mvc/application/forms/AddShowWhen.php @@ -197,6 +197,10 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm $interval = 'P7D'; } elseif ($formData["add_show_repeat_type"] == 1) { $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) { $interval = 'P1M'; } diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index 76eea0290..63dedd3e6 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -5,6 +5,8 @@ define("REPEAT_WEEKLY", 0); define("REPEAT_BI_WEEKLY", 1); define("REPEAT_MONTHLY_MONTHLY", 2); define("REPEAT_MONTHLY_WEEKLY", 3); +define("REPEAT_TRI_WEEKLY", 4); +define("REPEAT_QUAD_WEEKLY", 5); class Application_Service_ShowService { @@ -261,6 +263,14 @@ class Application_Service_ShowService $this->createWeeklyRepeatInstances($day, $populateUntil, REPEAT_BI_WEEKLY, new DateInterval("P14D"), $daysAdded); break; + case REPEAT_TRI_WEEKLY: + $this->createWeeklyRepeatInstances($day, $populateUntil, REPEAT_TRI_WEEKLY, + new DateInterval("P21D"), $daysAdded); + break; + case REPEAT_QUAD_WEEKLY: + $this->createWeeklyRepeatInstances($day, $populateUntil, REPEAT_QUAD_WEEKLY, + new DateInterval("P28D"), $daysAdded); + break; case REPEAT_MONTHLY_MONTHLY: $this->createMonthlyRepeatInstances($day, $populateUntil); break; @@ -392,7 +402,7 @@ SQL; //if the start date changes, these are the repeat types //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); if (in_array($this->repeatType, $deleteRepeatTypes) && diff --git a/widgets/js/jquery.showinfo.js b/widgets/js/jquery.showinfo.js index eab3f3d8b..c3cf6db94 100644 --- a/widgets/js/jquery.showinfo.js +++ b/widgets/js/jquery.showinfo.js @@ -238,7 +238,7 @@ var defaults = { sourceDomain: "http://localhost/", //where to get show status from updatePeriod: 600, - dowText: {monday:"Monday", tuesday:"Tuesday", wednesday:"Wednesday", thursday:"Thursday", friday:"Friday", saturday:"Saturday", sunday:"Sunday"}, + dowText:{monday:"Monday", tuesday:"Tuesday", wednesday:"Wednesday",thursday:"Thursday", friday:"Friday", saturday:"Saturday",sunday:"Sunday", nextmonday:"Next Monday", nexttuesday:"Next Tuesday",nextwednesday:"Next Wednesday", nextthursday:"Next Thursday",nextfriday:"Next Friday", nextsaturday:"Next Saturday", nextsunday:"NextSunday"}, miscText: {time:"Time", programName:"Program Name", details:"Details", readMore:"Read More"} }; options = $.extend(true, defaults, options); @@ -250,7 +250,7 @@ obj.attr("class", "ui-tabs"); - var dow = ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"]; + var dow = ["monday", "tuesday", "wednesday", "thursday", "friday","saturday", "sunday", "nextmonday", "nexttuesday", "nextwednesday","nextthursday", "nextfriday", "nextsaturday", "nextsunday"]; var date = new Date(); //subtract 1 because javascript date function returns