Files
EasySoft-ZenTaoPMS/module/execution/view/ajaxgetdropmenu.html.php
2021-03-10 13:43:28 +08:00

64 lines
2.8 KiB
PHP

<?php js::set('executionID', $executionID);?>
<?php js::set('module', $module);?>
<?php js::set('method', $method);?>
<?php js::set('extra', $extra);?>
<?php
$iCharges = 0;
$others = 0;
$dones = 0;
$executionNames = array();
$myProjectsHtml = '';
$normalProjectsHtml = '';
$closedProjectsHtml = '';
foreach($executions as $execution)
{
if($execution->status != 'done' and $execution->status != 'closed' and $execution->PM == $this->app->user->account) $iCharges++;
if($execution->status != 'done' and $execution->status != 'closed' and !($execution->PM == $this->app->user->account)) $others++;
if($execution->status == 'done' or $execution->status == 'closed') $dones++;
$executionNames[] = $execution->name;
}
$executionsPinYin = common::convert2Pinyin($executionNames);
foreach($executions as $execution)
{
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> " . $execution->name, '', "class='text-important' title='{$execution->name}' 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> " . $execution->name, '', "title='{$execution->name}' 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> " . $execution->name, '', "title='{$execution->name}' 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;
?>
</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"'); ?>
<a class='pull-right toggle-right-col not-list-item'><?php echo $lang->execution->doneExecutions;?><i class='icon icon-angle-right'></i></a>
</div>
</div>
<div class="table-col col-right">
<div class='list-group'>
<?php
echo $closedProjectsHtml;
?>
</div>
</div>
</div>