Merge branch 'saas-dev' into saas-dev-publishing

Conflicts:
	airtime_mvc/application/controllers/ApiController.php
This commit is contained in:
Albert Santoni 2015-11-18 12:38:18 -05:00
commit 965a78c54a
16 changed files with 191 additions and 26 deletions

View file

@ -73,6 +73,7 @@ class ApiController extends Zend_Controller_Action
->addActionContext('update-cue-values-by-silan' , 'json')
->addActionContext('get-usability-hint' , 'json')
->addActionContext('poll-celery' , 'json')
->addActionContext('recalculate-schedule' , 'json') //RKTN-260
->initContext();
}
@ -1524,9 +1525,40 @@ class ApiController extends Zend_Controller_Action
$streamData = Application_Model_StreamSetting::getEnabledStreamData();
foreach ($streamData as $stream) {
$m3uFile .= "#EXTINF,".$stationName." - " . strtoupper($stream['codec']) . "\r\n";
$m3uFile .= "#EXTINF," . $stationName . " - " . strtoupper($stream['codec']) . "\r\n";
$m3uFile .= $stream['url'] . "\r\n\r\n";
}
echo $m3uFile;
}
public function recalculateScheduleAction()
{
$this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
Zend_Session::start();
$scheduler = new Application_Model_Scheduler();
session_write_close();
$now = new DateTime("now", new DateTimeZone("UTC"));
$showInstances = CcShowInstancesQuery::create()
->filterByDbStarts($now, Criteria::GREATER_THAN)
//->filterByDbModifiedInstance(false)
->orderByDbStarts()
->find();
//->find($this->con);
$total = $showInstances->count();
$progress = 0;
foreach ($showInstances as $instance) {
echo(round(floatval($progress / $total)*100) . "% - " . $instance->getDbId() . "\n<br>");
flush();
ob_flush();
//while(@ob_end_clean());
$scheduler->removeGaps2($instance->getDbId());
$progress += 1;
}
echo("Recalculated $total shows.");
}
}

View file

@ -21,6 +21,12 @@ class BillingController extends Zend_Controller_Action {
public function upgradeAction()
{
//If you're not on a trial and you're suspended, we don't let you access the plans page and redirect you to the invoices
//page to force you to pay your bills first.
$isTrial = (Application_Model_Preference::GetPlanLevel() == 'trial');
if (!$isTrial && (Application_Model_Preference::getProvisioningStatus() == PROVISIONING_STATUS_SUSPENDED)) {
$this->_redirect('billing/invoices');
}
Zend_Layout::getMvcInstance()->assign('parent_page', 'Billing');