diff --git a/module/block/view/taskblock.html.php b/module/block/view/taskblock.html.php
index 0b2d1d9b4e..1f3ecfedc5 100644
--- a/module/block/view/taskblock.html.php
+++ b/module/block/view/taskblock.html.php
@@ -44,7 +44,7 @@
| id);?> |
task->priList, $task->pri, $task->pri)?> |
- createLink('task', 'view', "taskID=$task->id", '', '', $task->program), $task->name)?> |
+ createLink('task', 'view', "taskID=$task->id", '', '', $task->PRJ), $task->name)?> |
estimate?> |
deadline, 0, 4) > 0) echo $task->deadline;?> |
diff --git a/module/common/model.php b/module/common/model.php
index 60fb288711..e6c975f2da 100644
--- a/module/common/model.php
+++ b/module/common/model.php
@@ -539,28 +539,23 @@ class commonModel extends model
* @access public
* @return string
*/
- public function getRecentProjects()
+ public static function getRecentProjects()
{
+ global $dbh, $lang, $app;
echo '
';
- echo ' ' . $this->lang->recent . '';
+ echo ' ' . $lang->recent . '';
- $recentProjects = $this->dao->select('id,parent,name')->from(TABLE_PROJECT)
- ->where('type')->in('stage,sprint')
- ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi()
- ->andWhere('status')->ne('close')
- ->andWhere('deleted')->eq('0')
- ->orderBy('id_desc')
- ->limit(5)
- ->fetchAll();
+ $extraWhere = empty($app->user->admin) && !empty($app->user->view->projects) ? ' and parent in (' . $app->user->view->projects . ') ' : '';
+ $recentProjects = $dbh->query('select * from ' . TABLE_PROJECT . " where type in ('stage','sprint') $extraWhere and status != 'close' and deleted = '0' order by 'id' desc limit 6")->fetchAll();
if(!empty($recentProjects))
{
- foreach($recentProjects as $project)
+ foreach($recentProjects as $key => $project)
{
+ if($key == 5) continue;
echo '' . html::a(helper::createLink('project', 'task', 'projectID=' . $project->id, '', false, $project->parent), $project->name, '', "class='text-ellipsis' title='$project->name'") . '';
}
-
- if(count($recentProjects) >= 5) echo '' . $this->lang->more . '';
+ if(count($recentProjects) > 5) echo '' . $lang->more . '';
}
echo "\n";
diff --git a/module/common/view/header.html.php b/module/common/view/header.html.php
index 9d8603b835..fb260770fa 100755
--- a/module/common/view/header.html.php
+++ b/module/common/view/header.html.php
@@ -14,7 +14,7 @@ include 'chosen.html.php';