* Remove useless for program projectView page.

This commit is contained in:
wangyidong
2023-07-25 10:57:37 +08:00
parent 30cfbfad5a
commit b3a1d048c0
5 changed files with 0 additions and 121 deletions
-97
View File
@@ -775,103 +775,6 @@ class program extends control
$this->loadModel('setting')->updateItem("{$this->app->user->account}.program.showAllProjects", $data->showAllProjects);
}
/**
* Project View list.
* copied from browse()
*
* @param string $status
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @param int $param
* @access public
* @return void
*/
public function projectView($status = 'unclosed', $orderBy = 'order_asc', $recTotal = 0, $recPerPage = 10, $pageID = 1, $param = 0)
{
if(common::hasPriv('program', 'create')) $this->lang->pageActions = html::a($this->createLink('program', 'create'), "<i class='icon icon-plus'></i> " . $this->lang->program->create, '', "class='btn btn-primary create-program-btn'");
$this->session->set('programList', $this->app->getURI(true), 'program');
$this->session->set('projectList', $this->app->getURI(true), 'program');
$this->session->set('createProjectLocate', $this->app->getURI(true), 'program');
$this->app->loadClass('pager', true);
$pager = new pager($recTotal, $recPerPage, $pageID);
$programType = $this->cookie->programType ? $this->cookie->programType : 'bylist';
if($programType === 'bygrid')
{
$programs = $this->program->getProgramStats($status, 20, $orderBy);
}
else
{
if(strtolower($status) == 'bysearch')
{
$queryID = (int)$param;
$programs = $this->program->getListBySearch($orderBy, $queryID);
}
else
{
/* Get top programs and projects. */
$topObjects = $this->program->getList($status == 'unclosed' ? 'doing,suspended,wait' : $status, $orderBy, $pager, 'top');
if(!$topObjects) $topObjects = array(0);
$programs = $this->program->getList($status == 'closed' ? 'closed' : 'all', $orderBy, null, 'child', array_keys($topObjects));
/* Get summary. */
$topCount = $indCount = 0;
foreach($programs as $program)
{
if($program->type == 'program' and $program->parent == 0) $topCount ++;
if($program->type == 'project' and $program->parent == 0) $indCount ++;
}
$summary = sprintf($this->lang->program->summary, $topCount, $indCount);
}
}
/* Set the default work hours from config. */
$defaultWorkhours = $this->config->execution->defaultWorkhours;
/* Get PM id list. */
$accounts = array();
$hasProject = false;
foreach($programs as $program)
{
if(!empty($program->PM) and !in_array($program->PM, $accounts)) $accounts[] = $program->PM;
if($hasProject === false and $program->type != 'program') $hasProject = true;
if($program->type == 'project')
{
$workhour = $this->loadModel('project')->getWorkhour($program->id);
$program->invested = round($workhour->totalConsumed / $defaultWorkhours, 1);
}
}
$PMList = $this->loadModel('user')->getListByAccounts($accounts, 'account');
/* Build the search form. */
$actionURL = $this->createLink('program', 'browse', "status=bySearch&orderBy={$orderBy}&recTotal={$recTotal}&recPerPage={$recPerPage}&pageID={$pageID}&param=myQueryID");
$this->config->program->search['actionURL'] = $actionURL;
$this->loadModel('search')->setSearchParams($this->config->program->search);
$this->view->title = $this->lang->program->projectView;
$this->view->programs = $programs;
$this->view->status = $status;
$this->view->orderBy = $orderBy;
$this->view->summary = isset($summary) ? $summary : '';
$this->view->pager = $pager;
$this->view->users = $this->user->getPairs('noletter');
$this->view->userIdPairs = $this->user->getPairs('noletter|showid');
$this->view->usersAvatar = $this->user->getAvatarPairs('');
$this->view->programType = $programType;
$this->view->PMList = $PMList;
$this->view->progressList = $this->program->getProgressList();
$this->view->hasProject = $hasProject;
$this->view->param = $param;
$this->view->recTotal = $pager->recTotal;
$this->render();
}
/**
* Product View list.
* copied from all() function of product module.