execution.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. class project extends control
  3. {
  4. public function execution($status = 'all', $projectID = 0, $orderBy = 'order_asc', $productID = 0, $recTotal = 0, $recPerPage = 10, $pageID = 1)
  5. {
  6. $projectID = $this->project->checkAccess($projectID, $this->project->getPairsByProgram());
  7. if($projectID == 0 and common::hasPriv('project', 'create')) $this->locate($this->createLink('project', 'create'));
  8. if($projectID == 0 and !common::hasPriv('project', 'create')) $this->locate($this->createLink('project', 'browse'));
  9. $this->project->setMenu($projectID);
  10. $kanbanList = $this->loadModel('execution')->getList($projectID, 'all', $status);
  11. $executionActions = array();
  12. foreach($kanbanList as $kanbanID => $kanban)
  13. {
  14. foreach($this->config->execution->statusActions as $action)
  15. {
  16. if($this->execution->isClickable($kanban, $action)) $executionActions[$kanbanID][] = $action;
  17. }
  18. if($this->execution->isClickable($kanban, 'delete')) $executionActions[$kanbanID][] = 'delete';
  19. }
  20. $allExecution = $this->execution->getList($projectID, 'all', 'all');
  21. $this->view->allExecutionsNum = empty($allExecution);
  22. $this->view->title = $this->lang->project->kanban;
  23. $this->view->kanbanList = array_values($kanbanList);
  24. $this->view->memberGroup = $this->execution->getMembersByIdList(array_keys($kanbanList));
  25. $this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted');
  26. $this->view->usersAvatar = $this->user->getAvatarPairs();
  27. $this->view->projectID = $projectID;
  28. $this->view->status = $status;
  29. $this->view->executionActions = $executionActions;
  30. $this->display();
  31. }
  32. }