Merge branch 'fixbug_liumengyi_31992' into 'master'

* Fix bug #31992.

See merge request easycorp/zentaopms!6902
This commit is contained in:
孙广明
2023-02-09 07:05:01 +00:00
3 changed files with 8 additions and 12 deletions
+3
View File
@@ -2,3 +2,6 @@ ALTER TABLE `zt_image` ADD `localName` VARCHAR(64) NOT NULL AFTER `name`;
ALTER TABLE `zt_image` ADD `restoreDate` datetime NOT NULL AFTER `createdDate`;
ALTER TABLE `zt_ticket` MODIFY `resolution` text NOT NULL;
REPLACE INTO `zt_chart` (`id`, `name`, `dimension`, `type`, `group`, `dataset`, `desc`, `settings`, `filters`, `fields`, `sql`, `builtin`, `objects`, `createdBy`, `createdDate`, `editedBy`, `editedDate`, `deleted`) VALUES
(1105, '年度排行-个人-创建需求条目榜', 1, 'bar', 0, '', '', '{\"xaxis\":[{\"field\":\"realname\",\"name\":\"用户\"}],\"yaxis\":[{\"type\":\"value\",\"field\":\"count\",\"agg\":\"value\",\"name\":\"创建需求条目\",\"valOrAgg\":\"value\"}]}', '', NULL, 'SELECT YEAR(t1.openedDate) AS `year`,t2.realname,count(1) AS count\r\nFROM zt_story AS t1\r\nLEFT JOIN zt_user AS t2 ON t1.openedBy=t2.account\r\nWHERE t1.deleted = \'0\' AND t2.id IS NOT NULL\r\nGROUP BY `year`,t2.account ORDER BY `year`,count DESC', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00', 0);
+4 -11
View File
@@ -1143,7 +1143,6 @@ class story extends control
/* Append module when change product type. */
$moduleList = array(0 => '/');
$productStoryList = array();
$storyPlans = array();
foreach($stories as $story)
{
if(isset($modules[$story->product][$story->branch]))
@@ -1162,16 +1161,10 @@ class story extends control
if(!isset($productStoryList[$story->product][$story->branch])) $productStoryList[$story->product][$story->branch] = $this->story->getProductStoryPairs($story->product, $branch, 0, 'all', 'id_desc', 0, '', $story->type);
}
if(isset($plans[$story->product][$story->branch]) and zget($plans[$story->product][$story->branch], $story->plan))
if(!empty($story->plan) and !isset($plans[$story->product][$story->branch][$story->plan]))
{
$storyPlans = $plans[$story->product][$story->branch];
$planInfo = $this->dao->select('id,title,begin,end')->from(TABLE_PRODUCTPLAN)->where('id')->eq($story->plan)->fetchAll('id');
$storyPlans[$story->plan] = $planInfo[$story->plan]->title . ' [' . $planInfo[$story->plan]->begin . '~' . $planInfo[$story->plan]->end . ']';
}
else
{
$storyPlans = $plans;
$plan = $this->dao->select('id,title,begin,end')->from(TABLE_PRODUCTPLAN)->where('id')->eq($story->plan)->fetch();
$plans[$story->product][$story->branch][$story->plan] = $plan->title . ' [' . $plan->begin . '~' . $plan->end . ']';
}
}
@@ -1186,7 +1179,7 @@ class story extends control
$this->view->branchProduct = $branchProduct;
$this->view->storyIdList = $storyIdList;
$this->view->branch = $branch;
$this->view->plans = array('' => '') + $storyPlans;
$this->view->plans = $plans;
$this->view->storyType = $storyType;
$this->view->stories = $stories;
$this->view->executionID = $executionID;
+1 -1
View File
@@ -85,7 +85,7 @@ foreach(explode(',', $showFields) as $field)
<?php if(!$hiddenPlan):?>
<td class='text-left<?php echo zget($visibleFields, 'plan', ' hidden')?>'>
<?php $planDisabled = $story->parent < 0 ? "disabled='disabled'" : '';?>
<?php echo html::select("plans[$storyID]", isset($plans) ? array('' => '') + $plans : '', $story->plan, "class='form-control picker-select' data-drop-width='auto' $planDisabled");?>
<?php echo html::select("plans[$storyID]", isset($plans[$story->product][$story->branch]) ? array('' => '') + $plans[$story->product][$story->branch] : array(), $story->plan, "class='form-control picker-select' data-drop-width='auto' $planDisabled");?>
</td>
<?php endif;?>
<td title='<?php echo $story->title?>'>