- Change file/class names to match new naming conventions

- Change spelling of wizzard to wizard
This commit is contained in:
Nathan Gray 2010-03-22 15:09:26 +00:00
parent fcf1de6a1c
commit a6887ae908
21 changed files with 362 additions and 288 deletions

View File

@ -42,7 +42,7 @@ class importexport_admin_prefs_sidebox_hooks
),
'Export'=> array(
'text' => 'Export',
'link' => $GLOBALS['egw']->link('/index.php','menuaction=importexport.uiexport.export_dialog'),
'link' => $GLOBALS['egw']->link('/index.php','menuaction=importexport.importexport_export_ui.export_dialog'),
'target' => 'new',
'icon' => 'export'
),
@ -70,9 +70,9 @@ class importexport_admin_prefs_sidebox_hooks
if ($GLOBALS['egw_info']['user']['apps']['admin'] && $location != 'preferences')
{
$file = Array(
'Import definitions' => $GLOBALS['egw']->link('/index.php','menuaction=importexport.uidefinitions.import_definition'),
'Import definitions' => $GLOBALS['egw']->link('/index.php','menuaction=importexport.importexport_definitions_ui.import_definition'),
'Define {im|ex}ports' => $GLOBALS['egw']->link('/index.php',array(
'menuaction' => 'importexport.uidefinitions.index',
'menuaction' => 'importexport.importexport_definitions_ui.index',
)),
'Schedule' => $GLOBALS['egw']->link('/index.php', array(
'menuaction' => 'importexport.importexport_schedule_ui.index'

View File

@ -8,9 +8,6 @@
* @author Nathan Gray
*/
require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.iface_import_plugin.inc.php');
require_once(EGW_INCLUDE_ROOT.'/importexport/inc/class.import_csv.inc.php');
/**
* A basic CSV import plugin.
@ -18,9 +15,8 @@ require_once(EGW_INCLUDE_ROOT.'/importexport/inc/class.import_csv.inc.php');
* You should extend this class to implement the various bits, but combined with the basic wizard
* should get you started on building a CSV plugin for an application fairly quickly.
*
* NB: The name of your import plugin must start with import_.
*/
abstract class basic_import_csv implements iface_import_plugin {
abstract class importexport_basic_import_csv implements importexport_iface_import_plugin {
protected static $plugin_options = array(
'fieldsep', // char
@ -97,8 +93,8 @@ abstract class basic_import_csv implements iface_import_plugin {
* @param string $_charset
* @param definition $_definition
*/
public function import( $_stream, definition $_definition ) {
$import_csv = new import_csv( $_stream, array(
public function import( $_stream, importexport_definition $_definition ) {
$import_csv = new importexport_import_csv( $_stream, array(
'fieldsep' => $_definition->plugin_options['fieldsep'],
'charset' => $_definition->plugin_options['charset'],
));

View File

@ -10,7 +10,6 @@
* @version $Id$
*/
require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.iface_egw_record.inc.php');
require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.arrayxml.inc.php');
require_once(EGW_INCLUDE_ROOT. '/etemplate/inc/class.so_sql.inc.php');
@ -22,7 +21,7 @@ require_once(EGW_INCLUDE_ROOT. '/etemplate/inc/class.so_sql.inc.php');
* are in one assiozative array which is complely managed by {Im|Ex}port plugins
* @todo testing
*/
class definition implements iface_egw_record {
class importexport_definition implements importexport_iface_egw_record {
const _appname = 'importexport';
const _defintion_talbe = 'egw_importexport_definitions';
@ -209,9 +208,11 @@ class definition implements iface_egw_record {
}
}
$this->plugin = $_record['plugin'];
// convert plugin_options into internal representation
$this->set_allowed_users( $this->definition['allowed_users'] );
$this->set_options( $this->definition['plugin_options'] );
$this->set_options( $this->definition['plugin_options'] ? $this->definition['plugin_options'] : array());
}
/**

View File

@ -10,19 +10,17 @@
* @version $Id$
*/
require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.definition.inc.php');
require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.arrayxml.inc.php');
require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.import_export_helper_functions.inc.php');
require_once(EGW_INCLUDE_ROOT.'/etemplate/inc/class.so_sql.inc.php');
/** bo to define {im|ex}ports
*
* @todo make this class an egw_record_pool!
*/
class bodefinitions {
class importexport_definitions_bo {
const _appname = 'importexport';
const _defintion_talbe = 'egw_importexport_definitions';
const _defintion_table = 'egw_importexport_definitions';
/**
* @var so_sql holds so_sql
@ -36,7 +34,7 @@ class bodefinitions {
public function __construct($_query=false)
{
$this->so_sql = new so_sql(self::_appname, self::_defintion_talbe );
$this->so_sql = new so_sql(self::_appname, self::_defintion_table );
if ($_query) {
$definitions = $this->so_sql->search($_query, true);
foreach ((array)$definitions as $definition) {
@ -54,7 +52,7 @@ class bodefinitions {
return $this->definitions;
}
public function read($definition_id) {
$definition = new definition( $definition_id['name'] );
$definition = new importexport_definition( $definition_id['name'] );
return $definition->get_record_array();
}
/**
@ -76,7 +74,7 @@ class bodefinitions {
* @param definition $definition
*/
public function save(Array $data) {
$definition = new definition();
$definition = new importexport_definition();
$definition->set_record($data);
$definition->save($data['definition_id']);
}
@ -117,7 +115,7 @@ class bodefinitions {
$export_data['definitions'] = array();
foreach ($keys as $definition_id) {
$definition = new definition( $definition_id );
$definition = new importexport_definition( $definition_id );
$export_data['definitions'][$definition->name] = $definition->get_record_array();
$export_data['definitions'][$definition->name]['allowed_users'] =
import_export_helper_functions::account_id2name(
@ -166,10 +164,10 @@ class bodefinitions {
foreach ( $definitions as $name => $definition_data )
{
// convert allowed_user
$definition_data['allowed_users'] = import_export_helper_functions::account_name2id( $definition_data['allowed_users'] );
$definition_data['owner'] = import_export_helper_functions::account_name2id( $definition_data['owner'] );
$definition_data['allowed_users'] = importexport_helper_functions::account_name2id( $definition_data['allowed_users'] );
$definition_data['owner'] = importexport_helper_functions::account_name2id( $definition_data['owner'] );
$definition = new definition( $definition_data['name'] );
$definition = new importexport_definition( $definition_data['name'] );
$definition_id = $definition->get_identifier() ? $definition->get_identifier() : NULL;
$definition->set_record( $definition_data );

View File

@ -10,14 +10,12 @@
* @version $Id$
*/
require_once('class.bodefinitions.inc.php');
/**
* Userinterface to define {im|ex}ports
*
* @package importexport
*/
class uidefinitions
class importexport_definitions_ui
{
const _debug = false;
@ -26,7 +24,7 @@ class uidefinitions
public $public_functions = array(
'edit' => true,
'index' => true,
'wizzard' => true,
'wizard' => true,
'import_definition' => true,
);
@ -51,7 +49,7 @@ class uidefinitions
*/
var $response = true;
function uidefinitions()
function __construct()
{
// we cant deal with notice and warnings, as we are on ajax!
error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING);
@ -62,14 +60,14 @@ class uidefinitions
$this->etpl = new etemplate();
$this->clock = html::image(self::_appname,'clock');
$this->steps = array(
'wizzard_step10' => lang('Choose an application'),
'wizzard_step20' => lang('Choose a plugin'),
'wizzard_step21' => lang('Choose a name for this definition'),
'wizzard_step90' => lang('Which users are allowed to use this definition'),
'wizzard_finish' => '',
'wizard_step10' => lang('Choose an application'),
'wizard_step20' => lang('Choose a plugin'),
'wizard_step21' => lang('Choose a name for this definition'),
'wizard_step90' => lang('Which users are allowed to use this definition'),
'wizard_finish' => '',
);
//register plugins
$this->plugins = import_export_helper_functions::get_plugins();
$this->plugins = importexport_helper_functions::get_plugins();
}
/**
@ -79,7 +77,7 @@ class uidefinitions
*/
function index($content = null,$msg='')
{
$bodefinitions = new bodefinitions(array('name' => '*'));
$bodefinitions = new importexport_definitions_bo(array('name' => '*'));
if (is_array($content))
{
if (isset($content['delete']))
@ -118,12 +116,12 @@ class uidefinitions
$definitions = array('row0');
foreach ($bodefinitions->get_definitions() as $identifier) {
$definition = new definition($identifier);
$definition = new importexport_definition($identifier);
$definitions[] = $definition->get_record_array();
unset($definition);
}
$content = $definitions;
return $etpl->exec( self::_appname.'.uidefinitions.index', $content, array(), $readonlys, $preserv );
return $etpl->exec( self::_appname.'.importexport_definitions_ui.index', $content, array(), $readonlys, $preserv );
}
function edit()
@ -133,13 +131,13 @@ class uidefinitions
//close window
}
$definition = array('name' => $_definition);
$bodefinitions = new bodefinitions();
$bodefinitions = new importexport_definitions_bo();
$definition = $bodefinitions->read($definition);
$definition['edit'] = true;
$this->wizzard($definition);
$this->wizard($definition);
}
function wizzard($content = null, $msg='')
function wizard($content = null, $msg='')
{
$GLOBALS['egw_info']['flags']['java_script'] .=
"<script LANGUAGE='JavaScript'>
@ -150,30 +148,40 @@ class uidefinitions
}
</script>";
$this->etpl->read('importexport.wizzardbox');
$this->wizzard_content_template =& $this->etpl->children[0]['data'][1]['A'][2][1]['name'];
$this->etpl->read('importexport.wizardbox');
$this->wizard_content_template =& $this->etpl->children[0]['data'][1]['A'][2][1]['name'];
if(is_array($content) &&! $content['edit'])
{
if(self::_debug) error_log('importexport.wizzard->$content '. print_r($content,true));
if(self::_debug) error_log('importexport.wizard->$content '. print_r($content,true));
// fetch plugin object
if($content['plugin'] && $content['application'])
{
// we need to deal with the wizzard object if exists
if (file_exists(EGW_SERVER_ROOT . '/'. $content['application'].'/importexport/class.wizzard_'. $content['plugin'].'.inc.php'))
$wizard_name = $content['application'] . '_wizard_' . str_replace($content['application'] . '_', '', $content['plugin']);
// we need to deal with the wizard object if exists
if (file_exists(EGW_SERVER_ROOT . '/'. $content['application'].'/importexport/class.wizzard_'. $content['plugin'].'.inc.php')) {
error_log('Wizard has one z in english');
}
if (file_exists(EGW_SERVER_ROOT . '/'. $content['application'].'/importexport/class.wizard_'. $content['plugin'].'.inc.php'))
{
require_once(EGW_SERVER_ROOT . '/'. $content['application'].'/importexport/class.wizzard_'. $content['plugin'].'.inc.php');
$wizzard_plugin = 'wizzard_'.$content['plugin'];
require_once(EGW_SERVER_ROOT . '/'. $content['application'].'/importexport/class.wizard_'. $content['plugin'].'.inc.php');
$wizard_plugin = 'wizard_'.$content['plugin'];
error_log('Deprecated location for importexport wizard. Please move it to app/inc/ and rename it to follow new conventions');
}
elseif (file_exists(EGW_SERVER_ROOT . '/'. $content['application']."/inc/class.$wizard_name.inc.php"))
{
$wizard_plugin = $wizard_name;
}
else
{
$wizzard_plugin = $content['plugin'];
$wizard_plugin = $content['plugin'];
}
$this->plugin = is_object($GLOBALS['egw']->$wizzard_plugin) ? $GLOBALS['egw']->$wizzard_plugin : new $wizzard_plugin;
$this->plugin = is_object($GLOBALS['egw']->$wizard_plugin) ? $GLOBALS['egw']->$wizard_plugin : new $wizard_plugin;
// Global object needs to be the same, or references to plugin don't work
if(!is_object($GLOBALS['egw']->uidefinitions) || $GLOBALS['egw']->uidefinitions !== $this)
$GLOBALS['egw']->uidefinitions =& $this;
if(!is_object($GLOBALS['egw']->importexport_definitions_ui) || $GLOBALS['egw']->importexport_definitions_ui !== $this)
$GLOBALS['egw']->importexport_definitions_ui =& $this;
}
// deal with buttons even if we are not on ajax
if(isset($content['button']) && array_search('pressed',$content['button']) === false && count($content['button']) == 1)
@ -183,10 +191,14 @@ class uidefinitions
}
// post process submitted step
if(!key_exists($content['step'],$this->steps))
$next_step = $this->plugin->$content['step']($content);
else
$next_step = $this->$content['step']($content);
if($content['step']) {
if(!key_exists($content['step'],$this->steps))
$next_step = $this->plugin->$content['step']($content);
else
$next_step = $this->$content['step']($content);
} else {
die('Cannot find next step');
}
// pre precess next step
$sel_options = $readonlys = $preserv = array();
@ -197,14 +209,14 @@ class uidefinitions
}
if(!key_exists($next_step,$this->steps))
{
$this->wizzard_content_template = $this->plugin->$next_step($content,$sel_options,$readonlys,$preserv);
$this->wizard_content_template = $this->plugin->$next_step($content,$sel_options,$readonlys,$preserv);
}
else
{
$this->wizzard_content_template = $this->$next_step($content,$sel_options,$readonlys,$preserv);
$this->wizard_content_template = $this->$next_step($content,$sel_options,$readonlys,$preserv);
}
$html = $this->etpl->exec(self::_appname.'.uidefinitions.wizzard',$content,$sel_options,$readonlys,$preserv,1);
$html = $this->etpl->exec(self::_appname.'.importexport_definitions_ui.wizard',$content,$sel_options,$readonlys,$preserv,1);
}
else
{
@ -216,8 +228,8 @@ class uidefinitions
if($content['edit'])
unset ($content['edit']);
$this->wizzard_content_template = $this->wizzard_step10($content, $sel_options, $readonlys, $preserv);
$html = $this->etpl->exec(self::_appname.'.uidefinitions.wizzard',$content,$sel_options,$readonlys,$preserv,1);
$this->wizard_content_template = $this->wizard_step10($content, $sel_options, $readonlys, $preserv);
$html = $this->etpl->exec(self::_appname.'.importexport_definitions_ui.wizard',$content,$sel_options,$readonlys,$preserv,1);
}
if(class_exists('xajaxResponse'))
@ -250,12 +262,12 @@ class uidefinitions
$GLOBALS['egw']->js->set_onload("document.getElementById('picturebox').style.display = 'none';");
$GLOBALS['egw']->common->egw_header();
echo '<div id="divMain">'."\n";
echo '<div><h3>{Im|Ex}port Wizzard</h3></div>';
echo '<div><h3>{Im|Ex}port Wizard</h3></div>';
// adding a manual icon to every popup
if ($GLOBALS['egw_info']['user']['apps']['manual'])
{
$manual = new etemplate('etemplate.popup.manual');
echo $manual->exec(self::_appname.'.uidefinitions.wizzard',$content,$sel_options,$readonlys,$preserv,1);
echo $manual->exec(self::_appname.'.importexport_definitions_ui.wizard',$content,$sel_options,$readonlys,$preserv,1);
unset($manual);
}
@ -293,54 +305,61 @@ class uidefinitions
}
$step_keys = array_keys($steps);
$nn = array_search($curr_step,$step_keys)+(int)$step_width;
return (key_exists($nn,$step_keys)) ? $step_keys[$nn] : 'wizzard_finish';
return (key_exists($nn,$step_keys)) ? $step_keys[$nn] : 'wizard_finish';
}
function wizzard_step10(&$content, &$sel_options, &$readonlys, &$preserv)
function wizard_step10(&$content, &$sel_options, &$readonlys, &$preserv)
{
if(self::_debug) error_log('addressbook.importexport.addressbook_csv_import::wizzard_step10->$content '.print_r($content,true));
if(self::_debug) error_log('importexport.importexport_definitions_ui::wizard_step10->$content '.print_r($content,true));
// return from step10
if ($content['step'] == 'wizzard_step10')
if ($content['step'] == 'wizard_step10')
{
switch (array_search('pressed', $content['button']))
{
case 'next':
return $this->get_step($content['step'],1);
case 'finish':
return 'wizzard_finish';
return 'wizard_finish';
default :
return $this->wizzard_step10($content,$sel_options,$readonlys,$preserv);
return $this->wizard_step10($content,$sel_options,$readonlys,$preserv);
}
}
// init step10
else
{
$content['msg'] = $this->steps['wizzard_step10'];
$content['msg'] = $this->steps['wizard_step10'];
foreach ($this->plugins as $appname => $options) $sel_options['application'][$appname] = lang($appname);
$GLOBALS['egw']->js->set_onload("disable_button('exec[button][previous]');");
$content['step'] = 'wizzard_step10';
$content['step'] = 'wizard_step10';
$preserv = $content;
unset ($preserv['button']);
return 'importexport.wizzard_chooseapp';
return 'importexport.wizard_chooseapp';
}
}
// get plugin
function wizzard_step20(&$content, &$sel_options, &$readonlys, &$preserv)
function wizard_step20(&$content, &$sel_options, &$readonlys, &$preserv)
{
if(self::_debug) error_log('addressbook.importexport.addressbook_csv_import::wizzard_step20->$content '.print_r($content,true));
if(self::_debug) error_log('importexport.' . get_class($this) . '::wizard_step20->$content '.print_r($content,true));
// return from step20
if ($content['step'] == 'wizzard_step20')
if ($content['step'] == 'wizard_step20')
{
switch (array_search('pressed', $content['button']))
{
case 'next':
$content['type'] = $this->plugin instanceof iface_import_plugin ? 'import' : 'export';
// There's no real reason the plugin has to come from any of these, as long as it has a $steps variable
if($this->plugin instanceof importexport_iface_import_plugin || $this->plugin instanceof importexport_wizard_basic_import_csv) {
$content['type'] = 'import';
} elseif($this->plugin instanceof importexport_iface_export_plugin) {
$content['type'] = 'export';
} else {
throw new egw_exception('Invalid plugin');
}
return $this->get_step($content['step'],1);
case 'previous' :
unset ($content['plugin']);
@ -349,36 +368,36 @@ class uidefinitions
}
return $this->get_step($content['step'],-1);
case 'finish':
return 'wizzard_finish';
return 'wizard_finish';
default :
return $this->wizzard_step20($content,$sel_options,$readonlys,$preserv);
return $this->wizard_step20($content,$sel_options,$readonlys,$preserv);
}
}
// init step20
else
{
$content['msg'] = $this->steps['wizzard_step20'];
$content['msg'] = $this->steps['wizard_step20'];
foreach ($this->plugins[$content['application']] as $type => $plugins) {
foreach($plugins as $plugin => $name) {
$sel_options['plugin'][$plugin] = $name;
}
}
$content['step'] = 'wizzard_step20';
$content['step'] = 'wizard_step20';
$preserv = $content;
unset ($preserv['button']);
return 'importexport.wizzard_chooseplugin';
return 'importexport.wizard_chooseplugin';
}
}
// name
function wizzard_step21(&$content, &$sel_options, &$readonlys, &$preserv)
function wizard_step21(&$content, &$sel_options, &$readonlys, &$preserv)
{
if(self::_debug) error_log('importexport.uidefinitions::wizzard_step21->$content '.print_r($content,true));
if(self::_debug) error_log('importexport.importexport_definitions_ui::wizard_step21->$content '.print_r($content,true));
// return from step21
if ($content['step'] == 'wizzard_step21')
if ($content['step'] == 'wizard_step21')
{
switch (array_search('pressed', $content['button']))
{
@ -387,29 +406,29 @@ class uidefinitions
case 'previous' :
return $this->get_step($content['step'],-1);
case 'finish':
return 'wizzard_finish';
return 'wizard_finish';
default :
return $this->wizzard_step21($content,$sel_options,$readonlys,$preserv);
return $this->wizard_step21($content,$sel_options,$readonlys,$preserv);
}
}
// init step21
else
{
$content['msg'] = $this->steps['wizzard_step21'];
$content['step'] = 'wizzard_step21';
$content['msg'] = $this->steps['wizard_step21'];
$content['step'] = 'wizard_step21';
$preserv = $content;
unset ($preserv['button']);
return 'importexport.wizzard_choosename';
return 'importexport.wizard_choosename';
}
}
// allowed users
function wizzard_step90(&$content, &$sel_options, &$readonlys, &$preserv)
function wizard_step90(&$content, &$sel_options, &$readonlys, &$preserv)
{
if(self::_debug) error_log('importexport.uidefinitions::wizzard_step90->$content '.print_r($content,true));
if(self::_debug) error_log('importexport.importexport_definitions_ui::wizard_step90->$content '.print_r($content,true));
// return from step90
if ($content['step'] == 'wizzard_step90')
if ($content['step'] == 'wizard_step90')
{
$content['allowed_users'] = implode(',',$content['allowed_users']);
@ -420,45 +439,45 @@ class uidefinitions
return $this->get_step($content['step'],-1);
case 'next':
case 'finish':
return 'wizzard_finish';
return 'wizard_finish';
default :
return $this->wizzard_step90($content,$sel_options,$readonlys,$preserv);
return $this->wizard_step90($content,$sel_options,$readonlys,$preserv);
}
}
// init step90
else
{
$content['msg'] = $this->steps['wizzard_step90'];
$content['step'] = 'wizzard_step90';
$content['msg'] = $this->steps['wizard_step90'];
$content['step'] = 'wizard_step90';
$preserv = $content;
unset ($preserv['button']);
$GLOBALS['egw']->js->set_onload("disable_button('exec[button][next]');");
if(is_object($this->response)) {
$this->response->addAssign('exec[button][next]','style.display', 'none');
}
return 'importexport.wizzard_chooseallowedusers';
return 'importexport.wizard_chooseallowedusers';
}
}
function wizzard_finish(&$content)
function wizard_finish(&$content)
{
if(self::_debug) error_log('importexport.uidefinitions::wizzard_finish->$content '.print_r($content,true));
if(self::_debug) error_log('importexport.importexport_definitions_ui::wizard_finish->$content '.print_r($content,true));
// Take out some UI leavings
unset($content['msg']);
unset($content['step']);
unset($content['button']);
$bodefinitions = new bodefinitions();
$bodefinitions = new importexport_definitions_bo();
$bodefinitions->save($content);
// This message is displayed if browser cant close window
$content['msg'] = lang('ImportExport wizard finished successfully!');
$content['closewindow'] = true;
return 'importexport.wizzard_close';
return 'importexport.wizard_close';
}
function import_definition($content='')
{
$bodefinitions = new bodefinitions();
$bodefinitions = new importexport_definitions_bo();
if (is_array($content))
{
$bodefinitions->import($content['import_file']['tmp_name']);
@ -468,7 +487,7 @@ class uidefinitions
else
{
$etpl = new etemplate(self::_appname.'.import_definition');
return $etpl->exec(self::_appname.'.uidefinitions.import_definition',$content,array(),$readonlys,$preserv);
return $etpl->exec(self::_appname.'.importexport_definitions_ui.import_definition',$content,array(),$readonlys,$preserv);
}
}
}

View File

@ -10,9 +10,6 @@
* @version $Id$
*/
require_once('class.iface_export_record.inc.php');
require_once('class.import_export_helper_functions.inc.php');
require_once('class.iface_egw_record.inc.php');
require_once(EGW_INCLUDE_ROOT. '/phpgwapi/inc/class.translation.inc.php');
/**
@ -22,7 +19,7 @@ require_once(EGW_INCLUDE_ROOT. '/phpgwapi/inc/class.translation.inc.php');
* No mater where the records come from, at the end export_entry
* stores it into the stream
*/
class export_csv implements iface_export_record
class importexport_export_csv implements importexport_iface_export_record
{
/**
* @var array array with field mapping in form egw_field_name => exported_field_name
@ -111,10 +108,10 @@ class export_csv implements iface_export_record
/**
* exports a record into resource of handle
*
* @param iface_egw_record record
* @param importexport_iface_egw_record record
* @return bool
*/
public function export_record( iface_egw_record $_record ) {
public function export_record( importexport_iface_egw_record $_record ) {
$this->record = $_record->get_record_array();
// begin with fieldnames ?
@ -126,7 +123,7 @@ class export_csv implements iface_export_record
// do conversions
if ( !empty( $this->conversion )) {
$this->record = import_export_helper_functions::conversion( $this->record, $this->conversion );
$this->record = importexport_helper_functions::conversion( $this->record, $this->conversion );
}
// do fieldmapping
@ -171,7 +168,7 @@ class export_csv implements iface_export_record
* @param char $delimiter
* @param char $enclosure
*/
protected function fputcsv($filePointer, $dataArray, $delimiter, $enclosure){
protected function fputcsv($filePointer, Array $dataArray, $delimiter, $enclosure){
$string = "";
$writeDelimiter = false;
foreach($dataArray as $dataElement) {

View File

@ -11,16 +11,13 @@
*/
require_once(EGW_INCLUDE_ROOT. '/etemplate/inc/class.etemplate.inc.php');
require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.import_export_helper_functions.inc.php');
require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.bodefinitions.inc.php');
require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.definition.inc.php');
/**
* userinterface for exports
*
*/
class uiexport {
class importexport_export_ui {
const _appname = 'importexport';
public $public_functions = array(
@ -42,7 +39,7 @@ class uiexport {
$this->js = $GLOBALS['egw']->js = is_object($GLOBALS['egw']->js) ? $GLOBALS['egw']->js : CreateObject('phpgwapi.javascript');
$this->js->validate_file('.','export_dialog','importexport');
$this->user = $GLOBALS['egw_info']['user']['user_id'];
$this->export_plugins = import_export_helper_functions::get_plugins('all','export');
$this->export_plugins = importexport_helper_functions::get_plugins('all','export');
$GLOBALS['egw_info']['flags']['include_xajax'] = true;
}
@ -57,12 +54,11 @@ class uiexport {
if(empty($_content)) {
$et = new etemplate(self::_appname. '.export_dialog');
$_appname = $_GET['appname'];
//$_definition = $_GET['definition'] = 'expert';
$_definition = $_GET['definition'];
$_plugin = $_GET['plugin']; // NOTE: definition _must_ be 'expert' if for plugin to be used!
$_selection = $_GET['selection'];
error_log(__FILE__.__FUNCTION__. '::$_GET[\'appname\']='. $_appname. ',$_GET[\'definition\']='. $_definition. ',$_GET[\'plugin\']='.$_plugin. ',$_GET[\'selection\']='.$_selection);
//error_log(__FILE__.__FUNCTION__. '::$_GET[\'appname\']='. $_appname. ',$_GET[\'definition\']='. $_definition. ',$_GET[\'plugin\']='.$_plugin. ',$_GET[\'selection\']='.$_selection);
// if appname is given and valid, list available definitions (if no definition is given)
if (!empty($_appname) && $GLOBALS['egw']->acl->check('run',1,$_appname)) {
$content['appname'] = $_appname;
@ -73,12 +69,12 @@ class uiexport {
// fill definitions
$sel_options['definition'] = array();
$definitions = new bodefinitions(array(
$definitions = new importexport_definitions_bo(array(
'type' => 'export',
'application' => isset($content['appname']) ? $content['appname'] : '%'
));
foreach ((array)$definitions->get_definitions() as $identifier) {
$definition = new definition($identifier);
$definition = new importexport_definition($identifier);
if ($title = $definition->get_title()) {
$sel_options['definition'][$title] = $title;
}
@ -116,10 +112,12 @@ class uiexport {
$this->js->set_onload("set_style_by_class('tr','select_definition','display','none');");
}
else {
$this->js->set_onload("set_style_by_class('tr','select_plugin','display','none');");
$this->js->set_onload("set_style_by_class('tr','save_definition','display','none');");
$definition = new definition($content['definition']);
$definition = new importexport_definition($content['definition']);
$selected_plugin = $definition->plugin;
$content['description'] = $definition->description;
}
@ -142,21 +140,23 @@ class uiexport {
$content['selection'] = $_selection;
$preserv['selection'] = $_selection;
}
else {
elseif ($plugin_object) {
// ToDo: I need to think abaout it...
// are selectors abstracted in the iface_egw_record_entity ?
// if so, we might not want to have html here ?
//$content['plugin_selectors_html'] = $plugin_object->get_selectors_html();
$content['plugin_selectors_html'] = $plugin_object->get_selectors_html();
}
//unset ($plugin_object);
unset ($plugin_object);
}
// if no appname is supplied, list apps which can export
else {
(array)$apps = import_export_helper_functions::get_apps('export');
(array)$apps = importexport_helper_functions::get_apps('export');
$sel_options['appname'] = array('' => lang('Select one')) + array_combine($apps,$apps);
$this->js->set_onload("set_style_by_class('tr','select_plugin','display','none');");
$content['plugin_selectors_html'] = $content['plugin_options_html'] =
lang('You need to select an app and format first!');
$this->js->set_onload("document.getElementById('importexport.export_dialog.options_tab-tab').style.visibility='hidden';");
$this->js->set_onload("document.getElementById('importexport.export_dialog.selection_tab-tab').style.visibility='hidden';");
}
if (!$_selection) {
@ -176,19 +176,25 @@ class uiexport {
$response = new xajaxResponse();
if ($_content['definition'] == 'expert') {
$definition = new definition();
$definition = new importexport_definition();
$definition->definition_id = $_content['definition_id'] ? $_content['definition_id'] : '';
$definition->name = $_content['name'] ? $_content['name'] : '';
$definition->name = $_content['name'] ? $_content['name'] : '';
$definition->application = $_content['appname'];
$definition->plugin = $_content['plugin'];
$definition->type = 'export';
$definition->plugin = $_content['plugin'];
$definition->type = 'export';
$definition->allowed_users = $_content['allowed_users'] ? $_content['allowed_users'] : $this->user;
$definition->owner = $_content['owner'] ? $_content['owner'] : $this->user;
$definition->owner = $_content['owner'] ? $_content['owner'] : $this->user;
}
else {
$definition = new definition($_content['definition']);
$definition = new importexport_definition($_content['definition']);
}
_debug_array($_content);
if(!is_array($definition->plugin_options)) {
$definition->plugin_options = array(
'mapping' => array()
);
}
if (isset($definition->plugin_options['selection'])) {
//$definition->plugin_options = parse(...)
}
@ -199,6 +205,11 @@ class uiexport {
);
}
if(!$definition->plugin_options['selection']) {
$response->addScript('alert("' . lang('No records selected') . '");');
return $response->getXML();
}
$tmpfname = tempnam('/tmp','export');
$file = fopen($tmpfname, "w+");
if (! $charset = $definition->plugin_options['charset']) {
@ -210,7 +221,7 @@ class uiexport {
if($_content['export'] == 'pressed') {
fclose($file);
$response->addScript("xajax_eT_wrapper();");
$response->addScript("opener.location.href='". $GLOBALS['egw']->link('/index.php','menuaction=importexport.uiexport.download&_filename='. $tmpfname.'&_appname='. $definition->application). "&_suffix=". $plugin_object->get_filesuffix(). "';");
$response->addScript("opener.location.href='". $GLOBALS['egw']->link('/index.php','menuaction=importexport.importexport_export_ui.download&_filename='. $tmpfname.'&_appname='. $definition->application). "&_suffix=". $plugin_object->get_filesuffix(). "';");
$response->addScript('window.setTimeout("window.close();", 100);');
return $response->getXML();
}
@ -248,9 +259,12 @@ class uiexport {
}
//nothing else expected!
throw new Exception('Error: unexpected submit in export_dialog!');
} else {
$readonlys[$tabs]['selection'] = true;
$readonlys[$tabs]['selection'] = false;
}
//error_log(print_r($content,true));
return $et->exec(self::_appname. '.uiexport.export_dialog',$content,$sel_options,$readonlys,$preserv,2);
return $et->exec(self::_appname. '.importexport_export_ui.export_dialog',$content,$sel_options,$readonlys,$preserv,2);
}
public function ajax_get_definitions($_appname, xajaxResponse &$response = null) {
@ -264,15 +278,16 @@ class uiexport {
return $no_return ? '' : $response->getXML();
}
$definitions = new bodefinitions(array(
$definitions = new importexport_definitions_bo(array(
'type' => 'export',
'application' => $_appname
));
foreach ((array)$definitions->get_definitions() as $identifier) {
$definition = new definition($identifier);
$definition = new importexport_definition($identifier);
if ($title = $definition->get_title()) {
if (!$selected_plugin) $selected_plugin = $plugin;
$sel_options['definition'] .= '<option value="'. $title. '" >'. $title. '</option>';
if (!$selected_plugin) $selected_plugin = $title;
$sel_options['definition'] .= '<option ' . ($selected_plugin == $title ? 'selected="selected" ' : '') .
'value="'. $title. '" >'. $title. '</option>';
}
unset($definition);
}
@ -284,8 +299,8 @@ class uiexport {
} else {
$response->addScript("set_style_by_class('tr','select_plugin','display','none');");
}
$response->addScript('export_dialog.change_definition(document.getElementId(\'exec[definition]\'));');
$response->addAssign('exec[definition]','innerHTML',$sel_options['definition']);
$response->addScript('export_dialog.change_definition(document.getElementById("exec[definition]"));');
$response->addScript("set_style_by_class('tr','select_definition','display','table-row');");
return $no_return ? '' : $response->getXML();
}
@ -301,7 +316,7 @@ class uiexport {
return $no_return ? '' : $response->getXML();
}
(array)$plugins = import_export_helper_functions::get_plugins($_appname,'export');
(array)$plugins = importexport_helper_functions::get_plugins($_appname,'export');
$sel_options['plugin'] = '';
foreach ($plugins[$_appname]['export'] as $plugin => $plugin_name) {
if (!$selected_plugin) $selected_plugin = $plugin;
@ -309,6 +324,8 @@ class uiexport {
}
$this->ajax_get_plugin_description($selected_plugin,$response);
$this->ajax_get_plugin_options($selected_plugin, $response, $_definition);
$this->ajax_get_plugin_selectors($selected_plugin, $response, $_definition);
$response->addAssign('exec[plugin]','innerHTML',$sel_options['plugin']);
$response->addScript("set_style_by_class('tr','select_plugin','display','table-row');");
return $no_return ? '' : $response->getXML();
@ -320,8 +337,8 @@ class uiexport {
$response = new xajaxResponse();
}
if (!$_definition) return $response->getXML();
$_object = new definition($_definition);
if (is_a($_object, 'definition')) {
$_object = new importexport_definition($_definition);
if (is_a($_object, 'importexport_definition')) {
$description = $_object->description;
$response->assign('exec[plugin_description]','innerHTML',$description);
}
@ -331,37 +348,52 @@ class uiexport {
}
public function ajax_get_plugin_description($_plugin,&$_response=false) {
$no_return = !is_null($response);
if(is_null($response)) {
$response = new xajaxResponse();
$no_return = !is_null($_response);
if(is_null($_response)) {
$_response = new xajaxResponse();
}
if (!$_plugin) return $no_return ? '' : $response->getXML();
$plugin_object = new $_plugin;
if (is_a($plugin_object, 'iface_export_plugin')) {
if (is_a($plugin_object, 'importexport_iface_export_plugin')) {
$description = $plugin_object->get_description();
$_response->addAssign('exec[plugin_description]','innerHTML',$description);
$this->ajax_get_plugin_options($_plugin, $_response);
}
unset ($plugin_object);
return $no_return ? '' : $response->getXML();
}
public function ajax_get_plugin_options($_plugin,$_response=false) {
public function ajax_get_plugin_options($_plugin,&$response=false, $definition = '') {
$no_return = !is_null($response);
if(is_null($response)) {
$response = new xajaxResponse();
}
$response = $_response ? $_response : new xajaxResponse();
if (!$_plugin) return $no_return ? '' : $response->getXML();
$plugin_object = new $_plugin;
if (is_a($plugin_object, 'iface_export_plugin')) {
if (is_a($plugin_object, 'importexport_iface_export_plugin')) {
$options = $plugin_object->get_options_etpl();
ob_start();
$template = new etemplate($options);
/*
$template->exec('importexport.importexport_export_ui.dialog', array(), array(), array(), array(), 2);
$html = ob_get_clean();
ob_end_clean();
*/
$html = $template->exec('importexport.importexport_export_ui.dialog', array(), array(), array(), array(), 1);
$html = preg_replace('|<input.+id="etemplate_exec_id".*/>|',
'',
$html
);
$response->addAssign('importexport.export_dialog.options_tab', 'innerHTML', $html);
}
unset ($plugin_object);
return $_response ? '' : $response->getXML();
return $no_return ? '' : $response->getXML();
}
/**
@ -387,8 +419,31 @@ class uiexport {
unlink($tmpfname);
}
public function ajax_get_plugin_selectors() {
public function ajax_get_plugin_selectors($_plugin,&$response=false, $definition = '') {
$no_return = !is_null($response);
if(is_null($response)) {
$response = new xajaxResponse();
}
if (!$_plugin) return $no_return ? '' : $response->getXML();
$plugin_object = new $_plugin;
if (is_a($plugin_object, 'importexport_iface_export_plugin')) {
$options = $plugin_object->get_selectors_etpl();
ob_start();
$template = new etemplate($options);
$template->exec('importexport.importexport_export_ui.dialog', array(), array(), array(), array(), 2);
$html = ob_get_clean();
ob_end_clean();
$html = preg_replace('|<input.+id="etemplate_exec_id".*/>|',
'',
$html
);
$response->addAssign('importexport.export_dialog.selection_tab', 'innerHTML', $html);
}
unset ($plugin_object);
return $no_return ? '' : $response->getXML();
}
public function ajax_get_template($_name) {

View File

@ -14,7 +14,7 @@
* class import_export_helper_functions (only static methods)
* use import_export_helper_functions::method
*/
class import_export_helper_functions {
class importexport_helper_functions {
/**
* nothing to construct here, only static functions!
@ -272,7 +272,7 @@ class import_export_helper_functions {
$plugins = array();
foreach ($appnames as $appname) {
$appdir = EGW_INCLUDE_ROOT. "/$appname/importexport";
$appdir = EGW_INCLUDE_ROOT. "/$appname/inc";
if(!is_dir($appdir)) continue;
$d = dir($appdir);
@ -282,19 +282,20 @@ class import_export_helper_functions {
$file = $appdir. '/'. $entry;
foreach ($types as $type) {
if( !is_file($file) || substr($classname,0,7) != $type.'_' || $extension != 'php' ) continue;
if( !is_file($file) || strpos($entry, $type) === false || $extension != 'php' ) continue;
require_once($file);
try {
$plugin_object = @new $classname;
}
catch (Exception $exception) {
continue;
}
if (is_a($plugin_object,'iface_'.$type.'_plugin')) {
$reflectionClass = new ReflectionClass($classname);
if($reflectionClass->IsInstantiable() &&
$reflectionClass->implementsInterface('importexport_iface_'.$type.'_plugin')) {
try {
$plugin_object = new $classname;
}
catch (Exception $exception) {
continue;
}
$plugins[$appname][$type][$classname] = $plugin_object->get_name();
unset ($plugin_object);
}
unset ($plugin_object);
}
}
$d->close();

View File

@ -11,7 +11,7 @@
*/
/**
* class iface_egw_record
* class importexport_iface_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
@ -24,7 +24,7 @@
* @todo functions for capabilities of object
* @todo caching. e.g. only read name of object
*/
interface iface_egw_record
interface importexport_iface_egw_record
{
/**

View File

@ -11,7 +11,7 @@
*/
/**
* class iface_export_plugin
* class importexport_iface_export_plugin
* This a the abstract interface for an export plugin of importexport
*
* You need to implement this class in
@ -34,15 +34,15 @@
*
* get_selector(); //returns array
*/
interface iface_export_plugin {
interface importexport_iface_export_plugin {
/**
* exports entries according to given definition object.
*
* @param stream $_stream
* @param definition $_definition
* @param importexport_definition $_definition
*/
public function export($_stream, definition $_definition);
public function export($_stream, importexport_definition $_definition);
/**
* returns translated name of plugin

View File

@ -24,7 +24,7 @@
* usable for other tasks.
*
*/
interface iface_export_record
interface importexport_iface_export_record
{
/**
* constructor
@ -41,7 +41,7 @@ interface iface_export_record
* @param object of interface egw_record _record
* @return bool
*/
public function export_record( iface_egw_record $_record );
public function export_record( importexport_iface_egw_record $_record );
/**
* Retruns total number of exported records.

View File

@ -24,7 +24,7 @@
* So this interface just garanties the interaction with userinterfaces. It
* has nothing to do with datatypes.
*/
interface iface_import_plugin {
interface importexport_iface_import_plugin {
/**
* imports entries according to given definition object.
@ -33,7 +33,7 @@ interface iface_import_plugin {
* @param definition $_definition
* @return int number of successful imports
*/
public function import( $_stream, definition $_definition );
public function import( $_stream, importexport_definition $_definition );
/**
* returns translated name of plugin

View File

@ -18,7 +18,7 @@
* An record is e.g. a single address or or single event.
* No mater where the records come from, at the end the get_entry method comes out
*/
interface iface_import_record
interface importexport_iface_import_record
{
/**
* Opens resource, returns false if something fails

View File

@ -11,9 +11,6 @@
* @version $Id$
*/
require_once('class.iface_import_record.inc.php');
require_once('class.import_export_helper_functions.inc.php');
/**
* class import_csv
* This a an abstract implementation of interface iface_import_record
@ -22,7 +19,7 @@ require_once('class.import_export_helper_functions.inc.php');
* @todo Throw away spechial chars and trim() entries ?
* @todo Check for XSS like userinput! (see common_functions)
*/
class import_csv implements iface_import_record { //, Iterator {
class importexport_import_csv implements importexport_iface_import_record { //, Iterator {
const csv_max_linelength = 8000;
@ -235,7 +232,7 @@ class import_csv implements iface_import_record { //, Iterator {
* @return bool
*/
protected function do_conversions( ) {
if ( $record = import_export_helper_functions::conversion( $this->record, $this->conversion )) {
if ( $record = importexport_helper_functions::conversion( $this->record, $this->conversion )) {
$this->record = $record;
return;
}

View File

@ -10,10 +10,6 @@
* @version $Id: class.importexport_import_ui.inc.php 27222 2009-06-08 16:21:14Z ralfbecker $
*/
require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.import_export_helper_functions.inc.php');
require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.bodefinitions.inc.php');
require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.definition.inc.php');
/**
* userinterface for imports
@ -26,7 +22,6 @@ require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.definition.inc.php');
public $public_functions = array(
'import_dialog' => true,
'download' => true,
);
/**
@ -38,7 +33,7 @@ require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.definition.inc.php');
public function __construct() {
$GLOBALS['egw']->js->validate_file('.','import_dialog','importexport');
$this->plugins = import_export_helper_functions::get_plugins('all','import');
$this->plugins = importexport_helper_functions::get_plugins('all','import');
$GLOBALS['egw_info']['flags']['include_xajax'] = true;
}
@ -51,7 +46,7 @@ require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.definition.inc.php');
if($content['import'] && $definition) {
try {
$definition_obj = new definition($content['definition']);
$definition_obj = new importexport_definition($content['definition']);
if($content['dry-run']) {
$definition_obj->plugin_options = $definition_obj->plugin_options + array('dry_run' => true);
}
@ -75,7 +70,10 @@ require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.definition.inc.php');
} catch (Exception $e) {
$this->message = $e->getMessage();
}
} elseif($content['cancel']) {
$GLOBALS['egw']->js->set_onload('window.close();');
}
$data['appname'] = $appname;
$data['definition'] = $definition;
$sel_options = self::get_select_options($data);
@ -92,7 +90,7 @@ require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.definition.inc.php');
public static function get_select_options(Array $data) {
$options = array();
(array)$apps = import_export_helper_functions::get_apps('import');
(array)$apps = importexport_helper_functions::get_apps('import');
$options['appname'] = array('' => lang('Select one')) + array_combine($apps,$apps);
if($data['appname']) {
@ -101,12 +99,12 @@ require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.definition.inc.php');
if($data['file'] && !is_array($data['file'])) {
$extension = substr($data['file'], -3);
}
$definitions = new bodefinitions(array(
$definitions = new importexport_definitions_bo(array(
'type' => 'import',
'application' => $data['appname']
));
foreach ((array)$definitions->get_definitions() as $identifier) {
$definition = new definition($identifier);
$definition = new importexport_definition($identifier);
if ($title = $definition->get_title()) {
$options['definition'][$title] = $title;
}

View File

@ -10,9 +10,6 @@
* @version $Id: class.importexport_import_ui.inc.php 27222 2009-06-08 16:21:14Z ralfbecker $
*/
require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.bodefinitions.inc.php');
require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.definition.inc.php');
/**
* userinterface for admins to schedule imports or exports using async services
@ -39,20 +36,23 @@ require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.definition.inc.php');
ExecMethod('phpgwapi.asyncservice.cancel_timer', $key);
}
$async_list = ExecMethod('phpgwapi.asyncservice.read', 'importexport%');
foreach($async_list as $id => $async) {
if(is_array($async['data']['errors'])) {
$async['data']['errors'] = implode("\n", $async['data']['errors']);
$data = array();
if(is_array($async_list)) {
foreach($async_list as $id => $async) {
if(is_array($async['data']['errors'])) {
$async['data']['errors'] = implode("\n", $async['data']['errors']);
}
if(is_numeric($async['data']['record_count'])) {
$async['data']['record_count'] = lang('%1 records processed', $async['data']['record_count']);
}
$data['scheduled'][] = $async['data'] + array(
'id' => $id,
'next' => $async['next'],
'times' => str_replace("\n", '', print_r($async['times'], true)),
);
}
if(is_numeric($async['data']['record_count'])) {
$async['data']['record_count'] = lang('%1 records processed', $async['data']['record_count']);
}
$data['scheduled'][] = $async['data'] + array(
'id' => $id,
'next' => $async['next'],
'times' => str_replace("\n", '', print_r($async['times'], true)),
);
array_unshift($data['scheduled'], false);
}
array_unshift($data['scheduled'], false);
$sel_options = self::get_select_options($data);
$this->template->read('importexport.schedule_index');
@ -128,20 +128,20 @@ require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.definition.inc.php');
)
);
(array)$apps = import_export_helper_functions::get_apps($data['type'] ? $data['type'] : 'all');
(array)$apps = importexport_helper_functions::get_apps($data['type'] ? $data['type'] : 'all');
if(count($apps)) {
$options['appname'] = array('' => lang('Select one')) + array_combine($apps,$apps);
}
if($data['appname']) {
$plugins = import_export_helper_functions::get_plugins($data['appname'], $data['type']);
$plugins = importexport_helper_functions::get_plugins($data['appname'], $data['type']);
if(is_array($plugins[$data['appname']][$data['type']])) {
foreach($plugins[$data['appname']][$data['type']] as $key => $title) {
$options['plugin'][$key] = $title;
}
}
} else {
$plugins = import_export_helper_functions::get_plugins('all', $data['type'] ? $data['type'] : 'all');
$plugins = importexport_helper_functions::get_plugins('all', $data['type'] ? $data['type'] : 'all');
if(is_array($plugins)) {
foreach($plugins as $appname => $_types) {
foreach($_types as $type => $plugins) {
@ -164,9 +164,9 @@ require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.definition.inc.php');
if($data['type']) $query['type'] = $data['type'];
if($data['application']) $query['application'] = $data['application'];
if($data['plugin']) $query['plugin'] = $data['plugin'];
$definitions = new bodefinitions($query);
$definitions = new importexport_definitions_bo($query);
foreach ((array)$definitions->get_definitions() as $identifier) {
$definition = new definition($identifier);
$definition = new importexport_definition($identifier);
if ($title = $definition->get_title()) {
$options['definition'][$title] = $title;
}
@ -186,7 +186,7 @@ require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.definition.inc.php');
'name' => $data['definition']
);
$definitions = new bodefinitions($query);
$definitions = new importexport_definitions_bo($query);
$definition_list = ((array)$definitions->get_definitions());
$id = 'importexport.'.$definition_list[0].'.'.$data['target'];
@ -255,14 +255,13 @@ require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.definition.inc.php');
exit();
}
$definition = new definition($data['definition']);
$definition = new importexport_definition($data['definition']);
if( $definition->get_identifier() < 1 ) {
fwrite(STDERR,'importexport_schedule: ' . date('c') . ": Definition not found! \n");
exit();
}
$GLOBALS['egw_info']['flags']['currentapp'] = $definition->application;
require_once(EGW_INCLUDE_ROOT . "/$definition->application/importexport/class.$definition->plugin.inc.php");
$po = new $definition->plugin;
$type = $data['type'];
@ -284,7 +283,7 @@ require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.definition.inc.php');
unset($data['errors']);
}
if($po instanceof iface_import_plugin) {
if($po instanceof importexport_iface_import_plugin) {
if(is_numeric($result)) {
$data['record_count'] = $result;
}

View File

@ -7,7 +7,7 @@
*
* For the mapping to work properly, you will have to fill $mapping_fields with the target fields for your application.
*
* NB: Your wizard class must be in <appname>/importexport/class.wizzard_<plugin_name>.inc.php
* NB: Your wizard class must be in <appname>/inc/class.appname_wizard_<plugin_name>.inc.php
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package importexport
@ -15,9 +15,7 @@
* @author Nathan Gray
*/
require_once(EGW_INCLUDE_ROOT.'/importexport/inc/class.basic_import_csv.inc.php');
class wizzard_basic_import_csv
class importexport_wizard_basic_import_csv
{
const TEMPLATE_MARKER = '-eTemplate-';
@ -31,10 +29,10 @@ class wizzard_basic_import_csv
* List of eTemplates to use for each step. You can override this with your own etemplates steps.
*/
protected $step_templates = array(
'wizzard_step30' => 'importexport.wizard_basic_import_csv.sample_file',
'wizzard_step40' => 'importexport.wizard_basic_import_csv.choosesepncharset',
'wizzard_step50' => 'importexport.wizard_basic_import_csv.fieldmapping',
'wizzard_step55' => 'importexport.wizard_basic_import_csv.conditions'
'wizard_step30' => 'importexport.wizard_basic_import_csv.sample_file',
'wizard_step40' => 'importexport.wizard_basic_import_csv.choosesepncharset',
'wizard_step50' => 'importexport.wizard_basic_import_csv.fieldmapping',
'wizard_step55' => 'importexport.wizard_basic_import_csv.conditions'
);
@ -60,21 +58,21 @@ class wizzard_basic_import_csv
function __construct()
{
$this->steps = array(
'wizzard_step30' => lang('Load Sample file'),
'wizzard_step40' => lang('Choose seperator and charset'),
'wizzard_step50' => lang('Manage mapping'),
'wizzard_step55' => lang('Edit conditions'),
'wizard_step30' => lang('Load Sample file'),
'wizard_step40' => lang('Choose seperator and charset'),
'wizard_step50' => lang('Manage mapping'),
'wizard_step55' => lang('Edit conditions'),
);
}
/**
* Take a sample CSV file. It will be processed in later steps
*/
function wizzard_step30(&$content, &$sel_options, &$readonlys, &$preserv)
function wizard_step30(&$content, &$sel_options, &$readonlys, &$preserv)
{
if($this->debug) error_log(get_class($this) . '::wizzard_step30->$content '.print_r($content,true));
if($this->debug) error_log(get_class($this) . '::wizard_step30->$content '.print_r($content,true));
// return from step30
if ($content['step'] == 'wizzard_step30')
if ($content['step'] == 'wizard_step30')
{
switch (array_search('pressed', $content['button']))
{
@ -86,20 +84,20 @@ class wizzard_basic_import_csv
$GLOBALS['egw']->session->appsession('csvfile','',$csvfile);
}
unset($content['file']);
return $GLOBALS['egw']->uidefinitions->get_step($content['step'],1);
return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'],1);
case 'previous' :
return $GLOBALS['egw']->uidefinitions->get_step($content['step'],-1);
return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'],-1);
case 'finish':
return 'wizzard_finish';
return 'wizard_finish';
default :
return $this->wizzard_step30($content,$sel_options,$readonlys,$preserv);
return $this->wizard_step30($content,$sel_options,$readonlys,$preserv);
}
}
// init step30
else
{
$content['msg'] = $this->steps['wizzard_step30'];
$content['step'] = 'wizzard_step30';
$content['msg'] = $this->steps['wizard_step30'];
$content['step'] = 'wizard_step30';
$preserv = $content;
unset ($preserv['button']);
$GLOBALS['egw']->js->set_onload("var btn = document.getElementById('exec[button][next]'); btn.attributes.removeNamedItem('onclick');");
@ -117,11 +115,11 @@ class wizzard_basic_import_csv
* @param array $preserv
* @return string template name
*/
function wizzard_step40(&$content, &$sel_options, &$readonlys, &$preserv)
function wizard_step40(&$content, &$sel_options, &$readonlys, &$preserv)
{
if($this->debug) error_log(get_class($this) . '::wizzard_step40->$content '.print_r($content,true));
if($this->debug) error_log(get_class($this) . '::wizard_step40->$content '.print_r($content,true));
// return from step40
if ($content['step'] == 'wizzard_step40') {
if ($content['step'] == 'wizard_step40') {
switch (array_search('pressed', $content['button']))
{
case 'next':
@ -132,20 +130,20 @@ class wizzard_basic_import_csv
} elseif($content['plugin_options']['csv_fields']) {
$content['csv_fields'] = $content['plugin_options']['csv_fields'];
}
return $GLOBALS['egw']->uidefinitions->get_step($content['step'],1);
return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'],1);
case 'previous' :
return $GLOBALS['egw']->uidefinitions->get_step($content['step'],-1);
return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'],-1);
case 'finish':
return 'wizzard_finish';
return 'wizard_finish';
default :
return $this->wizzard_step40($content,$sel_options,$readonlys,$preserv);
return $this->wizard_step40($content,$sel_options,$readonlys,$preserv);
}
}
// init step40
else
{
$content['msg'] = $this->steps['wizzard_step40'];
$content['step'] = 'wizzard_step40';
$content['msg'] = $this->steps['wizard_step40'];
$content['step'] = 'wizard_step40';
// If editing an existing definition, these will be in plugin_options
if(!$content['fieldsep'] && $content['plugin_options']['fieldsep']) {
@ -178,11 +176,11 @@ class wizzard_basic_import_csv
*
* You can use the eTemplate
*/
function wizzard_step50(&$content, &$sel_options, &$readonlys, &$preserv)
function wizard_step50(&$content, &$sel_options, &$readonlys, &$preserv)
{
if($this->debug) error_log(get_class($this) . '::wizzard_step50->$content '.print_r($content,true));
if($this->debug) error_log(get_class($this) . '::wizard_step50->$content '.print_r($content,true));
// return from step50
if ($content['step'] == 'wizzard_step50')
if ($content['step'] == 'wizard_step50')
{
array_shift($content['csv_fields']);
array_shift($content['field_mapping']);
@ -195,20 +193,20 @@ class wizzard_basic_import_csv
switch (array_search('pressed', $content['button']))
{
case 'next':
return $GLOBALS['egw']->uidefinitions->get_step($content['step'],1);
return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'],1);
case 'previous' :
return $GLOBALS['egw']->uidefinitions->get_step($content['step'],-1);
return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'],-1);
case 'finish':
return 'wizzard_finish';
return 'wizard_finish';
default :
return $this->wizzard_step50($content,$sel_options,$readonlys,$preserv);
return $this->wizard_step50($content,$sel_options,$readonlys,$preserv);
}
}
// init step50
else
{
$content['msg'] = $this->steps['wizzard_step50'];
$content['step'] = 'wizzard_step50';
$content['msg'] = $this->steps['wizard_step50'];
$content['step'] = 'wizard_step50';
if(!$content['field_mapping'] && $content['plugin_options']) {
$content['field_mapping'] = $content['plugin_options']['field_mapping'];
@ -240,11 +238,11 @@ class wizzard_basic_import_csv
/**
* Edit conditions
*/
function wizzard_step55(&$content, &$sel_options, &$readonlys, &$preserv)
function wizard_step55(&$content, &$sel_options, &$readonlys, &$preserv)
{
if($this->debug) error_log(get_class($this) . '::wizzard_step55->$content '.print_r($content,true));
if($this->debug) error_log(get_class($this) . '::wizard_step55->$content '.print_r($content,true));
// return from step55
if ($content['step'] == 'wizzard_step55')
if ($content['step'] == 'wizard_step55')
{
array_shift($content['conditions']);
@ -259,21 +257,21 @@ class wizzard_basic_import_csv
switch (array_search('pressed', $content['button']))
{
case 'next':
return $GLOBALS['egw']->uidefinitions->get_step($content['step'],1);
return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'],1);
case 'previous' :
return $GLOBALS['egw']->uidefinitions->get_step($content['step'],-1);
return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'],-1);
case 'finish':
return 'wizzard_finish';
return 'wizard_finish';
case 'add':
return $GLOBALS['egw']->uidefinitions->get_step($content['step'],0);
return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'],0);
default :
return $this->wizzard_step55($content,$sel_options,$readonlys,$preserv);
return $this->wizard_step55($content,$sel_options,$readonlys,$preserv);
break;
}
}
// init step55
$content['msg'] = $this->steps['wizzard_step55'];
$content['step'] = 'wizzard_step55';
$content['msg'] = $this->steps['wizard_step55'];
$content['step'] = 'wizard_step55';
if(!$content['conditions'] && $content['plugin_options']['conditions']) {
$content['conditions'] = $content['plugin_options']['conditions'];
@ -282,8 +280,8 @@ class wizzard_basic_import_csv
foreach($content['field_mapping'] as $field) {
$sel_options['string'][$field] = $this->mapping_fields[$field];
}
$sel_options['type'] = array_combine($this->conditions, $this->conditions);
$sel_options['action'] = array_combine($this->actions, $this->actions);
$sel_options['type'] = $this->conditions;
$sel_options['action'] = $this->actions;
// Make 3 empty conditions
$j = 1;

View File

@ -13,17 +13,23 @@ function export_dialog() {
this.change_definition = function(sel_obj) {
if(sel_obj.value == 'expert') {
xajax_doXMLHTTP('importexport.uiexport.ajax_get_plugins',document.getElementById('exec[appname]') ? document.getElementById('exec[appname]').value : this.appname);
xajax_doXMLHTTP('importexport.importexport_export_ui.ajax_get_plugins',document.getElementById('exec[appname]') ? document.getElementById('exec[appname]').value : this.appname);
// next two lines fix some strange layout bug
//set_style_by_class('tr','select_definition','display','none');
//set_style_by_class('tr','select_definition','display','inline');
set_style_by_class('tr','select_plugin','display','table-row');
set_style_by_class('tr','save_definition','display','inline');
document.getElementById('importexport.export_dialog.selection_tab-tab').style.visibility='visible';
document.getElementById('importexport.export_dialog.options_tab-tab').style.visibility='visible';
}
else {
xajax_doXMLHTTP('importexport.uiexport.ajax_get_definition_description',sel_obj.value);
xajax_doXMLHTTP('importexport.importexport_export_ui.ajax_get_definition_description',sel_obj.value);
set_style_by_class('tr','select_plugin','display','none');
set_style_by_class('tr','save_definition','display','none');
document.getElementById('importexport.export_dialog.selection_tab-tab').style.visibility='hidden';
document.getElementById('importexport.export_dialog.options_tab-tab').style.visibility='hidden';
enable_button('exec[export]');
enable_button('exec[preview]');
}
};
this.appname = '';

View File

@ -2,7 +2,7 @@
/**
* eGroupWare - eTemplates for Application importexport
* http://www.egroupware.org
* generated by soetemplate::dump4setup() 2010-03-10 09:01
* generated by soetemplate::dump4setup() 2010-03-11 10:40
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package importexport
@ -12,7 +12,7 @@
$templ_version=1;
$templ_data[] = array('name' => 'importexport.definition_index','template' => '','lang' => '','group' => '0','version' => '0.0.1','data' => 'a:1:{i:0;a:5:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:1:{s:2:"h1";s:6:",!@msg";}i:1;a:1:{s:1:"A";a:4:{s:4:"span";s:13:"all,redItalic";s:7:"no_lang";s:1:"1";s:4:"name";s:3:"msg";s:4:"type";s:5:"label";}}i:2;a:1:{s:1:"A";a:4:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:2:{s:2:"c1";s:2:"th";s:2:"c2";s:7:"row,top";}i:1;a:6:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:5:"label";s:4:"Type";s:4:"span";s:11:",lr_padding";}s:1:"B";a:3:{s:4:"type";s:5:"label";s:5:"label";s:4:"Name";s:4:"span";s:11:",lr_padding";}s:1:"C";a:3:{s:4:"type";s:5:"label";s:5:"label";s:11:"Application";s:4:"span";s:11:",lr_padding";}s:1:"D";a:4:{s:5:"align";s:6:"center";s:4:"type";s:5:"label";s:5:"label";s:13:"Allowed users";s:4:"span";s:11:",lr_padding";}s:1:"E";a:5:{s:5:"label";s:3:"Add";s:5:"align";s:6:"center";s:4:"type";s:6:"button";s:4:"span";s:11:",lr_padding";s:7:"onclick";s:213:"window.open(egw::link(\'/index.php\',\'menuaction=importexport.uidefinitions.wizzard\'),\'\',\'dependent=yes,width=500,height=500,location=no,menubar=no,toolbar=no,scrollbars=yes,status=yes\'); return false; return false;";}s:1:"F";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:6:{s:5:"label";s:6:"Delete";s:4:"name";s:15:"delete_selected";s:4:"type";s:6:"button";s:4:"help";s:31:"delete ALL selected definitions";s:4:"size";s:6:"delete";s:7:"onclick";s:65:"return confirm(\'Do you really want to DELETE this definitions?\');";}i:2;a:5:{s:5:"label";s:6:"Export";s:4:"name";s:15:"export_selected";s:4:"type";s:6:"button";s:4:"help";s:31:"export ALL selected definitions";s:4:"size";s:10:"fileexport";}}}i:2;a:6:{s:1:"A";a:4:{s:7:"no_lang";s:1:"1";s:4:"type";s:5:"image";s:4:"span";s:11:",lr_padding";s:4:"name";s:12:"${row}[type]";}s:1:"B";a:4:{s:7:"no_lang";s:1:"1";s:4:"name";s:12:"${row}[name]";s:4:"type";s:5:"label";s:4:"span";s:11:",lr_padding";}s:1:"C";a:4:{s:7:"no_lang";s:1:"1";s:4:"name";s:19:"${row}[application]";s:4:"type";s:5:"label";s:4:"span";s:11:",lr_padding";}s:1:"D";a:6:{s:7:"no_lang";s:1:"1";s:4:"type";s:14:"select-account";s:4:"span";s:11:",lr_padding";s:8:"readonly";s:1:"1";s:4:"name";s:21:"${row}[allowed_users]";s:4:"size";s:6:"5,both";}s:1:"E";a:5:{s:5:"align";s:6:"center";s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:4:{s:5:"label";s:4:"Edit";s:4:"type";s:6:"button";s:4:"size";s:4:"edit";s:7:"onclick";s:237:"window.open(egw::link(\'/index.php\',\'menuaction=importexport.uidefinitions.edit&definition=$row_cont[name]\'),\'\',\'dependent=yes,width=500,height=500,location=no,menubar=no,toolbar=no,scrollbars=yes,status=yes\'); return false; return false;";}i:2;a:6:{s:5:"label";s:6:"Delete";s:7:"onclick";s:41:"return confirm(\'Delete this definition\');";s:4:"name";s:32:"delete[$row_cont[definition_id]]";s:4:"type";s:6:"button";s:4:"size";s:6:"delete";s:4:"help";s:21:"Delete this eTemplate";}}s:1:"F";a:4:{s:5:"align";s:6:"center";s:4:"name";s:34:"selected[$row_cont[definition_id]]";s:4:"type";s:8:"checkbox";s:4:"help";s:34:"select this eTemplate to delete it";}}}s:4:"cols";i:6;s:4:"rows";i:2;}}}s:4:"cols";i:1;s:4:"rows";i:2;s:4:"size";s:4:"100%";}}','size' => '100%','style' => '.redItalic { color:red; font-style:italic;} td.lr_padding { padding-left: 5px; padding-right: 5px; }','modified' => '1145972373',);
$templ_data[] = array('name' => 'importexport.definition_index','template' => '','lang' => '','group' => '0','version' => '0.0.1','data' => 'a:1:{i:0;a:5:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:1:{s:2:"h1";s:6:",!@msg";}i:1;a:1:{s:1:"A";a:4:{s:4:"span";s:13:"all,redItalic";s:7:"no_lang";s:1:"1";s:4:"name";s:3:"msg";s:4:"type";s:5:"label";}}i:2;a:1:{s:1:"A";a:4:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:2:{s:2:"c1";s:2:"th";s:2:"c2";s:7:"row,top";}i:1;a:6:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:5:"label";s:4:"Type";s:4:"span";s:11:",lr_padding";}s:1:"B";a:3:{s:4:"type";s:5:"label";s:5:"label";s:4:"Name";s:4:"span";s:11:",lr_padding";}s:1:"C";a:3:{s:4:"type";s:5:"label";s:5:"label";s:11:"Application";s:4:"span";s:11:",lr_padding";}s:1:"D";a:4:{s:5:"align";s:6:"center";s:4:"type";s:5:"label";s:5:"label";s:13:"Allowed users";s:4:"span";s:11:",lr_padding";}s:1:"E";a:5:{s:5:"label";s:3:"Add";s:5:"align";s:6:"center";s:4:"type";s:6:"button";s:4:"span";s:11:",lr_padding";s:7:"onclick";s:226:"window.open(egw::link(\'/index.php\',\'menuaction=importexport.importexport_definitions_ui.wizard\'),\'\',\'dependent=yes,width=500,height=500,location=no,menubar=no,toolbar=no,scrollbars=yes,status=yes\'); return false; return false;";}s:1:"F";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:6:{s:5:"label";s:6:"Delete";s:4:"name";s:15:"delete_selected";s:4:"type";s:6:"button";s:4:"help";s:31:"delete ALL selected definitions";s:4:"size";s:6:"delete";s:7:"onclick";s:65:"return confirm(\'Do you really want to DELETE this definitions?\');";}i:2;a:5:{s:5:"label";s:6:"Export";s:4:"name";s:15:"export_selected";s:4:"type";s:6:"button";s:4:"help";s:31:"export ALL selected definitions";s:4:"size";s:10:"fileexport";}}}i:2;a:6:{s:1:"A";a:4:{s:7:"no_lang";s:1:"1";s:4:"type";s:5:"image";s:4:"span";s:11:",lr_padding";s:4:"name";s:12:"${row}[type]";}s:1:"B";a:4:{s:7:"no_lang";s:1:"1";s:4:"name";s:12:"${row}[name]";s:4:"type";s:5:"label";s:4:"span";s:11:",lr_padding";}s:1:"C";a:4:{s:7:"no_lang";s:1:"1";s:4:"name";s:19:"${row}[application]";s:4:"type";s:5:"label";s:4:"span";s:11:",lr_padding";}s:1:"D";a:6:{s:7:"no_lang";s:1:"1";s:4:"type";s:14:"select-account";s:4:"span";s:11:",lr_padding";s:8:"readonly";s:1:"1";s:4:"name";s:21:"${row}[allowed_users]";s:4:"size";s:6:"5,both";}s:1:"E";a:5:{s:5:"align";s:6:"center";s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:4:{s:5:"label";s:4:"Edit";s:4:"type";s:6:"button";s:4:"size";s:4:"edit";s:7:"onclick";s:251:"window.open(egw::link(\'/index.php\',\'menuaction=importexport.importexport_definitions_ui.edit&definition=$row_cont[name]\'),\'\',\'dependent=yes,width=500,height=500,location=no,menubar=no,toolbar=no,scrollbars=yes,status=yes\'); return false; return false;";}i:2;a:6:{s:5:"label";s:6:"Delete";s:7:"onclick";s:41:"return confirm(\'Delete this definition\');";s:4:"name";s:32:"delete[$row_cont[definition_id]]";s:4:"type";s:6:"button";s:4:"size";s:6:"delete";s:4:"help";s:21:"Delete this eTemplate";}}s:1:"F";a:4:{s:5:"align";s:6:"center";s:4:"name";s:34:"selected[$row_cont[definition_id]]";s:4:"type";s:8:"checkbox";s:4:"help";s:34:"select this eTemplate to delete it";}}}s:4:"cols";i:6;s:4:"rows";i:2;}}}s:4:"cols";i:1;s:4:"rows";i:2;s:4:"size";s:4:"100%";}}','size' => '100%','style' => '.redItalic { color:red; font-style:italic;} td.lr_padding { padding-left: 5px; padding-right: 5px; }','modified' => '1145972373',);
$templ_data[] = array('name' => 'importexport.export_dialog','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:7:{i:0;a:1:{s:2:"c3";s:15:"save_definition";}i:1;a:1:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:4:"name";s:3:"msg";}}i:2;a:1:{s:1:"A";a:3:{s:4:"type";s:3:"tab";s:5:"label";s:25:"General|Selection|Options";s:4:"name";s:37:"general_tab|selection_tab|options_tab";}}i:3;a:1:{s:1:"A";a:3:{s:4:"type";s:8:"checkbox";s:5:"label";s:18:"Save as definition";s:4:"name";s:18:"save_as_definition";}}i:4;a:1:{s:1:"A";a:5:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";s:4:"span";s:3:"all";i:1;a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:4:{s:4:"type";s:6:"button";s:5:"label";s:6:"Export";s:4:"name";s:6:"export";s:7:"onclick";s:36:"xajax_eT_wrapper(this);return false;";}i:2;a:4:{s:4:"type";s:6:"button";s:5:"label";s:7:"Preview";s:4:"name";s:7:"preview";s:7:"onclick";s:36:"xajax_eT_wrapper(this);return false;";}}i:2;a:5:{s:4:"type";s:6:"button";s:5:"label";s:6:"Cancel";s:5:"align";s:5:"right";s:4:"name";s:6:"cancel";s:7:"onclick";s:29:"window.close(); return false;";}}}i:5;a:1:{s:1:"A";a:6:{s:4:"type";s:3:"box";s:4:"size";s:1:"1";s:4:"name";s:11:"preview-box";s:6:"needed";s:1:"1";i:1;a:1:{s:4:"type";s:5:"label";}s:4:"span";s:12:",preview-box";}}i:6;a:1:{s:1:"A";a:7:{s:4:"type";s:3:"box";s:4:"size";s:1:"1";s:4:"span";s:20:",preview-box-buttons";s:4:"name";s:19:"preview-box-buttons";i:1;a:4:{s:4:"type";s:6:"button";s:5:"label";s:2:"OK";s:5:"align";s:6:"center";s:7:"onclick";s:167:"document.getElementById(form::name(\'preview-box\')).style.display=\'none\'; document.getElementById(form::name(\'preview-box-buttons\')).style.display=\'none\'; return false;";}s:6:"needed";s:1:"1";s:5:"align";s:6:"center";}}}s:4:"rows";i:6;s:4:"cols";i:1;s:4:"size";s:4:"100%";s:7:"options";a:1:{i:0;s:4:"100%";}}}','size' => '100%','style' => '.preview-box {
position: absolute;
@ -38,7 +38,7 @@ $templ_data[] = array('name' => 'importexport.export_dialog','template' => '','l
$templ_data[] = array('name' => 'importexport.export_dialog.general_tab','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:2:{i:0;a:1:{s:2:"c1";s:4:",top";}i:1;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"image";s:4:"name";s:6:"export";}s:1:"B";a:2:{s:4:"type";s:8:"template";s:4:"name";s:46:"importexport.export_dialog.general_tab_content";}}}s:4:"rows";i:1;s:4:"cols";i:2;s:4:"size";s:6:",200px";s:7:"options";a:1:{i:1;s:5:"200px";}}}','size' => ',200px','style' => '','modified' => '1158223670',);
$templ_data[] = array('name' => 'importexport.export_dialog.general_tab_content','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:6:{i:0;a:3:{s:2:"c2";s:14:"select_appname";s:2:"c3";s:17:"select_definition";s:2:"c4";s:13:"select_plugin";}i:1;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"span";s:3:"all";s:5:"label";s:14:"some nice text";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:2;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:18:"Select application";}s:1:"B";a:4:{s:4:"type";s:6:"select";s:7:"no_lang";s:1:"1";s:4:"name";s:7:"appname";s:8:"onchange";s:73:"xajax_doXMLHTTP(\'importexport.uiexport.ajax_get_definitions\',this.value);";}}i:3;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:17:"Select definition";}s:1:"B";a:4:{s:4:"type";s:6:"select";s:7:"no_lang";s:1:"1";s:4:"name";s:10:"definition";s:8:"onchange";s:52:"export_dialog.change_definition(this); return false;";}}i:4;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:13:"Select plugin";}s:1:"B";a:4:{s:4:"type";s:6:"select";s:8:"onchange";s:80:"xajax_doXMLHTTP(\'importexport.uiexport.ajax_get_definition_options\',this.value);";s:7:"no_lang";s:1:"1";s:4:"name";s:6:"plugin";}}i:5;a:2:{s:1:"A";a:6:{s:4:"type";s:3:"box";s:4:"span";s:3:"all";s:4:"name";s:18:"plugin_description";s:6:"needed";s:1:"1";s:4:"size";s:1:"1";i:1;a:7:{s:4:"type";s:5:"label";s:4:"span";s:3:"all";s:6:"needed";s:1:"1";i:1;a:4:{s:4:"type";s:5:"label";s:4:"span";s:3:"all";s:6:"needed";s:1:"1";s:5:"label";s:11:"Description";}i:2;a:2:{s:4:"type";s:5:"label";s:4:"name";s:18:"plugin_description";}s:4:"name";s:11:"description";s:7:"no_lang";s:1:"1";}}s:1:"B";a:1:{s:4:"type";s:5:"label";}}}s:4:"rows";i:5;s:4:"cols";i:2;}}','size' => '','style' => '','modified' => '1158223021',);
$templ_data[] = array('name' => 'importexport.export_dialog.general_tab_content','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:6:{i:0;a:3:{s:2:"c2";s:14:"select_appname";s:2:"c3";s:17:"select_definition";s:2:"c4";s:13:"select_plugin";}i:1;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"span";s:3:"all";s:5:"label";s:14:"some nice text";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:2;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:18:"Select application";}s:1:"B";a:4:{s:4:"type";s:6:"select";s:7:"no_lang";s:1:"1";s:4:"name";s:7:"appname";s:8:"onchange";s:87:"xajax_doXMLHTTP(\'importexport.importexport_export_ui.ajax_get_definitions\',this.value);";}}i:3;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:17:"Select definition";}s:1:"B";a:4:{s:4:"type";s:6:"select";s:7:"no_lang";s:1:"1";s:4:"name";s:10:"definition";s:8:"onchange";s:52:"export_dialog.change_definition(this); return false;";}}i:4;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:13:"Select plugin";}s:1:"B";a:4:{s:4:"type";s:6:"select";s:8:"onchange";s:94:"xajax_doXMLHTTP(\'importexport.importexport_export_ui.ajax_get_definition_options\',this.value);";s:7:"no_lang";s:1:"1";s:4:"name";s:6:"plugin";}}i:5;a:2:{s:1:"A";a:6:{s:4:"type";s:3:"box";s:4:"span";s:3:"all";s:4:"name";s:18:"plugin_description";s:6:"needed";s:1:"1";s:4:"size";s:1:"1";i:1;a:7:{s:4:"type";s:5:"label";s:4:"span";s:3:"all";s:6:"needed";s:1:"1";i:1;a:4:{s:4:"type";s:5:"label";s:4:"span";s:3:"all";s:6:"needed";s:1:"1";s:5:"label";s:11:"Description";}i:2;a:2:{s:4:"type";s:5:"label";s:4:"name";s:18:"plugin_description";}s:4:"name";s:11:"description";s:7:"no_lang";s:1:"1";}}s:1:"B";a:1:{s:4:"type";s:5:"label";}}}s:4:"rows";i:5;s:4:"cols";i:2;}}','size' => '','style' => '','modified' => '1158223021',);
$templ_data[] = array('name' => 'importexport.export_dialog.options_tab','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:2:{i:0;a:1:{s:2:"c1";s:4:",top";}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:4:"html";s:4:"name";s:19:"plugin_options_html";s:7:"no_lang";s:1:"1";}}}s:4:"rows";i:1;s:4:"cols";i:1;s:4:"size";s:6:",200px";s:7:"options";a:1:{i:1;s:5:"200px";}}}','size' => ',200px','style' => '','modified' => '1158223824',);
@ -46,12 +46,19 @@ $templ_data[] = array('name' => 'importexport.export_dialog.selection_tab','temp
$templ_data[] = array('name' => 'importexport.import_definition','template' => '','lang' => '','group' => '0','version' => '0.0.1','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:4:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:92:"Import definitions (Attension: Existing definitions with equal names will be overwritten!!!)";}}i:2;a:1:{s:1:"A";a:2:{s:4:"type";s:4:"file";s:4:"name";s:11:"import_file";}}i:3;a:1:{s:1:"A";a:3:{s:4:"type";s:6:"button";s:5:"label";s:6:"Import";s:4:"name";s:6:"import";}}}s:4:"rows";i:3;s:4:"cols";i:1;}}','size' => '','style' => '','modified' => '1150533844',);
$templ_data[] = array('name' => 'importexport.import_dialog','template' => '','lang' => '','group' => '0','version' => '0.1','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:7:{i:0;a:1:{s:2:"h1";s:10:",!@message";}i:1;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"span";s:11:"all,message";s:4:"name";s:7:"message";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:2;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:11:"Application";}s:1:"B";a:3:{s:4:"type";s:6:"select";s:4:"name";s:7:"appname";s:8:"onchange";s:87:"xajax_doXMLHTTP(\'importexport.importexport_import_ui.ajax_get_definitions\',this.value);";}}i:3;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:28:"Please select file to import";}s:1:"B";a:3:{s:4:"type";s:4:"file";s:4:"name";s:4:"file";s:8:"onchange";s:142:"xajax_doXMLHTTP(\'importexport.importexport_import_ui.ajax_get_definitions\', document.getElementById(form::name(\'appname\')).value, this.value);";}}i:4;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:17:"Import definition";}s:1:"B";a:2:{s:4:"type";s:6:"select";s:4:"name";s:10:"definition";}}i:5;a:2:{s:1:"A";a:1:{s:4:"type";s:5:"label";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:6;a:2:{s:1:"A";a:6:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"3";s:4:"span";s:3:"all";i:1;a:3:{s:4:"type";s:6:"button";s:5:"label";s:6:"Import";s:4:"name";s:6:"import";}i:2;a:3:{s:4:"type";s:6:"button";s:4:"name";s:6:"cancel";s:5:"label";s:6:"Cancel";}i:3;a:4:{s:4:"type";s:8:"checkbox";s:4:"name";s:7:"dry-run";s:5:"label";s:9:"Test only";s:5:"align";s:5:"right";}}s:1:"B";a:1:{s:4:"type";s:5:"label";}}}s:4:"rows";i:6;s:4:"cols";i:2;}}','size' => '','style' => '','modified' => '1266439013',);
$templ_data[] = array('name' => 'importexport.import_dialog','template' => '','lang' => '','group' => '0','version' => '0.1','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:7:{i:0;a:1:{s:2:"h1";s:10:",!@message";}i:1;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"span";s:11:"all,message";s:4:"name";s:7:"message";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:2;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:11:"Application";}s:1:"B";a:3:{s:4:"type";s:6:"select";s:4:"name";s:7:"appname";s:8:"onchange";s:87:"xajax_doXMLHTTP(\'importexport.importexport_import_ui.ajax_get_definitions\',this.value);";}}i:3;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:17:"Import definition";}s:1:"B";a:2:{s:4:"type";s:6:"select";s:4:"name";s:10:"definition";}}i:4;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:28:"Please select file to import";}s:1:"B";a:2:{s:4:"type";s:4:"file";s:4:"name";s:4:"file";}}i:5;a:2:{s:1:"A";a:1:{s:4:"type";s:5:"label";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:6;a:2:{s:1:"A";a:6:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"3";s:4:"span";s:3:"all";i:1;a:3:{s:4:"type";s:6:"button";s:5:"label";s:6:"Import";s:4:"name";s:6:"import";}i:2;a:3:{s:4:"type";s:6:"button";s:4:"name";s:6:"cancel";s:5:"label";s:6:"Cancel";}i:3;a:4:{s:4:"type";s:8:"checkbox";s:4:"name";s:7:"dry-run";s:5:"label";s:9:"Test only";s:5:"align";s:5:"right";}}s:1:"B";a:1:{s:4:"type";s:5:"label";}}}s:4:"rows";i:6;s:4:"cols";i:2;}}','size' => '','style' => '','modified' => '1266439013',);
$templ_data[] = array('name' => 'importexport.schedule_edit','template' => '','lang' => '','group' => '0','version' => '1.7.001','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:9:{i:0;a:1:{s:2:"h1";s:10:",!@message";}i:1;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"span";s:11:"all,message";s:4:"name";s:7:"message";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:2;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:4:"Type";}s:1:"B";a:2:{s:4:"type";s:6:"select";s:4:"name";s:4:"type";}}i:3;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:11:"Application";}s:1:"B";a:3:{s:4:"type";s:6:"select";s:4:"name";s:7:"appname";s:8:"onchange";s:137:"xajax_doXMLHTTP(\'importexport.importexport_schedule_ui.ajax_get_plugins\', document.getElementById(form::name(\'type\')).value, this.value);";}}i:4;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:6:"Plugin";}s:1:"B";a:4:{s:4:"type";s:6:"select";s:4:"name";s:6:"plugin";s:4:"size";s:9:"Select...";s:8:"onchange";s:144:"xajax_doXMLHTTP(\'importexport.importexport_schedule_ui.ajax_get_definitions\', document.getElementById(form::name(\'appname\')).value, this.value);";}}i:5;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:10:"Definition";}s:1:"B";a:3:{s:4:"type";s:6:"select";s:4:"name";s:10:"definition";s:4:"size";s:9:"Select...";}}i:6;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:6:"Target";}s:1:"B";a:3:{s:4:"type";s:4:"text";s:4:"size";s:2:"50";s:4:"name";s:6:"target";}}i:7;a:2:{s:1:"A";a:7:{s:4:"type";s:4:"grid";s:4:"data";a:4:{i:0;a:1:{s:2:"c1";s:2:"th";}i:1;a:6:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:4:"Year";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:5:"Month";}s:1:"C";a:2:{s:4:"type";s:5:"label";s:5:"label";s:3:"Day";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:11:"Day of week";}s:1:"E";a:2:{s:4:"type";s:5:"label";s:5:"label";s:4:"Hour";}s:1:"F";a:2:{s:4:"type";s:5:"label";s:5:"label";s:6:"Minute";}}i:2;a:6:{s:1:"A";a:3:{s:4:"type";s:4:"text";s:4:"name";s:4:"year";s:4:"size";s:1:"5";}s:1:"B";a:3:{s:4:"type";s:4:"text";s:4:"name";s:5:"month";s:4:"size";s:1:"5";}s:1:"C";a:3:{s:4:"type";s:4:"text";s:4:"name";s:3:"day";s:4:"size";s:1:"5";}s:1:"D";a:4:{s:4:"type";s:4:"text";s:4:"name";s:3:"dow";s:5:"align";s:6:"center";s:4:"size";s:1:"5";}s:1:"E";a:3:{s:4:"type";s:4:"text";s:4:"name";s:4:"hour";s:4:"size";s:1:"5";}s:1:"F";a:3:{s:4:"type";s:4:"text";s:4:"name";s:3:"min";s:4:"size";s:1:"5";}}i:3;a:6:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"span";s:1:"3";s:5:"label";s:11:"(* for all)";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:12:"(0-6, 0=Sun)";}s:1:"E";a:2:{s:4:"type";s:5:"label";s:5:"label";s:6:"(0-23)";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}}s:4:"rows";i:3;s:4:"cols";i:6;s:4:"name";s:8:"schedule";s:4:"span";s:3:"all";s:7:"options";a:0:{}}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:8;a:2:{s:1:"A";a:5:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";s:4:"span";s:3:"all";i:1;a:3:{s:4:"type";s:6:"button";s:5:"label";s:4:"Save";s:4:"name";s:4:"save";}i:2;a:4:{s:4:"type";s:6:"button";s:4:"name";s:6:"cancel";s:5:"label";s:6:"Cancel";s:7:"onclick";s:13:"self.close();";}}s:1:"B";a:1:{s:4:"type";s:5:"label";}}}s:4:"rows";i:8;s:4:"cols";i:2;}}','size' => '','style' => '','modified' => '1267036378',);
$templ_data[] = array('name' => 'importexport.schedule_index','template' => '','lang' => '','group' => '0','version' => '1.7.001','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:4:{i:0;a:1:{s:2:"h1";s:6:",!@msg";}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"span";s:11:"all,message";s:4:"name";s:4:"@msg";}}i:2;a:1:{s:1:"A";a:6:{s:4:"type";s:4:"grid";s:4:"name";s:9:"scheduled";s:7:"options";a:0:{}s:4:"data";a:3:{i:0;a:2:{s:2:"c1";s:2:"th";s:2:"c2";s:4:",top";}i:1;a:8:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:4:"Type";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:11:"Application";}s:1:"C";a:2:{s:4:"type";s:5:"label";s:5:"label";s:6:"Plugin";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:10:"Definition";}s:1:"E";a:2:{s:4:"type";s:5:"label";s:5:"label";s:6:"Target";}s:1:"F";a:2:{s:4:"type";s:5:"label";s:5:"label";s:8:"Last Run";}s:1:"G";a:4:{s:4:"type";s:4:"vbox";s:4:"size";s:6:"2,,0,0";i:1;a:2:{s:4:"type";s:5:"label";s:5:"label";s:8:"Next Run";}i:2;a:2:{s:4:"type";s:5:"label";s:5:"label";s:8:"Schedule";}}s:1:"H";a:1:{s:4:"type";s:5:"label";}}i:2;a:8:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:4:"name";s:12:"${row}[type]";}s:1:"B";a:3:{s:4:"type";s:10:"select-app";s:4:"name";s:15:"${row}[appname]";s:8:"readonly";s:1:"1";}s:1:"C";a:4:{s:4:"type";s:6:"select";s:7:"no_lang";s:1:"1";s:4:"name";s:14:"${row}[plugin]";s:8:"readonly";s:1:"1";}s:1:"D";a:3:{s:4:"type";s:6:"select";s:4:"name";s:18:"${row}[definition]";s:8:"readonly";s:1:"1";}s:1:"E";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:14:"${row}[target]";}s:1:"F";a:6:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"4";i:1;a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:16:"${row}[last_run]";s:8:"readonly";s:1:"1";}i:2;a:3:{s:4:"type";s:5:"label";s:4:"name";s:20:"${row}[record_count]";s:7:"no_lang";s:1:"1";}i:3;a:3:{s:4:"type";s:5:"label";s:4:"name";s:14:"${row}[result]";s:7:"no_lang";s:1:"1";}i:4;a:2:{s:4:"type";s:5:"label";s:4:"name";s:14:"${row}[errors]";}}s:1:"G";a:4:{s:4:"type";s:4:"vbox";s:4:"size";s:6:"2,,0,0";i:1;a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:12:"${row}[next]";s:8:"readonly";s:1:"1";}i:2;a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:13:"${row}[times]";}}s:1:"H";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:6:"2,,0,0";i:1;a:4:{s:4:"type";s:6:"button";s:4:"size";s:4:"edit";s:4:"name";s:21:"edit[${row_cont[id]}]";s:7:"onclick";s:198:"window.open(egw::link(\'/index.php\',\'menuaction=importexport.importexport_schedule_ui.edit&id={$row_cont[id]}\'),\'_blank\',\'dependent=yes,width=600,height=450,scrollbars=yes,status=yes\'); return false;";}i:2;a:3:{s:4:"type";s:6:"button";s:4:"size";s:6:"delete";s:4:"name";s:23:"delete[{$row_cont[id]}]";}}}}s:4:"rows";i:2;s:4:"cols";i:8;}}i:3;a:1:{s:1:"A";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"1";s:4:"span";s:3:"all";i:1;a:4:{s:4:"type";s:6:"button";s:5:"label";s:3:"add";s:4:"name";s:3:"add";s:7:"onclick";s:179:"window.open(egw::link(\'/index.php\',\'menuaction=importexport.importexport_schedule_ui.edit\'),\'_blank\',\'dependent=yes,width=600,height=450,scrollbars=yes,status=yes\'); return false;";}}}}s:4:"rows";i:3;s:4:"cols";i:1;}}','size' => '','style' => '','modified' => '1267034207',);
$templ_data[] = array('name' => 'importexport.wizardbox','template' => '','lang' => '','group' => '0','version' => '0.0.1','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:3:{s:2:"c2";s:7:",bottom";s:2:"c1";s:4:",top";s:1:"A";s:4:"100%";}i:1;a:1:{s:1:"A";a:5:{s:4:"type";s:4:"hbox";s:7:"no_lang";s:1:"1";s:4:"size";s:1:"2";i:1;a:4:{s:4:"type";s:4:"hbox";s:7:"no_lang";s:1:"1";s:4:"size";s:1:"1";i:1;a:3:{s:4:"type";s:5:"image";s:7:"no_lang";s:1:"1";s:4:"name";s:12:"importexport";}}i:2;a:4:{s:4:"type";s:8:"groupbox";s:4:"size";s:1:"1";i:1;a:2:{s:4:"type";s:8:"template";s:4:"name";s:14:"wizard_content";}s:4:"span";s:15:",wizard_content";}}}i:2;a:1:{s:1:"A";a:6:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";s:4:"span";s:3:"all";i:1;a:5:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"3";i:1;a:4:{s:4:"type";s:6:"button";s:4:"name";s:16:"button[previous]";s:5:"label";s:8:"previous";s:7:"onclick";s:37:"xajax_eT_wrapper(this); return false;";}i:2;a:4:{s:4:"type";s:6:"button";s:4:"name";s:12:"button[next]";s:5:"label";s:4:"next";s:7:"onclick";s:37:"xajax_eT_wrapper(this); return false;";}i:3;a:4:{s:4:"type";s:6:"button";s:4:"name";s:14:"button[finish]";s:5:"label";s:6:"finish";s:7:"onclick";s:37:"xajax_eT_wrapper(this); return false;";}}i:2;a:5:{s:4:"type";s:6:"button";s:4:"name";s:14:"button[cancel]";s:5:"label";s:6:"cancel";s:7:"onclick";s:29:"window.close(); return false;";s:5:"align";s:5:"right";}s:5:"align";s:5:"right";}}}s:4:"rows";i:2;s:4:"cols";i:1;s:4:"size";s:4:",400";s:7:"options";a:1:{i:1;s:3:"400";}}}','size' => ',400','style' => '.wizard_content fieldset {
height: 347px;
width: 250px;
max-height:347px;
overflow:auto;
}','modified' => '1268325039',);
$templ_data[] = array('name' => 'importexport.wizard_basic_import_csv.choosesepncharset','template' => '','lang' => '','group' => '0','version' => '0.0.1','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:5:{i:0;a:1:{s:1:"B";s:5:"180px";}i:1;a:2:{s:1:"A";a:4:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:3:"msg";s:4:"span";s:3:"all";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:2;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:14:"Fieldseperator";}s:1:"B";a:4:{s:4:"type";s:4:"text";s:7:"no_lang";s:1:"1";s:4:"name";s:8:"fieldsep";s:4:"size";s:1:"1";}}i:3;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:15:"Charset of file";}s:1:"B";a:4:{s:4:"type";s:6:"select";s:7:"no_lang";s:1:"1";s:4:"name";s:7:"charset";s:4:"span";s:9:",width180";}}i:4;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:20:"Header lines to skip";}s:1:"B";a:3:{s:4:"type";s:3:"int";s:4:"name";s:16:"num_header_lines";s:4:"size";s:1:"0";}}}s:4:"rows";i:4;s:4:"cols";i:2;}}','size' => '','style' => '.width180 select { width:150px;}','modified' => '1268236708',);
$templ_data[] = array('name' => 'importexport.wizard_basic_import_csv.conditions','template' => '','lang' => '','group' => '0','version' => '0.01','data' => 'a:1:{i:0;a:7:{s:4:"type";s:4:"vbox";s:4:"data";a:2:{i:0;a:0:{}i:1;a:4:{s:1:"A";a:2:{s:4:"type";s:6:"select";s:4:"name";s:14:"${row}[string]";}s:1:"B";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:6:"2,,0,0";i:1;a:2:{s:4:"type";s:6:"select";s:4:"name";s:12:"${row}[type]";}i:2;a:2:{s:4:"type";s:4:"text";s:4:"name";s:12:"${row}[op_2]";}}s:1:"C";a:2:{s:4:"type";s:6:"select";s:4:"name";s:12:"${row}[true]";}s:1:"D";a:2:{s:4:"type";s:6:"select";s:4:"name";s:13:"${row}[false]";}}}s:4:"rows";i:1;s:4:"cols";i:4;s:4:"size";s:1:"2";i:1;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:1:{s:2:"c1";s:2:"th";}i:1;a:6:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:5:"Field";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:9:"Condition";}s:1:"C";a:5:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"2";s:4:"span";s:1:"2";i:1;a:4:{s:4:"type";s:5:"label";s:4:"span";s:1:"2";s:5:"label";s:4:"True";s:5:"align";s:6:"center";}i:2;a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:6:"2,,2,0";i:1;a:2:{s:4:"type";s:5:"label";s:5:"label";s:6:"Action";}i:2;a:3:{s:4:"type";s:5:"label";s:5:"label";s:4:"Stop";s:5:"align";s:5:"right";}}}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:5:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"2";s:4:"span";s:1:"2";i:1;a:4:{s:4:"type";s:5:"label";s:4:"span";s:1:"2";s:5:"label";s:5:"False";s:5:"align";s:6:"center";}i:2;a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:6:"2,,2,0";i:1;a:2:{s:4:"type";s:5:"label";s:5:"label";s:6:"Action";}i:2;a:3:{s:4:"type";s:5:"label";s:5:"label";s:4:"Stop";s:5:"align";s:5:"right";}}}s:1:"F";a:1:{s:4:"type";s:5:"label";}}i:2;a:6:{s:1:"A";a:2:{s:4:"type";s:6:"select";s:4:"name";s:14:"${row}[string]";}s:1:"B";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:6:"2,,0,0";i:1;a:2:{s:4:"type";s:6:"select";s:4:"name";s:12:"${row}[type]";}i:2;a:2:{s:4:"type";s:4:"text";s:4:"name";s:12:"${row}[op_2]";}}s:1:"C";a:2:{s:4:"type";s:6:"select";s:4:"name";s:20:"${row}[true][action]";}s:1:"D";a:3:{s:4:"type";s:8:"checkbox";s:5:"align";s:6:"center";s:4:"name";s:18:"${row}[true][stop]";}s:1:"E";a:2:{s:4:"type";s:6:"select";s:4:"name";s:21:"${row}[false][action]";}s:1:"F";a:3:{s:4:"type";s:8:"checkbox";s:5:"align";s:6:"center";s:4:"name";s:19:"${row}[false][stop]";}}}s:4:"rows";i:2;s:4:"cols";i:6;s:4:"name";s:10:"conditions";s:7:"options";a:0:{}}i:2;a:5:{s:4:"type";s:6:"button";s:4:"name";s:3:"add";s:5:"label";s:3:"add";s:4:"help";s:59:"This causes a segfault... haven\'t figured out how to fix it";s:8:"disabled";s:1:"1";}}}','size' => '','style' => '','modified' => '1268236762',);
@ -60,20 +67,13 @@ $templ_data[] = array('name' => 'importexport.wizard_basic_import_csv.fieldmappi
$templ_data[] = array('name' => 'importexport.wizard_basic_import_csv.sample_file','template' => '','lang' => '','group' => '0','version' => '0.0.1','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"name";s:3:"msg";s:7:"no_lang";s:1:"1";}}i:2;a:1:{s:1:"A";a:2:{s:4:"type";s:4:"file";s:4:"name";s:4:"file";}}}s:4:"rows";i:2;s:4:"cols";i:1;}}','size' => '','style' => '','modified' => '1268236654',);
$templ_data[] = array('name' => 'importexport.wizzardbox','template' => '','lang' => '','group' => '0','version' => '0.0.1','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:3:{s:2:"c2";s:7:",bottom";s:2:"c1";s:4:",top";s:1:"A";s:4:"100%";}i:1;a:1:{s:1:"A";a:5:{s:4:"type";s:4:"hbox";s:7:"no_lang";s:1:"1";s:4:"size";s:1:"2";i:1;a:4:{s:4:"type";s:4:"hbox";s:7:"no_lang";s:1:"1";s:4:"size";s:1:"1";i:1;a:3:{s:4:"type";s:5:"image";s:7:"no_lang";s:1:"1";s:4:"name";s:12:"importexport";}}i:2;a:4:{s:4:"type";s:8:"groupbox";s:4:"size";s:1:"1";i:1;a:2:{s:4:"type";s:8:"template";s:4:"name";s:15:"wizzard_content";}s:4:"span";s:16:",wizzard_content";}}}i:2;a:1:{s:1:"A";a:6:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";s:4:"span";s:3:"all";i:1;a:5:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"3";i:1;a:4:{s:4:"type";s:6:"button";s:4:"name";s:16:"button[previous]";s:5:"label";s:8:"previous";s:7:"onclick";s:37:"xajax_eT_wrapper(this); return false;";}i:2;a:4:{s:4:"type";s:6:"button";s:4:"name";s:12:"button[next]";s:5:"label";s:4:"next";s:7:"onclick";s:37:"xajax_eT_wrapper(this); return false;";}i:3;a:4:{s:4:"type";s:6:"button";s:4:"name";s:14:"button[finish]";s:5:"label";s:6:"finish";s:7:"onclick";s:37:"xajax_eT_wrapper(this); return false;";}}i:2;a:5:{s:4:"type";s:6:"button";s:4:"name";s:14:"button[cancel]";s:5:"label";s:6:"cancel";s:7:"onclick";s:29:"window.close(); return false;";s:5:"align";s:5:"right";}s:5:"align";s:5:"right";}}}s:4:"rows";i:2;s:4:"cols";i:1;s:4:"size";s:4:",400";s:7:"options";a:1:{i:1;s:3:"400";}}}','size' => ',400','style' => '.wizzard_content fieldset {
height: 347px;
width: 250px;
max-height:347px;
overflow:auto;
}','modified' => '1145975378',);
$templ_data[] = array('name' => 'importexport.wizard_chooseallowedusers','template' => '','lang' => '','group' => '0','version' => '0.0.1','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:3:"msg";}}i:2;a:1:{s:1:"A";a:3:{s:4:"type";s:14:"select-account";s:4:"name";s:13:"allowed_users";s:4:"size";s:8:"5,groups";}}}s:4:"rows";i:2;s:4:"cols";i:1;}}','size' => '','style' => '','modified' => '1146312041',);
$templ_data[] = array('name' => 'importexport.wizzard_chooseallowedusers','template' => '','lang' => '','group' => '0','version' => '0.0.1','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:3:"msg";}}i:2;a:1:{s:1:"A";a:3:{s:4:"type";s:14:"select-account";s:4:"name";s:13:"allowed_users";s:4:"size";s:8:"5,groups";}}}s:4:"rows";i:2;s:4:"cols";i:1;}}','size' => '','style' => '','modified' => '1146312041',);
$templ_data[] = array('name' => 'importexport.wizard_chooseapp','template' => '','lang' => '','group' => '0','version' => '0.0.1','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:3:"msg";}}i:2;a:1:{s:1:"A";a:3:{s:4:"type";s:6:"select";s:7:"no_lang";s:1:"1";s:4:"name";s:11:"application";}}}s:4:"rows";i:2;s:4:"cols";i:1;}}','size' => '','style' => '','modified' => '1145976439',);
$templ_data[] = array('name' => 'importexport.wizzard_chooseapp','template' => '','lang' => '','group' => '0','version' => '0.0.1','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:3:"msg";}}i:2;a:1:{s:1:"A";a:3:{s:4:"type";s:6:"select";s:7:"no_lang";s:1:"1";s:4:"name";s:11:"application";}}}s:4:"rows";i:2;s:4:"cols";i:1;}}','size' => '','style' => '','modified' => '1145976439',);
$templ_data[] = array('name' => 'importexport.wizard_choosename','template' => '','lang' => '','group' => '0','version' => '0.0.1','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:3:"msg";}}i:2;a:1:{s:1:"A";a:2:{s:4:"type";s:4:"text";s:4:"name";s:4:"name";}}}s:4:"rows";i:2;s:4:"cols";i:1;}}','size' => '','style' => '','modified' => '1146317310',);
$templ_data[] = array('name' => 'importexport.wizzard_choosename','template' => '','lang' => '','group' => '0','version' => '0.0.1','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:3:"msg";}}i:2;a:1:{s:1:"A";a:2:{s:4:"type";s:4:"text";s:4:"name";s:4:"name";}}}s:4:"rows";i:2;s:4:"cols";i:1;}}','size' => '','style' => '','modified' => '1146317310',);
$templ_data[] = array('name' => 'importexport.wizard_chooseplugin','template' => '','lang' => '','group' => '0','version' => '0.0.1','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:3:"msg";}}i:2;a:1:{s:1:"A";a:3:{s:4:"type";s:6:"select";s:7:"no_lang";s:1:"1";s:4:"name";s:6:"plugin";}}}s:4:"rows";i:2;s:4:"cols";i:1;}}','size' => '','style' => '','modified' => '1145976573',);
$templ_data[] = array('name' => 'importexport.wizzard_chooseplugin','template' => '','lang' => '','group' => '0','version' => '0.0.1','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:3:"msg";}}i:2;a:1:{s:1:"A";a:3:{s:4:"type";s:6:"select";s:7:"no_lang";s:1:"1";s:4:"name";s:6:"plugin";}}}s:4:"rows";i:2;s:4:"cols";i:1;}}','size' => '','style' => '','modified' => '1145976573',);
$templ_data[] = array('name' => 'importexport.wizzard_close','template' => '','lang' => '','group' => '0','version' => '0.0.1','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:2:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:3:"msg";}}}s:4:"rows";i:1;s:4:"cols";i:1;}}','size' => '','style' => '','modified' => '1146648383',);
$templ_data[] = array('name' => 'importexport.wizard_close','template' => '','lang' => '','group' => '0','version' => '0.0.1','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:2:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:3:"msg";}}}s:4:"rows";i:1;s:4:"cols";i:1;}}','size' => '','style' => '','modified' => '1146648383',);

View File

@ -9,7 +9,7 @@
*/
$setup_info['importexport']['name'] = 'importexport';
$setup_info['importexport']['version'] = '1.4';
$setup_info['importexport']['version'] = '1.7.001';
$setup_info['importexport']['app_order'] = 2;
$setup_info['importexport']['enable'] = 2;
$setup_info['importexport']['tables'] = array('egw_importexport_definitions');
@ -35,11 +35,11 @@ $setup_info['importexport']['hooks']['sidebox_menu'] = 'importexport'.'.importex
/* Dependencies for this app to work */
$setup_info['importexport']['depends'][] = array(
'appname' => 'phpgwapi',
'versions' => Array('1.3','1.4','1.5','1.6','1.7')
'versions' => Array('1.6','1.7')
);
$setup_info['importexport']['depends'][] = array(
'appname' => 'etemplate',
'versions' => Array('1.3','1.4','1.5','1.6','1.7')
'versions' => Array('1.6','1.7')
);
// installation checks for importexport

View File

@ -28,4 +28,13 @@
{
return $GLOBALS['setup_info']['importexport']['currentver'] = '1.4';
}
$test[] = '1.4';
function importexport_upgrade1_4()
{
$sql = 'UPDATE egw_importexport_definitions SET plugin = CONCAT(application, "_", plugin)';
$GLOBALS['egw_setup']->db->query($sql, __LINE__, __FILE__);
return $GLOBALS['setup_info']['importexport']['currentver'] = '1.7.001';
}
?>