X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/89d113bd3f5ab38ee7ecd7166ce420cad0634fa3..208b036ea536d9d0e96e008c524a52fa3626dcdb:/WEB-INF/lib/ttOrgImportHelper.class.php diff --git a/WEB-INF/lib/ttOrgImportHelper.class.php b/WEB-INF/lib/ttOrgImportHelper.class.php index 73f1f09e..3afe2694 100644 --- a/WEB-INF/lib/ttOrgImportHelper.class.php +++ b/WEB-INF/lib/ttOrgImportHelper.class.php @@ -32,6 +32,7 @@ import('ttTaskHelper'); import('ttProjectHelper'); import('ttClientHelper'); import('ttInvoiceHelper'); +import('ttTimeHelper'); import('ttCustomFieldHelper'); import('ttExpenseHelper'); import('ttFavReportHelper'); @@ -229,9 +230,11 @@ class ttOrgImportHelper { // We get here when processing tags for the current group. // Prepare a list of project ids. - $projects = explode(',', $attrs['PROJECTS']); - foreach ($projects as $id) - $mapped_projects[] = $this->currentGroupProjectMap[$id]; + if ($attrs['PROJECTS']) { + $projects = explode(',', $attrs['PROJECTS']); + foreach ($projects as $id) + $mapped_projects[] = $this->currentGroupProjectMap[$id]; + } $client_id = ttClientHelper::insert(array( 'group_id' => $this->current_group_id, @@ -523,7 +526,7 @@ class ttOrgImportHelper { // Read and parse the content of the file. During parsing, startElement is called back for each tag. $file = fopen($filename, 'r'); - while ($data = fread($file, 4096)) { + while (($data = fread($file, 4096)) && $this->errors->no()) { if (!xml_parse($parser, $data, feof($file))) { $this->errors->add(sprintf($i18n->get('error.xml'), xml_get_current_line_number($parser), @@ -552,7 +555,7 @@ class ttOrgImportHelper { // Read and parse the content of the file. During parsing, startElement is called back for each tag. $file = fopen($filename, 'r'); - while ($data = fread($file, 4096)) { + while (($data = fread($file, 4096)) && $this->errors->no()) { if (!xml_parse($parser, $data, feof($file))) { $this->errors->add(sprintf($i18n->get('error.xml'), xml_get_current_line_number($parser),