コード例 #1
0
ファイル: AdminUserController.php プロジェクト: grlf/eyedock
 public function __construct(Am_Request $request, Am_View $view)
 {
     parent::__construct($request, $view);
     $this->user_id = $this->getCompleteRequest()->get('user_id', 0);
     if ($this->user_id) {
         $this->getDataSource()->getDataSourceQuery()->addWhere('t.user_id=?d', $this->user_id);
     }
 }
コード例 #2
0
ファイル: Controller.php プロジェクト: grlf/eyedock
 public function viewAction()
 {
     $ticketIdentity = $this->getParam('ticket');
     $ticket = $this->getDi()->helpdeskTicketTable->load($ticketIdentity);
     if (!$this->strategy->canViewTicket($ticket)) {
         throw new Am_Exception_AccessDenied(___('Access Denied'));
     }
     $grid = new Am_Helpdesk_Grid_Admin($this->getRequest(), $this->getView());
     $grid->getDataSource()->getDataSourceQuery()->addWhere('m.user_id=?d', $ticket->user_id);
     $grid->actionsClear();
     $grid->removeField('m_login');
     $grid->addCallback(Am_Grid_ReadOnly::CB_TR_ATTRIBS, function (&$ret, $record) use($ticket) {
         if ($record->pk() == $ticket->pk()) {
             $ret['class'] = isset($ret['class']) ? $ret['class'] . ' emphase' : 'emphase';
         }
     });
     $grid->isAjax($this->isAjax() && $this->isGridRequest('_grid'));
     if ($grid->isAjax()) {
         echo $grid->run();
         return;
     }
     $category = $ticket->getCategory();
     $t = new Am_View();
     $t->assign('ticket', $ticket);
     $t->assign('category', $category);
     $t->assign('user', $ticket->getUser());
     $t->assign('strategy', $this->strategy);
     $t->assign('historyGrid', $grid->render());
     $content = $t->render($this->strategy->getTemplatePath() . '/ticket.phtml');
     if ($this->isAjax()) {
         header('Content-type: text/html; charset=UTF-8');
         echo $content;
     } else {
         $this->view->assign('content', $content);
         $this->view->display($this->strategy->getTemplatePath() . '/index.phtml');
     }
 }
コード例 #3
0
ファイル: AdminMyController.php プロジェクト: grlf/eyedock
 public function initGridFields()
 {
     parent::initGridFields();
     $this->removeField('owner_id');
 }