From 35ad154ab4b1cec78fc4b413d2967e635782e530 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 10 Feb 2025 07:58:38 +0100 Subject: [PATCH 1/3] return full version by endpoint 'version' --- restapi/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/restapi/index.php b/restapi/index.php index c940c3dfe..a5b17dfc1 100644 --- a/restapi/index.php +++ b/restapi/index.php @@ -2938,7 +2938,7 @@ final class SeedDMS_TestController { /* {{{ */ $logger = $this->container->get('logger'); $v = new SeedDMS_Version(); - return $this->renderer->json($response, ['success'=>true, 'message'=>'This is '.$v->banner(), 'data'=>['major'=>$v->majorVersion(), 'minor'=>$v->minorVersion(), 'subminor'=>$v->subminorVersion()]]); + return $this->renderer->json($response, ['success'=>true, 'message'=>'This is '.$v->banner(), 'data'=>['major'=>$v->majorVersion(), 'minor'=>$v->minorVersion(), 'subminor'=>$v->subminorVersion(), 'version'=>$v->majorVersion().'.'.$v->minorVersion().'.'.$v->subminorVersion()]]); } /* }}} */ } /* }}} */ From a5999caca3bee8039f2c3ffe5b641d6fbc713dcc Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 10 Feb 2025 16:17:03 +0100 Subject: [PATCH 2/3] use setValueCell() and AdvancedValueBinder --- inc/inc.ClassDownloadMgr.php | 44 ++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/inc/inc.ClassDownloadMgr.php b/inc/inc.ClassDownloadMgr.php index 5bf28edb2..b77d1aac8 100644 --- a/inc/inc.ClassDownloadMgr.php +++ b/inc/inc.ClassDownloadMgr.php @@ -129,7 +129,7 @@ class SeedDMS_Download_Mgr { public function createToc($file) { /* {{{ */ $objPHPExcel = new PhpOffice\PhpSpreadsheet\Spreadsheet(); - //$objPHPExcel->setValueBinder(new \PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder()); + $objPHPExcel->setValueBinder(new \PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder()); $objPHPExcel->getProperties()->setCreator("SeedDMS")->setTitle("Metadata"); if($items = $this->items) { $sheet = $objPHPExcel->setActiveSheetIndex(0); @@ -138,9 +138,9 @@ class SeedDMS_Download_Mgr { $i = 1; $col = 1; foreach($this->header as $h) - $sheet->setCellValueByColumnAndRow($col++, $i, $h); + $sheet->setCellValue([$col++, $i], $h); foreach($this->extraheader as $h) - $sheet->setCellValueByColumnAndRow($col++, $i, $h); + $sheet->setCellValue([$col++, $i], $h); $i++; foreach($items as $item) { if($item->isType('documentcontent')) { @@ -151,11 +151,11 @@ class SeedDMS_Download_Mgr { $approvalStatus = $item->getApprovalStatus(); $col = 1; - $sheet->setCellValueByColumnAndRow($col++, $i, $document->getID()); - $sheet->setCellValueByColumnAndRow($col++, $i, $document->getName()); - $sheet->setCellValueByColumnAndRow($col++, $i, $document->getID()."-".$item->getOriginalFileName()); - $sheet->setCellValueByColumnAndRow($col++, $i, getOverallStatusText($status['status'])); - $sheet->setCellValueByColumnAndRow($col++, $i, $item->getVersion()); + $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()); $l = $i; $k = $i; if($reviewStatus) { @@ -179,11 +179,11 @@ class SeedDMS_Download_Mgr { break; } $tcol = $col; - $sheet->setCellValueByColumnAndRow($tcol++, $l, $reqName); - $sheet->setCellValueByColumnAndRow($tcol, $l, ($r['status']==1 || $r['status']==-1) ? \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel(new DateTime($r['date'])) : null); + $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->getStyleByColumnAndRow($tcol++, $l)->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME); - $sheet->setCellValueByColumnAndRow($tcol++, $l, $r['comment']); - $sheet->setCellValueByColumnAndRow($tcol++, $l, getReviewStatusText($r["status"])); + $sheet->setCellValue([$tcol++, $l], $r['comment']); + $sheet->setCellValue([$tcol++, $l], getReviewStatusText($r["status"])); $l++; } $l--; @@ -210,11 +210,11 @@ class SeedDMS_Download_Mgr { break; } $tcol = $col; - $sheet->setCellValueByColumnAndRow($tcol++, $k, $reqName); - $sheet->setCellValueByColumnAndRow($tcol, $k, ($r['status']==1 || $r['status']==-1) ? \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel(new DateTime($r['date'])) : null); + $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->getStyleByColumnAndRow($tcol++, $k)->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME); - $sheet->setCellValueByColumnAndRow($tcol++, $k, $r['comment']); - $sheet->setCellValueByColumnAndRow($tcol++, $k, getApprovalStatusText($r["status"])); + $sheet->setCellValue([$tcol++, $k], $r['comment']); + $sheet->setCellValue([$tcol++, $k], getApprovalStatusText($r["status"])); $k++; } $k--; @@ -222,7 +222,7 @@ class SeedDMS_Download_Mgr { $col += 4; if(isset($this->extracols[$item->getID()]) && $this->extracols[$item->getID()]) { foreach($this->extracols[$item->getID()] as $column) - $sheet->setCellValueByColumnAndRow($col++, $i, is_array($column) ? implode("\n", $column) : $column ); + $sheet->setCellValue([$col++, $i], is_array($column) ? implode("\n", $column) : $column ); } $i = max($l, $k); $i++; @@ -240,9 +240,9 @@ class SeedDMS_Download_Mgr { $i = 1; $col = 1; foreach($this->folder_header as $h) - $sheet->setCellValueByColumnAndRow($col++, $i, $h); + $sheet->setCellValue([$col++, $i], $h); foreach($this->folder_extraheader as $h) - $sheet->setCellValueByColumnAndRow($col++, $i, $h); + $sheet->setCellValue([$col++, $i], $h); $i++; $items = $this->folder_items; foreach($items as $item) { @@ -251,11 +251,11 @@ class SeedDMS_Download_Mgr { $dms = $folder->_dms; $col = 1; - $sheet->setCellValueByColumnAndRow($col++, $i, $folder->getID()); - $sheet->setCellValueByColumnAndRow($col++, $i, $folder->getName()); + $sheet->setCellValue([$col++, $i], $folder->getID()); + $sheet->setCellValue([$col++, $i], $folder->getName()); if(isset($this->folder_extracols[$item->getID()]) && $this->folder_extracols[$item->getID()]) { foreach($this->folder_extracols[$item->getID()] as $column) - $sheet->setCellValueByColumnAndRow($col++, $i, is_array($column) ? implode("\n", $column) : $column ); + $sheet->setCellValue([$col++, $i], is_array($column) ? implode("\n", $column) : $column ); } $i++; } From 6c5dd72b86d46ccb57ab3a7db61349b34e98cb7e Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 10 Feb 2025 16:17:28 +0100 Subject: [PATCH 3/3] require php 8.2 --- CHANGELOG | 5 +++++ composer-dist.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 2cb9d5678..137592956 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,8 @@ +-------------------------------------------------------------------------------- + Changes in version 5.1.38 +-------------------------------------------------------------------------------- +- require php 8.2 + -------------------------------------------------------------------------------- Changes in version 5.1.37 -------------------------------------------------------------------------------- diff --git a/composer-dist.json b/composer-dist.json index 40c114d17..538af9e5f 100644 --- a/composer-dist.json +++ b/composer-dist.json @@ -1,7 +1,7 @@ { "config": { "platform": { - "php": "7.4" + "php": "8.2" } }, "require": {