* Sort projects.
This commit is contained in:
@@ -116,7 +116,7 @@ class project extends control
|
||||
public function ajaxGetDropMenu($projectID = 0, $module, $method)
|
||||
{
|
||||
$programs = $this->dao->select('id, name')->from(TABLE_PROGRAM)->where('type')->eq('program')->andWhere('deleted')->eq(0)->orderBy('order_asc')->fetchPairs();
|
||||
$projects = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->in($this->app->user->view->projects)->andWhere('deleted')->eq(0)->orderBy('openedDate_desc')->fetchAll('id');
|
||||
$projects = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->in($this->app->user->view->projects)->andWhere('deleted')->eq(0)->orderBy('order_asc')->fetchAll('id');
|
||||
|
||||
/* Sort project by program. */
|
||||
$orderedProjects = array();
|
||||
@@ -124,14 +124,11 @@ class project extends control
|
||||
{
|
||||
foreach($projects as $project)
|
||||
{
|
||||
if($project->parent == $programID)
|
||||
{
|
||||
$orderedProjects[] = $project;
|
||||
unset($projects[$project->id]);
|
||||
}
|
||||
if($project->parent and $project->parent != $programID) continue;
|
||||
$orderedProjects[] = $project;
|
||||
unset($projects[$project->id]);
|
||||
}
|
||||
}
|
||||
if(!empty($projects)) $orderedProjects += $projects;
|
||||
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->projects = $orderedProjects;
|
||||
|
||||
@@ -67,7 +67,7 @@ $lang->project->realBegan = '实际开始日期';
|
||||
$lang->project->bygrid = '看板';
|
||||
$lang->project->bylist = '列表';
|
||||
$lang->project->mine = '我参与的';
|
||||
$lang->project->myProject = '我负责:';
|
||||
$lang->project->myProject = '我参与:';
|
||||
$lang->project->other = '其他:';
|
||||
$lang->project->acl = '访问控制';
|
||||
$lang->project->setPlanduration = '设置工期';
|
||||
|
||||
Reference in New Issue
Block a user