Merge branch 'master' of https://github.com/jamieconnor/Airtime
Conflicts: airtime_mvc/application/services/ShowService.php
This commit is contained in:
commit
c687b6ad24
5 changed files with 23 additions and 6 deletions
|
@ -348,10 +348,11 @@ class ApiController extends Zend_Controller_Action
|
||||||
$utcDayStart = Application_Common_DateHelper::ConvertToUtcDateTimeString($dayStart);
|
$utcDayStart = Application_Common_DateHelper::ConvertToUtcDateTimeString($dayStart);
|
||||||
|
|
||||||
$dow = array("monday", "tuesday", "wednesday", "thursday", "friday",
|
$dow = array("monday", "tuesday", "wednesday", "thursday", "friday",
|
||||||
"saturday", "sunday");
|
"saturday", "sunday", "nextmonday", "nexttuesday", "nextwednesday",
|
||||||
|
"nextthursday", "nextfriday", "nextsaturday", "nextsunday");
|
||||||
|
|
||||||
$result = array();
|
$result = array();
|
||||||
for ($i=0; $i<7; $i++) {
|
for ($i=0; $i<14; $i++) {
|
||||||
$utcDayEnd = Application_Common_DateHelper::GetDayEndTimestamp($utcDayStart);
|
$utcDayEnd = Application_Common_DateHelper::GetDayEndTimestamp($utcDayStart);
|
||||||
$shows = Application_Model_Show::getNextShows($utcDayStart, "ALL", $utcDayEnd);
|
$shows = Application_Model_Show::getNextShows($utcDayStart, "ALL", $utcDayEnd);
|
||||||
$utcDayStart = $utcDayEnd;
|
$utcDayStart = $utcDayEnd;
|
||||||
|
|
|
@ -17,7 +17,9 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm
|
||||||
'class' => ' input_select',
|
'class' => ' input_select',
|
||||||
'multiOptions' => array(
|
'multiOptions' => array(
|
||||||
"0" => _("weekly"),
|
"0" => _("weekly"),
|
||||||
"1" => _("bi-weekly"),
|
"1" => _("every 2 weeks"),
|
||||||
|
"4" => _("every 3 weeks"),
|
||||||
|
"5" => _("every 4 weeks"),
|
||||||
"2" => _("monthly")
|
"2" => _("monthly")
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|
|
@ -197,6 +197,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';
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,8 @@ define("REPEAT_WEEKLY", 0);
|
||||||
define("REPEAT_BI_WEEKLY", 1);
|
define("REPEAT_BI_WEEKLY", 1);
|
||||||
define("REPEAT_MONTHLY_MONTHLY", 2);
|
define("REPEAT_MONTHLY_MONTHLY", 2);
|
||||||
define("REPEAT_MONTHLY_WEEKLY", 3);
|
define("REPEAT_MONTHLY_WEEKLY", 3);
|
||||||
|
define("REPEAT_TRI_WEEKLY", 4);
|
||||||
|
define("REPEAT_QUAD_WEEKLY", 5);
|
||||||
|
|
||||||
class Application_Service_ShowService
|
class Application_Service_ShowService
|
||||||
{
|
{
|
||||||
|
@ -261,6 +263,14 @@ class Application_Service_ShowService
|
||||||
$this->createWeeklyRepeatInstances($day, $populateUntil, REPEAT_BI_WEEKLY,
|
$this->createWeeklyRepeatInstances($day, $populateUntil, REPEAT_BI_WEEKLY,
|
||||||
new DateInterval("P14D"), $daysAdded);
|
new DateInterval("P14D"), $daysAdded);
|
||||||
break;
|
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:
|
case REPEAT_MONTHLY_MONTHLY:
|
||||||
$this->createMonthlyRepeatInstances($day, $populateUntil);
|
$this->createMonthlyRepeatInstances($day, $populateUntil);
|
||||||
break;
|
break;
|
||||||
|
@ -392,7 +402,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) &&
|
||||||
|
|
|
@ -238,7 +238,7 @@
|
||||||
var defaults = {
|
var defaults = {
|
||||||
sourceDomain: "http://localhost/", //where to get show status from
|
sourceDomain: "http://localhost/", //where to get show status from
|
||||||
updatePeriod: 600,
|
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"}
|
miscText: {time:"Time", programName:"Program Name", details:"Details", readMore:"Read More"}
|
||||||
};
|
};
|
||||||
options = $.extend(true, defaults, options);
|
options = $.extend(true, defaults, options);
|
||||||
|
@ -250,7 +250,7 @@
|
||||||
|
|
||||||
obj.attr("class", "ui-tabs");
|
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();
|
var date = new Date();
|
||||||
//subtract 1 because javascript date function returns
|
//subtract 1 because javascript date function returns
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue