From 7a3e571376c31868485074e902aab6577fd04569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cornelius=20Wei=C3=9F?= Date: Sat, 9 Jun 2007 15:36:30 +0000 Subject: [PATCH] - reworked conversions backend in importexport_helper_functions - reworked plugin interfaces. - charset is now an attribut of plugin_options only - import / export function itselve is not static any more - whiped out silly phpdoc tags generated by umbrello (kde uml modeler) - reworked representation of plugin_options for definitions - many fixes in uiexport and export_csv - lang updates --- importexport/importexport_cli.php | 11 +- importexport/inc/class.arrayxml.inc.php | 6 +- importexport/inc/class.bodefinitions.inc.php | 28 ++- importexport/inc/class.definition.inc.php | 24 +- importexport/inc/class.export_csv.inc.php | 90 +++----- .../inc/class.iface_export_plugin.inc.php | 7 +- .../inc/class.iface_export_record.inc.php | 16 +- .../inc/class.iface_import_plugin.inc.php | 3 +- .../inc/class.iface_import_record.inc.php | 16 +- importexport/inc/class.import_csv.inc.php | 53 ++--- ...ass.import_export_helper_functions.inc.php | 214 ++++++++---------- importexport/inc/class.uidefinitions.inc.php | 2 +- importexport/inc/class.uiexport.inc.php | 13 +- importexport/js/export_dialog.js | 28 +++ importexport/setup/etemplates.inc.php | 54 ++--- importexport/setup/phpgw_de.lang | 11 + importexport/setup/phpgw_en.lang | 10 + 17 files changed, 273 insertions(+), 313 deletions(-) create mode 100644 importexport/js/export_dialog.js diff --git a/importexport/importexport_cli.php b/importexport/importexport_cli.php index 2264e842d7..ac21d62cc7 100755 --- a/importexport/importexport_cli.php +++ b/importexport/importexport_cli.php @@ -15,7 +15,6 @@ $usage = "usage: --definition --file - --charset --user --password --domain \n"; @@ -48,7 +47,6 @@ $long_opts = array( 'definition=', 'file=', - 'charset=', 'user=', 'password=', 'domain=' @@ -73,9 +71,6 @@ case '--file' : $file = $option[1]; break; - case '--charset' : - $charset = $option[1]; - break; case '--definition' : $definition = $option[1]; break; @@ -98,10 +93,6 @@ fwrite(STDERR,'importexport_cli: You have to supply a username / password'."\n".$usage); exit(INVALID_OPTION); } - if ( !$charset ) { - fwrite(STDERR,'importexport_cli: You have to supply a valid charset'."\n".$usage); - exit(INVALID_OPTION); - } $GLOBALS['egw_info']['flags'] = array( 'disable_Template_class' => True, @@ -153,7 +144,7 @@ $type = $definition->type; $resource = fopen( $file, 'r' ); - $po->$type( $resource, $charset, $definition ); + $po->$type( $resource, $definition ); $GLOBALS['egw']->common->phpgw_exit(); diff --git a/importexport/inc/class.arrayxml.inc.php b/importexport/inc/class.arrayxml.inc.php index 97de6f4c2f..08bad351ed 100644 --- a/importexport/inc/class.arrayxml.inc.php +++ b/importexport/inc/class.arrayxml.inc.php @@ -25,7 +25,6 @@ class arrayxml { /** * converts a php array to an xml string * - * @static * @param mixed $_data * @param string $_name * @param DOMElement $_node @@ -72,7 +71,6 @@ class arrayxml { /** * converts XML string into php array * - * @static * @param string $_xml * @return array */ @@ -98,10 +96,10 @@ class arrayxml { } else { switch ( $type ) { case 'boolean' : - $value = utf8_decode($nc->nodeValue) == 'FALSE' ? false : true; + $value = $nc->nodeValue == 'FALSE' ? false : true; break; default : - $value = utf8_decode($nc->nodeValue); + $value = $nc->nodeValue; } $xml_array[$name] = $value; } diff --git a/importexport/inc/class.bodefinitions.inc.php b/importexport/inc/class.bodefinitions.inc.php index 1aea53a901..a64506a6ac 100644 --- a/importexport/inc/class.bodefinitions.inc.php +++ b/importexport/inc/class.bodefinitions.inc.php @@ -12,6 +12,7 @@ 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 @@ -24,11 +25,13 @@ class bodefinitions { const _defintion_talbe = 'egw_importexport_definitions'; /** - * holds so_sql - * - * @var so_sql + * @var so_sql holds so_sql */ private $so_sql; + + /** + * @var array hold definitions + */ private $definitions; public function __construct($_query=false) @@ -43,11 +46,8 @@ class bodefinitions { } /** - * gets definitions as raw data. - * well, we need a god idea for egw_record pools... - * its not a god idea to make a definition object of each - * at the moment, as each defintion holds an so_sql instance. - * + * gets array of definition ids + * * @return array */ public function get_definitions() { @@ -121,6 +121,14 @@ class bodefinitions { foreach ($keys as $definition_id) { $definition = new 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( + $export_data['definitions'][$definition->name]['allowed_users'] + ); + $export_data['definitions'][$definition->name]['owner'] = + import_export_helper_functions::account_id2name( + $export_data['definitions'][$definition->name]['owner'] + ); unset($export_data['definitions'][$definition->name]['definition_id']); unset($definition); } @@ -159,6 +167,10 @@ class bodefinitions { // save definition(s) into internal table 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 = new definition( $definition_data['name'] ); $definition_id = $definition->get_identifier() ? $definition->get_identifier() : NULL; diff --git a/importexport/inc/class.definition.inc.php b/importexport/inc/class.definition.inc.php index 3a4820dcd8..1a28875d17 100644 --- a/importexport/inc/class.definition.inc.php +++ b/importexport/inc/class.definition.inc.php @@ -11,7 +11,8 @@ */ require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.iface_egw_record.inc.php'); -require_once(EGW_INCLUDE_ROOT.'/etemplate/inc/class.so_sql.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'); /** * class definition @@ -39,30 +40,22 @@ class definition implements iface_egw_record { ); /** - * holds so_sql object - * - * @var so_sql + * @var so_sql holds so_sql object */ private $so_sql; /** - * internal representation of definition - * - * @var unknown_type + * @var array internal representation of definition */ private $definition = array(); /** - * holds current user - * - * @var int + * @var int holds current user */ private $user; /** - * is current user an admin? - * - * @var bool + * @var bool is current user an admin? */ private $is_admin; @@ -157,7 +150,8 @@ class definition implements iface_egw_record { * @return array */ private function get_options() { - return unserialize($this->definition['plugin_options']); + $options_data = arrayxml::xml2array( $this->definition['plugin_options'] ); + return $options_data['plugin_options']; } /** @@ -166,7 +160,7 @@ class definition implements iface_egw_record { * @param array $options */ private function set_options(array $_plugin_options) { - $this->definition['plugin_options'] = serialize( $_plugin_options ); + $this->definition['plugin_options'] = arrayxml::array2xml( $_plugin_options, 'plugin_options' ); } /** diff --git a/importexport/inc/class.export_csv.inc.php b/importexport/inc/class.export_csv.inc.php index 35a3eef570..a2f418deaf 100644 --- a/importexport/inc/class.export_csv.inc.php +++ b/importexport/inc/class.export_csv.inc.php @@ -24,57 +24,43 @@ require_once(EGW_INCLUDE_ROOT. '/phpgwapi/inc/class.translation.inc.php'); */ class export_csv implements iface_export_record { - - /** Aggregations: */ - - /** Compositions: */ - /** - * array with field mapping in form egw_field_name => exported_field_name - * @var array + * @var array array with field mapping in form egw_field_name => exported_field_name */ protected $mapping = array(); /** - * array with conversions to be done in form: egw_field_name => conversion_string - * @var array + * @var array array with conversions to be done in form: egw_field_name => conversion_string */ protected $conversion = array(); /** - * array holding the current record - * @access protected + * @var array holding the current record */ protected $record = array(); /** - * holds (charset) translation object - * @var object + * @var translation holds (charset) translation object */ protected $translation; /** - * charset of csv file - * @var string + * @var string charset of csv file */ protected $csv_charset; /** - * holds number of exported records - * @var unknown_type + * @var int holds number of exported records */ protected $num_of_records = 0; /** - * stream resource of csv file - * @var resource + * @var stream stream resource of csv file */ protected $handle; /** - * csv specific options - * - * @var array + * @var array csv specific options */ protected $csv_options = array( 'delimiter' => ';', @@ -84,21 +70,19 @@ class export_csv implements iface_export_record /** * constructor * - * @param object _handle resource where records are exported to. - * @param string _charset charset the records are exported to. + * @param stram $_stream resource where records are exported to. * @param array _options options for specific backends * @return bool - * @access public */ - public function __construct( $_handle, $_charset, array $_options=array() ) { + public function __construct( $_stream, $_options ) { if (!is_object($GLOBALS['egw']->translation)) { $GLOBALS['egw']->translation = new translation(); } $this->translation = &$GLOBALS['egw']->translation; - $this->handle = $_handle; - $this->csv_charset = $_charset; - if (!empty($_options)) { - $this->csv_options = array_merge($this->csv_options,$_options); + $this->handle = $_stream; + $this->csv_charset = $_options['charset'] ? $_options['charset'] : 'utf-8'; + if ( !empty( $_options ) ) { + $this->csv_options = array_merge( $this->csv_options, $_options ); } } @@ -111,9 +95,7 @@ class export_csv implements iface_export_record if ($this->num_of_records > 0) { throw new Exception('Error: Field mapping can\'t be set during ongoing export!'); } - foreach ($_mapping as $egw_filed => $csv_field) { - $this->mapping[$egw_filed] = $this->translation->convert($csv_field, $this->translation->charset(), $this->csv_charset); - } + $this->mapping = $_mapping; } /** @@ -131,45 +113,42 @@ class export_csv implements iface_export_record * * @param iface_egw_record record * @return bool - * @access public */ public function export_record( iface_egw_record $_record ) { - $record_data = $_record->get_record_array(); + $this->record = $_record->get_record_array(); - if (empty($this->mapping)) { - $this->mapping = array_combine(array_keys($record_data),array_keys($record_data)); - } - - // just for debug... - $this->mapping = $this->translation->convert($this->mapping, 'utf-8', 'iso-8859-1');//$this->translation->charset()); - - if ($this->num_of_records == 0 && $this->csv_options['begin_with_fieldnames'] && !empty($this->mapping)) { - fputcsv($this->handle,array_values($this->mapping),$this->csv_options['delimiter'],$this->csv_options['enclosure']); + // begin with fieldnames ? + if ($this->num_of_records == 0 && $this->csv_options['begin_with_fieldnames'] ) { + $mapping = ! empty( $this->mapping ) ? $this->mapping : array_keys ( $this->record ); + $mapping = $this->translation->convert( $mapping, $this->translation->charset(), $this->csv_charset ); + fputcsv( $this->handle ,$mapping ,$this->csv_options['delimiter'], $this->csv_options['enclosure'] ); } // do conversions - if ($this->conversion[$egw_field]) { - $record_data[$egw_field] = import_export_helper_functions::conversion($record_data,$this->conversion); + if ( !empty( $this->conversion )) { + $this->record = import_export_helper_functions::conversion( $this->record, $this->conversion ); + } + + // do fieldmapping + if ( !empty( $this->mapping ) ) { + $record_data = $this->record; + $this->record = array(); + foreach ($this->mapping as $egw_field => $csv_field) { + $this->record[$csv_field] = $record_data[$egw_field]; + } } // do charset translation - $record_data = $this->translation->convert($record_data, $this->translation->charset(), $this->csv_charset); + $this->record = $this->translation->convert( $this->record, $this->translation->charset(), $this->csv_charset ); - // do fieldmapping - foreach ($this->mapping as $egw_field => $csv_field) { - $this->record[$csv_field] = $record_data[$egw_field]; - } - - $this->fputcsv($this->handle,$this->record,$this->csv_options['delimiter'],$this->csv_options['enclosure']); + $this->fputcsv( $this->handle, $this->record, $this->csv_options['delimiter'], $this->csv_options['enclosure'] ); $this->num_of_records++; - $this->record = array(); } /** * Retruns total number of exported records. * * @return int - * @access public */ public function get_num_of_records() { return $this->num_of_records; @@ -179,7 +158,6 @@ class export_csv implements iface_export_record * destructor * * @return - * @access public */ public function __destruct() { diff --git a/importexport/inc/class.iface_export_plugin.inc.php b/importexport/inc/class.iface_export_plugin.inc.php index 667f059cf9..136c220304 100644 --- a/importexport/inc/class.iface_export_plugin.inc.php +++ b/importexport/inc/class.iface_export_plugin.inc.php @@ -39,9 +39,10 @@ interface iface_export_plugin { /** * exports entries according to given definition object. * + * @param stream $_stream * @param definition $_definition */ - public static function export($_stream, $_charset, definition $_definition); + public function export($_stream, definition $_definition); /** * returns translated name of plugin @@ -76,14 +77,14 @@ interface iface_export_plugin { * preserv => array, * ) */ - public static function get_options_etpl(); + public function get_options_etpl(); /** * returns etemplate name for slectors of this plugin * * @return string etemplate name */ - public static function get_selectors_etpl(); + public function get_selectors_etpl(); } // end of iface_export_plugin ?> diff --git a/importexport/inc/class.iface_export_record.inc.php b/importexport/inc/class.iface_export_record.inc.php index 97aabf47ef..ce18700347 100644 --- a/importexport/inc/class.iface_export_record.inc.php +++ b/importexport/inc/class.iface_export_record.inc.php @@ -26,28 +26,20 @@ */ interface iface_export_record { - - /** Aggregations: */ - - /** Compositions: */ - /** * constructor * - * @param object _handle resource where records are exported to. - * @param string _charset charset the records are exported to. - * @param array _options options for specific backends + * @param stream $_stream resource where records are exported to. + * @param array $_options options for specific backends * @return bool - * @access public */ - public function __construct( $_handle, $_charset, array $_options=array() ); + public function __construct( $_stream, array $_options ); /** * exports a record into resource of handle * * @param object of interface egw_record _record * @return bool - * @access public */ public function export_record( iface_egw_record $_record ); @@ -55,7 +47,6 @@ interface iface_export_record * Retruns total number of exported records. * * @return int - * @access public */ public function get_num_of_records( ); @@ -63,7 +54,6 @@ interface iface_export_record * destructor * * @return - * @access public */ public function __destruct( ); diff --git a/importexport/inc/class.iface_import_plugin.inc.php b/importexport/inc/class.iface_import_plugin.inc.php index 553ba6199b..a0744129cc 100644 --- a/importexport/inc/class.iface_import_plugin.inc.php +++ b/importexport/inc/class.iface_import_plugin.inc.php @@ -29,9 +29,10 @@ interface iface_import_plugin { /** * imports entries according to given definition object. * + * @param stram $_stram * @param definition $_definition */ - public function import($_stream, $_charset, definition $_definition); + public function import( $_stream, definition $_definition ); /** * returns translated name of plugin diff --git a/importexport/inc/class.iface_import_record.inc.php b/importexport/inc/class.iface_import_record.inc.php index ed1c767b15..09188248cc 100644 --- a/importexport/inc/class.iface_import_record.inc.php +++ b/importexport/inc/class.iface_import_record.inc.php @@ -20,26 +20,19 @@ */ interface iface_import_record { - - /** Aggregations: */ - - /** Compositions: */ - /** * Opens resource, returns false if something fails * - * @param string _resource resource containing data. Differs according to the implementations - * @param array _options options for the resource + * @param stream $_stream resource containing data. Differs according to the implementations + * @param array $_options options for specific backends * @return bool - * @access public */ - public function __construct( $_resource, $_options ); + public function __construct( $_stream, array $_options ); /** * cleanup * * @return - * @access public */ public function __destruct( ); @@ -48,7 +41,6 @@ interface iface_import_record * * @param string _position may be: {first|last|next|previous|somenumber} * @return bool - * @access public */ public function get_record( $_position = 'next' ); @@ -56,7 +48,6 @@ interface iface_import_record * Retruns total number of records for the open resource. * * @return int - * @access public */ public function get_num_of_records( ); @@ -64,7 +55,6 @@ interface iface_import_record * Returns pointer of current position * * @return int - * @access public */ public function get_current_position( ); diff --git a/importexport/inc/class.import_csv.inc.php b/importexport/inc/class.import_csv.inc.php index bc75912eb9..a5b4345550 100755 --- a/importexport/inc/class.import_csv.inc.php +++ b/importexport/inc/class.import_csv.inc.php @@ -19,49 +19,40 @@ require_once('class.import_export_helper_functions.inc.php'); * This a an abstract implementation of interface iface_import_record * An record is e.g. a single address or or single event. * No mater where the records come from, at the end the get_record method comes out + * @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 { const csv_max_linelength = 8000; /** - * @static import_export_helper_functions - */ - - /** - * array with field mapping in form column number => new_field_name - * @access public + * @var array array with field mapping in form column number => new_field_name */ public $mapping = array(); /** - * array with conversions to be done in form: new_field_name => conversion_string - * @access public + * @var array with conversions to be done in form: new_field_name => conversion_string */ public $conversion = array(); /** - * array holding the current record - * @access protected + * @var array holding the current record */ protected $record = array(); /** - * current position counter - * @access protected + * @var int current position counter */ protected $current_position = 0; /** - * holds total number of records - * @access private - * @var int + * @var int holds total number of records */ protected $num_of_records = 0; /** - * csv resource - * @access private + * @var stream */ private $resource; @@ -73,18 +64,16 @@ class import_csv implements iface_import_record { //, Iterator { private $csv_fieldsep; /** - * charset of csv file - * @var string - * @access privat + * + * @var string charset of csv file */ private $csv_charset; /** - * @param string _resource resource containing data. May be each valid php-stream - * @param array _options options for the resource array with keys: charset and fieldsep - * @access public + * @param string $_resource resource containing data. May be each valid php-stream + * @param array $_options options for the resource array with keys: charset and fieldsep */ - public function __construct( $_resource, $_options = array() ) { + public function __construct( $_resource, $_options ) { $this->resource = $_resource; $this->csv_fieldsep = $_options['fieldsep']; $this->csv_charset = $_options['charset']; @@ -93,9 +82,6 @@ class import_csv implements iface_import_record { //, Iterator { /** * cleanup - * - * @return - * @access public */ public function __destruct( ) { } // end of member function __destruct @@ -105,21 +91,20 @@ class import_csv implements iface_import_record { //, Iterator { * * @param mixed _position may be: {current|first|last|next|previous|somenumber} * @return mixed array with data / false if no furtor records - * @access public */ public function get_record( $_position = 'next' ) { if ($this->get_raw_record( $_position ) === false) { return false; } - if ( !empty( $this->mapping ) ) { - $this->do_fieldmapping(); - } - if ( !empty( $this->conversion ) ) { $this->do_conversions(); } + if ( !empty( $this->mapping ) ) { + $this->do_fieldmapping(); + } + return $this->record; } // end of member function get_record @@ -191,7 +176,6 @@ class import_csv implements iface_import_record { //, Iterator { * Retruns total number of records for the open resource. * * @return int - * @access public */ public function get_num_of_records( ) { if ($this->num_of_records > 0) { @@ -208,7 +192,6 @@ class import_csv implements iface_import_record { //, Iterator { * Returns pointer of current position * * @return int - * @access public */ public function get_current_position( ) { @@ -221,7 +204,6 @@ class import_csv implements iface_import_record { //, Iterator { * does fieldmapping according to $this->mapping * * @return - * @access protected */ protected function do_fieldmapping( ) { $record = $this->record; @@ -236,7 +218,6 @@ class import_csv implements iface_import_record { //, Iterator { * does conversions according to $this->conversion * * @return bool - * @access protected */ protected function do_conversions( ) { if ( $record = import_export_helper_functions::conversion( $this->record, $this->conversion )) { diff --git a/importexport/inc/class.import_export_helper_functions.inc.php b/importexport/inc/class.import_export_helper_functions.inc.php index f9d3e51af8..39cfdeda15 100755 --- a/importexport/inc/class.import_export_helper_functions.inc.php +++ b/importexport/inc/class.import_export_helper_functions.inc.php @@ -10,8 +10,6 @@ * @version $Id$ */ - - /** * class import_export_helper_functions (only static methods) * use import_export_helper_functions::method @@ -25,80 +23,75 @@ class import_export_helper_functions { /** * converts accound_lid to account_id * - * @param string _account_lid comma seperated list - * @return string comma seperated list - * @static - * @access public + * @param mixed $_account_lid comma seperated list or array with lids + * @return mixed comma seperated list or array with ids */ - public static function account_lid2id( $_account_lids ) { - $account_lids = explode( ',', $_account_lids ); + public static function account_name2id( $_account_lids ) { + $account_lids = is_array( $_account_lids ) ? $_account_lids : explode( ',', $_account_lids ); foreach ( $account_lids as $account_lid ) { if ( $account_id = $GLOBALS['egw']->accounts->name2id( $account_lid )) { $account_ids[] = $account_id; } } - return implode( ',', $account_ids ); + return is_array( $_account_lids ) ? $account_ids : implode( ',', $account_ids ); } // end of member function account_lid2id /** * converts account_ids to account_lids * - * @param int _account_ids comma seperated list - * @return string comma seperated list - * @static - * @access public + * @param mixed $_account_ids comma seperated list or array with ids + * @return mixed comma seperated list or array with lids */ - public static function account_id2lid( $_account_id ) { - $account_ids = explode( ',', $_account_id ); + public static function account_id2name( $_account_id ) { + $account_ids = is_array( $_account_id ) ? $_account_id : explode( ',', $_account_id ); foreach ( $account_ids as $account_id ) { if ( $account_lid = $GLOBALS['egw']->accounts->id2name( $account_id )) { $account_lids[] = $account_lid; } } - return implode( ',', $account_lids ); + return is_array( $_account_id ) ? $account_lids : implode( ',', $account_lids ); } // end of member function account_id2lid - + /** * converts cat_id to a cat_name * - * @param int _cat_ids comma seperated list - * @return mixed string cat_name - * @static - * @access public + * @param mixed _cat_ids comma seperated list or array + * @return mixed comma seperated list or array with cat_names */ public static function cat_id2name( $_cat_ids ) { - if ( !is_object($GLOBALS['egw']->categories) ) { - $GLOBALS['egw']->categories =& CreateObject('phpgwapi.categories'); - } - $cat_ids = explode( ',', $_cat_id ); + $cats = &CreateObject( 'phpgwapi.categories' ); + + $cat_ids = is_array( $_cat_ids ) ? $_cat_ids : explode( ',', $_cat_ids ); foreach ( $cat_ids as $cat_id ) { - $cat_names[] = $GLOBALS['egw']->categories->id2name( (int)$cat_id ); + $cat_names[] = $cats->id2name( (int)$cat_id ); } - return implode(',',$cat_names); + return is_array( $_cat_ids ) ? $cat_names : implode(',',$cat_names); } // end of member function category_id2name /** * converts cat_name to a cat_id. * If a cat isn't found, it will be created. * - * @param string _cat_names comma seperated list. - * @return mixed int / string (comma seperated cat id's) - * @static - * @access public + * @param mixed $_cat_names comma seperated list or array. + * @return mixed comma seperated list or array with cat_ids */ - public static function cat_name2id( $_cat_names, $_create = true ) { - if (!is_object($GLOBALS['egw']->categories)) { - $GLOBALS['egw']->categories =& CreateObject( 'phpgwapi.categories' ); - } - $cat_names = explode( ',', $_cat_names ); + public static function cat_name2id( $_cat_names ) { + $cats = &CreateObject( 'phpgwapi.categories' ); + $cats->app_name = 'phpgw'; + + $cat_names = is_array( $_cat_names ) ? $_cat_names : explode( ',', $_cat_names ); + foreach ( $cat_names as $cat_name ) { - if ( $cat_id = $GLOBALS['egw']->categories->name2id( addslashes( $cat_name ))) { } - elseif ($_create) $cat_id = $GLOBALS['egw']->categories->add( array( 'name' => $cat_name,'descr' => $cat_name )); - else continue; + if ( $cat_id = $cats->name2id( addslashes( $cat_name ))) { } + else $cat_id = $cats->add( array( + 'name' => $cat_name, + 'access' => 'public', + 'descr' => $cat_name. ' ('. lang('Automatically created by importexport'). ')' + )); $cat_ids[] = $cat_id; } - return implode( ',', $cat_ids ); + return $_cat_names ? $cat_ids : implode( ',', $cat_ids ); } // end of member function category_name2id @@ -113,115 +106,90 @@ class import_export_helper_functions { * This will translate a '1' in the _record field to 'privat' and everything else to 'public'. * * In addintion to the fields assign by the pattern of the reg.exp. - * you can use all other _record fields, with the syntax |[FIELDNAME]. + * you can use all other _record fields, with the syntax |[FIELDINDEX]. * Example: - * .+|>|[Company]: |[NFamily], |[NGiven]|||[NFamily], |[NGiven] - * It is used on the _record field 'Company' and constructs a something like - * Company: FamilyName, GivenName or FamilyName, GivenName if 'Company' is empty. + * Your record is: + * array( 0 => Company, 1 => NFamily, 2 => NGiven + * Your conversion string for field 0 (Company): + * .+|>|[0]: |[1], |[2]|||[1], |[2] + * This constructs something like + * Company: FamilyName, GivenName or FamilyName, GivenName if 'Company' is empty. * - * Moreover the helper function of this class can be used using the '@' operator. - * @cat_name2id(Cat1,...,CatN) returns a (','-separated) list with the cat_id's. If a + * Moreover the two helper function cat() and account() can be used. + * cat(Cat1,...,CatN) returns a (','-separated) list with the cat_id's. If a * category isn't found, it will be automaticaly added. * * Patterns as well as the replacement can be regular expressions (the replacement is done * via ereg_replace). * - * If, after all replacements, the value starts with an '@' the whole - * value is eval()'ed, so you may use all php, phpgw plus your own functions. This is quiet - * powerfull, but circumvents all ACL. Therefor this feature is only availible to - * Adminstrators. - * - * Example using regular expressions and '@'-eval(): - * ||0?([0-9]+)[ .:-]+0?([0-9]*)[ .:-]+0?([0-9]*)[ .:-]+0?([0-9]*)[ .:-]+0?([0-9]*)[ .:-]+0?([0-9]*).*|>@mktime(|#4,|#5,|#6,|#2,|#3,|#1) - * It will read a date of the form '2001-05-20 08:00:00.00000000000000000' (and many more, - * see the regular expr.). The [ .:-]-separated fields are read and assigned in different - * order to @mktime(). Please note to use |# insted of a backslash (I couldn't get backslash - * through all the involved templates and forms.) plus the field-number of the pattern. - * * @param array _record reference with record to do the conversion with * @param array _conversion array with conversion description + * @param object &$cclass calling class to process the '@ evals' (not impelmeted yet) * @return bool - * @static - * @access public - * @todo replace this function with a function dealing with reg expressions! */ - public static function conversion( $_record, $_conversion ) { + public static function conversion( $_record, $_conversion, &$_cclass = null ) { if (empty( $_conversion ) ) return $_record; + $values = $_record; $PSep = '||'; // Pattern-Separator, separats the pattern-replacement-pairs in conversion $ASep = '|>'; // Assignment-Separator, separats pattern and replacesment - $VPre = '|#'; // Value-Prefix, is expanded to \ for ereg_replace - $CPre = '|['; $CPreReg = '\|\['; // |{_record-fieldname} is expanded to the value of the _record-field - $CPos = ']'; $CPosReg = '\]'; // if used together with @ (replacement is eval-ed) value gets autom. quoted + $CPre = '|['; $CPos = ']'; // |[_record-idx] is expanded to the corespondig value - foreach ( $_record as $record_idx => $record_value ) { - $pat_reps = explode($PSep,stripslashes($_conversion[$record_idx])); - $replaces = ''; $rvalues = ''; - if($pat_reps[0] != '') - { - foreach($pat_reps as $k => $pat_rep) - { - list($pattern,$replace) = explode($ASep,$pat_rep,2); - if($replace == '') - { - $replace = $pattern; $pattern = '^.*$'; - } - $rvalues[$pattern] = $replace; // replace two with only one, added by the form - $replaces .= ($replaces != '' ? $PSep : '') . $pattern . $ASep . $replace; + foreach ( $_conversion as $idx => $conversion_string ) { + + if ( empty( $conversion_string ) ) continue; + + // fetch patterns ($rvalues) + $pat_reps = explode( $PSep, stripslashes( $conversion_string ) ); + foreach( $pat_reps as $k => $pat_rep ) { + list( $pattern, $replace ) = explode( $ASep, $pat_rep, 2 ); + if( $replace == '' ) { + $replace = $pattern; $pattern = '^.*$'; } - //$_conversion[$record_idx] = $rvalues; - $conv_record = $rvalues; - } - else - { - //unset($_conversion[$record_idx] ); + $rvalues[$pattern] = $replace; // replace two with only one, added by the form } - $val = $record_value; - if(!empty($_conversion[$record_idx])) - { - //$conv_record = $_conversion[$record_idx]; - while(list($pattern,$replace) = each($conv_record)) - { - if(ereg((string) $pattern,$val)) - { - $val = ereg_replace((string) $pattern,str_replace($VPre,'\\',$replace),(string) $val); + // conversion list may be longer than $_record (no_csv) + $val = array_key_exists( $idx, $_record ) ? $_record[$idx] : ''; - $reg = $CPreReg.'([a-zA-Z_0-9]+)'.$CPosReg; - while(ereg($reg,$val,$vars)) - { // expand all _record fields - $val = str_replace($CPre . $vars[1] . $CPos, $val[0] == '@' ? "'" - . addslashes($fields[array_search($vars[1], array_keys($_record))]) - . "'" : $fields[array_search($vars[1], array_keys($_record))], $val); - } - if($val[0] == '@') - { - if (!$GLOBALS['egw_info']['user']['apps']['admin']) - { - error_log(__FILE__.__LINE__. lang('@-eval() is only availible to admins!!!')); - } - else - { - // removing the $ to close security hole of showing vars, which contain eg. passwords - $val = substr(str_replace('$','',$val),1).';'; - $val = 'return '. (substr($val,0,6) == 'cat_id' ? '$this->'.$val : $val); - // echo "

eval('$val')="; - $val = eval($val); - // echo "'$val'

"; - } - } - if($pattern[0] != '@' || $val) - { - break; - } + foreach ( $rvalues as $pattern => $replace ) { + if( ereg( (string)$pattern, $val) ) { + + $val = ereg_replace( (string)$pattern, $replace, (string)$val ); + + $reg = '\|\[([a-zA-Z_0-9]+)\]'; + while( ereg( $reg, $val, $vars ) ) { + // expand all _record fields + $val = str_replace( + $CPre . $vars[1] . $CPos, + $_record[array_search($vars[1], array_keys($_record))], + $val + ); } + + $val = preg_replace_callback( "/(cat|account)\(([^)]+)\)/i", array( self, 'c2_dispatcher') , $val ); } } - $values[$record_idx] = $val; + $values[$idx] = $val; } return $values; } // end of member function conversion - + + /** + * callback for preg_replace_callback from self::conversion. + * This function gets called when 2nd level conversions are made, + * like the cat() and account() statements in the conversions. + * + * @param array $_matches + */ + private static function c2_dispatcher( $_matches ) { + $action = &$_matches[1]; // cat or account ... + $data = &$_matches[2]; // datas for action + + $method = (string)$action. ( is_int( $data ) ? '_id2name' : '_name2id' ); + return self::$method( $data ); + } + /** * returns a list of importexport plugins * diff --git a/importexport/inc/class.uidefinitions.inc.php b/importexport/inc/class.uidefinitions.inc.php index 2a4e217bfd..ca888161ab 100644 --- a/importexport/inc/class.uidefinitions.inc.php +++ b/importexport/inc/class.uidefinitions.inc.php @@ -128,7 +128,7 @@ class uidefinitions unset($definition); } $content = $definitions; - return $etpl->exec(self::_appname.'.uidefinitions.index',$content,array(),$readonlys,$preserv); + return $etpl->exec( self::_appname.'.uidefinitions.index', $content, array(), $readonlys, $preserv ); } function edit() diff --git a/importexport/inc/class.uiexport.inc.php b/importexport/inc/class.uiexport.inc.php index 8465f55273..114e937b29 100644 --- a/importexport/inc/class.uiexport.inc.php +++ b/importexport/inc/class.uiexport.inc.php @@ -199,7 +199,7 @@ class uiexport { $charset = $GLOBALS['egw']->translation->charset(); } $plugin_object = new $definition->plugin; - $plugin_object->export($file, $charset, $definition); + $plugin_object->export( $file, $definition ); if($_content['export'] == 'pressed') { fclose($file); @@ -224,9 +224,16 @@ class uiexport { fclose($file); unlink($tmpfname); - $preview = $GLOBALS['egw']->translation->convert($preview,'iso-8859-1','utf-8'); + + // NOTE: $definition->plugin_options['charset'] may not be set, + // but it's the best guess atm. + $preview = $GLOBALS['egw']->translation->convert( $preview, + $definition->plugin_options['charset'], + $GLOBALS['egw']->translation->charset() + ); + $response->addAssign('exec[preview-box]','innerHTML',$preview); - $response->addAssign('divPoweredBy','style.display','none'); + //$response->addAssign('divPoweredBy','style.display','none'); $response->addAssign('exec[preview-box]','style.display','inline'); $response->addAssign('exec[preview-box-buttons]','style.display','inline'); diff --git a/importexport/js/export_dialog.js b/importexport/js/export_dialog.js new file mode 100644 index 0000000000..c42e8e27b6 --- /dev/null +++ b/importexport/js/export_dialog.js @@ -0,0 +1,28 @@ +/** + * eGroupWare + * + * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License + * @package importexport + * @link http://www.egroupware.org + * @author Cornelius Weiss + * @copyright Cornelius Weiss + * @version $Id:$ + */ + +function export_dialog() { + + this.change_definition = function(sel_obj) { + if(sel_obj.value == 'expert') { + // 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','inline'); + set_style_by_class('tr','save_definition','display','inline'); + } + else { + set_style_by_class('tr','select_plugin','display','none'); + set_style_by_class('tr','save_definition','display','none'); + } + }; +} +var export_dialog = new export_dialog(); \ No newline at end of file diff --git a/importexport/setup/etemplates.inc.php b/importexport/setup/etemplates.inc.php index 3ea6125383..21f62634b0 100644 --- a/importexport/setup/etemplates.inc.php +++ b/importexport/setup/etemplates.inc.php @@ -2,7 +2,7 @@ /** * eGroupWare - eTemplates for Application importexport * http://www.egroupware.org - * generated by soetemplate::dump4setup() 2006-11-16 12:03 + * generated by soetemplate::dump4setup() 2007-06-09 17:40 * * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License * @package importexport @@ -12,28 +12,28 @@ $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=400,height=400,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:1:"5";}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=400,height=400,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:213:"window.open(egw::link(\'/index.php\',\'menuaction=importexport.uidefinitions.wizzard\'),\'\',\'dependent=yes,width=400,height=400,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=400,height=400,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:230:"document.getElementById(\'divPoweredBy\').style.display=\'block\'; 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; - top: 0px; - left: 0px; - width: 400px; - height: 360px; - overflow: scroll; - background-color: white; - z-index: 999; - display: none; -} -.preview-box-buttons { - position: absolute; - top: 365px; - left: 0px; - width: 400px; - height: 20px; - - z-index: 999; - display: none; +$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; + top: 0px; + left: 0px; + width: 400px; + height: 360px; + overflow: scroll; + background-color: white; + z-index: 999; + display: none; +} +.preview-box-buttons { + position: absolute; + top: 365px; + left: 0px; + width: 400px; + height: 20px; + + z-index: 999; + display: none; }','modified' => '1158220473',); $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',); @@ -46,11 +46,11 @@ $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.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; +$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.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',); diff --git a/importexport/setup/phpgw_de.lang b/importexport/setup/phpgw_de.lang index 8787d2781a..d99ca3920e 100644 --- a/importexport/setup/phpgw_de.lang +++ b/importexport/setup/phpgw_de.lang @@ -1,7 +1,18 @@ +allowed users importexport de Erlaubte Benutzer choose a name for this definition importexport de Wählen sie einen Namen für diese Definition. choose a plugin importexport de Wählen sie ein Plugin. choose an application importexport de Wählen sei eine Anwendung. +delete all selected definitions importexport de Alle ausgewählten Definitionen löschen +export importexport de Exportieren +export all selected definitions importexport de Alle ausgewählten Definitionen exportieren finish importexport de Fertig +general importexport de Generell +import definitions (attension: existing definitions with equal names will be overwritten!!!) importexport de Definitionen importieren (Achtung: Alle gleichnamigen existierenden Definitionen werden überschrieben!) next importexport de Weiter +preview importexport de Vorschau previous importexport de Zurück +save as definition importexport de Als Definition speichern +select definition importexport de Definition auswählen +select plugin importexport de Plugin auswählen +some nice text importexport de Ein schöner Text which useres are allowed for this definition importexport de Welche Benutzer dürden diese Definition verwenden? diff --git a/importexport/setup/phpgw_en.lang b/importexport/setup/phpgw_en.lang index 865235a5e8..a15374e31d 100644 --- a/importexport/setup/phpgw_en.lang +++ b/importexport/setup/phpgw_en.lang @@ -2,7 +2,17 @@ allowed users importexport en Allowed users choose a name for this definition importexport en Choose a name for this definition choose a plugin importexport en Choose a plugin choose an application importexport en Choose an application +delete all selected definitions importexport en delete ALL selected definitions +export importexport en Export +export all selected definitions importexport en export ALL selected definitions finish importexport en finish +general importexport en General +import definitions (attension: existing definitions with equal names will be overwritten!!!) importexport en Import definitions (Attension: Existing definitions with equal names will be overwritten!!!) next importexport en next +preview importexport en Preview previous importexport en previous +save as definition importexport en Save as definition +select definition importexport en Select definition +select plugin importexport en Select plugin +some nice text importexport en some nice text which useres are allowed for this definition importexport en Which useres are allowed for this definition