diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index 0f330b355..5df8d878f 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -38,6 +38,8 @@ class Application_Model_Preference $paramMap[':id'] = $userId; } + Application_Common_Database::prepareAndExecute("LOCK TABLE cc_pref"); + $result = Application_Common_Database::prepareAndExecute($sql, $paramMap, Application_Common_Database::COLUMN, diff --git a/airtime_mvc/application/models/Scheduler.php b/airtime_mvc/application/models/Scheduler.php index 3d0aa54ea..17410f6d6 100644 --- a/airtime_mvc/application/models/Scheduler.php +++ b/airtime_mvc/application/models/Scheduler.php @@ -620,7 +620,7 @@ class Application_Model_Scheduler //show is empty so start position counter at 0 $pos = 0; - $adjustSched = false; + //$adjustSched = false; } if (!in_array($instanceId, $affectedShowInstances)) { @@ -658,6 +658,7 @@ class Application_Model_Scheduler //item existed previously and is being moved. //need to keep same id for resources if we want REST. if (isset($file['sched_id'])) { + $adjustFromDT = clone $nextStartDT; $doUpdate = true; $movedItem_sql = "SELECT * FROM cc_schedule ". @@ -693,7 +694,6 @@ class Application_Model_Scheduler $file["fadein"] = $sched["fade_in"]; $file["fadeout"] = $sched["fade_out"]; } else { - //$sched = new CcSchedule(); $doInsert = true; } @@ -754,7 +754,7 @@ class Application_Model_Scheduler "(starts, ends, cue_in, cue_out, fade_in, fade_out, ". "clip_length, position, instance_id, file_id, stream_id) VALUES ". implode($values, ","); - + Application_Common_Database::prepareAndExecute( $insert_sql, array(), Application_Common_Database::EXECUTE); } @@ -780,7 +780,7 @@ class Application_Model_Scheduler if ($adjustSched === true) { $followingItems_sql = "SELECT * FROM cc_schedule ". - "WHERE starts >= '{$initalStartDT->format("Y-m-d H:i:s.u")}' ". + "WHERE starts > '{$initalStartDT->format("Y-m-d H:i:s.u")}' ". "AND instance_id = {$instanceId} "; if (count($excludeIds) > 0) { $followingItems_sql .= "AND id NOT IN (". implode($excludeIds, ",").") ";