* finish task #36749.

This commit is contained in:
wangyidong
2021-03-22 11:04:27 +08:00
parent ec5b9b2ace
commit 9531c783de
5 changed files with 83 additions and 62 deletions
+2 -1
View File
@@ -2551,7 +2551,7 @@ class execution extends control
* @access public
* @return void
*/
public function ajaxGetDropMenu($module, $method, $extra)
public function ajaxGetDropMenu($executionID, $module, $method, $extra)
{
$projects = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->in($this->app->user->view->projects)->andWhere('deleted')->eq(0)->orderBy('order_desc')->fetchAll('id');
@@ -2579,6 +2579,7 @@ class execution extends control
$this->view->link = $this->execution->getLink($module, $method, $extra);
$this->view->module = $module;
$this->view->method = $method;
$this->view->executionID = $executionID;
$this->view->extra = $extra;
$this->view->projects = $this->project->getPairsByModel();
$this->view->executions = $orderedExecutions;
+2 -2
View File
@@ -139,7 +139,7 @@ class executionModel extends model
}
}
$dropMenuLink = helper::createLink('execution', 'ajaxGetDropMenu', "module=$currentModule&method=$currentMethod&extra=$extra");
$dropMenuLink = helper::createLink('execution', 'ajaxGetDropMenu', "executionID=$executionID&module=$currentModule&method=$currentMethod&extra=$extra");
$currentExecutionName = '';
if(isset($currentExecution->name)) $currentExecutionName = $currentExecution->name;
@@ -850,7 +850,7 @@ class executionModel extends model
$currentExecutionName = $currentExecution->name;
}
$dropMenuLink = helper::createLink('execution', 'ajaxGetDropMenu', "module=$currentModule&method=$currentMethod&extra=");
$dropMenuLink = helper::createLink('execution', 'ajaxGetDropMenu', "executionID=$executionID&module=$currentModule&method=$currentMethod&extra=");
$output = "<div class='btn-group header-btn'>" . html::a(helper::createLink('execution', 'all'), "<i class='icon icon-run'></i> {$this->lang->execution->common}", '', "class='btn'") . '</div>';
$output .= "<div class='btn-group header-btn' id='swapper'><button data-toggle='dropdown' type='button' class='btn' id='currentItem' title='{$currentExecutionName}'><span class='text'>{$currentExecutionName}</span> <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
$output .= '<div class="input-control search-box has-icon-left has-icon-right search-example"><input type="search" class="form-control search-input" /><label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label><a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a></div>';
+26 -20
View File
@@ -20,33 +20,34 @@ $executionsPinYin = common::convert2Pinyin($executionNames);
foreach($executions as $execution)
{
$selected = $execution->id == $executionID ? 'selected' : '';
$executionName = zget($projects, $execution->project) . '/' . $execution->name;
if($execution->status != 'done' and $execution->status != 'closed' and $execution->PM == $this->app->user->account)
{
$myProjectsHtml .= html::a(sprintf($link, $execution->id), "<i class='icon icon-{$lang->icons[$execution->type]}'></i> " . $executionName, '', "class='text-important' title='{$executionName}' data-key='" . zget($executionsPinYin, $execution->name, '') . "'");
$myProjectsHtml .= html::a(sprintf($link, $execution->id), "<i class='icon icon-{$lang->icons[$execution->type]}'></i> " . $executionName, '', "class='text-important $selected' title='{$executionName}' data-key='" . zget($executionsPinYin, $execution->name, '') . "'");
}
else if($execution->status != 'done' and $execution->status != 'closed' and !($execution->PM == $this->app->user->account))
{
$normalProjectsHtml .= html::a(sprintf($link, $execution->id), "<i class='icon icon-{$lang->icons[$execution->type]}'></i> " . $executionName, '', "title='{$executionName}' data-key='" . zget($executionsPinYin, $execution->name, '') . "'");
$normalProjectsHtml .= html::a(sprintf($link, $execution->id), "<i class='icon icon-{$lang->icons[$execution->type]}'></i> " . $executionName, '', "class='$selected' title='{$executionName}' data-key='" . zget($executionsPinYin, $execution->name, '') . "'");
}
else if($execution->status == 'done' or $execution->status == 'closed') $closedProjectsHtml .= html::a(sprintf($link, $execution->id), "<i class='icon icon-{$lang->icons[$execution->type]}'></i> " . $executionName, '', "title='{$executionName}' data-key='" . zget($executionsPinYin, $execution->name, '') . "'");
else if($execution->status == 'done' or $execution->status == 'closed') $closedProjectsHtml .= html::a(sprintf($link, $execution->id), "<i class='icon icon-{$lang->icons[$execution->type]}'></i> " . $executionName, '', "class='$selected' title='{$executionName}' data-key='" . zget($executionsPinYin, $execution->name, '') . "'");
}
?>
<div class="table-row">
<div class="table-col col-left">
<div class='list-group'>
<?php
if(!empty($myProjectsHtml))
{
echo "<div class='heading'>{$lang->execution->mine}</div>";
echo $myProjectsHtml;
if(!empty($myProjectsHtml))
{
echo "<div class='heading'>{$lang->execution->other}</div>";
}
}
echo $normalProjectsHtml;
?>
<?php
if(!empty($myProjectsHtml))
{
echo "<div class='heading'>{$lang->execution->mine}</div>";
echo $myProjectsHtml;
if(!empty($myProjectsHtml))
{
echo "<div class='heading'>{$lang->execution->other}</div>";
}
}
echo $normalProjectsHtml;
?>
</div>
<div class="col-footer">
<?php echo html::a(helper::createLink('execution', 'all'), '<i class="icon icon-cards-view muted"></i> ' . $lang->execution->all, '', 'class="not-list-item"'); ?>
@@ -54,10 +55,15 @@ foreach($executions as $execution)
</div>
</div>
<div class="table-col col-right">
<div class='list-group'>
<?php
echo $closedProjectsHtml;
?>
</div>
<div class='list-group'><?php echo $closedProjectsHtml;?></div>
</div>
</div>
<script>
$(function()
{
if($('#dropMenu .table-row .col-left .list-group .selected').length > 0)
{
$('#dropMenu .table-row .col-left .list-group').scrollTop($('#dropMenu .table-row .col-left .list-group .selected').position().top - 75);
}
})
</script>
+26 -18
View File
@@ -22,43 +22,44 @@ $closedProductsHtml = '';
foreach($products as $product)
{
$selected = $product->id == $productID ? 'selected' : '';
$productName = $product->program ? zget($programs, $product->program, '') . '/' : '';
$productName .= $product->line ? zget($lines, $product->line, '') . '/' . $product->name : $product->name;
if($product->status == 'normal' and $product->PO == $this->app->user->account)
{
$objectID = ($product->type != 'platform' && $module == 'branch' && $method == 'manage') ? $productID : $product->id;
$linkHtml = $this->product->setParamsForLink($module, $link, $projectID, $product->id);
$myProductsHtml .= html::a($linkHtml, $productName, '', "class='text-important' title='{$productName}' data-key='" . zget($productsPinYin, $product->name, '') . "' data-app='$openApp'");
$myProductsHtml .= html::a($linkHtml, $productName, '', "class='text-important $selected' title='{$productName}' data-key='" . zget($productsPinYin, $product->name, '') . "' data-app='$openApp'");
}
else if($product->status == 'normal' and !($product->PO == $this->app->user->account))
{
$objectID = ($product->type != 'platform' && $module == 'branch' && $method == 'manage') ? $productID : $product->id;
$linkHtml = $this->product->setParamsForLink($module, $link, $projectID, $product->id);
$normalProductsHtml .= html::a($linkHtml, $productName, '', "title='{$productName}' data-key='" . zget($productsPinYin, $product->name, '') . "' data-app='$openApp'");
$normalProductsHtml .= html::a($linkHtml, $productName, '', "class='$selected' title='{$productName}' data-key='" . zget($productsPinYin, $product->name, '') . "' data-app='$openApp'");
}
else if($product->status == 'closed')
{
$objectID = ($product->type != 'platform' && $module == 'branch' && $method == 'manage') ? $productID : $product->id;
$linkHtml = $this->product->setParamsForLink($module, $link, $projectID, $objectID);
$closedProductsHtml .= html::a($linkHtml, $productName, '', "title='{$productName}' class='closed' data-key='" . zget($productsPinYin, $product->name, '') . "' data-app='$openApp'");
$closedProductsHtml .= html::a($linkHtml, $productName, '', "class='$selected' title='{$productName}' class='closed' data-key='" . zget($productsPinYin, $product->name, '') . "' data-app='$openApp'");
}
}
?>
<div class="table-row">
<div class="table-col col-left">
<div class='list-group'>
<?php
if(!empty($myProductsHtml))
{
echo "<div class='heading'>{$lang->product->mine}</div>";
echo $myProductsHtml;
if(!empty($myProductsHtml))
{
echo "<div class='heading'>{$lang->product->other}</div>";
}
}
echo $normalProductsHtml;
?>
<?php
if(!empty($myProductsHtml))
{
echo "<div class='heading'>{$lang->product->mine}</div>";
echo $myProductsHtml;
if(!empty($myProductsHtml))
{
echo "<div class='heading'>{$lang->product->other}</div>";
}
}
echo $normalProductsHtml;
?>
</div>
<div class="col-footer">
<?php //echo html::a(helper::createLink('product', 'all'), '<i class="icon icon-cards-view muted"></i> ' . $lang->product->all, '', 'class="not-list-item"'); ?>
@@ -67,8 +68,15 @@ foreach($products as $product)
</div>
</div>
<div class="table-col col-right">
<div class='list-group'>
<?php echo $closedProductsHtml;?>
</div>
<div class='list-group'><?php echo $closedProductsHtml;?></div>
</div>
</div>
<script>
$(function()
{
if($('#dropMenu .table-row .col-left .list-group .selected').length > 0)
{
$('#dropMenu .table-row .col-left .list-group').scrollTop($('#dropMenu .table-row .col-left .list-group .selected').position().top - 75);
}
})
</script>
+27 -21
View File
@@ -20,34 +20,35 @@ $projectsPinYin = common::convert2Pinyin($projectNames);
foreach($projects as $project)
{
$link = helper::createLink('project', 'index', "projectID=%s", '', '', $project->id);
$selected = $project->id == $projectID ? 'selected' : '';
$link = helper::createLink('project', 'index', "projectID=%s", '', '', $project->id);
$projectName = zget($programs, $project->parent, '') ? zget($programs, $project->parent) . '/' . $project->name : $project->name;
if($project->status != 'done' and $project->status != 'closed' and $project->PM == $this->app->user->account)
{
$myProjectsHtml .= html::a(sprintf($link, $project->id), $projectName, '', "class='text-important' title='{$projectName}' data-key='" . zget($projectsPinYin, $projectName, '') . "'");
$myProjectsHtml .= html::a(sprintf($link, $project->id), $projectName, '', "class='text-important $selected' title='{$projectName}' data-key='" . zget($projectsPinYin, $projectName, '') . "'");
}
else if($project->status != 'done' and $project->status != 'closed' and !($project->PM == $this->app->user->account))
{
$normalProjectsHtml .= html::a(sprintf($link, $project->id), $projectName, '', "title='{$projectName}' data-key='" . zget($projectsPinYin, $projectName, '') . "'");
$normalProjectsHtml .= html::a(sprintf($link, $project->id), $projectName, '', "class='selected' title='{$projectName}' data-key='" . zget($projectsPinYin, $projectName, '') . "'");
}
else if($project->status == 'done' or $project->status == 'closed') $closedProjectsHtml .= html::a(sprintf($link, $project->id), $projectName, '', "title='{$projectName}' data-key='" . zget($projectsPinYin, $projectName, '') . "'");
else if($project->status == 'done' or $project->status == 'closed') $closedProjectsHtml .= html::a(sprintf($link, $project->id), $projectName, '', "class='$selected' title='{$projectName}' data-key='" . zget($projectsPinYin, $projectName, '') . "'");
}
?>
<div class="table-row">
<div class="table-col col-left">
<div class='list-group'>
<?php
if(!empty($myProjectsHtml))
{
echo "<div class='heading'>{$lang->project->myProject}</div>";
echo $myProjectsHtml;
if(!empty($myProjectsHtml))
{
echo "<div class='heading'>{$lang->project->other}</div>";
}
}
echo $normalProjectsHtml;
?>
<?php
if(!empty($myProjectsHtml))
{
echo "<div class='heading'>{$lang->project->myProject}</div>";
echo $myProjectsHtml;
if(!empty($myProjectsHtml))
{
echo "<div class='heading'>{$lang->project->other}</div>";
}
}
echo $normalProjectsHtml;
?>
</div>
<div class="col-footer">
<?php echo html::a(helper::createLink('project', 'browse', 'programID=0&browseType=all'), '<i class="icon icon-cards-view muted"></i> ' . $lang->project->all, '', 'class="not-list-item"'); ?>
@@ -55,10 +56,15 @@ foreach($projects as $project)
</div>
</div>
<div class="table-col col-right">
<div class='list-group'>
<?php
echo $closedProjectsHtml;
?>
</div>
<div class='list-group'><?php echo $closedProjectsHtml;?></div>
</div>
</div>
<script>
$(function()
{
if($('#dropMenu .table-row .col-left .list-group .selected') > 0)
{
$('#dropMenu .table-row .col-left .list-group').scrollTop($('#dropMenu .table-row .col-left .list-group .selected').position().top - 75);
}
})
</script>