Move importexport to new API - appsession()->getSession()

This commit is contained in:
Nathan Gray 2016-05-09 23:08:59 +00:00
parent 7e7f045343
commit 153b27a881
2 changed files with 4 additions and 4 deletions

View File

@ -471,7 +471,7 @@ use EGroupware\Api\Etemplate;
if($dst_file) if($dst_file)
{ {
// Still have uploaded file, jump there // Still have uploaded file, jump there
$GLOBALS['egw']->session->appsession('csvfile','',$dst_file); Cache::setSession($definition->application,'csvfile',$dst_file);
$edit_link['step'] = 'wizard_step30'; $edit_link['step'] = 'wizard_step30';
} }
$edit_link = Egw::link('/index.php',$edit_link); $edit_link = Egw::link('/index.php',$edit_link);

View File

@ -124,15 +124,15 @@ class importexport_wizard_basic_import_csv
{ {
case 'next': case 'next':
// Process sample file for fields // Process sample file for fields
if ($GLOBALS['egw']->session->appsession('csvfile',$content['application']) && if (Api\Cache::getSession($content['application'],'csvfile') &&
($handle = fopen($GLOBALS['egw']->session->appsession('csvfile',$content['application']), "rb")) !== FALSE ($handle = fopen(Api\Cache::getSession($content['application'],'csvfile'), "rb")) !== FALSE
) { ) {
$data = fgetcsv($handle, 8000, $content['fieldsep']); $data = fgetcsv($handle, 8000, $content['fieldsep']);
//error_log(array2string($data)); //error_log(array2string($data));
fclose($handle); fclose($handle);
// Remove & forget file // Remove & forget file
unlink($GLOBALS['egw']->session->appsession('csvfile',$content['application'])); unlink(Api\Cache::getSession($content['application'],'csvfile'));
Api\Cache::setSession($content['application'], 'csvfile', ''); Api\Cache::setSession($content['application'], 'csvfile', '');
$content['csv_fields'] = Api\Translation::convert($data,$content['charset']); $content['csv_fields'] = Api\Translation::convert($data,$content['charset']);