Index: /cron.php
===================================================================
--- /cron.php	(revision 5909)
+++ /cron.php	(revision 5911)
@@ -8,5 +8,5 @@
 	ini_set("display_errors", "1");
 	 
-	require_once(dirname(__FILE__).'/../../../wp-load.php'); 	
+	require_once(dirname(__FILE__).'/../../../wp-load.php'); 
  
 	date_default_timezone_set("Europe/Berlin");
Index: /lib/functions.inc.php
===================================================================
--- /lib/functions.inc.php	(revision 5909)
+++ /lib/functions.inc.php	(revision 5911)
@@ -292,5 +292,27 @@
 		
 	} // function wpsg_tax_groups()
-	
+
+	/**
+	 * Wandelt einen Key => Value Array fÃŒr die InlineEdit JS Funktion um
+	 * @param $ar
+	 */
+	function wpsg_prepare_for_inlineEdit($ar)
+	{
+		
+		if (!wpsg_isSizedArray($ar)) return json_encode(array());
+		
+		$arReturn = array();
+		
+		foreach ($ar as $k => $v)
+		{
+			
+			$arReturn[] = array('value' => $k, 'text' => $v);
+			
+		}
+		
+		return json_encode($arReturn);
+		
+	} // function wpsg_prepare_for_inlineEdit($ar)
+
 	function wpsg_prepare_for_debug(&$value)
 	{
@@ -699,6 +721,12 @@
 	function wpsg_toDate($value)
 	{
-		
-		if (preg_match('/\d{2}\.\d{2}\.\d{4}/', $value))
+			
+		if (is_numeric($value))
+		{
+			
+			return date('Y-m-d', $value); 
+			
+		}
+		else if (preg_match('/\d{2}\.\d{2}\.\d{4}/', $value))
 		{
 			
@@ -707,5 +735,5 @@
 			return $arDate[2].'-'.$arDate[1].'-'.$arDate[0];
 			
-		}
+		}		
 		else if (strtotime($value) > 0)
 		{
Index: /lib/helper_functions.inc.php
===================================================================
--- /lib/helper_functions.inc.php	(revision 5909)
+++ /lib/helper_functions.inc.php	(revision 5911)
@@ -593,4 +593,6 @@
 		$TC->view['field_id'] = $field_id;
 		
+		if (wpsg_isSizedArray($TC->view['field_config']['inlineEdit_source'])) $TC->view['field_config']['inlineEdit_source'] = wpsg_prepare_for_inlineEdit($TC->view['field_config']['inlineEdit_source']);
+		
 		return $TC->render(WPSG_PATH_VIEW.'admin/form/text.phtml', false);
 		
Index: /lib/wpsg_remoteconnection.class.php
===================================================================
--- /lib/wpsg_remoteconnection.class.php	(revision 5911)
+++ /lib/wpsg_remoteconnection.class.php	(revision 5911)
@@ -0,0 +1,52 @@
+<?php
+
+    /**
+     * User: Daschmi (daschmi@daschmi.de)
+     * Date: 16.11.2016
+     * Time: 10:31
+     */
+
+    abstract class wpsg_remoteconnection
+    {
+   
+        /* Statische Funktionen */
+        
+        public static function handleConenctionString($strConnectionString, $filename, $file, $con_type = FTP_ASCII)
+        {
+            
+            if (preg_match('/^ftp/', $strConnectionString))
+            {
+                
+                $arPath = explode('/', $strConnectionString);
+                $arConnection = explode('@', $arPath[2]);
+                $arAccess = explode(':', $arConnection[0]);
+                
+                $host = $arConnection[1];
+                $username = $arAccess[0];
+                $password = $arAccess[1];
+                
+                $path = implode('/', array_slice($arPath, 3));
+                                
+                $connection = ftp_connect($host);                
+                if ($connection === false) throw new \Exception(wpsg_translate(__('Konnte keine Verbindung zu #1# aufbauen. (Host)', 'wpsg'), $host));
+                
+                $login_result = ftp_login($connection, $username, $password);
+                if ($login_result === false) throw new \Exception(wpsg_translate(__('Konnte keine Verbindung zu #1# aufbauen. (Zugangsdaten)', 'wpsg'), $host));
+                
+                ftp_pasv($connection, true);
+                
+                $trans = ftp_put($connection, $path.'/'.$filename, $file, $con_type);
+                
+                ftp_close($connection);
+                
+                return true;
+                
+            }
+            
+            return false;
+            
+        } // public static function handleConenctionString($connection, $file)
+        
+    } // class wpsg_mod_remoteconnection
+
+?>
Index: /model/wpsg_order.class.php
===================================================================
--- /model/wpsg_order.class.php	(revision 5909)
+++ /model/wpsg_order.class.php	(revision 5911)
@@ -1031,4 +1031,5 @@
 			$bJoinCustomer = false;
 			$bJoinInvoice = false;
+			$bJoinOrderAdress = false;
 
 			if (wpsg_isSizedInt($arFilter['k_id'])) $strQueryWHERE .= " AND O.`k_id` = '".wpsg_q($arFilter['k_id'])."' ";
@@ -1043,14 +1044,17 @@
 
 				$strQueryWHERE .= "
-					C.`vname` LIKE '%".wpsg_q($arFilter['s'])."%' OR
-					C.`name` LIKE '%".wpsg_q($arFilter['s'])."%' OR
-					C.`email` LIKE '%".wpsg_q($arFilter['s'])."%' OR
-					C.`firma` LIKE '%".wpsg_q($arFilter['s'])."%' OR
-					C.`ustidnr` LIKE '%".wpsg_q($arFilter['s'])."%' OR					
-					O.`onr` LIKE '%".wpsg_q($arFilter['s'])."%' OR
-					O.`id` = '".wpsg_q($arFilter['s'])."' OR
-					O.`custom_data` LIKE '%".wpsg_q($arFilter['s'])."%' 		
+					AND
+					(
+						OA.`vname` LIKE '%".wpsg_q($arFilter['s'])."%' OR
+						OA.`name` LIKE '%".wpsg_q($arFilter['s'])."%' OR
+						C.`email` LIKE '%".wpsg_q($arFilter['s'])."%' OR
+						OA.`firma` LIKE '%".wpsg_q($arFilter['s'])."%' OR
+						C.`ustidnr` LIKE '%".wpsg_q($arFilter['s'])."%' OR					
+						O.`onr` LIKE '%".wpsg_q($arFilter['s'])."%' OR
+						O.`id` = '".wpsg_q($arFilter['s'])."' 
+					)
 				";
 
+				$bJoinOrderAdress = true;
 				$bJoinCustomer = true;
 
@@ -1154,8 +1158,9 @@
 
 			// Optionale Joins
-			if ($bJoinProducts === true) $strQueryJOIN = " LEFT JOIN `".WPSG_TBL_ORDERPRODUCT."` AS OP ON (O.`id` = OP.`o_id`) ";
-			if ($bJoinCustomer === true) $strQueryJOIN = " LEFT JOIN `".WPSG_TBL_KU."` AS C ON (C.`id` = O.`k_id`) ";
-			if ($bJoinInvoice === true) $strQueryJOIN = " LEFT JOIN `".WPSG_TBL_RECHNUNGEN."` AS I ON (I.`o_id` =  O.`id` AND I.`storno` = '0000-00-00 00:00:00' AND I.`rnr` != '') ";
-
+			if ($bJoinProducts === true) $strQueryJOIN .= " LEFT JOIN `".WPSG_TBL_ORDERPRODUCT."` AS OP ON (O.`id` = OP.`o_id`) ";
+			if ($bJoinCustomer === true) $strQueryJOIN .= " LEFT JOIN `".WPSG_TBL_KU."` AS C ON (C.`id` = O.`k_id`) ";
+			if ($bJoinInvoice === true) $strQueryJOIN .= " LEFT JOIN `".WPSG_TBL_RECHNUNGEN."` AS I ON (I.`o_id` =  O.`id` AND I.`storno` = '0000-00-00 00:00:00' AND I.`rnr` != '') ";
+			if ($bJoinOrderAdress === true) $strQueryJOIN .= " LEFT JOIN `".WPSG_TBL_ADRESS."` AS OA ON (OA.`id` = O.`adress_id`) ";
+			
 			return array($strQuerySELECT, $strQueryWHERE, $strQueryJOIN, $strQueryHAVING, $strQueryORDER);
 
Index: /model/wpsg_order_product.class.php
===================================================================
--- /model/wpsg_order_product.class.php	(revision 5909)
+++ /model/wpsg_order_product.class.php	(revision 5911)
@@ -94,5 +94,7 @@
 		{
 			
-			if (wpsg_isSizedString($this->mod_vp_varkey))
+			$var_key = $this->mod_vp_varkey;
+			
+			if (wpsg_isSizedString($var_key))
 			{
 				
Index: /mods/wpsg_mod_export.class.php
===================================================================
--- /mods/wpsg_mod_export.class.php	(revision 5909)
+++ /mods/wpsg_mod_export.class.php	(revision 5911)
@@ -23,4 +23,7 @@
 		var $arFileEncoding = array();
 				
+		/** @var array Array mit den Cron Auswahloptionen */
+		var $arCronTypes = array();
+		
 		var $arCache = array();
 		
@@ -32,4 +35,10 @@
 		const FORMAT_CSV = '1';
 		const FORMAT_XML = '2';
+		
+		const CRON_OFF = '0';
+		const CRON_LIVE = '1';
+		const CRON_DAILY = '2';
+		const CRON_WEEKLY = '3';
+		const CRON_MONTHLY = '4';
 		
 		/**
@@ -62,4 +71,12 @@
 				self::ENCODING_UTF8 => __('UTF-8', 'wpsg'),
 				self::ENCODING_ISO88591 => __('ISO-8859-1', 'wpsg')
+			);
+			
+			$this->arCronTypes = array(
+				wpsg_mod_export::CRON_OFF => __('Nie', 'wpsg'),
+				wpsg_mod_export::CRON_LIVE => __('Mit jeder Cron AusfÃŒhrung'),
+                wpsg_mod_export::CRON_DAILY => __('TÃ€glich', 'wpsg'),
+                wpsg_mod_export::CRON_WEEKLY => __('WÃ¶chentlich', 'wpsg'),
+                wpsg_mod_export::CRON_MONTHLY => __('Monatlich', 'wpsg')	
 			);
 			
@@ -90,6 +107,14 @@
 		   	  	order_onetime INT(1) NOT NULL COMMENT 'Bestellungen nur einmal exportieren',
 		   	  	csv_fieldnames INT(1) NOT NULL COMMENT 'Beim CSV Export die Feldnamen in erster Zeile auffÃŒhren',
+		   	  	cron_interval INT(1) NOT NULL DEFAULT '0' COMMENT 'Cron Eisntellunge (Inaktiv/Intervall)',
+		   	  	cron_path VARCHAR(500) NOT NULL COMMENT 'Pfad in dem die automatischen Dateien abgelegt werden',
+		   	  	cron_lastrun DATE NOT NULL COMMENT 'Letzte AusfÃŒhrung des Crons',
+		   	  	orderfilter TEXT NOT NULL COMMENT 'Serialisizerter Bestellfilter',
+		   	  	xml_roottag TEXT NOT NULL COMMENT 'Tagname des XML Root Elements',
+		   	  	xml_ordertag TEXT NOT NULL COMMENT 'Tagname des XML Bestellung Elements',
+		   	  	xml_productroottag TEXT NOT NULL COMMENT 'Tagname des XML Produkt Rootelements',
+		   	  	xml_producttag TEXT NOT NULL COMMENT 'Tagname des Produkt Elements',
 		   	  	file_encoding INT(1) NOT NULL COMMENT 'Encoding der Datei',		   	  	
-		   		PRIMARY KEY  (id)
+		   	  	PRIMARY KEY  (id)
 		   	) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;";
 		   	
@@ -106,5 +131,5 @@
 				value_key VARCHAR(255) NOT NULL COMMENT 'Der SchlÃŒssel, mit dem der Wert gefÃŒllt wird',
 				format INT(2) NOT NULL COMMENT 'Zellenformat',
-				xml_exporttype INT(1) NOT NULL COMMENT 'Tag oder Attributexport',
+				xml_att INT(1) NOT NULL COMMENT 'Tag oder Attributexport',
 				userformat VARCHAR(255) NOT NULL COMMENT 'Benutzerdefiniertes Format',
 				clear_spaces INT(1) NOT NULL COMMENT 'Leerzeichen entfernen',
@@ -137,5 +162,5 @@
 			
 		} // public function profilList()
-		
+						
 		public function handleExport()
 		{
@@ -144,6 +169,9 @@
 			
 			parse_str($_REQUEST['filter'], $filter);
+			if (!wpsg_isSizedArray($filter['filter'])) $filter['filter'] = array();
+
 			$arData = wpsg_order::find($filter['filter']);
-			 			
+			$arFiles = array();
+            
 			if (sizeof($arProfile) >= 1)
 			{
@@ -154,154 +182,67 @@
 				{
 					
-					$tmpfname = tempnam($this->getTmpFilePath(), "wpsg");
-					$filehandler = fopen($tmpfname, 'w');
-					
-					$profil = $this->loadProfil($profil_id);
-				 
-					$arExportData = array();
-					
-					if ($profil['format'] == self::FORMAT_CSV && $profil['csv_fieldnames'] == '1')
-					{
-						
-						$row = array();
-						
-						foreach ($profil['fields'] as $f)
-						{
-							
-							$row[] = $f['name'];
-							
-						}
-						
-						$arExportData[] = $row;
-						
-					}
-					
-					foreach ($arData as $oOrder) 
-					{
-						
-						if ($profil['order_online'] == '1')
-						{
-						
-							foreach ($profil['fields'] as $f) 
-							{
-
-								$row[] = $this->getValue($f, $profil['field_delimiter'], $oOrder->id);
-								
-							}
-							
-							$arExportData[] = $row; 
-							
-						}
-						else 
-						{
-							
-							$arProdukte = $this->db->fetchAssoc("
-								SELECT 
-									OP.`p_id`, 
-									OP.`productkey`, 
-									OP.`product_index`,
-									OP.`id` AS `order_product_id`
-								FROM 
-									`".WPSG_TBL_ORDERPRODUCT."` AS OP 
-								WHERE 
-									OP.`o_id` = '".wpsg_q($oOrder->id)."'
-							");
-							
-							foreach ($arProdukte as $p)
-							{
-							
-								$row = array();
-								
-								foreach ($profil['fields'] as $f)
-								{
-
-									$row[] = $this->getValue($f, $profil['field_delimiter'], $oOrder->id, $p['p_id'], $p['product_index'], $p['productkey'], $p['order_product_id']);
-																		
-								}
-
-								$arExportData[] = $row; 
-								
-							}
-							
-						}
-						
-					} // foreach arData
-										
-					foreach ($arExportData as $row)
-					{
-						
-						if ($profil['format'] == self::FORMAT_CSV)
-						{
-							
-							fputcsv($filehandler, $row, $profil['field_delimiter']);
-							
-						}
-						
-					}
-					
-					fclose($filehandler);
-					
-					// In ISO wandeln
-					if ($profil['file_encoding'] == self::ENCODING_ISO88591)
-					{
-						
-						file_put_contents($tmpfname, utf8_decode(file_get_contents($tmpfname)));
-												
-					}
-					
-					$arFiles[] = array(strval($profil['filename']), $tmpfname);
-					
-				} // foreach profile
-				 				
-				if (sizeof($arFiles) == 1 && $profil['format'] == self::FORMAT_CSV)
-				{
-					
-					header("Content-Type: text/csv"); 
-					header("Content-Disposition: attachment; filename=".$arFiles[0][0]); 
-					header("Pragma: no-cache"); 
-					header("Expires: 0"); 
-					
-					die(file_get_contents($arFiles[0][1]));
-						
-				}
-				else if (sizeof($arFiles) > 1)
-				{
-					
-					$zip = new ZipArchive();
-					
-					$tmpfname = tempnam($this->getTmpFilePath(), "wpsg").'.zip';			
-
-					if ($zip->open($tmpfname, ZIPARCHIVE::CREATE) == true) 
-					{
-    
-						foreach ($arFiles as $f)
-						{
-						
-							$zip->addFile($f[1], $f[0]);
-							
-						}
-						
-						$zip->close();
-						
-						header("Content-Type: application/octet-stream"); 
-						header("Content-Disposition: attachment; filename=export.zip"); 
-						header("Pragma: no-cache"); 
-						header("Expires: 0"); 
-						
-						die(file_get_contents($tmpfname));
-						
-					}
-					else
-					{
-						
-						throw new \Exception(__('Konnte Zip Archiv nicht erstellen!', 'wpsg'));
-						
-					}
-					
-				} 
+                    $profil = $this->loadProfil($profil_id);
+                    
+                    if ($profil['format'] == self::FORMAT_CSV) $file = $this->handleExportCSV($profil_id);
+                    else if ($profil['format'] == self::FORMAT_XML) $file = $this->handleExportXML($profil_id);
+                 
+                    $arFiles[] = array(
+                        $file,
+                        $profil['filename'],
+                        $profil['cron_path']
+                    );
+                    
+                }
 				
 			} 
-			 
-			$this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order');
+            
+            if (sizeof($arFiles) > 1)
+            {
+                
+                // Zip erstellen und ablegen
+                $zip = new ZipArchive();					
+                $tmpfname = tempnam($this->getTmpFilePath(), "wpsg");
+                
+                if ($zip->open($tmpfname, ZIPARCHIVE::CREATE) == true) 
+                {
+
+                    foreach ($arFiles as $f)
+                    {
+                    
+                        $zip->addFile($f[0], $f[1]);
+                        
+                    }
+                    
+                    $zip->close();
+                    
+                    header("Content-Type: application/octet-stream"); 
+                    header("Content-Disposition: attachment; filename=export.zip"); 
+                    header("Pragma: no-cache"); 
+                    header("Expires: 0"); 
+                    
+                    die(file_get_contents($tmpfname));
+                    
+                }
+                else
+                {
+                    
+                    throw new \Exception(__('Konnte Zip Archiv nicht erstellen!', 'wpsg'));
+                    
+                }
+
+            }
+            else
+            {
+            
+                header("Content-Type: text/csv"); 
+                header("Content-Disposition: attachment; filename=".$arFiles[0][0]); 
+                header("Pragma: no-cache"); 
+                header("Expires: 0"); 
+                    
+                die(file_get_contents($arFiles[0][0]));
+                    
+            }
+             
+            $this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order');
 			
 		} // public function handleExport()
@@ -416,6 +357,7 @@
 						case 'field_userformat': $col = 'userformat'; break;
 						case 'field_typ': $col = 'value_key'; break;
-						
-						default: throw new \Exception(__('UngÃŒltiger Feldname', 'wpsg'));
+						case 'field_xml_att': $col = 'xml_att'; break;
+						
+						default: throw new \Exception(__('UngÃŒltiger Feldname (Feld)', 'wpsg'));
 							
 					}
@@ -426,4 +368,36 @@
 					
 					echo $this->db->fetchOne("SELECT `".wpsg_q($col)."` FROM `".WPSG_TBL_EXPORTPROFILE_FIELDS."` WHERE `id` = '".wpsg_q($field_id)."' "); 
+					exit;
+					
+				}
+				else if (preg_match('/orderfilter_/', $_REQUEST['name']))
+				{
+					
+					// Wert aus dem Bestellfilter wurde bearbeitet					
+					$col = substr($_REQUEST['name'], 12);
+								
+					switch ($col) 
+					{
+						
+						case 's': $col = 's'; break;
+						case 'k_id': $col = 'k_id'; break;
+						case 'status': $col = 'status'; break;
+						case 'cdate_m': $col = 'cdate_m'; break;
+						case 'cdate_y': $col = 'cdate_y'; break;
+						case 'invoicedate_m': $col = 'invoicedate_m'; break;
+											
+						default: throw new \Exception(__('UngÃŒltiger Feldname (Bestellfilter)', 'wpsg'));
+							
+					}
+					
+					$orderfilter = $this->db->fetchOne("SELECT `orderfilter` FROM `".WPSG_TBL_EXPORTPROFILE."` WHERE `id` = '".wpsg_q($_REQUEST['profil_id'])."' ");
+					$orderfilter = @unserialize($orderfilter);
+					if (!is_array($orderfilter)) $orderfilter = array();
+					
+					$orderfilter[$col] = $_REQUEST['value'];
+					
+					$this->db->UpdateQuery(WPSG_TBL_EXPORTPROFILE, array('orderfilter' => wpsg_q(serialize($orderfilter))), " `id` = '".wpsg_q($_REQUEST['profil_id'])."' ");
+					
+					echo $orderfilter[$col];
 					exit;
 					
@@ -447,6 +421,12 @@
 					case 'field_escape': $col = 'field_escape'; break;
 					case 'order_onetime': $col = 'order_onetime'; break;
-										
-					default: throw new \Exception(__('UngÃŒltiger Feldname', 'wpsg'));
+					case 'cron_interval': $col = 'cron_interval'; break;
+					case 'cron_path': $col = 'cron_path'; break;
+					case 'xml_roottag': $col = 'xml_roottag'; break;
+					case 'xml_ordertag': $col = 'xml_ordertag'; break;
+					case 'xml_productroottag': $col = 'xml_productroottag'; break;
+					case 'xml_producttag': $col = 'xml_producttag'; break;
+															
+					default: throw new \Exception(__('UngÃŒltiger Feldname (Profil)', 'wpsg'));
 					
 				}
@@ -523,6 +503,499 @@
 		} // public function be_ajax()
 		
+		public function cron() 
+		{ 
+			
+			// Alle Profile laden, die automatisiert aufgerufen werden
+			$arProfile = $this->db->fetchAssoc("
+				SELECT
+					EXP.`id`, EXP.`cron_interval`, EXP.`cron_lastrun`, EXP.`orderfilter`, EXP.`cron_path`, EXP.`filename`, EXP.`format`
+				FROM
+					`".WPSG_TBL_EXPORTPROFILE."` AS EXP 
+				WHERE
+					EXP.`cron_interval` > 0
+			");
+			
+			foreach ($arProfile as $profil)
+			{
+				
+				if ($profil['cron_lastrun'] == '0000-00-00') $cron_lastrun = 0;
+				else $cron_lastrun = strtotime($profil['cron_lastrun']);
+				
+				$bRun = false;
+				
+				if ($cron_lastrun <= 0) $bRun = true;
+				else 
+				{
+					
+					switch ($profil['cron_interval'])
+					{
+						
+						case self::CRON_LIVE: 
+							
+							$bRun = true;
+							break;
+						
+						case self::CRON_DAILY:
+							
+							if (strtotime("+1 day", $cron_lastrun) < time()) $bRun = true;
+							break;
+						
+						case self::CRON_MONTHLY:
+							
+							if (strtotime("+1 month", $cron_lastrun) < time()) $bRun = true;
+							break;
+						
+						case self::CRON_WEEKLY:
+							
+							if (strtotime("+1 week", $cron_lastrun) < time()) $bRun = true;
+							break;
+						
+					}
+					
+				}
+				
+				if ($bRun === true)
+				{
+					
+					$aOrderrFilter = @unserialize($profil['orderfilter']);
+					if (!wpsg_isSizedArray($aOrderrFilter)) $aOrderrFilter = array();
+					
+                    if ($profil['format'] == self::FORMAT_CSV)
+                    {
+                        
+                        $file = $this->handleExportCSV($profil['id'], $aOrderrFilter);
+                        
+                    }
+                    else if ($profil['format'] == self::FORMAT_XML)
+                    {
+                     
+                        $file = $this->handleExportXML($profil['id'], $aOrderrFilter);
+                        
+                    } 
+                    
+                    if (wpsg_remoteconnection::handleConenctionString($profil['cron_path'], $profil['filename'], $file) !== true) file_put_contents($file, file_get_contents($profil['filename']));
+										
+				}
+				
+			}
+			
+		} // public function cron()
+		
 		/* Modulfunktionen */
 
+        /**
+         * Gibt den TemporÃ€ren Dateinamen zurÃŒck
+         * 
+         * @param $profil_id
+         * @param array $arOrderFilter
+         */
+		private function handleExportCSV($profil_id, $arOrderFilter = array())
+		{
+			
+			$this->loadFields();
+			
+			$arData = wpsg_order::find($arOrderFilter);
+			$arFiles = array(); 	
+												
+            $tmpfname = tempnam($this->getTmpFilePath(), "wpsg");
+            $filehandler = fopen($tmpfname, 'w');
+            
+            $profil = $this->loadProfil($profil_id);
+            
+            $arExportData = array();
+            
+            if ($profil['format'] == self::FORMAT_CSV && $profil['csv_fieldnames'] == '1')
+            {
+                
+                $row = array();
+                
+                foreach ($profil['fields'] as $f)
+                {
+                    
+                    $row[] = $f['name'];
+                    
+                }
+                
+                $arExportData[] = $row;
+                
+            }
+            
+            foreach ($arData as $oOrder) 
+            {
+                
+                if ($profil['order_online'] == '1')
+                {
+                
+                    foreach ($profil['fields'] as $f) 
+                    {
+
+                        $row[] = $this->getValue($f, $profil['field_delimiter'], $oOrder->id);
+                        
+                    }
+                    
+                    $arExportData[] = $row; 
+                    
+                }
+                else 
+                {
+                    
+                    $arProdukte = $this->db->fetchAssoc("
+                        SELECT 
+                            OP.`p_id`, 
+                            OP.`productkey`, 
+                            OP.`product_index`,
+                            OP.`id` AS `order_product_id`
+                        FROM 
+                            `".WPSG_TBL_ORDERPRODUCT."` AS OP 
+                        WHERE 
+                            OP.`o_id` = '".wpsg_q($oOrder->id)."'
+                    ");
+                    
+                    foreach ($arProdukte as $p)
+                    {
+                    
+                        $row = array();
+                        
+                        foreach ($profil['fields'] as $f)
+                        {
+
+                            $row[] = $this->getValue($f, $profil['field_delimiter'], $oOrder->id, $p['p_id'], $p['product_index'], $p['productkey'], $p['order_product_id']);
+                                                                
+                        }
+
+                        $arExportData[] = $row; 
+                        
+                    }
+                    
+                }
+                
+            } // foreach arData
+             
+            foreach ($arExportData as $row)
+            {
+                
+                if ($profil['format'] == self::FORMAT_CSV)
+                {
+                    
+                    fputcsv($filehandler, $row, $profil['field_delimiter'], $profil['field_enclosure'], $profil['field_escape']);
+                    
+                }
+                
+            }
+            
+            fclose($filehandler);
+            
+            // In ISO wandeln
+            if ($profil['file_encoding'] == self::ENCODING_ISO88591)
+            {
+                
+                file_put_contents($tmpfname, utf8_decode(file_get_contents($tmpfname)));
+                                        
+            }
+                        
+            return $tmpfname;
+            
+			/*			
+			if (sizeof($arFiles) > 1)
+			{
+				
+				// Zip erstellen und ablegen
+				$zip = new ZipArchive();					
+				$tmpfname = tempnam($this->getTmpFilePath(), "wpsg");
+				
+				if ($zip->open($tmpfname, ZIPARCHIVE::CREATE) == true) 
+				{
+
+					foreach ($arFiles as $f)
+					{
+					
+						$zip->addFile($f[1], $f[0]);
+						
+					}
+					
+					$zip->close();
+					
+					header("Content-Type: application/octet-stream"); 
+					header("Content-Disposition: attachment; filename=export.zip"); 
+					header("Pragma: no-cache"); 
+					header("Expires: 0"); 
+					
+					die(file_get_contents($tmpfname));
+					
+				}
+				else
+				{
+					
+					throw new \Exception(__('Konnte Zip Archiv nicht erstellen!', 'wpsg'));
+					
+				}
+
+			}
+			else
+			{
+			
+				if ($cron === false)
+				{
+				
+					header("Content-Type: text/csv"); 
+					header("Content-Disposition: attachment; filename=".$arFiles[0][0]); 
+					header("Pragma: no-cache"); 
+					header("Expires: 0"); 
+					
+					die(file_get_contents($arFiles[0][1]));
+					
+				}
+				else
+				{
+					
+					if (wpsg_remoteconnection::handleConenctionString($arFiles[0][2], $arFiles[0][3], $arFiles[0][1]) !== true) file_put_contents($arFiles[0][2], file_get_contents($arFiles[0][1]));
+					
+				}
+				
+			}
+			*/
+			
+		} // private function handleExportCSV($arProfile, $arOrderFilter = array(), $cron = false)
+
+        /**
+         * Erstellt die XML und gibt den Pfad zur erstellten Datei zurÃŒck
+         * 
+         * @param $arProfile
+         * @param array $arOrderFilter
+         */
+		private function handleExportXML($profil_id, $arOrderFilter = array())
+		{
+			
+			$this->loadFields();
+			
+			$arData = wpsg_order::find($arOrderFilter);
+			$arFiles = array(); 	
+												
+            $profil = $this->loadProfil($profil_id);
+            
+            if (!wpsg_isSizedString($profil['xml_roottag'])) throw new \Exception(wpsg_translate(__('Kein XML Root Tagname fÃŒr Profil "#1#" gesetzt!', 'wpsg'), $profil['name']));
+            if (!wpsg_isSizedString($profil['xml_ordertag'])) throw new \Exception(wpsg_translate(__('Kein XML Bestellung Tagname fÃŒr Profil "#1#" gesetzt!', 'wpsg'), $profil['name']));
+            if (!wpsg_isSizedString($profil['xml_productroottag'])) throw new \Exception(wpsg_translate(__('Kein XML Produkt Roottagname fÃŒr Profil "#1#" gesetzt!', 'wpsg'), $profil['name']));
+            if (!wpsg_isSizedString($profil['xml_producttag'])) throw new \Exception(wpsg_translate(__('Kein XML Produkt Tagname fÃŒr Profil "#1#" gesetzt!', 'wpsg'), $profil['name']));
+            
+            $doc = new DOMDocument('1.0');
+            $doc->formatOutput = true;
+            
+            $root = $doc->createElement($this->clearXML($profil['xml_roottag']));					
+            $root = $doc->appendChild($root);
+            
+            foreach ($arData as $oOrder)
+            {
+                
+                $tag_order = $doc->createElement($this->clearXML($profil['xml_ordertag']));
+                $tag_order = $root->appendChild($tag_order);
+                 
+                $tag_product_root = false; 
+                
+                if (wpsg_isSizedString($profil['xml_productroottag']))
+                {
+                    
+                    $tag_product_root = $doc->createElement($this->clearXML($profil['xml_productroottag']));
+                    $tag_product_root = $tag_order->appendChild($tag_product_root);
+                                                
+                }
+                
+                foreach ($profil['fields'] as $f)
+                {
+                    
+                    // Wert ist kein Produktfeld
+                    if ($this->getFieldGroup($f['value_key']) != 20)
+                    {
+                        
+                        $value = $this->getValue($f, $profil['field_delimiter'], $oOrder->id);
+                                                    
+                        if (wpsg_isSizedInt($f['xml_att']))
+                        {
+                            
+                            $att = $doc->createAttribute($this->clearXML($f['name']));
+                            $att->value = htmlspecialchars($value);
+                            
+                            $tag_order->appendChild($att);
+
+                            
+                        }
+                        else
+                        {
+                            
+                            $tag = $doc->createElement($this->clearXML($f['name']));
+                            $tag = $tag_order->appendChild($tag);
+                            
+                            $tag_value = $doc->createTextNode(htmlspecialchars($value));
+                            $tag->appendChild($tag_value);
+                            
+                        }
+                        
+                    }
+                    
+                }
+                
+                // Produkte
+                $arOrderProducts = $oOrder->getOrderProducts();
+                
+                foreach ($arOrderProducts as $oOrderProduct)
+                {
+                    
+                    $tag_product = false;
+                    
+                    foreach ($profil['fields'] as $f)
+                    {
+                                                        
+                        // Wert ist ein Produktfeld
+                        if ($this->getFieldGroup($f['value_key']) == 20)
+                        {
+                                        
+                            if ($tag_product === false) $tag_product = $doc->createElement($this->clearXML($profil['xml_producttag']));
+                            
+                            $value = $this->getValue($f, $profil['field_delimiter'], $oOrder->id, $oOrderProduct->getProductId(), $oOrderProduct->getProductIndex(), $oOrderProduct->getProductKey());
+                        
+                            if (wpsg_isSizedInt($f['xml_att']))
+                            {
+                                
+                                $att = $doc->createAttribute($this->clearXML($f['name']));
+                                $att->value = htmlspecialchars($value);
+                                
+                                $tag_product->appendChild($att);
+
+                                
+                            }
+                            else
+                            {
+                                
+                                $tag = $doc->createElement($this->clearXML($f['name']));
+                                $tag = $tag_product->appendChild($tag);
+                                
+                                $tag_value = $doc->createTextNode(htmlspecialchars($value));
+                                $tag->appendChild($tag_value);
+                                
+                            }
+                            
+                        }
+                    }
+                    
+                    if ($tag_product !== false)
+                    {
+                        
+                        $tag_product_root->appendChild($tag_product);
+                        
+                    }
+                    
+                } // foreach Produkte
+                 
+            } // foreach Order
+            
+            $tmpfname = tempnam($this->getTmpFilePath(), "wpsg");
+            file_put_contents($tmpfname, $doc->saveXML());
+            
+            // In ISO wandeln
+            if ($profil['file_encoding'] == self::ENCODING_ISO88591)
+            {
+                
+                file_put_contents($tmpfname, utf8_decode(file_get_contents($tmpfname)));
+                                        
+            }
+            
+            return $tmpfname;
+              
+            /*
+			if (sizeof($arFiles) > 1)
+			{
+				
+				// Zip erstellen und ablegen
+				$zip = new ZipArchive();					
+				$tmpfname = tempnam($this->getTmpFilePath(), "wpsg");
+				
+				if ($zip->open($tmpfname, ZIPARCHIVE::CREATE) == true) 
+				{
+
+					foreach ($arFiles as $f)
+					{
+					
+						$zip->addFile($f[1], $f[0]);
+						
+					}
+					
+					$zip->close();
+					
+					header("Content-Type: application/octet-stream"); 
+					header("Content-Disposition: attachment; filename=export.zip"); 
+					header("Pragma: no-cache"); 
+					header("Expires: 0"); 
+					
+					die(file_get_contents($tmpfname));
+					
+				}
+				else
+				{
+					
+					throw new \Exception(__('Konnte Zip Archiv nicht erstellen!', 'wpsg'));
+					
+				}
+
+			}
+			else
+			{
+			
+				if ($cron === false)
+				{
+				
+					header("Content-Type: text/xml"); 
+					header("Content-Disposition: attachment; filename=".$arFiles[0][0]); 
+					header("Pragma: no-cache"); 
+					header("Expires: 0"); 
+					
+					die(file_get_contents($arFiles[0][1]));
+					
+				}
+				else
+				{
+					
+					if (wpsg_remoteconnection::handleConenctionString($arFiles[0][2], $arFiles[0][3], $arFiles[0][1]) !== true) file_put_contents($arFiles[0][2], file_get_contents($arFiles[0][1]));
+					
+				}
+				
+			} 
+            */
+			
+		} // private function handleExportXML($arProfile, $arOrderFilter = array(), $cron = false)
+
+		/**
+		 * Bereinigt Daten an XML fÃŒr Tagname / Attributname
+		 */
+		private function clearXML($value)
+		{
+			
+			$value = preg_replace('/\040+/', '_', $value);
+			$value = preg_replace('/\"|\<|\>|\'/', '', $value);
+			
+			return htmlspecialchars($value);
+			
+		}
+		
+		private function getFieldGroup($key)
+		{
+			
+			if (!wpsg_isSizedArray($this->fields)) $this->loadFields();
+			
+			foreach ($this->fields as $group_key => $group)
+			{
+				
+				foreach ($group['fields'] as $field_key => $field_label)
+				{
+					
+					if ($field_key == $key) return $group_key;
+					
+				}
+				
+			}
+			
+			return false;
+			
+		}
+		
 		public function renderProfil($profil_id)
 		{
@@ -531,8 +1004,12 @@
 												
 			$this->shop->view['profil'] = $this->loadProfil($profil_id);
-													
+									
+			$this->shop->view['cdate_years'] = $this->db->fetchAssocField("SELECT DISTINCT DATE_FORMAT(`cdate`, '%Y') FROM `".WPSG_TBL_ORDER."` ORDER BY `cdate` ASC ");
+			if ($this->shop->hasMod('wpsg_mod_rechnungen')) $this->shop->view['invoicedate_years'] = $this->db->fetchAssocField("SELECT DISTINCT DATE_FORMAT(`datum`, '%Y') FROM `".WPSG_TBL_RECHNUNGEN."` WHERE `storno` = '0000-00-00' AND `gnr` = '' ORDER BY `datum` ASC ");
+			
 			$this->shop->view['arExportFormats'] = $this->arExportFormats;
 			$this->shop->view['arFileEncoding'] = $this->arFileEncoding;				
 			$this->shop->view['arFieldFormats'] = $this->arFieldFormats;
+			$this->shop->view['arCronTypes'] = $this->arCronTypes;
 			$this->shop->view['fields'] = $this->fields;
 			$this->shop->view['strFields'] = $this->renderFields($this->shop->view['profil']);
@@ -566,4 +1043,8 @@
 			
 			$arReturn = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_EXPORTPROFILE."` WHERE `id` = '".wpsg_q($profil_id)."' ");
+			
+			$arReturn['orderfilter'] = @unserialize($arReturn['orderfilter']);			
+			if (!is_array($arReturn['orderfilter'])) $arReturn['orderfilter'] = array();
+						
 			$arReturn['fields'] = $this->db->fetchAssoc("SELECT * FROM `".WPSG_TBL_EXPORTPROFILE_FIELDS."` WHERE `profil_id` = '".wpsg_q($profil_id)."' ORDER BY `pos` ASC, `id` ASC ", "id");
 			
@@ -1048,12 +1529,5 @@
 				case 'order_price': 
 					
-					if (!is_array($order['custom_data']['basket']))
-					{
-						$return = wpsg_ff($order['price_gesamt']);	
-					}
-					else
-					{					
-						$return = wpsg_ff($order['custom_data']['basket']['sum']['preis_gesamt_brutto'], $this->shop->get_option('wpsg_currency'));
-					}
+					$return = wpsg_ff($order['custom_data']['basket']['sum']['preis_gesamt_brutto']);
 					 
 					break;
@@ -1061,5 +1535,5 @@
 				case 'order_price_netto': 
 					
-					$return = wpsg_ff($order['custom_data']['basket']['sum']['preis_gesamt_netto'], $this->shop->get_option('wpsg_currency'));						
+					$return = wpsg_ff($order['custom_data']['basket']['sum']['preis_gesamt_netto']);						
 					
 					break;
Index: /views/admin/form/text.phtml
===================================================================
--- /views/admin/form/text.phtml	(revision 5909)
+++ /views/admin/form/text.phtml	(revision 5911)
@@ -9,5 +9,5 @@
             <span <?php echo ((wpsg_isSizedString($this->view['field_id']))?' id="'.$this->view['field_id'].'" ':''); ?>><?php echo $this->view['field_value']; ?></span>
             <?php } else { ?>
-			<p <?php echo ((wpsg_isSizedString($this->view['field_id']))?' id="'.$this->view['field_id'].'" ':''); ?> class="form-control-static" style="padding-left:0px;"><?php echo $this->view['field_value']; ?></p>
+			<p <?php echo ((wpsg_isSizedString($this->view['field_id']))?' id="'.$this->view['field_id'].'" ':''); ?> class="form-control-static"><?php echo $this->view['field_value']; ?></p>
             <?php } ?>
 				
@@ -24,10 +24,13 @@
 
             jQuery('#<?php echo $this->view['field_id']; ?>').wspg_editable('<?php echo $this->view['field_config']['inlineEdit_url']; ?>', {
+                'placement': 'bottom'
                 <?php if (wpsg_isSizedString($this->view['field_config']['inlineEdit_type'])) { ?>
-                'type': '<?php echo $this->view['field_config']['inlineEdit_type']; ?>',
-                'placement': 'bottom'
+                ,'type': '<?php echo $this->view['field_config']['inlineEdit_type']; ?>'                
                 <?php } ?>
-                <?php if (wpsg_isSizedArray($this->view['field_config']['inlineEdit_source'])) { ?>
-                ,'data': <?php echo json_encode($this->view['field_config']['inlineEdit_source']); ?>
+                <?php if (wpsg_isSizedString($this->view['field_config']['inlineEdit_source'])) { ?>
+                , 'data': <?php echo $this->view['field_config']['inlineEdit_source']; ?>
+                <?php } ?>
+                <?php if (wpsg_isSizedString($this->view['field_config']['inlineEdit_callback'])) { ?>
+                , 'callback': function(response, newValue) { <?php echo $this->view['field_config']['inlineEdit_callback']; ?>(response, newValue); }
                 <?php } ?>
             } );
Index: /views/css/admin.css
===================================================================
--- /views/css/admin.css	(revision 5909)
+++ /views/css/admin.css	(revision 5911)
@@ -46,4 +46,5 @@
 #wpsg-bs .info { font-style:italic; }
 #wpsg-bs .tab-pane { padding-top:15px; }
+#wpsg-bs fieldset > legend { padding-top:2rem; text-align:right; }
 
 /* Allgemeine Klassen */
Index: /views/js/editable.js
===================================================================
--- /views/js/editable.js	(revision 5909)
+++ /views/js/editable.js	(revision 5911)
@@ -26,43 +26,22 @@
             if (typeof options.type == "string") opt['type'] = options.type;
 
-            if (options.type == "select" && typeof options.data == "string")
-            {
- 
-                var ar = [];
-                var arData = jQuery.parseJSON(options.data);
-                var strValue = jQuery(this).html();
-                var value = 0;
-                
-                for (var i in arData)
-                {
-                    
-                    ar.push( { 'value': i, 'text': arData[i] } );
-                    if (arData[i] == strValue) value = i;
-                    
-                }
-                                
-                // Normale Ãbergabe eines JSON Strings
-                opt.source = ar;
-                opt.type = 'select';
-                opt.value = value;
-
-            }
-			else if (options.type == "select" && typeof options.data == "object")
+			if (options.type == "select" && Array.isArray(options.data))
 			{
-				
-				var value = 0;
+			 	 
+				var value = "0";
 				var strValue = jQuery(this).html();
 				
 				for (var i in options.data)
 				{
-					
-					if (options.data[i] == strValue) value = i;
+				
+					if (options.data[i].text == strValue) value = options.data[i].value;
 					
 				}
 				
 				opt.source = options.data;
-				opt.value = value
+                opt.type = 'select';
+                opt.value = value;
 				
-			}
+			}			 
             else if (options.type == 'multiarray')
             {
@@ -70,4 +49,5 @@
                 var ar = [];
                 var arData = jQuery.parseJSON(options.data);
+				var strValue = jQuery(this).html();
  
                 for (var i in arData)
@@ -81,4 +61,6 @@
                         objData['children'].push( { 'value': j, 'text': arData[i]['fields'][j] } );
 
+						if (arData[i]['fields'][j] == strValue) value = j;
+						
                     }
 
@@ -89,27 +71,6 @@
                 opt.source = ar;
                 opt.type = 'select';
+				opt.value = j;
 
-            }			
-			else if (options.type == 'string' && typeof options.data == "string")
-            {
-
-				var ar = [];
-				var arData = jQuery.parseJSON(options.data);
-
-				for (var i in arData)
-				{
-				
-					ar.push( { 
-						'value': i,
-						'text': arData[i]
-					} );
-					
-					if (arData[i] == jQuery(this).text()) opt.value = i;
-					
-				}
-				
-				opt.type = 'select';
-				opt.source = ar;
-				
 			}
 			else
Index: /views/mods/mod_export/fields.phtml
===================================================================
--- /views/mods/mod_export/fields.phtml	(revision 5909)
+++ /views/mods/mod_export/fields.phtml	(revision 5911)
@@ -16,4 +16,8 @@
             <th class="wpsg_mod_export_col_value"><?php echo __('Wert', 'wpsg'); ?></th>
             <th class="wpsg_mod_export_col_format"><?php echo __('Format', 'wpsg'); ?></th>
+            
+            <th style="display:<?php echo (($this->view['profil']['format'] == wpsg_mod_export::FORMAT_XML)?'table-cell':'none'); ?>;" title="<?php echo __('Feld im XML als Attribut exportieren', 'wpsg'); ?>" class="wpsg_mod_export_format wpsg_mod_export_format_<?php echo wpsg_mod_export::FORMAT_XML; ?> wpsg_mod_export_col_att"><?php echo __('Att'); ?></th>            
+            <th style="display:<?php echo (($this->view['profil']['format'] != wpsg_mod_export::FORMAT_XML)?'table-cell; padding:0px':'none'); ?>;" class="wpsg_mod_export_format wpsg_mod_export_format_<?php echo wpsg_mod_export::FORMAT_CSV; ?>">&nbsp;</th>
+            
             <th class="wpsg_mod_export_col_remove">
                 
@@ -55,5 +59,13 @@
                 <div class="wpsg_editable" id="field_format_<?php echo $f_id; ?>"><?php echo $this->view['arFieldFormats'][$f['format']]; ?></div>
             
+            </td> 
+            
+            <td style="display:<?php echo (($this->view['profil']['format'] == wpsg_mod_export::FORMAT_XML)?'table-cell':'none'); ?>;" class="wpsg_mod_export_col_att wpsg_mod_export_format wpsg_mod_export_format_<?php echo wpsg_mod_export::FORMAT_XML; ?>">
+                
+                <input type="checkbox" onchange="wpsg_mod_export_setAtt(this, <?php echo $f['id']; ?>);" value="1" <?php echo ((wpsg_isSizedInt($f['xml_att']))?'checked="checked"':''); ?> />
+                                
             </td>
+            <td style="display:<?php echo (($this->view['profil']['format'] != wpsg_mod_export::FORMAT_XML)?'table-cell; padding:0px':'none'); ?>;" class="wpsg_mod_export_format wpsg_mod_export_format_<?php echo wpsg_mod_export::FORMAT_CSV; ?>">&nbsp;</td>
+                        
             <td>
                 
@@ -64,5 +76,5 @@
         </tr>
         <tr id="userformatrow_<?php echo $f_id; ?>" style="<?php echo (($f['format'] != 700)?'display:none;':''); ?>" class="wpsg_mod_export_row2 wpsg_tablerow wpsg_mod_export_fieldrow_<?php echo $f_id; ?> <?php echo (($i % 2 == 0)?'odd':'even'); ?>">
-            <td class="wpsg_mod_export_col_format_user" colspan="3">
+            <td class="wpsg_mod_export_col_format_user" colspan="4">
             
                 <?php echo __('Format', 'wpsg'); ?>:
@@ -88,5 +100,5 @@
                         jQuery('#field_format_<?php echo $f_id; ?>').wspg_editable('<?php echo $inlineEdit_url; ?>', {
                             'type': 'select',
-                            'data': <?php echo json_encode($this->view['arFieldFormats']); ?>,
+                            'data': <?php echo wpsg_prepare_for_inlineEdit($this->view['arFieldFormats']); ?>,
                             'callback': function(response, newValue) {
                                 
@@ -111,5 +123,5 @@
 
 <script type="text/javascript">/* <![CDATA[ */
-
+    
     wpsg_ajaxBind();
 
Index: /views/mods/mod_export/profil.phtml
===================================================================
--- /views/mods/mod_export/profil.phtml	(revision 5909)
+++ /views/mods/mod_export/profil.phtml	(revision 5911)
@@ -5,5 +5,5 @@
 	 */
 
-	$inlineEdit_url = WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_export&do=inlinedit&noheader=1&profil_id='.$this->view['profil']['id'];
+	$inlineEdit_url = WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_export&do=inlinedit&noheader=1&profil_id='.$this->view['profil']['id'];    
 	$upload_url = WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_export&do=musterupload&noheader=1&profil_id='.$this->view['profil']['id'];
 
@@ -16,8 +16,8 @@
         <li role="presentation" class="active"><a href="#tab1" aria-controls="home" role="tab" data-toggle="tab"><?php echo __('Profiloptionen', 'wpsg'); ?></a></li>
         <li role="presentation"><a href="#tab2" aria-controls="profile" role="tab" data-toggle="tab"><?php echo __('Feldkonfiguration', 'wpsg'); ?></a></li>
-        <li role=""
+        <li role="presentation"><a href="#tab3" aria-controls="cron" role="tab" data-toggle="tab"><?php echo __('Automatische AusfÃŒhrung', 'wpsg'); ?></a></li>
     </ul>
 	<div class="tab-content">
-		<div id="tab1" role="tabpanel" class="tab-pane active" >
+		<div id="tab1" role="tabpanel" class="tab-pane active">
             
             <?php echo wpsg_drawForm_Text(__('Profilname', 'wpsg'), $this->view['profil']['name'], 'name', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
@@ -35,12 +35,27 @@
             </div>
             
+            <?php /* XML */ ?>
+            <div class="wpsg_mod_export_format wpsg_mod_export_format_<?php echo wpsg_mod_export::FORMAT_XML; ?>" style="display:<?php echo (($this->view['profil']['format'] == wpsg_mod_export::FORMAT_XML)?'block':'none'); ?>;">
+            
+                <?php echo wpsg_drawForm_Text('Root-Tagname', $this->view['profil']['xml_roottag'], 'xml_roottag', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
+                <?php echo wpsg_drawForm_Text('Bestellung-Tagname', $this->view['profil']['xml_ordertag'], 'xml_ordertag', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
+                <?php echo wpsg_drawForm_Text('Produkt-Root-Tagname', $this->view['profil']['xml_productroottag'], 'xml_productroottag', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
+                <?php echo wpsg_drawForm_Text('Produkt-Tagname', $this->view['profil']['xml_producttag'], 'xml_producttag', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
+                
+            </div>
+            
             <div class="wpsg_mod_export_format wpsg_mod_export_format_<?php echo wpsg_mod_export::FORMAT_CSV; ?>" style="display:<?php echo (($this->view['profil']['format'] == wpsg_mod_export::FORMAT_CSV)?'block':'none'); ?>">
-                <?php echo wpsg_drawForm_Upload('samplefile', __('Muster Vorlage', 'wpsg'), false, '50', '100000', array('ajax_upload' => true, 'ajax_upload_url' => $upload_url, 'ajax_success' => 'samplefile_success')); ?>
-            </div>
-            
-            <?php echo wpsg_drawForm_Checkbox('order_online', __('Eine Zeile pro Bestellung', 'wpsg'), $this->view['profil']['order_online'], array('label' => __('Optionen', 'wpsg'), 'inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
-            <?php echo wpsg_drawForm_Checkbox('order_onetime', __('Bestellungen nur einmalig exportieren', 'wpsg'), $this->view['profil']['order_onetime'], array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
-            
+                <?php echo wpsg_drawForm_Upload('samplefile', __('Muster Vorlage', 'wpsg'), false, '50', '100000', array('ajax_upload' => true, 'ajax_upload_url' => $upload_url, 'ajax_success' => 'samplefile_success')); ?>                
+            </div>
+                        
+            <br />
+            
+            <?php echo wpsg_drawForm_Checkbox('order_onetime', __('Bestellungen nur einmalig exportieren', 'wpsg'), $this->view['profil']['order_onetime'], array('label' => __('Optionen', 'wpsg'), 'inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
+    
             <div class="wpsg_mod_export_format wpsg_mod_export_format_<?php echo wpsg_mod_export::FORMAT_CSV; ?>" style="display:<?php echo (($this->view['profil']['format'] == wpsg_mod_export::FORMAT_CSV)?'block':'none'); ?>">
+            <?php echo wpsg_drawForm_Checkbox('order_online', __('Eine Zeile pro Bestellung', 'wpsg'), $this->view['profil']['order_online'], array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
+            </div>
+                
+            <div class="wpsg_mod_export_format wpsg_mod_export_format_<?php echo wpsg_mod_export::FORMAT_CSV; ?>" style="display:<?php echo (($this->view['profil']['format'] == wpsg_mod_export::FORMAT_CSV)?'block':'none'); ?>">
                 
                 <?php echo wpsg_drawForm_Checkbox('csv_fieldnames', __('Spaltennamen in erster Spalte', 'wpsg'), $this->view['profil']['csv_fieldnames'], array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
@@ -50,9 +65,115 @@
         </div>
         
-        <div id="tab2" role="tabpanel" class="tab-pane" >
+        <div id="tab2" role="tabpanel" class="tab-pane">
             
             <div id="wpsg_mod_export_fields"><?php echo $this->view['strFields']; ?></div>
             
         </div>
+        
+        <div id="tab3" role="tabpanel" class="tab-pane">
+             
+            <?php echo wpsg_drawForm_Text(__('Automatische AusfÃŒhrung aktivieren', 'wpsg'), $this->view['arCronTypes'][$this->view['profil']['cron_interval']], 'cron_interval', array('inlineEdit' => true, 'inlineEdit_callback' => 'switchCronType', 'inlineEdit_url' => $inlineEdit_url, 'inlineEdit_type' => 'select', 'inlineEdit_source' => wpsg_prepare_for_inlineEdit($this->view['arCronTypes']))); ?>
+                                    
+            <div class="cron_interval cron_interval_1" style="<?php echo (($this->view['profil']['cron_interval'] == '0')?'display:none;':''); ?>">
+                 
+                <?php echo wpsg_drawForm_Text(__('Pfad', 'wpsg'), $this->view['profil']['cron_path'], 'cron_path', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>                
+                <?php echo wpsg_drawForm_Text(__('Letzte AusfÃŒhrung', 'wpsg'), (($this->view['profil']['cron_lastrun'] == '0000-00-00')?__('Noch nie', 'wpsg'):wpsg_formatTimestamp($this->view['profil']['cron_lastrun'], true)), false); ?>
+                
+                <fieldset id="wpsg_mod_export_orderfilter">                                                
+                    <legend><?php echo __('Bestellfilter', 'wpsg'); ?></legend>
+                    
+                    <form id="wpsg_mod_export_searchfilter">
+                        
+                        <?php echo wpsg_drawForm_Text(__('Suchfeld', 'wpsg'), wpsg_getStr($this->view['profil']['orderfilter']['s']), 'orderfilter_s', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>                    
+                        <?php echo wpsg_drawForm_Text(__('Kunde (ID)', 'wpsg'), wpsg_getStr($this->view['profil']['orderfilter']['k_id']), 'orderfilter_k_id', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
+                        
+                        <?php $arOrderStatus = wpsg_array_merge(array('-1' => __('Alle', 'wpsg')), $this->arStatus); ?>
+                        <?php echo wpsg_drawForm_Text(__('Bestellstatus', 'wpsg'), $arOrderStatus[wpsg_getStr($this->view['profil']['orderfilter']['status'], '-1')], 'orderfilter_status', array('inlineEdit' => true, 'inlineEdit_type' => 'select', 'inlineEdit_url' => $inlineEdit_url, 'inlineEdit_source' => $arOrderStatus)); ?>
+                                            
+                        <?php $arMonth = array('-1' => __('Alle', 'wpsg')); ?>
+                        <?php for ($i = 1; $i <= 12; $i ++) { $arMonth[str_pad($i, 2, '0', STR_PAD_LEFT)] = strftime("%B", mktime(0, 0, 0, $i, 1, 2000)); } ?>
+                        
+                        <?php $arYearCdate = array('-1' => __('Alle', 'wpsg')); ?>
+                        <?php foreach ($this->view['cdate_years'] as $y) { $arYearCdate[$y] = $y; } ?>
+                        
+                        <?php $arYearInvoice = array('-1' => __('Alle', 'wpsg')); ?>
+                        <?php foreach ($this->view['invoicedate_years'] as $y) { $arYearInvoice[$y] = $y; } ?>
+                        
+                        <?php echo wpsg_drawForm_TextStart(); ?>
+                        <div class="row">
+                            <div class="col-lg-6">
+                                <p id="orderfilter_cdate_m" class="form-control-static"><?php echo $arMonth[wpsg_getStr($this->view['profil']['orderfilter']['cdate_m'], '-1')]; ?></p>
+                                <script type="text/javascript">/* <![CDATA[ */
+                                
+                                    jQuery(document).ready(function() {
+                                        
+                                        jQuery('#orderfilter_cdate_m').wspg_editable('<?php echo $inlineEdit_url; ?>', {
+                                            'test': '1', 'placement': 'bottom', 'type': 'select',  'data': <?php echo wpsg_prepare_for_inlineEdit($arMonth); ?>
+                                        } );
+                                        
+                                    } );
+                                
+                                /* ]]> */</script>
+                            </div>
+                            <div class="col-lg-6">
+                                <p id="orderfilter_cdate_y" class="form-control-static"><?php echo $arYearCdate[wpsg_getStr($this->view['profil']['orderfilter']['cdate_y'], '-1')]; ?></p>
+                                <script type="text/javascript">/* <![CDATA[ */
+                                
+                                    jQuery(document).ready(function() {
+                                        
+                                        jQuery('#orderfilter_cdate_y').wspg_editable('<?php echo $inlineEdit_url; ?>', {
+                                            'placement': 'bottom', 'type': 'select',  'data': <?php echo wpsg_prepare_for_inlineEdit($arYearCdate); ?>
+                                        } );
+                                        
+                                    } );
+                                
+                                /* ]]> */</script>
+                            </div>
+                        </div>
+                        <?php echo wpsg_drawForm_TextEnd(__('Bestelldatum (Monat/Jahr)', 'wpsg'), array('noP' => true)); ?>
+                        
+                        <?php if ($this->hasMod('wpsg_mod_rechnungen')) { ?>
+                        <?php echo wpsg_drawForm_TextStart(); ?>
+                        <div class="row">
+                            <div class="col-lg-6">
+                                <p id="orderfilter_invoicedate_m" class="form-control-static"><?php echo $arMonth[wpsg_getStr($this->view['profil']['orderfilter']['invoicedate_m'], '-1')]; ?></p>                            
+                                <script type="text/javascript">/* <![CDATA[ */
+                                
+                                    jQuery(document).ready(function() {
+                                        
+                                        jQuery('#orderfilter_invoicedate_m').wspg_editable('<?php echo $inlineEdit_url; ?>', {
+                                            'placement': 'bottom', 'type': 'select',  'data': <?php echo wpsg_prepare_for_inlineEdit($arMonth); ?>
+                                        } );
+                                        
+                                    } );
+                                
+                                /* ]]> */</script>
+                            </div>
+                            <div class="col-lg-6">
+                                <p id="orderfilter_invoicedate_y" class="form-control-static"><?php echo $arYearInvoice[wpsg_getStr($this->view['profil']['orderfilter']['invoicedate_y'], '-1')]; ?></p>                            
+                                <script type="text/javascript">/* <![CDATA[ */
+                                
+                                    jQuery(document).ready(function() {
+                                        
+                                        jQuery('#orderfilter_invoicedate_y').wspg_editable('<?php echo $inlineEdit_url; ?>', {
+                                            'placement': 'bottom', 'type': 'select',  'data': <?php echo wpsg_prepare_for_inlineEdit($arYearInvoice); ?>
+                                        } );
+                                        
+                                    } );
+                                
+                                /* ]]> */</script>
+                            </div>
+                        </div>
+                        <?php echo wpsg_drawForm_TextEnd(__('Rechnungsdatum (Monat/Jahr)', 'wpsg'), array('noP' => true)); ?>
+                        <?php } ?>
+                        
+                    </form>
+                    
+                </fieldset>
+                
+            </div>
+            
+        </div>
+        
     </div>
 </div>
@@ -64,4 +185,12 @@
 <script type="text/javascript">/* <![CDATA[ */
 
+    function switchCronType(response, newValue)
+    {
+       
+        if (newValue != "0") jQuery('.cron_interval_1').show();
+        else jQuery('.cron_interval_1').hide();
+        
+    }
+    
     function samplefile_success(data)
     {
Index: /views/mods/mod_export/settings_edit.phtml
===================================================================
--- /views/mods/mod_export/settings_edit.phtml	(revision 5909)
+++ /views/mods/mod_export/settings_edit.phtml	(revision 5911)
@@ -113,4 +113,30 @@
 	} // function wpsg_addExportProfil()
 
+	function wpsg_mod_export_setAtt(htmlCheckbox, field_id)
+	{
+		
+		var value = '0';
+		if (jQuery(htmlCheckbox).prop('checked') == true) value = '1';
+		
+		jQuery.ajax( { 
+			url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_export&do=inlinedit&noheader=1',
+			data: {
+				'name': 'field_xml_att_' + field_id,
+				'value': value
+			},			
+			success: function(data) {
+				
+				if (data != '1')
+				{
+					
+					alert(data);
+					
+				}
+				
+			}
+		} );
+		
+	}
+	
 </script>
 
Index: /wpshopgermany.php
===================================================================
--- /wpshopgermany.php	(revision 5909)
+++ /wpshopgermany.php	(revision 5911)
@@ -108,4 +108,5 @@
 	require_once(dirname(__FILE__).'/lib/wpsg_basket.class.php');
 	require_once(dirname(__FILE__).'/lib/wpsg_header.class.php');
+	require_once(dirname(__FILE__).'/lib/wpsg_remoteconnection.class.php');
 	require_once(dirname(__FILE__).'/model/wpsg_model.class.php');
 	require_once(dirname(__FILE__).'/model/wpsg_product.class.php');
@@ -144,4 +145,5 @@
 	// UPLOADS Dir fÃŒr MultiblogunterstÃŒtzung
 	global $current_blog;
+
 	if ($GLOBALS['wpsg_sc']->isMultiBlog())
 	{
@@ -153,5 +155,5 @@
 	
 	}
-	
+
 	$GLOBALS['wpsg_sc']->initShop($prefix);
 	 
