From 097f76364ec679741b48fc2f3ba43cfa0a2ea0bb Mon Sep 17 00:00:00 2001
From: holan20180123 <56391770@qq.com>
Date: Tue, 19 Jan 2021 10:54:11 +0800
Subject: [PATCH] * Finish task #9006.
---
module/product/control.php | 23 +++++++++++++++-----
module/product/view/project.html.php | 5 ++++-
module/program/control.php | 11 +++++++++-
module/program/model.php | 5 ++++-
module/program/view/pgmbrowsebylist.html.php | 5 ++++-
5 files changed, 39 insertions(+), 10 deletions(-)
diff --git a/module/product/control.php b/module/product/control.php
index bb2d887c60..1e378415bd 100644
--- a/module/product/control.php
+++ b/module/product/control.php
@@ -84,13 +84,24 @@ class product extends control
$this->app->loadLang('my');
$this->app->loadLang('program');
- $this->view->projectStats = $this->product->getProjectStatsByProduct($productID, $status, $branch, $PRJMine);
- $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->product->project;
- $this->view->position[] = $this->products[$productID];
- $this->view->position[] = $this->lang->product->project;
- $this->view->productID = $productID;
- $this->view->status = $status;
+ /* Get PM id list. */
+ $accounts = array();
+ $projectStats = $this->product->getProjectStatsByProduct($productID, $status, $branch, $PRJMine);
+ foreach($projectStats as $project)
+ {
+ if(!empty($project->PM) and !in_array($project->PM, $accounts)) $accounts[] = $project->PM;
+ }
+ $PMList = $this->user->getListByAccounts($accounts, 'account');
+
+ $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->product->project;
+ $this->view->position[] = $this->products[$productID];
+ $this->view->position[] = $this->lang->product->project;
+ $this->view->projectStats = $projectStats;
+ $this->view->PMList = $PMList;
+ $this->view->productID = $productID;
+ $this->view->status = $status;
+ $this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->display();
}
diff --git a/module/product/view/project.html.php b/module/product/view/project.html.php
index cc7aacdc81..922e033da0 100644
--- a/module/product/view/project.html.php
+++ b/module/product/view/project.html.php
@@ -51,7 +51,10 @@
id);?> |
createLink('project', 'task', 'project=' . $project->id, '', false, $project->id), $project->name, '_parent');?> |
programName) ? $project->programName : '';?> |
- PM;?> |
+
+ PM]) ? $PMList[$project->PM]->id : ''?>
+ PM)) echo html::a($this->createLink('user', 'profile', "userID=$userID", '', true), zget($users, $project->PM), '', "data-toggle='modal' data-type='iframe' data-width='600'");?>
+ |
begin;?> |
end;?> |
processStatus('project', $project);?>
diff --git a/module/program/control.php b/module/program/control.php
index 8e14781b47..0f2dc009f1 100644
--- a/module/program/control.php
+++ b/module/program/control.php
@@ -78,14 +78,23 @@ class program extends control
$programs = $this->program->getPGMList($status, $orderBy, null, true);
}
+ /* Get PM id list. */
+ $accounts = array();
+ foreach($programs as $program)
+ {
+ if(!empty($program->PM) and !in_array($program->PM, $accounts)) $accounts[] = $program->PM;
+ }
+ $PMList = $this->loadModel('user')->getListByAccounts($accounts, 'account');
+
$this->view->title = $this->lang->program->PGMBrowse;
$this->view->position[] = $this->lang->program->PGMBrowse;
$this->view->programs = $programs;
$this->view->status = $status;
$this->view->orderBy = $orderBy;
- $this->view->users = $this->loadModel('user')->getPairs('noletter');
+ $this->view->users = $this->user->getPairs('noletter');
$this->view->programType = $programType;
+ $this->view->PMList = $PMList;
$this->display();
}
diff --git a/module/program/model.php b/module/program/model.php
index e7bfe437ed..0ac14072ad 100644
--- a/module/program/model.php
+++ b/module/program/model.php
@@ -1684,7 +1684,10 @@ class programModel extends model
echo $PRJProgram;
break;
case 'PM':
- echo zget($users, $project->PM);
+ $user = $this->loadModel('user')->getByID($project->PM, 'account');
+ $userID = !empty($user) ? $user->id : '';
+ $PMLink = helper::createLink('user', 'profile', "userID=$userID", '', true);
+ echo empty($project->PM) ? '' : html::a($PMLink, zget($users, $project->PM), '', "data-toggle='modal' data-type='iframe' data-width='600'");
break;
case 'begin':
echo $project->begin;
diff --git a/module/program/view/pgmbrowsebylist.html.php b/module/program/view/pgmbrowsebylist.html.php
index aec71e55b6..3d2f98d1a6 100644
--- a/module/program/view/pgmbrowsebylist.html.php
+++ b/module/program/view/pgmbrowsebylist.html.php
@@ -52,7 +52,10 @@
createLink('program', 'index', "programID=$program->id", '', '', $program->id), $program->name);?>
- PM);?> |
+
+ PM]) ? $PMList[$program->PM]->id : ''?>
+ PM)) echo html::a($this->createLink('user', 'profile', "userID=$userID", '', true), zget($users, $program->PM), '', "data-toggle='modal' data-type='iframe' data-width='600'");?>
+ |
budget != 0 ? $program->budget . ' ' . zget($lang->program->unitList, $program->budgetUnit) : $lang->program->future;?> |
project->statusList, $program->status, '');?> |
begin;?> |