CC-3174 : showbuilder

removing items recalulates everything correctly.
This commit is contained in:
Naomi Aro 2012-01-31 21:39:34 +01:00
parent fbda0e733b
commit 3d502b748f
3 changed files with 127 additions and 2 deletions

View File

@ -154,6 +154,8 @@ class Application_Model_Scheduler {
self::removeGaps($instance); self::removeGaps($instance);
} }
} }
$this->con->commit();
} }
catch (Exception $e) { catch (Exception $e) {
$this->con->rollback(); $this->con->rollback();

View File

@ -15,4 +15,66 @@
*/ */
class CcSchedule extends BaseCcSchedule { class CcSchedule extends BaseCcSchedule {
/**
* Get the [optionally formatted] temporal [starts] column value.
*
*
* @param string $format The date/time format string (either date()-style or strftime()-style).
* If format is NULL, then the raw DateTime object will be returned.
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
* @throws PropelException - if unable to parse/validate the date/time value.
*/
public function getDbStarts($format = 'Y-m-d H:i:s')
{
if ($this->starts === null) {
return null;
}
try {
$dt = new DateTime($this->starts, new DateTimeZone("UTC"));
} catch (Exception $x) {
throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->starts, true), $x);
}
if ($format === null) {
// Because propel.useDateTimeClass is TRUE, we return a DateTime object.
return $dt;
} elseif (strpos($format, '%') !== false) {
return strftime($format, $dt->format('U'));
} else {
return $dt->format($format);
}
}
/**
* Get the [optionally formatted] temporal [ends] column value.
*
*
* @param string $format The date/time format string (either date()-style or strftime()-style).
* If format is NULL, then the raw DateTime object will be returned.
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
* @throws PropelException - if unable to parse/validate the date/time value.
*/
public function getDbEnds($format = 'Y-m-d H:i:s')
{
if ($this->ends === null) {
return null;
}
try {
$dt = new DateTime($this->ends, new DateTimeZone("UTC"));
} catch (Exception $x) {
throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->ends, true), $x);
}
if ($format === null) {
// Because propel.useDateTimeClass is TRUE, we return a DateTime object.
return $dt;
} elseif (strpos($format, '%') !== false) {
return strftime($format, $dt->format('U'));
} else {
return $dt->format($format);
}
}
} // CcSchedule } // CcSchedule

View File

@ -15,4 +15,65 @@
*/ */
class CcShowInstances extends BaseCcShowInstances { class CcShowInstances extends BaseCcShowInstances {
/**
* Get the [optionally formatted] temporal [starts] column value.
*
*
* @param string $format The date/time format string (either date()-style or strftime()-style).
* If format is NULL, then the raw DateTime object will be returned.
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
* @throws PropelException - if unable to parse/validate the date/time value.
*/
public function getDbStarts($format = 'Y-m-d H:i:s')
{
if ($this->starts === null) {
return null;
}
try {
$dt = new DateTime($this->starts, new DateTimeZone("UTC"));
} catch (Exception $x) {
throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->starts, true), $x);
}
if ($format === null) {
// Because propel.useDateTimeClass is TRUE, we return a DateTime object.
return $dt;
} elseif (strpos($format, '%') !== false) {
return strftime($format, $dt->format('U'));
} else {
return $dt->format($format);
}
}
/**
* Get the [optionally formatted] temporal [ends] column value.
*
*
* @param string $format The date/time format string (either date()-style or strftime()-style).
* If format is NULL, then the raw DateTime object will be returned.
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
* @throws PropelException - if unable to parse/validate the date/time value.
*/
public function getDbEnds($format = 'Y-m-d H:i:s')
{
if ($this->ends === null) {
return null;
}
try {
$dt = new DateTime($this->ends, new DateTimeZone("UTC"));
} catch (Exception $x) {
throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->ends, true), $x);
}
if ($format === null) {
// Because propel.useDateTimeClass is TRUE, we return a DateTime object.
return $dt;
} elseif (strpos($format, '%') !== false) {
return strftime($format, $dt->format('U'));
} else {
return $dt->format($format);
}
}
} // CcShowInstances } // CcShowInstances