X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/251996aed11c648ecaa30f77383e0384bfadf7a5..098a79f0819ebb89b7d48df4a6b154af4560f68e:/import.php diff --git a/import.php b/import.php new file mode 100644 index 00000000..47493db1 --- /dev/null +++ b/import.php @@ -0,0 +1,56 @@ +addInput(array('type'=>'upload','name'=>'xmlfile','value'=>'browse','maxsize'=>16777216)); // 16 MB file upload limit. +// Note: for the above limit to work make sure to set upload_max_filesize and post_max_size in php.ini to at least 16M. +$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.import'))); + +if ($request->getMethod() == 'POST') { + + $import = new ttImportHelper($errors); + $import->importXml(); + if ($errors->isEmpty()) + $messages->add($i18n->getKey('form.import.success')); +} + +$smarty->assign('forms', array($form->getName()=>$form->toArray()) ); +$smarty->assign('title', $i18n->getKey('title.import')); +$smarty->assign('content_page_name', 'import.tpl'); +$smarty->display('index.tpl'); +?> \ No newline at end of file