* Adjust recent.

This commit is contained in:
leiyong
2020-11-18 15:22:49 +08:00
parent ec6ced01d5
commit 455e828fce
10 changed files with 73 additions and 77 deletions
-1
View File
@@ -1,6 +1,5 @@
<?php
$config->program = new stdclass();
$config->program->PRJRecentQuantity = 15;
$config->program->editor = new stdclass();
$config->program->editor->pgmcreate = array('id' => 'desc', 'tools' => 'simpleTools');
+7 -27
View File
@@ -575,24 +575,6 @@ class program extends control
$this->display();
}
/**
* Gets the most recently created project.
*
* @access public
* @return string
*/
public function ajaxGetRecentProjects()
{
$recentProjects = $this->program->getPRJRecent();
if(!empty($recentProjects))
{
foreach($recentProjects as $project)
{
echo html::a(helper::createLink('project', 'task', 'projectID=' . $project->id, '', false, $project->project), '<i class="icon icon-menu-doc"></i>' . $project->name, '', "class='text-ellipsis' title='$project->name'");
}
}
}
/**
* Update program order.
*
@@ -1033,22 +1015,20 @@ class program extends control
$this->loadModel('user');
$this->loadModel('dept');
$project = $this->project->getById($projectID);
$users = $this->user->getPairs('noclosed|nodeleted|devfirst|nofeedback');
$roles = $this->user->getUserRoles(array_keys($users));
$deptUsers = empty($dept) ? array() : $this->dept->getDeptUserPairs($dept);
$project = $this->project->getById($projectID);
$users = $this->user->getPairs('noclosed|nodeleted|devfirst|nofeedback');
$roles = $this->user->getUserRoles(array_keys($users));
$deptUsers = $dept === '' ? array() : $this->dept->getDeptUserPairs($dept);
$title = $this->lang->program->PRJManageMembers . $this->lang->colon . $project->name;
$position[] = $this->lang->program->PRJManageMembers;
$this->view->title = $this->lang->program->PRJManageMembers . $this->lang->colon . $project->name;
$this->view->position[] = $this->lang->program->PRJManageMembers;
$this->view->title = $title;
$this->view->position = $position;
$this->view->project = $project;
$this->view->users = $users;
$this->view->deptUsers = $deptUsers;
$this->view->roles = $roles;
$this->view->dept = $dept;
$this->view->depts = array('' => '') + $this->loadModel('dept')->getOptionMenu();
$this->view->depts = array('' => '') + $this->dept->getOptionMenu();
$this->view->currentMembers = $this->project->getTeamMembers($projectID);;
$this->display();
}
-23
View File
@@ -975,29 +975,6 @@ class programModel extends model
->fetchPairs();
}
/**
* Get recent stage and sprint.
*
* @access public
* @return object
*/
public function getPRJRecent()
{
if(!$this->app->user->admin && (empty($this->app->user->view->sprints) || empty($this->app->user->view->projects)))
{
return array();
}
return $this->dao->select('id,project,name')->from(TABLE_PROJECT)
->where('type')->in('stage,sprint')
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->sprints)->fi()
->beginIF(!$this->app->user->admin)->andWhere('project')->in($this->app->user->view->projects)->fi()
->andWhere('status')->ne('status')
->andWhere('deleted')->eq('0')
->orderBy('id_desc')
->limit('5,' . $this->config->program->PRJRecentQuantity)
->fetchAll();
}
/**
* Build the query.
*
+1 -4
View File
@@ -71,10 +71,7 @@ js::set('browseType', $browseType);
<?php
foreach($setting as $value)
{
if($value->show)
{
$this->datatable->printHead($value, $orderBy, $vars);
}
if($value->show) $this->datatable->printHead($value, $orderBy, $vars);
}
?>
</tr>