Author: nathangray
New Revision: 56103
URL: http://svn.stylite.de/viewvc/egroupware?rev=56103&view=rev
Log:
Move importexport to new API
Removed:
trunk/importexport/setup/etemplates.inc.php
Modified:
trunk/importexport/importexport_cli.php
trunk/importexport/inc/class.importexport_admin_prefs_sidebox_hooks.inc.php
trunk/importexport/inc/class.importexport_basic_import_csv.inc.php
trunk/importexport/inc/class.importexport_definition.inc.php
trunk/importexport/inc/class.importexport_definitions_bo.inc.php
trunk/importexport/inc/class.importexport_definitions_ui.inc.php
trunk/importexport/inc/class.importexport_export_csv.inc.php
trunk/importexport/inc/class.importexport_export_ui.inc.php
trunk/importexport/inc/class.importexport_helper_functions.inc.php
trunk/importexport/inc/class.importexport_iface_egw_record.inc.php
trunk/importexport/inc/class.importexport_import_csv.inc.php
trunk/importexport/inc/class.importexport_import_ui.inc.php
trunk/importexport/inc/class.importexport_schedule_ui.inc.php
trunk/importexport/inc/class.importexport_widget_filter.inc.php
trunk/importexport/inc/class.importexport_wizard_basic_export_csv.inc.php
trunk/importexport/inc/class.importexport_wizard_basic_import_csv.inc.php
trunk/importexport/setup/setup.inc.php
trunk/importexport/setup/tables_update.inc.php
— trunk/importexport/importexport_cli.php (original)
+++ trunk/importexport/importexport_cli.php Tue May 10 00:49:20 2016
@@ -9,6 +9,8 @@
+use EGroupware\Api;
$path_to_egroupware = realpath(dirname(FILE).’/…’);
@@ -148,7 +150,7 @@
$resource = fopen( $file, ‘r’ );
$po->$type( $resource, $definition );
-common::egw_exit();
+exit();
function import_export_access(&$account)
{
— trunk/importexport/inc/class.importexport_admin_prefs_sidebox_hooks.inc.php (original)
+++ trunk/importexport/inc/class.importexport_admin_prefs_sidebox_hooks.inc.php Tue May 10 00:49:20 2016
@@ -8,6 +8,9 @@
+use EGroupware\Api;
+use EGroupware\Api\Egw;
if (!defined(‘IMPORTEXPORT_APP’))
{
@@ -32,27 +35,27 @@
array(
‘text’ => ‘Import’,
‘link’ => “javascript:egw_openWindowCentered2(’”.
-
Egw::link('/index.php','menuaction=importexport.importexport_import_ui.import_dialog',false).
"','_blank',850,440,'yes')",
'icon' => 'import'
),
);
-
Egw::link('/index.php','menuaction=importexport.importexport_export_ui.export_dialog',false).
"','_blank',850,440,'yes')",
'icon' => 'export'
);
}
-
$file['Define imports|exports'] = Egw::link('/index.php',array(
'menuaction' => 'importexport.importexport_definitions_ui.index',
'ajax' => 'true'
),$GLOBALS['egw_info']['user']['apps']['admin'] ? 'admin' : 'preferences');
@@ -63,13 +66,13 @@
if ($GLOBALS[‘egw_info’][‘user’][‘apps’][‘admin’])
{
$file = Array(
-
'Site Configuration' => egw::link('/index.php','menuaction=importexport.importexport_definitions_ui.site_config'),
-
'Import definitions' => egw::link('/index.php','menuaction=importexport.importexport_definitions_ui.import_definition'),
-
'Define imports|exports' => egw::link('/index.php',array(
-
'Site Configuration' => Egw::link('/index.php','menuaction=importexport.importexport_definitions_ui.site_config'),
-
'Import definitions' => Egw::link('/index.php','menuaction=importexport.importexport_definitions_ui.import_definition'),
-
'Define imports|exports' => Egw::link('/index.php',array(
'menuaction' => 'importexport.importexport_definitions_ui.index',
'ajax' => 'true'
)),
@@ -92,12 +95,12 @@
if($GLOBALS[‘egw_info’][‘flags’][‘no_importexport’] === true) return array();
$appname = $GLOBALS['egw_info']['flags']['currentapp'];
-
$cache = Api\Cache::getCache(Api\Cache::SESSION, 'importexport', 'sidebox_links');
if(!$cache[$appname] && $GLOBALS['egw_info']['user']['apps']['importexport']) {
$cache[$appname]['import'] = importexport_helper_functions::has_definitions($appname, 'import');
$cache[$appname]['export'] = importexport_helper_functions::has_definitions($appname, 'export');
-
Api\Cache::setCache(Api\Cache::SESSION, 'importexport', 'sidebox_links', $cache);
}
// Add in import / export, if available
@@ -106,7 +109,7 @@
if($cache[$appname][‘import’])
{
$file[‘Import CSV’] = array(‘link’ => “javascript:egw_openWindowCentered2(’”.
-
Egw::link('/index.php',array(
'menuaction' => 'importexport.importexport_import_ui.import_dialog',
'appname'=>$appname
),false)."','_blank',850,440,'yes')",
@@ -118,12 +121,12 @@
$file[‘Import CSV’][‘link’] = ‘’;
}
}
-
Egw::link('/index.php',array(
'menuaction' => 'importexport.importexport_export_ui.export_dialog',
'appname'=>$appname
),false)."','_blank',850,440,'yes')",
@@ -136,12 +139,12 @@
}
}
-
$file['Define imports|exports'] = Egw::link('/index.php',array(
'menuaction' => 'importexport.importexport_definitions_ui.index',
'application' => $appname,
'ajax' => 'true'
— trunk/importexport/inc/class.importexport_basic_import_csv.inc.php (original)
+++ trunk/importexport/inc/class.importexport_basic_import_csv.inc.php Tue May 10 00:49:20 2016
@@ -8,6 +8,8 @@
+use EGroupware\Api;
+use EGroupware\Api\Link;
/**
- A basic CSV import plugin.
@@ -355,7 +357,7 @@
}
else if($type == ‘search’)
{
@@ -369,7 +371,7 @@
// Searching, take first result
if(!is_numeric($app_id))
{
@@ -385,7 +387,7 @@
}
if (!$this->dry_run && $app && $app_id && ($app != $this->definition->application || $app_id != $id))
{
@@ -443,7 +445,7 @@
}
$this->preview_records = array();
-
return Api\Html::table($rows);
}
/**
@@ -533,7 +535,7 @@
// Find matching entry
if($app && $custom_field && $value)
{
@@ -557,10 +559,10 @@
if($custom_field[0] != ‘#’) $custom_field = ‘#’ . $custom_field;
error_log(“Searching for $custom_field = $value”);
// Search
— trunk/importexport/inc/class.importexport_definition.inc.php (original)
+++ trunk/importexport/inc/class.importexport_definition.inc.php Tue May 10 00:49:20 2016
@@ -9,6 +9,8 @@
+use EGroupware\Api;
/**
-
-
@var so_sql holds so_sql object
-
-
@var so_sql holds Api\Storage\Base object
*/
private $so_sql;
@@ -64,7 +66,7 @@
* @param string $_identifier
*/
public function __construct( $_identifier=’’ ) {
@@ -282,7 +284,7 @@
$this->so_sql->data[‘filter’] = importexport_arrayxml::array2xml( $this->definition[‘filter’] );
$this->so_sql->data[‘modified’] = time();
if ($this->so_sql->save( array( ‘definition_id’ => $_dst_identifier ))) {
@@ -342,7 +344,7 @@
throw('Error: User '. $this->user. 'does not have permissions to delete definition '.$this->get_identifier());
}
if(!$this->so_sql->delete()) {
— trunk/importexport/inc/class.importexport_definitions_bo.inc.php (original)
+++ trunk/importexport/inc/class.importexport_definitions_bo.inc.php Tue May 10 00:49:20 2016
@@ -10,6 +10,8 @@
+use EGroupware\Api;
+
/** bo to define {im|ex}ports
*
-
-
@var so_sql holds Api\Storage\Base
*/
private $so_sql;
@@ -31,7 +33,7 @@
public function __construct($_query=false, $ignore_acl = false)
{
@@ -170,7 +172,7 @@
{
$export_data = array(‘metainfo’ => array(
‘type’ => ‘importexport definitions’,
@@ -224,10 +226,10 @@
unset ( $data );
// convert charset into internal used charset
@@ -273,7 +275,7 @@
public static function export_from_import(importexport_definition $import)
{
// Only operates on import definitions
— trunk/importexport/inc/class.importexport_definitions_ui.inc.php (original)
+++ trunk/importexport/inc/class.importexport_definitions_ui.inc.php Tue May 10 00:49:20 2016
@@ -10,6 +10,12 @@
+use EGroupware\Api;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Egw;
+use EGroupware\Api\Acl;
+use EGroupware\Api\Etemplate;
+
/**
- Userinterface to define {im|ex}ports
-
@@ -57,11 +63,11 @@
{
// we cant deal with notice and warnings, as we are on ajax!
error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING);
-
$this->etpl = new Etemplate();
-
$this->clock = Api\Html::image(self::_appname,'clock');
$this->steps = array(
'wizard_step10' => lang('Choose an application'),
'wizard_step20' => lang('Choose a plugin'),
@@ -88,8 +94,8 @@
} else {
// Filter private definitions
$filter[‘owner’] = $GLOBALS[‘egw_info’][‘user’][‘account_id’];
@@ -105,7 +111,7 @@
elseif(($button = array_search(‘pressed’,$content[‘nm’][‘rows’])) !== false)
{
$selected = $content[‘nm’][‘rows’][‘selected’];
@@ -174,9 +180,9 @@
);
if($_GET[‘application’]) $content[‘nm’][‘col_filter’][‘application’] = $_GET[‘application’];
}
-
if(egw_session::appsession('index', 'importexport'))
-
{
-
$content['nm'] = array_merge($content['nm'], egw_session::appsession('index', 'importexport'));
-
if(Api\Cache::getSession('importexport', 'index'))
-
{
-
$content['nm'] = array_merge($content['nm'], Api\Cache::getSession('importexport', 'index'));
}
$content['nm']['actions'] = $this->get_actions();
$sel_options = array(
@@ -197,7 +203,7 @@
}
if($msg) $content[‘msg’] = $msg;
-
$etpl = new Etemplate(self::_appname.'.definition_index');
return $etpl->exec( self::_appname.'.importexport_definitions_ui.index', $content, $sel_options, $readonlys, $preserv );
}
@@ -312,7 +318,7 @@
if ($use_all)
{
// get the whole selection
-
$old_query = $query = is_array($session_name) ? $session_name : Api\Cache::getSession('importexport', $session_name);
@set_time_limit(0); // switch off the execution time limit, as it's for big selections to small
$query['num_rows'] = -1; // all
@@ -326,7 +332,7 @@
if(!is_array($session_name))
{
// Restore old query
@@ -340,12 +346,12 @@
// There’s probably a way to do this in just JS, all the info should be there…
foreach($selected as $id) {
$definition = $bodefinitions->read((int)$id);
-
$link = Egw::link('/index.php', array(
'menuaction' => 'importexport.importexport_'.$definition['type'].'_ui.'.$definition['type'].'_dialog',
'appname' => $definition['application'],
'definition' => $definition['name']
));
-
egw_framework::set_onload("egw_openWindowCentered2('$link','_blank',850,440,'yes');");
-
Framework::set_onload("egw_openWindowCentered2('$link','_blank',850,440,'yes');");
}
break;
case 'allowed':
@@ -377,7 +383,7 @@
header(‘Content-Type: ’ . $mime_type);
header(‘Content-Disposition: attachment; filename="’.$name.’"’);
echo $bodefinitions->export($selected);
@@ -438,7 +444,7 @@
public function get_rows(&$query, &$rows, &$readonlys) {
$rows = array();
@@ -528,7 +534,7 @@
$wizard_plugin = $content[‘plugin’];
}
// App translations
@@ -716,7 +722,7 @@
} elseif($this->plugin instanceof importexport_iface_export_plugin || $this->plugin instanceof importexport_wizard_basic_export_csv || strpos(get_class($this->plugin),‘export’) !== false) {
$content[‘type’] = ‘export’;
} else {
@@ -732,7 +738,7 @@
else
{
$content[‘text’] = $this->steps[‘wizard_step20’];
@@ -771,7 +777,7 @@
$suggestions = array(
$content[‘name’] .’-’. $GLOBALS[‘egw_info’][‘user’][‘account_lid’],
$content[‘name’] .’-’. $GLOBALS[‘egw_info’][‘user’][‘account_id’],
-
$content['name'] .'-'. Api\DateTime::to('now', true),
//$content['name'] .'-'. rand(0,100),
);
foreach($suggestions as $key => $suggestion) {
@@ -824,7 +830,7 @@
{
if($this->can_edit($content))
{
-
$content['owner'] = $content['just_me'] || !$GLOBALS['egw']->acl->check('share_definitions', Acl::READ,'importexport') ?
($content['owner'] ? $content['owner'] : $GLOBALS['egw_info']['user']['account_id']) :
null;
$content['allowed_users'] = $content['just_me'] ? '' : ($content['all_users'] ? 'all' : implode(',',$content['allowed_users']));
@@ -854,7 +860,7 @@
$content[‘just_me’] = ((!$content[‘allowed_users’] || !$content[‘allowed_users’][0] && count($content[‘allowed_users’]) ==1) && $content[‘owner’]);
$content[‘all_users’] = is_array($content[‘allowed_users’]) && array_key_exists(‘0’,$content[‘allowed_users’]) && $content[‘allowed_users’][0] == ‘all’ ||
$content[‘allowed_users’] == ‘all’;
-
if(!$GLOBALS['egw']->acl->check('share_definition', Acl::READ, 'importexport') && !$GLOBALS['egw_info']['user']['apps']['admin'])
{
$content['allowed_users'] = array();
$readonlys['allowed_users'] = true;
@@ -897,8 +903,8 @@
$bodefinitions->save($content);
// This message is displayed if browser cant close window
$content[‘msg’] = lang(‘ImportExport wizard finished successfully!’);
-
Framework::refresh_opener('','importexport');
-
Framework::window_close();
return 'importexport.wizard_close';
}
@@ -961,7 +967,7 @@
{
if(!$GLOBALS[‘egw_info’][‘user’][‘apps’][‘admin’])
{
@@ -973,25 +979,25 @@
foreach($content['share_definition'] as $group)
{
-
$GLOBALS['egw']->acl->add_repository(self::_appname, 'share_definition', $group,Acl::READ);
}
unset($content['share_definition']);
-
$data = config::read(self::_appname);
-
$data['share_definition'] = $GLOBALS['egw']->acl->get_ids_for_location('share_definition', EGW_ACL_READ, self::_appname);
-
$data = Api\Config::read(self::_appname);
-
$data['share_definition'] = $GLOBALS['egw']->acl->get_ids_for_location('share_definition', Acl::READ, self::_appname);
$sel_options['import_charsets'] = array_combine(mb_list_encodings(),mb_list_encodings());
// Remove 'standard' encodings to prevent doubles
— trunk/importexport/inc/class.importexport_export_csv.inc.php (original)
+++ trunk/importexport/inc/class.importexport_export_csv.inc.php Tue May 10 00:49:20 2016
@@ -10,6 +10,10 @@
+use EGroupware\Api;
+use EGroupware\Api\Link;
+use EGroupware\Api\Acl;
+
/**
-
-
@var translation holds (charset) translation object
-
-
@var translation holds (charset) Api\Translation object
*/
protected $translation;
@@ -96,7 +100,7 @@
*/
public function __construct( $_stream, array $_options ) {
if (!is_object($GLOBALS[‘egw’]->translation)) {
@@ -106,10 +110,10 @@
$this->csv_options = array_merge( $this->csv_options, $_options );
}
//error_log(METHOD.LINE.array2string($_options[‘appname’]));
-
if(!Api\Storage\Merge::is_export_limit_excepted()) {
-
$this->export_limit = Api\Storage\Merge::getExportLimit($_options['appname']);
//error_log(__METHOD__.__LINE__.' app:'.$_options['appname'].' limit:'.$this->export_limit);
@@ -124,7 +128,7 @@
}
if($_mapping[‘all_custom_fields’]) {
// Field value is the appname, so we can pull the fields
@@ -179,7 +183,7 @@
if(substr($label,-1) == ‘*’) $label = substr($label,0,-1);
}
} catch (Exception $e) {
@@ -236,7 +240,7 @@
if(!$appname) return;
$fields = array();
@@ -258,7 +262,7 @@
case ‘select’:
if (count($c_field[‘values’]) == 1 && isset($c_field[‘values’][’@’]))
{
@@ -333,12 +337,12 @@
foreach((array)$fields[‘links’] as $name) {
if($record->$name) {
if(is_numeric($record->$name) && !$links[$name]) {
@@ -352,11 +356,11 @@
if(is_array($record->$name)) {
$names = array();
foreach($record->$name as $_name) {
@@ -409,14 +413,14 @@
}
static $cat_object;
-
if(is_null($cat_object)) $cat_object = new Api\Categories(false,$appname);
foreach((array)$fields['select-cat'] as $name) {
if($record->$name) {
$cats = array();
$ids = is_array($record->$name) ? $record->$name : explode(',', $record->$name);
foreach($ids as $n => $cat_id) {
— trunk/importexport/inc/class.importexport_export_ui.inc.php (original)
+++ trunk/importexport/inc/class.importexport_export_ui.inc.php Tue May 10 00:49:20 2016
@@ -10,6 +10,10 @@
+use EGroupware\Api;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Etemplate;
+
/**
- userinterface for exports
-
@@ -32,8 +36,8 @@
private $export_plugins;
public function __construct() {
-
egw_framework::validate_file('.','export_dialog','importexport');
-
egw_framework::validate_file('.','importexport','importexport');
-
Framework::includeJS('.','export_dialog','importexport');
-
Framework::includeJS('.','importexport','importexport');
$this->user = $GLOBALS['egw_info']['user']['user_id'];
$this->export_plugins = importexport_helper_functions::get_plugins('all','export');
$GLOBALS['egw_info']['flags']['include_xajax'] = true;
@@ -46,7 +50,7 @@
$readonlys = array();
$preserv = array();
@@ -56,8 +60,8 @@
if($_GET[‘selection’] || $_content[‘selection_passed’]) $content[‘selection_passed’] = $preserv[‘selection_passed’] = true;
// Check global setting
@@ -245,7 +249,7 @@
if($_content[‘preview’] || $_content[‘export’])
{
//error_log(LINE.FILE.’$_content: '.print_r($_content,true));
@@ -287,13 +291,13 @@
}
if(is_array($value) && array_key_exists(‘from’, $value) && $value[‘from’])
{
-
$filter[$key]['from'] = Api\DateTime::to($value['from'],'ts');
}
// If user selects an end date, they most likely want entries including that date
if(is_array($value) && array_key_exists('to',$value) && $value['to'] )
{
// Adjust time to 23:59:59
@@ -316,7 +320,7 @@
$tmpfname = tempnam($GLOBALS[‘egw_info’][‘server’][‘temp_dir’],‘export’);
$file = fopen($tmpfname, “w+”);
if (! $charset = $definition->plugin_options[‘charset’]) {
@@ -338,7 +342,7 @@
}
// Store charset to use in header
-
Api\Cache::setSession('importexport', $tmpfname, $charset, 100);
if($_content['export'] == 'pressed') {
fclose($file);
@@ -357,7 +361,7 @@
$link_query[‘filename’] = $plugin_filename;
}
$response->redirect( $GLOBALS[‘egw’]->link(’/index.php’,$link_query),true);
@@ -378,9 +382,9 @@
unlink($tmpfname);
// Convert back to system charset for display
@@ -432,7 +436,7 @@
public function ajax_get_definition_description($_definition) {
@@ -446,7 +450,7 @@
}
public function ajax_get_plugin_description($_plugin) {
@@ -477,9 +481,9 @@
$file = fopen($tmpfname,‘rb’);
// Get charset
-
$charset = egw_cache::getSession('importexport', $tmpfname);
-
-
html::content_header($nicefname.'.'.$_GET['_suffix'],
-
$charset = Api\Cache::getSession('importexport', $tmpfname);
-
-
Api\Header\Content::type($nicefname.'.'.$_GET['_suffix'],
($_GET['_type'] ? $_GET['_type'] : 'application/text') . ($charset ? '; charset='.$charset : ''),
filesize($tmpfname));
fpassthru($file);
@@ -487,6 +491,6 @@
unlink($tmpfname);
// Try to avoid any extra finishing output
-
exit();
}
} // end class uiexport
— trunk/importexport/inc/class.importexport_helper_functions.inc.php (original)
+++ trunk/importexport/inc/class.importexport_helper_functions.inc.php Tue May 10 00:49:20 2016
@@ -9,6 +9,8 @@
+use EGroupware\Api;
/**
- class importexport_helper_functions (only static methods)
@@ -223,7 +225,7 @@
public static function cat_id2name( $_cat_ids ) {
$cat_ids = is_array( $_cat_ids ) ? $_cat_ids : explode( ‘,’, $_cat_ids );
foreach ( $cat_ids as $cat_id ) {
-
$cats = new Api\Categories(); // uses current user and app (egw_info[flags][currentapp])
$cat_names = is_array( $_cat_names ) ? $_cat_names : explode( ',', $_cat_names );
foreach ( $cat_names as $cat_name ) {
@@ -422,7 +424,7 @@
* @return array( => array( => array( => )))
*/
public static function get_plugins( $_appname = ‘all’, $_type = ‘all’ ) {
-
$plugins = Api\Cache::getTree(
__CLASS__,
'plugins',
array('importexport_helper_functions','_get_plugins'),
@@ -432,7 +434,7 @@
$appnames = $_appname == ‘all’ ? array_keys($GLOBALS[‘egw_info’][‘apps’]) : (array)$_appname;
$types = $_type == ‘all’ ? array(‘import’,‘export’) : (array)$_type;
-
// Testing: comment out Api\Cache call, use this
//$plugins = self::_get_plugins($appnames, $types);
foreach($plugins as $appname => $_types) {
if(!in_array($appname, $appnames)) unset($plugins[$appname]);
@@ -479,7 +481,7 @@
}
$d->close();
@@ -537,7 +539,7 @@
* @return boolean
*/
public static function has_definitions( $_appname = ‘all’, $_type = ‘all’ ) {
-
$definitions = Api\Cache::getSession(
__CLASS__,
'has_definitions',
array('importexport_helper_functions','_has_definitions'),
@@ -559,7 +561,7 @@
return count($definitions[$appname]) > 0;
}
- // egw_cache needs this public
- // Api\Cache needs this public
public static function _has_definitions(Array $appnames, Array $types) {
$def = new importexport_definitions_bo(array(‘application’=>$appnames, ‘type’ => $types));
$list = array();
@@ -636,7 +638,7 @@
}
}
// Add custom fields
— trunk/importexport/inc/class.importexport_iface_egw_record.inc.php (original)
+++ trunk/importexport/inc/class.importexport_iface_egw_record.inc.php Tue May 10 00:49:20 2016
@@ -10,9 +10,12 @@
+use EGroupware\Api;
+use EGroupware\Api\Egw;
+
/**
- class importexport_iface_egw_record
-
- This a the abstract interface of an egw record.
-
- This a the abstract interface of an Egw record.
- A record is e.g. a single address or or single event.
- The idea behind is that we can have metaoperation over differnt apps by
- having a common interface.
— trunk/importexport/inc/class.importexport_import_csv.inc.php (original)
+++ trunk/importexport/inc/class.importexport_import_csv.inc.php Tue May 10 00:49:20 2016
@@ -11,6 +11,9 @@
+use EGroupware\Api;
+use EGroupware\Api\Link;
+
/**
- class import_csv
- This a an abstract implementation of interface iface_import_record
@@ -156,7 +159,7 @@
return false;
}
$this->current_position++;
@@ -268,7 +271,7 @@
if($appname) {
// Load translations
-
Api\Translation::add_app($appname);
if(!self::$cf_parse_cache[$appname]) {
$c_fields = importexport_export_csv::convert_parse_custom_fields($appname, $selects, $links, $methods);
@@ -319,7 +322,7 @@
// Text - search for a matching record
if(!is_numeric($record[$name]))
{
@@ -389,36 +392,36 @@
// Need to handle format first
if($format == 1)
{
-
$formatted = egw_time::createFromFormat(
-
'!'.egw_time::$user_dateformat . ' ' .egw_time::$user_timeformat,
-
$formatted = Api\DateTime::createFromFormat(
-
'!'.Api\DateTime::$user_dateformat . ' ' .Api\DateTime::$user_timeformat,
$record[$name],
-
$formatted = Api\DateTime::createFromFormat(
-
'!'.Api\DateTime::$user_dateformat,
trim($record[$name]),
@@ -426,7 +429,7 @@
{
$record[$name] = $formatted->getTimestamp();
// Timestamp is apparently in server time, but apps will do the same conversion
@@ -447,13 +450,13 @@
// Need to handle format first
if($format == 1)
{
-
$formatted = egw_time::createFromFormat('!'.egw_time::$user_dateformat, $record[$name]);
-
if($formatted && $errors = egw_time::getLastErrors() && $errors['error_count'] == 0)
-
$formatted = Api\DateTime::createFromFormat('!'.Api\DateTime::$user_dateformat, $record[$name]);
-
if($formatted && $errors = Api\DateTime::getLastErrors() && $errors['error_count'] == 0)
{
$record[$name] = $formatted->getTimestamp();
}
}
-
$record[$name] = Api\DateTime::server2user($record[$name],'ts');
if(is_array(self::$cf_parse_cache[$appname][0]['date']) &&
in_array($name, self::$cf_parse_cache[$appname][0]['date'])) {
// Custom fields stored in a particular format (from customfields_widget)
@@ -484,7 +487,7 @@
if($appname) {
$GLOBALS[‘egw_info’][‘flags’][‘currentapp’] = $appname;
}
— trunk/importexport/inc/class.importexport_import_ui.inc.php (original)
+++ trunk/importexport/inc/class.importexport_import_ui.inc.php Tue May 10 00:49:20 2016
@@ -10,6 +10,10 @@
- @version $Id: class.importexport_import_ui.inc.php 27222 2009-06-08 16:21:14Z ralfbecker $
*/
+use EGroupware\Api;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Egw;
+use EGroupware\Api\Etemplate;
/**
-
userinterface for imports
@@ -44,14 +48,14 @@
$definition = $_GET[‘definition’] ? $_GET[‘definition’] : $content[‘definition’];
// We use some inline js in preview results if it fails