Merge branch 'sprint/cyy_70499' into 'master'

Sprint/cyy 70499

See merge request easycorp/zentaopms!5629
This commit is contained in:
李玉春
2022-09-30 01:30:06 +00:00
4 changed files with 58 additions and 9 deletions
+6
View File
@@ -39,3 +39,9 @@ td.c-branch {overflow: hidden; text-align: left !important; text-overflow: ellip
#productplanList .c-actions .btn+.btn {margin-left: -1px;}
#productplanList .c-actions .btn {display: block; float: left;}
#productplanList td.c-actions .dividing-line {width: 1px; height: 16px; display: inline-block; vertical-align: middle; background: #F4F5F7; margin: 6px 0 0 0; float: left;}
.popover.right {left: 40px; top: -5px; white-space: nowrap;}
.popover.right .popover-content {padding: 5px 20px 0px 0px;}
.execution-tip {list-style: none;}
#taskPopover .arrow {margin-top: -55px;}
+20
View File
@@ -99,6 +99,26 @@ $(function()
{
$.zui.ContextMenu.hide();
});
$('.project-popover').on('click', function(e)
{
e.stopPropagation();
var showPopover = $(this).next().css('display') == 'block';
$('.popover.right').hide();
if(!showPopover) $(this).next().show();
});
$('.project-link').on('click', function()
{
$('.popover.right').hide();
});
/* Hide popover tip. */
$(document).on('mousedown', function(e)
{
var $target = $(e.target);
var $toggle = $target.closest('.popover, .project-popover');
if(!$toggle.length) $('.popover.right').hide();
});
});
/* Define menu creators. */
+7 -8
View File
@@ -122,14 +122,14 @@ class productplanModel extends model
foreach($planIdList as $planID)
{
$planProjects[$planID] = $this->dao->select('t1.*,t2.type')->from(TABLE_PROJECTPRODUCT)->alias('t1')
$planProjects[$planID] = $this->dao->select('t1.project,t2.name')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id')
->where('t1.product')->eq($product)
->andWhere('t2.deleted')->eq(0)
->andWhere('t1.plan')->like(",$planID,")
->andWhere('t2.type')->in('sprint,stage,kanban')
->orderBy('project_desc')
->fetch('project');
->fetchAll('project');
}
$storyCountInTable = $this->dao->select('plan,count(story) as count')->from(TABLE_PLANSTORY)->where('plan')->in($planIdList)->groupBy('plan')->fetchPairs('plan', 'count');
@@ -159,12 +159,11 @@ class productplanModel extends model
->andWhere('deleted')->eq(0)
->fetchPairs('id', 'estimate');
}
$plan->stories = count($storyPairs);
$plan->bugs = isset($bugs[$plan->id]) ? count($bugs[$plan->id]) : 0;
$plan->hour = array_sum($storyPairs);
$plan->project = zget($planProjects, $plan->id, '');
$plan->projectID = $plan->project;
$plan->expired = $plan->end < $date ? true : false;
$plan->stories = count($storyPairs);
$plan->bugs = isset($bugs[$plan->id]) ? count($bugs[$plan->id]) : 0;
$plan->hour = array_sum($storyPairs);
$plan->projects = zget($planProjects, $plan->id, '');
$plan->expired = $plan->end < $date ? true : false;
/* Sync linked stories. */
if(!isset($storyCountInTable[$plan->id]) or $storyCountInTable[$plan->id] != $plan->stories)
+25 -1
View File
@@ -145,7 +145,31 @@
<td class='text-center'><?php echo $plan->stories;?></td>
<td class='text-center'><?php echo $plan->bugs;?></td>
<td class='text-center'><?php echo $plan->hour;?></td>
<td class='text-center'><?php if(!empty($plan->projectID)) echo html::a(helper::createLink('execution', 'task', 'projectID=' . $plan->projectID), '<i class="icon-search"></i>');?></td>
<td class='text-center'>
<?php
if(!empty($plan->projects))
{
if(count($plan->projects) === 1)
{
$executionID = key($plan->projects);
echo html::a(helper::createLink('execution', 'task', "executionID=$executionID"), '<i class="icon-run text-primary"></i>', '', "title='{$plan->projects[$executionID]->name}'");
}
else
{
$executionHtml = '<div class="popover right" id="taskPopover">';
$executionHtml .= '<div class="arrow"></div>';
$executionHtml .= '<div class="popover-content">';
$executionHtml .= '<ul class="execution-tip">';
foreach($plan->executions as $executionID => $execution) $executionHtml .= '<li>' . html::a(helper::createLink('execution', 'task', "executionID=$executionID"), $execution->name, '', "class='execution-link' title='{$execution->name}'") . '</li>';
$executionHtml .= '</ul>';
$executionHtml .= '</div>';
$executionHtml .= '</div>';
echo "<i class='icon-run execution-popover text-primary'></i>";
echo $executionHtml;
}
}
?>
</td>
<td class='text-left content'>
<?php $desc = trim(strip_tags(str_replace(array('</p>', '<br />', '<br>', '<br/>'), "\n", str_replace(array("\n", "\r"), '', $plan->desc)), '<img>'));?>
<div title='<?php echo $desc;?>'><?php echo nl2br($desc);?></div>