Merge branch '2.2.x' of dev.sourcefabric.org:airtime into 2.2.x
This commit is contained in:
commit
7356d4fe89
|
@ -1743,7 +1743,8 @@ SQL;
|
||||||
$days = $interval->format('%a');
|
$days = $interval->format('%a');
|
||||||
$shows = Application_Model_Show::getShows($p_start, $p_end);
|
$shows = Application_Model_Show::getShows($p_start, $p_end);
|
||||||
$nowEpoch = time();
|
$nowEpoch = time();
|
||||||
|
$content_count = Application_Model_ShowInstance::getContentCount(
|
||||||
|
$p_start, $p_end);
|
||||||
$timezone = date_default_timezone_get();
|
$timezone = date_default_timezone_get();
|
||||||
|
|
||||||
foreach ($shows as $show) {
|
foreach ($shows as $show) {
|
||||||
|
@ -1789,9 +1790,9 @@ SQL;
|
||||||
|
|
||||||
$showInstance = new Application_Model_ShowInstance(
|
$showInstance = new Application_Model_ShowInstance(
|
||||||
$show["instance_id"]);
|
$show["instance_id"]);
|
||||||
//$showContent = $showInstance->getShowListContent();
|
|
||||||
|
|
||||||
$options["show_empty"] = ($showInstance->showEmpty()) ? 1 : 0;
|
$options["show_empty"] = (array_key_exists($show['instance_id'],
|
||||||
|
$content_count)) ? 1 : 0;
|
||||||
|
|
||||||
$events[] = &self::makeFullCalendarEvent($show, $options,
|
$events[] = &self::makeFullCalendarEvent($show, $options,
|
||||||
$startsDT, $endsDT, $startsEpochStr, $endsEpochStr);
|
$startsDT, $endsDT, $startsEpochStr, $endsEpochStr);
|
||||||
|
|
|
@ -662,6 +662,27 @@ SQL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static function getContentCount($p_start, $p_end)
|
||||||
|
{
|
||||||
|
$sql = <<<SQL
|
||||||
|
SELECT instance_id,
|
||||||
|
count(*) AS instance_count
|
||||||
|
FROM cc_schedule
|
||||||
|
WHERE ends > :p_start::TIMESTAMP
|
||||||
|
AND starts < :p_end::TIMESTAMP
|
||||||
|
GROUP BY instance_id
|
||||||
|
SQL;
|
||||||
|
|
||||||
|
$counts = Application_Common_Database::prepareAndExecute( $sql, array(
|
||||||
|
':p_start' => $p_start->format("Y-m-d G:i:s"),
|
||||||
|
':p_end' => $p_end->format("Y-m-d G:i:s"))
|
||||||
|
, 'all');
|
||||||
|
|
||||||
|
return $counts;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public function showEmpty()
|
public function showEmpty()
|
||||||
{
|
{
|
||||||
$sql = <<<SQL
|
$sql = <<<SQL
|
||||||
|
|
Loading…
Reference in New Issue