* @package workflowgroup * @link https://www.zentao.net */ namespace zin; /* 关闭总开关。 */ if(!helper::hasFeature('process')) { div ( setClass('dtable shadow ring rounded dtable-hover-row dtable-hover-col dtable-is-empty'), div ( setClass('dtable-empty-tip'), div ( setClass('row gap-4 items-center text-gray'), $lang->workflowgroup->noProcessTip ) ) ); return; } /* 关闭项目流程开关。 */ if(!$hasProcess) { $currentModuleName = $lang->process->common; include('../../../common/ext/ui/closefeaturenotice.html.php'); return; } $html = ''; $html .= ''; $html .= ""; foreach($lang->workflowgroup->reportThead as $key => $thead) { if(!$hasDeliverable && in_array($key, ['deliverable', 'approval', 'reviewcl'])) continue; if(!$hasAuditplan && $key == 'auditcl') continue; $html .= ""; } $html .= ""; $html .= ''; $html .= ''; foreach($report as $module => $processList) { $moduleRowspan = 0; $processRowspanMap = array(); foreach($processList as $pid => $activityList) { $processRowspan = 0; foreach($activityList as $aid => $activity) { $activityRowspan = !empty($activity->deliverables) ? count($activity->deliverables) : 1; $processRowspan += $activityRowspan; $moduleRowspan += $activityRowspan; } $processRowspanMap[$pid] = $processRowspan; } $isModuleFirstRow = true; foreach($processList as $pid => $activityList) { $isProcessFirstRow = true; foreach($activityList as $aid => $activity) { $activityRowspan = !empty($activity->deliverables) ? count($activity->deliverables) : 1; $isActivityFirstRow = true; $activity->optional = $activity->optional ? $activity->optional : 'yes'; if($activity->deliverables && $hasDeliverable) { foreach($activity->deliverables as $deliverable) { $html .= ""; if($isModuleFirstRow) { $html .= ""; $isModuleFirstRow = false; } if($isProcessFirstRow && $isActivityFirstRow) { $html .= ""; } $optional = zget($lang->activity->optionalList, $activity->optional, 'yes'); $icon = $activity->optional == 'yes' ? "" : ""; if($isActivityFirstRow) { $html .= ""; if($hasAuditplan) { $auditclCount = hasPriv('auditcl', 'browse') ? html::a(createLink('auditcl', 'browse', "id={$groupID}&pid={$activity->pid}"), $activity->auditclCount) : $activity->auditclCount; $html .= ""; } $isActivityFirstRow = false; } $trimmable = zget($lang->deliverable->trimmableList, $deliverable->trimmable, '1'); $icon = $deliverable->trimmable == '1' ? "" : ""; $html .= ""; $html .= ""; $param = $deliverable->aid ? "id={$groupID}&type=byreview&aid={$deliverable->aid}" : "id={$groupID}"; $reviewclCount = hasPriv('reviewcl', 'browse') ? html::a(createLink('reviewcl', 'browse', $param), $deliverable->reviewclCount) : $deliverable->reviewclCount; $html .= ""; $html .= ""; } } else { $html .= ""; if($isModuleFirstRow) { $html .= ""; $isModuleFirstRow = false; } if($isProcessFirstRow) { $html .= ""; } if(empty($activity->aname)) { $html .= ""; if($hasAuditplan) $html .= ""; } else { $optional = zget($lang->activity->optionalList, $activity->optional, 'yes'); $icon = $activity->optional == 'yes' ? "" : ""; $html .= ""; if($hasAuditplan) { $auditclCount = hasPriv('auditcl', 'browse') ? html::a(createLink('auditcl', 'browse', "id={$groupID}&pid={$activity->pid}"), $activity->auditclCount) : $activity->auditclCount; $html .= ""; } } if($hasDeliverable) { $html .= ""; $html .= ""; $html .= ""; } $html .= ""; } $isProcessFirstRow = false; } } } $html .= ''; $html .= '
{$thead}
{$activity->moduleName}{$activity->pname}{$activity->aname} {$icon}{$auditclCount}{$deliverable->name} {$icon}{$deliverable->flowName}{$reviewclCount}
{$activity->moduleName}{$activity->pname}{$activity->aname} {$icon}{$auditclCount}
'; h::css('.table td {border: 1px solid #ebedf3;}'); panel(html($html));