Merge branch '2.5.x' of github.com:sourcefabric/Airtime into 2.5.x
This commit is contained in:
commit
e6c971387b
|
@ -84,7 +84,7 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm
|
||||||
|
|
||||||
public function isValid($formData) {
|
public function isValid($formData) {
|
||||||
if (parent::isValid($formData)) {
|
if (parent::isValid($formData)) {
|
||||||
return $this->checkReliantFields($formData);
|
return $this->checkReliantFields($formData);
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -95,15 +95,18 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm
|
||||||
if (!$formData['add_show_no_end']) {
|
if (!$formData['add_show_no_end']) {
|
||||||
$start_timestamp = $formData['add_show_start_date'];
|
$start_timestamp = $formData['add_show_start_date'];
|
||||||
$end_timestamp = $formData['add_show_end_date'];
|
$end_timestamp = $formData['add_show_end_date'];
|
||||||
|
$showTimeZone = new DateTimeZone($formData['add_show_timezone']);
|
||||||
|
|
||||||
$start_epoch = strtotime($start_timestamp);
|
//We're assuming all data is valid at this point (timezone, etc.).
|
||||||
$end_epoch = strtotime($end_timestamp);
|
|
||||||
|
|
||||||
if ($end_epoch < $start_epoch) {
|
$startDate = new DateTime($start_timestamp, $showTimeZone);
|
||||||
|
$endDate = new DateTime($end_timestamp, $showTimeZone);
|
||||||
|
|
||||||
|
if ($endDate < $startDate) {
|
||||||
$this->getElement('add_show_end_date')->setErrors(array(_('End date must be after start date')));
|
$this->getElement('add_show_end_date')->setErrors(array(_('End date must be after start date')));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($formData['add_show_day_check'])) {
|
if (!isset($formData['add_show_day_check'])) {
|
||||||
|
|
|
@ -67,7 +67,7 @@ class Application_Model_Preference
|
||||||
elseif ($result == 1) {
|
elseif ($result == 1) {
|
||||||
|
|
||||||
// result found
|
// result found
|
||||||
if (is_null($userId)) {
|
if (!$isUserValue) {
|
||||||
// system pref
|
// system pref
|
||||||
$sql = "UPDATE cc_pref"
|
$sql = "UPDATE cc_pref"
|
||||||
." SET subjid = NULL, valstr = :value"
|
." SET subjid = NULL, valstr = :value"
|
||||||
|
@ -85,7 +85,7 @@ class Application_Model_Preference
|
||||||
else {
|
else {
|
||||||
|
|
||||||
// result not found
|
// result not found
|
||||||
if (is_null($userId)) {
|
if (!$isUserValue) {
|
||||||
// system pref
|
// system pref
|
||||||
$sql = "INSERT INTO cc_pref (keystr, valstr)"
|
$sql = "INSERT INTO cc_pref (keystr, valstr)"
|
||||||
." VALUES (:key, :value)";
|
." VALUES (:key, :value)";
|
||||||
|
|
Loading…
Reference in New Issue