Index: /changelog
===================================================================
--- /changelog	(revision 7093)
+++ /changelog	(revision 7094)
@@ -131,5 +131,5 @@
 - Bugfix: PHP Warnung bei Produktbewertungen
 - Bugfix: Paypal-Schnittstellenanpassung 
-- Bugfix; MÃ¶gliche SicherheitslÃŒcke beim Upload von Widerrufsbelehrungen verhindert
+- Bugfix: MÃ¶gliche SicherheitslÃŒcke beim Upload von Widerrufsbelehrungen verhindert
 
 #4.0.12
@@ -138,6 +138,8 @@
 - Bugfix: Unter bestimmten UmstÃ€nden lÃ€sst sich der Bewertungsreiter in der Produktverwaltung nicht mehr Ã¶ffnen
 - Bugfix: Produktbild bei Auswahl aus Mediathek wird nur die ID ÃŒbergeben
+- Bugfix: Bug gefixt, bei dem die Seite "BestellÃŒbersicht" im Frontend nur Fehler ausgegeben hat
 - Feature: Satolo Newsletter-Registrierung mittels Double-OptIn
 - Feature: Satolo Newsletter-Abonnenten in gewÃ€hlte Liste integrieren
 - Feature: Trackinganbieter in Versandart auswÃ€hlbar
-- Feature: Export von Variationen von Varianten als einzelne Spalten 
+- Feature: Export von Variationen von Varianten als einzelne Spalten
+- Feature: Erweiterte Einstellungen eines Logos sowohl fÃŒr die Rechnung des Moduls "Rechnungen", als auch fÃŒr sÃ€mtliche E-Mail eingebaut
Index: /controller/wpsg_AdminController.class.php
===================================================================
--- /controller/wpsg_AdminController.class.php	(revision 7093)
+++ /controller/wpsg_AdminController.class.php	(revision 7094)
@@ -6,9 +6,9 @@
 	class wpsg_AdminController extends wpsg_SystemController
 	{
-		
+
 		const SHOPDATA_EU_GERMANY = '0';
 		const SHOPDATA_EU_EU = '1';
 		const SHOPDATA_EU_WORLD = '2';
-		
+
 		/**
 		 * Ãbernimmt das Routing
@@ -58,23 +58,23 @@
 			}
 			else if (wpsg_isSizedString($_REQUEST['action'], 'resetMessages'))
-            {
-
-                $this->update_option('wpsg_msgHidden', array());
-
-                $this->addBackendMessage(__('Systemmeldungen wurden zurÃŒckgesetzt.', 'wpsg'));
-                $this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=ueber&subaction=systemcheck');
-
-            }
+			{
+
+				$this->update_option('wpsg_msgHidden', array());
+
+				$this->addBackendMessage(__('Systemmeldungen wurden zurÃŒckgesetzt.', 'wpsg'));
+				$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=ueber&subaction=systemcheck');
+
+			}
 			else if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'clearMessage')
 			{
 
-                $arMsgHidden = $this->get_option('wpsg_msgHidden');
-                if (!wpsg_isSizedArray($arMsgHidden)) $arMsgHidden = array();
-
-                $arMsgHidden[] = $_REQUEST['msg_key'];
-
-                $this->update_option('wpsg_msgHidden', $arMsgHidden);
-
-                die("1");
+				$arMsgHidden = $this->get_option('wpsg_msgHidden');
+				if (!wpsg_isSizedArray($arMsgHidden)) $arMsgHidden = array();
+
+				$arMsgHidden[] = $_REQUEST['msg_key'];
+
+				$this->update_option('wpsg_msgHidden', $arMsgHidden);
+
+				die("1");
 
 			}
@@ -87,15 +87,15 @@
 
 		} // public function dispatch()
-		
+
 		public function init()
 		{
-		
+
 			// Option gab es frÃŒher nicht und wird hier auf den Default Wert korrigiert.
 			if ($this->shop->get_option('wpsg_shopdata_eu') === false) $this->shop->update_option('wpsg_shopdata_eu', self::EXPIRE_GERMANY);
 			if ($this->shop->get_option('wpsg_shopdata_eu') === false) $this->shop->update_option('wpsg_shopdata_eu', self::EXPIRE_EU);
 			if ($this->shop->get_option('wpsg_shopdata_eu') === false) $this->shop->update_option('wpsg_shopdata_eu', self::EXPIRE_WORLD);
-		
+
 		} // public function init()
-		
+
 		/**
 		 * Index des Backends
@@ -158,6 +158,6 @@
 			}
 			$this->shop->view['arSubAction']['dataprotection'] = array(
-					'Menutext' => __('Datenschutz', 'wpsg'),
-					'subTemplate' => WPSG_PATH_VIEW.'/admin/dataprotection.phtml'
+				'Menutext' => __('Datenschutz', 'wpsg'),
+				'subTemplate' => WPSG_PATH_VIEW.'/admin/dataprotection.phtml'
 			);
 			$this->shop->view['arSubAction']['kalkulation'] = array(
@@ -263,5 +263,5 @@
 
 		} // public function indexAction()
- 	
+
 		/**
 		 * Beim Speichern und Anzeigen der Shopdaten
@@ -293,7 +293,7 @@
 				$this->shop->update_option('wpsg_shopdata_eu_street', $_REQUEST['wpsg_shopdata_eu_street'], false, true);
 				$this->shop->update_option('wpsg_shopdata_eu_zip', $_REQUEST['wpsg_shopdata_eu_zip'], false, true);
-				$this->shop->update_option('wpsg_shopdata_eu_city', $_REQUEST['wpsg_shopdata_eu_city'], false, true);		
+				$this->shop->update_option('wpsg_shopdata_eu_city', $_REQUEST['wpsg_shopdata_eu_city'], false, true);
 				$this->shop->update_option('wpsg_shopdata_eu_country', $_REQUEST['wpsg_shopdata_eu_country'], false, true);
-				
+
 				$this->shop->update_option('dataprotectioncommissioner', $_REQUEST['dataprotectioncommissioner'], false, true);
 				$this->shop->update_option('dataprotectioncommissioner_name', $_REQUEST['dataprotectioncommissioner_name'], false, true);
@@ -301,7 +301,7 @@
 				$this->shop->update_option('dataprotectioncommissioner_email', $_REQUEST['dataprotectioncommissioner_email'], false, true);
 				$this->shop->update_option('dataprotectioncommissioner_baskettext', $_REQUEST['dataprotectioncommissioner_baskettext'], false, true);
-				$this->shop->update_option('dataprotectioncommissioner_mailtext', $_REQUEST['dataprotectioncommissioner_mailtext'], false, true);	
+				$this->shop->update_option('dataprotectioncommissioner_mailtext', $_REQUEST['dataprotectioncommissioner_mailtext'], false, true);
 				$this->shop->update_option('dataprotectioncommissioner_texts', $_REQUEST['dataprotectioncommissioner_texts'], false, true);
-								
+
 				$this->shop->update_option('wpsg_shopdata_bank_name', $_REQUEST['wpsg_shopdata_bank_name'], false, true);
 				$this->shop->update_option('wpsg_shopdata_bank_owner', $_REQUEST['wpsg_shopdata_bank_owner'], false, true);
@@ -317,7 +317,7 @@
 
 					$this->shop->addBackendError('nohspc_'.wpsg_translate(
-            			__('Die allgemeinen Daten des Shops haben sich verÃ€ndert, sie sollten das <a href="#1#">Widerrufsformular</a> ÃŒberprÃŒfen bzw. neu generieren.', 'wpsg'),
-						WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=widerrufsbelehrung'
-					), 'wpsg_message_shopdata_change');
+							__('Die allgemeinen Daten des Shops haben sich verÃ€ndert, sie sollten das <a href="#1#">Widerrufsformular</a> ÃŒberprÃŒfen bzw. neu generieren.', 'wpsg'),
+							WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=widerrufsbelehrung'
+						), 'wpsg_message_shopdata_change');
 
 				}
@@ -335,33 +335,33 @@
 		{
 
-		    $wpsg_update_data = wpsg_get_update_data($_REQUEST['wpsg_licence_file'], true);
-
-            if (!wpsg_isSizedArray($wpsg_update_data))
-            {
-
-                $this->addBackendError(__('Keine Verbindung zum Registrierungsserver', 'wpsg'));
-
-            }
-            else
-            {
-
-                if ($wpsg_update_data['returnCode'] === '0')
-                {
-
-                    $this->addBackendError(__('UngÃŒltiger Lizenzcode', 'wpsg'));
-
-                }
-                else
-                {
+			$wpsg_update_data = wpsg_get_update_data($_REQUEST['wpsg_licence_file'], true);
+
+			if (!wpsg_isSizedArray($wpsg_update_data))
+			{
+
+				$this->addBackendError(__('Keine Verbindung zum Registrierungsserver', 'wpsg'));
+
+			}
+			else
+			{
+
+				if ($wpsg_update_data['returnCode'] === '0')
+				{
+
+					$this->addBackendError(__('UngÃŒltiger Lizenzcode', 'wpsg'));
+
+				}
+				else
+				{
 
 					$this->addBackendMessage(__('wpShopGermany wurde aktiviert.', 'wpsg'));
-                    $this->update_option('wpsg_key', $_REQUEST['wpsg_licence_file']);
-
-                }
-
-            }
-
-            if ($this->shop->isMultiBlog()) die($this->redirect(WPSG_URL_WP.'wp-admin/network/plugins.php'));
-            else die($this->redirect(WPSG_URL_WP.'wp-admin/plugins.php'));
+					$this->update_option('wpsg_key', $_REQUEST['wpsg_licence_file']);
+
+				}
+
+			}
+
+			if ($this->shop->isMultiBlog()) die($this->redirect(WPSG_URL_WP.'wp-admin/network/plugins.php'));
+			else die($this->redirect(WPSG_URL_WP.'wp-admin/plugins.php'));
 
 		} // public function loadLicenceAction()
@@ -375,318 +375,318 @@
 			if (wpsg_isSizedString($_REQUEST['do'], 'activatemodul'))
 			{
-				
+
 				try
 				{
-				
+
 					if (!wpsg_isSizedString($_REQUEST['modulcode']))
 					{
-						
+
 						throw new \Exception(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module');
-						
+
 					}
 					else
 					{
-						 
+
 						$api_return = wpsg_api_call('registerModule', array($_REQUEST['modulcode']));
-						
+
 						if (!wpsg_isSizedArray($api_return) || !isset($api_return['returnCode']))
 						{
-							
+
 							// API Fehler
 							throw new \Exception(__('Registrierungsserver antwortet nicht.', 'wpsg'));
-						
+
 						}
 						else
 						{
-							
+
 							if ($api_return['returnCode'] === 0)
 							{
-								
+
 								throw new \Exception(__('Ihre Lizenz ist ungÃŒltig.', 'wpsg'));
-								
+
 							}
 							else if ($api_return['returnCode'] === 1)
 							{
-								
+
 								throw new \Exception(__('Modulcode wurde nicht akzeptiert.', 'wpsg'));
-								
+
 							}
 							else if ($api_return['returnCode'] === 2)
 							{
-								
+
 								throw new \Exception(__('Modulcode wurde bereits verbraucht.', 'wpsg'));
-								
+
 							}
 							else if ($api_return['returnCode'] === 3)
 							{
-								
+
 								throw new \Exception(__('Modulcode wurde bereits fÃŒr diesen SchlÃŒssel verbraucht.', 'wpsg'));
-								
+
 							}
 							else if ($api_return['returnCode'] === 4)
 							{
-																
+
 								$this->addBackendMessage(__('Modul wurde fÃŒr diesen LizenzschlÃŒssel aktiviert.', 'wpsg'));
-								
+
 								if (wpsg_isSizedString($_REQUEST['source'], 'licence')) $this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung&subaction=modulactivation');
 								else $this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module');
-								
+
 							}
 							else
 							{
-								
+
 								throw new \Exception(__('Nicht definierte API Antwort.'));
-								
+
 							}
-							
-						}  
-						
-					}
-					
+
+						}
+
+					}
+
 				}
 				catch (Exception $e)
 				{
-					
+
 					$this->addBackendError($e->getMessage());
-					
+
 					if (wpsg_isSizedString($_REQUEST['source'], 'licence')) $this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung&subaction=modulactivation');
 					else $this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module');
-					
-				}
-				
+
+				}
+
 			}
 			else if (wpsg_isSizedString($_REQUEST['do'], 'saveRegister'))
 			{
-				
+
 				$api_return = wpsg_api_call('updateRegisterData', array($_REQUEST['register']));
-					
+
 				try
 				{
-					
+
 					if ($api_return['returnCode'] === 0)
 					{
-						
+
 						throw new \Exception(__('Ihre Lizenz ist ungÃŒltig.', 'wpsg'));
-						
+
 					}
 					else if ($api_return['returnCode'] === 1)
 					{
-						
+
 						$this->addBackendMessage(__('Daten erfolgreich aktualisiert.', 'wpsg'));
 						$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung');
-						
+
 					}
 					else
 					{
-						
+
 						throw new \Exception(__('Nicht definierte API Antwort.'));
-						
-					}
-					
+
+					}
+
 				}
 				catch (Exception $e)
 				{
-				
+
 					$this->addBackendError($e->getMessage());
 					$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung');
-					
-				}
-				
+
+				}
+
 			}
 			else if (wpsg_isSizedString($_REQUEST['do'], 'domainRegister'))
 			{
-				
+
 				$api_return = wpsg_api_call('domainRegister', array($_SERVER['HTTP_HOST']));
-					
+
 				try
 				{
-					
+
 					if ($api_return['returnCode'] === 1)
 					{
-						
+
 						$this->addBackendMessage(__('Domain erfolgreich registriert.', 'wpsg'));
 						$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung&subaction=domaindata');
-						
+
 					}
 					else if ($api_return['returnCode'] === -1)
 					{
-						
+
 						throw new \Exception(__('Ihre Lizenz ist ungÃŒltig.', 'wpsg'));
-						
+
 					}
 					else if ($api_return['returnCode'] === -2)
 					{
-						
+
 						throw new \Exception(__('Diese Domain ist schon auf Ihren SchlÃŒssel registriert.', 'wpsg'));
-						
-					}					
+
+					}
 					else
 					{
-						
+
 						throw new \Exception(__('Nicht definierte API Antwort.'));
-						
-					}
-					
+
+					}
+
 				}
 				catch (Exception $e)
 				{
-				
+
 					$this->addBackendError($e->getMessage());
 					$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung&subaction=domaindata');
-					
-				}
-				
+
+				}
+
 			}
 			else if (wpsg_isSizedString($_REQUEST['do'], 'domainDeRegister'))
 			{
-				
+
 				$api_return = wpsg_api_call('domainDeRegister', array($_SERVER['HTTP_HOST']));
-					
+
 				try
 				{
-					
+
 					if ($api_return['returnCode'] === 1)
 					{
-						
+
 						$this->addBackendMessage(__('Domain erfolgreich unregistriert.', 'wpsg'));
 						$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung&subaction=domaindata');
-						
+
 					}
 					else if ($api_return['returnCode'] === -1)
 					{
-						
+
 						throw new \Exception(__('Ihre Lizenz ist ungÃŒltig.', 'wpsg'));
-						
+
 					}
 					else if ($api_return['returnCode'] === -2)
 					{
-						
+
 						throw new \Exception(__('Diese Domain ist nicht auf Ihren SchlÃŒssel registriert.', 'wpsg'));
-						
-					}					
+
+					}
 					else
 					{
-						
+
 						throw new \Exception(__('Nicht definierte API Antwort.'));
-						
-					}
-					
+
+					}
+
 				}
 				catch (Exception $e)
 				{
-				
+
 					$this->addBackendError($e->getMessage());
 					$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung&subaction=domaindata');
-					
-				}
-				
+
+				}
+
 			}
 			else if (wpsg_isSizedString($_REQUEST['do'], 'startDemo'))
 			{
-				
+
 				$api_return = wpsg_api_call('startDemo', array($_REQUEST['modul']));
-				
+
 				try
 				{
-					
+
 					if ($api_return['returnCode'] === 1)
 					{
-						
+
 						$this->addBackendMessage(__('Demo Modus erfolgreich gestartet.', 'wpsg'));
-												
+
 					}
 					else if (isset($api_return['returnCode']) && isset($api_return['returnMessage']))
 					{
-						
+
 						throw new \Exception($api_return['returnMessage']);
-												
-					} 
+
+					}
 					else
 					{
-						
+
 						throw new \Exception(__('Nicht definierte API Antwort.'));
-						
-					}
-					 
+
+					}
+
 				}
 				catch (Exception $e)
 				{
-				
+
 					$this->addBackendError($e->getMessage());
-										
-				}
-				
+
+				}
+
 				$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul='.$_REQUEST['modul']);
-				
-			}
-			else if (wpsg_isSizedString($_REQUEST['do'], 'installModul')) 
-			{
-
-			    global $wp_filesystem;
-
-			    // Kann die Moduldatei geschrieben werden?
-                if (!is_writable(WPSG_PATH_MOD))
-                {
-
-                    ob_start();
-                    $request_creds = request_filesystem_credentials(
-                        WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung&noheader=1&do=installModul&modul='.$modul_key.'&source='.$_REQUEST['source'],
-                        '',
-                        false,
-                        false,
-                        null
-                    );
-                    ob_end_clean();
-
-                    // 1 gibt es bei Windows Rechnern zurÃŒck, da es hier egal ist
-                    // Ein Array ist es wenn das Formular bereits abgeschickt wurde und die Anfrage vom Formular kommt
-                    // false ist es wenn kein Zugriff ist dann muss das Formular angezeigt werden
-
-                    if (false === $request_creds)
-                    {
-
-                        // Berechtigungen anfragen
-                        $this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung&do=getCredentials&modul='.$_REQUEST['modul'].'&source='.$_REQUEST['source']);
-
-                    }
-                    else if (is_array($request_creds))
-                    {
-
-                        if (!WP_Filesystem($request_creds))
-                        {
-
-                            // Eingegebene Daten waren falsch
-                            $this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung&do=getCredentials&modul='.$_REQUEST['modul'].'&sourcce='.$_REQUEST['source']);
-
-                        }
-
-                    }
-
-                }
+
+			}
+			else if (wpsg_isSizedString($_REQUEST['do'], 'installModul'))
+			{
+
+				global $wp_filesystem;
+
+				// Kann die Moduldatei geschrieben werden?
+				if (!is_writable(WPSG_PATH_MOD))
+				{
+
+					ob_start();
+					$request_creds = request_filesystem_credentials(
+						WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung&noheader=1&do=installModul&modul='.$modul_key.'&source='.$_REQUEST['source'],
+						'',
+						false,
+						false,
+						null
+					);
+					ob_end_clean();
+
+					// 1 gibt es bei Windows Rechnern zurÃŒck, da es hier egal ist
+					// Ein Array ist es wenn das Formular bereits abgeschickt wurde und die Anfrage vom Formular kommt
+					// false ist es wenn kein Zugriff ist dann muss das Formular angezeigt werden
+
+					if (false === $request_creds)
+					{
+
+						// Berechtigungen anfragen
+						$this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung&do=getCredentials&modul='.$_REQUEST['modul'].'&source='.$_REQUEST['source']);
+
+					}
+					else if (is_array($request_creds))
+					{
+
+						if (!WP_Filesystem($request_creds))
+						{
+
+							// Eingegebene Daten waren falsch
+							$this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung&do=getCredentials&modul='.$_REQUEST['modul'].'&sourcce='.$_REQUEST['source']);
+
+						}
+
+					}
+
+				}
 
 				$bOK = $this->installModul($_REQUEST['modul']);
-						
+
 				if ($bOK === true) $this->addBackendMessage(__('Modul erfolgreich installiert.', 'wpsg'));
-				
+
 				if (wpsg_isSizedString($_REQUEST['source'], 'licence')) $this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung&subaction=modulactivation');
 				else $this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module');
-				
+
 			}
 			else if (wpsg_isSizedString($_REQUEST['do'], 'getCredentials'))
 			{
 
-			    //https://dev4-wpshopgermany.maennchen1.de/wp-admin/admin.php?page=wpsg-Admin&action=registrierung&noheader=1&do=installModul&modul=wpsg_mod_paypalapi&source=module
-
-                echo request_filesystem_credentials(
-                    WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung&noheader=1&do=installModul&modul='.$_REQUEST['modul'].'&source='.$_REQUEST['source'],
-                    '',
-                    false,
-                    false,
-                    null
-                );
-
-                return;
-
-            }
+				//https://dev4-wpshopgermany.maennchen1.de/wp-admin/admin.php?page=wpsg-Admin&action=registrierung&noheader=1&do=installModul&modul=wpsg_mod_paypalapi&source=module
+
+				echo request_filesystem_credentials(
+					WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung&noheader=1&do=installModul&modul='.$_REQUEST['modul'].'&source='.$_REQUEST['source'],
+					'',
+					false,
+					false,
+					null
+				);
+
+				return;
+
+			}
 
 			$this->view['actionName'] = 'licence';
@@ -694,7 +694,7 @@
 			if (wpsg_isSizedString($_REQUEST['subaction'])) $this->view['subaction'] = $_REQUEST['subaction'];
 			else $this->view['subaction'] = 'registerdata';
-			
-			$this->render(WPSG_PATH_VIEW.'/admin/licence.phtml'); 	
-			
+
+			$this->render(WPSG_PATH_VIEW.'/admin/licence.phtml');
+
 		} // public function registrierungAction()
 
@@ -883,7 +883,7 @@
 
 			if (	!wpsg_isSizedArray($this->shop->view['distinctProductTax']) &&
-					!wpsg_isSizedArray($this->shop->view['arPaymentMethods']) &&
-					!wpsg_isSizedArray($this->shop->view['arShippingMethods']) &&
-					!wpsg_isSizedArray($this->shop->view['arConf'])	)
+			        !wpsg_isSizedArray($this->shop->view['arPaymentMethods']) &&
+			        !wpsg_isSizedArray($this->shop->view['arShippingMethods']) &&
+			        !wpsg_isSizedArray($this->shop->view['arConf'])	)
 			{
 
@@ -1029,20 +1029,20 @@
 				if ($_REQUEST['wpsg_deinstall_sites'] == '1')
 				{
-				
+
 					// Seiten lÃ¶schen
 
-                    wp_delete_post($this->get_option('wpsg_page_basket'), true);
-                    wp_delete_post($this->get_option('wpsg_page_versand'), true);
-                    wp_delete_post($this->get_option('wpsg_page_product'), true);
-                    wp_delete_post($this->get_option('wpsg_page_agb'), true);
-                    wp_delete_post($this->get_option('wpsg_page_datenschutz'), true);
-                    wp_delete_post($this->get_option('wpsg_page_widerrufsbelehrung'), true);
-                    wp_delete_post($this->get_option('wpsg_page_impressum'), true);
-
-                    // Module
-                    $this->shop->callMods('wpsg_deinstall_sites');
+					wp_delete_post($this->get_option('wpsg_page_basket'), true);
+					wp_delete_post($this->get_option('wpsg_page_versand'), true);
+					wp_delete_post($this->get_option('wpsg_page_product'), true);
+					wp_delete_post($this->get_option('wpsg_page_agb'), true);
+					wp_delete_post($this->get_option('wpsg_page_datenschutz'), true);
+					wp_delete_post($this->get_option('wpsg_page_widerrufsbelehrung'), true);
+					wp_delete_post($this->get_option('wpsg_page_impressum'), true);
+
+					// Module
+					$this->shop->callMods('wpsg_deinstall_sites');
 
 					$this->shop->addBackendMessage(__('Seiten erfolgreich gelÃ¶scht.', 'wpsg'));
-				
+
 				}
 
@@ -1279,13 +1279,13 @@
 				{
 
-				    // DoppeleintrÃ€ge verhindern
-                    $exist = $this->db->fetchOne("SELECT `id` FROM `".WPSG_TBL_WPML_ICL_STRINGS."` WHERE `value` = '".wpsg_q($t)."' AND `context` = 'wpsg' ");
-
-                    if (!wpsg_isSizedInt($exist))
-                    {
-
-                        icl_register_string('wpsg', 'wpsg_auto_'.$k, $t, false, $this->get_option('wpsg_backend_language'));
-
-                    }
+					// DoppeleintrÃ€ge verhindern
+					$exist = $this->db->fetchOne("SELECT `id` FROM `".WPSG_TBL_WPML_ICL_STRINGS."` WHERE `value` = '".wpsg_q($t)."' AND `context` = 'wpsg' ");
+
+					if (!wpsg_isSizedInt($exist))
+					{
+
+						icl_register_string('wpsg', 'wpsg_auto_'.$k, $t, false, $this->get_option('wpsg_backend_language'));
+
+					}
 
 				}
@@ -1604,4 +1604,40 @@
 		} // public function kundendatenAction()
 
+		/*
+		 * Gibt den Absoluten Path des Speicherorts der Emailconfig an
+		 * Ist der Parameter $url auf true, so wird der relative Pfad fÃŒr die Ausgabe in URLs zurÃŒckgegeben
+		 */
+		public function getMailConfFilePath($order_id, $url = false)
+		{
+
+			if ($order_id == '')
+			{	// Emaillogo
+				if ($this->shop->isMultiBlog())
+				{
+
+					$path = WP_CONTENT_DIR.'/'.WPSG_MB_UPLOADS.'/wpsg/wpsg_mailconf/';
+					$htaccess = WP_CONTENT_DIR.'/'.WPSG_MB_UPLOADS.'/wpsg/wpsg_mailconf/.htaccess';
+
+					$url_content = WPSG_URL_CONTENT.WPSG_MB_UPLOADS.'/wpsg/wpsg_mailconf/';
+
+					if ($url) $strReturn = $url_content.'/'.$order_id.'/';
+					else $strReturn = $path.'/'.$order_id.'/';
+
+				}
+				else
+				{
+
+					$path = WPSG_PATH_CONTENT.'uploads/wpsg/wpsg_mailconf/';
+					$htaccess = WPSG_PATH_CONTENT.'uploads/wpsg/wpsg_mailconf/.htaccess';
+
+					if ($url) $strReturn = WPSG_URL_CONTENT.'uploads/wpsg/wpsg_mailconf/'.$order_id.'/';
+					else $strReturn = $path.$order_id.'/';
+
+				}
+				return $strReturn;
+			}
+
+		} // public function getEmailFilePath()
+
 		/**
 		 * Konfiguration der E-Mail Einstellungen
@@ -1614,4 +1650,37 @@
 
 				$this->update_option('wpsg_htmlmail', $_REQUEST['wpsg_htmlmail']);
+				$this->update_option('wpsg_email_logo_activated', $_REQUEST['wpsg_email_logo_activated']);
+
+				$this->update_option('wpsg_email_logo_watermark', $_REQUEST['wpsg_email_logo_watermark']);
+				$this->update_option('wpsg_email_logo_alignment', $_REQUEST['wpsg_email_logo_alignment']);
+				$this->update_option('wpsg_email_logo_transparency', $_REQUEST['wpsg_email_logo_transparency']);
+
+				if(file_exists($_FILES['wpsg_email_logo']['tmp_name']))
+				{
+
+					$ending = strtolower(preg_replace("/(.*)\./", "", $_FILES['wpsg_email_logo']['name']));
+
+					if ($ending != "jpg" && $ending != "jpeg")
+					{
+						$this->shop->addBackendError(__("UngÃŒltiger Dateityp (Logo) ! Es sind nur JPG/JPEG Dateien erlaubt!", "wpsg"));
+					}
+					else if ($ending == "jpg" || $ending == "jpeg")
+					{
+						$destination = $this->getMailConfFilePath('').'wpsg_email_logo.jpg';
+
+						move_uploaded_file($_FILES['wpsg_email_logo']['tmp_name'], $destination);
+						$this->update_option('wpsg_email_logo_url', $this->getMailConfFilePath('', true).'wpsg_email_logo.jpg');
+					}
+
+				}
+
+				if((array_key_exists('wpsg_email_logo_del', $_REQUEST)) && ($_REQUEST['wpsg_email_logo_del'] == "1"))
+				{
+
+					@unlink(WPSG_PATH_CONTENT . 'uploads/wpsg/wpsg_mailconf/wpsg_email_logo.jpg');
+					$this->shop->addBackendMessage(__('Logo wurde erfolgreich gelÃ¶scht.', 'wpsg'));
+
+				}
+
 
 				wpsg_saveEMailConfig("global"); // Global
@@ -1665,5 +1734,5 @@
 			if (isset($_REQUEST['noheader']) && $_REQUEST['noheader'] == '1' && !isset($_REQUEST['submit']))
 			{
-                
+
 				// Ajax Anfrage eines Moduls
 				$this->shop->callMod($_REQUEST['modul'], 'be_ajax');
@@ -1735,6 +1804,6 @@
 			{
 
-                \check_admin_referer('wpsg-save-revocation');
-			    
+				\check_admin_referer('wpsg-save-revocation');
+
 				$this->shop->update_option('wpsg_ps_mailwiderruf', $_REQUEST['wpsg_ps_mailwiderruf']);
 				$this->shop->addTranslationString('wpsg_ps_mailwiderruf', $_REQUEST['wpsg_ps_mailwiderruf']);
@@ -1742,28 +1811,28 @@
 				if (file_exists($_FILES['wpsg_widerrufsformular']['tmp_name']))
 				{
-				    
-				    if (mime_content_type($_FILES['wpsg_widerrufsformular']['tmp_name']) === 'application/pdf') {
-
-                        if (!file_exists(WPSG_PATH_UPLOADS.'wpsg_revocation/')) mkdir(WPSG_PATH_UPLOADS.'wpsg_revocation/', 0775, true);
-    
-                        $this->clearRevocationForm();
-    
-                        move_uploaded_file($_FILES['wpsg_widerrufsformular']['tmp_name'], WPSG_PATH_UPLOADS.'wpsg_revocation/'.$_FILES['wpsg_widerrufsformular']['name']);
-                        $this->addBackendMessage(__('Widerrufsformular erfolgreich hochgeladen.', 'wpsg'));
-    
-                        $this->shop->update_option('wpsg_revocationform', $_FILES['wpsg_widerrufsformular']['name']);
-                        
-                    } else {
-				        
-				        $this->shop->addBackendError(__('Dateiformat muss vom Type PDF sein.', 'wpsg'));
-				        
-                    }
+
+					if (mime_content_type($_FILES['wpsg_widerrufsformular']['tmp_name']) === 'application/pdf') {
+
+						if (!file_exists(WPSG_PATH_UPLOADS.'wpsg_revocation/')) mkdir(WPSG_PATH_UPLOADS.'wpsg_revocation/', 0775, true);
+
+						$this->clearRevocationForm();
+
+						move_uploaded_file($_FILES['wpsg_widerrufsformular']['tmp_name'], WPSG_PATH_UPLOADS.'wpsg_revocation/'.$_FILES['wpsg_widerrufsformular']['name']);
+						$this->addBackendMessage(__('Widerrufsformular erfolgreich hochgeladen.', 'wpsg'));
+
+						$this->shop->update_option('wpsg_revocationform', $_FILES['wpsg_widerrufsformular']['name']);
+
+					} else {
+
+						$this->shop->addBackendError(__('Dateiformat muss vom Type PDF sein.', 'wpsg'));
+
+					}
 
 				} else if ($_FILES['wpsg_widerrufsformular']['error']) {
-				    
-				    $this->shop->addBackendError(__('Mit dem Upload gab es ein Problem, mÃ¶glicherweise ist die Datei zu groÃ.', 'wpsg'));
-				    
-                }
-                
+
+					$this->shop->addBackendError(__('Mit dem Upload gab es ein Problem, mÃ¶glicherweise ist die Datei zu groÃ.', 'wpsg'));
+
+				}
+
 				$this->shop->update_option('wpsg_widerrufsformular_kundenmail', $_REQUEST['wpsg_widerrufsformular_kundenmail']);
 
@@ -1783,5 +1852,5 @@
 
 				if (!$this->shop->hasBackendError()) $this->shop->addBackendMessage(__('Widerruf erfolgreich gespeichert.', 'wpsg'));
-				
+
 				$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=widerrufsbelehrung');
 
@@ -1900,14 +1969,14 @@
 		{
 
-            if (wpsg_isSizedString($_REQUEST['subaction'], 'clearSysLog'))
-            {
-
-                @unlink($GLOBALS['wpsg_sc']->getStorageRoot().'exception.log');
-
-                $this->addBackendMessage(__('Fehlerprotokoll gelÃ¶scht.', 'wpsg'));
-
-                $this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=ueber&subaction=systemlog');
-
-            }
+			if (wpsg_isSizedString($_REQUEST['subaction'], 'clearSysLog'))
+			{
+
+				@unlink($GLOBALS['wpsg_sc']->getStorageRoot().'exception.log');
+
+				$this->addBackendMessage(__('Fehlerprotokoll gelÃ¶scht.', 'wpsg'));
+
+				$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=ueber&subaction=systemlog');
+
+			}
 
 			$this->shop->view = array(
@@ -1947,6 +2016,6 @@
 			{
 
-                \check_admin_referer('wpsg-save-config'); 
-			    
+				\check_admin_referer('wpsg-save-config');
+
 				$this->update_option('wpsg_currency', $_REQUEST['wpsg_currency']);
 				$this->update_option('wpsg_showincompleteorder', $_REQUEST['wpsg_showincompleteorder']);
@@ -1975,5 +2044,5 @@
 			else if (@$_REQUEST['subaction'] == "dataprotection")
 			{
-				
+
 				$this->update_option('dataprotectioncommissioner', $_REQUEST['dataprotectioncommissioner']);
 				$this->update_option('dataprotectioncommissioner_name', $_REQUEST['dataprotectioncommissioner_name']);
@@ -1984,11 +2053,11 @@
 				$this->update_option('dataprotectioncommissioner_cookie', $_REQUEST['dataprotectioncommissioner_cookie']);
 				$this->update_option('dataprotectioncommissioner_cookietext', $_REQUEST['dataprotectioncommissioner_cookietext']);
-				
+
 				$this->addBackendMessage(__('Einstellungen gespeichert.', 'wpsg'));
-				
+
 				$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=dataprotection');
-				
-			}
-			
+
+			}
+
 			else if (@$_REQUEST['subaction'] == 'extended')
 			{
@@ -1997,6 +2066,6 @@
 				$this->update_option('wpsg_options_nl2br', $_REQUEST['wpsg_options_nl2br']);
 				$this->update_option('wpsg_debugModus', $_REQUEST['wpsg_debugModus']);
-                $this->update_option('wpsg_displayTemplates', $_REQUEST['wpsg_displayTemplates']);
-                $this->update_option('wpsg_displayTemplatesLog', $_REQUEST['wpsg_displayTemplatesLog']);
+				$this->update_option('wpsg_displayTemplates', $_REQUEST['wpsg_displayTemplates']);
+				$this->update_option('wpsg_displayTemplatesLog', $_REQUEST['wpsg_displayTemplatesLog']);
 
 				$this->update_option('wpsg_referer_requesturi', $_REQUEST['wpsg_referer_requesturi']);
@@ -2029,4 +2098,6 @@
 				$this->update_option('wpsg_showArticelnumber', $_REQUEST['wpsg_showArticelnumber']);
 				$this->update_option('wpsg_hideBasketCountrySelect', $_REQUEST['wpsg_hideBasketCountrySelect']);
+				$this->update_option('wpsg_alternativeProductDetailDesign', $_REQUEST['wpsg_alternativeProductDetailDesign']);
+				$this->update_option('wpsg_alternativeOrderDesign', $_REQUEST['wpsg_alternativeOrderDesign']);
 
 				$this->shop->callMods('admin_presentation_submit');
@@ -2120,36 +2191,36 @@
 
 						$path ="/wpsg/settings/option";
-			        	$res = $xml->xpath($path);
-
-			        	foreach ($res as $k => $v)
-			        	{
-
-			        		$a = $v->attributes();
-
-			        		$bExists = $this->db->fetchOne("SELECT `option_id` FROM `".$wpdb->prefix."options` WHERE `option_name` = '".wpsg_q(strval($a->option_name))."' ");
-
-			        		if ($bExists > 0)
-			        		{
-
-			        			$this->db->UpdateQuery($wpdb->prefix."options", array(
-			        				"option_value" => wpsg_q(strval($a->option_value))
-			        			), "`option_name` = '".wpsg_q(strval($a->option_name))."'");
-
-			        		}
-			        		else
-			        		{
-
-			        			$this->db->ImportQuery($wpdb->prefix."options", array(
-			        				"blog_id" => wpsg_q(strval($a->blog_id)),
-			        				"option_name" => wpsg_q(strval($a->option_name)),
-			        				"option_value" => wpsg_q(strval($a->option_value)),
-			        				"autoload" => wpsg_q(strval($a->autoload))
-			        			), true);
-
-			        		}
-
-			        	}
-
-			        	$this->shop->addBackendMessage(__('Einstellungen wurden erfolgreich importiert.', 'wpsg'));
+						$res = $xml->xpath($path);
+
+						foreach ($res as $k => $v)
+						{
+
+							$a = $v->attributes();
+
+							$bExists = $this->db->fetchOne("SELECT `option_id` FROM `".$wpdb->prefix."options` WHERE `option_name` = '".wpsg_q(strval($a->option_name))."' ");
+
+							if ($bExists > 0)
+							{
+
+								$this->db->UpdateQuery($wpdb->prefix."options", array(
+									"option_value" => wpsg_q(strval($a->option_value))
+								), "`option_name` = '".wpsg_q(strval($a->option_name))."'");
+
+							}
+							else
+							{
+
+								$this->db->ImportQuery($wpdb->prefix."options", array(
+									"blog_id" => wpsg_q(strval($a->blog_id)),
+									"option_name" => wpsg_q(strval($a->option_name)),
+									"option_value" => wpsg_q(strval($a->option_value)),
+									"autoload" => wpsg_q(strval($a->autoload))
+								), true);
+
+							}
+
+						}
+
+						$this->shop->addBackendMessage(__('Einstellungen wurden erfolgreich importiert.', 'wpsg'));
 
 					}
@@ -2468,20 +2539,20 @@
 			$temp_name = $this->shop->getTempName($modul_key.'.zip');
 			@unlink($temp_name);
-				
+
 			$wpsg_update_data = wpsg_get_update_data();
 			$url = $wpsg_update_data['modulinfo'][$modul_key]['download_url'];
-			
+
 			if (!wpsg_isSizedString($url)) throw new \Exception("UngÃŒltige Download URL.");
-						
+
 			$bOK = @copy($url, $temp_name);
-			
+
 			if (!$bOK)
 			{
-			
+
 				$bOK = @file_put_contents($temp_name, $this->shop->get_url_content($url));
-			
+
 				if (!$bOK)
 				{
-						
+
 					// Pfad finden fÃŒr das Wordpress Filesystem
 					if ($GLOBALS['wpsg_sc']->isMultiBlog())
@@ -2489,89 +2560,89 @@
 					else
 						$ftp_path = WP_CONTENT_DIR.'/uploads/wpsg/wpsg_temp/';
-								
-						$ftp_path = trailingslashit($wp_filesystem->find_folder($ftp_path)).preg_replace('/(.*)\/wpsg_temp\//', '', $temp_name);
-								
-						$bOK = $wp_filesystem->put_contents($ftp_path, $this->shop->get_url_content($url), FS_CHMOD_FILE);
-								
-						if (!$bOK)
-						{
-									
-							$this->shop->addBackendError(wpsg_translate(__('Modul (#1#) konnte nicht kopiert werden!', 'wpsg'), $modul_key));
-							return false;
-			
-						}
-								
-				}
-			
-			}
-				
+
+					$ftp_path = trailingslashit($wp_filesystem->find_folder($ftp_path)).preg_replace('/(.*)\/wpsg_temp\//', '', $temp_name);
+
+					$bOK = $wp_filesystem->put_contents($ftp_path, $this->shop->get_url_content($url), FS_CHMOD_FILE);
+
+					if (!$bOK)
+					{
+
+						$this->shop->addBackendError(wpsg_translate(__('Modul (#1#) konnte nicht kopiert werden!', 'wpsg'), $modul_key));
+						return false;
+
+					}
+
+				}
+
+			}
+
 			$zip = new ZipArchive();
-			 
+
 			if ($zip->open($temp_name) === true)
 			{
-			
+
 				try
 				{
-															
+
 					$bOK = @$zip->extractTo(realpath(WPSG_PATH.'/../'));
 					$zip->close();
-			
+
 					if ($bOK === false)
 					{
-			
+
 						throw new Exception();
-							
+
 					}
 					else
 					{
-			
+
 						return true;
-							
-					}
-			
+
+					}
+
 				}
 				catch (Exception $e)
 				{
-						
+
 					// Es ist ein Fehler aufgetreten, jetzt versuche ich die Datei mit dem Wordpress Filesystem zu entpacken
-						
+
 					// Pfad finden fÃŒr das Wordpress Filesystem
 					$ftp_path = trailingslashit($wp_filesystem->find_folder(realpath(WPSG_PATH.'/../')));
-						
+
 					$bOK = unzip_file($temp_name, $ftp_path);
-						
+
 					if ($bOK !== true)
 					{
-			
+
 						$strError = '';
-			
+
 						// Hier ist immer noch ein Fehler aufgetreten
 						foreach ((array)$bOK->errors as $e)
 						{
-								
+
 							$strError .= $e[0].' ';
-			
+
 						}
-						 
+
 						$this->shop->addBackendError(wpsg_translate(__('Fehler beim Entpacken: #1#', 'wpsg'), $strError)); return false;
-			
+
 					}
 					else
 					{
-			
+
 						return true;
-			
-					}
-						
-				}
-			
+
+					}
+
+				}
+
 			}
 			else
 			{
-			
+
 				$this->shop->addBackendError(__('Datei konnte nicht ÃŒbertragen werden.', 'wpsg')); return false;
-			
-			}
-			
+
+			}
+
 			$this->shop->addBackendError(__('Datei konnte nicht entpackt werden.', 'wpsg')); return false;
 
Index: /controller/wpsg_OrderController.class.php
===================================================================
--- /controller/wpsg_OrderController.class.php	(revision 7093)
+++ /controller/wpsg_OrderController.class.php	(revision 7094)
@@ -6,5 +6,5 @@
 	class wpsg_OrderController extends wpsg_SystemController
 	{
-		
+
 		/**
 		 * Ãbernimmt die Vertreilung der Anfragen
@@ -14,5 +14,5 @@
 			//die('test');
 			parent::dispatch();
-			
+
 			if (wpsg_isSizedString($_REQUEST['subaction'], 'productData'))
 			{
@@ -31,4 +31,12 @@
 				$this->voucherDataAction();
 			}
+			if (wpsg_isSizedString($_REQUEST['subaction'], 'itemOrderData'))
+			{
+				$this->itemOrderDataAction();
+			}
+			if (wpsg_isSizedString($_REQUEST['subaction'], 'foldedItemsData'))
+			{
+				$this->foldedItemsDataAction();
+			}
 			if (wpsg_isSizedString($_REQUEST['subaction'], 'discountData'))
 			{
@@ -60,10 +68,10 @@
 			}
 			else
-			{			
+			{
 				$this->indexAction();
 			}
-			
+
 		} // public function dispatch()
-		
+
 		/**
 		 * Wird aufgerufen wenn die Produkte bearbeitet werden
@@ -71,10 +79,10 @@
 		public function productDataAction()
 		{
-			
+
 			$t1 = 0;
 			$oid = 0;
 			$option = $this->shop->get_option('wpsg_preisangaben');
 			if (isset($_REQUEST['edit_id'])) $oid = wpsg_q($_REQUEST['edit_id']);
-			
+
 			// Steuersatz berechnen
 			$oOrder = wpsg_order::getInstance($oid);
@@ -82,5 +90,5 @@
 			//$country_id = 1;
 			$country = wpsg_country::getInstance($country_id);
-			
+
 			if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'add')
 			{
@@ -88,17 +96,17 @@
 				if (isset($_REQUEST['edit_id'])) $oid = wpsg_q($_REQUEST['edit_id']);
 				if (isset($_REQUEST['p_id'])) $pid = wpsg_q($_REQUEST['p_id']);
-				
+
 				$arProd = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_PRODUCTS."` WHERE `id` = '".wpsg_q($pid)."'");
-				
+
 				$data = array('o_id' => $oid, 'p_id' => $pid, 'productkey' => $pid,
-						'menge' => 1, 'mwst_key' => $arProd['mwst_key'], 'mod_vp_varkey' => $pid,
-						'allowedpayments' => $arProd['allowedpayments'],
-						'allowedshipping' => $arProd['allowedshipping']
+				              'menge' => 1, 'mwst_key' => $arProd['mwst_key'], 'mod_vp_varkey' => $pid,
+				              'allowedpayments' => $arProd['allowedpayments'],
+				              'allowedshipping' => $arProd['allowedshipping']
 				);
-				
+
 				if ($this->shop->hasMod('wpsg_mod_weight')) $data['weight'] = $arProd['weight'];
 				// FÃŒllmenge nicht in WPSG_TBL_ORDERPRODUCT
 				//if ($this->shop->hasMod('wpsg_mod_fuellmenge')) $data['fmenge'] = $arProd['fmenge'];
-				
+
 				$noMwSt = false;
 				if (isset($_REQUEST['noMwSt']))
@@ -108,12 +116,12 @@
 					if ($noMwSt === true) $tax_value = 0; else $tax_value = $country->getTax($tax_key);
 				}
-				
+
 				$price = $arProd['preis'];
-				
+
 				if ($option == WPSG_NETTO)
 				{
 					$netto = $price;
 					$brutto = $price * ((100.0 + $tax_value) / 100.0);
-					
+
 				}
 				else
@@ -121,10 +129,10 @@
 					$netto = $price / ((100.0 + $tax_value) / 100.0);
 					$brutto = $price;
-					
+
 				}
 				$diff = $brutto - $netto;
-				
+
 				$count = $this->db->fetchOne("SELECT COUNT(*) FROM `".WPSG_TBL_ORDERPRODUCT."` WHERE `o_id` = '".wpsg_q($oid)."' ");
-				
+
 				$data['product_index'] = $count;
 				$data['price'] = $price;
@@ -133,8 +141,8 @@
 				////$data['mwst_value'] = $diff;
 				$data['mwst_value'] = $tax_value;
-				
+
 				$op_id = $this->db->ImportQuery(WPSG_TBL_ORDERPRODUCT, $data);
 				//$this->db->UpdateQuery(WPSG_TBL_ORDER, $ogs, "`id` = '".$oid."'");
-				
+
 			}
 			else if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'remove')
@@ -144,7 +152,7 @@
 				if (isset($_REQUEST['edit_id'])) $oid = wpsg_q($_REQUEST['edit_id']);
 				if (isset($_REQUEST['op_id'])) $opid = wpsg_q($_REQUEST['op_id']);
-				
+
 				$this->db->Query("DELETE FROM `".WPSG_TBL_ORDERPRODUCT."` WHERE `id` = '".wpsg_q($opid)."' ");
-				
+
 			}
 			else if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'change')
@@ -154,7 +162,7 @@
 				if (isset($_REQUEST['p_id'])) $pid = wpsg_q($_REQUEST['p_id']);
 				if (isset($_REQUEST['op_id'])) $opid = wpsg_q($_REQUEST['op_id']);
-				
+
 				$arProd = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_PRODUCTS."` WHERE `id` = '".wpsg_q($pid)."'");
-				
+
 				//$data = array('o_id' => $oid, 'p_id' => $pid, 'productkey' => $pid,
 				//		'mod_vp_varkey' => $pid,
@@ -162,12 +170,12 @@
 				//		'allowedshipping' => $arProd['allowedshipping']
 				//);
-				
+
 				if ($this->shop->hasMod('wpsg_mod_weight')) $data['weight'] = $arProd['weight'];
 				// FÃŒllmenge nicht in WPSG_TBL_ORDERPRODUCT
 				//if ($this->shop->hasMod('wpsg_mod_fuellmenge')) $data['fmenge'] = $arProd['fmenge'];
-				
+
 				$pval = abs(wpsg_tf($_REQUEST['p_val']));
 				$pme = abs(wpsg_tf($_REQUEST['p_me']));
-				
+
 				$noMwSt = false;
 				if (isset($_REQUEST['noMwSt']))
@@ -178,12 +186,12 @@
 					if ($noMwSt === true) $tax_value = 0; else $tax_value = $country->getTax($tax_key);
 				}
-				
+
 				$price = $pval;
-				
+
 				if ($option == WPSG_NETTO)
 				{
 					$netto = $price;
 					$brutto = $price * ((100.0 + $tax_value) / 100.0);
-					
+
 				}
 				else
@@ -191,8 +199,8 @@
 					$netto = $price / ((100.0 + $tax_value) / 100.0);
 					$brutto = $price;
-					
+
 				}
 				$diff = $brutto - $netto;
-				
+
 				$data['mwst_key'] = wpsg_q($_REQUEST['p_mwst']);
 				$data['menge'] = $pme;
@@ -202,25 +210,25 @@
 				////$data['mwst_value'] = $diff;
 				$data['mwst_value'] = $tax_value;
-				
+
 				$this->db->UpdateQuery(WPSG_TBL_ORDERPRODUCT, $data, "`id` = '".$opid."'");
-				
-			}
-			
+
+			}
+
 			$this->correctPrice($oid);
-			
+
 			// Order-Daten sammeln und Tabelle neu generieren
 			$basket = new wpsg_basket();
 			$basket->initFromDB($oid, true);
 			$this->shop->view['basket'] = $basket->toArray(true);
-			
+
 			$this->shop->view['colspan'] = 3;
 			if ($this->shop->get_option('wpsg_showMwstAlways') == '1' || sizeof($this->shop->view['basket']['mwst']) > 1) $this->shop->view['colspan'] ++;
-			
+
 			$this->shop->render(WPSG_PATH_VIEW.'/order/view_orderdata.phtml');
-			
+
 			exit;
-			
+
 		} // public function productDataAction()
-		
+
 		public function correctPrice($oid)
 		{
@@ -231,20 +239,20 @@
 			//$country_id = 1;
 			$country = wpsg_country::getInstance($country_id);
-			
+
 			// Tabelle Order die Preise korrigieren
 			$arOrderProd = $this->db->fetchAssoc("SELECT * FROM `".WPSG_TBL_ORDERPRODUCT."` WHERE `o_id` = '".wpsg_q($oid)."'");
-			
+
 			$data = array();
 			$data['price_gesamt'] = 0;
 			$data['price_gesamt_netto'] = 0;
 			$data['price_gesamt_brutto'] = 0;
-			
+
 			foreach ($arOrderProd as $p)
 			{
-				
+
 				$tax_key = $p['mwst_key'];
 				//if ($noMwSt === true) $tax_value = 0; else $tax_value = $country->getTax($tax_key);
 				$tax_value = $country->getTax($tax_key);
-				
+
 				if ($option == WPSG_NETTO)
 				{
@@ -253,5 +261,5 @@
 					$data['price_gesamt_netto'] += $price;
 					$data['price_gesamt_brutto'] += $price * ((100.0 + $tax_value) / 100.0);
-					
+
 				}
 				else
@@ -261,8 +269,8 @@
 					$data['price_gesamt_netto'] += $price / ((100.0 + $tax_value) / 100.0);
 					$data['price_gesamt_brutto'] += $price;
-					
-				}
-			}
-			
+
+				}
+			}
+
 			// Zusatzkosten (Gutschein, Rabatt, Versand, Zahlung) zusammenfassen
 			$p = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_ORDER."` WHERE `id` = '".wpsg_q($oid)."'");
@@ -279,15 +287,15 @@
 			$zusatz_netto += $p['price_payment_netto'];
 			$zusatz_brutto += $p['price_payment_brutto'];
-			
+
 			$data['price_gesamt'] += $zusatz;
 			$data['price_gesamt_netto'] += $zusatz_netto;
 			$data['price_gesamt_brutto'] += $zusatz_brutto;
-			
+
 			$this->db->UpdateQuery(WPSG_TBL_ORDER, $data, "`id` = '".$oid."'");
-			
+
 		}
-		
+
 		/**
-		 * Wird aufgerufen wenn die Zahlungsart verÃ€ndert wird
+		 * Wird aufgerufen, wenn die Zahlungsart verÃ€ndert wird
 		 */
 		public function paymentDataAction()
@@ -303,5 +311,5 @@
 			{
 				//'wp-admin/admin.php?page=wpsg-Admin&subaction=paymentData&do=change&edit_id=12&p_id=34&p_value=56&noheader=1';
-				
+
 				$arTaxKey = explode('_', wpsg_q($_REQUEST['mwst']));
 				$country_id = $arTaxKey[1];
@@ -323,5 +331,5 @@
 				 $valb = $pval;
 				 }
-				 
+
 				 $data = array('price_payment' => $pval, 'price_payment_brutto' => $valb, 'price_payment_netto' => $valn,
 				 'type_payment' => $pid);
@@ -336,12 +344,12 @@
 				}
 				$this->db->UpdateQuery(WPSG_TBL_ORDER, $data, "`id` = '".$oid."'");
-				
-			}
-			
+
+			}
+
 			// Order-Daten sammeln und Tabelle neu generieren
 			$basket = new wpsg_basket();
 			$basket->initFromDB($oid, true);
 			$this->shop->view['basket'] = $basket->toArray(true);
-			
+
 			//$pval = 7.9646;
 			// Aufruf in wpsg_basket mit Wert = 7.9646 ergibt 1.0354
@@ -349,5 +357,5 @@
 			//$taxp = $bc->addMwSt($this->shop->view['basket'], $pval);
 			//$taxp = abs($taxp);
-			
+
 			if ($option == WPSG_NETTO)
 			{
@@ -359,18 +367,18 @@
 			}
 			$this->db->UpdateQuery(WPSG_TBL_ORDER, $data, "`id` = '".$oid."'");
-			
+
 			$this->correctPrice($oid);
-			
+
 			$this->shop->view['colspan'] = 3;
 			if ($this->shop->get_option('wpsg_showMwstAlways') == '1' || sizeof($this->shop->view['basket']['mwst']) > 1) $this->shop->view['colspan'] ++;
-			
+
 			$this->shop->render(WPSG_PATH_VIEW.'/order/view_orderdata.phtml');
-			
+
 			exit;
-			
+
 		}	// public function paymentDataAction()
-		
+
 		/**
-		 * Wird aufgerufen wenn die Versandart verÃ€ndert wird
+		 * Wird aufgerufen, wenn die Versandart verÃ€ndert wird
 		 */
 		public function shippingDataAction()
@@ -386,5 +394,5 @@
 			{
 				//'wp-admin/admin.php?page=wpsg-Admin&subaction=shippingData&do=change&edit_id=12&p_id=34&p_value=56&noheader=1';
-				
+
 				$arTaxKey = explode('_', wpsg_q($_REQUEST['mwst']));
 				$country_id = $arTaxKey[1];
@@ -404,12 +412,12 @@
 				}
 				$this->db->UpdateQuery(WPSG_TBL_ORDER, $data, "`id` = '".$oid."'");
-				
-			}
-			
+
+			}
+
 			// Order-Daten sammeln und Tabelle neu generieren
 			$basket = new wpsg_basket();
 			$basket->initFromDB($oid, true);
 			$this->shop->view['basket'] = $basket->toArray(true);
-			
+
 			if ($option == WPSG_NETTO)
 			{
@@ -421,18 +429,18 @@
 			}
 			$this->db->UpdateQuery(WPSG_TBL_ORDER, $data, "`id` = '".$oid."'");
-			
+
 			$this->correctPrice($oid);
-			
+
 			$this->shop->view['colspan'] = 3;
 			if ($this->shop->get_option('wpsg_showMwstAlways') == '1' || sizeof($this->shop->view['basket']['mwst']) > 1) $this->shop->view['colspan'] ++;
-			
+
 			$this->shop->render(WPSG_PATH_VIEW.'/order/view_orderdata.phtml');
-			
+
 			exit;
-			
+
 		}	// public function shippingDataAction()
-		
+
 		/**
-		 * Wird aufgerufen wenn die Gutscheine verwaltet werden sollen
+		 * Wird aufgerufen, wenn die Gutscheine verwaltet werden sollen
 		 */
 		public function voucherDataAction()
@@ -442,5 +450,5 @@
 			$option = $this->shop->get_option('wpsg_preisangaben');
 			if (isset($_REQUEST['edit_id'])) $oid = wpsg_q($_REQUEST['edit_id']);
-			
+
 			if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'add')
 			{
@@ -452,5 +460,5 @@
 				$dt2 = $dt->format('Y-m-d H:i:s');
 				$gs = array('value' => '10.00', 'calc_typ' => 'w', 'code' => 'Gutschein', 'o_id' => $oid,
-						'cdate' => $dt1, 'start_date' => $dt1, 'end_date' => $dt2);
+				            'cdate' => $dt1, 'start_date' => $dt1, 'end_date' => $dt2);
 				$gs_id = $this->db->ImportQuery(WPSG_TBL_GUTSCHEIN, $gs);
 				$sval = 10.0;
@@ -463,8 +471,8 @@
 					$data = array('price_gs' => $sval, 'price_gs_brutto' => $sval);
 				}
-				
+
 				$this->db->UpdateQuery(WPSG_TBL_ORDER, $data, "`id` = '".$oid."'");
 				$_REQUEST['gs_id'] = $gs_id;
-				
+
 			}
 			else if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'remove')
@@ -475,5 +483,5 @@
 				$this->db->UpdateQuery(WPSG_TBL_ORDER, $ogs, "`id` = '".$oid."'");
 				$_REQUEST['gs_id'] = 0;
-				
+
 			}
 			else if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'editname')
@@ -482,5 +490,5 @@
 				//submitdata: { field: 'code', gs_id: 92 }
 				$data = array(wpsg_q($_REQUEST['field']) => wpsg_q($_REQUEST['value']));
-				
+
 				$this->db->UpdateQuery(WPSG_TBL_GUTSCHEIN, $data, "`id` = '".wpsg_q($_REQUEST['gs_id'])."'");
 			}
@@ -500,22 +508,22 @@
 				 //if (wpsg_q($_REQUEST['price_frontend']) == WPSG_NETTO)
 				 */
-				 if ($option == WPSG_NETTO)
-				 {
-				 	$data = array('price_gs' => $sval, 'price_gs_netto' => $sval);
-				 }
-				 else
-				 {
-				 	$data = array('price_gs' => $sval, 'price_gs_brutto' => $sval);
-				 }
-				 
-				 $this->db->UpdateQuery(WPSG_TBL_ORDER, $data, "`id` = '".wpsg_q($_REQUEST['edit_id'])."'");
-				 
-			}
-			
+				if ($option == WPSG_NETTO)
+				{
+					$data = array('price_gs' => $sval, 'price_gs_netto' => $sval);
+				}
+				else
+				{
+					$data = array('price_gs' => $sval, 'price_gs_brutto' => $sval);
+				}
+
+				$this->db->UpdateQuery(WPSG_TBL_ORDER, $data, "`id` = '".wpsg_q($_REQUEST['edit_id'])."'");
+
+			}
+
 			// Order-Daten sammeln und Tabelle neu generieren
 			$basket = new wpsg_basket();
 			$basket->initFromDB($oid, true);
 			$this->shop->view['basket'] = $basket->toArray(true);
-			
+
 			//if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'editvalue')
 			{
@@ -530,18 +538,57 @@
 				$this->db->UpdateQuery(WPSG_TBL_ORDER, $data, "`id` = '".wpsg_q($_REQUEST['edit_id'])."'");
 			}
-			
+
 			$this->correctPrice($oid);
-			
+
 			$this->shop->view['colspan'] = 3;
 			if ($this->shop->get_option('wpsg_showMwstAlways') == '1' || sizeof($this->shop->view['basket']['mwst']) > 1) $this->shop->view['colspan'] ++;
-			
+
 			$this->shop->render(WPSG_PATH_VIEW.'/order/view_orderdata.phtml');
-			
+
 			exit;
-			
+
 		} // public function voucherDataAction()
-		
+
+		/*
+		 * Wird aufgerufen, wenn Elemente der Bestellansicht in der Bestellverwaltung im alternativen Design verschoben werden
+		 */
+		public function itemOrderDataAction()
+		{
+
+			if(isset($_REQUEST['order'])  && wpsg_isSizedArray($_REQUEST['order'])) $order = $_REQUEST['order'];
+			else $order = array();
+
+			if(isset($_REQUEST['orderPosition'])  && wpsg_isSizedString($_REQUEST['orderPosition'])) $orderPos = $_REQUEST['orderPosition'];
+			else $orderPos = "";
+
+			$currentOrderLeft = $this->shop->get_option('wpsg_backendui_orderdetail_itemorder_left');
+			$currentOrderRight = $this->shop->get_option('wpsg_backendui_orderdetail_itemorder_right');
+
+			if($orderPos === "left" && $currentOrderLeft !== $order)
+				$this->shop->update_option('wpsg_backendui_orderdetail_itemorder_left', $order);
+
+			if($orderPos === "right" && $currentOrderRight !== $order)
+				$this->shop->update_option('wpsg_backendui_orderdetail_itemorder_right', $order);
+
+		} // public function itemOrderDataAction
+
+		/*
+		 * Wird aufgerufen, wenn Elemente der Bestellansicht in der Bestellverwaltung im alternativen Design eingeklappt werdeb
+		 */
+		public function foldedItemsDataAction()
+		{
+
+			if(isset($_REQUEST['folded_items'])) $items = $_REQUEST['folded_items'];
+			else $items = array();
+
+			$currentFoldedItems = $this->shop->get_option('wpsg_backendui_orderdetail_foldedpanels');
+
+			if($currentFoldedItems !== $items)
+				$this->shop->update_option('wpsg_backendui_orderdetail_foldedpanels', $items);
+
+		} // public function itemOrderDataAction
+
 		/**
-		 * Wird aufgerufen wenn die Rabatte verwaltet werden sollen
+		 * Wird aufgerufen, wenn die Rabatte verwaltet werden sollen
 		 */
 		public function discountDataAction()
@@ -551,9 +598,9 @@
 			$option = $this->shop->get_option('wpsg_preisangaben');
 			if (isset($_REQUEST['edit_id'])) $oid = wpsg_q($_REQUEST['edit_id']);
-			
+
 			if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'add')
 			{
 				if (isset($_REQUEST['edit_id'])) $oid = wpsg_q($_REQUEST['edit_id']);
-				
+
 				$sval = 10.0;
 				if ($option == WPSG_NETTO)
@@ -565,7 +612,7 @@
 					$data = array('price_rabatt' => $sval, 'price_rabatt_brutto' => $sval);
 				}
-				
+
 				$this->db->UpdateQuery(WPSG_TBL_ORDER, $data, "`id` = '".$oid."'");
-				
+
 			}
 			else if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'remove')
@@ -574,5 +621,5 @@
 				$ogs = array('price_rabatt' => 0, 'price_rabatt_netto' => 0, 'price_rabatt_brutto' => 0);
 				$this->db->UpdateQuery(WPSG_TBL_ORDER, $ogs, "`id` = '".$oid."'");
-				
+
 			}
 			else if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'editname')
@@ -580,5 +627,5 @@
 				//submitdata: { field: 'code', gs_id: 92 }
 				$data = array(wpsg_q($_REQUEST['field']) => wpsg_q($_REQUEST['value']));
-				
+
 				//$this->db->UpdateQuery(WPSG_TBL_GUTSCHEIN, $data, "`id` = '".wpsg_q($_REQUEST['gs_id'])."'");
 			}
@@ -586,5 +633,5 @@
 			{
 				$sval = abs(wpsg_tf($_REQUEST['value']));
-				
+
 				$arTaxKey = explode('_', wpsg_q($_REQUEST['mwst']));
 				$country_id = $arTaxKey[1];
@@ -603,13 +650,13 @@
 					$data = array('price_rabatt' => $sval, 'price_rabatt_brutto' => $sval);
 				}
-				
+
 				$this->db->UpdateQuery(WPSG_TBL_ORDER, $data, "`id` = '".wpsg_q($_REQUEST['edit_id'])."'");
 			}
-			
+
 			// Order-Daten sammeln und Tabelle neu generieren
 			$basket = new wpsg_basket();
 			$basket->initFromDB($oid, true);
 			$this->shop->view['basket'] = $basket->toArray(true);
-			
+
 			//if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'editvalue')
 			{
@@ -624,16 +671,16 @@
 				$this->db->UpdateQuery(WPSG_TBL_ORDER, $data, "`id` = '".wpsg_q($_REQUEST['edit_id'])."'");
 			}
-			
+
 			$this->correctPrice($oid);
-			
+
 			$this->shop->view['colspan'] = 3;
 			if ($this->shop->get_option('wpsg_showMwstAlways') == '1' || sizeof($this->shop->view['basket']['mwst']) > 1) $this->shop->view['colspan'] ++;
-			
+
 			$this->shop->render(WPSG_PATH_VIEW.'/order/view_orderdata.phtml');
-			
+
 			exit;
-			
+
 		} // public function discountDataAction()
-		
+
 		/**
 		 * Setzt den Admin Kommentar
@@ -644,10 +691,10 @@
 			$this->db->UpdateQuery(WPSG_TBL_ORDER, array(
 				'admincomment' => wpsg_q($_REQUEST['value'])
-			), "`id` = '".wpsg_q($_REQUEST['edit_id'])."'");				
-				
+			), "`id` = '".wpsg_q($_REQUEST['edit_id'])."'");
+
 			die($_REQUEST['value']);
-			
+
 		} // public function setAdminCommentAction()
-		
+
 		/**
 		 * Nimmt Ajax Anfragen innerhalb der Bestellverwaltung entgegen
@@ -655,11 +702,11 @@
 		public function ajaxAction()
 		{
-			
+
 			if (isset($_REQUEST['mod']))
 			{
-				
+
 				if (isset($_REQUEST['edit_id']))
 				{
-					
+
 					$this->shop->view['data'] = $this->db->fetchRow("
 						SELECT
@@ -670,7 +717,7 @@
 							O.`id` = '".wpsg_q($_REQUEST['edit_id'])."'					
 					");
-					
+
 					$this->shop->view['data']['shipping_land'] = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_LAND."` WHERE `id` = '".wpsg_q($this->shop->view['data']['shipping_land'])."'");
-					
+
 					$temp = $this->db->fetchRow("
 						SELECT
@@ -681,7 +728,7 @@
 							A.`id` = '".wpsg_q($this->shop->view['data']['shipping_adress_id'])."'
 					");
-					
+
 					$this->shop->view['data']['shipping_land'] = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_LAND."` WHERE `id` = '".wpsg_q($temp['land'])."'");
-					
+
 					$this->shop->view['kunde'] = $this->db->fetchRow("
 						SELECT
@@ -692,5 +739,5 @@
 							K.`id` = '".wpsg_q($this->shop->view['data']['k_id'])."'
 					");
-					
+
 					$this->shop->view['kunde']['land'] = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_LAND."` WHERE `id` = '".wpsg_q($this->shop->view['kunde']['land'])."'");
 
@@ -705,18 +752,18 @@
 
 					$this->shop->view['kunde']['land'] = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_LAND."` WHERE `id` = '".wpsg_q($temp['land'])."'");
-					
-				}
-				
+
+				}
+
 				$this->shop->callMod($_REQUEST['mod'], 'order_ajax');
-				
+
 			}
 			else if (wpsg_isSizedString($_REQUEST['wpsg_action'], 'saveInvoiceAdress'))
 			{
-				
+
 				parse_str($_REQUEST['form_data'], $form_data);
-				
+
 				/* TODO alt
 				$k_id = $this->db->fetchOne("SELECT `k_id` FROM `".WPSG_TBL_ORDER."` WHERE `id` = '".wpsg_q($_REQUEST['edit_id'])."' ");
-				
+
 				$this->db->UpdateQuery(WPSG_TBL_KU, array(
 					'firma' => wpsg_q($form_data['dialog_firma']),
@@ -730,8 +777,8 @@
 				), " `id` = '".wpsg_q($k_id)."' ");
 				*/
-				
+
 				/*
 				$a_id = $this->db->fetchOne("SELECT `adress_id` FROM `".WPSG_TBL_ORDER."` WHERE `id` = '".wpsg_q($_REQUEST['edit_id'])."' ");
-				
+
 				if ($a_id > 0) {
 					$this->db->UpdateQuery(WPSG_TBL_ADRESS, array(
@@ -747,55 +794,55 @@
 				}
 				*/
-				
-				
+
+
 				if (wpsg_isSizedInt($form_data['dialog_all']))
 				{
-						
+
 					// Alle Bestellungen des Kunden anpassen
 					$customer_id = $this->db->fetchOne("SELECT `k_id` FROM `".WPSG_TBL_ORDER."` WHERE `id` = '".wpsg_q($_REQUEST['edit_id'])."' ");
 					$arOrder = $this->db->fetchAssocField("SELECT `id` FROM `".WPSG_TBL_ORDER."` WHERE `k_id` = '".wpsg_q($customer_id)."' ");
-						
+
 				}
 				else
 				{
-						
+
 					$arOrder = array($_REQUEST['edit_id']);
-						
-				}
-				
+
+				}
+
 				$adress_data = array(
-						'firma' => wpsg_q($form_data['dialog_firma']),
-						'title' => wpsg_q($form_data['dialog_title']),
-						'vname' => wpsg_q($form_data['dialog_vname']),
-						'name' => wpsg_q($form_data['dialog_name']),
-						'fax' => wpsg_q($form_data['dialog_fax']),
-						'tel' => wpsg_q($form_data['dialog_tel']),
-						'strasse' => wpsg_q($form_data['dialog_strasse']),
-						'nr' => wpsg_q($form_data['dialog_nr']),
-						'plz' => wpsg_q($form_data['dialog_plz']),
-						'ort' => wpsg_q($form_data['dialog_ort']),
-						'land' => wpsg_q($form_data['dialog_land'])
+					'firma' => wpsg_q($form_data['dialog_firma']),
+					'title' => wpsg_q($form_data['dialog_title']),
+					'vname' => wpsg_q($form_data['dialog_vname']),
+					'name' => wpsg_q($form_data['dialog_name']),
+					'fax' => wpsg_q($form_data['dialog_fax']),
+					'tel' => wpsg_q($form_data['dialog_tel']),
+					'strasse' => wpsg_q($form_data['dialog_strasse']),
+					'nr' => wpsg_q($form_data['dialog_nr']),
+					'plz' => wpsg_q($form_data['dialog_plz']),
+					'ort' => wpsg_q($form_data['dialog_ort']),
+					'land' => wpsg_q($form_data['dialog_land'])
 				);
-				
+
 				foreach ($arOrder as $order_id)
 				{
-				
+
 					// Daten in der Bestellung aktualisieren
 					/** @var wpsg_order $oOrder */
 					$oOrder = wpsg_order::getInstance($order_id);
 					$oOrder->updateAdress($adress_data);
-					
+
 					// Daten im Kunden aktualisieren?
 					if (wpsg_isSizedInt($form_data['dialog_customer']))
 					{
-					
+
 						$oCustomer = $oOrder->getCustomer();
 						$oCustomer->updateAdress($adress_data);
 					}
-					
+
 					if (wpsg_isSizedInt($form_data['dialog_shipping']))
 					{
 						$oOrder->updateShippingAdress($adress_data);
-							
+
 						/* TODO alt
 						$this->db->UpdateQuery(WPSG_TBL_ORDER, array(
@@ -813,75 +860,75 @@
 				}
 				die("1");
-				
+
 			}
 			else if (wpsg_isSizedString($_REQUEST['wpsg_action'], 'debug_urlpay'))
 			{
-			
+
 				$oOrder = wpsg_order::getInstance($_REQUEST['edit_id']);
 				$arOrderProducts = $oOrder->getOrderProducts();
-				
+
 				foreach ($arOrderProducts as $oOrderProduct)
 				{
-					
+
 					$oProduct = $oOrderProduct->getProduct();
-					
+
 					$this->shop->notifyURL($oProduct->posturl, $oOrderProduct->getProductKey(), $oOrderProduct->getCount(), $oOrder->id, 1, false, array(
 						'product_index' => $oOrderProduct->getProductIndex()
 					));
-					
-				}
-				
+
+				}
+
 				$this->shop->addBackendMessage(__('URL Benachrichtigung (Bezahlung) wurde fÃŒr die Produkte der Bestellung simuliert.'));
 				$this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&action=view&edit_id='.$_REQUEST['edit_id']);
-				
+
 			}
 			else if (wpsg_isSizedString($_REQUEST['wpsg_action'], 'debug_urlbuy'))
 			{
-				
+
 				$oOrder = wpsg_order::getInstance($_REQUEST['edit_id']);
 				$arOrderProducts = $oOrder->getOrderProducts();
-				
+
 				foreach ($arOrderProducts as $oOrderProduct)
 				{
-						
+
 					$oProduct = $oOrderProduct->getProduct();
-						
+
 					$this->shop->notifyURL($oProduct->posturl, $oOrderProduct->getProductKey(), $oOrderProduct->getCount(), $oOrder->id, 0, false, array(
-							'product_index' => $oOrderProduct->getProductIndex()
+						'product_index' => $oOrderProduct->getProductIndex()
 					));
-						
-				}
-				
+
+				}
+
 				$this->shop->addBackendMessage(__('URL Benachrichtigung (Kauf) wurde fÃŒr die Produkte der Bestellung simuliert.'));
 				$this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&action=view&edit_id='.$_REQUEST['edit_id']);
-				
+
 			}
 			else if (wpsg_isSizedString($_REQUEST['wpsg_action'], 'debug_customermail'))
 			{
-				
+
 				$this->shop->basket->initFromDB($_REQUEST['edit_id']);
 				$arBasket = $this->shop->basket->toArray();
-				
+
 				$this->shop->basket->sendOrderSaveMails($_REQUEST['edit_id'], $arBasket, true, false, true);
-				
+
 				$this->shop->addBackendMessage(wpsg_translate(__('Kundenmail wurde erfolgreich an #1# simuliert.', 'wpsg'), $this->shop->get_option('wpsg_adminmail_empfaenger')));
 				$this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&action=view&edit_id='.$_REQUEST['edit_id']);
-				
+
 			}
 			else if (wpsg_isSizedString($_REQUEST['wpsg_action'], 'debug_adminmail'))
 			{
-				
+
 				$this->shop->basket->initFromDB($_REQUEST['edit_id']);
 				$arBasket = $this->shop->basket->toArray();
-				
+
 				$this->shop->basket->sendOrderSaveMails($_REQUEST['edit_id'], $arBasket, false, true, true);
-				
+
 				$this->shop->addBackendMessage(wpsg_translate(__('Adminmail wurde erfolgreich an #1# simuliert.', 'wpsg'), $this->shop->get_option('wpsg_adminmail_empfaenger')));
 				$this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&action=view&edit_id='.$_REQUEST['edit_id']);
-								
-			}
-			
+
+			}
+
 		} // public function ajaxAction()
-		
+
 		/**
 		 * Ãndert den Status einer Bestellung und leitet zur Bestellung zurÃŒck
@@ -889,27 +936,27 @@
 		public function switchStatusAction()
 		{
-			
-			if (!array_key_exists($_REQUEST['status'], $this->shop->arStatus)) 
-			{
-				
+
+			if (!array_key_exists($_REQUEST['status'], $this->shop->arStatus))
+			{
+
 				$this->shop->addBackendError(__('Status konnte nicht gesetzt werden!', 'wpsg'));
-				
+
 			}
 			else
 			{
-			
-				$bOK = $this->shop->setOrderStatus($_REQUEST['edit_id'], $_REQUEST['status'], (($_REQUEST['sendMail'] == '1')?true:false));												
-				
+
+				$bOK = $this->shop->setOrderStatus($_REQUEST['edit_id'], $_REQUEST['status'], (($_REQUEST['sendMail'] == '1')?true:false));
+
 				if ($bOK)
 					$this->shop->addBackendMessage(__('Status wurde erfolgreich geÃ€ndert!', 'wpsg'));
 				else
 					$this->shop->addBackendError(__('Status wurde nicht geÃ€ndert, da unverÃ€ndert.', 'wpsg'));
-				
-			}
-			
+
+			}
+
 			$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&action=view&edit_id='.$_REQUEST['edit_id']);
-			
+
 		} // public function switchStatusAction()
-		
+
 		/**
 		 * Wird beim stornieren einer einzelnen Bestellung aufgerufen
@@ -917,10 +964,10 @@
 		public function stornoAction()
 		{
-			
+
 			$this->shop->setOrderStatus($_REQUEST['edit_id'], 500, true);
-			$this->shop->addBackendMessage(__('Bestellung wurde storniert und Kunde benachrichtigt.', 'wpsg'));			
-			
+			$this->shop->addBackendMessage(__('Bestellung wurde storniert und Kunde benachrichtigt.', 'wpsg'));
+
 			$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order');
-			
+
 		} // public function stornoAction()
 
@@ -930,5 +977,5 @@
 		public function viewAction()
 		{
-			
+
 			$this->shop->view['data'] = $this->db->fetchRow("
 				SELECT
@@ -947,17 +994,17 @@
 				WHERE
 					O.`id` = '".wpsg_q($_REQUEST['edit_id'])."'	
-			"); 
-			
-			$this->shop->view['oOrder'] = wpsg_order::getInstance($_REQUEST['edit_id']);			
+			");
+
+			$this->shop->view['oOrder'] = wpsg_order::getInstance($_REQUEST['edit_id']);
 
 			$custom_data = @unserialize($this->shop->view['data']['custom_data']);
-			 
+
 			$basket = new wpsg_basket();
-			$basket->initFromDB($this->shop->view['data']['id'], true); 
+			$basket->initFromDB($this->shop->view['data']['id'], true);
 			$this->shop->view['basket'] = $basket->toArray(true);
-			
+
 			$this->shop->view['colspan'] = 3;
 			if ($this->shop->get_option('wpsg_showMwstAlways') == '1' || sizeof($this->shop->view['basket']['mwst']) > 1) $this->shop->view['colspan'] ++;
-			
+
 			$this->shop->view['arPayment'] = $this->shop->arPayment;
 			$this->shop->view['arShipping'] = $this->shop->arShipping;
@@ -973,10 +1020,10 @@
 					C.`id` = '".$this->shop->view['data']['land']."'
 			");
-			
+
 			$this->shop->view['arCountry'] = $this->db->fetchAssocField("SELECT `id`, `name` FROM `".WPSG_TBL_LAND."` WHERE 1 ", "id", "name");
-			
+
 			$this->shop->view['pflicht'] = $this->shop->loadPflichtFeldDaten();
 			$this->shop->view['arTitles'] = explode('|', $this->shop->view['pflicht']['anrede_auswahl']);
-			
+
 			$this->shop->view['shipping_country'] = $this->db->fetchRow("
 				SELECT
@@ -987,5 +1034,5 @@
 					C.`id` = '".$this->shop->view['data']['shipping_land']."'
 			");
-			
+
 			$arAdr = $this->db->fetchRow("
 						SELECT
@@ -1009,5 +1056,5 @@
 				$this->shop->callMod('wpsg_mod_orderupload', 'order_view_sidebar', array(&$_REQUEST['edit_id']));
 			}
-			
+
 			$this->shop->view['arSubAction'] = array(
 				'general' => array(
@@ -1045,9 +1092,20 @@
 
 			}
-			
-			$this->shop->render(WPSG_PATH_VIEW.'/order/view.phtml');
-			
+
+			if($this->get_option('wpsg_alternativeOrderDesign') == true)
+			{
+
+				$this->shop->render(WPSG_PATH_VIEW.'/order/view_alternativeDesign.phtml');
+
+			}
+			else
+			{
+
+				$this->shop->render(WPSG_PATH_VIEW.'/order/view.phtml');
+
+			}
+
 		} // public function viewAction()
-		
+
 		/**
 		 * Ãbernimmt das lÃ¶schen von Bestellungen
@@ -1055,11 +1113,11 @@
 		public function deleteAction()
 		{
-			
+
 			if (!isset($_REQUEST['edit_id']))
 			{
-				
+
 				$this->shop->addBackendError(__('Keine Bestellnummer ÃŒbergeben.', 'wpsg'));
 				$this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order');
-				
+
 			}
 
@@ -1069,7 +1127,7 @@
 			$this->shop->addBackendMessage(__('Bestellung erfolgreich gelÃ¶scht.', 'wpsg'));
 			$this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order');
-						
+
 		} // public function deleteAction()
-		
+
 		public function indexAction()
 		{
@@ -1084,5 +1142,5 @@
 				// Hier die Rechnungen noch einmal nach CDATE sortieren
 				$IDs = $this->db->fetchAssocField("SELECT `id` FROM `".WPSG_TBL_ORDER."` WHERE `id` IN (".wpsg_q(implode(',', $IDs)).") ORDER BY `cdate` ASC");
- 
+
 				require_once WPSG_PATH_LIB.'fpdf/fpdf.php';
 				require_once WPSG_PATH_LIB.'fpdf/fpdi.php';
@@ -1125,10 +1183,10 @@
 					}
 
-                    ob_end_clean();
-                    
+					ob_end_clean();
+
 					$pdf->Output('rechnungen.pdf', 'I');
-                    
-                    exit;
-                    
+
+					exit;
+
 				}
 				else
@@ -1142,5 +1200,5 @@
 			else if (isset($_REQUEST['wpsg_order_doaction']))
 			{
-				
+
 				if ($_REQUEST['wpsg_action'] == '-1') $this->addBackendError(__('Bitte eine Aktion wÃ€hlen!', 'wpsg'));
 				else if (!isset($_REQUEST['wpsg_multido']) || !is_array($_REQUEST['wpsg_multido'])) $this->addBackendError(__('Bitte mindestens eine Bestellung auswÃ€hlen!', 'wpsg'));
@@ -1175,11 +1233,11 @@
 						// Neuer Status
 						$_REQUEST['wpsg_rechnungen_status_neu'] = '110';
-						
+
 						// FuÃtext
 						if ($this->shop->get_option('wpsg_rechnungen_foottext_standard') !== false)
 						{
-							
+
 							$wpsg_rechnungen_footer = $this->get_option("wpsg_rechnungen_footer");
- 							if (!is_array($wpsg_rechnungen_footer)) $wpsg_rechnungen_footer = unserialize($this->get_option("wpsg_rechnungen_footer"));
+							if (!is_array($wpsg_rechnungen_footer)) $wpsg_rechnungen_footer = unserialize($this->get_option("wpsg_rechnungen_footer"));
 							if (!is_array($wpsg_rechnungen_footer)) $wpsg_rechnungen_footer = Array();
 
@@ -1219,17 +1277,17 @@
 								try
 								{
-								
+
 									$this->shop->callMod('wpsg_mod_rechnungen', 'writeRechnung', array($k, false, false));
 									$arIDs[] = $k;
 									$nWriteRechnung ++;
-									
+
 								}
 								catch (Exception $e)
 								{
-									
+
 									die($e->getMessage());
-									
+
 								}
-								
+
 							}
 
@@ -1296,5 +1354,5 @@
 
 				$this->shop->view['arFilter'] = $_REQUEST['filter'];
-				
+
 			}
 			else if (wpsg_isSizedArray($_SESSION['wpsg']['backend']['order']['arFilter']))
@@ -1307,18 +1365,18 @@
 			if (!isset($this->shop->view['arFilter']['status'])) $this->shop->view['arFilter']['status'] = '0';
 
-            // Filter gesetzt?
-            foreach (Array('s', 'k_id', 'cdate_m', 'cdate_y', 'invoicedate_m', 'invoicedate_y') as $field)
-            {
-                
-                if (wpsg_isSizedString($this->shop->view['arFilter'][$field]) && $this->shop->view['arFilter'][$field] != '-1') { $this->shop->view['hasFilter'] = true; break; }
-                
-            }
-            
-            
+			// Filter gesetzt?
+			foreach (Array('s', 'k_id', 'cdate_m', 'cdate_y', 'invoicedate_m', 'invoicedate_y') as $field)
+			{
+
+				if (wpsg_isSizedString($this->shop->view['arFilter'][$field]) && $this->shop->view['arFilter'][$field] != '-1') { $this->shop->view['hasFilter'] = true; break; }
+
+			}
+
+
 			foreach ($this->shop->arStatus as $status_key => $status_label)
 			{
 
 				if ($this->shop->get_option('wpsg_showincompleteorder') != '1' && $status_key == wpsg_ShopController::STATUS_UNVOLLSTAENDIG) continue;
-				
+
 				$arFilterState = $this->shop->view['arFilter'];
 				$arFilterState['status'] = $status_key;
@@ -1355,7 +1413,7 @@
 
 			$this->shop->render(WPSG_PATH_VIEW.'/order/index.phtml');
-			
+
 		} // public function indexAction()
-		
+
 	} // class wpsg_OrderController extends wpsg_SystemController
 
Index: /controller/wpsg_ProduktController.class.php
===================================================================
--- /controller/wpsg_ProduktController.class.php	(revision 7093)
+++ /controller/wpsg_ProduktController.class.php	(revision 7094)
@@ -6,5 +6,5 @@
 	class wpsg_ProduktController extends wpsg_SystemController
 	{
-		
+
 		/**
 		 * Ãbernimmt die Verteilung der Anfragen
@@ -12,10 +12,10 @@
 		public function dispatch()
 		{
-			
+
 			parent::dispatch();
-			
+
 			if (wpsg_isSizedString($_REQUEST['action'], 'add'))
 			{
-				$this->addAction();	
+				$this->addAction();
 			}
 			else if (wpsg_isSizedString($_REQUEST['action'], 'edit'))
@@ -25,11 +25,11 @@
 			else if (wpsg_isSizedString($_REQUEST['action'], 'export'))
 			{
-				$this->exportAction();				
-			}
-			else if (wpsg_isSizedString($_REQUEST['action'], 'exportMedia')) 
-			{
-				
+				$this->exportAction();
+			}
+			else if (wpsg_isSizedString($_REQUEST['action'], 'exportMedia'))
+			{
+
 				$this->exportMediaAction();
-				
+
 			}
 			else if (wpsg_isSizedString($_REQUEST['action'], 'import'))
@@ -61,7 +61,7 @@
 				$this->indexAction();
 			}
-			
+
 		} // public function dispatch()		
-		
+
 		/**
 		 * Nimmt Ajax Anfragen innerhalb der Produktverwaltung entgege
@@ -69,80 +69,80 @@
 		public function ajaxAction()
 		{
-			
+
 			if (isset($_REQUEST['mod']))
 			{
-				
+
 				$this->shop->callMod($_REQUEST['mod'], 'produkt_ajax');
-				
+
 			}
 			else if ($_REQUEST['cmd'] == 'upload')
-			{ 
-			  				
-				add_post_meta($_REQUEST['post_id'], 'wpsg_produkt_id', $_REQUEST['edit_id']);
-				
+			{
+
+				add_post_meta($_REQUEST['post']['id'], 'wpsg_produkt_id', $_REQUEST['edit_id']);
+
 				$this->shop->view['data']['id'] = $_REQUEST['edit_id'];
-				
+
 				die($this->imagehandler->getProductListBackend($_REQUEST['edit_id']));
-				
+
 			}
 			else if ($_REQUEST['cmd'] == 'setImageOrder')
 			{
-				
+
 				$reo = $_REQUEST['wpsg_reorder'];
 				$pid = $_REQUEST['edit_id'];
-				
+
 				$file = '';
 				$line = '';
-				
+
 				$sreo = '';
 
-				foreach ($reo as $v) 
-				{
-					
+				foreach ($reo as $v)
+				{
+
 					$st = explode('_', $v);
 					$sreo .= $st[1].',';
-					
-				}
-				
+
+				}
+
 				$sreo = substr($sreo, 0, strlen($sreo) - 1);
-				
+
 				$this->db->UpdateQuery(WPSG_TBL_PRODUCTS, array("postids" => wpsg_q($sreo)), "`id` = '".wpsg_q($pid)."'");
-				 
+
 				die('1');
-				
+
 			}
 			else if ($_REQUEST['cmd'] == 'removeImage')
 			{
-				
+
 				// Auch in der Mediathek lÃ¶schen
-				if ($_REQUEST['delmt'] === 'true') 
-				{
-					
+				if ($_REQUEST['delmt'] === 'true')
+				{
+
 					wp_delete_post($_REQUEST['pid'], true);
-					
-				}
-				
+
+				}
+
 				// Zuordnung lÃ¶schen
 				delete_post_meta($_REQUEST['pid'], 'wpsg_produkt_id', $_REQUEST['edit_id']);
-				
+
 				$this->shop->view['data']['id'] = $_REQUEST['edit_id'];
-			
+
 				if ($this->shop->hasMod('wpsg_mod_produktartikel')) $this->shop->callMod('wpsg_mod_produktartikel', 'updatePostThumbnail', array($_REQUEST['edit_id']));
-			
+
 				die($this->imagehandler->getProductListBackend($_REQUEST['edit_id']));
-				
+
 			}
 			else if ($_REQUEST['cmd'] == 'ratingDel')
 			{
-				
+
 				wp_delete_comment($_REQUEST['c_id'], true);
-				
-				//'content' => $this->shop->render(WPSG_PATH_VIEW.'/produkt/addedit_rating.phtml', false)  
+
+				//'content' => $this->shop->render(WPSG_PATH_VIEW.'/produkt/addedit_rating.phtml', false)
 				//$ret = $this->shop->render(WPSG_PATH_VIEW.'/produkt/addedit_rating.phtml');
-				
-			}
-			
+
+			}
+
 		} // public function ajaxAction()
-		
+
 		/**
 		 * Stellt die Ãbersicht der Produkte im Backend dar
@@ -159,5 +159,5 @@
 				'ascdesc' => 'ASC',
 				'status' => '0',
-				'page' => '1'                
+				'page' => '1'
 			);
 			$this->shop->view['arData'] = array();
@@ -179,5 +179,5 @@
 
 			$this->shop->view['arFilter']['showDisabled'] = true;
-			
+
 			$this->shop->view['countAll'] = wpsg_product::count($this->shop->view['arFilter']);
 
@@ -196,9 +196,9 @@
 			if (isset($_REQUEST['submit-button'])) $this->shop->view['submit'] = true;
 			else $this->shop->view['submit'] = false;
-			
+
 			$this->shop->render(WPSG_PATH_VIEW.'/produkt/index.phtml');
- 
+
 		} // public function indexAction()
-		
+
 		/**
 		 * Wird beim exportieren der Produkte aufgerufen
@@ -206,59 +206,59 @@
 		public function exportAction($bReturnData = false)
 		{
-			
+
 			$arData = $this->db->fetchAssoc("SELECT * FROM `".wpsg_q(WPSG_TBL_PRODUCTS)."` WHERE `deleted` != '1'");
-			
+
 			if (!wpsg_isSizedArray($arData)) { $this->addBackendError(__('Keine Daten zum Exportieren vorhanden.', 'wpsg')); $this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Produkt&amp;action=index'); return; }
-			
+
 			foreach ($arData as $k => $v)
 			{
-				
+
 				// Produktattribute laden
 				if ($this->shop->hasMod('wpsg_mod_produktattribute'))
 				{
-										
+
 					$att = $this->db->fetchAssoc("SELECT * FROM `".WPSG_TBL_AT."`");
-					
+
 					foreach ($att as $a)
 					{
-						
+
 						$arData[$k]["ATT_".$a['name']] = $this->db->fetchOne("SELECT `value` FROM `".WPSG_TBL_PRODUCTS_AT."` WHERE `p_id` = '".wpsg_q($v['id'])."' AND `a_id` = '".wpsg_q($a['id'])."' ");
-						
+
 					}
-						
-				}
-				
-			}
-			
+
+				}
+
+			}
+
 			$mb = new wpsg_mod_basic();
 			$path = $mb->getTmpFilePath();
-			
+
 			$fp = fopen($path.'/wpsg_productexport.csv', 'w');
 			fputcsv($fp, array_keys($arData[0]));;
-			
+
 			$arDataExport = array();
-			
+
 			foreach ($arData as $e)
 			{
-				
+
 				// ZeilenumbrÃŒche entfernen
 				if (get_option('wpsg_impexp_clearlinebreak') === '1')
 				{
-					
+
 					foreach ($e as $k => $v) { $e[$k] = preg_replace('/\r|\n/', '', $v); }
-					
-				}
-				
+
+				}
+
 				$arDataExport[] = $e;
-				
+
 				fputcsv($fp, $e, ',', '"');
-				
+
 			}
 			fclose($fp);
-			
+
 			if ($bReturnData) return array($path.'/wpsg_productexport.csv', $arDataExport);
 			else
 			{
-			
+
 				header('Content-type: application/download');
 				header('Content-Disposition:inline; filename="wpsg_productexport.csv"');
@@ -266,182 +266,182 @@
 				header('Cache-Control:must-revalidate, post-check=0, pre-check=0');
 				header('Pragma:public');
-					 
+
 				readfile($path.'/wpsg_productexport.csv');
-				die(); 
-				
-			}
-			
+				die();
+
+			}
+
 		} // public function exportAction()
-		
+
 		public function exportMediaAction()
 		{
-			
-			@ini_set('memory_limit', '2000M');			
+
+			@ini_set('memory_limit', '2000M');
 			@set_time_limit(3600);
-            
-			$zip_file = tempnam(sys_get_temp_dir(), 'wpsg');			
+
+			$zip_file = tempnam(sys_get_temp_dir(), 'wpsg');
 			$zip = new ZipArchive();
-			
-			if ($zip->open($zip_file, ZIPARCHIVE::CREATE) == true) 
-			{
-				
+
+			if ($zip->open($zip_file, ZIPARCHIVE::CREATE) == true)
+			{
+
 				// Produktdaten, wie normaler Export
-				list($product_export_file, $arData) = $this->exportAction(true);				
+				list($product_export_file, $arData) = $this->exportAction(true);
 				$zip->addFile($product_export_file, 'productdata.csv');
-			
-				// Bilddaten 				
+
+				// Bilddaten
 				foreach ($arData as $d)
 				{
-				
+
 					$arAttachmentIDs = $this->imagehandler->getAttachmentIDs($d['id']);
-				
+
 					if (wpsg_isSizedArray($arAttachmentIDs))
 					{
-					
+
 						$zip->addEmptyDir($d['id']);
-						
+
 						foreach ($arAttachmentIDs as $attachment_id)
 						{
-						
+
 							$file = get_attached_file($attachment_id);
-							
-							if (file_exists($file) && is_file($file)) 
+
+							if (file_exists($file) && is_file($file))
 							{
-								 
+
 								$zip->addFile($file, $d['id'].'/'.basename($file));
-								
+
 							}
-							
+
 						}
-						
+
 					}
-					
-				}
-				
+
+				}
+
 				$zip->close();
-				
+
 				wpsg_header::ZIP($zip_file, 'wpsg_export.zip');
-				
+
 			}
 			else
 			{
-				
+
 				$this->addBackendError(_('Konnte ZIP Archiv nicht erstellen.', 'wpsg'));
-				
-			}
-			
+
+			}
+
 			$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Produkt');
-			
+
 		} // public function exportMediaAction()
-		
+
 		/**
-		 * Wird beim importieren der Produkte aufgerufen. Zeichnet das Upload Formular und fÃŒhrt auch den Import durch 
+		 * Wird beim importieren der Produkte aufgerufen. Zeichnet das Upload Formular und fÃŒhrt auch den Import durch
 		 */
 		public function importAction()
 		{
-			 
-            @ini_set('memory_limit', '2000M');			
+
+			@ini_set('memory_limit', '2000M');
 			@set_time_limit(3600);
-            
+
 			if (isset($_REQUEST['wpsg_import']) && file_exists($_FILES['wpsg_importfile']['tmp_name']))
 			{
-				
-				// Import starten 
- 
+
+				// Import starten
+
 				$nImported = 0;
 				$arImages = array();
 				$keys = array();
-                $extract_dir = '';
-                
-                if (preg_match('/\.zip$/i', $_FILES['wpsg_importfile']['name']))
-				{
-                    
-                    $zip = new ZipArchive();
-										
-					if ($zip->open($_FILES['wpsg_importfile']['tmp_name']) === true) 
+				$extract_dir = '';
+
+				if (preg_match('/\.zip$/i', $_FILES['wpsg_importfile']['name']))
+				{
+
+					$zip = new ZipArchive();
+
+					if ($zip->open($_FILES['wpsg_importfile']['tmp_name']) === true)
 					{
-						
+
 						$extract_dir = sys_get_temp_dir().'/'.time();
-						
+
 						$zip->extractTo($extract_dir);
-    					$zip->close();
-													
+						$zip->close();
+
 						if (!file_exists($extract_dir) || !is_dir($extract_dir))
 						{
-							
+
 							$this->shop->addBackendError(__('Konnte ZIP Archiv nicht entpacken.', 'wpsg'));
 							$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Produkt');
-							
+
 						}
 						else
 						{
-							
+
 							$arZIPData = scandir($extract_dir);
-							 
+
 							foreach ($arZIPData as $z)
 							{
-								
+
 								if (is_numeric($z))
 								{
-									
+
 									$arImages[$z] = array();
 									$arImageFiles = scandir($extract_dir.'/'.$z);
-									
+
 									foreach ($arImageFiles as $if) { if (is_file($extract_dir.'/'.$z.'/'.$if)) { $arImages[$z][] = $if; } }
-									
+
 								}
-								
+
 							}
-							
+
 						}
-                        
-                        if (!file_exists($extract_dir.'/productdata.csv'))
-                        {
-                            
-                            $this->shop->addBackendError(__('Keine Produktdaten im ZIP Archiv gefunden.', 'wpsg'));
+
+						if (!file_exists($extract_dir.'/productdata.csv'))
+						{
+
+							$this->shop->addBackendError(__('Keine Produktdaten im ZIP Archiv gefunden.', 'wpsg'));
 							$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Produkt');
-                            
-                        }
+
+						}
 
 						$handle = fopen($extract_dir.'/productdata.csv', "r");
-						
+
 					}
 					else
 					{
-					
+
 						$this->shop->addBackendError(__('Konnte ZIP Archiv nicht Ã¶ffnen.', 'wpsg'));
 						$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Produkt');
-						
+
 					}
-                    
-                }
-                else
-                {
-                 
-				    $handle = fopen($_FILES['wpsg_importfile']['tmp_name'], "r");
-                    
-                }
-				
+
+				}
+				else
+				{
+
+					$handle = fopen($_FILES['wpsg_importfile']['tmp_name'], "r");
+
+				}
+
 				$i = 0;
-				while (($row = fgetcsv ($handle, 0, ",")) !== FALSE ) 
-				{
-					
+				while (($row = fgetcsv ($handle, 0, ",")) !== FALSE )
+				{
+
 					if ($i > 0)
 					{
-						
+
 						$data = array();
-						
+
 						foreach ($keys as $k => $k_name)
-						{							
+						{
 							$data[$k_name] = wpsg_q($row[$k]);
 						}
-						
+
 						if ($data['id'] <= 0) unset($data['id']);
-					  
+
 						// Alte Sachen lÃ¶sche ich vor dem Import mit der Ãbergebenen ID !
-						
+
 						// Produkt lÃ¶schen
 						$this->db->Query("DELETE FROM `".WPSG_TBL_PRODUCTS."` WHERE `id` = '".wpsg_q($data['id'])."'");
-						
+
 						// Attributwerte lÃ¶schen
 						if ($this->shop->hasMod('wpsg_mod_produktattribute'))
@@ -449,7 +449,7 @@
 							$this->db->Query("DELETE FROM `".WPSG_TBL_PRODUCTS_AT."` WHERE `p_id` = '".wpsg_q($data['id'])."'");
 						}
-						
-                        if (!isset($data['lang_parent']) || $data['lang_parent'] <= 0) $nImported ++;
-						
+
+						if (!isset($data['lang_parent']) || $data['lang_parent'] <= 0) $nImported ++;
+
 						unset($data['v_id']);
 						unset($data['mwst_value']);
@@ -457,25 +457,25 @@
 
 						$data_import = $data;
-						
+
 						foreach ($data_import as $k => $v)
-						{ 
+						{
 							if (preg_match("/^ATT_(.*)/", $k)) { unset($data_import[$k]); }
 						}
-					    
+
 						$pNeu_id = $this->db->ImportQuery(WPSG_TBL_PRODUCTS, $data_import, true);
-						 
+
 						// Attribute speichern
 						foreach ($data as $k => $v)
 						{
-							
+
 							if (preg_match("/^ATT_(.*)/", $k))
 							{
-								
+
 								// Attribute ID auslesen
 								$att_id = $this->db->fetchOne("SELECT `id` FROM `".WPSG_TBL_AT."` WHERE `name` = '".wpsg_q(preg_replace("/^ATT_/", "", $k))."' ");
-								
+
 								if ($att_id > 0)
 								{
-								
+
 									// Attribut speichern
 									$this->db->ImportQuery(WPSG_TBL_PRODUCTS_AT, array(
@@ -484,43 +484,43 @@
 										"value" => $v
 									));
-								
+
 								}
-									
+
 							}
-							
+
 						}
-                        
-                        // Bilder?
+
+						// Bilder?
 						if (wpsg_isSizedInt($data['id']) && wpsg_isSizedArray($arImages[$data['id']]))
-                        {
-                            
+						{
+
 							$arAttachmentIDs = $this->imagehandler->getAttachmentIDs($data['id']);
-							
-                            foreach (array_reverse($arImages[$data['id']]) as $img)
-                            {
-                                
+
+							foreach (array_reverse($arImages[$data['id']]) as $img)
+							{
+
 								$exist = false;
-								
-                                // PrÃŒfen ob ein Bild anhand des Namens schon im Produkt existiert
+
+								// PrÃŒfen ob ein Bild anhand des Namens schon im Produkt existiert
 								foreach ($arAttachmentIDs as $attachment_id)
 								{
-									
+
 									$file = get_attached_file($attachment_id);
-									
+
 									if (strtolower(basename($file)) == strtolower($img)) { $exist = true; break; }
-									
+
 								}
-								
+
 								if (!$exist)
 								{
-									
+
 									$this->imagehandler->addImageToProduct($extract_dir.'/'.$data['id'].'/'.$img, $data['id']);
-									
+
 								}
-								
-                            }
-                                                           
-                        }
-						
+
+							}
+
+						}
+
 					}
 					else
@@ -529,16 +529,16 @@
 						// SchlÃŒssel erzeugen
 						$keys = $row;
-					
+
 					}
-					
+
 					$i ++;
-					
-			    }
-			    
-			    fclose($handle);
-				
-			    $this->shop->addBackendMessage(wpsg_translate(__('#1# Produkte wurden importiert.', 'wpsg'), $nImported));			    
-			    die($this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Produkt&amp;action=index'));
-			    			    
+
+				}
+
+				fclose($handle);
+
+				$this->shop->addBackendMessage(wpsg_translate(__('#1# Produkte wurden importiert.', 'wpsg'), $nImported));
+				die($this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Produkt&amp;action=index'));
+
 			}
 			else if (isset($_REQUEST['wpsg_import']))
@@ -547,11 +547,11 @@
 				$this->shop->addBackendError(__('Keine Datei zum Import angegeben.', 'wpsg'));
 				$this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Produkt&amp;action=import');
-				
-			}
-			
+
+			}
+
 			$this->shop->render(WPSG_PATH_VIEW.'/produkt/import.phtml');
-			
+
 		} // public function importAction()
-		
+
 		/**
 		 * Wird beim bearbeiten aufgerufen
@@ -559,11 +559,11 @@
 		public function editAction()
 		{
-			
+
 			// VerfÃŒgbare Produkttemplates
 			$this->shop->view['templates'] = $this->shop->loadProduktTemplates();
-			
+
 			if (isset($_REQUEST['wpsg_lang']))
 			{
-				
+
 				$product_translated_id = $this->db->fetchOne("
 					SELECT
@@ -575,10 +575,10 @@
 						P.`lang_code` = '".wpsg_q($_REQUEST['wpsg_lang'])."'
 				");
-				
+
 				if ($product_translated_id <= 0)
 				{
-					
+
 					$arLang = $this->shop->getStoreLanguages();
-					
+
 					// Ãbersetzung anlegen
 					$product_data_original = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_PRODUCTS."` WHERE `id` = '".wpsg_q($_REQUEST['edit_id'])."'");
@@ -589,12 +589,12 @@
 					$product_data_original['name'] .= ' ['.$arLang[$this->shop->getLocaleToLanguageCode($_REQUEST['wpsg_lang'])]['name'].']';
 					$product_data_original['beschreibung'] .= ' ['.$arLang[$this->shop->getLocaleToLanguageCode($_REQUEST['wpsg_lang'])]['name'].']';
-					if (trim($product_data_original['detailname']) != '') $product_data_original['detailname'] .= ' ['.$arLang[$this->shop->getLocaleToLanguageCode($_REQUEST['wpsg_lang'])]['name'].']';					
-					
+					if (trim($product_data_original['detailname']) != '') $product_data_original['detailname'] .= ' ['.$arLang[$this->shop->getLocaleToLanguageCode($_REQUEST['wpsg_lang'])]['name'].']';
+
 					$product_translated_id = $this->db->ImportQuery(WPSG_TBL_PRODUCTS, $product_data_original);
-										
+
 					$this->shop->callMods('produkt_createTranslation', array(&$_REQUEST['edit_id'], &$product_translated_id));
-					
-				}
-				
+
+				}
+
 				$this->shop->view['data'] = $this->db->fetchRow("
 					SELECT
@@ -605,10 +605,10 @@
 						P.`lang_parent` = '".wpsg_q($_REQUEST['edit_id'])."' AND
 						P.`lang_code` = '".wpsg_q($_REQUEST['wpsg_lang'])."'
-				"); 
-								
+				");
+
 			}
 			else
 			{
-				
+
 				$this->shop->view['data'] = $this->db->fetchRow("
 					SELECT
@@ -619,66 +619,66 @@
 						P.`id` = '".wpsg_q($_REQUEST['edit_id'])."'
 				");
-				
+
 				$default_country = $this->shop->getDefaultCountry();
 				$this->shop->view['data']['mwst_value'] = $default_country->getTax($this->shop->view['data']['mwst_key']);
-				
-				if ($this->shop->get_option('wpsg_preisangaben') == WPSG_NETTO) $this->shop->view['data']['tax_sum_value'] = wpsg_calculateSteuer($this->shop->view['data']['preis'], WPSG_NETTO, $this->shop->view['data']['mwst_value']); 
+
+				if ($this->shop->get_option('wpsg_preisangaben') == WPSG_NETTO) $this->shop->view['data']['tax_sum_value'] = wpsg_calculateSteuer($this->shop->view['data']['preis'], WPSG_NETTO, $this->shop->view['data']['mwst_value']);
 				else $this->shop->view['data']['tax_sum_value'] = wpsg_calculateSteuer($this->shop->view['data']['preis'], WPSG_BRUTTO, $this->shop->view['data']['mwst_value']);
-				
-			}
-			
-			// Produktobject			 
+
+			}
+
+			// Produktobject
 			$this->shop->view['oProduct'] = wpsg_product::getInstance($_REQUEST['edit_id']);
-			 	
+
 			// Erlaubte Zahlungsarten
 			$this->shop->view['allowedPayment'] = wpsg_trim((array)explode(',', $this->shop->view['data']['allowedpayments']));
-			
+
 			// Erlaubte Versandarten
 			$this->shop->view['allowedShipping'] = wpsg_trim((array)explode(',', $this->shop->view['data']['allowedshipping']));
-			 
+
 			$this->shop->callMods('produkt_edit', array(&$this->shop->view['data']));
-			
+
 			// SteuersÃ€tze des Standardlandes ermitteln
 			$this->shop->view['arTaxGroup'] = array(
-				'a' => 'A', 
-				'b' => 'B', 
-				'c' => 'C', 
+				'a' => 'A',
+				'b' => 'B',
+				'c' => 'C',
 				'd' => 'D'
 			);
-			
+
 			if (wpsg_isSizedInt($this->shop->get_option('wpsg_defaultland')))
 			{
-			
+
 				$default_country = wpsg_country::getInstance($this->shop->get_option('wpsg_defaultland'));
-				
+
 				foreach ($this->shop->view['arTaxGroup'] as &$tax_group)
 				{
-					
+
 					$tax_value = $default_country->getTax(strtolower($tax_group));
-					
+
 					if (!is_null($tax_value)) $tax_group .= ' ('.wpsg_ff($tax_value, '%').' / '.$default_country->kuerzel.')';
-					
-				}
-
-			}
-			
+
+				}
+
+			}
+
 			$this->shop->view['partikel_select'] = array();
-			
+
 			$this->shop->view['partikel_select']['davor'][1]['']= 'Nicht zugeordnet';
-			
+
 			$arArtikel = get_posts('numberposts=-1'); if (wpsg_isSizedArray($arArtikel)) {
-				
-				$this->shop->view['partikel_select']['article'] = array(__('Artikel', 'wpsg'), array());				
-				foreach ($arArtikel as $a) $this->shop->view['partikel_select']['article'][1][$a->ID] = $a->post_title;
-				
-			}
-			
-			$arPages = get_pages(); if (wpsg_isSizedArray($arPages)) { 
-			
-				$this->shop->view['partikel_select']['pages'] = array(__('Seiten', 'wpsg'), array());				
-				foreach ($arPages as $p) $this->shop->view['partikel_select']['pages'][1][$p->ID] = $p->post_title;
-			
-			}
-			
+
+			$this->shop->view['partikel_select']['article'] = array(__('Artikel', 'wpsg'), array());
+			foreach ($arArtikel as $a) $this->shop->view['partikel_select']['article'][1][$a->ID] = $a->post_title;
+
+		}
+
+			$arPages = get_pages(); if (wpsg_isSizedArray($arPages)) {
+
+			$this->shop->view['partikel_select']['pages'] = array(__('Seiten', 'wpsg'), array());
+			foreach ($arPages as $p) $this->shop->view['partikel_select']['pages'][1][$p->ID] = $p->post_title;
+
+		}
+
 			$this->shop->view['arSubAction'] = array(
 				'general' => array(
@@ -687,14 +687,14 @@
 				)
 			);
-			 
+
 			$this->shop->view['arSubAction']['texte'] = array(
 				'title' => __('Texte', 'wpsg'),
-				'content' => $this->shop->render(WPSG_PATH_VIEW.'/produkt/addedit_texte.phtml', false)				
+				'content' => $this->shop->render(WPSG_PATH_VIEW.'/produkt/addedit_texte.phtml', false)
 			);
 
-            if ($this->shop->hasMod('wpsg_mod_produktartikel'))
-            {
-
-                $this->shop->view['arCom'] = $this->db->fetchAssoc("
+			if ($this->shop->hasMod('wpsg_mod_produktartikel'))
+			{
+
+				$this->shop->view['arCom'] = $this->db->fetchAssoc("
                     SELECT 
                             C.`comment_ID`, C.`comment_author`, C.`comment_date`, C.`comment_content`, M.`meta_value`,  P.`wpsg_produkt_id` 
@@ -711,50 +711,61 @@
                 ");
 
-                $this->shop->view['arSubAction']['tabrating'] = array(
-                    'title' => __('Bewertungen', 'wpsg'),
-                    'content' => $this->shop->render(WPSG_PATH_VIEW.'/produkt/addedit_rating.phtml', false)
-                );
-                
-            } 
-			
-			if (!isset($_REQUEST['wpsg_lang'])) 
-			{
-				
+				$this->shop->view['arSubAction']['tabrating'] = array(
+					'title' => __('Bewertungen', 'wpsg'),
+					'content' => $this->shop->render(WPSG_PATH_VIEW.'/produkt/addedit_rating.phtml', false)
+				);
+
+			}
+
+			if (!isset($_REQUEST['wpsg_lang']))
+			{
+
 				$this->shop->view['arSubAction']['price'] = array(
 					'title' => __('Preis / Steuer', 'wpsg'),
 					'content' => $this->shop->render(WPSG_PATH_VIEW.'/produkt/addedit_price.phtml', false)
 				);
-								
+
 				$this->shop->view['arSubAction']['payship'] = array(
 					'title' => __('Versand-/ Zahlungsarten', 'wpsg'),
 					'content' => $this->shop->render(WPSG_PATH_VIEW.'/produkt/addedit_payship.phtml', false)
 				);
-								
-			}
-			
+
+			}
+
 			/* Produktbilder */
-			if (!isset($_REQUEST['wpsg_lang'])) 
-			{
-				
+			if (!isset($_REQUEST['wpsg_lang']))
+			{
+
 				if (wpsg_isSizedInt($this->shop->view['data']['id']))
 				{
-			 
+
 					$this->shop->view['strProductList'] = $this->imagehandler->getProductListBackend($this->shop->view['data']['id']);
-					
-				}
-			
+
+				}
+
 				$this->shop->view['arSubAction']['images'] = array(
 					'title' => __('Produktbilder', 'wpsg'),
 					'content' => $this->shop->render(WPSG_PATH_VIEW.'/produkt/images.phtml', false)
 				);
-				
-			}
-			
+
+			}
+
 			$this->shop->callMods('product_addedit_content', array(&$this->shop->view['arSubAction'], &$this->shop->view['data']));
-			
-			$this->shop->render(WPSG_PATH_VIEW.'/produkt/addedit.phtml');
-			
+
+			if($this->get_option('wpsg_alternativeProductDetailDesign') == true)
+			{
+
+				$this->shop->render( WPSG_PATH_VIEW . '/produkt/addedit_alternativeDesign.phtml' );
+
+			}
+			else
+			{
+
+				$this->shop->render( WPSG_PATH_VIEW . '/produkt/addedit.phtml' );
+
+			}
+
 		} // public function editAction()
-		
+
 		/**
 		 * Wird beim kopieren eines Produkts aufgerufen
@@ -762,40 +773,40 @@
 		public function copyAction()
 		{
-			
+
 			$produkt_db = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_PRODUCTS."` WHERE `id` = '".wpsg_q($_REQUEST['edit_id'])."' ");
-			
+
 			// Neues Produkt anlegen
 			unset($produkt_db['id']);
-			
-			$produkt_db['cdate'] = 'NOW()';			
+
+			$produkt_db['cdate'] = 'NOW()';
 			$produkt_db['name'] = '['.__('KOPIE', 'wpsg').'] '.$produkt_db['name'];
-			
+
 			$produkt_db = wpsg_q($produkt_db);
-			
+
 			$new_id = $this->db->ImportQuery(WPSG_TBL_PRODUCTS, $produkt_db);
-			
+
 			// Ãbersetzungen kopieren wenn vorhanden
 			$produkt_translations = $this->db->fetchAssoc("SELECT * FROM `".WPSG_TBL_PRODUCTS."` WHERE `lang_parent` = '".wpsg_q($_REQUEST['edit_id'])."'");
-			
+
 			foreach ((array)$produkt_translations as $p)
 			{
-				
+
 				unset($p['id']);
 				$p['lang_parent'] = $new_id;
-				
+
 				$p = wpsg_q($p);
-				
+
 				$this->db->ImportQuery(WPSG_TBL_PRODUCTS, $p);
-				
-			}
-			
+
+			}
+
 			$this->shop->callMods('produkt_copy', array(&$_REQUEST['edit_id'], &$new_id));
-			
+
 			$this->addBackendMessage(__('Produkt wurde erfolgreich kopiert.', 'wpsg'));
-			
+
 			$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Produkt&action=index');
-			
+
 		} // public function copyAction()
-		
+
 		/**
 		 * Speichert ein Produkt
@@ -806,18 +817,18 @@
 			if ($this->shop->get_option('wpsg_options_nl2br') == '1')
 			{
-				
+
 				$_REQUEST['beschreibung'] = nl2br($_REQUEST['beschreibung']);
 
 			}
-			
+
 			if (isset($_REQUEST['wpsg_lang']))
 			{
-				
+
 				// Ãbersetzung speichern
-				
+
 				$trans_id = $this->db->fetchOne("SELECT `id` FROM `".WPSG_TBL_PRODUCTS."` WHERE `lang_parent` = '".wpsg_q($_REQUEST['edit_id'])."' AND `lang_code` = '".wpsg_q($_REQUEST['wpsg_lang'])."'");
-				
+
 				if ($trans_id <= 0) throw new \wpsg\Exception(__('ERROR: Ãbersetzung existiert noch nicht, das dÃŒrfte nicht passieren!', 'wpsg'));
-				
+
 				$data = array(
 					'name' => wpsg_q($_REQUEST['name']),
@@ -828,20 +839,20 @@
 					'partikel' => wpsg_q(wpsg_getStr($_REQUEST['partikel']))
 				);
-				
+
 				$this->db->UpdateQuery(WPSG_TBL_PRODUCTS, $data, "`id` = '".wpsg_q($trans_id)."'");
 
 				$this->addBackendMessage(__('Ãbersetzung erfolgreich gespeichert', 'wpsg'));
-				
+
 				$this->shop->callMods('produkt_save_translation', array(&$_REQUEST['edit_id'], &$trans_id));
-				
+
 				if (isset($_REQUEST['submit_index'])) $this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Produkt&action=index');
 				else $this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Produkt&action=edit&edit_id='.$_REQUEST['edit_id'].'&wpsg_lang='.$_REQUEST['wpsg_lang']);
-				
+
 			}
 			else
 			{
-			
+
 				// RegulÃ€res Produkt speichern
-								
+
 				$data = array(
 					'name' => wpsg_q(wpsg_getStr($_REQUEST['name'])),
@@ -852,6 +863,6 @@
 					'longdescription' => wpsg_q(wpsg_getStr($_REQUEST['longdescription'])),
 					'moreinfos' => wpsg_q(wpsg_getStr($_REQUEST['moreinfos'])),
-					'anr' => wpsg_q(wpsg_getStr($_REQUEST['anr'])), 
-					'mwst_key' => wpsg_q(wpsg_getStr($_REQUEST['mwst_key'])),		
+					'anr' => wpsg_q(wpsg_getStr($_REQUEST['anr'])),
+					'mwst_key' => wpsg_q(wpsg_getStr($_REQUEST['mwst_key'])),
 					'ptemplate_file' => wpsg_q(wpsg_getStr($_REQUEST['ptemplate_file'])),
 					'posturl' => wpsg_q(wpsg_getStr($_REQUEST['posturl'])),
@@ -868,41 +879,41 @@
 				if (wpsg_isSizedInt($_REQUEST['wpsg_paymentmethods_select'], '1'))
 				{
-				
+
 					$arAllowedPayments = wpsg_trim($_REQUEST['wpsg_paymentmethods'], '0');
 					if (wpsg_isSizedArray($arAllowedPayments)) $data['allowedpayments'] = implode(',', $arAllowedPayments);
 					else $data['allowedpayments'] = '';
-					
-				}
-				
+
+				}
+
 				// Erlaubte Versandarten speichern
 				$data['allowedshipping'] = '';
 				if (wpsg_isSizedInt($_REQUEST['wpsg_shippingmethods_select'], '1'))
 				{
-					
+
 					$arAllowedShipping = wpsg_trim($_REQUEST['wpsg_shippingmethods'], '0');
 					if (wpsg_isSizedArray($arAllowedShipping)) $data['allowedshipping'] = implode(',', $arAllowedShipping);
 					else $data['allowedshipping'] = '';
-					
-				}
-				 
+
+				}
+
 				$data['preis'] = wpsg_tf(wpsg_getStr($_REQUEST['preis']));
 				$data['oldprice'] = wpsg_tf(wpsg_getStr($_REQUEST['oldprice']));
-				 			
+
 				$this->shop->callMods('produkt_save_before', array(&$data));
 
 				if (wpsg_getInt($_REQUEST['edit_id']) > 0)
 				{
-					
+
 					$this->db->UpdateQuery(WPSG_TBL_PRODUCTS, $data, "`id` = '".wpsg_q($_REQUEST['edit_id'])."'");
 					$this->addBackendMessage(__('Produkt erfolgreich gespeichert.', 'wpsg'));
-					
+
 				}
 				else
 				{
-	
+
 					$data['cdate'] = 'NOW()';
 					$_REQUEST['edit_id'] = $this->db->ImportQuery(WPSG_TBL_PRODUCTS, $data);
 					$this->addBackendMessage(__('Produkt erfolgreich angelegt.', 'wpsg'));
-					
+
 				}
 
@@ -910,25 +921,25 @@
 				if (trim($data['anr']) == '')
 				{
-					
+
 					$data = array('anr' => wpsg_q($_REQUEST['edit_id']));
-					
+
 					$this->db->UpdateQuery(WPSG_TBL_PRODUCTS, $data, "`id` = '".wpsg_q($_REQUEST['edit_id'])."'");
 
 					// Produkt Object Cache lÃ¶schen
 					$this->shop->cache->clearProductCache($_REQUEST['edit_id']);
-					
-				}
-				
+
+				}
+
 				$this->shop->callMods('produkt_save', array(&$_REQUEST['edit_id']));
-						
+
 				if (isset($_REQUEST['submit_index'])) $this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Produkt&action=index');
 				else $this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Produkt&action=edit&edit_id='.$_REQUEST['edit_id']);
-				
-			}
-			
+
+			}
+
 			die();
-			
+
 		} // public function saveAction()
-		
+
 		/**
 		 * Wird beim erstellen eines neuen Produktes aufgerufen
@@ -936,29 +947,29 @@
 		public function addAction()
 		{
-			
+
 			// VerfÃŒgbare Produkttemplates
 			$this->shop->view['templates'] = $this->shop->loadProduktTemplates();
-			 
-			$this->shop->view['data'] = array( 
+
+			$this->shop->view['data'] = array(
 				'id' => false,
 				'ptemplate_file' => 'standard.phtml'
 			);
-			
+
 			$this->shop->view['partikel_select'] = array();
-			
+
 			$arArtikel = get_posts('numberposts=-1'); if (wpsg_isSizedArray($arArtikel)) {
-				
-				$this->shop->view['partikel_select']['article'] = array(__('Artikel', 'wpsg'), array());				
-				foreach ($arArtikel as $a) $this->shop->view['partikel_select']['article'][1][$a->ID] = $a->post_title;
-				
-			}
-			
-			$arPages = get_pages(); if (wpsg_isSizedArray($arPages)) { 
-			
-				$this->shop->view['partikel_select']['pages'] = array(__('Seiten', 'wpsg'), array());				
-				foreach ($arPages as $p) $this->shop->view['partikel_select']['pages'][1][$p->ID] = $p->post_title;
-			
-			}
-			
+
+			$this->shop->view['partikel_select']['article'] = array(__('Artikel', 'wpsg'), array());
+			foreach ($arArtikel as $a) $this->shop->view['partikel_select']['article'][1][$a->ID] = $a->post_title;
+
+		}
+
+			$arPages = get_pages(); if (wpsg_isSizedArray($arPages)) {
+
+			$this->shop->view['partikel_select']['pages'] = array(__('Seiten', 'wpsg'), array());
+			foreach ($arPages as $p) $this->shop->view['partikel_select']['pages'][1][$p->ID] = $p->post_title;
+
+		}
+
 			$this->shop->view['arSubAction'] = array(
 				'general' => array(
@@ -967,17 +978,16 @@
 				)
 			);
-			
+
 			$this->shop->view['arSubAction']['texte'] = array(
 				'title' => __('Texte', 'wpsg'),
 				'content' => $this->shop->render(WPSG_PATH_VIEW.'/produkt/addedit_texte.phtml', false)
 			);
-			
-									
+
+
 			$this->shop->callMods('product_addedit_content', array(&$this->shop->view['arSubAction'], &$this->shop->view['data']));
-			
 			$this->shop->render(WPSG_PATH_VIEW.'/produkt/addedit.phtml');
-			
+
 		} // public function addAction()
-		
+
 		/**
 		 * Wird beim lÃ¶schen eines Produktes aufgerufen
@@ -985,21 +995,21 @@
 		public function delAction()
 		{
-			
+
 			$oProduct = wpsg_product::getInstance($_REQUEST['edit_id']);
 			$oProduct->delete();
-						
+
 			// Alle Bilder eines Produktes in der Mediathek lÃ¶schen
 			$pid = $_REQUEST['edit_id'];
 			$data = $GLOBALS['wpsg_sc']->db->fetchAssoc("SELECT * FROM `".$GLOBALS['wpdb']->prefix."postmeta` WHERE `meta_key`='".wpsg_q('wpsg_produkt_id')."' AND `meta_value`='".wpsg_q($pid)."' ORDER BY `post_id`");
-			
+
 			foreach ($data as $pm) {
 				// Wenn das Bild mehrmals verwendet wird, ist die post_id mehrmals vorhanden.
 				$sql = "SELECT * FROM `".$GLOBALS['wpdb']->prefix."postmeta` WHERE `post_id` = '".wpsg_q($pm['post_id'])."'";
 				$pis = $GLOBALS['wpsg_sc']->db->fetchAssoc("SELECT * FROM `".$GLOBALS['wpdb']->prefix."postmeta` WHERE `post_id` = '".wpsg_q($pm['post_id'])."' AND `meta_key` = '".wpsg_q('wpsg_produkt_id')."'");
-				
+
 				if (count($pis) > 1) {
 					// Nur den Eintrag mit der post_id, meta_key='wpsg_produkt_id' und meta_value=product_id lÃ¶schen.
 					$GLOBALS['wpsg_sc']->db->Query("DELETE FROM `".$GLOBALS['wpdb']->prefix."postmeta` WHERE `post_id` = '".wpsg_q($pm['post_id'])."' AND `meta_key` = '".wpsg_q('wpsg_produkt_id')."' AND `meta_value` = '".wpsg_q($pid)."' ");
-					
+
 				}
 				if (count($pis) == 1) {
@@ -1007,43 +1017,43 @@
 					//$GLOBALS['wpsg_sc']->db->Query("DELETE FROM `".$GLOBALS['wpdb']->prefix."postmeta` WHERE `post_id` = '".wpsg_q($pm['post_id'])."' ");
 					//$GLOBALS['wpsg_sc']->db->Query("DELETE FROM `".$GLOBALS['wpdb']->prefix."posts` WHERE `ID` = '".wpsg_q($pm['post_id'])."' ");
-					
+
 					// Tabelle Produkte Eintrag postids leeren
 					$data = array(
-							'postids' => ''
+						'postids' => ''
 					);
 					$GLOBALS['wpsg_sc']->db->UpdateQuery(WPSG_TBL_PRODUCTS, $data, "`id` = '".wpsg_q($pid)."'");
-					
+
 					// Bilddateien lÃ¶schen
 					//delete_post_meta($pm['post_id'], 'wpsg_produkt_id');	// LÃ¶scht den Eintrag bei mehreren Produkten
 					wp_delete_attachment( $pm['post_id'], true );	// LÃ¶scht alle EintrÃ€ge zu der post_id und die Bilder
-					
-				}
-			}
-			
-			
+
+				}
+			}
+
+
 			$this->addBackendMessage(__('Produkt erfolgreich gelÃ¶scht.', 'wpsg'));
 			$this->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Produkt&action=index');
-			
+
 		} // public function delAction()
-		 		
+
 		/**
 		 * Dialog fÃŒr die Produktauswahl
 		 */
 		public function selectAction()
-		{ 
-			
+		{
+
 			if (wpsg_isSizedString($_REQUEST['wpsg_mode'], 'filterDialog'))
 			{
-				 
+
 				die($this->shop->render(WPSG_PATH_VIEW.'/produkt/select_filter.phtml'));
-				
+
 			}
 			else if (wpsg_isSizedString($_REQUEST['wpsg_mode'], 'filter'))
 			{
- 
+
 				$strQueryWHERE = '';
-				 
+
 				if (wpsg_isSizedString($_REQUEST['filter_name'])) $strQueryWHERE .= " AND P.`name` LIKE '%".wpsg_q($_REQUEST['filter_name'])."%' ";
-				
+
 				$arProductIDs = $this->db->fetchAssocField("
 					SELECT
@@ -1056,38 +1066,38 @@
 						".$strQueryWHERE."
 				");
-				 				
+
 				$this->shop->view['arProducts'] = array();
-				
+
 				// Aufwerten
 				foreach ($arProductIDs as $p_id)
 				{
-					
+
 					$product_data = $this->shop->loadProduktArray($p_id);
-					$bVariante = false;					
-					
+					$bVariante = false;
+
 					if ($this->shop->hasMod('wpsg_mod_productvariants'))
 					{
-				
+
 						$arVarianten = $this->shop->callMod('wpsg_mod_productvariants', 'getVariants', array($p_id, true, true, true));
-				
+
 						if (wpsg_isSizedArray($arVarianten))
 						{
-					
-							$bVariante = true;									
-					
+
+							$bVariante = true;
+
 						}
-				
+
 					}
-					
+
 					if (!$bVariante) $this->shop->view['arProducts'][] = $product_data;
-					
-				} 
-				
+
+				}
+
 				die($this->shop->render(WPSG_PATH_VIEW.'/produkt/select_filter_productlist.phtml'));
-				
+
 			}
 			else if ($_REQUEST['wpsg_mode'] == 'wpsg_mod_relatedproducts')
-			{ 
-				
+			{
+
 				// Bei der Auswahl fÃŒr die Ãhnlichen Produkte sollte das aktuelle Produkt und bereits relevante nicht zur auswahl stehen
 				$this->shop->view['arProdukte'] = $this->db->fetchAssocField("
@@ -1102,6 +1112,6 @@
 						P.`lang_parent` = '0' AND
 						P.`id` != '".wpsg_q($_REQUEST['edit_id'])."'
-				", "id", "name"); 
-								
+				", "id", "name");
+
 			}
 			else
@@ -1117,8 +1127,8 @@
 						`lang_parent` = '0'
 				", "id", "name"));
-				
+
 				if ($this->shop->hasMod('wpsg_mod_productgroups'))
 				{
-				
+
 					$this->shop->view['arProduktgroups'] = $this->db->fetchAssocField("
 						SELECT
@@ -1129,5 +1139,5 @@
 							PG.`deleted` != '1'					
 					", "id", "name");
-					
+
 					$this->shop->view['arProductgroupsOrder'] = array(
 						'id' => __('Interne ID', 'wpsg'),
@@ -1136,21 +1146,21 @@
 						'preis' => __('Preis', 'wpsg')
 					);
-					
+
 					$this->shop->view['arProductgroupsDirection'] = array(
 						'asc' => __('Aufsteigend', 'wpsg'),
 						'desc' => __('Absteigend', 'wpsg')
 					);
-					
-				}
-					
-			}
-			
+
+				}
+
+			}
+
 			$this->shop->view['arTemplates'] = $this->shop->loadProduktTemplates();
-			array_unshift($this->shop->view['arTemplates'], __('Aus Produkt', 'wpsg'));			
-						
+			array_unshift($this->shop->view['arTemplates'], __('Aus Produkt', 'wpsg'));
+
 			die($this->shop->render(WPSG_PATH_VIEW.'/produkt/select.phtml'));
-			
+
 		} // public function selectAction()
-		
+
 	} // class wpsg_ProduktController extends wpsg_SystemController
 
Index: /controller/wpsg_SystemController.class.php
===================================================================
--- /controller/wpsg_SystemController.class.php	(revision 7093)
+++ /controller/wpsg_SystemController.class.php	(revision 7094)
@@ -98,8 +98,8 @@
 		public function redirect($url) 
 		{
-		
+
 			header('Location: '.html_entity_decode($url));
 			exit;
-			
+
 		} // public function redirect($url)
 		
Index: /lib/functions.inc.php
===================================================================
--- /lib/functions.inc.php	(revision 7093)
+++ /lib/functions.inc.php	(revision 7094)
@@ -216,6 +216,6 @@
 		if (isset($arrayElement))
 		{
-			
-			$arrayElement += $addSet;			
+
+			$arrayElement += (int)$addSet;
 			
 		}
Index: /mods/wpsg_mod_basic.class.php
===================================================================
--- /mods/wpsg_mod_basic.class.php	(revision 7093)
+++ /mods/wpsg_mod_basic.class.php	(revision 7094)
@@ -855,7 +855,7 @@
 					$shipping_netto = $shipping_price;				
 										
-				}					
-					 
-				$shipping_mwst = $shipping_brutto - $shipping_netto;
+				}
+
+				$shipping_mwst = (int)$shipping_brutto - $shipping_netto;
 				if ($arBasket['noMwSt'] == true) $shipping_mwst = 0;
 				
Index: /mods/wpsg_mod_deliverynote.class.php
===================================================================
--- /mods/wpsg_mod_deliverynote.class.php	(revision 7093)
+++ /mods/wpsg_mod_deliverynote.class.php	(revision 7094)
@@ -87,14 +87,14 @@
 			
 		} // public function install()
-		
+
 		public function settings_edit()
 		{
-			
+
 			$this->shop->view['wpsg_mod_deliverynote']['fields'] = $this->fields;
 			$this->shop->view['wpsg_mod_deliverynote']['arTexte'] = $this->shop->get_option('wpsg_mod_deliverynote_texte');
 			if (!is_array($this->shop->view['wpsg_mod_deliverynote']['arTexte'])) $this->shop->view['wpsg_mod_deliverynote']['arTexte'] = array();
-			
+
 			$this->shop->view['foottext_list'] = $this->foottext_list();
-			
+
 			if (file_exists($this->getFilePath('').'wpsg_deliverynote_bp.jpg'))
 			{
@@ -109,5 +109,5 @@
 				$this->shop->view['wpsg_mod_deliverynote']['bp'] = false;
 			}
-				
+
 			if (file_exists($this->getFilePath('').'wpsg_deliverynote_logo.jpg'))
 			{
@@ -118,12 +118,12 @@
 				$this->shop->view['wpsg_mod_deliverynote']['logo'] = false;
 			}
-			
+
 			$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_deliverynote/settings_edit.phtml');
-			
+
 		} // public function settings_edit()
-		
+
 		public function settings_save()
 		{
-			
+
 			$this->shop->update_option('wpsg_mod_deliverynote_nrformat', $_REQUEST['wpsg_mod_deliverynote_nrformat']);
 			$this->shop->update_option('wpsg_mod_deliverynote_nr', $_REQUEST['wpsg_mod_deliverynote_nr']);
@@ -132,14 +132,14 @@
 			$this->shop->update_option('wpsg_mod_deliverynote_url', $_REQUEST['wpsg_mod_deliverynote_url']);
 			$this->shop->update_option('wpsg_mod_deliverynote_url_standard', $_REQUEST['wpsg_mod_deliverynote_url_standard']);
-			$this->shop->update_option('wpsg_mod_deliverynote_adressrow', $_REQUEST['wpsg_mod_deliverynote_adressrow']);			
+			$this->shop->update_option('wpsg_mod_deliverynote_adressrow', $_REQUEST['wpsg_mod_deliverynote_adressrow']);
 			$this->shop->update_option('wpsg_mod_deliverynote_produktattribute', $_REQUEST['wpsg_mod_deliverynote_produktattribute']);
 			$this->shop->update_option('wpsg_mod_deliverynote_hideCountry', $_REQUEST['wpsg_mod_deliverynote_hideCountry']);
 			$this->shop->update_option('wpsg_mod_deliverynote_anr', $_REQUEST['wpsg_mod_deliverynote_anr']);
-			
+
 			if (file_exists($_FILES['wpsg_mod_deliverynote_bp']['tmp_name']))
 			{
-			
+
 				$ending = strtolower(preg_replace("/(.*)\./", "", $_FILES['wpsg_mod_deliverynote_bp']['name']));
-			
+
 				if ($ending != "jpg" && $ending != "jpeg" && $ending != "pdf")
 				{
@@ -154,21 +154,32 @@
 					move_uploaded_file($_FILES['wpsg_mod_deliverynote_bp']['tmp_name'], $this->getFilePath('').'wpsg_deliverynote_bp.pdf');
 				}
-					
+
 			}
 			else if ((array_key_exists('wpsg_mod_deliverynote_bp_del', $_REQUEST)) && ($_REQUEST['wpsg_mod_deliverynote_bp_del'] == "1"))
 			{
-			
+
 				@unlink($this->getFilePath('').'wpsg_deliverynote_bp.jpg');
 				@unlink($this->getFilePath('').'wpsg_deliverynote_bp.pdf');
-			
+
 				$this->shop->addBackendMessage(__('Briefpapier wurde erfolgreich gelÃ¶scht.', 'wpsg'));
-			
-			}
-				
+
+			}
+
+
+			if (array_key_exists('wpsg_mod_deliverynote_logo_position_left', $_REQUEST) && strpos($_REQUEST['wpsg_mod_deliverynote_logo_position_left'], 'selected') !== false)
+				$wpsg_mod_deliverynote_logo_position = "left";
+
+			if (array_key_exists('wpsg_mod_deliverynote_logo_position_center', $_REQUEST) && strpos($_REQUEST['wpsg_mod_deliverynote_logo_position_center'], 'selected') !== false)
+				$wpsg_mod_deliverynote_logo_position = "center";
+
+			if (array_key_exists('wpsg_mod_deliverynote_logo_position_right', $_REQUEST) && strpos($_REQUEST['wpsg_mod_deliverynote_logo_position_right'], 'selected') !== false)
+				$wpsg_mod_deliverynote_logo_position = "right";
+
+
 			if (file_exists($_FILES['wpsg_mod_deliverynote_logo']['tmp_name']))
 			{
-			
+
 				$ending = strtolower(preg_replace("/(.*)\./", "", $_FILES['wpsg_mod_deliverynote_logo']['name']));
-			
+
 				if ($ending != "jpg" && $ending != "jpeg")
 				{
@@ -179,15 +190,18 @@
 					move_uploaded_file($_FILES['wpsg_mod_deliverynote_logo']['tmp_name'], $this->getFilePath('').'wpsg_deliverynote_logo.jpg');
 				}
-					
+
 			}
 			else if ((array_key_exists('wpsg_mod_deliverynote_logo_del', $_REQUEST)) && ($_REQUEST['wpsg_mod_deliverynote_logo_del'] == "1"))
 			{
-			
+
 				@unlink($this->getFilePath('').'wpsg_deliverynote_logo.jpg');
-			
+
 				$this->shop->addBackendMessage(__('Logo wurde erfolgreich gelÃ¶scht.', 'wpsg'));
-			
-			}
-			
+
+			}
+
+			$this->shop->update_option("wpsg_mod_deliverynote_logo_position", $wpsg_mod_deliverynote_logo_position ? $wpsg_mod_deliverynote_logo_position : null);
+			$this->shop->update_option("wpsg_mod_deliverynote_logo_transparency", $_REQUEST['wpsg_mod_deliverynote_logo_transparency']);
+
 		} // public function settings_save()
 
@@ -210,14 +224,14 @@
 		public function order_ajax()
 		{
-			
-			if (isset($_REQUEST['wpsg_mod_deliverynote_preview']))
-			{
-			 
+
+			if (isset($_REQUEST['wpsg_deliverynote_preview']))
+			{
+
 				// Vorschau eines Lieferscheines aus der Bestellverwaltung
 				$this->writeDeliverynote(
-					$_REQUEST['edit_id'], 
-					explode(',', $_REQUEST['wpsg_mod_deliverynote_productindexes']), 
-					$_REQUEST['wpsg_mod_deliverynote_fusstext'], 
-					strtotime($_REQUEST['wpsg_mod_deliverynote_date']), 
+					$_REQUEST['edit_id'],
+					explode(',', $_REQUEST['wpsg_mod_deliverynote_productindexes']),
+					$_REQUEST['wpsg_mod_deliverynote_fusstext'],
+					strtotime($_REQUEST['wpsg_mod_deliverynote_date']),
 					true
 				);
@@ -443,4 +457,10 @@
 				
 			}
+			else if ($_REQUEST['do'] == 'orderAjax')
+			{
+
+				$this->order_ajax();
+
+			}
 			
 			
@@ -569,5 +589,7 @@
 		public function writeDeliverynote($order_id, $arProductIndexes, $fussText = '', $liefer_datum = false, $preview = false, $lnr = false, $filename = false)
 		{
-			
+
+			if($preview && is_null($order_id)) $order_id = 1;
+
 			$this->shop->view['order'] = $this->shop->cache->loadOrder($order_id);
 			$this->shop->view['customer'] = $this->shop->cache->loadKunden($this->shop->view['order']['k_id']);
@@ -578,5 +600,5 @@
 			if (trim($this->shop->view['order']['language']) != '') $this->shop->setTempLocale($this->shop->view['order']['language']);
 			
-			$oOrder = wpsg_order::getInstance($order_id);  
+			$oOrder = wpsg_order::getInstance($order_id);
 			
 			// Rechnungsadresse		
@@ -591,5 +613,5 @@
 			$this->shop->view['data']['land'] = $this->shop->view['customer']['land'];
 			$this->shop->view['data']['land'] = strtoupper($oOrder->getInvoiceCountryName());
-			
+
 			// Versandadresse ?
 			if ($this->shop->hasMod('wpsg_mod_shippingadress'))
Index: /mods/wpsg_mod_rechnungen.class.php
===================================================================
--- /mods/wpsg_mod_rechnungen.class.php	(revision 7093)
+++ /mods/wpsg_mod_rechnungen.class.php	(revision 7094)
@@ -175,15 +175,21 @@
 				
 			}
+			else if ($_REQUEST['do'] == 'orderAjax')
+			{
+
+				$this->order_ajax();
+
+			}
 			
 		} // public function be_ajax()
-		
+
 		public function settings_save()
 		{
-			
+
 			if (file_exists($_FILES['wpsg_rechnungen_bp']['tmp_name']))
 			{
-				
+
 				$ending = strtolower(preg_replace("/(.*)\./", "", $_FILES['wpsg_rechnungen_bp']['name']));
-				
+
 				if ($ending != "jpg" && $ending != "jpeg" && $ending != "pdf")
 				{
@@ -191,12 +197,12 @@
 				}
 				else if ($ending == "jpg" || $ending == "jpeg")
-				{					
-					move_uploaded_file($_FILES['wpsg_rechnungen_bp']['tmp_name'], $this->getFilePath('').'wpsg_rechnungen_bp.jpg');					
-				} 
+				{
+					move_uploaded_file($_FILES['wpsg_rechnungen_bp']['tmp_name'], $this->getFilePath('').'wpsg_rechnungen_bp.jpg');
+				}
 				else if ($ending == "pdf")
 				{
 					move_uploaded_file($_FILES['wpsg_rechnungen_bp']['tmp_name'], $this->getFilePath('').'wpsg_rechnungen_bp.pdf');
 				}
-					
+
 			}
 			else if ((array_key_exists('wpsg_rechnungen_bp_del', $_REQUEST)) && ($_REQUEST['wpsg_rechnungen_bp_del'] == "1"))
@@ -205,14 +211,25 @@
 				@unlink($this->getFilePath('').'wpsg_rechnungen_bp.jpg');
 				@unlink($this->getFilePath('').'wpsg_rechnungen_bp.pdf');
-				
+
 				$this->shop->addBackendMessage(__('Briefpapier wurde erfolgreich gelÃ¶scht.', 'wpsg'));
-				
-			}
-			
+
+			}
+
+
+			if (array_key_exists('wpsg_rechnungen_logo_position_left', $_REQUEST) && strpos($_REQUEST['wpsg_rechnungen_logo_position_left'], 'selected') !== false)
+				$wpsg_rechnungen_logo_position = "left";
+
+			if (array_key_exists('wpsg_rechnungen_logo_position_center', $_REQUEST) && strpos($_REQUEST['wpsg_rechnungen_logo_position_center'], 'selected') !== false)
+				$wpsg_rechnungen_logo_position = "center";
+
+			if (array_key_exists('wpsg_rechnungen_logo_position_right', $_REQUEST) && strpos($_REQUEST['wpsg_rechnungen_logo_position_right'], 'selected') !== false)
+				$wpsg_rechnungen_logo_position = "right";
+
+
 			if (file_exists($_FILES['wpsg_rechnungen_logo']['tmp_name']))
 			{
-				
+
 				$ending = strtolower(preg_replace("/(.*)\./", "", $_FILES['wpsg_rechnungen_logo']['name']));
-				
+
 				if ($ending != "jpg" && $ending != "jpeg")
 				{
@@ -220,22 +237,24 @@
 				}
 				else if ($ending == "jpg" || $ending == "jpeg")
-				{					
-					move_uploaded_file($_FILES['wpsg_rechnungen_logo']['tmp_name'], $this->getFilePath('').'wpsg_rechnungen_logo.jpg');					
-				}  
-					
+				{
+					move_uploaded_file($_FILES['wpsg_rechnungen_logo']['tmp_name'], $this->getFilePath('').'wpsg_rechnungen_logo.jpg');
+				}
+
 			}
 			else if ((array_key_exists('wpsg_rechnungen_logo_del', $_REQUEST)) && ($_REQUEST['wpsg_rechnungen_logo_del'] == "1"))
 			{
 
-				@unlink($this->getFilePath('').'wpsg_rechnungen_logo.jpg'); 
-				
+				@unlink($this->getFilePath('').'wpsg_rechnungen_logo.jpg');
+
 				$this->shop->addBackendMessage(__('Logo wurde erfolgreich gelÃ¶scht.', 'wpsg'));
-				
-			}
-			
+
+			}
+
 			$this->shop->update_option("wpsg_mod_rechnungen_texte", $_REQUEST['text']);
-			
+
 			$this->shop->update_option("wpsg_rechnungen_url", $_REQUEST['wpsg_rechnungen_url']);
 			$this->shop->update_option("wpsg_mod_rechnungen_auto", $_REQUEST['wpsg_mod_rechnungen_auto']);
+			$this->shop->update_option("wpsg_rechnungen_logo_position", $wpsg_rechnungen_logo_position ? $wpsg_rechnungen_logo_position : null);
+			$this->shop->update_option("wpsg_rechnungen_logo_transparency", $_REQUEST['wpsg_rechnungen_logo_transparency']);
 			$this->shop->update_option("wpsg_rechnungen_faelligkeit", $_REQUEST['wpsg_rechnungen_faelligkeit']);
 			$this->shop->update_option('wpsg_rechnungen_pdfperpage', $_REQUEST['wpsg_rechnungen_pdfperpage']);
@@ -254,5 +273,5 @@
 			$this->shop->update_option('wpsg_rechnungen_foottext_standard', $_REQUEST['wpsg_rechnungen_foottext_standard']);
 			$this->shop->update_option('wpsg_mod_rechnungen_hideCountry', $_REQUEST['wpsg_mod_rechnungen_hideCountry']);
-			
+
 		}
 		
@@ -336,10 +355,10 @@
 			if (isset($_REQUEST['wpsg_rechnungen_preview']))
 			{
-				
+
 				// Vorschau einer Rechnung aus der Bestellverwaltung
-				$this->writeRechnung($_REQUEST['edit_id'], true);
-				
+				$this->writeRechnung($_REQUEST['edit_id'], true, true);
+
 				die();
-				
+
 			}
 			else if (isset($_REQUEST['wpsg_rechnungen_write']))
@@ -846,5 +865,5 @@
 		public function writeRechnung($order_id, $preview, $bOutput = true)
 		{
-             
+
 			// PrÃŒfen ob schon eine Rechnung zu dieser Bestellung existiert und eventuell Fehler werfen
 			if (!$preview)
@@ -863,5 +882,5 @@
             
 			$this->shop->view['output'] = $bOutput;
-			
+
 			$this->shop->view['data'] = $this->db->fetchRow("
 				SELECT
@@ -871,11 +890,11 @@
 				WHERE
 					O.`id` = '".wpsg_q($order_id)."'
-			");			
-						
+			");
+
 			// Wurde die Bestellung in einer anderen Sprache gemacht
 			if (trim($this->shop->view['data']['language']) != '') $this->shop->setTempLocale($this->shop->view['data']['language']);
-			
+
 			$this->getAdresse($this->shop->view['data']['k_id']);
-			
+
 			$custom_data = @unserialize($this->shop->view['data']['custom_data']);
 			$this->shop->view['basket'] = $custom_data['basket'];
@@ -908,5 +927,5 @@
 					A.`id` = '".wpsg_q($this->shop->view['data']['shipping_adress_id'])."'
 				");
-				
+
 				$this->shop->view['data']['shipping_firma'] = $temp['firma'];
 				$this->shop->view['data']['shipping_vname'] = $temp['vname'];
@@ -985,4 +1004,6 @@
 				$this->shop->view['rnr'] = $rnr.' - '.__('Vorschau', 'wpsg');
 				$r_id = "Vorschau";
+
+				wpsg_debug($this->shop->view);
 												
 			}
Index: /mods/wpsg_mod_willcollect.class.php
===================================================================
--- /mods/wpsg_mod_willcollect.class.php	(revision 7093)
+++ /mods/wpsg_mod_willcollect.class.php	(revision 7094)
@@ -16,5 +16,5 @@
 		public function __construct()
 		{
-			
+
 			parent::__construct();
 			
Index: /system/old/mod_produktbilder/produkt_addedit_content.phtml
===================================================================
--- /system/old/mod_produktbilder/produkt_addedit_content.phtml	(revision 7093)
+++ /system/old/mod_produktbilder/produkt_addedit_content.phtml	(revision 7094)
@@ -118,8 +118,8 @@
 					new AjaxUpload(
 						"upload_button_mt", {
-							action: "<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt&action=ajax&mod=wpsg_mod_produktbilder&cmd=upload_mt&edit_id=<?php echo $this->view['data']['id']; ?>&noheader=1",
+							action: "*/<?php //echo WPSG_URL_WP; ?>/*wp-admin/admin.php?page=wpsg-Produkt&action=ajax&mod=wpsg_mod_produktbilder&cmd=upload_mt&edit_id=*/<?php //echo $this->view['data']['id']; ?>/*&noheader=1",
 							onSubmit: function(file, extension) {
 
-								jQuery('#produktbilder_target_MT').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+								jQuery('#produktbilder_target_MT').html('<img src="*/<?php //echo WPSG_URL; ?>/*views/gfx/ajax-loader.gif" alt="*/<?php //echo __('Bitte warten ...', 'wpsg'); ?>/*" />');
 								
 							},
@@ -130,5 +130,5 @@
 								{
 									
-									jQuery("#produktbilder_target_MT").load("<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt&action=ajax&mod=wpsg_mod_produktbilder&cmd=produktbilder_liste_MT&edit_id=<?php echo $this->view['data']['id']; ?>&noheader=1");
+									jQuery("#produktbilder_target_MT").load("*/<?php //echo WPSG_URL_WP; ?>/*wp-admin/admin.php?page=wpsg-Produkt&action=ajax&mod=wpsg_mod_produktbilder&cmd=produktbilder_liste_MT&edit_id=*/<?php // echo $this->view['data']['id']; ?>/*&noheader=1");
 
 									//jQuery('#produktbilder_target_MT').html(data);
@@ -272,5 +272,5 @@
 
 							jQuery.ajax( {
-								url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt&action=ajax&mod=wpsg_mod_produktbilder&cmd=uploadmt&noheader=1&edit_id=<?php echo $this->view['data']['id']; ?>',
+								url: '*/<?php// echo WPSG_URL_WP; ?>/*wp-admin/admin.php?page=wpsg-Produkt&action=ajax&mod=wpsg_mod_produktbilder&cmd=uploadmt&noheader=1&edit_id=*/<?php // echo $this->view['data']['id']; ?>*/',
 								async: true,
 								data: {
Index: /views/admin/emailconf.phtml
===================================================================
--- /views/admin/emailconf.phtml	(revision 7093)
+++ /views/admin/emailconf.phtml	(revision 7094)
@@ -9,49 +9,122 @@
 	
 	<div class="list-group">
-		<span class="list-group-head list-group-item"><?php echo __('Konfiguration'); ?></span>		
-		<?php foreach ($this->view['arSubAction'] as $k => $v) { ?>		 
-		<a class="list-group-item <?php echo (($k == $this->view['subAction'])?'active':''); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;subaction=<?php echo $k; ?>"><?php echo $v['Menutext']; ?></a>		
+		<span class="list-group-head list-group-item"><?php echo __('Konfiguration'); ?></span>
+		<?php foreach ($this->view['arSubAction'] as $k => $v) { ?>
+			<a class="list-group-item <?php echo (($k == $this->view['subAction'])?'active':''); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;subaction=<?php echo $k; ?>"><?php echo $v['Menutext']; ?></a>
 		<?php } ?>
-	</div> 
-			
+	</div>
+
 </div>
-
 
 <div class="wpsg_admin_content form-horizontal">
 	<form name="form1" method="post" enctype="multipart/form-data" action="<?php echo wpsg_hspc(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=emailconf&noheader=1'); ?>">
-	
+
 		<?php echo wpsg_drawForm_AdminboxStart('Allgemeine Einstellungen', 'wpsg'); ?>
-		<?php echo wpsg_drawForm_Checkbox('wpsg_htmlmail', __('HTML Mails versenden', 'wpsg'), $this->get_option('wpsg_htmlmail')); ?>
+		<?php $logoPath = WPSG_PATH_CONTENT . 'uploads/wpsg/wpsg_mailconf/wpsg_email_logo.jpg'; ?>
+
+		<?php echo wpsg_drawForm_Checkbox(
+			'wpsg_htmlmail',
+			__('HTML Mails versenden', 'wpsg'),
+			$this->get_option('wpsg_htmlmail')
+		); ?>
+
+
+		<div class="col-emaillogo">
+
+			<?php if(file_exists($logoPath)) { ?>
+				<?php echo wpsg_drawForm_Checkbox(
+					'wpsg_email_logo_activated',
+					__("E-Maillogo anzeigen"),
+					$this->get_option('wpsg_email_logo_activated')
+				); ?>
+
+				<br>
+
+				<?php echo wpsg_drawForm_Checkbox(
+					'wpsg_email_logo_watermark',
+					__("E-Maillogo als Wasserzeichen anzeigen"),
+					$this->get_option('wpsg_email_logo_watermark')
+				); ?>
+			<?php } ?>
+
+			<div class="form-group">
+				<div class="col-sm-6 control-label control-label-email-conf">
+					<label><?php echo __("E-Maillogo (JPG)"); ?></label>
+				</div>
+				<div class="col-sm-6">
+					<?php if(file_exists($logoPath)) { ?>
+						<a href="<?php echo $this->get_option('wpsg_email_logo_url'); ?>" target="_blank"><?php echo __('Derzeitiges Logo', 'wpsg'); ?></a><br>
+					<?php } ?>
+					<input type="file" name="wpsg_email_logo">
+				</div>
+
+				<?php if(file_exists($logoPath)) { ?>
+					<?php echo wpsg_drawForm_Checkbox(
+						'wpsg_email_logo_del',
+						__("Logo LÃ¶schen"),
+						0
+					); ?>
+				<?php } ?>
+
+			</div> <!-- .form-group -->
+
+			<?php if(file_exists($logoPath)) { ?>
+
+				<div class="form-group col-logo-alignment">
+					<div class="col-sm-6 control-label control-label-email-conf">
+						<label><?php echo __("Ausrichtung des Maillogos"); ?></label>
+					</div>
+					<div class="col-sm-6 email-logo-alignment">
+						<?php $logoAlignment = $this->get_option('wpsg_email_logo_alignment'); ?>
+						<?php $standardAlignment = false; ?>
+						<?php if(!wpsg_isSizedString($logoAlignment)) $standardAlignment = true; ?>
+						<input type="radio" name="wpsg_email_logo_alignment" value="left" <?php if($logoAlignment === "left"):?>checked<?php endif;?>> <span>&#xf036 <?php echo __("LinksbÃŒndig"); ?></span> <br>
+						<input type="radio" name="wpsg_email_logo_alignment" value="center" <?php if($logoAlignment === "center"):?>checked<?php endif;?>> <span>&#xf037 <?php echo __("Zentriert"); ?></span> <br>
+						<input type="radio" name="wpsg_email_logo_alignment" value="right" <?php if($logoAlignment === "right" || $standardAlignment):?>checked<?php endif;?>> <span>&#xf038 <?php echo __("RechtsbÃŒndig"); ?></span>
+					</div>
+				</div>
+
+				<?php $logoTransparency = $this->get_option('wpsg_email_logo_transparency'); ?>
+				<?php if(!wpsg_isSized($logoTransparency)) $logoTransparency = "100%"; ?>
+				<?php echo wpsg_drawForm_Input(
+					'wpsg_email_logo_transparency',
+					__("Deckkraft des Logos"),
+					strpos($logoTransparency, "%") !== false ? $logoTransparency : $logoTransparency."%"
+				); ?>
+
+			<?php } ?>
+
+		</div>
 		<?php echo wpsg_drawForm_AdminboxEnd(); ?>
-		
+
 		<?php echo wpsg_drawEMailConfig(
-			'global', 
-			__('Globale Vorgaben', 'wpsg'), 
+			'global',
+			__('Globale Vorgaben', 'wpsg'),
 			__('Werden keine Angaben fÃŒr die folgenden E-Mails gemacht, so gelten die globalen Angaben.', 'wpsg')); ?>
-		 
+
 		<?php echo wpsg_drawEMailConfig(
-			'adminmail', 
-			__('BestellbestÃ€tigung (Admin)', 'wpsg'), 
-			__('Diese Mail bekommt der Admin beim Eingang einer neuen Bestellung.', 'wpsg'), 
+			'adminmail',
+			__('BestellbestÃ€tigung (Admin)', 'wpsg'),
+			__('Diese Mail bekommt der Admin beim Eingang einer neuen Bestellung.', 'wpsg'),
 			true); ?>
-			  		
+
 		<?php echo wpsg_drawEMailConfig(
-			'kundenmail', 
-			__('BestellbestÃ€tigung (Kunde)', 'wpsg'), 
+			'kundenmail',
+			__('BestellbestÃ€tigung (Kunde)', 'wpsg'),
 			__('Diese Mail bekommt der Kunde nach DurchfÃŒhrung der Bestellung.', 'wpsg'),
 			false,
 			true); ?>
-		
+
 		<?php echo wpsg_drawEMailConfig(
-			'status', 
-			__('StatusÃ€nderung (Kunde)', 'wpsg'), 
+			'status',
+			__('StatusÃ€nderung (Kunde)', 'wpsg'),
 			__('Diese Mail bekommt der Kunde bei der Ãnderung des Bestellstatus.', 'wpsg')); ?>
-						
+
 		<?php $this->callMods('admin_emailconf'); ?>
 
 		<div class="wpsg_hinweis"><?php echo __('Klicken Sie auf die jeweilige Mail um die Einstellungen angezeigt zu bekommen bzw. zu Ã€ndern.', 'wpsg'); ?></div>
-				
+
 		<p class="submit"><input type="submit" value="<?php echo __('Einstellungen speichern', 'wpsg'); ?>" class="button-primary" id="submit" name="submit" /></p>
-		
+
 	</form>
 </div>
@@ -66,13 +139,13 @@
 
 		var wpsg_mail_open = Array();
-		
+
 		jQuery('.wpsg_email_box .panel-body:visible').each(function() {
 
 			wpsg_mail_open.push(jQuery(this).prev().attr("id"));
-			
+
 		} );
 
 		jQuery.cookie('wpsg_mail', wpsg_mail_open.join(','));
-		 
+
 	} // function wpsg_mail_save_cookie()
 
@@ -80,9 +153,9 @@
 
 		jQuery('.wpsg_email_box .panel-heading').bind('click', function() {
- 
-			jQuery(this).next().toggle(); 
-			
+
+			jQuery(this).next().toggle();
+
 			wpsg_mail_save_cookie();
-			
+
 		} ).css( { 'cursor': 'pointer' } ).disableSelection().next().hide();
 
@@ -94,13 +167,29 @@
 			for (var i = 0; i < arOpen.length; i ++)
 			{
- 
+
 				jQuery('#' + arOpen[i]).next().show();
-				jQuery('#' + arOpen[i]).css('border-bottom', '0px');	
-				
+				jQuery('#' + arOpen[i]).css('border-bottom', '0px');
+
 			}
-			
-		}				
-		
+
+		}
+
+		jQuery("#wpsg_htmlmail").click(function() {
+
+			if(jQuery("#wpsg_htmlmail")[0].checked == false) jQuery(".col-emaillogo").css("display", "none");
+			else $(".col-emaillogo").css("display", "block");
+
+		});
+		if(jQuery("#wpsg_htmlmail")[0].checked == false) jQuery(".col-emaillogo").css("display", "none");
+
+		jQuery("#wpsg_email_logo_watermark").click(function() {
+
+			if(jQuery("#wpsg_email_logo_watermark")[0].checked == true) jQuery(".col-logo-alignment").hide();
+			else jQuery(".col-logo-alignment").show()
+
+		});
+		if(jQuery("#wpsg_email_logo_watermark")[0].checked == true) jQuery(".col-logo-alignment").hide();
+
 	} );
 
-/* ]]> */</script>
+	/* ]]> */</script>
Index: /views/admin/presentation.phtml
===================================================================
--- /views/admin/presentation.phtml	(revision 7093)
+++ /views/admin/presentation.phtml	(revision 7094)
@@ -9,43 +9,44 @@
 	
 	<div class="list-group">
-		<span class="list-group-head list-group-item"><?php echo __('Konfiguration'); ?></span>		
-		<?php foreach ($this->view['arSubAction'] as $k => $v) { ?>		 
-		<a class="list-group-item <?php echo (($k == $this->view['subAction'])?'active':''); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;subaction=<?php echo $k; ?>"><?php echo $v['Menutext']; ?></a>		
+		<span class="list-group-head list-group-item"><?php echo __('Konfiguration'); ?></span>
+		<?php foreach ($this->view['arSubAction'] as $k => $v) { ?>
+			<a class="list-group-item <?php echo (($k == $this->view['subAction'])?'active':''); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;subaction=<?php echo $k; ?>"><?php echo $v['Menutext']; ?></a>
 		<?php } ?>
-	</div> 
-			
+	</div>
+
 </div>
-		
+
 <div class="wpsg_admin_content form-horizontal">
 	<form name="form1" method="post" enctype="multipart/form-data" action="<?php echo wpsg_hspc(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=presentation&noheader=1'); ?>">
-	 
-	 	<div class="panel panel-default">
-  			<div class="panel-heading clearfix">
-          		<h3 class="panel-title"><?php echo __('Darstellung', 'wpsg'); ?></h3>
-        	</div>
-  			<div class="panel-body">
-	 
-	 			<?php echo wpsg_drawForm_Select('wpsg_form_validation', __('Formular Validierung', 'wpsg'), array(
-	 				'0' => __('Serverseitig', 'wpsg'),
-	 				'1' => __('Serverseitig + Javascript V1', 'wpsg'),
-	 				'2' => __('Serverseitig + Javascript V2', 'wpsg')
-	 			), $this->get_option('wpsg_form_validation')); ?>
-	 			
+
+		<div class="panel panel-default">
+			<div class="panel-heading clearfix">
+				<h3 class="panel-title"><?php echo __('Darstellung', 'wpsg'); ?></h3>
+			</div>
+			<div class="panel-body">
+
+				<?php echo wpsg_drawForm_Select('wpsg_form_validation', __('Formular Validierung', 'wpsg'), array(
+					'0' => __('Serverseitig', 'wpsg'),
+					'1' => __('Serverseitig + Javascript V1', 'wpsg'),
+					'2' => __('Serverseitig + Javascript V2', 'wpsg')
+				), $this->get_option('wpsg_form_validation')); ?>
+
 				<?php echo wpsg_drawForm_Checkbox('wpsg_imagehandler_basketimage', __('Produktbild im Warenkorb anzeigen', 'wpsg'), $this->get_option('wpsg_imagehandler_basketimage')); ?>
 				<?php echo wpsg_drawForm_Checkbox('wpsg_imagehandler_overviewimage', __('Produktbild in Bestellzusammenfassung anzeigen', 'wpsg'), $this->get_option('wpsg_imagehandler_overviewimage')); ?>
-				
+
 				<?php $this->callMods('admin_presentation'); ?>
-			 	
+
 				<?php echo wpsg_drawForm_Checkbox('wpsg_showMwstAlways', __('MwSt. Spalte auch bei einem Satz zeigen', 'wpsg'), $this->get_option('wpsg_showMwstAlways')); ?>
-			 	<?php echo wpsg_drawForm_Checkbox('wpsg_showArticelnumber', __('Artikelnummer im Produkttemplate anzeigen', 'wpsg'), $this->get_option('wpsg_showArticelnumber')); ?>
-			 	<?php echo wpsg_drawForm_Checkbox('wpsg_hideBasketCountrySelect', __('LÃ€nderauswahl im Warenkorb verbergen', 'wpsg'), $this->get_option('wpsg_hideBasketCountrySelect')); ?>
+				<?php echo wpsg_drawForm_Checkbox('wpsg_showArticelnumber', __('Artikelnummer im Produkttemplate anzeigen', 'wpsg'), $this->get_option('wpsg_showArticelnumber')); ?>
+				<?php echo wpsg_drawForm_Checkbox('wpsg_hideBasketCountrySelect', __('LÃ€nderauswahl im Warenkorb verbergen', 'wpsg'), $this->get_option('wpsg_hideBasketCountrySelect')); ?>
 
-			    <br />
+				<br />
 
-			    <?php echo wpsg_drawForm_Checkbox('wpsg_v3DesignMode', __('Design der Version 3 fÃŒr die Produktverwaltung aktivieren', 'wpsg'), $this->get_option('wpsg_v3DesignMode'), array('help' => 'wpsg_v3DesignMode')); ?>
+				<?php echo wpsg_drawForm_Checkbox('wpsg_alternativeProductDetailDesign', __('Alternatives Design fÃŒr die Produktverwaltung aktivieren', 'wpsg'), $this->get_option('wpsg_alternativeProductDetailDesign'), array('help' => 'alternativeProductDetailDesign')); ?>
+				<?php echo wpsg_drawForm_Checkbox('wpsg_alternativeOrderDesign', __('Alternatives Design fÃŒr die Bestellansichtsseite aktivieren', 'wpsg'), $this->get_option('wpsg_alternativeOrderDesign'), array('help' => 'alternativeOrderDesign')); ?>
 
-			 </div>
+			</div>
 		</div>
-	 		 
+
 		<p class="submit"><input type="submit" value="<?php echo __('Einstellungen speichern', 'wpsg'); ?>" class="button-primary" id="submit" name="submit" /></p>
 	
Index: /views/css/admin.css
===================================================================
--- /views/css/admin.css	(revision 7093)
+++ /views/css/admin.css	(revision 7094)
@@ -12,5 +12,5 @@
 #wpsg-bs .flex { display:flex; }
 #wpsg-bs .flex-100 { width:100%; justify-content:space-between; }
-#wpsg-bs nav.navbar { margin-right:20px; } 
+#wpsg-bs nav.navbar { margin-right:20px; }
 #wpsg-bs nav.navbar li { margin-bottom:0px; }
 #wpsg-bs nav.navbar .active { margin-right:2px; }
@@ -24,5 +24,5 @@
 #wpsg-bs .content { width:100%; box-sizing:border-box; padding-right:20px; }
 #wpsg-bs .form-group { margin-bottom:5px; margin-top:5px; }
-#wpsg-bs .form-checkbox { margin-top:-5px; margin-bottom:0px; } 
+#wpsg-bs .form-checkbox { margin-top:-5px; margin-bottom:0px; }
 #wpsg-bs .popover { max-width:400px; margin-right:20px; }
 #wpsg-bs .arrow { margin-left:0px !important; }
@@ -109,5 +109,5 @@
 
 /* Kundenkontakt */
-.wpsg_kundenkontakt_template, 
+.wpsg_kundenkontakt_template,
 .wpsg_kundenkontakt_betreff { width:80%; float:right; margin-bottom:20px; }
 .wpsg_kundenkontakt_textarea { width:100%; float:right; height:150px; }
@@ -134,5 +134,5 @@
 #wpsg-bs .has-feedback .wpsg_field_wrap { width:100%; position:relative; padding-right:25px; }
 #wpsg-bs .wpsg_field_wrap .form-control-feedback { right:0px; width:20px; cursor:pointer; pointer-events:all; }
-#wpsg-bs .form-checkbox .wpsg_field_wrap .form-control-feedback { line-height:25px; } 
+#wpsg-bs .form-checkbox .wpsg_field_wrap .form-control-feedback { line-height:25px; }
 #wpsg-bs .wpsg_field_wrap .form-control-feedback:focus,
 #wpsg-bs .wpsg_field_wrap .form-control-feedback:hover { text-decoration:none; }
@@ -140,5 +140,5 @@
 
 /* Bootstrap Formulare im alten Teil */
-.wpsg_old_forms .form-group { margin-left:-15px; margin-right:-15px; margin-bottom:5px; } 
+.wpsg_old_forms .form-group { margin-left:-15px; margin-right:-15px; margin-bottom:5px; }
 .wpsg_old_forms .form-checkbox > div:first-child { width:100%; margin-left:0px; }
 
@@ -175,4 +175,7 @@
 .wpsg_admin_ueber_check_wrap .wpsg_admin_ueber_check_2 { } /* Warnungen Meldungen */
 .wpsg_admin_ueber_check_wrap .wpsg_admin_ueber_check_3 { } /* Error Meldungen */
+.email-logo-alignment, .email-logo-alignment input[type="radio"] { font-family: FontAwesome; margin: 0; outline: 0; }
+.email-logo { padding-bottom: 10px; }
+.email-logo-watermark { position:absolute; top:10%; left:0; right:0; display:flex; justify-content:center; align-items:center; }
 
 /* Produktverwaltung */
@@ -212,7 +215,8 @@
 .addedit_templateV3 #wpsg_mods br:first-child{ display: block !important; }
 
+
 /* Bild allgemein */
 .box_img_wrap { position:relative; padding-top:100%; border:1px solid #000000; background:transparent; }
-.box_img_wrap img {border:0px !important; position:absolute; left:50%; top:50%; max-height:100% !important; max-width:100%!important; height:auto!important; width:auto!important; margin:0px !important; 
+.box_img_wrap img {border:0px !important; position:absolute; left:50%; top:50%; max-height:100% !important; max-width:100%!important; height:auto!important; width:auto!important; margin:0px !important;
     transform:translateY(-50%) translateX(-50%);
     -ms-transform:translateY(-50%) translateX(-50%);
@@ -230,5 +234,5 @@
 /* Bewertung */
 .wpsg_rating { background-color:#29556E; }
-.sto_comment_form .comment_list, 
+.sto_comment_form .comment_list,
 .sto_comment_form .comment_form { width:55rem; }
 .wpsg_comment_form .comment { background-color:#ececec; padding:20px; margin-bottom:30px; }
@@ -297,5 +301,5 @@
 .wpsg_mod_produktbilder_admin_bild a > span { left:0px; top:0px; display:none; position:absolute; width:100%; height:100%; text-align:center; background-color:rgba(255, 0, 0, 0.3); }
 .wpsg_mod_produktbilder_admin_bild a > span > span { font-size:30px; top:50%; margin-top:-15px; }
-.wpsg_mod_produktbilder_admin_bild a:hover > span { display:block; }  
+.wpsg_mod_produktbilder_admin_bild a:hover > span { display:block; }
 
 /* Modul Produktartikel (wpsg_mod_produktartikel) */
@@ -355,4 +359,8 @@
 .wpsg_mod_deliverynote_fieldtable .col_groesse { width:60px; }
 .wpsg_foottextlist .col_standard { text-align:center; }
+.align-buttons input, .align-buttons input:hover { font-family: FontAwesome !important; cursor: pointer; outline: 0; border: 1px solid #ddd; background: #f9f9f9; color: #666; padding: 3px 7px; width: 30%; }
+.align-buttons-active { background: #f1f1f1 !important; border-color: #ccc !important; box-shadow: 0 1px 0 #ccc; color: #555 !important; }
+.logo-transparency * { text-align:center; }
+.logo-transparency input { width: 30%; margin-left: -20px; margin-right: 5px; }
 
 #rechnungen_order_backend label,
@@ -361,5 +369,5 @@
 #wpsg_rechnungen_status_neu,
 #wpsg_rechnungen_datum,
-#wpsg_rechnungen_select, 
+#wpsg_rechnungen_select,
 #wpsg_rechnungen_fusstext { font-size:12px; font-family:"Helvetica Neue", Helvetica, Arial, sans-serif; color:#333; }
 
@@ -384,5 +392,5 @@
 .wpsg_mod_downloadplus_fieldtable .col_y { width:50px; }
 
-/* Produktvariablen */ 
+/* Produktvariablen */
 .wpsg_pv_table { width:100%; }
 .wpsg_pv_table tr td { vertical-align:top; }
@@ -393,5 +401,5 @@
 .wpsg_pv_table .wpsg_label { text-align:left; }
 
-/* Produktattribute */ 
+/* Produktattribute */
 .wpsg_pa_table { width:100%; }
 .wpsg_pa_table tr td { vertical-align:top; }
@@ -438,16 +446,16 @@
 
 @media (min-width:1024px) and (max-width:1640px) {
-	
-	
+
+
 }
 
 
 @media (min-width:768px) and (max-width:1023px) {
-	
-	
+
+
 }
 
 @media (min-width:375px) and (max-width:767px) {
-	
-	
+
+
 }
Index: /views/mailtemplates/html/adminmail.phtml
===================================================================
--- /views/mailtemplates/html/adminmail.phtml	(revision 7093)
+++ /views/mailtemplates/html/adminmail.phtml	(revision 7094)
@@ -3,4 +3,6 @@
 	/* Wichtig, da die Module sonst kein HTML zurÃŒckgeben */
 	$this->htmlMail = true;
+
+	include(WPSG_PATH_VIEW . 'mailtemplates/html/logo.phtml');
 
 ?>
Index: /views/mailtemplates/html/kundenmail.phtml
===================================================================
--- /views/mailtemplates/html/kundenmail.phtml	(revision 7093)
+++ /views/mailtemplates/html/kundenmail.phtml	(revision 7094)
@@ -3,4 +3,6 @@
 	/* Wichtig, da die Module sonst kein HTML zurÃŒckgeben */
 	$this->htmlMail = true;
+
+	include(WPSG_PATH_VIEW . 'mailtemplates/html/logo.phtml');
 
 ?>
Index: /views/mailtemplates/html/logo.phtml
===================================================================
--- /views/mailtemplates/html/logo.phtml	(revision 7094)
+++ /views/mailtemplates/html/logo.phtml	(revision 7094)
@@ -0,0 +1,33 @@
+<style>
+	.email-logo { padding-bottom: 10px; }
+	.email-logo-watermark { position:absolute; top:10%; left:0; right:0; display:flex; justify-content:center; align-items:center; }
+</style>
+
+<?php
+	if($this->get_option('wpsg_email_logo_activated'))
+	{
+
+		$logoWatermark = $this->get_option('wpsg_email_logo_watermark') ? "email-logo-watermark" : "";
+
+		$logoTransparency = str_replace("#", "", get_option('wpsg_email_logo_transparency'));
+		if($logoTransparency !== "100") $logoTransparency = str_replace(array("0", "00"), "", $logoTransparency);
+		if($logoTransparency !== "100") $logoTransparency = "0." . $logoTransparency;
+
+		$logoAlignment = $this->get_option('wpsg_email_logo_alignment');
+		$logoPath = WPSG_PATH_CONTENT . 'uploads/wpsg/wpsg_mailconf/wpsg_email_logo.jpg';
+
+		if(file_exists($logoPath))
+		{
+			$logoType = pathinfo($logoPath);
+			$logoData = file_get_contents($logoPath);
+			$logoBase64 = 'data:image/' . $logoType . ';base64,' . base64_encode($logoData);
+		}
+
+	}
+?>
+
+<?php if(file_exists($logoPath) && $this->get_option('wpsg_email_logo_activated')) { ?>
+	<?php echo "<div class='email-logo $logoWatermark' style='text-align:$logoAlignment; opacity:$logoTransparency;'>" ?>
+	<?php echo "<img alt='Emaillogo' class='email-logo-$logoAlignment' src='$logoBase64'>"; ?>
+	<?php echo "</div>"; ?>
+<?php } ?>
Index: /views/mailtemplates/html/status.phtml
===================================================================
--- /views/mailtemplates/html/status.phtml	(revision 7093)
+++ /views/mailtemplates/html/status.phtml	(revision 7094)
@@ -7,4 +7,6 @@
 	/* Wichtig, da die Module sonst kein HTML zurÃŒckgeben */
 	$this->htmlMail = true;
+
+	include(WPSG_PATH_VIEW . 'mailtemplates/html/logo.phtml');
 
 ?>
Index: /views/mods/mod_abo/mail_admin_stoprenewal_html.phtml
===================================================================
--- /views/mods/mod_abo/mail_admin_stoprenewal_html.phtml	(revision 7093)
+++ /views/mods/mod_abo/mail_admin_stoprenewal_html.phtml	(revision 7094)
@@ -4,5 +4,7 @@
      * Template fÃŒr die Mail, die der Admin bekommt wenn ein Kunde ein Abo im Frontend anhalten mÃ¶chte (HTML)
      */
-    
+
+	include(WPSG_PATH_VIEW . 'mailtemplates/html/logo.phtml');7
+
 ?>
 
Index: /views/mods/mod_abo/mail_expiration_html.phtml
===================================================================
--- /views/mods/mod_abo/mail_expiration_html.phtml	(revision 7093)
+++ /views/mods/mod_abo/mail_expiration_html.phtml	(revision 7094)
@@ -4,4 +4,6 @@
 	 * Mail die beim Auslauf eines Abos versendet wird (HTML)
 	 */
+
+	include(WPSG_PATH_VIEW . 'mailtemplates/html/logo.phtml');
 
 ?><p><?php echo __('Hallo', 'wpsg'); ?> <?php echo wpsg_hspc($this->view['customer']['vname']); ?> <?php echo wpsg_hspc($this->view['customer']['name']); ?>,</p>
Index: /views/mods/mod_abo/mail_firstbuy_html.phtml
===================================================================
--- /views/mods/mod_abo/mail_firstbuy_html.phtml	(revision 7093)
+++ /views/mods/mod_abo/mail_firstbuy_html.phtml	(revision 7094)
@@ -4,4 +4,6 @@
 	 * Mailtemplate, welches beim erstmaligen Kauf eines Abos versendet wird (HTML)
 	 */
+
+	include(WPSG_PATH_VIEW . 'mailtemplates/html/logo.phtml');
 
 ?><p><?php echo __('Hallo', 'wpsg'); ?> <?php echo wpsg_hspc($this->view['customer']['vname']); ?> <?php echo wpsg_hspc($this->view['customer']['name']); ?>,</p>
Index: /views/mods/mod_abo/mail_rebuy_html.phtml
===================================================================
--- /views/mods/mod_abo/mail_rebuy_html.phtml	(revision 7093)
+++ /views/mods/mod_abo/mail_rebuy_html.phtml	(revision 7094)
@@ -4,4 +4,6 @@
 	 * Template fÃŒr die Mail an den Kunden wenn ein Abo verlÃ€ngert wurde (HTML)
 	 */
+
+	include(WPSG_PATH_VIEW . 'mailtemplates/html/logo.phtml');
 
 ?><p><?php echo __('Hallo', 'wpsg'); ?> <?php echo wpsg_hspc($this->view['customer']['vname']); ?> <?php echo wpsg_hspc($this->view['customer']['name']); ?>,</p>
Index: /views/mods/mod_abo/mail_row_html.phtml
===================================================================
--- /views/mods/mod_abo/mail_row_html.phtml	(revision 7093)
+++ /views/mods/mod_abo/mail_row_html.phtml	(revision 7094)
@@ -4,4 +4,6 @@
 	 * Template fÃŒr die Zeile eines Abo Produktes im HTML Template
 	 */
+
+	include(WPSG_PATH_VIEW . 'mailtemplates/html/logo.phtml');
 
 ?>
Index: /views/mods/mod_abo/mail_storno_html.phtml
===================================================================
--- /views/mods/mod_abo/mail_storno_html.phtml	(revision 7093)
+++ /views/mods/mod_abo/mail_storno_html.phtml	(revision 7094)
@@ -4,4 +4,6 @@
 	 * Template fÃŒr die Mail an den Kunden wenn ein Abo storniert wurde (HTML)
 	 */
+
+	include(WPSG_PATH_VIEW . 'mailtemplates/html/logo.phtml');
 
 ?><p><?php echo __('Hallo', 'wpsg'); ?> <?php echo wpsg_hspc($this->view['customer']['vname']); ?> <?php echo wpsg_hspc($this->view['customer']['name']); ?>,</p>
Index: /views/mods/mod_auftragsbestaetigung/auftragsbestaetigung_html.phtml
===================================================================
--- /views/mods/mod_auftragsbestaetigung/auftragsbestaetigung_html.phtml	(revision 7093)
+++ /views/mods/mod_auftragsbestaetigung/auftragsbestaetigung_html.phtml	(revision 7094)
@@ -3,4 +3,5 @@
 	/* Wichtig, da die Module sonst kein HTML zurÃŒckgeben */
 	$this->htmlMail = true;
+	include(WPSG_PATH_VIEW . 'mailtemplates/html/logo.phtml');
 
 ?><?php $this->render(WPSG_PATH_VIEW.'/mailtemplates/html/html_head.phtml'); ?>
Index: /views/mods/mod_deliverynote/deliverymail_html.phtml
===================================================================
--- /views/mods/mod_deliverynote/deliverymail_html.phtml	(revision 7093)
+++ /views/mods/mod_deliverynote/deliverymail_html.phtml	(revision 7094)
@@ -4,4 +4,6 @@
 	 * Template fÃŒr die Mail an den Kunden (HTML)
 	 */
+
+	include(WPSG_PATH_VIEW . 'mailtemplates/html/logo.phtml');
 
 ?><p><?php echo __("Hallo", "wpsg"); ?> <?php echo $this->view['customer']['vname']; ?> <?php echo $this->view['customer']['name']; ?>,</p>
Index: /views/mods/mod_deliverynote/deliverynote_pdf.phtml
===================================================================
--- /views/mods/mod_deliverynote/deliverynote_pdf.phtml	(revision 7093)
+++ /views/mods/mod_deliverynote/deliverynote_pdf.phtml	(revision 7094)
@@ -36,16 +36,39 @@
 				
 			}
-				
-				
+
+
 			if (file_exists($shop->callMod('wpsg_mod_deliverynote', 'getFilePath', array(''))."wpsg_deliverynote_logo.jpg"))
 			{
-			
+
 				list($width, $height, $type, $attr) = getimagesize($shop->callMod('wpsg_mod_deliverynote', 'getFilePath', array(''))."wpsg_deliverynote_logo.jpg");
-			 
+
+				// Umrechnung von Inch zu Pixel
 				$wPix = (25.4 * $width) / 96;
 				$hPix = (25.4 * $height) / 96;
-			
-				$pdf->image($shop->callMod('wpsg_mod_deliverynote', 'getFilePath', array(''))."wpsg_deliverynote_logo.jpg", 210 - $wPix, 0, $wPix, $hPix);
-			
+
+				$leftPos = 110 - $wPix;
+				$midPos = $wPix * 2.6 - $width / 2;
+				$rightPos = 210 - $wPix;
+
+				$abscissa = $rightPos;
+				$ordinate = 0;
+
+				$transparency = str_replace("%", "", $shop->get_option('wpsg_mod_deliverynote_logo_transparency'));
+				if($transparency !== "100") $transparency = str_replace(array("0", "00"), "", $transparency);
+
+				$alpha = 1;
+				if(!is_null($transparency) && $transparency !== "100") $alpha = "0.$transparency";
+				if(!is_null($transparency) && $transparency === "100") $alpha = $transparency;
+
+				$logo_pos = $shop->get_option('wpsg_mod_deliverynote_logo_position');
+
+				if(isset($logo_pos) && $logo_pos === "left") { $abscissa = $leftPos; $ordinate = 20; }
+				if(isset($logo_pos) && $logo_pos === "center") { $abscissa = $midPos; $ordinate = 20; }
+				if(isset($logo_pos) && $logo_pos === "right") { $abscissa = $rightPos; }
+
+				$pdf->SetAlpha($alpha);
+				$pdf->image($shop->callMod('wpsg_mod_deliverynote', 'getFilePath', array(''))."wpsg_deliverynote_logo.jpg", $abscissa, $ordinate, $wPix, $hPix);
+				$pdf->SetAlpha(1);
+
 			}
 				
Index: /views/mods/mod_deliverynote/settings_edit.phtml
===================================================================
--- /views/mods/mod_deliverynote/settings_edit.phtml	(revision 7093)
+++ /views/mods/mod_deliverynote/settings_edit.phtml	(revision 7094)
@@ -8,102 +8,132 @@
 
 <div>
-    <ul class="nav nav-tabs" role="tablist">
-        <li role="presentation" class="active"><a href="#tab1" aria-controls="home" role="tab" data-toggle="tab"><?php echo __('Vordefinierte Textfelder', 'wpsg'); ?></a></li>
-        <li role="presentation"><a href="#tab2" aria-controls="profile" role="tab" data-toggle="tab"><?php echo __('FuÃzeile', 'wpsg'); ?></a></li>
-        <li role="presentation"><a href="#tab3" aria-controls="messages" role="tab" data-toggle="tab"><?php echo __('Sonstiges', 'wpsg'); ?></a></li>
-    </ul>
-    <div class="tab-content">
-        <div role="tabpanel" class="tab-pane active" id="tab1">
-
-            <?php echo wpsg_drawForm_Input('wpsg_mod_deliverynote_adressrow', __('Adresszeile', 'wpsg'), $this->get_option('wpsg_mod_deliverynote_adressrow'), array('help' => 'wpsg_mod_deliverynote_adressrow')); ?>
-
-            <?php echo wpsg_drawForm_TextStart(); ?>
-                <div style="position:relative;">
-                <?php if ($this->view['wpsg_mod_deliverynote']['bp'] === false) { ?>
-                <p><?php echo __('Es wurde bisher kein Briefpapier hochgeladen', 'wpsg'); ?></p>
-                <?php } else { ?>
-                <a href="<?php echo $this->view['wpsg_mod_deliverynote']['bp']; ?>" target="_blank"><?php echo __('Derzeitiges Briefpapier', 'wpsg'); ?></a>
-                <?php } ?>
-                <a class="wpsg_glyphicon_right glyphicon glyphicon-question-sign form-control-feedback" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_deliverynote_bp" data-wpsg-tip="mod_deliverynote_bp" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_deliverynote_bp"></a>
-                <input type="file" name="wpsg_mod_deliverynote_bp">
-                <?php $strSuffix = ''; if ($this->view['wpsg_mod_deliverynote']['bp'] !== false) { $strSuffix = '
+	<ul class="nav nav-tabs" role="tablist">
+		<li role="presentation" class="active"><a href="#tab1" aria-controls="home" role="tab" data-toggle="tab"><?php echo __('Vordefinierte Textfelder', 'wpsg'); ?></a></li>
+		<li role="presentation"><a href="#tab2" aria-controls="profile" role="tab" data-toggle="tab"><?php echo __('FuÃzeile', 'wpsg'); ?></a></li>
+		<li role="presentation"><a href="#tab3" aria-controls="messages" role="tab" data-toggle="tab"><?php echo __('Sonstiges', 'wpsg'); ?></a></li>
+	</ul>
+	<div class="tab-content">
+		<div role="tabpanel" class="tab-pane active" id="tab1">
+
+			<?php echo wpsg_drawForm_Input('wpsg_mod_deliverynote_adressrow', __('Adresszeile', 'wpsg'), $this->get_option('wpsg_mod_deliverynote_adressrow'), array('help' => 'wpsg_mod_deliverynote_adressrow')); ?>
+
+			<?php echo wpsg_drawForm_TextStart(); ?>
+			<div style="position:relative;">
+				<?php if ($this->view['wpsg_mod_deliverynote']['bp'] === false) { ?>
+					<p><?php echo __('Es wurde bisher kein Briefpapier hochgeladen', 'wpsg'); ?></p>
+				<?php } else { ?>
+					<a href="<?php echo $this->view['wpsg_mod_deliverynote']['bp']; ?>" target="_blank"><?php echo __('Derzeitiges Briefpapier', 'wpsg'); ?></a>
+				<?php } ?>
+				<a class="wpsg_glyphicon_right glyphicon glyphicon-question-sign form-control-feedback" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_deliverynote_bp" data-wpsg-tip="mod_deliverynote_bp" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_deliverynote_bp"></a>
+				<input type="file" name="wpsg_mod_deliverynote_bp">
+				<?php $strSuffix = ''; if ($this->view['wpsg_mod_deliverynote']['bp'] !== false) { $strSuffix = '
                     <label>
 						<input type="checkbox" name="wpsg_mod_deliverynote_bp_del" value="1" />&nbsp;'.__('LÃ¶schen', 'wpsg').'
 					</label>';
 					echo __($strSuffix);
-			} ?>
-			</div>
-            <?php echo wpsg_drawForm_TextEnd(__('Briefpapier (PDF/JPG)', 'wpsg'), array('noP' => true, 'helps' => 'wpsg_mod_deliverynote_bp')); ?>
-
-            <?php echo wpsg_drawForm_TextStart(); ?>
-                <div style="position:relative;">
-                <?php if ($this->view['wpsg_mod_deliverynote']['logo'] === false) { ?>
-                <p><?php echo __('Es wurde bisher kein Logo hochgeladen', 'wpsg'); ?></p>
-                <?php } else { ?>
-                <a href="<?php echo $this->view['wpsg_mod_deliverynote']['logo']; ?>" target="_blank"><?php echo __('Derzeitiges Logo', 'wpsg'); ?></a>
-                <?php } ?>
-                <a class="wpsg_glyphicon_right glyphicon glyphicon-question-sign form-control-feedback" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_deliverynote_logo" data-wpsg-tip="mod_deliverynote_logo" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_deliverynote_logo"></a>
-                <input type="file" name="wpsg_mod_deliverynote_logo">
-                <?php $strSuffix = ''; if ($this->view['wpsg_mod_deliverynote']['logo'] !== false) { $strSuffix = '  
-					<label>
-						<input type="checkbox" name="wpsg_mod_deliverynote_logo_del" value="1" />&nbsp;'.__('LÃ¶schen', 'wpsg').'
-					</label>';
+				} ?>
+			</div>
+			<?php echo wpsg_drawForm_TextEnd(__('Briefpapier (PDF/JPG)', 'wpsg'), array('noP' => true, 'helps' => 'wpsg_mod_deliverynote_bp')); ?>
+
+			<?php echo wpsg_drawForm_TextStart(); ?>
+			<div style="position:relative;">
+				<?php if ($this->view['wpsg_mod_deliverynote']['logo'] === false) { ?>
+					<p><?php echo __('Es wurde bisher kein Logo hochgeladen', 'wpsg'); ?></p>
+				<?php } else { ?>
+					<a href="<?php echo stripslashes($this->view['wpsg_mod_deliverynote']['logo']); ?>" target="_blank"><?php echo __('Derzeitiges Logo', 'wpsg'); ?></a>
+				<?php } ?>
+				<a class="wpsg_glyphicon_right glyphicon glyphicon-question-sign form-control-feedback" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_deliverynote_logo" data-wpsg-tip="mod_deliverynote_logo" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_deliverynote_logo"></a>
+				<input type="file" name="wpsg_mod_deliverynote_logo">
+				<?php $logo_pos = $this->get_option("wpsg_mod_deliverynote_logo_position"); ?>
+				<?php $defaultAlign = !isset($logo_pos) || empty($logo_pos) ? "align-buttons-active" : ""; ?>
+
+				<?php $alignLeft = $logo_pos === 'left' ? "align-buttons-active" : ""; ?>
+				<?php $alignCenter = $logo_pos === 'center' ? "align-buttons-active" : ""; ?>
+				<?php $alignRight = $logo_pos === 'right' ? "align-buttons-active" : ""; ?>
+
+				<?php $logo_transparency = $this->get_option("wpsg_mod_deliverynote_logo_transparency") ?: "0%"; ?>
+
+				<?php $strSuffix = ''; if ($this->view['logo'] !== false) { $strSuffix = '
+					<div class="row">
+						<div class="col-md-4">
+							<div class="align-buttons">
+								<input type="input" data-toggle="tooltip" class="logo-align-button logo-align-button-left '.$alignLeft.'" name="wpsg_mod_deliverynote_logo_position_left" value="&#xf036" onclick="handleLogoAlignClick($(this))" onkeydown="return false;" onfocus="return false;" autocomplete="off" title="'.__("Logo linksbÃŒndig ausrichten").'">
+								<input type="input" data-toggle="tooltip" class="logo-align-button logo-align-button-center '.$alignCenter.'" name="wpsg_mod_deliverynote_logo_position_center" value="&#xf037" onclick="handleLogoAlignClick($(this))" onkeydown="return false;" onfocus="return false;" autocomplete="off" title="'.__("Logo zentrieren").'">
+								<input type="input" data-toggle="tooltip" class="logo-align-button logo-align-button-right '.$alignRight.' '.$defaultAlign.'" name="wpsg_mod_deliverynote_logo_position_right" value="&#xf038" onclick="handleLogoAlignClick($(this))" onkeydown="return false;" onfocus="return false;" autocomplete="off" title="'.__("Logo rechtsbÃŒndig ausrichten").'">
+							</div>
+						</div>
+						<div class="col-md-8 logo-transparency">
+							<label>
+								<input type="text" name="wpsg_mod_deliverynote_logo_transparency" value="'.$logo_transparency.'" />&nbsp;'.__('Logodeckkraft', 'wpsg').'
+							</label>		
+						</div>
+						<div class="col-md-12">
+							<label>
+								<input type="checkbox" name="wpsg_mod_deliverynote_logo_del" value="1" />&nbsp;'.__('LÃ¶schen', 'wpsg').'
+							</label>	
+						</div>
+					</div>';
 					echo __($strSuffix);
 				} ?>
-				</div>
-            <?php echo wpsg_drawForm_TextEnd(__('Logo (JPG)', 'wpsg'), array('noP' => true, 'helps' => 'wpsg_mod_deliverynote_logo')); ?>
+
+				<button class="button wpsg_deliverynote_preview" style="float:right; margin-right:10px;" name="wpsg_deliverynote_preview" type="button">
+					<?php echo __("Vorschau", "wpsg"); ?>
+				</button>
+
+			</div>
+			<?php echo wpsg_drawForm_TextEnd(__('Logo (JPG)', 'wpsg'), array('noP' => true, 'helps' => 'wpsg_mod_deliverynote_logo')); ?>
 
 			<br />
 
 			<table class="table table-body-striped wpsg_mod_deliverynote_fieldtable">
-                <thead>
-                    <tr>
-                        <th class="col_bezeichnung"><?php echo __('Bezeichnung', 'wpsg'); ?></th>
-                        <th class="col_freitext"><?php echo __('Freitext', 'wpsg'); ?></th>
-                        <th class="col_x"><?php echo __('X', 'wpsg'); ?></th>
-                        <th class="col_y"><?php echo __('Y', 'wpsg'); ?></th>
-                        <th class="col_color"><?php echo __('Farbe', 'wpsg'); ?></th>
-                        <th class="col_groesse"><?php echo __('GrÃ¶Ãe', 'wpsg'); ?></th>
-                        <th class="col_action"></th>
-                    </tr>
-                </thead>
-                <tbody>
-                    <?php foreach ($this->view['wpsg_mod_deliverynote']['fields'] as $f => $field_name) { ?>
-                    <tr>
-                        <td><?php echo wpsg_hspc($field_name); ?></td>
-                        <td>
-                            <input type="text" style="width:100%;" name="text[<?php echo $f; ?>][text]" value="<?php echo wpsg_getStr($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['text']); ?>" />
-                        </td>
-                        <td>
-                            <input type="text" style="width:100%;" name="text[<?php echo $f; ?>][x]" value="<?php echo wpsg_getStr($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['x']); ?>" />
-                        </td>
-                        <td>
-                            <input type="text" style="width:100%;" name="text[<?php echo $f; ?>][y]" value="<?php echo wpsg_getStr($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['y']); ?>" />
-                        </td>
-                        <td>
-                            <input type="text" style="width:100%;" name="text[<?php echo $f; ?>][color]" value="<?php echo wpsg_getStr($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['color']); ?>" />
-                        </td>
-                        <td>
-                            <select name="text[<?php echo $f; ?>][fontsize]" style="width:100%;">
-                                <option <?php echo ((wpsg_getStr($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['fontsize']) == "8")?'selected="selected"':''); ?> value="8">8</option>
-                                <option <?php echo ((wpsg_getStr($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['fontsize']) == "9")?'selected="selected"':''); ?> value="9">9</option>
-                                <option <?php echo ((wpsg_getStr($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['fontsize']) == "10")?'selected="selected"':''); ?> value="10">10</option>
-                                <option <?php echo ((wpsg_getStr($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['fontsize']) == "11")?'selected="selected"':''); ?> value="11">11</option>
-                                <option <?php echo ((wpsg_getStr($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['fontsize']) == "12")?'selected="selected"':''); ?> value="12">12</option>
-                                <option <?php echo ((wpsg_getStr($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['fontsize']) == "13")?'selected="selected"':''); ?> value="13">13</option>
-                                <option <?php echo ((wpsg_getStr($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['fontsize']) == "14")?'selected="selected"':''); ?> value="14">14</option>
-                            </select>
-                        </td>
-                        <td>
-                            <input type="checkbox" title="<?php echo __('Diese Checkbox aktivieren, damit die Textzeile verwendet wird.', 'wpsg'); ?>" value="1" name="text[<?php echo $f; ?>][aktiv]" <?php echo ((wpsg_isSizedInt($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['aktiv']))?'checked="checked"':''); ?> />
-                        </td>
-                    </tr>
-                    <?php } ?>
-                </tbody>
+				<thead>
+				<tr>
+					<th class="col_bezeichnung"><?php echo __('Bezeichnung', 'wpsg'); ?></th>
+					<th class="col_freitext"><?php echo __('Freitext', 'wpsg'); ?></th>
+					<th class="col_x"><?php echo __('X', 'wpsg'); ?></th>
+					<th class="col_y"><?php echo __('Y', 'wpsg'); ?></th>
+					<th class="col_color"><?php echo __('Farbe', 'wpsg'); ?></th>
+					<th class="col_groesse"><?php echo __('GrÃ¶Ãe', 'wpsg'); ?></th>
+					<th class="col_action"></th>
+				</tr>
+				</thead>
+				<tbody>
+				<?php foreach ($this->view['wpsg_mod_deliverynote']['fields'] as $f => $field_name) { ?>
+					<tr>
+						<td><?php echo wpsg_hspc($field_name); ?></td>
+						<td>
+							<input type="text" style="width:100%;" name="text[<?php echo $f; ?>][text]" value="<?php echo wpsg_getStr($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['text']); ?>" />
+						</td>
+						<td>
+							<input type="text" style="width:100%;" name="text[<?php echo $f; ?>][x]" value="<?php echo wpsg_getStr($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['x']); ?>" />
+						</td>
+						<td>
+							<input type="text" style="width:100%;" name="text[<?php echo $f; ?>][y]" value="<?php echo wpsg_getStr($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['y']); ?>" />
+						</td>
+						<td>
+							<input type="text" style="width:100%;" name="text[<?php echo $f; ?>][color]" value="<?php echo wpsg_getStr($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['color']); ?>" />
+						</td>
+						<td>
+							<select name="text[<?php echo $f; ?>][fontsize]" style="width:100%;">
+								<option <?php echo ((wpsg_getStr($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['fontsize']) == "8")?'selected="selected"':''); ?> value="8">8</option>
+								<option <?php echo ((wpsg_getStr($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['fontsize']) == "9")?'selected="selected"':''); ?> value="9">9</option>
+								<option <?php echo ((wpsg_getStr($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['fontsize']) == "10")?'selected="selected"':''); ?> value="10">10</option>
+								<option <?php echo ((wpsg_getStr($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['fontsize']) == "11")?'selected="selected"':''); ?> value="11">11</option>
+								<option <?php echo ((wpsg_getStr($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['fontsize']) == "12")?'selected="selected"':''); ?> value="12">12</option>
+								<option <?php echo ((wpsg_getStr($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['fontsize']) == "13")?'selected="selected"':''); ?> value="13">13</option>
+								<option <?php echo ((wpsg_getStr($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['fontsize']) == "14")?'selected="selected"':''); ?> value="14">14</option>
+							</select>
+						</td>
+						<td>
+							<input type="checkbox" title="<?php echo __('Diese Checkbox aktivieren, damit die Textzeile verwendet wird.', 'wpsg'); ?>" value="1" name="text[<?php echo $f; ?>][aktiv]" <?php echo ((wpsg_isSizedInt($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['aktiv']))?'checked="checked"':''); ?> />
+						</td>
+					</tr>
+				<?php } ?>
+				</tbody>
 			</table>
 
 			<input class="button" onclick="if (!confirm('<?php echo __('Sind Sie sich sicher? Ihre bisherigen Einstellungen gehen verloren!', 'wpsg'); ?>')) return false; else location.href = '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;action=module&amp;modul=<?php echo $_REQUEST['modul']; ?>&amp;do=reset&amp;noheader=1';" type="button" value="<?php echo __('Standardeinstellungen laden', 'wpsg'); ?>" />
 
-            <br /><br />
+			<br /><br />
 
 			<div class="info">
@@ -116,14 +146,14 @@
 			<br />
 
-        </div>
-        <div role="tabpanel" class="tab-pane" id="tab2">
-
-            <div id="foottext_list"><?php echo $this->view['foottext_list']; ?></div>
-
-            <br />
-
-            <a title="<?php echo __('Neue FuÃzeile anlegen', 'wpsg'); ?>" href="" class="" onclick="return wpsg_addFooter();"><span class="glyphicon wpsg-glyphicon glyphicon-plus"></span><?php echo __('Neue FuÃzeile anlegen.', 'wpsg'); ?></a>
-
-            <br /><br />
+		</div>
+		<div role="tabpanel" class="tab-pane" id="tab2">
+
+			<div id="foottext_list"><?php echo $this->view['foottext_list']; ?></div>
+
+			<br />
+
+			<a title="<?php echo __('Neue FuÃzeile anlegen', 'wpsg'); ?>" href="" class="" onclick="return wpsg_addFooter();"><span class="glyphicon wpsg-glyphicon glyphicon-plus"></span><?php echo __('Neue FuÃzeile anlegen.', 'wpsg'); ?></a>
+
+			<br /><br />
 
 			<div class="info">
@@ -133,6 +163,6 @@
 			</div>
 
-        </div>
-        <div role="tabpanel" class="tab-pane" id="tab3">
+		</div>
+		<div role="tabpanel" class="tab-pane" id="tab3">
 
             <?php echo wpsg_drawForm_Input('wpsg_mod_deliverynote_nrformat', __('Format der Lieferscheinnummer', 'wpsg'), $this->get_option('wpsg_mod_deliverynote_nrformat'), array('help' => 'wpsg_mod_deliverynote_nrformat')); ?>
@@ -140,9 +170,9 @@
 			<?php echo wpsg_drawForm_Input('wpsg_mod_deliverynote_url', __('URL FÃŒr URL Benachrichtigung', 'wpsg'), $this->get_option('wpsg_mod_deliverynote_url'), array('help' => 'wpsg_mod_deliverynote_url')); ?>
 			<?php echo wpsg_drawForm_Checkbox('wpsg_mod_deliverynote_url_standard', __('URL Benachrichtigung standardmÃ€Ãig aktiv', 'wpsg'), $this->get_option('wpsg_mod_deliverynote_url_standard'), array('help' => 'wpsg_mod_deliverynote_url_standard')); ?>
-			
+
 			<?php if ($this->hasMod('wpsg_mod_produktattribute') == '1') {?>
-				<?php echo wpsg_drawForm_Checkbox('wpsg_mod_deliverynote_produktattribute', __('Produktattribute auf dem Lieferschein anzeigen', 'wpsg'), $this->get_option('wpsg_mod_deliverynote_produktattribute'), array('help' => 'wpsg_mod_deliverynote_produktattribute')); ?>			
+				<?php echo wpsg_drawForm_Checkbox('wpsg_mod_deliverynote_produktattribute', __('Produktattribute auf dem Lieferschein anzeigen', 'wpsg'), $this->get_option('wpsg_mod_deliverynote_produktattribute'), array('help' => 'wpsg_mod_deliverynote_produktattribute')); ?>
 			<?php }?>
-			
+
 			<?php echo wpsg_drawForm_Checkbox('wpsg_mod_deliverynote_hideCountry', __('Land auf Lieferschein verbergen', 'wpsg'), $this->get_option('wpsg_mod_deliverynote_hideCountry'), array('help' => 'wpsg_mod_deliverynote_hideCountry')); ?>
 			<?php echo wpsg_drawForm_Select('wpsg_mod_deliverynote_anr', __('Artikelnummer anzeigen', 'wpsg'), array(
@@ -153,5 +183,5 @@
 
         </div>
-      </div>
+	</div>
 </div>
 
@@ -159,9 +189,53 @@
 
 	/**
+	 * Stellt sicher, dass immer nur ein Button der align-buttons die highlight Klasse hat
+	 */
+	function handleLogoAlignClick(pressedEl)
+	{
+
+		if(pressedEl.hasClass("align-buttons-active")) return;
+		else
+		{
+
+			pressedEl.addClass("align-buttons-active");
+			pressedEl[0].value = pressedEl[0].value + " selected";
+
+			jQuery.each($(".logo-align-button"), function(index, element) {
+				if(element.classList.contains("align-buttons-active") && element !== pressedEl[0]){
+
+					var values = element.value.split(" ");
+					element.value = values[0];
+
+					element.classList.remove("align-buttons-active");
+
+					return false;
+
+				}
+			});
+
+		}
+
+	} // function handleLogoAlignClick()
+
+	/**
+	 * Wird beim Klicken auf den Vorschau Button ausgelÃ¶st
+	 */
+	function wpsg_deliverynote_preview()
+	{
+
+		let url = "<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_deliverynote&do=orderAjax&noheader=1&wpsg_deliverynote_preview=1";
+
+		window.open(url, '_blank');
+
+		return false;
+
+	} // function wpsg_rechnungen_preview()
+
+	/**
 	 * Wird beim anlegen einer neuen FuÃzeile aufgerufen
-	 */ 
+	 */
 	function wpsg_addFooter()
 	{
-	
+
 		jQuery('#foottext_list').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
 		
@@ -172,7 +246,7 @@
 			}
 		} );
-	
+
 		return false;
-	
+
 	} // function wpsg_addFooter()
 	
@@ -182,9 +256,9 @@
 	function wpsg_removeFooter(foot_id)
 	{
-	
+
 		if (!confirm('<?php echo __('Sind Sie sich sicher, dass Sie diese FuÃzeile lÃ¶schen mÃ¶chten?', 'wpsg'); ?>')) return false;
 		
 		jQuery('#foottext_list').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
-	
+
 		jQuery.ajax( {
 			url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_deliverynote&do=removeFoottext&noheader=1',
@@ -196,11 +270,12 @@
 			}
 		} );
-	
+
 		return false;
 		
 	} // function wpsg_removeFooter()
-			
+
 	jQuery(document).ready(function() {
-		jQuery('#wpsg_tab').wpsg_tab( { 
+
+		jQuery('#wpsg_tab').wpsg_tab( {
 			'cookiename': 'wpsg_mod_deliverynote_tab',
 			'tab2': function() {
@@ -208,5 +283,8 @@
 			}
 		} );
+
+		jQuery(".wpsg_deliverynote_preview").click(function(){ wpsg_deliverynote_preview(); });
+
 	} );
 
-/* ]]> */</script>
+	/* ]]> */</script>
Index: /views/mods/mod_downloadplus/cronmail_html.phtml
===================================================================
--- /views/mods/mod_downloadplus/cronmail_html.phtml	(revision 7093)
+++ /views/mods/mod_downloadplus/cronmail_html.phtml	(revision 7094)
@@ -4,4 +4,6 @@
 	 * Template fÃŒr die Mail, die bei erfolgreicher Individualisierung an den Admin gesendet wird (HTML)
 	 */
+
+	include(WPSG_PATH_VIEW . 'mailtemplates/html/logo.phtml');
 
 ?>
Index: /views/mods/mod_downloadplus/pdfdownloadmail_html.phtml
===================================================================
--- /views/mods/mod_downloadplus/pdfdownloadmail_html.phtml	(revision 7093)
+++ /views/mods/mod_downloadplus/pdfdownloadmail_html.phtml	(revision 7094)
@@ -4,4 +4,6 @@
 	 * Mail, die die PDF Downloads an den Kunden sendet (HTML)
 	 */
+
+	include(WPSG_PATH_VIEW . 'mailtemplates/html/logo.phtml');
 
 ?>
Index: /views/mods/mod_downloadprodukte/zahlung_downloadprodukt_html.phtml
===================================================================
--- /views/mods/mod_downloadprodukte/zahlung_downloadprodukt_html.phtml	(revision 7093)
+++ /views/mods/mod_downloadprodukte/zahlung_downloadprodukt_html.phtml	(revision 7094)
@@ -1,3 +1,5 @@
-<p><?php echo __("Hallo", "wpsg"); ?> <?php echo $this->view['customer']['vname']; ?> <?php echo $this->view['customer']['name']; ?></p> 
+<?php include(WPSG_PATH_VIEW . 'mailtemplates/html/logo.phtml'); ?>
+
+<p><?php echo __("Hallo", "wpsg"); ?> <?php echo $this->view['customer']['vname']; ?> <?php echo $this->view['customer']['name']; ?></p>
 
 <p><?php echo __("Ihre Bezahlung zu der Bestellung", "wpsg"); ?> <?php echo $this->view['order']['onr'] ?> <?php echo __("ist bei uns eingegangen.", "wpsg"); ?></p>
Index: /views/mods/mod_kundenkontakt/templates/zahlungsaufforderung_html.phtml
===================================================================
--- /views/mods/mod_kundenkontakt/templates/zahlungsaufforderung_html.phtml	(revision 7093)
+++ /views/mods/mod_kundenkontakt/templates/zahlungsaufforderung_html.phtml	(revision 7094)
@@ -2,4 +2,6 @@
 	
 	global $template_name, $template_betreff, $absender_name, $absender_email;
+
+	include(WPSG_PATH_VIEW . 'mailtemplates/html/logo.phtml');
 
 	/**
Index: /views/mods/mod_kundenkontakt/templates/zahlungserinnerung_html.phtml
===================================================================
--- /views/mods/mod_kundenkontakt/templates/zahlungserinnerung_html.phtml	(revision 7093)
+++ /views/mods/mod_kundenkontakt/templates/zahlungserinnerung_html.phtml	(revision 7094)
@@ -2,4 +2,6 @@
 
 	global $template_name, $template_betreff, $absender_name, $absender_email;
+
+	include(WPSG_PATH_VIEW . 'mailtemplates/html/logo.phtml');
 
 	/**
Index: /views/mods/mod_rechnungen/accountingmail_html.phtml
===================================================================
--- /views/mods/mod_rechnungen/accountingmail_html.phtml	(revision 7093)
+++ /views/mods/mod_rechnungen/accountingmail_html.phtml	(revision 7094)
@@ -4,4 +4,6 @@
 	 * Template fÃŒr die Mail, die beim Schreiben einer Rechnungskorrektur optional an den Kunden versendet werden kann (HTML)
 	 */
+
+	include(WPSG_PATH_VIEW . 'mailtemplates/html/logo.phtml');
 
 	//wpsg_debug($this->view);
Index: /views/mods/mod_rechnungen/invoice_pdf.phtml
===================================================================
--- /views/mods/mod_rechnungen/invoice_pdf.phtml	(revision 7093)
+++ /views/mods/mod_rechnungen/invoice_pdf.phtml	(revision 7094)
@@ -1,4 +1,4 @@
 <?php
- 
+
 	/**
 	 * Template fÃŒr die PDF Rechnung
@@ -8,19 +8,19 @@
 	require_once WPSG_PATH_LIB.'fpdf/fpdi.php';
 	require_once WPSG_PATH_LIB.'wpsg_fpdf.class.php';
-  
+
 	global $absender_left, $absender_top, $adress_left, $adress_top, $rdata_left, $rdata_top;
-	 
+
 	// Positionierung der Absenderadresszeile
 	$absender_left				= 25;
 	$absender_top				= 50;
-	
+
 	// Positionierung der Zieladress
-	$adress_left 				= 25;	
+	$adress_left 				= 25;
 	$adress_top					= 55;
-	
+
 	// Positionierung des Rechnungskopfes
 	$rdata_left					= 25;
 	$rdata_top					= 90;
-	
+
 	// Positionierung der Produktdaten
 	$prod_left					= 25;
@@ -29,59 +29,80 @@
 	// Anzahl an Produkten pro Seite
 	$prod_break					= $this->get_option('wpsg_rechnungen_pdfperpage');
-	
+
 	// Damit die Steuer bei der Kleinunternehmerregelung nicht angezeigt wird leer ich den Array sicherheitshalber
 	if ($this->get_option('wpsg_kleinunternehmer') == '1')
 	{
-		
+
 		unset($this->view['basket']['mwst']);
-		
-	}
-	
+
+	}
+
 	if (!function_exists('AddRechnungPage'))
 	{
-		
+
 		function AddRechnungPage($shop, $pdf)
 		{
-			
+
 			global $absender_left, $absender_top, $adress_left, $adress_top, $rdata_left, $rdata_top;
-			
+
 			$pdf->AddPage();
-			
+
 			if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.pdf"))
 			{
-				
-				$pagecount = $pdf->setSourceFile($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.pdf"); 
-				$tplidx = $pdf->importPage(1, '/MediaBox'); 
-				$pdf->useTemplate($tplidx, 0, 0, 210); 
-				
+
+				$pagecount = $pdf->setSourceFile($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.pdf");
+				$tplidx = $pdf->importPage(1, '/MediaBox');
+				$pdf->useTemplate($tplidx, 0, 0, 210);
+
 			}
 			if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.jpg"))
 			{
-				$pdf->image($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.jpg", 0, 0, 210, 297, 'jpg');
-			}
-			
-			
+				//$pdf->image($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.jpg", 0, 0, 210, 297, 'jpg');
+			}
+
+
 			if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_logo.jpg"))
 			{
-	
+
 				list($width, $height, $type, $attr) = getimagesize($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_logo.jpg");
-				
-				//wpsg_debug($width.":".$height);
-				
-				$wPix = (25.4 * $width) / 96;
-				$hPix = (25.4 * $height) / 96;  
-				
-				$pdf->image($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_logo.jpg", 210 - $wPix, 0, $wPix, $hPix);
-				
-			}
-			
+
+				// Umrechnung von Inch zu Pixel
+				$wPix = (25.4 * (int)$width) / 96;
+				$hPix = (25.4 * (int)$height) / 96;
+
+				$leftPos = 110 - $wPix;
+				$midPos = $wPix * 2.6 - $width / 2;
+				$rightPos = 210 - $wPix;
+
+				$abscissa = $rightPos;
+				$ordinate = 0;
+
+				$transparency = str_replace("%", "", $shop->get_option('wpsg_rechnungen_logo_transparency'));
+				if($transparency !== "100") $transparency = str_replace(array("0", "00"), "", $transparency);
+
+				$alpha = 1;
+				if(!is_null($transparency) && $transparency !== "100") $alpha = "0.$transparency";
+				if(!is_null($transparency) && $transparency === "100") $alpha = $transparency;
+
+				$logo_pos = $shop->get_option('wpsg_rechnungen_logo_position');
+
+				if(isset($logo_pos) && $logo_pos === "left") { $abscissa = $leftPos; $ordinate = 20; }
+				if(isset($logo_pos) && $logo_pos === "center") { $abscissa = $midPos; $ordinate = 20; }
+				if(isset($logo_pos) && $logo_pos === "right") { $abscissa = $rightPos; }
+
+				$pdf->SetAlpha($alpha);
+				$pdf->image($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_logo.jpg", $abscissa, $ordinate, $wPix, $hPix);
+				$pdf->SetAlpha(1);
+
+			}
+
 			// Absenderadresszeile (Wird in der Konfiguration hinterlegt)
 			$pdf->SetFont('Arial', '', 6);
-			$pdf->Text($absender_left, $absender_top, $shop->replaceUniversalPlatzhalter(__($shop->get_option("wpsg_rechnungen_adresszeile"), 'wpsg'), $shop->view['data']['id']));	
-			
+			$pdf->Text($absender_left, $absender_top, $shop->replaceUniversalPlatzhalter(__($shop->get_option("wpsg_rechnungen_adresszeile"), 'wpsg'), $shop->view['data']['id']));
+
 			if (wpsg_getStr($shop->view['kunde']['kuerzel']) != "") $shop->view['kunde']['kuerzel'] = $shop->view['kunde']['kuerzel'].'-';
-			
+
 			// Adresse des Kunden
-			$pdf->SetFont('Arial', '', 12);			
+			$pdf->SetFont('Arial', '', 12);
 			$pdf->Text($adress_left, $adress_top, $shop->view['kunde']['firma']);
 			$pdf->Text($adress_left, $adress_top + 5, $shop->view['kunde']['vname'].' '.$shop->view['kunde']['name']);
@@ -89,7 +110,7 @@
 			$pdf->Text($adress_left, $adress_top + 15, $shop->view['kunde']['plz'].' '.$shop->view['kunde']['ort']);
 			if ($shop->get_option("wpsg_mod_rechnungen_hideCountry") == '0')
-				$pdf->Text($adress_left, $adress_top + 20, strtoupper($shop->view['oOrder']->getInvoiceCountryName()));			
-			
-			// Rechnungsdaten 
+				$pdf->Text($adress_left, $adress_top + 20, strtoupper($shop->view['oOrder']->getInvoiceCountryName()));
+
+			// Rechnungsdaten
 			$pdf->SetFont('Arial', 'B', 16);
 			$pdf->Text($rdata_left, $rdata_top, $shop->view['title']);
@@ -97,70 +118,70 @@
 			$pdf->Text($rdata_left, $rdata_top + 6, $shop->view['rnr']);
 			$pdf->SetFont('Arial', '', 9);
-			
+
 			if (isset($shop->view['faelligkeitdatum']))
 			{
-	
+
 				$pdf->Text($rdata_left + 35, $rdata_top, __("FÃ€llig am", "wpsg"));
-				$pdf->Text($rdata_left + 35, $rdata_top + 6, $shop->view['faelligkeitdatum']);
-				
-			}
-					
+				$pdf->Text($rdata_left + 35, $rdata_top + 6, (int)$shop->view['faelligkeitdatum']);
+
+			}
+
 			if (isset($shop->view['payment']))
 			{
-							
+
 				$pdf->Text($rdata_left + 58, $rdata_top, __("Zahlungsbedingungen", "wpsg"));
 				$pdf->Text($rdata_left + 58, $rdata_top + 6, $shop->view['payment']);
-				
-			}
-			
+
+			}
+
 			$pdf->Text($rdata_left + 105, $rdata_top, __("Kunden-Nr", "wpsg"));
 			$pdf->Text($rdata_left + 105, $rdata_top + 6, (($shop->view['kunde']['knr'] != '')?$shop->view['kunde']['knr']:$shop->view['kunde']['id']));
-			
+
 			$pdf->Text($rdata_left + 135, $rdata_top, __("Best. Nr.", "wpsg"));
 			$pdf->Text($rdata_left + 135, $rdata_top + 6, ((trim($shop->view['data']['onr']) != '')?$shop->view['data']['onr']:$shop->view['data']['id']));
-			
-			$pdf->Text($rdata_left + 155, $rdata_top, __("Datum", "wpsg")); 
+
+			$pdf->Text($rdata_left + 155, $rdata_top, __("Datum", "wpsg"));
 			$pdf->Text($rdata_left + 155, $rdata_top + 6, $shop->view['rDatum']);
-					
+
 			if ($shop->view['oOrder']->isInnerEu())
 			{
-				 
-				$pdf->SetFont('Arial', '', 9);		
+
+				$pdf->SetFont('Arial', '', 9);
 				$pdf->Text($adress_left, $rdata_top + 11.5, __("Innergemeinschaftliche Lieferung.", "wpsg"));
-				
-			}
-			
+
+			}
+
 			// Benutzerdefinierte Felder
 			$arTexte = $shop->callMod('wpsg_mod_rechnungen', 'getRechnungstexte', array($shop->view['data']['id']));
-			
+
 			foreach ((array)$arTexte as $text)
 			{
-				
+
 				if (isset($text['aktiv']) && $text['aktiv'] == 1)
 				{
-					
+
 					$pdf->SetFont('Arial', 'B', ((intval($text['fontsize']) > 0)?intval($text['fontsize']):10));
 					$pdf->wpsg_SetTextColor($text['color']);
-					$pdf->wpsg_MultiCell($text['x'], $text['y'], 5, $text['text']); 
+					$pdf->wpsg_MultiCell($text['x'], $text['y'], 5, $text['text']);
 					$pdf->wpsg_SetTextColor("#000000");
-					
-				}
-				
-			}
-			
-		}
-		
+
+				}
+
+			}
+
+		}
+
 	}
 	//wpsg_debug($this->view); die();
-	$pdf = new wpsg_fpdf();	
+	$pdf = new wpsg_fpdf();
 	$pdf->SetAutoPageBreak(true, 5);
 	AddRechnungPage($this, $pdf);
-				
+
 	$summe = 0;
-	
+
 	$bKopf = false; $pnr = 1; $offset = 0; $count = 0;
 	foreach ($this->view['basket']['produkte'] as $p)
 	{
-			 
+
 		if (!$bKopf)
 		{
@@ -172,113 +193,113 @@
 			$pdf->setXY($prod_left + 10, $prod_top);
 			$pdf->Cell( ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, "Name", 1, 0, 'L');
-			
+
 			if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
 			{
-			
+
 				$pdf->setXY($prod_left + 97, $prod_top);
 				$pdf->Cell(15, 8, __("MwSt.", "wpsg"), 1, 0, 'C');
-				
-			}
-			
+
+			}
+
 			$pdf->setXY($prod_left + 112, $prod_top);
 			$pdf->Cell(15, 8, __("Menge", "wpsg"), 1, 0, 'C');
-						
+
 			$pdf->setXY($prod_left + 127, $prod_top);
 			$pdf->Cell(25, 8, __("Einzelpreis", "wpsg"), 1, 0, 'R');
-			
+
 			$pdf->setXY($prod_left + 152, $prod_top);
 			$pdf->Cell(25, 8, __("Gesamtpreis", "wpsg"), 1, 0, 'R');
-			 												
-			$offset = 8;	
+
+			$offset = 8;
 			$bKopf = true;
-			
-		}
-		
+
+		}
+
 		$pdf->SetFont('Arial', '', 9);
 		$pdf->setXY($prod_left, $prod_top + $offset);
-		
+
 		if ($this->get_option('wpsg_mod_rechnungen_anr') == '1')
 		{
-			
+
 			$pdf->Cell(10, 8,  $p['anr'], 0, 0, 'C');
-			
+
 		}
 		else
 		{
-		
+
 			$pdf->Cell(10, 8, $pnr.".", 0, 0, 'C');
-			
+
 		}
 
 		/* Wenn Detailname vorhanden, wird der Detailname auf Rechnung verwendet */
 		$produkt_text = $this->getProductName($this->getProduktID($p['id']), true);
-		
+
 		/* Falls Detailname vorhanden, wird jetzt der Produktname verwendet */
 		/* $produkt_text = $this->getProductName($this->getProduktID($p['id']), false); */
-		
+
 		$produktBeschreibung = trim(strip_tags($p['beschreibung']));
-		
+
 		if ($this->isOtherLang())
-		{ 
-			
+		{
+
 			$trans_db = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_PRODUCTS."` WHERE `lang_parent` = '".wpsg_q($this->getProduktID($p['id']))."' AND `lang_code` = '".wpsg_q($this->getCurrentLanguageCode())."'");
-			
+
 			if (is_array($trans_db) && sizeof($trans_db) > 0)
 			{
-				
+
 				$produkt_text = $trans_db['name'];
 				$produktBeschreibung = trim(strip_tags($trans_db['beschreibung']));
-				 
-			}
-			
-		}
-		 
+
+			}
+
+		}
+
 		$height = 0; // HÃ¶he der Zeile fÃŒr den Rahmen
-		
+
 		$pdf->setXY($prod_left + 10, $prod_top + $offset);
-		
+
 		// Produktvariablen 
 		if ($this->hasMod('wpsg_mod_productvars') && $this->get_option("wpsg_mod_rechnungen_showpv") == "1")
 		{
-		 
+
 			$arPV = $this->callMod('wpsg_mod_productvars', 'getAllProductVarValues', array($this->view['data']['id'], $p['product_index']));
-					
+
 			if (wpsg_isSizedArray($arPV))
 			{
-				
-				foreach ($arPV as $pv) 
-				{
-				
+
+				foreach ($arPV as $pv)
+				{
+
 					$produkt_text .= "\r\n".$pv['name'].': '.$pv['value'];
 					$height += 5;
-					
-				}
-				
-			}
-			
-		}
-
-        if ($this->get_option('wpsg_mod_rechnungen_anr') === '2')
-        {
-
-            $anr = $this->getProductAnr($p['productkey']);
-            $produkt_text .= "\r\n".wpsg_translate(__('Artikelnummer: #1#', 'wpsg'), $anr);
-
-        }
+
+				}
+
+			}
+
+		}
+
+		if ($this->get_option('wpsg_mod_rechnungen_anr') === '2')
+		{
+
+			$anr = $this->getProductAnr($p['productkey']);
+			$produkt_text .= "\r\n".wpsg_translate(__('Artikelnummer: #1#', 'wpsg'), $anr);
+
+		}
 
 		$produkt_text_cell_width = 102;
 		if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
 		{
-			$produkt_text_cell_width = 87;	
-		}
-		
+			$produkt_text_cell_width = 87;
+		}
+
 		$produkt_text_width = $pdf->GetStringWidth($produkt_text);
 		//$produkt_text_cell_width = (($this->arMwSt == "-1")?87:102);
-		
+
 		$height += 5 * ceil($produkt_text_width / $produkt_text_cell_width) + 3;
-		
+
 		$height_y = $pdf->getY();
 		$height = 2 + $pdf->wpsg_MultiCell($prod_left + 10, $prod_top + $offset + 1.5, 5, $produkt_text, 0, 'L', 0, $produkt_text_cell_width);
-		
+
 		//$height += 3 + 5 + $pdf->getY() - $height_y;
 		//$pdf->Cell((($this->arMwSt == "-1")?102:87), 8, $produkt_text, 0, 0, 'L');
@@ -286,17 +307,17 @@
 		if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
 		{
-		
-			$pdf->setXY($prod_left + 97, $prod_top + $offset);		
+
+			$pdf->setXY($prod_left + 97, $prod_top + $offset);
 			$pdf->Cell(15, 8, (($this->view['basket']['noMwSt'] == '1')?'0.00 %':wpsg_ff($p['mwst_value'], '%')), 0, 0, 'C');
-			
-		}
-		
+
+		}
+
 		$pdf->setXY($prod_left + 112, $prod_top + $offset);
 		$pdf->Cell(15, 8, $p['menge'], 0, 0, 'C');
-						
+
 		if (wpsg_ShopController::get_option('wpsg_preisangaben') == WPSG_NETTO)
 		{
 			$preis = $p['preis_netto'];
-			
+
 			//TODO
 		}
@@ -305,10 +326,10 @@
 			$preis = $p['preis_brutto'];
 		}
-		
+
 		$pdf->setXY($prod_left + 127, $prod_top + $offset);
 		$pdf->Cell(25, 8, wpsg_ff($preis, $this->get_option('wpsg_currency')), 0, 0, 'R');
-		
+
 		$pdf->setXY($prod_left + 152, $prod_top + $offset);
-		$pdf->Cell(25, 8, wpsg_ff($preis * $p['menge'], $this->get_option('wpsg_currency')), 0, 0, 'R');		
+		$pdf->Cell(25, 8, wpsg_ff($preis * $p['menge'], $this->get_option('wpsg_currency')), 0, 0, 'R');
 
 		/**
@@ -318,21 +339,21 @@
 		if ($this->get_option("wpsg_rechnungen_pbeschreibung") == "1" && trim(strip_tags($p['beschreibung'])) != '')
 		{
-			
-			$produktBeschreibung = nl2br($produktBeschreibung);			
+
+			$produktBeschreibung = nl2br($produktBeschreibung);
 			preg_match_all('/\<br \/\>/', $produktBeschreibung, $treffer);
 			$produktBeschreibung = strip_tags($produktBeschreibung);
-			
-			$pBeschreibungWidth = $pdf->getStringWidth($produktBeschreibung); 
+
+			$pBeschreibungWidth = $pdf->getStringWidth($produktBeschreibung);
 			$pBeschreibungHeight = 5 * (ceil($pBeschreibungWidth / $produkt_text_cell_width) + @sizeof($treffer[0]));
-			
+
 			$pdf->SetFont('Arial', 'I', 9);
-			
+
 			$cellY = $pdf->getY();
-			$pdf->wpsg_MultiCell($prod_left + 10, $prod_top + $height + $offset - 1, 5, $produktBeschreibung, 0, 'L', 0, $produkt_text_cell_width);			
+			$pdf->wpsg_MultiCell($prod_left + 10, $prod_top + $height + $offset - 1, 5, $produktBeschreibung, 0, 'L', 0, $produkt_text_cell_width);
 			$pBeschreibungHeight = $pdf->getY() - $cellY - $height + 1;
 			$pdf->SetFont('Arial', '', 9);
-			
-		} 
-					
+
+		}
+
 		$height += $pBeschreibungHeight;
 
@@ -342,88 +363,88 @@
 		if ($this->get_option('wpsg_rechnungen_produktattribute') == '1')
 		{
-				
+
 			$attributeInfo = $this->callMod('wpsg_mod_produktattribute', 'getProductAttributeByProductId', array($this->getProduktId($p['id'])));
-		
+
 			foreach ($attributeInfo as $pa)
 			{
-					
+
 				$pa_text = $pa['name'].': '.$pa['value'];
 				$height += $pdf->wpsg_MultiCell($prod_left + 10, $prod_top + $height + $offset - 0.5, 5, $pa_text, 0, 'L', 0, $produkt_text_cell_width);
-					
-			}
-		}		
-		
+
+			}
+		}
+
 		/**
-		 * Variante ? 
+		 * Variante ?
 		 */
 		if (preg_match('/pv_(.*)/', $p['productkey']))
 		{
-			
+
 			$variInfo = $this->callMod('wpsg_mod_productvariants', 'getVariantenInfoArray', array($p['productkey']));
 
-			$height += $pdf->wpsg_MultiCell($prod_left + 10, $prod_top + $height + $offset - 0.5, 5, wpsg_translate(__('Variante: #1#', 'wpsg'), $variInfo['key']), 0, 'L', 0, $produkt_text_cell_width);			
-			
+			$height += $pdf->wpsg_MultiCell($prod_left + 10, $prod_top + $height + $offset - 0.5, 5, wpsg_translate(__('Variante: #1#', 'wpsg'), $variInfo['key']), 0, 'L', 0, $produkt_text_cell_width);
+
 			//$height += 5;
-			
-		}
-		
+
+		}
+
 		if ($this->hasMod('wpsg_mod_deliverynote'))
 		{
-			
+
 			$arDN_order = $this->callMod('wpsg_mod_deliverynote', 'loadDeliveryNotesFromOrder', array($this->view['data']['id']));
-			
+
 			if (sizeof($arDN_order) > 1)
 			{
-				
-				$deliveryTimeProduct = $this->callMod('wpsg_mod_deliverynote', 'getProductDeliveryTime', array($this->view['data']['id'], $p['product_index'])); 
-				
+
+				$deliveryTimeProduct = $this->callMod('wpsg_mod_deliverynote', 'getProductDeliveryTime', array($this->view['data']['id'], $p['product_index']));
+
 				if ($deliveryTimeProduct !== false)
 				{
-				
+
 					$height += $pdf->wpsg_MultiCell($prod_left + 10, $prod_top + $height + $offset - 0.5, 5, wpsg_translate(__('Lieferdatum: #1#', 'wpsg'), date('d.m.Y', $deliveryTimeProduct)), 0, 'L', 0, $produkt_text_cell_width);
-					
-				}
-									
-			}
-			
-		}
-		
+
+				}
+
+			}
+
+		}
+
 		// Jetzt die Rahmen zeichnen
 		$pdf->Rect($prod_left, $prod_top + $offset, 10, $height);
-		
+
 		$pdf->Rect($prod_left + 10, $prod_top + $offset, ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), $height);
-		
+
 		if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
 		{
-		
+
 			$pdf->Rect($prod_left + 97, $prod_top + $offset, 15, $height);
-			
-		}
-		
+
+		}
+
 		$pdf->Rect($prod_left + 112, $prod_top + $offset, 15, $height);
 		$pdf->Rect($prod_left + 127, $prod_top + $offset, 25, $height);
 		$pdf->Rect($prod_left + 152, $prod_top + $offset, 25, $height);
-		
+
 		$offset += $height;
-		 		
+
 		$pnr ++;
 		$count ++;
-				
+
 		$summe += $p['price'] * $p['menge'];
-		
-		if ($pdf->getY() > 220 || ($count >= $prod_break && sizeof($this->view['basket']['produkte']) > ($pnr - 1)))		
-		{
-			
+
+		if ($pdf->getY() > 220 || ($count >= $prod_break && sizeof($this->view['basket']['produkte']) > ($pnr - 1)))
+		{
+
 			AddRechnungPage($this, $pdf);
 			$bKopf = false; $offset = 0; $count = 0;
-			
-		}
-		
+
+		}
+
 	} // produkte
- 
+
 	// Gutschein
 	if ((isset($this->view['basket']['gs'])) && ($this->view['basket']['gs_value'] > 0))
 	{
-		
+
 		$pdf->SetFont('Arial', '', 9);
 		$pdf->setXY($prod_left, $prod_top + $offset);
@@ -432,18 +453,18 @@
 		$pdf->setXY($prod_left + 10, $prod_top + $offset);
 		$pdf->Cell( ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, wpsg_translate(__('Gutschein (#1#)', 'wpsg'), $this->view['basket']['gs']['code']), 1, 0, 'L');
-		
+
 		if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
 		{
-		
+
 			$mwst = __('anteilig', 'wpsg');
-				
+
 			$pdf->setXY($prod_left + 97, $prod_top + $offset);
 			$pdf->Cell(15, 8, $mwst, 1, 0, 'C');
-			
-		}
-		
+
+		}
+
 		$pdf->setXY($prod_left + 112, $prod_top + $offset);
-		$pdf->Cell(15, 8, '1', 1, 0, 'C');		
-					
+		$pdf->Cell(15, 8, '1', 1, 0, 'C');
+
 		/*
 		if ($this->view['basket']['gs']['calc'] == 'w')
@@ -462,22 +483,22 @@
 		}
 		*/
-		
+
 		$gs_value_einzel = '-'.wpsg_ff($this->view['basket']['sum']['gs'], $this->get_option('wpsg_currency'));
 		$gs_value_gesamt = '-'.wpsg_ff($this->view['basket']['sum']['gs'], $this->get_option('wpsg_currency'));
-		
+
 		$pdf->setXY($prod_left + 127, $prod_top + $offset);
 		$pdf->Cell(25, 8, $gs_value_einzel, 1, 0, 'R');
-		
+
 		$pdf->setXY($prod_left + 152, $prod_top + $offset);
 		$pdf->Cell(25, 8, $gs_value_gesamt, 1, 0, 'R');
-		 												
-		$offset += 8; 
-		
-	} 
-	
+
+		$offset += 8;
+
+	}
+
 	// Versandkosten
 	if ($this->view['basket']['sum']['preis_shipping'] != '' && $this->view['basket']['sum']['preis_shipping'] != 0)
 	{
-			 
+
 		$pdf->SetFont('Arial', '', 9);
 		$pdf->setXY($prod_left, $prod_top + $offset);
@@ -486,31 +507,31 @@
 		$pdf->setXY($prod_left + 10, $prod_top + $offset);
 		$pdf->Cell( ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, wpsg_translate(__('Versandkosten "#1#"', 'wpsg'), $this->view['oOrder']->getShippingLabel()), 1, 0, 'L');
-		
+
 		if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
 		{
-		
+
 			if ($this->arShipping[$this->view['data']['type_shipping']]['mwst_null'] == '1' && $this->view['basket']['noMwSt'] == '1')
 			{
-				
+
 				$mwst = 0;
-				
+
 			}
 			else
 			{
-	 
+
 				if (isset($this->view['basket']['shipping']['tax_rata']) && $this->view['basket']['shipping']['tax_rata'] === true)
 				{
-					
+
 					$mwst = __('anteilig', 'wpsg');
-											
+
 				}
 				else
 				{
-					
+
 					$mwst = wpsg_ff($this->arShipping[$this->view['basket']['checkout']['shipping']]['mwst_value'], '%');
 					$mwst = wpsg_ff($this->view['basket']['shipping']['tax_value'], '%');
-					
-				}
-				
+
+				}
+
 				/*
 				if ($this->arShipping[$this->view['data']['type_shipping']]['mwst'] == '0')
@@ -527,21 +548,21 @@
 				}
 				*/
-				
-			}
-			
+
+			}
+
 			$pdf->setXY($prod_left + 97, $prod_top + $offset);
 			$pdf->Cell(15, 8, $mwst, 1, 0, 'C');
- 	
-		}
-		
+
+		}
+
 		$pdf->setXY($prod_left + 112, $prod_top + $offset);
-		$pdf->Cell(15, 8, '1', 1, 0, 'C');		
-					
+		$pdf->Cell(15, 8, '1', 1, 0, 'C');
+
 		$pdf->setXY($prod_left + 127, $prod_top + $offset);
 		$pdf->Cell(25, 8, wpsg_ff($this->view['basket']['sum']['preis_shipping'], $this->get_option('wpsg_currency')), 1, 0, 'R');
-		
+
 		$pdf->setXY($prod_left + 152, $prod_top + $offset);
 		$pdf->Cell(25, 8, wpsg_ff($this->view['basket']['sum']['preis_shipping'], $this->get_option('wpsg_currency')), 1, 0, 'R');
-		 												
+
 		$offset += 8;
 
@@ -585,12 +606,12 @@
 		}
 		*/
-			
-		
-	}
-	
+
+
+	}
+
 	// Zahlungskosten
 	if ($this->view['basket']['sum']['preis_payment'] != '' && $this->view['basket']['sum']['preis_payment'] != 0)
 	{
-		
+
 		$pdf->SetFont('Arial', '', 9);
 		$pdf->setXY($prod_left, $prod_top + $offset);
@@ -599,8 +620,8 @@
 		$pdf->setXY($prod_left + 10, $prod_top + $offset);
 		$pdf->Cell( ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, $this->arPayment[$this->view['data']['type_payment']]['name'], 1, 0, 'L');
-		
+
 		if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
 		{
-		
+
 			if ($this->arPayment[$this->view['data']['type_payment']]['mwst_null'] == '1' && $this->view['basket']['noMwSt'] == '1')
 			{
@@ -608,19 +629,19 @@
 			}
 			else
-			{ 
-				
+			{
+
 				if (isset($this->view['basket']['payment']['tax_rata']) && $this->view['basket']['payment']['tax_rata'] === true)
 				{
-						
+
 					$mwst = __('anteilig', 'wpsg');
-						
+
 				}
 				else
 				{
-						
+
 					$mwst = wpsg_ff($this->arPayment[$this->view['basket']['checkout']['payment']]['mwst_value'], '%');
-						
-				}
-				
+
+				}
+
 				/*
 				if ($this->arPayment[$this->view['data']['type_payment']]['mwst'] == '0')
@@ -637,29 +658,29 @@
 				}
 				*/
-				
-			}
-			
+
+			}
+
 			$pdf->setXY($prod_left + 97, $prod_top + $offset);
 			$pdf->Cell(15, 8, $mwst, 1, 0, 'C');
-			
-		}
-		
+
+		}
+
 		$pdf->setXY($prod_left + 112, $prod_top + $offset);
-		$pdf->Cell(15, 8, '1', 1, 0, 'C');		
-					
+		$pdf->Cell(15, 8, '1', 1, 0, 'C');
+
 		$pdf->setXY($prod_left + 127, $prod_top + $offset);
 		$pdf->Cell(25, 8, wpsg_ff($this->view['basket']['sum']['preis_payment'], $this->get_option('wpsg_currency')), 1, 0, 'R');
-		
+
 		$pdf->setXY($prod_left + 152, $prod_top + $offset);
 		$pdf->Cell(25, 8, wpsg_ff($this->view['basket']['sum']['preis_payment'], $this->get_option('wpsg_currency')), 1, 0, 'R');
-		 												
+
 		$offset += 8;
-		
-	}
-		 	 
+
+	}
+
 	// GebÃŒhr
 	if (wpsg_tf(wpsg_getStr($this->view['storno_fee'])) > 0)
 	{
-		
+
 		$pdf->SetFont('Arial', '', 9);
 		$pdf->setXY($prod_left, $prod_top + $offset);
@@ -669,11 +690,11 @@
 
 		if (strpos($this->view['storno_fee'], '%') !== false) $label .= ' ('.wpsg_ff($this->view['storno_fee'], '%').')';
-		
+
 		$pdf->setXY($prod_left + 10, $prod_top + $offset);
 		$pdf->Cell( ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, $label, 1, 0, 'L');
-		
+
 		if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
 		{
-		
+
 			if ($this->view['basket']['noMwSt'] == '1')
 			{
@@ -681,31 +702,31 @@
 			}
 			else
-			{ 
-				
-				
+			{
+
+
 				$mwst = wpsg_ff($this->view['storno_fee_tax_value'], '%');
-				
-			}
-			
+
+			}
+
 			$pdf->setXY($prod_left + 97, $prod_top + $offset);
 			$pdf->Cell(15, 8, $mwst, 1, 0, 'C');
-			
-		}
-		
+
+		}
+
 		$pdf->setXY($prod_left + 112, $prod_top + $offset);
-		$pdf->Cell(15, 8, '1', 1, 0, 'C');		
-					
+		$pdf->Cell(15, 8, '1', 1, 0, 'C');
+
 		$pdf->setXY($prod_left + 127, $prod_top + $offset);
 		$pdf->Cell(25, 8, '-'.wpsg_ff($this->view['storno_fee_value'], $this->get_option('wpsg_currency')), 1, 0, 'R');
-		
+
 		$pdf->setXY($prod_left + 152, $prod_top + $offset);
 		$pdf->Cell(25, 8, '-'.wpsg_ff($this->view['storno_fee_value'], $this->get_option('wpsg_currency')), 1, 0, 'R');
-		 												
+
 		$offset += 8;
-		
-	}
-	
+
+	}
+
 	$pdf->SetFont('Arial', '', 9);
-	
+
 	if ($this->view['kunde']['ustidnr'] != "")
 	{
@@ -715,5 +736,5 @@
 		$pdf->Cell(37, 8, $this->view['kunde']['ustidnr'], 0, 0, 'R');
 	}
-	
+
 	$offset += 10;
 	if ($this->get_option('wpsg_kleinunternehmer'))
@@ -725,12 +746,12 @@
 		$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'] + $this->view['basket']['sum']['preis_rabatt'], $this->get_option('wpsg_currency')), 0, 0, 'R');
 		$offset += 5;
-		
+
 	}
 	else
 	{
-		
+
 		if ($this->view['basket']['noMwSt'] == '1')
 		{
-			
+
 			$pdf->Text($prod_left, $prod_top + $offset, __("Es ergibt sich folgender Gesamtbetrag", "wpsg").':');
 			$pdf->Text($prod_left + 100, $prod_top + $offset, __("BRUTTOBETRAG", "wpsg"));
@@ -738,60 +759,60 @@
 			$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_netto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
 			$offset += 5;
-			
+
 			$pdf->Text($prod_left + 100, $prod_top + $offset, __("MwSt. GESAMT", "wpsg"));
 			$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
 			$pdf->Cell(37, 8, wpsg_ff(0, $this->get_option('wpsg_currency')), 0, 0, 'R');
-					
-		}
-		else  
-		{
-			
+
+		}
+		else
+		{
+
 			$pdf->Text($prod_left, $prod_top + $offset, __("Der Gesamtbetrag setzt sich wie folgt zusammen", "wpsg"));
-				 
+
 			$pdf->Text($prod_left + 100, $prod_top + $offset, __("NETTOBETRAG", "wpsg"));
 			$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
 			$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_netto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
-							
+
 			if (sizeof($this->view['basket']['mwst']) >= 1)
 			{
-				
+
 				foreach ($this->view['basket']['mwst'] as $mw)
 				{
-					
+
 					$offset += 5;
 					$pdf->Text($prod_left + 100, $prod_top + $offset, __("MwSt. ", "wpsg").wpsg_ff($mw['value'], '%'));
 					$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
 					$pdf->Cell(37, 8, wpsg_ff($mw['sum'], $this->get_option('wpsg_currency')), 0, 0, 'R');
-					
-				}
-				
-			}
-		 	
+
+				}
+
+			}
+
 			if (sizeof($this->view['basket']['mwst']) > 1)
 			{
-				
+
 				$offset += 5;
 				$pdf->Text($prod_left + 100, $prod_top + $offset, __("MwSt. GESAMT", "wpsg"));
 				$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
 				$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'] - $this->view['basket']['sum']['preis_gesamt_netto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
-			
-			}
-	
-		} 
-		
-	}
-	
+
+			}
+
+		}
+
+	}
+
 	// Rabatt
 	if ($this->view['basket']['sum']['preis_rabatt'] > 0)
 	{
-		
+
 		$offset += 5;
-		
+
 		$pdf->Text($prod_left + 100, $prod_top + $offset, __("Rabatt", "wpsg"));
 		$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
 		$pdf->Cell(37, 8, '-'.wpsg_ff($this->view['basket']['sum']['preis_rabatt'], $this->get_option('wpsg_currency')), 0, 0, 'R');
-		
-	}
-	 
+
+	}
+
 	$offset += 5;
 	$pdf->Text($prod_left + 100, $prod_top + $offset, __("SUMME", "wpsg"));
@@ -801,53 +822,53 @@
 	if ($this->get_option('wpsg_kleinunternehmer') == '1')
 	{
- 
-		$pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset + 5, 5, $this->get_option('wpsg_kleinunternehmer_text')); 
+
+		$pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset + 5, 5, $this->get_option('wpsg_kleinunternehmer_text'));
 		$offset += 15;
-		
-	}
-	
+
+	}
+
 	if ($this->hasMod('wpsg_mod_deliverynote'))
 	{
-		
+
 		$arDN_order = $this->callMod('wpsg_mod_deliverynote', 'loadDeliveryNotesFromOrder', array($this->view['data']['id']));
 		$delivery_date = $this->callMod('wpsg_mod_deliverynote', 'getDeliveryTime', array($this->view['data']['id']));
-		
+
 		// Wenn es ein Gesamtlieferdatum gibt und nur einen Lieferschein, dann unter der Bestellung anzeigen
 		if ($delivery_date !== false && sizeof($arDN_order) == 1)
 		{
-			
-			$offset += 10; 
-			
+
+			$offset += 10;
+
 			$pdf->wpsg_MultiCell($prod_left, $prod_top + $offset, 5, wpsg_translate(__('Lieferung: #1#', 'wpsg'), date('d.m.Y', $delivery_date)));
 
 			$offset += 5;
-			
-		}
-		
-	}
-	
+
+		}
+
+	}
+
 	$offset += 5;
-	
+
 	if ($this->view['fussText'] != "")
 	{
-	
+
 		//$pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset, 5, utf8_encode($this->view['fussText']));		
 		$pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset, 5, $this->view['fussText']);
 		$pdf->SetFont('Arial', 'B', 9);
-		$offset += 10;	
-		
-	}
-	
+		$offset += 10;
+
+	}
+
 	$shipping_adress = false;
 
 	if ($this->hasMod('wpsg_mod_shippingadress') && $this->callMod('wpsg_mod_shippingadress', 'check_different_shippingadress', array('k_id' => $this->view['data']['k_id'], 'o_id' => $this->view['data']['id'])))
 	{
- 
+
 		$pdf->setFont('Arial', 'B', 9);
 		$pdf->Text($prod_left, $prod_top + $offset, __("Lieferanschrift", "wpsg").":");
 		$offset += 5;
-		
-		$pdf->setFont('Arial', '', 9);		
-		
+
+		$pdf->setFont('Arial', '', 9);
+
 		$shipping_adress = "";
 		if ($this->view['data']['shipping_firma'] != "")
@@ -858,33 +879,33 @@
 		$shipping_adress .= $this->view['data']['shipping_strasse']."\r\n";
 		//$shipping_adress .= $this->view['data']['shipping_land']['kuerzel'].'-';
-		
+
 		$shipping_adress .= $this->view['data']['shipping_plz'].' '.$this->view['data']['shipping_ort']."\r\n";
 		$shipping_adress .= $this->view['data']['shipping_land']['name'];
-		
-		
+
+
 		$start = $pdf->getY();
 		$pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset, 5, $shipping_adress, 0, 'L', 0, 100);
 		$offset += $pdf->getY() - $start;
-		
+
 		$shipping_adress = true;
-		
-	}
-		
-	
+
+	}
+
+
 	$offset += 5;
-	 
+
 	// Bestellvariablen
 	if ($this->hasMod('wpsg_mod_ordervars') && $this->get_option('wpsg_mod_rechnungen_showov') == '1')
 	{
-		
-		$bvars = @unserialize($this->view['data']['bvars']);		
+
+		$bvars = @unserialize($this->view['data']['bvars']);
 		if (!is_array($bvars)) $bvars = array();
-		
+
 		$strBVars = "";
 		foreach ($bvars as $bvars_id => $bvars_value)
 		{
-				
+
 			$bvars = $this->db->fetchRow("SELECT * FROM `".wpsg_q(WPSG_TBL_ORDERVARS)."` WHERE `id` = '".wpsg_q($bvars_id)."' ORDER BY `pos` ASC, `id` ASC ");
-			
+
 			if ($bvars['typ'] == "1") // Auswahl
 			{
@@ -897,44 +918,44 @@
 			else if ($bvars['typ'] == "3") // Checkbox
 			{
-				if ($bvars_value <= 0) $bvars_value = __("Keine Angabe", "wpsg");					
-			}
-			
-			$bvars_name = $this->callMod('wpsg_mod_ordervars', 'getNameById', array($bvars_id));			
-			$strBVars .= "\r\n".$bvars_name.": ".$bvars_value;	
-			
-		}
-		
-		$pdf->SetFont('Arial', 'B', 9);	
+				if ($bvars_value <= 0) $bvars_value = __("Keine Angabe", "wpsg");
+			}
+
+			$bvars_name = $this->callMod('wpsg_mod_ordervars', 'getNameById', array($bvars_id));
+			$strBVars .= "\r\n".$bvars_name.": ".$bvars_value;
+
+		}
+
+		$pdf->SetFont('Arial', 'B', 9);
 		$pdf->Text($prod_left, $prod_top + $offset, __("Angaben wÃ€hrend der Bestellung", "wpsg").":");
 		$pdf->SetFont('Arial', '', 9);
 		$pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset, 5, $strBVars);
-		
-	}  
-	
+
+	}
+
 	if (!file_exists($this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($this->view['data']['id']))))
 	{
-		
+
 		mkdir($this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($this->view['data']['id'])), 0777, true);
-		
-	}
-	
+
+	}
+
 	$this->callMods('wpsg_mod_rechnungen_pdf', array(&$pdf, &$this->view['data']['id'], &$this->view['preview'], &$this->view['invoice']));
-	
+
 	$filename = $this->view['filename'].".pdf";
 
-    ob_end_clean();
+	ob_end_clean();
 
 	if ($this->view['preview']) {
-	    
+
 		$pdf->Output($filename, 'I');
-        
+
 	} else {
-		
+
 		$pdf->Output($this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($this->view['data']['id'])).$filename, 'F');
-		
+
 		// Hier wird der Dateiname an FPD ÃŒbergeben. Er soll sich aus der Rechnungsnummer ergeben, auch wenn das Dokument ÃŒber die ID gespeichert ist.
 		if ($this->view['output'] === true) $pdf->Output($this->view['filename_out'], 'I');
-			
-	} 
-	 
+
+	}
+
 ?>
Index: /views/mods/mod_rechnungen/invoicemail_html.phtml
===================================================================
--- /views/mods/mod_rechnungen/invoicemail_html.phtml	(revision 7093)
+++ /views/mods/mod_rechnungen/invoicemail_html.phtml	(revision 7094)
@@ -4,4 +4,6 @@
 	 * Template fÃŒr die Mail, die beim Schreiben einer Rechnung optional an den Kunden versendet werden kann (HTML)
 	 */
+
+	include(WPSG_PATH_VIEW . 'mailtemplates/html/logo.phtml');
 
 	/* Wichtig, da die Module sonst kein HTML zurÃŒckgeben */
Index: /views/mods/mod_rechnungen/settings_edit.phtml
===================================================================
--- /views/mods/mod_rechnungen/settings_edit.phtml	(revision 7093)
+++ /views/mods/mod_rechnungen/settings_edit.phtml	(revision 7094)
@@ -7,60 +7,92 @@
 ?>
 
-<div>	
-    <ul class="nav nav-tabs" role="tablist">
-        <li role="presentation" class="active"><a href="#tab1" aria-controls="home" role="tab" data-toggle="tab"><?php echo __('Vordefinierte Textfelder', 'wpsg'); ?></a></li>
-        <li role="presentation"><a href="#tab2" aria-controls="profile" role="tab" data-toggle="tab"><?php echo __('FuÃzeile', 'wpsg'); ?></a></li>
-        <li role="presentation"><a href="#tab3" aria-controls="messages" role="tab" data-toggle="tab"><?php echo __('Sonstiges', 'wpsg'); ?></a></li>
-    </ul>
+<div>
+	<ul class="nav nav-tabs" role="tablist">
+		<li role="presentation" class="active"><a href="#tab1" aria-controls="home" role="tab" data-toggle="tab"><?php echo __('Vordefinierte Textfelder', 'wpsg'); ?></a></li>
+		<li role="presentation"><a href="#tab2" aria-controls="profile" role="tab" data-toggle="tab"><?php echo __('FuÃzeile', 'wpsg'); ?></a></li>
+		<li role="presentation"><a href="#tab3" aria-controls="messages" role="tab" data-toggle="tab"><?php echo __('Sonstiges', 'wpsg'); ?></a></li>
+	</ul>
 	<div class="tab-content">
 		<div id="tab1" role="tabpanel" class="tab-pane active" >
-			
+
 			<?php echo wpsg_drawForm_Input('wpsg_rechnungen_adresszeile', __('Adresszeile', 'wpsg'), $this->get_option('wpsg_rechnungen_adresszeile')); ?>
-<!--
+			<!--
 			<div class="wpsg_hinweis"><?php echo __('Diese Zeile wird klein oberhalb der Kundenadresse platziert', 'wpsg'); ?></div>
 			<br />
--->		
-            <?php echo wpsg_drawForm_TextStart(); ?>
-            	<div style="position:relative;">
-                <?php if ($this->view['bp'] === false) { ?>
-                <p><?php echo __('Es wurde bisher kein Briefpapier hochgeladen', 'wpsg'); ?></p>
-                <?php } else { ?>
-                <a href="<?php echo $this->view['bp']; ?>" target="_blank"><?php echo __('Derzeitiges Briefpapier', 'wpsg'); ?></a>
-                <?php } ?>
-                <a style="float:right; position:relative;" class="glyphicon glyphicon-question-sign form-control-feedback" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_rechnung_bp" data-wpsg-tip="mod_rechnung_bp" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_rechnung_bp"></a>
-                <input type="file" name="wpsg_rechnungen_bp">
-                <?php $strSuffix = ''; if ($this->view['bp'] !== false) { $strSuffix = '
+-->
+			<?php echo wpsg_drawForm_TextStart(); ?>
+			<div style="position:relative;">
+				<?php if ($this->view['bp'] === false) { ?>
+					<p><?php echo __('Es wurde bisher kein Briefpapier hochgeladen', 'wpsg'); ?></p>
+				<?php } else { ?>
+					<a href="<?php echo $this->view['bp']; ?>" target="_blank"><?php echo __('Derzeitiges Briefpapier', 'wpsg'); ?></a>
+				<?php } ?>
+				<a style="float:right; position:relative;" class="glyphicon glyphicon-question-sign form-control-feedback" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_rechnung_bp" data-wpsg-tip="mod_rechnung_bp" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_rechnung_bp"></a>
+				<input type="file" name="wpsg_rechnungen_bp">
+				<?php $strSuffix = ''; if ($this->view['bp'] !== false) { $strSuffix = '
                     <label>
 						<input type="checkbox" name="wpsg_rechnungen_bp_del" value="1" />&nbsp;'.__('LÃ¶schen', 'wpsg').'
 					</label>';
 					echo __($strSuffix);
-                } ?>
-				</div>
-            <?php echo wpsg_drawForm_TextEnd(__('Briefpapier (PDF/JPG)', 'wpsg'), array('noP' => true, 'helps' => 'wpsg_rechnungen_bp')); ?>
-
-            <?php echo wpsg_drawForm_TextStart(); ?>
-            	<div style="position:relative;">
-                <?php if ($this->view['logo'] === false) { ?>
-                <p><?php echo __('Es wurde bisher kein Logo hochgeladen', 'wpsg'); ?></p>
-                <?php } else { ?>
-                <a href="<?php echo $this->view['logo']; ?>" target="_blank"><?php echo __('Derzeitiges Logo', 'wpsg'); ?></a>
-                <?php } ?>
-                <a style="float:right; position:relative;" class="glyphicon glyphicon-question-sign form-control-feedback" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_rechnung_logo" data-wpsg-tip="mod_rechnung_logo" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_rechnung_logo"></a>
-                <input type="file" name="wpsg_rechnungen_logo">
-                <?php $strSuffix = ''; if ($this->view['logo'] !== false) { $strSuffix = '
-                    <label>
-						<input type="checkbox" name="wpsg_rechnungen_logo_del" value="1" />&nbsp;'.__('LÃ¶schen', 'wpsg').'
-					</label>';
-                	echo __($strSuffix);
-                } ?>
-                </div>
-            <?php echo wpsg_drawForm_TextEnd(__('Logo (JPG)', 'wpsg'), array('noP' => true, 'helps' => 'wpsg_rechnungen_bp')); ?>
-
-<!--		
-			<div class="wpsg_hinweis"><?php echo __('Das Briefpapier wird hinter die gesamte Seite gelegt, das Logo wird rechts oben auf jeder Seite platziert. (96 dpi)', 'wpsg'); ?></div>
-			<br />
--->		
+				} ?>
+			</div>
+			<?php echo wpsg_drawForm_TextEnd(__('Briefpapier (PDF/JPG)', 'wpsg'), array('noP' => true, 'helps' => 'wpsg_rechnungen_bp')); ?>
+
+			<?php echo wpsg_drawForm_TextStart(); ?>
+			<div style="position:relative;">
+				<?php if ($this->view['logo'] === false) { ?>
+					<p><?php echo __('Es wurde bisher kein Logo hochgeladen', 'wpsg'); ?></p>
+				<?php } else { ?>
+					<a href="<?php echo stripslashes($this->view['logo']); ?>" target="_blank"><?php echo __('Derzeitiges Logo', 'wpsg'); ?></a>
+				<?php } ?>
+				<a style="float:right; position:relative;" class="glyphicon glyphicon-question-sign form-control-feedback" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_rechnung_logo" data-wpsg-tip="mod_rechnung_logo" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_rechnung_logo"></a>
+				<input type="file" name="wpsg_rechnungen_logo">
+
+				<?php $logo_pos = $this->get_option("wpsg_rechnungen_logo_position"); ?>
+				<?php $defaultAlign = !isset($logo_pos) || empty($logo_pos) ? "align-buttons-active" : ""; ?>
+
+				<?php $alignLeft = $logo_pos === 'left' ? "align-buttons-active" : ""; ?>
+				<?php $alignCenter = $logo_pos === 'center' ? "align-buttons-active" : ""; ?>
+				<?php $alignRight = $logo_pos === 'right' ? "align-buttons-active" : ""; ?>
+
+				<?php $logo_transparency = $this->get_option("wpsg_rechnungen_logo_transparency") ?: "0%"; ?>
+
+				<?php $strSuffix = ''; if ($this->view['logo'] !== false) { $strSuffix = '
+					<div class="row">
+						<div class="col-md-4">
+							<div class="align-buttons">
+								<input type="input" data-toggle="tooltip" class="logo-align-button logo-align-button-left '.$alignLeft.'" name="wpsg_rechnungen_logo_position_left" value="&#xf036" onclick="handleLogoAlignClick($(this))" onkeydown="return false;" onfocus="return false;" autocomplete="off" title="'.__("Logo linksbÃŒndig ausrichten").'">
+								<input type="input" data-toggle="tooltip" class="logo-align-button logo-align-button-center '.$alignCenter.'" name="wpsg_rechnungen_logo_position_center" value="&#xf037" onclick="handleLogoAlignClick($(this))" onkeydown="return false;" onfocus="return false;" autocomplete="off" title="'.__("Logo zentrieren").'">
+								<input type="input" data-toggle="tooltip" class="logo-align-button logo-align-button-right '.$alignRight.' '.$defaultAlign.'" name="wpsg_rechnungen_logo_position_right" value="&#xf038" onclick="handleLogoAlignClick($(this))" onkeydown="return false;" onfocus="return false;" autocomplete="off" title="'.__("Logo rechtsbÃŒndig ausrichten").'">
+							</div>
+						</div>
+						<div class="col-md-8 logo-transparency">
+							<label>
+								<input type="text" name="wpsg_rechnungen_logo_transparency" value="'.$logo_transparency.'" />&nbsp;'.__('Logodeckkraft', 'wpsg').'
+							</label>		
+						</div>
+						<div class="col-md-12">
+							<label>
+								<input type="checkbox" name="wpsg_rechnungen_logo_del" value="1" />&nbsp;'.__('LÃ¶schen', 'wpsg').'
+							</label>	
+						</div>
+					</div>';
+					echo __($strSuffix);
+				} ?>
+
+			<button class="button wpsg_rechnungen_preview" style="float:right; margin-right:10px;" name="wpsg_rechnungen_preview" type="button">
+				<?php echo __("Vorschau", "wpsg"); ?>
+			</button>
+
+			</div>
+			<?php echo wpsg_drawForm_TextEnd(__('Logo (JPG)', 'wpsg'), array('noP' => true, 'helps' => 'wpsg_rechnungen_bp')); ?>
+
+
+			<!--
+			<div class="wpsg_hinweis"><?php echo __('Das Briefpapier wird hinter die gesamte Seite gelegt, das Logo wird standardmÃ€Ãig rechts oben auf jeder Seite platziert. (96 dpi)', 'wpsg'); ?></div>
+			<br />
+-->
 			<table class="table table-body-striped wpsg_mod_deliverynote_fieldtable">
-              <thead>
+				<thead>
 				<tr>
 					<th class="col_bezeichnung"><?php echo __('Bezeichnung', 'wpsg'); ?></th>
@@ -72,73 +104,73 @@
 					<th class="col_action"></th>
 				</tr>
-              </thead>
-              <tbody>
+				</thead>
+				<tbody>
 				<?php foreach ($this->view['fields'] as $f => $field_name) { ?>
-				<tr>
-					<td><?php echo wpsg_getStr($field_name); ?></td>
-					<td>
-						<input type="text" style="width:100%;" name="text[<?php echo $f; ?>][text]" value="<?php echo wpsg_getStr($this->view['arTexte'][$f]['text']); ?>" />
-					</td>
-					<td>
-						<input type="text" style="width:100%;" name="text[<?php echo $f; ?>][x]" value="<?php echo wpsg_getStr($this->view['arTexte'][$f]['x']); ?>" />
-					</td>
-					<td>
-						<input type="text" style="width:100%;" name="text[<?php echo $f; ?>][y]" value="<?php echo wpsg_getStr($this->view['arTexte'][$f]['y']); ?>" />
-					</td>
-					<td>
-						<input type="text" style="width:100%;" name="text[<?php echo $f; ?>][color]" value="<?php echo wpsg_getStr($this->view['arTexte'][$f]['color']); ?>" />
-					</td>
-					<td>
-						<select name="text[<?php echo $f; ?>][fontsize]" style="width:100%;">
-							<option <?php echo ((wpsg_getStr($this->view['arTexte'][$f]['fontsize']) == "8")?'selected="selected"':''); ?> value="8">8</option>				
-							<option <?php echo ((wpsg_getStr($this->view['arTexte'][$f]['fontsize']) == "9")?'selected="selected"':''); ?> value="9">9</option>
-							<option <?php echo ((wpsg_getStr($this->view['arTexte'][$f]['fontsize']) == "10")?'selected="selected"':''); ?> value="10">10</option>
-							<option <?php echo ((wpsg_getStr($this->view['arTexte'][$f]['fontsize']) == "11")?'selected="selected"':''); ?> value="11">11</option>
-							<option <?php echo ((wpsg_getStr($this->view['arTexte'][$f]['fontsize']) == "12")?'selected="selected"':''); ?> value="12">12</option>
-							<option <?php echo ((wpsg_getStr($this->view['arTexte'][$f]['fontsize']) == "13")?'selected="selected"':''); ?> value="13">13</option>
-							<option <?php echo ((wpsg_getStr($this->view['arTexte'][$f]['fontsize']) == "14")?'selected="selected"':''); ?> value="14">14</option>
-						  
-						</select>
-					</td>
-					<td>			
-						<label><input type="checkbox" value="1" name="text[<?php echo $f; ?>][aktiv]" <?php echo ((wpsg_isSizedInt($this->view['arTexte'][$f]['aktiv']))?'checked="checked"':''); ?> />&nbsp;<?php echo __("Aktiv", "wpsg"); ?></label>
-						<a style="float:right; position:relative;" class="glyphicon glyphicon-question-sign" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_rechnung_fieldconfig" data-wpsg-tip="mod_rechnung_fieldconfig" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_rechnung_fieldconfig"></a>
-					</td>
-				</tr>
+					<tr>
+						<td><?php echo wpsg_getStr($field_name); ?></td>
+						<td>
+							<input type="text" style="width:100%;" name="text[<?php echo $f; ?>][text]" value="<?php echo wpsg_getStr($this->view['arTexte'][$f]['text']); ?>" />
+						</td>
+						<td>
+							<input type="text" style="width:100%;" name="text[<?php echo $f; ?>][x]" value="<?php echo wpsg_getStr($this->view['arTexte'][$f]['x']); ?>" />
+						</td>
+						<td>
+							<input type="text" style="width:100%;" name="text[<?php echo $f; ?>][y]" value="<?php echo wpsg_getStr($this->view['arTexte'][$f]['y']); ?>" />
+						</td>
+						<td>
+							<input type="text" style="width:100%;" name="text[<?php echo $f; ?>][color]" value="<?php echo wpsg_getStr($this->view['arTexte'][$f]['color']); ?>" />
+						</td>
+						<td>
+							<select name="text[<?php echo $f; ?>][fontsize]" style="width:100%;">
+								<option <?php echo ((wpsg_getStr($this->view['arTexte'][$f]['fontsize']) == "8")?'selected="selected"':''); ?> value="8">8</option>
+								<option <?php echo ((wpsg_getStr($this->view['arTexte'][$f]['fontsize']) == "9")?'selected="selected"':''); ?> value="9">9</option>
+								<option <?php echo ((wpsg_getStr($this->view['arTexte'][$f]['fontsize']) == "10")?'selected="selected"':''); ?> value="10">10</option>
+								<option <?php echo ((wpsg_getStr($this->view['arTexte'][$f]['fontsize']) == "11")?'selected="selected"':''); ?> value="11">11</option>
+								<option <?php echo ((wpsg_getStr($this->view['arTexte'][$f]['fontsize']) == "12")?'selected="selected"':''); ?> value="12">12</option>
+								<option <?php echo ((wpsg_getStr($this->view['arTexte'][$f]['fontsize']) == "13")?'selected="selected"':''); ?> value="13">13</option>
+								<option <?php echo ((wpsg_getStr($this->view['arTexte'][$f]['fontsize']) == "14")?'selected="selected"':''); ?> value="14">14</option>
+
+							</select>
+						</td>
+						<td>
+							<label><input type="checkbox" value="1" name="text[<?php echo $f; ?>][aktiv]" <?php echo ((wpsg_isSizedInt($this->view['arTexte'][$f]['aktiv']))?'checked="checked"':''); ?> />&nbsp;<?php echo __("Aktiv", "wpsg"); ?></label>
+							<a style="float:right; position:relative;" class="glyphicon glyphicon-question-sign" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_rechnung_fieldconfig" data-wpsg-tip="mod_rechnung_fieldconfig" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_rechnung_fieldconfig"></a>
+						</td>
+					</tr>
 				<?php } ?>
-              </tbody>
+				</tbody>
 			</table>
-						
-			<br />
-			
+
+			<br />
+
 			<input style="float:right;" class="button" onclick="if (!confirm('<?php echo __('Sind Sie sich sicher? Ihre bisherigen Einstellungen gehen verloren!', 'wpsg'); ?>')) return false; else location.href = '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;action=module&amp;modul=<?php echo $_REQUEST['modul']; ?>&amp;do=reset&amp;noheader=1';" type="button" value="<?php echo __('Standardeinstellungen laden', 'wpsg'); ?>" />
-			
+
 			<div class="info">
-				<p style="line-height:none;">
+				<p style="line-height:normal;">
 					<?php echo __('Die Angaben fÃŒr X (Abstand von Links) und Y (Abstand von Oben) werden in mm eingetragen.', 'wpsg'); ?><br />
-					<?php echo __('Die Farbe wird im Hexadezimalformat angegeben (#FFFFFF fÃŒr weiÃ, #000000 fÃŒr schwarz).', 'wpsg'); ?> 
+					<?php echo __('Die Farbe wird im Hexadezimalformat angegeben (#FFFFFF fÃŒr weiÃ, #000000 fÃŒr schwarz).', 'wpsg'); ?>
 				</p>
 			</div>
 			<br />
-			
+
 		</div>
 		<div id="tab2" role="tabpanel" class="tab-pane" >
-			
+
 			<div id="foottext_list"><?php echo $this->view['foottext_list']; ?></div>
-            <br />
-
-            <a title="<?php echo __('Neue FuÃzeile anlegen', 'wpsg'); ?>" href="" class="" onclick="return wpsg_addFooter();"><span class="glyphicon wpsg-glyphicon glyphicon-plus"></span><?php echo __('Neue FuÃzeile anlegen.', 'wpsg'); ?></a>
-
-            <br /><br />
+			<br />
+
+			<a title="<?php echo __('Neue FuÃzeile anlegen', 'wpsg'); ?>" href="" class="" onclick="return wpsg_addFooter();"><span class="glyphicon wpsg-glyphicon glyphicon-plus"></span><?php echo __('Neue FuÃzeile anlegen.', 'wpsg'); ?></a>
+
+			<br /><br />
 			<div class="info">
-				<p style="line-height:none;">
+				<p style="line-height:normal;">
 					<?php echo __('Hier kÃ¶nnen Sie Texte vordefinieren, die sie unter die Rechnung setzen kÃ¶nnen.', 'wpsg'); ?>
 				</p>
 			</div>
-			
-		</div>		
+
+		</div>
 		<div id="tab3" role="tabpanel" class="tab-pane" >
-		
-			<?php echo wpsg_drawForm_Input('wpsg_rechnungen_url', __('URL Benachrichtigung', 'wpsg'), $this->get_option('wpsg_rechnungen_url'), array('help' => 'wpsg_rechnung_url')); ?>			
+
+			<?php echo wpsg_drawForm_Input('wpsg_rechnungen_url', __('URL Benachrichtigung', 'wpsg'), $this->get_option('wpsg_rechnungen_url'), array('help' => 'wpsg_rechnung_url')); ?>
 			<?php echo wpsg_drawForm_Select('wpsg_mod_rechnungen_auto', __('Rechnungserstellung', 'wpsg'), array(
 				'0' => __('Manuell', 'wpsg'),
@@ -149,9 +181,9 @@
 			<?php echo wpsg_drawForm_Input('wpsg_rechnungen_pdfperpage', __('Anzahl an Produkten pro Seite (PDF)', 'wpsg'), $this->get_option('wpsg_rechnungen_pdfperpage'), array('help' => 'wpsg_rechnungen_pdfperpage')); ?>
 			<?php echo wpsg_drawForm_Checkbox('wpsg_rechnungen_pbeschreibung', __('Produktbeschreibung auf Rechnung anzeigen', 'wpsg'), $this->get_option('wpsg_rechnungen_pbeschreibung'), array('help' => 'wpsg_rechnungen_pbeschreibung')); ?>
-			
+
 			<?php if ($this->hasMod('wpsg_mod_produktattribute') == '1') {?>
-				<?php echo wpsg_drawForm_Checkbox('wpsg_rechnungen_produktattribute', __('Produktattribute auf der Rechnung anzeigen', 'wpsg'), $this->get_option('wpsg_rechnungen_produktattribute'), array('help' => 'wpsg_rechnungen_produktattribute')); ?>			
+				<?php echo wpsg_drawForm_Checkbox('wpsg_rechnungen_produktattribute', __('Produktattribute auf der Rechnung anzeigen', 'wpsg'), $this->get_option('wpsg_rechnungen_produktattribute'), array('help' => 'wpsg_rechnungen_produktattribute')); ?>
 			<?php }?>
-			
+
 			<?php echo wpsg_drawForm_Checkbox('wpsg_mod_rechnungen_showgutschriftrechnung', __('Rechnungsnummer auf Rechnungskorrektur anzeigen', 'wpsg'), $this->get_option('wpsg_mod_rechnungen_showgutschriftrechnung'), array('help' => 'wpsg_mod_rechnungen_showgutschriftrechnung')); ?>
 			<?php echo wpsg_drawForm_Checkbox('wpsg_mod_rechnungen_showpv', __('Produktvariablen auf Rechnung anzeigen', 'wpsg'), $this->get_option('wpsg_mod_rechnungen_showpv'), array('help' => 'wpsg_mod_rechnungen_showpv')); ?>
@@ -169,28 +201,29 @@
 				'2' => __('Als extra Zeile anzeigen', 'wpsg')
 			), $this->get_option('wpsg_mod_rechnungen_anr'), array('help' => 'wpsg_mod_rechnungen_anr')); ?>
-			
-      <?php echo wpsg_drawForm_TextStart(); ?>
-				<div class="info">				
-					<p style="line-height:none;">
-						%nr% - <?php echo __('Fortlaufende Rechnungs- bzw. Rechnungskorrekturnummer', 'wpsg'); ?><br />
-						%Jahr% - <?php echo __('Das aktuelle Jahr (4 Stellig)', 'wpsg'); ?><br />
-						%Monat% - <?php echo __('Der aktuelle Monat (01 - 12)', 'wpsg'); ?><br />
-						%Tag% - <?php echo __('Der Tag des Monats (01 - 31)', 'wpsg'); ?><br />						
-					</p>
-				</div>
-					
-					<p style="line-height:none;"><?php echo __('Die Platzhalter kÃ¶nnen bei den Formatfeldern und dem Dateinamen verwendet werden. Der Platzhalter %nr% sollte dabei immer Verwendung finden.', 'wpsg'); ?></p>
-											
+
+			<?php echo wpsg_drawForm_TextStart(); ?>
+			<div class="info">
+				<p style="line-height:normal;">
+					%nr% - <?php echo __('Fortlaufende Rechnungs- bzw. Rechnungskorrekturnummer', 'wpsg'); ?><br />
+					%Jahr% - <?php echo __('Das aktuelle Jahr (4 Stellig)', 'wpsg'); ?><br />
+					%Monat% - <?php echo __('Der aktuelle Monat (01 - 12)', 'wpsg'); ?><br />
+					%Tag% - <?php echo __('Der Tag des Monats (01 - 31)', 'wpsg'); ?><br />
+				</p>
+			</div>
+
+			<p style="line-height:normal;"><?php echo __('Die Platzhalter kÃ¶nnen bei den Formatfeldern und dem Dateinamen verwendet werden. Der Platzhalter %nr% sollte dabei immer Verwendung finden.', 'wpsg'); ?></p>
+
 			<?php echo wpsg_drawForm_TextEnd(__('MÃ¶gliche Platzhalter fÃŒr Rechnungen und Rechnungskorrektur', 'wpsg'), array('noP' => true)); ?>
-		
+
 		</div>
 	</div>
 </div>
- 
+
 
 <script type="text/javascript">/* <![CDATA[ */
 
 	jQuery(document).ready(function() {
-		jQuery('#wpsg_tab').wpsg_tab( { 
+
+		jQuery('#wpsg_tab').wpsg_tab( {
 			'cookiename': 'wpsg_rechnungen_tab',
 			'tab2': function() {
@@ -198,13 +231,69 @@
 			}
 		} );
+
+		let onloadActiveBtn = $(".align-buttons-active")[0];
+		if(onloadActiveBtn)
+		{
+			if(!onloadActiveBtn.value.includes("selected"))
+				onloadActiveBtn.value += " selected";
+		}
+
+		$(".wpsg_rechnungen_preview").click(function(){ wpsg_rechnungen_preview(); });
+
 	} );
 
+	/**
+	 * Stellt sicher, dass immer nur ein Button der align-buttons die highlight Klasse hat
+	 */
+	function handleLogoAlignClick(pressedEl)
+	{
+
+		if(pressedEl.hasClass("align-buttons-active")) return;
+		else
+		{
+
+			pressedEl.addClass("align-buttons-active");
+			pressedEl[0].value = pressedEl[0].value + " selected";
+
+			jQuery.each($(".logo-align-button"), function(index, element) {
+				if(element.classList.contains("align-buttons-active") && element !== pressedEl[0]){
+
+					var values = element.value.split(" ");
+					element.value = values[0];
+
+					element.classList.remove("align-buttons-active");
+
+					return false;
+
+				}
+			});
+
+		}
+
+	} // function handleLogoAlignClick()
+
+	// Verhindern der Weiterleitung nach dem Klick auf einen Align Button
+	$(".logo-align-button").click(function() { return false; });
+
+	/**
+	 * Wird beim Klicken auf den Vorschau Button ausgelÃ¶st
+	 */
+	function wpsg_rechnungen_preview()
+	{
+
+		let url = "<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_rechnungen&do=orderAjax&noheader=1&wpsg_rechnungen_preview=1";
+
+		window.open(url, '_blank');
+
+		return false;
+
+	} // function wpsg_rechnungen_preview()
 
 	/**
 	 * Wird beim anlegen einer neuen FuÃzeile aufgerufen
-	 */ 
+	 */
 	function wpsg_addFooter()
 	{
-	
+
 		jQuery('#foottext_list').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
 		
@@ -217,5 +306,5 @@
 
 		return false;
-	
+
 	} // function wpsg_addFooter()
 
@@ -245,3 +334,3 @@
 
 
-/* ]]> */</script>
+	/* ]]> */</script>
Index: /views/mods/mod_surfaceproduct/mail_row.html.phtml
===================================================================
--- /views/mods/mod_surfaceproduct/mail_row.html.phtml	(revision 7093)
+++ /views/mods/mod_surfaceproduct/mail_row.html.phtml	(revision 7094)
@@ -4,4 +4,6 @@
     * Template fÃŒr die Intergration der FlÃ€chenProdukt-Daten in die HTML Kunden- und Adminmail
     */
+
+	include(WPSG_PATH_VIEW . 'mailtemplates/html/logo.phtml');
 
 ?>
Index: /views/order/view_alternativeDesign.phtml
===================================================================
--- /views/order/view_alternativeDesign.phtml	(revision 7094)
+++ /views/order/view_alternativeDesign.phtml	(revision 7094)
@@ -0,0 +1,491 @@
+<?php
+
+	/**
+	 * Template fÃŒr die alternative Ansicht einer Bestellung im Backend
+	 */
+
+?>
+
+<?php //wpsg_debug(print_r($this->view['arSubAction'])); ?>
+
+<style>.orderdetail-alternative-left:active, .orderdetail-alternative-right:active { cursor: move; }</style>
+
+<div class="wpsg_order_view wpsg_order_view_alternativedesign" id="wpsg-bs">
+
+	<nav class="navbar navbar-default">
+		<div class="container-fluid">
+			<div class="navbar-header">
+				<a class="navbar-brand" href="#"><?php echo __('wpShopGermany', 'wpsg'); ?></a>
+			</div>
+			<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
+				<ul class="nav navbar-nav">
+					<li role="presentation" class="<?php echo ((!isset($_REQUEST['action']))?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order"><?php echo __("BestellÃŒbersicht", "wpsg"); ?></a></li>
+					<li role="presentation" class="wpsg_showhide_filter active"><a onclick="return false;"><?php echo __("Bestellansicht (Detail)", "wpsg"); ?></a></li>
+					<li role="presentation" class="wpsg_top_extend" id="wpsg_be_orderdata">
+
+						<?php echo $this->view['oOrder']->getInvoiceFirstName().' '.$this->view['oOrder']->getInvoiceName().' / '.wpsg_ff($this->view['oOrder']->getAmount($this->getBackendTaxview()), $this->get_option('wpsg_currency')); ?>
+
+						<?php if (trim($this->view['oOrder']->admincomment) != "") { ?>
+							<a title="<?php echo __("Kommentar (Admin): ", "wpsg").htmlspecialchars($this->view['oOrder']->admincomment); ?>" onclick="return false;" class="glyphicon glyphicon-question-sign commenticon admincomment" href="#"></a>
+						<?php } ?>
+
+						<?php if (trim($this->view['oOrder']->comment) != "") { ?>
+							<a title="<?php echo __("Kommentar (Kunde): ", "wpsg").htmlspecialchars($this->view['oOrder']->comment); ?>" onclick="return false;" class="glyphicon glyphicon-question-sign commenticon customercomment" href="#"></a>
+						<?php } ?>
+
+					</li>
+				</ul>
+				<ul class="nav navbar-nav navbar-right">
+					<li>
+						<a style="padding-top:11px;padding-bottom:11px;">
+							<button role="button" class="button btn-reset-itemorder">Anordnung der Kacheln zurÃŒcksetzen</button>
+						</a>
+					</li>
+				</ul>
+			</div>
+		</div>
+	</nav>
+
+	<div class="wpsg_msg_wrap"><hr class="wp-header-end wpsg-wp-header-end"/></div>
+
+
+	<div class="orderdetail-alternative">
+		<div class="col-md-8 orderdetail-alternative-left connectedSortable">
+			<div id="item-general" class="orderdetail-item orderdetail-item-left orderdetail-item-_general">
+				<div id="item-general" class="orderdetail-item-inner">
+
+					<?php echo $this->view['arSubAction']['general']['content']; ?>
+
+				</div>
+			</div>
+			<div id="item-orderdata" class="orderdetail-item orderdetail-item-left orderdetail-item-_orderdata">
+				<div id="item-orderdata" class="orderdetail-item-inner">
+
+					<?php echo $this->view['arSubAction']['orderdata']['content']; ?>
+
+				</div>
+			</div>
+			<div id="item-ordervariables" class="orderdetail-item orderdetail-item-left orderdetail-item-_ordervariables">
+				<div id="item-ordervariables" class="orderdetail-item-inner">
+
+					<?php echo $this->view['arSubAction']['950']['content']; ?>
+
+				</div>
+			</div>
+			<div id="item-customercontact" class="orderdetail-item orderdetail-item-left orderdetail-item-_customercontact">
+				<div id="item-customercontact" class="orderdetail-item-inner">
+
+					<?php echo $this->view['arSubAction']['1000']['content']; ?>
+
+				</div>
+			</div>
+			<div id="item-bills" class="orderdetail-item orderdetail-item-left orderdetail-_item-bills">
+				<div id="item-bills" class="orderdetail-item-inner">
+
+					<?php echo $this->view['arSubAction']['1400']['content']; ?>
+
+				</div>
+			</div>
+			<div id="item-deliverynotes" class="orderdetail-item orderdetail-item-left orderdetail-item-_deliverynotes">
+				<div id="item-deliverynotes" class="orderdetail-item-inner">
+
+					<?php echo $this->view['arSubAction']['2000']['content']; ?>
+
+				</div>
+			</div>
+		</div> <!-- .orderdetail-alternative-left -->
+
+
+
+		<div class="col-md-4 orderdetail-alternative-right connectedSortable">
+			<div id="item-customerdata" class="orderdetail-item orderdetail-item-right orderdetail-item-_customerdata">
+				<div id="item-customerdata" class="orderdetail-item-inner">
+
+					<?php echo $this->view['arSubAction']['customerdata']['content']; ?>
+
+				</div>
+			</div>
+			<div id="item-shippay" class="orderdetail-item orderdetail-item-right orderdetail-item-_shippay">
+				<div id="item-shippay" class="orderdetail-item-inner">
+
+					<?php echo $this->view['arSubAction']['shippay']['content']; ?>
+
+				</div>
+			</div>
+			<div id="item-confirmation" class="orderdetail-item orderdetail-item-right orderdetail-item-_confirmation">
+				<div id="item-confirmation" class="orderdetail-item-inner">
+
+					<?php echo $this->view['arSubAction']['70']['content']; ?>
+
+				</div>
+			</div>
+			<div id="item-trustedshops" class="orderdetail-item orderdetail-item-right orderdetail-item-_trustedshops">
+				<div id="item-trustedshops" class="orderdetail-item-inner">
+
+					<?php echo $this->view['arSubAction']['5000']['content']; ?>
+
+				</div>
+			</div>
+			<div id="item-orderlog" class="orderdetail-item orderdetail-item-right orderdetail-item-_orderlog">
+				<div id="item-orderlog" class="orderdetail-item-inner">
+
+					<?php echo $this->view['arSubAction']['orderlog']['content']; ?>
+
+				</div>
+			</div>
+			<div id="item-dev" class="orderdetail-item orderdetail-item-right orderdetail-item-_dev">
+				<div id="item-dev" class="orderdetail-item-inner">
+
+					<?php echo $this->view['arSubAction']['dev']['content']; ?>
+
+				</div>
+			</div>
+		</div> <!-- .orderdetail-alternative-right -->
+	</div>
+
+
+</div>
+
+
+
+<script type="text/javascript">/* <![CDATA[ */
+
+	/**
+	 * Ersetzt jedes Vorkommen eines Charaktersets in einem String
+	 */
+	String.prototype.replaceAll = function(search, replacement)
+	{
+
+		let target = this;
+		return target.split(search).join(replacement);
+
+	}; // String.prototype.replaceAll()
+
+	/**
+	 * Sendet eine eMail
+	 */
+	function wpsg_sendMail(oid)
+	{
+		jQuery('#wpsg_produkte_table').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+
+		jQuery.ajax( {
+			url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=sendMail&do=send&edit_id=' + oid + '&noheader=1',
+			success: function(data) {
+				jQuery('#wpsg_produkte_table').replaceWith(data);
+				location.href = location.href;
+			}
+		} );
+
+		return false;
+
+	} // function wpsg_sendMail()
+
+	/**
+	 * FÃŒgt einen neuen Rabatt hinzu (nur wenn keiner da ist)
+	 */
+	function wpsg_addDiscount(oid)
+	{
+		jQuery('#wpsg_produkte_table').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+
+		jQuery.ajax( {
+			url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&subaction=discountData&do=add&edit_id=' + oid + '&noheader=1',
+			success: function(data) {
+				jQuery('#wpsg_produkte_table').replaceWith(data);
+				jQuery('#LinkRabattNeu').hide();
+			}
+		} );
+
+		return false;
+
+	} // function wpsg_addDiscount()
+
+
+	/**
+	 * FÃŒgt einen neuen Gutschein hinzu (nur wenn keiner da ist)
+	 */
+	function wpsg_addVoucher(oid)
+	{
+		jQuery('#wpsg_produkte_table').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+
+		jQuery.ajax( {
+			url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&subaction=voucherData&do=add&edit_id=' + oid + '&noheader=1',
+			success: function(data) {
+				jQuery('#wpsg_produkte_table').replaceWith(data);
+				jQuery('#LinkGutscheinNeu').hide();
+				//jQuery('#wpsg_kv_list').html(data);
+				//location.href = location.href;
+				//jQuery('#wpsg_kv_list').html('');
+			}
+		} );
+
+		return false;
+
+	} // function wpsg_addVoucher()
+
+	/*
+	 * Wendet die gespeicherte Reihenfolge auf die verschiebbaren Elemente an
+	 */
+	function applySavedItemOrder()
+	{
+
+		let leftElements = jQuery(".orderdetail-item-left");
+		let rightElements = jQuery(".orderdetail-item-right");
+
+		let leftOrder = '<?php echo json_encode($this->get_option('wpsg_backendui_orderdetail_itemorder_left')); ?>' || false;
+		let rightOrder = '<?php echo json_encode($this->get_option('wpsg_backendui_orderdetail_itemorder_right')); ?>' || false;
+
+		if(leftOrder === "false" || leftOrder.includes('"",')) leftOrder = false;
+		if(rightOrder === "false" || rightOrder.includes('"",')) rightOrder = false;
+
+		if(leftOrder)
+		{
+
+			let elementIDs = [];
+			leftElements.each(function(key, item) {
+				elementIDs.push(item.id);
+			});
+
+			let cleanLeftOrder = leftOrder.replace("[", "").replace("]", "").replaceAll('"', "").split(",");
+			writeOrderItems(cleanLeftOrder, "left");
+
+		}
+
+		if(rightOrder)
+		{
+
+			let elementIDs = [];
+			rightElements.each(function(key, item) {
+				elementIDs.push(item.id);
+			});
+
+			let cleanRightOrder = rightOrder.replace("[", "").replace("]", "").replaceAll('"', "").split(",");
+			writeOrderItems(cleanRightOrder, "right");
+
+		}
+
+	} // function applySavedItemOrder()
+
+	/*
+	 * Schreibt Elemente der angegebenen IDs ins DOM
+	 */
+	function writeOrderItems(orderIDs, orderPos)
+	{
+
+		let writeElement = "";
+
+		let elements = [];
+		orderIDs.forEach(function(id) {
+			elements.push(jQuery(`#${id}`)[0]);
+		});
+
+		switch(orderPos) {
+
+			case 'left':
+				writeElement = jQuery(".orderdetail-alternative-left");
+				break;
+
+			case 'right':
+				writeElement = jQuery(".orderdetail-alternative-right");
+				break;
+
+		}
+
+		if(writeElement.length > 0 || writeElement !== "")
+		{
+
+			writeElement[0].innerHTML = "";
+			elements.forEach(function (element) {
+				try{
+					writeElement[0].innerHTML += element.innerHTML;
+				}
+				catch(err){
+					return false;
+				}
+			});
+
+		}
+
+	} // function writeOrderItems()
+
+	/*
+	 * Weist den zuvor eingeklappten Elementen eine Klase zu und klappt sie schlieÃlich auch ein
+	 */
+	function applyFoldedStatus()
+	{
+
+		let foldedPanels = '<?php echo json_encode($this->get_option('wpsg_backendui_orderdetail_foldedpanels')); ?>' || false;
+		if(foldedPanels === "false" || foldedPanels.includes('"",')) foldedPanels = false;
+
+		if(foldedPanels)
+		{
+
+			let foldedPanelsArr = foldedPanels.replace("[", "").replace("]", "").replaceAll('"', "").split(",");
+
+			for(var i = 0; i < foldedPanelsArr.length; i++) {
+				let mainParent = jQuery(`#${foldedPanelsArr[i].split("_")[0]}`);
+				mainParent.find(".panel-body").slideUp('fast');
+			}
+
+		}
+
+	} // fucntion applyFoldedStatus()
+
+	/*
+	 *  Speichert die angegebene Reihenfolge der verschiebbaren Elemente
+	 */
+	function saveItemOrder(order, orderPosition)
+	{
+
+		jQuery.ajax( {
+			url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&subaction=itemOrderData&do=save&noheader=1',
+			data: {
+				'order': order,
+				'orderPosition': orderPosition
+			}
+		} );
+
+	} // function saveItemOrder(order, orderPosition)
+
+	/*
+	 *  Speichert die angegebene Reihenfolge der verschiebbaren Elemente
+	 */
+	function saveFoldedItems(items)
+	{
+
+		jQuery.ajax( {
+			url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&subaction=foldedItemsData&do=save&noheader=1',
+			data: {
+				'folded_items': items
+			}
+		} );
+
+	} // function saveItemOrder(order, orderPosition)
+
+	// Weist dem gegebenen JS Element eine einzigartige Klasse zu
+	// und gibt das jeweilige Element als jQuery Object zurÃŒck
+	let counter = 0;
+	function jsElTojQueryObj(jsEl, specificClass) {
+
+		let id = jsEl.id ? `#${jsEl.id}` : "";
+		let classes = "";
+
+		if(typeof jsEl !== "object" || jsEl.length <= 1 && jsEl[0] === "#document")
+			return;
+
+		jsEl.classList.add(`${specificClass}-${counter++}`);
+
+		if(jsEl.classList && jsEl.classList.length > 0) {
+
+			jsEl.classList.forEach(function(className) {
+				if(!classes.includes(`.${className}`)) classes += `.${className}`;
+			});
+
+		}
+
+		return $(`${jsEl.tagName.toLowerCase()}${id}${classes}`);
+
+	} // function jsElTojQueryObj(jsEl, specificClass)
+
+
+	jQuery(document).ready(function() {
+
+		applySavedItemOrder();
+		applyFoldedStatus();
+		wpsg_view_orderdata_hide();
+
+		jQuery('#wpsg_order_view_tabs a.list-group-item').bind('click', function() {
+
+			jQuery('#wpsg_order_view_tabs a').removeClass('active');
+			jQuery('.wpsg_order_view_tab_content').hide();
+
+			tab = jQuery(this).attr('wpsg-data-target');
+			if (tab == 'orderdata') {
+				wpsg_view_orderdata_show();
+			} else {
+				wpsg_view_orderdata_hide();
+			}
+			jQuery(this).addClass('active');
+			jQuery('#tab' + jQuery(this).attr('wpsg-data-target')).show();
+
+			jQuery.cookie('wpsg_order_view_tab', jQuery(this).attr('wpsg-data-target'));
+			jQuery(this).blur();
+
+		} );
+
+
+		co = jQuery.cookie('wpsg_order_view_tab');
+		if (co === undefined) {
+			jQuery("[wpsg-data-target='general']").trigger("click");
+		} else {
+			jQuery("[wpsg-data-target='" + co + "']").trigger("click");
+		}
+
+		// Anordnung der Kacheln zurÃŒcksetzen
+		jQuery(".btn-reset-itemorder").click(function() {
+			const leftorder = ["item-general", "item-orderdata", "item-ordervariables", "item-customercontact", "item-bills", "item-deliverynotes"];
+			const rightorder = ["item-customerdata", "item-shippay", "item-confirmation", "item-trustedshops", "item-orderlog", "item-dev"];
+
+			saveItemOrder(leftorder, "left");
+			saveItemOrder(rightorder, "right");
+
+			setTimeout(function(){
+				applySavedItemOrder();
+			}, 1000);
+		});
+
+		// Drag & Drop
+		jQuery(".orderdetail-alternative-left, .orderdetail-alternative-right").sortable({
+			connectWith: ".connectedSortable"
+		}).disableSelection();
+
+		jQuery(".orderdetail-alternative-left").on('sortupdate', function()
+		{
+			var action = jQuery(".orderdetail-alternative-left").sortable("toArray");
+			saveItemOrder(action, "left");
+		});
+		jQuery(".orderdetail-alternative-right").on('sortupdate', function()
+		{
+			var action = jQuery(".orderdetail-alternative-right").sortable("toArray");
+			saveItemOrder(action, "right");
+		});
+
+		let foldedElements = '<?php echo json_encode($this->get_option('wpsg_backendui_orderdetail_foldedpanels')); ?>' || [];
+		if(foldedElements === "false" || foldedElements.includes('"",')) foldedElements = [];
+		if(foldedElements && foldedElements.length > 0) foldedElements = foldedElements.replace("[", "").replace("]", "").replaceAll('"', "").split(",");
+
+		// Panels einklappen
+		jQuery(".panel-heading").click(function(){
+
+			let jQueryPanelBody = jsElTojQueryObj(this.parentElement.lastElementChild, "orderdetail-panel-body");
+			let item_payload = jQueryPanelBody.parents().eq(1)[0].id + "_" + jQueryPanelBody[0].classList[0];
+
+			if(jQueryPanelBody.is(":hidden"))
+			{
+
+				let targetIndex = 0;
+
+				for(var i = 0; i < foldedElements.length; i++) {
+					if(foldedElements[i].includes(item_payload))
+						targetIndex = i;
+				}
+
+				foldedElements.splice(targetIndex, 1);
+				jQueryPanelBody.slideToggle('fast');
+
+			}
+			else
+			{
+
+				foldedElements.push(item_payload);
+				jQueryPanelBody.slideToggle('fast');
+
+			}
+
+			saveFoldedItems(foldedElements);
+
+		});
+
+
+	} );
+
+	/* ]]> */</script>
Index: /views/produkt/addedit_alternativeDesign.phtml
===================================================================
--- /views/produkt/addedit_alternativeDesign.phtml	(revision 7094)
+++ /views/produkt/addedit_alternativeDesign.phtml	(revision 7094)
@@ -0,0 +1,362 @@
+<?php
+
+	/**
+	 * Alternativtemplate zur Ausgabe der Produktverwaltung
+	 */
+
+?>
+
+<script type="text/javascript">/* <![CDATA[ */
+
+	wpsg_product_edit_change = new Array();
+
+	jQuery(document).ready( function() {
+
+		//jQuery('.wpsg_form_help').tipTip();
+
+		jQuery("#normal-sortables, #side-sortables").sortable({
+			connectWith: ".meta-box-sortables",
+			placeholder: 'wpsg_placeholder',
+			dropOnEmpty: true,
+			cursor: 'move',
+			grid: [50, 20],
+			handle: '.wpsg_handlediv',
+			forceHelperSize: true,
+			forcePlaceholderSize: true,
+			opacity: 0.8,
+			stop: function(e,ui) {
+
+				var ser = jQuery("#normal-sortables").sortable("serialize");
+				ser = ser.replace(/\&wpsg\[\]\=/g, ',').replace(/wpsg\[\]\=/g, '');
+
+				jQuery.cookie('wpsg_product_view_normal', ser);
+
+				var ser = jQuery("#side-sortables").sortable("serialize");
+				ser = ser.replace(/\&wpsg\[\]\=/g, ',').replace(/wpsg\[\]\=/g, '');
+
+				jQuery.cookie('wpsg_product_view_side', ser);
+
+			},
+			receive: function(e, ui) {
+			}
+		});
+
+		if (jQuery.cookie('wpsg_product_view_normal') != null)
+		{
+
+			var divs = jQuery.cookie('wpsg_product_view_normal').split(',').reverse();
+
+			for (index in divs)
+			{
+
+				jQuery('#normal-sortables').prepend(jQuery('#wpsg_' + divs[index]));
+
+			}
+
+		}
+
+		if (jQuery.cookie('wpsg_product_view_side') != null)
+		{
+
+			var divs = jQuery.cookie('wpsg_product_view_side').split(',').reverse();
+
+			for (index in divs)
+			{
+
+				jQuery('#side-sortables').prepend(jQuery('#wpsg_' + divs[index]));
+
+			}
+
+		}
+
+		var click_x = false;
+		var click_y = false;
+
+		jQuery('.wpsg_handlediv').bind('click', function(ev) {
+
+			console.log(ev);
+
+			if (Math.abs(click_x - ev.pageX) <= 5 && Math.abs(click_y - ev.pageY) <= 5)
+			{
+
+				jQuery(this).next().toggle();
+
+				var arClose = new Array();
+				jQuery('.wpsg_product_view .postbox .inside:hidden').each(function() {
+					arClose.push(jQuery(this).parent().attr("id"));
+				} );
+
+				jQuery.cookie('wpsg_product_closed', arClose.join(','));
+
+			}
+
+		} );
+
+		jQuery('.wpsg_handlediv').bind('mousedown', function(ev) {
+
+			click_x = ev.pageX;
+			click_y = ev.pageY;
+
+		} );
+
+		if (jQuery.cookie('wpsg_product_closed') != null && jQuery.cookie('wpsg_product_closed') != '')
+		{
+
+			var arClose = jQuery.cookie('wpsg_product_closed').split(',');
+
+			for (index in arClose)
+			{
+
+				jQuery('#' + arClose[index] + ' .inside').hide();
+
+			}
+
+		}
+
+		jQuery('#submit, #submit_index').bind('click', function() {
+
+			if (wpsg_product_edit_change.length > 0)
+			{
+
+				jQuery('.wpsg_change_error').removeClass('wpsg_change_error');
+
+				for (var i = 0; i < wpsg_product_edit_change.length; i++) {
+
+					jQuery('#' + wpsg_product_edit_change[i]).addClass('wpsg_change_error');
+
+				}
+
+				alert('<?php echo __('Bitte ÃŒberprÃŒfen Sie die rot markierten Felder. Ãnderungen in diesen Feldern gehen beim Speichern verloren.', 'wpsg'); ?>');
+
+				return false;
+
+			}
+			else
+			{
+
+				return true;
+
+			}
+
+		} );
+
+		// Flaggen fÃŒr die aktuelle Sprache davorbauen
+		<?php if ($this->isMultiLingual() && isset($_REQUEST['wpsg_lang'])) { $arLang = $this->getStoreLanguages(); $lang = $arLang[$_REQUEST['wpsg_lang']]; ?>
+		jQuery('.wpsg_handlediv').prepend('<img src="<?php echo $this->getFlagURL().$lang['flag']; ?>" alt="<?php echo $lang['name']; ?>" />&nbsp;');
+		<?php } ?>
+
+		$(".addedit_templateV3 .general-panel-ordercondition .col-sm-6").removeClass("col-sm-6 col-sm-offset-6");
+
+		// Position der Section "EU-Leistungsortregeln" korrigieren
+		let leistungsortregelnCheckbox = $("input#euleistungsortregel");
+		let leistungsortregelenContainer = leistungsortregelnCheckbox.parents().eq(3);
+		let laenderverwaltungsLink = leistungsortregelnCheckbox.parents().eq(4).next();
+		let leistungsortregelnPanel = leistungsortregelenContainer.closest('.panel');
+
+		leistungsortregelenContainer.addClass("col-sm-12 col-sm-offset-12 v3Design_leistungsortregelCheckbox");
+
+		leistungsortregelenContainer.css({
+			"padding-left": "15px",
+			"margin-left": "0"
+		});
+
+		laenderverwaltungsLink.css({
+			"padding-left": "15px"
+		});
+
+		// Wenn form-control Element das letzte seiner Art im jeweiligen Elementeblock ist, Klasse hinzufÃŒgen
+		let counter = 0;
+		let formControlElements = $(".addedit_templateV3 .form-group");
+
+		$.each(formControlElements, function(key, val) {
+
+			let jQueryObj = jsElTojQueryObj(val, 'form-group');
+
+
+			if(!jQueryObj.next().hasClass("form-group")) {
+				jQueryObj.addClass("last-form-group");
+			}
+
+		});
+
+		// handlediv Klasse allen panel-heading hinzufÃŒgen
+		let panelHeadings = $(".panel-heading");
+
+		$.each(panelHeadings, function(key, val) {
+
+			let jQueryObj = jsElTojQueryObj(val, 'panel-heading');
+
+			val.classList.add("handlediv");
+			jQueryObj.wrap("<div class='wpsg_handlediv'></div>");
+
+		});
+
+		// Weist dem gegebenen JS Element eine einzigartige Klasse zu
+		// und gibt das jeweilige Element als jQuery Object zurÃŒck
+		function jsElTojQueryObj(jsEl, specificClass) {
+
+			let id = jsEl.id ? `#${jsEl.id}` : "";
+			let classes = "";
+
+			if(typeof jsEl !== "object" || jsEl.length <= 1 && jsEl[0] === "#document")
+				return;
+
+			jsEl.classList.add(`${specificClass}-${counter++}`);
+
+			if(jsEl.classList && jsEl.classList.length > 0) {
+
+				jsEl.classList.forEach(function(className) {
+					if(!classes.includes(`.${className}`)) classes += `.${className}`;
+				});
+
+			}
+
+			return $(`${jsEl.tagName.toLowerCase()}${id}${classes}`);
+
+		} // function jsElTojQueryObj(jsEl, specificClass)
+
+	} );
+
+	/* ]]> */</script>
+
+<div class="wrap columns-2 wpsg_produkt_addedit addedit_templateV3 wpsg_product_view" id="wpsg_product_view">
+
+	<div id="wpsg_relatedproducts_produktauswahl"></div>
+
+	<div class="icon32 icon32-posts-post" id="icon-edit"><br /></div>
+	<h2>
+		<?php if ($_REQUEST['edit_id'] > 0) { ?>
+			<?php echo __('Produkt bearbeiten', 'wpsg'); ?>
+			<?php if (isset($_REQUEST['wpsg_lang'])) { ?>
+				&nbsp;[<?php $arLang = $this->getStoreLanguages(); echo $arLang[$_REQUEST['wpsg_lang']]['name']; ?> <img src="<?php echo $this->getFlagURL().$arLang[$_REQUEST['wpsg_lang']]['flag']; ?>" alt="" />]
+			<?php } ?>
+		<?php } else { ?>
+			<?php echo __('Neues Produkt', 'wpsg'); ?>
+		<?php } ?>
+	</h2>
+	<br />
+
+	<?php echo $this->writeBackendMessage(); ?>
+
+	<form method="POST" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt&amp;action=save&amp;noheader=1" enctype="multipart/form-data">
+
+		<div id="postbox" class="metabox-holder has-right-sidebar">
+
+			<div id="side-info-column" class="inner-sidebar" style="width:386px;">
+				<div id="side-sortables" class="meta-box-sortables ui-sortable" style="width:380px;">
+
+					<?php if (!isset($_REQUEST['wpsg_lang'])) { ?>
+						<div id="wpsg_preis" class="">
+							<div class="inside panel-price">
+
+								<?php echo $this->view['arSubAction']['price']['content']; ?>
+
+							</div>
+						</div>
+						<div id="wpsg_paymentmethods" class="">
+							<div class="inside panel-payship">
+
+								<?php echo $this->view['arSubAction']['payship']['content']; ?>
+
+							</div>
+						</div>
+					<?php } ?>
+
+					<?php $this->callMods('produkt_edit_sidebar_contentt', array(&$this->view['data'])); ?>
+
+				</div>
+			</div>
+
+			<div id="post-body">
+
+				<div id="titlediv" style="margin-right:400px;">
+					<div id="titlewrap">
+						<input type="text" placeholder="<?php echo __('Produktname', 'wpsg'); ?>" id="title" value="<?php echo wpsg_hspc($this->view['data']['name']); ?>" tabindex="1" size="30" name="name">
+					</div>
+				</div>
+
+				<br />
+
+				<div id="normal-sortables" class="meta-box-sortables" style="margin-right:400px;">
+
+					<div id="wpsg_generally" class="">
+						<div class="inside panel-general">
+
+							<?php echo $this->view['arSubAction']['general']['content']; ?>
+
+						</div>
+					</div>
+
+					<div id="wpsg_description" class="postbox">
+						<h3 class="wpsg_handlediv texte-title">
+							<span title="<?php echo __('Zum Ein/Ausklappen hier klicken', 'wpsg'); ?>" class="handlediv"><br /></span>
+							<span><?php echo __('Beschreibung', 'wpsg'); ?></span>
+						</h3>
+						<div class="inside panel-texte">
+
+							<?php echo $this->view['arSubAction']['texte']['content']; ?>
+
+						</div>
+					</div>
+
+					<div id="wpsg_images" class="">
+						<div class="inside panel-images">
+
+							<?php echo $this->view['arSubAction']['images']['content']; ?>
+
+						</div>
+					</div>
+
+					<div id="wpsg_stock">
+						<div class="inside panel-stock">
+
+							<?php echo $this->view['arSubAction']['stock']['content']; ?>
+
+						</div>
+					</div>
+
+					<div id="wpsg_mods" class="mod-area">
+						<h1>Aktivierte Mods</h1>
+						<?php
+
+							foreach($this->view['arSubAction'] as $index => $subArr)
+							{
+								if(strpos($index, 'wpsg_mod') !== false)
+								{
+
+									$modtitle = $this->view['arSubAction'][$index]['title'];
+
+									echo "<div class='inside mod-$modtitle'>";
+									echo $this->view['arSubAction'][$index]['content'];
+									echo '</div>';
+
+								}
+							}
+
+						?>
+					</div>
+
+					<?php $this->callMods('produkt_edit_content', array(&$this->view['data'])); ?>
+
+				</div>
+
+				<?php if ($_REQUEST['edit_id'] > 0) { ?>
+					<input type="hidden" name="edit_id" value="<?php echo $_REQUEST['edit_id']; ?>" />
+				<?php } ?>
+
+				<?php if (isset($_REQUEST['wpsg_lang'])) { ?>
+					<input type="hidden" name="wpsg_lang" value="<?php echo $_REQUEST['wpsg_lang']; ?>" />
+				<?php } ?>
+
+				<p class="submit">
+					<input type="submit" value="<?php echo __('Produkt speichern', 'wpsg'); ?>" class="button-primary" id="submit" name="submit" />
+					<input type="submit" value="<?php echo __('Produkt speichern und zur Ãbersicht', 'wpsg'); ?>" class="button-primary" id="submit_index" name="submit_index" />
+				</p>
+
+			</div>
+
+		</div>
+
+	</form>
+
+</div>
Index: ews/produkt/addedit_templateV3.phtml
===================================================================
--- /views/produkt/addedit_templateV3.phtml	(revision 7093)
+++ 	(revision )
@@ -1,362 +1,0 @@
-<?php
-
-	/**
-	 * Alternativtemplate zur Ausgabe der Produktverwaltung
-	 */
-
-?>
-
-<script type="text/javascript">/* <![CDATA[ */
-
-	wpsg_product_edit_change = new Array();
-
-	jQuery(document).ready( function() {
-
-		//jQuery('.wpsg_form_help').tipTip();
-
-		jQuery("#normal-sortables, #side-sortables").sortable({
-			connectWith: ".meta-box-sortables",
-			placeholder: 'wpsg_placeholder',
-			dropOnEmpty: true,
-			cursor: 'move',
-			grid: [50, 20],
-			handle: '.wpsg_handlediv',
-			forceHelperSize: true,
-			forcePlaceholderSize: true,
-			opacity: 0.8,
-			stop: function(e,ui) {
-
-				var ser = jQuery("#normal-sortables").sortable("serialize");
-				ser = ser.replace(/\&wpsg\[\]\=/g, ',').replace(/wpsg\[\]\=/g, '');
-
-				jQuery.cookie('wpsg_product_view_normal', ser);
-
-				var ser = jQuery("#side-sortables").sortable("serialize");
-				ser = ser.replace(/\&wpsg\[\]\=/g, ',').replace(/wpsg\[\]\=/g, '');
-
-				jQuery.cookie('wpsg_product_view_side', ser);
-
-			},
-			receive: function(e, ui) {
-			}
-		});
-
-		if (jQuery.cookie('wpsg_product_view_normal') != null)
-		{
-
-			var divs = jQuery.cookie('wpsg_product_view_normal').split(',').reverse();
-
-			for (index in divs)
-			{
-
-				jQuery('#normal-sortables').prepend(jQuery('#wpsg_' + divs[index]));
-
-			}
-
-		}
-
-		if (jQuery.cookie('wpsg_product_view_side') != null)
-		{
-
-			var divs = jQuery.cookie('wpsg_product_view_side').split(',').reverse();
-
-			for (index in divs)
-			{
-
-				jQuery('#side-sortables').prepend(jQuery('#wpsg_' + divs[index]));
-
-			}
-
-		}
-
-		var click_x = false;
-		var click_y = false;
-
-		jQuery('.wpsg_handlediv').bind('click', function(ev) {
-
-			console.log(ev);
-
-			if (Math.abs(click_x - ev.pageX) <= 5 && Math.abs(click_y - ev.pageY) <= 5)
-			{
-
-				jQuery(this).next().toggle();
-
-				var arClose = new Array();
-				jQuery('.wpsg_product_view .postbox .inside:hidden').each(function() {
-					arClose.push(jQuery(this).parent().attr("id"));
-				} );
-
-				jQuery.cookie('wpsg_product_closed', arClose.join(','));
-
-			}
-
-		} );
-
-		jQuery('.wpsg_handlediv').bind('mousedown', function(ev) {
-
-			click_x = ev.pageX;
-			click_y = ev.pageY;
-
-		} );
-
-		if (jQuery.cookie('wpsg_product_closed') != null && jQuery.cookie('wpsg_product_closed') != '')
-		{
-
-			var arClose = jQuery.cookie('wpsg_product_closed').split(',');
-
-			for (index in arClose)
-			{
-
-				jQuery('#' + arClose[index] + ' .inside').hide();
-
-			}
-
-		}
-
-		jQuery('#submit, #submit_index').bind('click', function() {
-
-			if (wpsg_product_edit_change.length > 0)
-			{
-
-				jQuery('.wpsg_change_error').removeClass('wpsg_change_error');
-
-				for (var i = 0; i < wpsg_product_edit_change.length; i++) {
-
-					jQuery('#' + wpsg_product_edit_change[i]).addClass('wpsg_change_error');
-
-				}
-
-				alert('<?php echo __('Bitte ÃŒberprÃŒfen Sie die rot markierten Felder. Ãnderungen in diesen Feldern gehen beim Speichern verloren.', 'wpsg'); ?>');
-
-				return false;
-
-			}
-			else
-			{
-
-				return true;
-
-			}
-
-		} );
-
-		// Flaggen fÃŒr die aktuelle Sprache davorbauen
-		<?php if ($this->isMultiLingual() && isset($_REQUEST['wpsg_lang'])) { $arLang = $this->getStoreLanguages(); $lang = $arLang[$_REQUEST['wpsg_lang']]; ?>
-		jQuery('.wpsg_handlediv').prepend('<img src="<?php echo $this->getFlagURL().$lang['flag']; ?>" alt="<?php echo $lang['name']; ?>" />&nbsp;');
-		<?php } ?>
-
-		$(".addedit_templateV3 .general-panel-ordercondition .col-sm-6").removeClass("col-sm-6 col-sm-offset-6");
-
-		// Position der Section "EU-Leistungsortregeln" korrigieren
-		let leistungsortregelnCheckbox = $("input#euleistungsortregel");
-		let leistungsortregelenContainer = leistungsortregelnCheckbox.parents().eq(3);
-		let laenderverwaltungsLink = leistungsortregelnCheckbox.parents().eq(4).next();
-		let leistungsortregelnPanel = leistungsortregelenContainer.closest('.panel');
-
-		leistungsortregelenContainer.addClass("col-sm-12 col-sm-offset-12 v3Design_leistungsortregelCheckbox");
-
-		leistungsortregelenContainer.css({
-			"padding-left": "15px",
-			"margin-left": "0"
-		});
-
-		laenderverwaltungsLink.css({
-			"padding-left": "15px"
-		});
-
-		// Wenn form-control Element das letzte seiner Art im jeweiligen Elementeblock ist, Klasse hinzufÃŒgen
-		let counter = 0;
-		let formControlElements = $(".addedit_templateV3 .form-group");
-
-		$.each(formControlElements, function(key, val) {
-
-			let jQueryObj = jsElTojQueryObj(val, 'form-group');
-
-
-			if(!jQueryObj.next().hasClass("form-group")) {
-				jQueryObj.addClass("last-form-group");
-			}
-
-		});
-
-		// handlediv Klasse allen panel-heading hinzufÃŒgen
-		let panelHeadings = $(".panel-heading");
-
-		$.each(panelHeadings, function(key, val) {
-
-			let jQueryObj = jsElTojQueryObj(val, 'panel-heading');
-
-			val.classList.add("handlediv");
-			jQueryObj.wrap("<div class='wpsg_handlediv'></div>");
-
-		});
-
-		// Weist dem gegebenen JS Element eine einzigartige Klasse zu
-		// und gibt das jeweilige Element als jQuery Object zurÃŒck
-		function jsElTojQueryObj(jsEl, specificClass) {
-
-			let id = jsEl.id ? `#${jsEl.id}` : "";
-			let classes = "";
-
-			if(typeof jsEl !== "object" || jsEl.length <= 1 && jsEl[0] === "#document")
-				return;
-
-			jsEl.classList.add(`${specificClass}-${counter++}`);
-
-			if(jsEl.classList && jsEl.classList.length > 0) {
-
-				jsEl.classList.forEach(function(className) {
-					if(!classes.includes(`.${className}`)) classes += `.${className}`;
-				});
-
-			}
-
-			return $(`${jsEl.tagName.toLowerCase()}${id}${classes}`);
-
-		} // function jsElTojQueryObj(jsEl, specificClass)
-
-	} );
-
-	/* ]]> */</script>
-
-<div class="wrap columns-2 wpsg_produkt_addedit addedit_templateV3 wpsg_product_view" id="wpsg_product_view">
-
-	<div id="wpsg_relatedproducts_produktauswahl"></div>
-
-	<div class="icon32 icon32-posts-post" id="icon-edit"><br /></div>
-	<h2>
-		<?php if ($_REQUEST['edit_id'] > 0) { ?>
-			<?php echo __('Produkt bearbeiten', 'wpsg'); ?>
-			<?php if (isset($_REQUEST['wpsg_lang'])) { ?>
-				&nbsp;[<?php $arLang = $this->getStoreLanguages(); echo $arLang[$_REQUEST['wpsg_lang']]['name']; ?> <img src="<?php echo $this->getFlagURL().$arLang[$_REQUEST['wpsg_lang']]['flag']; ?>" alt="" />]
-			<?php } ?>
-		<?php } else { ?>
-			<?php echo __('Neues Produkt', 'wpsg'); ?>
-		<?php } ?>
-	</h2>
-	<br />
-
-	<?php echo $this->writeBackendMessage(); ?>
-
-	<form method="POST" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt&amp;action=save&amp;noheader=1" enctype="multipart/form-data">
-
-		<div id="postbox" class="metabox-holder has-right-sidebar">
-
-			<div id="side-info-column" class="inner-sidebar" style="width:386px;">
-				<div id="side-sortables" class="meta-box-sortables ui-sortable" style="width:380px;">
-
-					<?php if (!isset($_REQUEST['wpsg_lang'])) { ?>
-						<div id="wpsg_preis" class="">
-							<div class="inside panel-price">
-
-								<?php echo $this->view['arSubAction']['price']['content']; ?>
-
-							</div>
-						</div>
-						<div id="wpsg_paymentmethods" class="">
-							<div class="inside panel-payship">
-
-								<?php echo $this->view['arSubAction']['payship']['content']; ?>
-
-							</div>
-						</div>
-					<?php } ?>
-
-					<?php $this->callMods('produkt_edit_sidebar_contentt', array(&$this->view['data'])); ?>
-
-				</div>
-			</div>
-
-			<div id="post-body">
-
-				<div id="titlediv" style="margin-right:400px;">
-					<div id="titlewrap">
-						<input type="text" placeholder="<?php echo __('Produktname', 'wpsg'); ?>" id="title" value="<?php echo wpsg_hspc($this->view['data']['name']); ?>" tabindex="1" size="30" name="name">
-					</div>
-				</div>
-
-				<br />
-
-				<div id="normal-sortables" class="meta-box-sortables" style="margin-right:400px;">
-
-					<div id="wpsg_generally" class="">
-						<div class="inside panel-general">
-
-							<?php echo $this->view['arSubAction']['general']['content']; ?>
-
-						</div>
-					</div>
-
-					<div id="wpsg_description" class="postbox">
-						<h3 class="wpsg_handlediv texte-title">
-							<span title="<?php echo __('Zum Ein/Ausklappen hier klicken', 'wpsg'); ?>" class="handlediv"><br /></span>
-							<span><?php echo __('Beschreibung', 'wpsg'); ?></span>
-						</h3>
-						<div class="inside panel-texte">
-
-							<?php echo $this->view['arSubAction']['texte']['content']; ?>
-
-						</div>
-					</div>
-
-					<div id="wpsg_images" class="">
-						<div class="inside panel-images">
-
-							<?php echo $this->view['arSubAction']['images']['content']; ?>
-
-						</div>
-					</div>
-
-					<div id="wpsg_stock">
-						<div class="inside panel-stock">
-
-							<?php echo $this->view['arSubAction']['stock']['content']; ?>
-
-						</div>
-					</div>
-
-					<div id="wpsg_mods" class="mod-area">
-						<h1>Aktivierte Mods</h1>
-						<?php
-
-							foreach($this->view['arSubAction'] as $index => $subArr)
-							{
-								if(strpos($index, 'wpsg_mod') !== false)
-								{
-
-									$modtitle = $this->view['arSubAction'][$index]['title'];
-
-									echo "<div class='inside mod-$modtitle'>";
-									echo $this->view['arSubAction'][$index]['content'];
-									echo '</div>';
-
-								}
-							}
-
-						?>
-					</div>
-
-					<?php $this->callMods('produkt_edit_content', array(&$this->view['data'])); ?>
-
-				</div>
-
-				<?php if ($_REQUEST['edit_id'] > 0) { ?>
-					<input type="hidden" name="edit_id" value="<?php echo $_REQUEST['edit_id']; ?>" />
-				<?php } ?>
-
-				<?php if (isset($_REQUEST['wpsg_lang'])) { ?>
-					<input type="hidden" name="wpsg_lang" value="<?php echo $_REQUEST['wpsg_lang']; ?>" />
-				<?php } ?>
-
-				<p class="submit">
-					<input type="submit" value="<?php echo __('Produkt speichern', 'wpsg'); ?>" class="button-primary" id="submit" name="submit" />
-					<input type="submit" value="<?php echo __('Produkt speichern und zur Ãbersicht', 'wpsg'); ?>" class="button-primary" id="submit_index" name="submit_index" />
-				</p>
-
-			</div>
-
-		</div>
-
-	</form>
-
-</div>
