From 6e26b05999b5921277d8cbab3ba25e3f566f170c Mon Sep 17 00:00:00 2001 From: Derek Schaefer Date: Mon, 14 Sep 2009 06:21:04 +0000 Subject: [PATCH] Improved ODS date/time/datetime export format. Patch #2856664 --- libraries/export/ods.php | 46 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/libraries/export/ods.php b/libraries/export/ods.php index 37e3c0837..50d7393a1 100644 --- a/libraries/export/ods.php +++ b/libraries/export/ods.php @@ -69,6 +69,40 @@ function PMA_exportFooter() { function PMA_exportHeader() { $GLOBALS['ods_buffer'] .= '' . '' + . '' + . '' + . '' + . '/' + . '' + . '/' + . '' + . '' + . '' + . '' + . ':' + . '' + . ':' + . '' + . ' ' + . '' + . '' + . '' + . '' + . '/' + . '' + . '/' + . '' + . ' ' + . '' + . ':' + . '' + . ' ' + . '' + . '' + . '' + . '' + . '' + . '' . '' . ''; return TRUE; @@ -165,6 +199,18 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) { $GLOBALS['ods_buffer'] .= '' . '' . ''; + } elseif ($fields_meta[$j]->type == "date") { + $GLOBALS['ods_buffer'] .= '' + . '' . htmlspecialchars($row[$j]) . '' + . ''; + } elseif ($fields_meta[$j]->type == "time") { + $GLOBALS['ods_buffer'] .= '' + . '' . htmlspecialchars($row[$j]) . '' + . ''; + } elseif ($fields_meta[$j]->type == "datetime") { + $GLOBALS['ods_buffer'] .= '' + . '' . htmlspecialchars($row[$j]) . '' + . ''; } elseif ($fields_meta[$j]->numeric && $fields_meta[$j]->type != 'timestamp' && ! $fields_meta[$j]->blob) { $GLOBALS['ods_buffer'] .= '' . '' . htmlspecialchars($row[$j]) . ''