function render() { $this->_sanitize(); $tpl = DevblocksPlatform::getTemplateService(); $tpl->assign('id', $this->id); $view_path = APP_PATH . '/features/cerberusweb.core/templates/tickets/'; $tpl->assign('view_path', $view_path); $tpl->assign('view', $this); $visit = CerberusApplication::getVisit(); $results = self::getData(); $tpl->assign('results', $results); @($ids = array_keys($results[0])); $workers = DAO_Worker::getAll(); $tpl->assign('workers', $workers); $teams = DAO_Group::getAll(); $tpl->assign('teams', $teams); $buckets = DAO_Bucket::getAll(); $tpl->assign('buckets', $buckets); $team_categories = DAO_Bucket::getTeams(); $tpl->assign('team_categories', $team_categories); $custom_fields = DAO_CustomField::getBySource(ChCustomFieldSource_Ticket::ID); $tpl->assign('custom_fields', $custom_fields); // Undo? $last_action = C4_TicketView::getLastAction($this->id); $tpl->assign('last_action', $last_action); if (!empty($last_action) && !is_null($last_action->ticket_ids)) { $tpl->assign('last_action_count', count($last_action->ticket_ids)); } $tpl->assign('timestamp_now', time()); $tpl->assign('view_fields', $this->getColumns()); $tpl->display('file:' . $view_path . 'ticket_view.tpl'); }
function render() { $tpl = DevblocksPlatform::getTemplateService(); $tpl->assign('id', $this->id); $view_path = DEVBLOCKS_PLUGIN_PATH . 'cerberusweb.mobile/templates/tickets/'; $tpl->assign('view_path_mobile', $view_path_mobile); $tpl->assign('view', $this); $visit = CerberusApplication::getVisit(); $results = self::getData(); $tpl->assign('results', $results); @($ids = array_keys($results[0])); $workers = DAO_Worker::getAll(); $tpl->assign('workers', $workers); $teams = DAO_Group::getAll(); $tpl->assign('teams', $teams); $buckets = DAO_Bucket::getAll(); $tpl->assign('buckets', $buckets); $team_categories = DAO_Bucket::getTeams(); $tpl->assign('team_categories', $team_categories); // [TODO] Is this even used here or did mfogg copy it blindly? $ticket_fields = DAO_CustomField::getBySource(ChCustomFieldSource_Ticket::ID); $tpl->assign('ticket_fields', $ticket_fields); // Undo? // [TODO] Is this even used here or did mfogg copy it blindly? $last_action = C4_TicketView::getLastAction($this->id); $tpl->assign('last_action', $last_action); if (!empty($last_action) && !is_null($last_action->ticket_ids)) { $tpl->assign('last_action_count', count($last_action->ticket_ids)); } $tpl->cache_lifetime = "0"; $tpl->assign('view_fields', $this->getColumns()); $tpl->display('file:' . $view_path . 'ticket_view.tpl'); }
function viewUndoAction() { @($view_id = DevblocksPlatform::importGPC($_REQUEST['view_id'], 'string')); @($clear = DevblocksPlatform::importGPC($_REQUEST['clear'], 'integer', 0)); $last_action = C4_TicketView::getLastAction($view_id); if ($clear || empty($last_action)) { C4_TicketView::setLastAction($view_id, null); $view = C4_AbstractViewLoader::getView($view_id); $view->render(); return; } /* * [TODO] This could be optimized by only doing the row-level updates for the * MOVE action, all the rest can just be a single DAO_Ticket::update($ids, ...) */ if (is_array($last_action->ticket_ids) && !empty($last_action->ticket_ids)) { foreach ($last_action->ticket_ids as $ticket_id => $fields) { DAO_Ticket::updateTicket($ticket_id, $fields); } } $visit = CerberusApplication::getVisit(); $visit->set(CerberusVisit::KEY_VIEW_LAST_ACTION, null); $view = C4_AbstractViewLoader::getView($view_id); $view->render(); return; }