Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2026-03-06 21:28:17 +01:00
commit 2c4506aae1

View File

@ -179,20 +179,20 @@ class SeedDMS_Download_Mgr {
if($item->isType('documentcontent')) {
$document = $item->getDocument();
$dms = $document->_dms;
$col = 1;
$k = $i; // Number of approvers
if(!$this->skipdefaultcols) {
$status = $item->getStatus();
$reviewStatus = $item->getReviewStatus();
$approvalStatus = $item->getApprovalStatus();
$col = 1;
$l = $i; // Number of reviewers
$k = $i; // Number of approvers
if(!$this->skipdefaultcols) {
$sheet->setCellValue([$col++, $i], $document->getID());
$sheet->setCellValue([$col++, $i], $document->getName());
$sheet->setCellValue([$col++, $i], $document->getID()."-".$item->getOriginalFileName());
$sheet->setCellValue([$col++, $i], getOverallStatusText($status['status']));
$sheet->setCellValue([$col++, $i], $item->getVersion());
if($reviewStatus) {
$l = $i;
foreach ($reviewStatus as $r) {
switch ($r["type"]) {
case 0: // Reviewer is an individual.
@ -221,9 +221,11 @@ class SeedDMS_Download_Mgr {
$l++;
}
$l--;
$k = max($k, $l);
}
$col += 4;
if($approvalStatus) {
$l = $i;
foreach ($approvalStatus as $r) {
switch ($r["type"]) {
case 0: // Reviewer is an individual.
@ -244,23 +246,37 @@ class SeedDMS_Download_Mgr {
break;
}
$tcol = $col;
$sheet->setCellValue([$tcol++, $k], $reqName);
$sheet->setCellValue([$tcol, $k], ($r['status']==1 || $r['status']==-1) ? \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel(new DateTime($r['date'])) : null);
$sheet->getStyle([$tcol++, $k])->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME);
$sheet->setCellValue([$tcol++, $k], $r['comment']);
$sheet->setCellValue([$tcol++, $k], getApprovalStatusText($r["status"]));
$k++;
$sheet->setCellValue([$tcol++, $l], $reqName);
$sheet->setCellValue([$tcol, $l], ($r['status']==1 || $r['status']==-1) ? \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel(new DateTime($r['date'])) : null);
$sheet->getStyle([$tcol++, $l])->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME);
$sheet->setCellValue([$tcol++, $l], $r['comment']);
$sheet->setCellValue([$tcol++, $l], getApprovalStatusText($r["status"]));
$l++;
}
$k--;
$l--;
$k = max($k, $l);
}
$col += 4;
}
if(isset($this->extracols[$item->getID()]) && $this->extracols[$item->getID()]) {
foreach($this->extracols[$item->getID()] as $column)
$sheet->setCellValue([$col++, $i], is_array($column) ? implode("\n", $column) : $column );
foreach($this->extracols[$item->getID()] as $column) {
$l = $i;
if (is_array($column)) {
if ($column) {
foreach ($column as $cl) {
$sheet->setCellValue([$col, $l++], $cl);
}
} else {
$sheet->setCellValue([$col, $i], '');
}
$col++;
} else {
$sheet->setCellValue([$col++, $i], $column);
}
}
}
$i = max($l, $k);
$i++;
$k = max($k, $l);
$i = $k+1;
}
}
}