Пример #1
0
 public function executeField(sfWebRequest $request)
 {
     $this->weekstart = $request->getParameter('weekstart');
     $account_id = $this->getUser()->getAttribute('account_id');
     $query = new Doctrine_Query();
     $project = ProjectTable::getInstance()->find($request->getParameter('project_id'));
     $item_types = TimeItemTypeTable::getInstance()->findByAccountId($account_id);
     $this->default_item_type = TimeItemTypeTable::getInstance()->findDefaultForAccount($account_id);
     if ($this->default_item_type) {
         $this->default_item_type_name = $this->default_item_type->getName();
     } else {
         $this->default_item_type_name = null;
     }
     $this->setLayout(false);
     return $this->renderPartial('timeitem', array('item_types' => $item_types, 'weekstart' => $this->weekstart, 'project' => $project, 'weekday' => $request->getParameter('weekday'), 'default_item_type_name' => $this->default_item_type_name));
 }
Пример #2
0
 public function executeProjectTotal(sfWebRequest $request)
 {
     $filter = $this->checkFilter($request);
     $account_id = $this->getUser()->getAttribute('account_id');
     $this->types = TimeItemTypeTable::getInstance()->findByAccountId($account_id);
     $this->user = UserTable::getInstance()->find($this->getUser()->getAttribute('uid'));
     $this->users = UserTable::getInstance()->findByAccountId($account_id);
     if ($this->getUser()->getAttribute('overlord', false) == true) {
         $this->projects = ProjectTable::getInstance()->findByAccountId($account_id);
     } else {
         if (array_key_exists('user', $filter)) {
             $this->user = UserTable::getInstance()->find($filter['user']);
             $this->projects = $this->user->Projects;
         } else {
             $this->projects = $this->user->Projects;
         }
     }
     $this->project_totals = TimeLogItemTable::getInstance()->prepareTotalReport($filter, $this->projects, $this->user, $account_id);
 }
Пример #3
0
 public function executeDefault(sfWebRequest $request)
 {
     $account_id = $this->getUser()->getAttribute('account_id');
     TimeItemTypeTable::getInstance()->setAsDefault($request->getParameter('id'), $account_id);
     $this->redirect('adminTimeItemType/list');
 }