Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
1c89244b02
|
@ -783,6 +783,8 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$data['add_show_instance_id']);
|
||||
|
||||
if ($success) {
|
||||
$scheduler = new Application_Model_Scheduler();
|
||||
$scheduler->removeGaps($data['add_show_instance_id']);
|
||||
$this->view->addNewShow = true;
|
||||
$this->view->newForm = $this->view->render('schedule/add-show-form.phtml');
|
||||
} else {
|
||||
|
|
|
@ -331,7 +331,7 @@ class Application_Model_Scheduler
|
|||
* This function squeezes all items of a show together so that
|
||||
* there are no gaps between them.
|
||||
*/
|
||||
private function removeGaps($showInstance, $exclude=null)
|
||||
public function removeGaps($showInstance, $exclude=null)
|
||||
{
|
||||
Logging::info("removing gaps from show instance #".$showInstance);
|
||||
|
||||
|
|
|
@ -187,8 +187,8 @@ SQL;
|
|||
if ($diff != 0) {
|
||||
$sql = <<<SQL
|
||||
UPDATE cc_schedule
|
||||
SET starts = starts + INTERVAL :diff1 SECOND,
|
||||
ends = ends + INTERVAL :diff2 SECOND
|
||||
SET starts = starts + :diff1::INTERVAL SECOND,
|
||||
ends = ends + :diff2::INTERVAL SECOND
|
||||
WHERE instance_id = :instanceId
|
||||
SQL;
|
||||
Application_Common_Database::prepareAndExecute($sql,
|
||||
|
|
Loading…
Reference in New Issue