* finish task #5364.

This commit is contained in:
wangyidong
2019-03-20 14:39:55 +08:00
parent 310b4c22a4
commit 559ff6b3b0
4 changed files with 20 additions and 2 deletions
+6
View File
@@ -342,6 +342,12 @@ class actionModel extends model
}
}
}
elseif(($actionName == 'opened' or $actionName == 'managed') and $objectType == 'project')
{
$linkedProducts = $this->dao->select('id,name')->from(TABLE_PRODUCT)->where('id')->in($action->extra)->fetchPairs('id', 'name');
$action->extra = '';
if($linkedProducts) $action->extra = sprintf($this->lang->project->action->extra, '<strong>' . join(', ', $linkedProducts) . '</strong>');
}
$action->history = isset($histories[$actionID]) ? $histories[$actionID] : array();
$actionName = strtolower($action->action);
+4 -2
View File
@@ -1053,7 +1053,7 @@ class project extends control
$this->project->updateProducts($projectID);
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
$this->loadModel('action')->create('project', $projectID, 'opened');
$this->loadModel('action')->create('project', $projectID, 'opened', '', join(',', $_POST['products']));
$planID = reset($_POST['plans']);
if(!empty($planID))
@@ -1711,7 +1711,7 @@ class project extends control
* @access public
* @return void
*/
public function manageProducts($projectID, $from='')
public function manageProducts($projectID, $from = '')
{
/* use first project if projectID does not exist. */
if(!isset($this->projects[$projectID])) $projectID = key($this->projects);
@@ -1723,6 +1723,8 @@ class project extends control
$this->project->updateProducts($projectID);
if(dao::isError()) die(js::error(dao::getError()));
$this->loadModel('action')->create('project', $projectID, 'Managed', '', join(',', $_POST['products']));
die(js::locate($browseProjectLink));
}
+5
View File
@@ -246,6 +246,11 @@ $lang->project->withweekend = 'incl. Weekend';
$lang->project->interval = 'Intervals';
$lang->project->fixFirstWithLeft = 'Modify the left';
$lang->project->action = new stdclass();
$lang->project->action->opened = '$date, created by <strong>$actor</strong> .' . "\n";
$lang->project->action->managed = '$date, managed by <strong>$actor</strong> .' . "\n";
$lang->project->action->extra = 'The related products are %s.';
/* 统计。*/
$lang->project->charts = new stdclass();
$lang->project->charts->burn = new stdclass();
+5
View File
@@ -246,6 +246,11 @@ $lang->project->withweekend = '显示周末';
$lang->project->interval = '间隔';
$lang->project->fixFirstWithLeft = '修改剩余工时';
$lang->project->action = new stdclass();
$lang->project->action->opened = '$date, 由 <strong>$actor</strong> 创建。$extra' . "\n";
$lang->project->action->managed = '$date, 由 <strong>$actor</strong> 维护。$extra' . "\n";
$lang->project->action->extra = '相关产品为 %s。';
/* 统计。*/
$lang->project->charts = new stdclass();
$lang->project->charts->burn = new stdclass();