diff --git a/airtime_mvc/application/models/Datatables.php b/airtime_mvc/application/models/Datatables.php index 7545aec71..b3b370352 100644 --- a/airtime_mvc/application/models/Datatables.php +++ b/airtime_mvc/application/models/Datatables.php @@ -4,6 +4,7 @@ class Application_Model_Datatables { private static function buildWhereClauseForAdvancedSearch($dbname2searchTerm) { + $where = array(); $where['clause'] = array(); $where['params'] = array(); foreach ($dbname2searchTerm as $dbname=>$term) { diff --git a/airtime_mvc/application/models/Playlist.php b/airtime_mvc/application/models/Playlist.php index 8a32db7e1..660864af5 100644 --- a/airtime_mvc/application/models/Playlist.php +++ b/airtime_mvc/application/models/Playlist.php @@ -1075,8 +1075,7 @@ SQL; $sql .= "END WHERE position IN ($currentPos) and playlist_id=:p1"; Application_Common_Database::prepareAndExecute($sql, array("p1"=>$this->id)); - $result['result'] = 0; - return $result; + return array('result' => 0); } public static function getAllPlaylistFiles() diff --git a/airtime_mvc/application/models/Scheduler.php b/airtime_mvc/application/models/Scheduler.php index e3869c662..1464384c6 100644 --- a/airtime_mvc/application/models/Scheduler.php +++ b/airtime_mvc/application/models/Scheduler.php @@ -85,6 +85,9 @@ class Application_Model_Scheduler $nowEpoch = floatval($this->nowDT->format("U.u")); + $schedInfo = array(); + $instanceInfo = array(); + for ($i = 0; $i < count($items); $i++) { $id = $items[$i]["id"]; @@ -103,7 +106,7 @@ class Application_Model_Scheduler } $schedIds = array(); - if (isset($schedInfo)) { + if (count($schedInfo) > 0) { $schedIds = array_keys($schedInfo); } $schedItems = CcScheduleQuery::create()->findPKs($schedIds, $this->con); diff --git a/airtime_mvc/application/models/ShowBuilder.php b/airtime_mvc/application/models/ShowBuilder.php index cd6af41e7..7149ce10c 100644 --- a/airtime_mvc/application/models/ShowBuilder.php +++ b/airtime_mvc/application/models/ShowBuilder.php @@ -388,6 +388,7 @@ class Application_Model_ShowBuilder $outdated = false; $shows = Application_Model_Show::getShows($this->startDT, $this->endDT); + $include = array(); if ($this->opts["showFilter"] !== 0) { $include[] = $this->opts["showFilter"]; } elseif ($this->opts["myShows"] === 1) { diff --git a/airtime_mvc/application/models/ShowInstance.php b/airtime_mvc/application/models/ShowInstance.php index e95b7dd01..bae020a7b 100644 --- a/airtime_mvc/application/models/ShowInstance.php +++ b/airtime_mvc/application/models/ShowInstance.php @@ -352,10 +352,10 @@ SQL; ); //only need to check overlap if show increased in size. - if (strtotime($new_ends) > strtotime($ends)) { + if (strtotime($now_ends) > strtotime($ends)) { $utcStartDateTime = new DateTime($ends, new DateTimeZone("UTC")); - $utcEndDateTime = new DateTime($new_ends, new DateTimeZone("UTC")); + $utcEndDateTime = new DateTime($now_ends, new DateTimeZone("UTC")); $overlap = Application_Model_Show::getShows($utcStartDateTime, $utcEndDateTime); @@ -381,7 +381,7 @@ SQL; } - $this->setShowEnd($new_ends); + $this->setShowEnd($now_ends); Application_Model_RabbitMq::PushSchedule(); } diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index b8f84b26d..207b80601 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -893,7 +893,7 @@ SQL; $in = fopen($_FILES['file']['tmp_name'], "rb"); if ($in) { - while ($buff = fread($in, 4096)) + while (($buff = fread($in, 4096))) fwrite($out, $buff); } else die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": _("Failed to open input stream.")}, "id" : "id"}'); @@ -912,7 +912,7 @@ SQL; $in = fopen("php://input", "rb"); if ($in) { - while ($buff = fread($in, 4096)) + while (($buff = fread($in, 4096))) fwrite($out, $buff); } else die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": _("Failed to open input stream.")}, "id" : "id"}'); @@ -961,6 +961,7 @@ SQL; // Check if we have enough space before copying if (!self::isEnoughDiskSpaceToCopy($stor, $audio_file)) { $freeSpace = disk_free_space($stor); + $fileSize = filesize($audio_file); return array("code" => 107, "message" => sprintf(_("The file was not uploaded, there is " diff --git a/airtime_mvc/application/models/Systemstatus.php b/airtime_mvc/application/models/Systemstatus.php index 6f6a05fff..4a0480a04 100644 --- a/airtime_mvc/application/models/Systemstatus.php +++ b/airtime_mvc/application/models/Systemstatus.php @@ -125,6 +125,7 @@ class Application_Model_Systemstatus public static function GetPlatformInfo() { $keys = array("release", "machine", "memory", "swap"); + $data = array(); foreach ($keys as $key) { $data[$key] = "UNKNOWN"; } @@ -212,7 +213,7 @@ class Application_Model_Systemstatus public static function GetDiskInfo() { - $partions = array(); + $partitions = array(); /* First lets get all the watched directories. Then we can group them * into the same partitions by comparing the partition sizes. */ diff --git a/airtime_mvc/application/models/User.php b/airtime_mvc/application/models/User.php index 34e1fe0f6..a3b2c5d3d 100644 --- a/airtime_mvc/application/models/User.php +++ b/airtime_mvc/application/models/User.php @@ -226,7 +226,7 @@ class Application_Model_User public function deleteAllFiles() { $my_files = $this->getOwnedFiles(); - foreach ($files as $file) { + foreach ($my_files as $file) { $file->delete(); } }