| id);?> |
- code;?> |
name);?> |
+ code;?> |
+ project->typeList, $execution->type);?> |
+ createLink('project', 'browse', "id=$execution->project", '', '', $execution->project), $execution->parentName);?> |
begin;?> |
end;?> |
diff --git a/module/program/model.php b/module/program/model.php
index 221131547c..c9ccf3c7c1 100644
--- a/module/program/model.php
+++ b/module/program/model.php
@@ -1077,6 +1077,23 @@ class programModel extends model
->fetchPairs();
}
+ /**
+ * Get project by id list.
+ *
+ * @param array $projectIdList
+ * @access public
+ * @return object
+ */
+ public function getPRJByIdList($projectIdList = array())
+ {
+ return $this->dao->select('*')->from(TABLE_PROJECT)
+ ->where('type')->eq('project')
+ ->andWhere('deleted')->eq(0)
+ ->andWhere('id')->in($projectIdList)
+ ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi()
+ ->fetchAll('id');
+ }
+
/**
* Build the query.
*
diff --git a/module/project/lang/de.php b/module/project/lang/de.php
index 8a37a03b0f..b9fa345a1c 100644
--- a/module/project/lang/de.php
+++ b/module/project/lang/de.php
@@ -342,6 +342,11 @@ $lang->printKanban->taskStatus = 'Status';
$lang->printKanban->typeList['all'] = 'Alle';
$lang->printKanban->typeList['increment'] = 'Erhöhen';
+$lang->project->typeList[''] = '';
+$lang->project->typeList['stage'] = 'Stage';
+$lang->project->typeList['sprint'] = 'Sprint';
+$lang->project->typeList['kanban'] = 'Kanban';
+
$lang->project->featureBar['task']['all'] = $lang->project->allTasks;
$lang->project->featureBar['task']['unclosed'] = $lang->project->unclosed;
$lang->project->featureBar['task']['assignedtome'] = $lang->project->assignedToMe;
diff --git a/module/project/lang/en.php b/module/project/lang/en.php
index e21b6e1a17..08fa36d7a9 100644
--- a/module/project/lang/en.php
+++ b/module/project/lang/en.php
@@ -342,6 +342,11 @@ $lang->printKanban->taskStatus = 'Status';
$lang->printKanban->typeList['all'] = 'All';
$lang->printKanban->typeList['increment'] = 'Increment';
+$lang->project->typeList[''] = '';
+$lang->project->typeList['stage'] = 'Stage';
+$lang->project->typeList['sprint'] = 'Sprint';
+$lang->project->typeList['kanban'] = 'Kanban';
+
$lang->project->featureBar['task']['all'] = $lang->project->allTasks;
$lang->project->featureBar['task']['unclosed'] = $lang->project->unclosed;
$lang->project->featureBar['task']['assignedtome'] = $lang->project->assignedToMe;
diff --git a/module/project/lang/fr.php b/module/project/lang/fr.php
index 08af772b37..e267af982c 100644
--- a/module/project/lang/fr.php
+++ b/module/project/lang/fr.php
@@ -342,6 +342,11 @@ $lang->printKanban->taskStatus = 'Statut';
$lang->printKanban->typeList['all'] = 'Tout';
$lang->printKanban->typeList['increment'] = 'Incrément';
+$lang->project->typeList[''] = '';
+$lang->project->typeList['stage'] = 'Stage';
+$lang->project->typeList['sprint'] = 'Sprint';
+$lang->project->typeList['kanban'] = 'Kanban';
+
$lang->project->featureBar['task']['all'] = $lang->project->allTasks;
$lang->project->featureBar['task']['unclosed'] = $lang->project->unclosed;
$lang->project->featureBar['task']['assignedtome'] = $lang->project->assignedToMe;
diff --git a/module/project/lang/vi.php b/module/project/lang/vi.php
index 2e8f167ae1..dc4a7152f2 100644
--- a/module/project/lang/vi.php
+++ b/module/project/lang/vi.php
@@ -342,6 +342,11 @@ $lang->printKanban->taskStatus = 'Tình trạng';
$lang->printKanban->typeList['all'] = 'Tất cả';
$lang->printKanban->typeList['increment'] = 'Tăng dần';
+$lang->project->typeList[''] = '';
+$lang->project->typeList['stage'] = 'Stage';
+$lang->project->typeList['sprint'] = 'Sprint';
+$lang->project->typeList['kanban'] = 'Kanban';
+
$lang->project->featureBar['task']['all'] = $lang->project->allTasks;
$lang->project->featureBar['task']['unclosed'] = $lang->project->unclosed;
$lang->project->featureBar['task']['assignedtome'] = $lang->project->assignedToMe;
diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php
index 7503bb04e0..f1b276b734 100644
--- a/module/project/lang/zh-cn.php
+++ b/module/project/lang/zh-cn.php
@@ -342,6 +342,11 @@ $lang->printKanban->taskStatus = '状态';
$lang->printKanban->typeList['all'] = '全部';
$lang->printKanban->typeList['increment'] = '增量';
+$lang->project->typeList[''] = '';
+$lang->project->typeList['stage'] = '阶段';
+$lang->project->typeList['sprint'] = '冲刺';
+$lang->project->typeList['kanban'] = '看板';
+
$lang->project->featureBar['task']['all'] = $lang->project->allTasks;
$lang->project->featureBar['task']['unclosed'] = $lang->project->unclosed;
$lang->project->featureBar['task']['assignedtome'] = $lang->project->assignedToMe;
diff --git a/module/project/lang/zh-tw.php b/module/project/lang/zh-tw.php
index d6c38fd7b1..23f45cb652 100644
--- a/module/project/lang/zh-tw.php
+++ b/module/project/lang/zh-tw.php
@@ -342,6 +342,11 @@ $lang->printKanban->taskStatus = '狀態';
$lang->printKanban->typeList['all'] = '全部';
$lang->printKanban->typeList['increment'] = '增量';
+$lang->project->typeList[''] = '';
+$lang->project->typeList['stage'] = '階段';
+$lang->project->typeList['sprint'] = '衝刺';
+$lang->project->typeList['kanban'] = '看板';
+
$lang->project->featureBar['task']['all'] = $lang->project->allTasks;
$lang->project->featureBar['task']['unclosed'] = $lang->project->unclosed;
$lang->project->featureBar['task']['assignedtome'] = $lang->project->assignedToMe;
diff --git a/module/user/model.php b/module/user/model.php
index c5bb55acd4..0100ce9ecc 100644
--- a/module/user/model.php
+++ b/module/user/model.php
@@ -977,26 +977,36 @@ class userModel extends model
public function getProjects($account, $type = 'project', $pager = null)
{
if($type == 'execution') $type = 'sprint,stage';
- $projects = $this->dao->select('t1. *,t2. *')->from(TABLE_TEAM)->alias('t1')
+ $myProjectsList = $this->dao->select('t1. *,t2. *')->from(TABLE_TEAM)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.root = t2.id')
->where('t1.type')->in($type)
->andWhere('t1.account')->eq($account)
->andWhere('t2.deleted')->eq(0)
->orderBy('t2.id_desc')
->page($pager)
- ->fetchAll();
+ ->fetchGroup('project');
- /* Judge whether the project is delayed. */
- foreach($projects as $project)
+ $projectIdList = array_keys($myProjectsList);
+ $projectList = $this->loadModel('program')->getPRJByIdList($projectIdList);
+
+ $myProjects = array();
+ foreach($myProjectsList as $projects)
{
- if($project->status != 'done' and $project->status != 'closed' and $project->status != 'suspended')
+ foreach($projects as $project)
{
- $delay = helper::diffDate(helper::today(), $project->end);
- if($delay > 0) $project->delay = $delay;
+ /* Judge whether the project is delayed. */
+ if($project->status != 'done' and $project->status != 'closed' and $project->status != 'suspended')
+ {
+ $delay = helper::diffDate(helper::today(), $project->end);
+ if($delay > 0) $project->delay = $delay;
+ }
+
+ $project->parentName = $projectList[$project->project]->name;
+ $myProjects[$project->id] = $project;
}
}
- return $projects;
+ return $myProjects;
}
/**
From 7c4908478c158033f09ecc95904846b5ee348577 Mon Sep 17 00:00:00 2001
From: tianshujie98
Date: Wed, 25 Nov 2020 09:34:08 +0800
Subject: [PATCH 6/9] * Adjust the back button link.
---
module/program/view/prjmanagemembers.html.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/module/program/view/prjmanagemembers.html.php b/module/program/view/prjmanagemembers.html.php
index 60183e0018..a67c929d64 100644
--- a/module/program/view/prjmanagemembers.html.php
+++ b/module/program/view/prjmanagemembers.html.php
@@ -83,7 +83,7 @@
- |
+ | createLink('program', 'PRJBrowse', '', '', '', $project->id), $lang->goback, '', 'class="btn btn-back btn-wide"');?> |
From 55fb0867cbacc33f6178de205e7738e1225b89b8 Mon Sep 17 00:00:00 2001
From: z
Date: Wed, 25 Nov 2020 09:54:47 +0800
Subject: [PATCH 7/9] * code for task #8496.
---
module/custom/control.php | 150 +++---------------
module/custom/js/configurescrum.js | 2 +
module/custom/js/configurewaterfall.js | 2 +
module/custom/lang/zh-cn.php | 1 +
module/custom/view/configurescrum.html.php | 73 +--------
.../custom/view/configurewaterfall.html.php | 69 +-------
6 files changed, 30 insertions(+), 267 deletions(-)
diff --git a/module/custom/control.php b/module/custom/control.php
index 31ca3af33c..bcb1081fde 100644
--- a/module/custom/control.php
+++ b/module/custom/control.php
@@ -398,7 +398,7 @@ class custom extends control
* @access public
* @return void
*/
- public function configureWaterfall($type = 'concept')
+ public function configureWaterfall()
{
$this->app->loadLang('custom');
$this->lang->custom->menu = new stdclass();
@@ -406,76 +406,22 @@ class custom extends control
if($_POST)
{
- if($type == 'concept')
- {
- $result = $this->custom->setURAndSR();
- if(!$result) $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->URSREmpty));
- }
-
- if($type == 'user' and isset($_POST['keys']))
- {
- $lang = $_POST['lang'];
- $oldCustoms = $this->custom->getItems("lang=$lang&module=user§ion=roleList");
- foreach($_POST['keys'] as $index => $key)
- {
- if(strlen($key) > 10) $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->invalidStrlen['ten']));
- }
-
- $this->custom->deleteItems("lang=$lang&module=user§ion=roleList");
- $data = fixer::input('post')->get();
- foreach($data->keys as $index => $key)
- {
-
- $value = $data->values[$index];
- $system = $data->systems[$index];
- $this->custom->setItem("{$lang}.user.roleList.{$key}.{$system}", $value);
- }
- }
+ $result = $this->custom->setURAndSR();
+ if(!$result) $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->URSREmpty));
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
- $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('custom', 'configurewaterfall', "type=$type")));
+ $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('custom', 'configurewaterfall')));
}
- if($type == 'user')
- {
- $this->app->loadLang('user');
- $fieldList = zget($this->lang->user, 'roleList', '');
- $lang = $this->app->getClientLang();
- $dbFields = $this->custom->getItems("lang=$lang&module=user§ion=roleList");
- if(empty($dbFields)) $dbFields = $this->custom->getItems("lang=all&module=user§ion=roleList");
- if($dbFields)
- {
- $dbField = reset($dbFields);
- if($lang != $dbField->lang)
- {
- $lang = str_replace('-', "_", $dbField->lang);
- foreach($fieldList as $key => $value)
- {
- if(isset($dbFields[$key]) and $value != $dbFields[$key]->value) $fieldList[$key] = $dbFields[$key]->value;
- }
- }
- }
-
- $this->view->fieldList = $fieldList;
- $this->view->dbFields = $dbFields;
- $this->view->currentLang = $lang;
- $this->view->lang2Set = str_replace('_', '-', $lang);
- }
-
- if($type == 'concept')
- {
- $URSRName = $this->dao->select("`value`")->from(TABLE_CONFIG)
- ->where('module')->eq('custom')
- ->andWhere('section')->eq('common')
- ->andWhere('`key`')->eq('URSRName')
- ->fetch('value');
-
- $this->view->URSRName = json_decode($URSRName);
- }
+ $URSRName = $this->dao->select("`value`")->from(TABLE_CONFIG)
+ ->where('module')->eq('custom')
+ ->andWhere('section')->eq('common')
+ ->andWhere('`key`')->eq('URSRName')
+ ->fetch('value');
$this->view->title = $this->lang->custom->common;
$this->view->position[] = $this->lang->custom->common;
- $this->view->type = $type;
+ $this->view->URSRName = json_decode($URSRName);
$this->display();
}
@@ -486,7 +432,7 @@ class custom extends control
* @access public
* @return void
*/
- public function configureScrum($type = 'concept')
+ public function configureScrum()
{
$this->app->loadLang('custom');
$this->lang->custom->menu = new stdclass();
@@ -494,77 +440,23 @@ class custom extends control
if($_POST)
{
- if($type == 'concept')
- {
- $this->custom->setConcept();
- $result = $this->custom->setURAndSR();
- if(!$result) $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->URSREmpty));
- }
+ $this->custom->setConcept();
+ $result = $this->custom->setURAndSR();
+ if(!$result) $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->URSREmpty));
- if($type == 'user' && isset($_POST['keys']))
- {
- $lang = $_POST['lang'];
- $oldCustoms = $this->custom->getItems("lang=$lang&module=user§ion=roleList");
- foreach($_POST['keys'] as $index => $key)
- {
- if(strlen($key) > 10) $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->invalidStrlen['ten']));
- }
-
- $this->custom->deleteItems("lang=$lang&module=user§ion=roleList");
- $data = fixer::input('post')->get();
- foreach($data->keys as $index => $key)
- {
-
- $value = $data->values[$index];
- $system = $data->systems[$index];
- $this->custom->setItem("{$lang}.user.roleList.{$key}.{$system}", $value);
- }
- }
-
- $locate = inlink('configureScrum', "type=$type");
+ $locate = inlink('configureScrum');
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locate));
}
- if($type == 'concept')
- {
- $URSRName = $this->dao->select("`value`")->from(TABLE_CONFIG)
- ->where('module')->eq('custom')
- ->andWhere('section')->eq('common')
- ->andWhere('`key`')->eq('URSRName')
- ->fetch('value');
-
- $this->view->URSRName = json_decode($URSRName);
- }
-
- if($type == 'user')
- {
- $this->app->loadLang('user');
- $fieldList = zget($this->lang->user, 'roleList', '');
- $lang = $this->app->getClientLang();
- $dbFields = $this->custom->getItems("lang=$lang&module=user§ion=roleList");
- if(empty($dbFields)) $dbFields = $this->custom->getItems("lang=all&module=user§ion=roleList");
- if($dbFields)
- {
- $dbField = reset($dbFields);
- if($lang != $dbField->lang)
- {
- $lang = str_replace('-', "_", $dbField->lang);
- foreach($fieldList as $key => $value)
- {
- if(isset($dbFields[$key]) and $value != $dbFields[$key]->value) $fieldList[$key] = $dbFields[$key]->value;
- }
- }
- }
-
- $this->view->fieldList = $fieldList;
- $this->view->dbFields = $dbFields;
- $this->view->currentLang = $lang;
- $this->view->lang2Set = str_replace('_', '-', $lang);
- }
+ $URSRName = $this->dao->select("`value`")->from(TABLE_CONFIG)
+ ->where('module')->eq('custom')
+ ->andWhere('section')->eq('common')
+ ->andWhere('`key`')->eq('URSRName')
+ ->fetch('value');
$this->view->title = $this->lang->custom->configureScrum;
$this->view->position[] = $this->lang->custom->configureScrum;
- $this->view->type = $type;
+ $this->view->URSRName = json_decode($URSRName);
$this->display();
}
diff --git a/module/custom/js/configurescrum.js b/module/custom/js/configurescrum.js
index ff6b6463fd..972fb87827 100644
--- a/module/custom/js/configurescrum.js
+++ b/module/custom/js/configurescrum.js
@@ -5,10 +5,12 @@ $(function()
if($(this).val() == 0)
{
$('#URSRName').addClass('hidden');
+ $('#customURSR').addClass('hidden');
}
else
{
$('#URSRName').removeClass('hidden');
+ $('#customURSR').removeClass('hidden');
}
});
diff --git a/module/custom/js/configurewaterfall.js b/module/custom/js/configurewaterfall.js
index c68b418bd9..13af9a1e0f 100644
--- a/module/custom/js/configurewaterfall.js
+++ b/module/custom/js/configurewaterfall.js
@@ -5,10 +5,12 @@ $(function()
if($(this).val() == 0)
{
$('#URSRName').addClass('hidden');
+ $('#customURSR').addClass('hidden');
}
else
{
$('#URSRName').removeClass('hidden');
+ $('#customURSR').removeClass('hidden');
}
});
diff --git a/module/custom/lang/zh-cn.php b/module/custom/lang/zh-cn.php
index 1c0809b32f..67ef1d38c0 100644
--- a/module/custom/lang/zh-cn.php
+++ b/module/custom/lang/zh-cn.php
@@ -125,6 +125,7 @@ $lang->custom->todo->fields['typeList'] = '类型';
$lang->custom->todo->fields['statusList'] = '状态';
$lang->custom->user = new stdClass();
+$lang->custom->user->fields['roleList'] = '职位';
$lang->custom->user->fields['statusList'] = '状态';
$lang->custom->user->fields['contactField'] = '可用联系方式';
$lang->custom->user->fields['deleted'] = '列出已删除用户';
diff --git a/module/custom/view/configurescrum.html.php b/module/custom/view/configurescrum.html.php
index 19a0774e41..63170d6ab1 100644
--- a/module/custom/view/configurescrum.html.php
+++ b/module/custom/view/configurescrum.html.php
@@ -10,40 +10,19 @@
*/
?>
-
-
-
-
- |
-
-
- |
-
-
-
- |
- |
-EOT;
-?>
-
-
- " . $lang->custom->concept . '', '', "class='btn btn-link concept'");?>
- " . $lang->user->role . '', '', "class='btn btn-link user'");?>
+ " . $lang->custom->concept . '', '', "class='btn btn-link btn-active-text concept'");?>
- " . $lang->custom->concept . '', '', "class='btn btn-link concept'");?>
- " . $lang->user->role . '', '', "class='btn btn-link user'");?>
+ " . $lang->custom->concept . '', '', "class='btn btn-link btn-active-text concept'");?>