CC-3174 : showbuilder
adding new column last_scheduled to cc_show_instance changing column time_filled to be of type interval.
This commit is contained in:
parent
b1fbeeb448
commit
f14ebce239
10 changed files with 219 additions and 75 deletions
|
@ -107,13 +107,13 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
{
|
||||
$request = $this->getRequest();
|
||||
|
||||
$ids = $request->getParam("ids", null);
|
||||
$items = $request->getParam("items", null);
|
||||
|
||||
$json = array();
|
||||
|
||||
try {
|
||||
$scheduler = new Application_Model_Scheduler();
|
||||
$scheduler->removeItems($ids);
|
||||
$scheduler->removeItems($items);
|
||||
|
||||
$json["message"]="success... maybe";
|
||||
}
|
||||
|
@ -147,4 +147,53 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
|
||||
$this->view->data = $json;
|
||||
}
|
||||
|
||||
public function scheduleReorderAction() {
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
||||
$showInstance = $request->getParam("instanceId");
|
||||
}
|
||||
|
||||
/*
|
||||
* make sure any incoming requests for scheduling are ligit.
|
||||
*
|
||||
* @param array $items, an array containing pks of cc_schedule items.
|
||||
*/
|
||||
private function filterSelected($items) {
|
||||
|
||||
$allowed = array();
|
||||
$user = Application_Model_User::GetCurrentUser();
|
||||
$type = $user->getType();
|
||||
|
||||
//item must be within the host's show.
|
||||
if ($type === UTYPE_HOST) {
|
||||
|
||||
$hosted = CcShowHostsQuery::create()
|
||||
->filterByDbHost($user->getId())
|
||||
->find();
|
||||
|
||||
$allowed_shows = array();
|
||||
foreach ($hosted as $host) {
|
||||
$allowed_shows[] = $host->getDbShow();
|
||||
}
|
||||
|
||||
for ($i = 0; $i < count($items); $i++) {
|
||||
|
||||
$instance = $items[$i]["instance"];
|
||||
|
||||
if (in_array($instance, $allowed_shows)) {
|
||||
$allowed[] = $items[$i];
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->shows = $res;
|
||||
}
|
||||
//they can schedule anything.
|
||||
else if ($type === UTYPE_ADMIN || $type === UTYPE_PROGRAM_MANAGER) {
|
||||
$allowed = $items;
|
||||
}
|
||||
|
||||
return $allowed;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue