translate headers, use DateTime for Excel dates

This commit is contained in:
Uwe Steinmann 2020-04-01 18:29:11 +02:00
parent 0fac1646d4
commit c69490daba

View File

@ -49,7 +49,7 @@ class SeedDMS_Download_Mgr {
function __construct($tmpdir = '') {
$this->tmpdir = $tmpdir;
$this->items = array();
$this->header = array('Dokumenten-Nr.', 'Dokumentenname', 'Dateiname', 'Status', 'Int. Version', 'Prüfer', 'Prüfdatum', 'Prüfkommentar', 'Prüfstatus', 'Freigeber', 'Freigabedatum', 'Freigabekommentar', 'Freigabestatus');
$this->header = array(getMLText('download_header_document_no'), getMLText('download_header_document_name'), getMLText('download_header_filename'), getMLText('download_header_state'), getMLText('download_header_internal_version'), getMLText('download_header_reviewer'), getMLText('download_header_review_date'), getMLText('download_header_review_comment'), getMLText('download_header_review_state'), getMLText('download_header_approver'), getMLText('download_header_approval_date'), getMLText('download_header_approval_comment'), getMLText('download_header_approval_state'));
$this->extracols = array();
$this->rawcontents = array();
$this->extraheader = array();
@ -115,7 +115,7 @@ class SeedDMS_Download_Mgr {
}
$tcol = $col;
$sheet->setCellValueByColumnAndRow($tcol++, $l, $reqName);
$sheet->setCellValueByColumnAndRow($tcol, $l, ($r['status']==1 || $r['status']==-1) ? PHPExcel_Shared_Date::PHPToExcel(makeTsFromLongDate($r['date'])) : "");
$sheet->setCellValueByColumnAndRow($tcol, $l, ($r['status']==1 || $r['status']==-1) ? PHPExcel_Shared_Date::PHPToExcel(new DateTime($r['date'])) : null);
$sheet->getStyleByColumnAndRow($tcol++, $l)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX22);
$sheet->setCellValueByColumnAndRow($tcol++, $l, $r['comment']);
$sheet->setCellValueByColumnAndRow($tcol++, $l, getReviewStatusText($r["status"]));
@ -146,7 +146,7 @@ class SeedDMS_Download_Mgr {
}
$tcol = $col;
$sheet->setCellValueByColumnAndRow($tcol++, $k, $reqName);
$sheet->setCellValueByColumnAndRow($tcol, $k, ($r['status']==1 || $r['status']==-1) ?PHPExcel_Shared_Date::PHPToExcel(makeTsFromLongDate($r['date'])) : "");
$sheet->setCellValueByColumnAndRow($tcol, $k, ($r['status']==1 || $r['status']==-1) ?PHPExcel_Shared_Date::PHPToExcel(new DateTime($r['date'])) : null);
$sheet->getStyleByColumnAndRow($tcol++, $k)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX22);
$sheet->setCellValueByColumnAndRow($tcol++, $k, $r['comment']);
$sheet->setCellValueByColumnAndRow($tcol++, $k, getApprovalStatusText($r["status"]));