Merge branch '2.5.x' into saas
Conflicts: CREDITS
This commit is contained in:
commit
2fadc8f8f1
19 changed files with 130 additions and 39 deletions
|
@ -209,8 +209,12 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
|||
$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 && $formData["add_show_monthly_repeat_type"] == 2) {
|
||||
$interval = 'P1M';
|
||||
} elseif ($formData["add_show_repeat_type"] == 2 && $formData["add_show_monthly_repeat_type"] == 3) {
|
||||
list($weekNumberOfMonth, $dayOfWeek) =
|
||||
Application_Service_ShowService::getMonthlyWeeklyRepeatInterval(
|
||||
new DateTime($start_time, $showTimezone));
|
||||
}
|
||||
|
||||
/* Check first show
|
||||
|
@ -274,12 +278,26 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
|||
$this->getElement('add_show_duration')->setErrors(array(_('Cannot schedule overlapping shows')));
|
||||
break 1;
|
||||
} else {
|
||||
$repeatShowStart->setTimezone($showTimezone);
|
||||
$repeatShowEnd->setTimezone($showTimezone);
|
||||
$repeatShowStart->add(new DateInterval($interval));
|
||||
$repeatShowEnd->add(new DateInterval($interval));
|
||||
$repeatShowStart->setTimezone($utc);
|
||||
$repeatShowEnd->setTimezone($utc);
|
||||
if ($formData["add_show_repeat_type"] == 2 && $formData["add_show_monthly_repeat_type"] == 3) {
|
||||
$monthlyWeeklyStart = new DateTime($repeatShowStart->format("Y-m"),
|
||||
new DateTimeZone("UTC"));
|
||||
$monthlyWeeklyStart->add(new DateInterval("P1M"));
|
||||
$repeatShowStart = clone Application_Service_ShowService::getNextMonthlyWeeklyRepeatDate(
|
||||
$monthlyWeeklyStart,
|
||||
$formData["add_show_timezone"],
|
||||
$formData['add_show_start_time'],
|
||||
$weekNumberOfMonth,
|
||||
$dayOfWeek);
|
||||
$repeatShowEnd = clone $repeatShowStart;
|
||||
$repeatShowEnd->add(new DateInterval("PT".$hours."H".$minutes."M"));
|
||||
} else {
|
||||
$repeatShowStart->setTimezone($showTimezone);
|
||||
$repeatShowEnd->setTimezone($showTimezone);
|
||||
$repeatShowStart->add(new DateInterval($interval));
|
||||
$repeatShowEnd->add(new DateInterval($interval));
|
||||
$repeatShowStart->setTimezone($utc);
|
||||
$repeatShowEnd->setTimezone($utc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
private $criteriaOptions;
|
||||
private $stringCriteriaOptions;
|
||||
private $numericCriteriaOptions;
|
||||
private $sortOptions;
|
||||
private $limitOptions;
|
||||
|
||||
/* We need to know if the criteria value will be a string
|
||||
|
@ -122,6 +123,17 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
}
|
||||
return $this->limitOptions;
|
||||
}
|
||||
private function getSortOptions()
|
||||
{
|
||||
if (!isset($this->sortOptions)) {
|
||||
$this->sortOptions = array(
|
||||
"random" => _("random"),
|
||||
"newest" => _("newest"),
|
||||
"oldest" => _("oldest")
|
||||
);
|
||||
}
|
||||
return $this->sortOptions;
|
||||
}
|
||||
|
||||
|
||||
public function init()
|
||||
|
@ -288,6 +300,15 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
}
|
||||
$this->addElement($repeatTracks);
|
||||
|
||||
$sort = new Zend_Form_Element_Select('sp_sort_options');
|
||||
$sort->setAttrib('class', 'sp_input_select')
|
||||
->setDecorators(array('viewHelper'))
|
||||
->setMultiOptions($this->getSortOptions());
|
||||
if (isset($storedCrit["sort"])) {
|
||||
$sort->setValue($storedCrit["sort"]["value"]);
|
||||
}
|
||||
$this->addElement($sort);
|
||||
|
||||
$limit = new Zend_Form_Element_Select('sp_limit_options');
|
||||
$limit->setAttrib('class', 'sp_input_select')
|
||||
->setDecorators(array('viewHelper'))
|
||||
|
@ -344,7 +365,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
|
||||
public function preValidation($params)
|
||||
{
|
||||
$data = Application_Model_Block::organizeSmartPlyalistCriteria($params['data']);
|
||||
$data = Application_Model_Block::organizeSmartPlaylistCriteria($params['data']);
|
||||
// add elelments that needs to be added
|
||||
// set multioption for modifier according to criteria_field
|
||||
$modRowMap = array();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue