Beispiel #1
0
 /**
  * Before rendering, we'll add some extra stuff into the view!
  *
  */
 protected function renderView($script)
 {
     if (za()->getUser()->hasRole(User::ROLE_USER)) {
         $this->view->actionList = new CompositeView('layouts/actions-list.php');
         // Let's get a bunch of the current user's oldest incomplete
         // tasks to put in the list.
         $projectService = za()->getService('ProjectService');
         /* @var $projectService ProjectService */
         $this->view->actionList->tasks = $projectService->getUserTasks(za()->getUser(), array('complete=' => 0));
     }
     parent::renderView($script);
 }
Beispiel #2
0
 /**
  * Override the edit action to supply some selectable relationships
  *
  * @param MappedObject $model
  */
 public function editAction($model = null)
 {
     $this->view->relationships = array("Lead", "Opportunity", "Customer", "Dead", "Supplier");
     parent::editAction($model);
 }
 /**
  * Edit a timesheet
  */
 public function editAction($model = null)
 {
     $pid = $this->_getParam('projectid');
     if ($pid) {
         $this->view->project = $this->byId($pid, 'Project');
     }
     $cid = $this->_getParam('clientid');
     if ($cid) {
         $this->view->client = $this->byId($cid, 'Client');
     }
     // bind in the task types
     $task = new Task();
     $this->view->categories = $task->constraints['category']->getValues();
     parent::editAction($model);
 }