Commit 01b5c952 authored by Carsten  Rose's avatar Carsten Rose
Browse files

F4922 / Excel Import: delimiter moved from ':' to '='

parent 71cbbf1b
Pipeline #673 passed with stage
in 1 minute and 28 seconds
...@@ -1306,8 +1306,8 @@ const COLUMN_STRIPTAGS = 'striptags'; ...@@ -1306,8 +1306,8 @@ const COLUMN_STRIPTAGS = 'striptags';
const COLUMN_MIME_TYPE = 'mimeType'; // Will also be used to identify equal named columns in upload record. const COLUMN_MIME_TYPE = 'mimeType'; // Will also be used to identify equal named columns in upload record.
const COLUMN_FILE_SIZE = 'fileSize'; // Will also be used to identify equal named columns in upload record. const COLUMN_FILE_SIZE = 'fileSize'; // Will also be used to identify equal named columns in upload record.
const COLUMN_IMPORT = "import"; const COLUMN_IMPORT = "import";
const COLUMN_EXCEL_STRING = 'XLSstring'; const COLUMN_EXCEL_STRING = 'XLSs';
const COLUMN_EXCEL_NUMERIC = 'XLSnumeric'; const COLUMN_EXCEL_NUMERIC = 'XLSn';
const COLUMN_EXCEL_PLAIN = 'XLS'; const COLUMN_EXCEL_PLAIN = 'XLS';
const COLUMN_WRAP_TOKEN = '+'; const COLUMN_WRAP_TOKEN = '+';
......
...@@ -106,24 +106,25 @@ class Excel { ...@@ -106,24 +106,25 @@ class Excel {
continue; continue;
} }
$token = explode(':', $line, 2); $token = explode('=', $line, 2);
$key=$token[0]; $key=$token[0];
$value=$token[1]; $value=$token[1];
switch ($token[0]) {
switch ($key) {
case EXCEL_WORKSHEET: case EXCEL_WORKSHEET:
throw new downloadException("Not implemented: " . $token[0], ERROR_NOT_IMPLEMENTED); throw new downloadException("Not implemented: $key", ERROR_NOT_IMPLEMENTED);
case EXCEL_MODE: case EXCEL_MODE:
throw new downloadException("Not implemented: " . $token[0], ERROR_NOT_IMPLEMENTED); throw new downloadException("Not implemented: $key", ERROR_NOT_IMPLEMENTED);
case EXCEL_POSITION: case EXCEL_POSITION:
if (empty($token[1])) { if (empty($value)) {
throw new downloadException("Position argument is empty", ERROR_EXCEL_POSITION_ARGUMENT_EMPTY); throw new downloadException("Position argument is empty", ERROR_EXCEL_POSITION_ARGUMENT_EMPTY);
} }
if (!OnString::splitExcelPos($token[1], $posColumn, $posRow)) { if (!OnString::splitExcelPos($value, $posColumn, $posRow)) {
throw new downloadException("Invalid cell coordinates: " . $token[1], ERROR_EXCEL_INVALID_COORDINATES); throw new downloadException("Invalid cell coordinates: " . $value, ERROR_EXCEL_INVALID_COORDINATES);
} }
break; break;
...@@ -142,14 +143,14 @@ class Excel { ...@@ -142,14 +143,14 @@ class Excel {
$spreadsheet->getActiveSheet() $spreadsheet->getActiveSheet()
->setCellValueExplicit( ->setCellValueExplicit(
$posColumn . $posRow, $posColumn . $posRow,
$token[1], $value,
$token[0] $key
); );
$posColumn = $this->nextColumn($posColumn); $posColumn = $this->nextColumn($posColumn);
break; break;
default: default:
throw new downloadException("Excel Export: unknown token " . $token[0], ERROR_UNKNOWN_TOKEN); throw new downloadException("Excel Export: unknown token " . $key, ERROR_UNKNOWN_TOKEN);
} }
} }
......
...@@ -794,10 +794,10 @@ class Report { ...@@ -794,10 +794,10 @@ class Report {
$content .= $columnValue . PHP_EOL; $content .= $columnValue . PHP_EOL;
break; break;
case COLUMN_EXCEL_STRING: case COLUMN_EXCEL_STRING:
$content .= EXCEL_STRING . ':' . $columnValue . PHP_EOL; $content .= EXCEL_STRING . '=' . $columnValue . PHP_EOL;
break; break;
case COLUMN_EXCEL_NUMERIC: case COLUMN_EXCEL_NUMERIC:
$content .= EXCEL_NUMERIC . ':' . $columnValue . PHP_EOL; $content .= EXCEL_NUMERIC . '=' . $columnValue . PHP_EOL;
break; break;
case "bullet": case "bullet":
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment