From aff06ec4ccd4f84ab07227a908e7586fad34dfdd Mon Sep 17 00:00:00 2001 From: nathangray Date: Tue, 6 Apr 2021 14:07:25 -0600 Subject: [PATCH] =?UTF-8?q?Import/export=20fixes=20-=20Fix=20for=20missing?= =?UTF-8?q?=20floats=20by=20J=C3=BCrgen=20Dlugi=20-=20Fix=20broken=20times?= =?UTF-8?q?heet=20export=20was=20always=200=20results?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inc/class.importexport_export_csv.inc.php | 12 ++++++++---- infolog/inc/class.infolog_egw_record.inc.php | 9 +++++---- timesheet/inc/class.timesheet_egw_record.inc.php | 1 + timesheet/inc/class.timesheet_export_csv.inc.php | 6 +++--- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/importexport/inc/class.importexport_export_csv.inc.php b/importexport/inc/class.importexport_export_csv.inc.php index 59f781b29b..5135916fbd 100644 --- a/importexport/inc/class.importexport_export_csv.inc.php +++ b/importexport/inc/class.importexport_export_csv.inc.php @@ -244,6 +244,9 @@ class importexport_export_csv implements importexport_iface_export_record foreach($custom as $name => $c_field) { $name = '#' . $name; switch($c_field['type']) { + case 'float' : + $fields['float'][] = $name; + break; case 'date': case 'date-time': if ($c_field['values']['format']) @@ -296,13 +299,14 @@ class importexport_export_csv implements importexport_iface_export_record } /** - * Convert system info into a format with a little more transferrable meaning + * Convert system info into a format with a little more transferable meaning * * Uses the static variable $types to convert various datatypes. * - * @param record Record to be converted - * @parem fields List of field types => field names to be converted - * @param appname Current appname if you want to do custom fields too + * @param importexport_iface_egw_record $record Record to be converted + * @param string[] $fields List of field types => field names to be converted + * @param string $appname Current appname if you want to do custom fields too + * @param array[] $selects Select box options */ public static function convert(importexport_iface_egw_record &$record, Array $fields = array(), $appname = null, $selects = array()) { diff --git a/infolog/inc/class.infolog_egw_record.inc.php b/infolog/inc/class.infolog_egw_record.inc.php index f236702b59..2829849ec4 100644 --- a/infolog/inc/class.infolog_egw_record.inc.php +++ b/infolog/inc/class.infolog_egw_record.inc.php @@ -24,12 +24,13 @@ class infolog_egw_record implements importexport_iface_egw_record // Used in conversions static $types = array( + 'flaot' => array('info_price'), 'select' => array('info_type', 'info_status', 'info_priority', 'pl_id'), - 'select-cat' => array('info_cat'), - 'select-account' => array('info_owner','info_responsible','info_modifier'), - 'date-time' => array('info_startdate', 'info_enddate','info_datecompleted', 'info_datemodified','info_created'), + 'select-cat' => array('info_cat'), + 'select-account' => array('info_owner','info_responsible','info_modifier'), + 'date-time' => array('info_startdate', 'info_enddate','info_datecompleted', 'info_datemodified','info_created'), 'links' => array('info_link_id'), - ); + ); /** * constructor diff --git a/timesheet/inc/class.timesheet_egw_record.inc.php b/timesheet/inc/class.timesheet_egw_record.inc.php index f0e928f6f3..063143fe5b 100644 --- a/timesheet/inc/class.timesheet_egw_record.inc.php +++ b/timesheet/inc/class.timesheet_egw_record.inc.php @@ -26,6 +26,7 @@ class timesheet_egw_record implements importexport_iface_egw_record // Used in conversions static $types = array( + 'float' => array('ts_quantity','ts_unitprice'), 'select-account' => array('ts_owner','ts_modifier'), 'date-time' => array('ts_start', 'ts_created', 'ts_modified'), 'select-cat' => array('cat_id'), diff --git a/timesheet/inc/class.timesheet_export_csv.inc.php b/timesheet/inc/class.timesheet_export_csv.inc.php index 39fb474598..bef614c784 100644 --- a/timesheet/inc/class.timesheet_export_csv.inc.php +++ b/timesheet/inc/class.timesheet_export_csv.inc.php @@ -42,7 +42,7 @@ class timesheet_export_csv implements importexport_iface_export_plugin $query = Api\Cache::getSession(TIMESHEET_APP, 'index'); $query['num_rows'] = -1; // all records $query['csv_export'] = true; // so get_rows method _can_ produce different content or not store state in the session - $this->ui->get_rows($query,$selection,$readonlys,true); // true = only return the id's + $this->ui->get_rrows($query,$selection,$readonlys,true); // true = only return the id's } elseif($options['selection'] == 'all') { @@ -50,7 +50,7 @@ class timesheet_export_csv implements importexport_iface_export_plugin 'num_rows' => -1, 'csv_export' => true, // so get_rows method _can_ produce different content or not store state in the session ); - $this->ui->get_rows($query,$selection,$readonlys,true); // true = only return the id's + $this->ui->get_rrows($query,$selection,$readonlys,true); // true = only return the id's } else if($options['selection'] == 'filter') { @@ -78,7 +78,7 @@ class timesheet_export_csv implements importexport_iface_export_plugin if($value['to']) $query['col_filter'][] = "$field <= " . (int)$value['to']; unset($query['col_filter'][$field]); } - $this->ui->get_rows($query,$selection,$readonlys,true); // true = only return the id's + $this->ui->get_rrows($query,$selection,$readonlys,true); // true = only return the id's }