Importing tracker items through CSV only sets the created and lastModif value properly if the dates from the CSV file are in the numerical php date format.
When you import a csv file where the created and lastModif dates are written as proper dates, the imported tracker items have a created and lastModif date/timestamp of the date & time of the import action.
example csv :
"itemId","status","created","lastModif","VRID — 265"
"849","o","07/12/2009 13:24","07/12/2009 13:24","4"
Whenever I export a csv file, it contains the dates as shown above, so you can't just export data and import data on the fly without modifying all the values...
c.f. bug 3500
in lib/trackers/trackerlib.php starting at line 1627
replace the following code
for ($i = 0; $i < $max; $i++) { if ($encoding == 'ISO-8859-1') { $data[$i] = utf8_encode($data[$i]); } if ($header[$i] == 'status') { if ($data[$i] == 'o' || $data[$i] =='p' || $data[$i] == 'c') $status = $data[$i]; } elseif ($header[$i] == 'itemId') { $itemId = $data[$i]; } elseif ($header[$i] == 'created' && is_numeric($data[$i])) { $created = $data[$i]; } elseif ($header[$i] == 'lastModif' && is_numeric($data[$i])) { $lastModif = $data[$i]; } elseif ($header[$i] == 'categs') { // for old compatibility $cats = split(',',trim($data[$i])); } }
With the following code :
for ($i = 0; $i < $max; $i++) { if ($encoding == 'ISO-8859-1') { $data[$i] = utf8_encode($data[$i]); } if ($header[$i] == 'status') { if ($data[$i] == 'o' || $data[$i] =='p' || $data[$i] == 'c') $status = $data[$i]; } elseif ($header[$i] == 'itemId') { $itemId = $data[$i]; } elseif ($header[$i] == 'created') || ($header[$i] == 'lastModif') { if (is_numeric($data[$i]) { // If created is numeric, datetime is in php format if ($header[$i] == 'created') { $created = $data[$i]; } else { $lastModif = $data[$i]; } } else { // date time needs to be converted to php format $l = strlen($data[$i]); switch ($l) { case ($l == 10): # Field does not contain the time if ($dateFormat == 'mm/dd/yyyy') { list($m, $d, $y) = explode('/', $data[$i]); $data[$i] = $tikilib->make_time($hh, $mm, $ss, $m, $d, $y); } elseif ($dateFormat == 'dd/mm/yyyy') { list($d, $m, $y) = explode('/', $data[$i]); $data[$i] = $tikilib->make_time(0, 0, 0, $m, $d, $y); } break; case ($l == 16): # Field contains HH:MM list($fd, $ft) = explode(' ', $data[$i]); list($hh, $mm) = explode(':', $ft); if ($dateFormat == 'mm/dd/yyyy') { list($m, $d, $y) = explode('/', $fd); $data[$i] = $tikilib->make_time($hh, $mm, 0, $m, $d, $y); } elseif ($dateFormat == 'dd/mm/yyyy') { list($d, $m, $y) = explode('/', $fd); $data[$i] = $tikilib->make_time($hh, $mm, 0, $m, $d, $y); } break; case ($l == 19): # Field contains HH:MM:SS list($fd, $ft) = explode(' ', $data[$i]); list($hh, $mm, $ss) = explode(':', $ft); if ($dateFormat == 'mm/dd/yyyy') { list($m, $d, $y) = explode('/', $fd); $data[$i] = $tikilib->make_time($hh, $mm, $ss, $m, $d, $y); } elseif ($dateFormat == 'dd/mm/yyyy') { list($d, $m, $y) = explode('/', $fd); $data[$i] = $tikilib->make_time($hh, $mm, $ss, $m, $d, $y); } break; } if ($header[$i] == 'created') { $created = $data[$i]; } else { $lastModif = $data[$i]; } } } elseif ($header[$i] == 'categs') { // for old compatibility $cats = split(',',trim($data[$i])); } }
To help developers solve the bug, we kindly request that you demonstrate your bug on a show2.tiki.org instance. To start, simply select a version and click on "Create show2.tiki.org instance". Once the instance is ready (in a minute or two), as indicated in the status window below, you can then access that instance, login (the initial admin username/password is "admin") and configure the Tiki to demonstrate your bug. Priority will be given to bugs that have been demonstrated on show2.tiki.org.
To help developers solve the bug, we kindly request that you demonstrate your bug on a show.tikiwiki.org instance. To start, simply select a version and click on "Create show.tikiwiki.org instance". Once the instance is ready (in a minute or two), as indicated in the status window below, you can then access that instance, login (the initial admin username/password is "admin") and configure the Tiki to demonstrate your bug. Priority will be given to bugs that have been demonstrated on show.tikiwiki.org.
filename | created | hits | comment | version | filetype | ||
---|---|---|---|---|---|---|---|
No attachments for this item |