Index: /mods/wpsg_mod_basic.class.php
===================================================================
--- /mods/wpsg_mod_basic.class.php	(revision 6955)
+++ /mods/wpsg_mod_basic.class.php	(revision 6958)
@@ -95,5 +95,6 @@
 			5100    => 'wpsg_mod_productview', // Produktansicht 
 			5200    => 'wpsg_mod_recaptcha', 
-			5300	=> 'wpsg_mod_converter' // Konverter von wpsg3 auf wpsg4
+			5300	=> 'wpsg_mod_converter', // Konverter von wpsg3 auf wpsg4
+			5400 	=> 'wpsg_mod_surfaceproduct' // Druckerei		
 		);
 		
Index: /mods/wpsg_mod_surfaceproduct.class.php
===================================================================
--- /mods/wpsg_mod_surfaceproduct.class.php	(revision 6958)
+++ /mods/wpsg_mod_surfaceproduct.class.php	(revision 6958)
@@ -0,0 +1,201 @@
+<?php
+
+	/**
+	 * Modul fÃŒr das Modul FlÃ€chenprodukt
+	 */
+	
+	class wpsg_mod_surfaceproduct extends wpsg_mod_basic
+	{
+	
+		var $lizenz = 1;
+		var $id = 5400;
+		//var $version = "9.9.9";
+		var $hilfeURL = 'http://wpshopgermany.de/?p=5729960';
+		
+		const MODE_RUNNING = 1;
+		const MODE_HEIGHTWIDE = 2;
+	
+		
+		/**
+		 * Constructor
+		 */
+		public function __construct()
+		{
+				
+			global $wpdb;
+				
+			parent::__construct();
+		
+			$this->name = __('Druckerei', 'wpsg');
+			$this->group = __('Produkte', 'wpsg');
+			$this->desc = __('ErmÃ¶glicht die Integration von flÃ€chenberechneten Produkten.', 'wpsg');
+				
+		} // public function __construct()
+		
+		public function install()
+		{
+		
+			require_once(WPSG_PATH_WP.'/wp-admin/includes/upgrade.php');
+		
+			/**
+			 * Produkttabelle erweitern
+			 */
+			$sql = "CREATE TABLE ".WPSG_TBL_PRODUCTS." (			  	
+				wpsg_mod_surfaceproduct_productactiv int(1) NOT NULL,
+				wpsg_mod_surfaceproduct_mode VARCHAR(255) NOT NULL,
+				wpsg_mod_surfaceproduct_mode_running VARCHAR(255) NOT NULL							
+			) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;";
+				
+			dbDelta($sql);
+			
+			/**
+			 * Bestelltabelle (order_products) erweitern
+			 */
+			$sql = "CREATE TABLE ".WPSG_TBL_ORDER_PRODUCTS." (
+				wpsg_mod_surfaceproduct_running_order VARCHAR (255) NOT NULL,
+				wpsg_mod_surfaceproduct_mode_length VARCHAR(255) NOT NULL,
+				wpsg_mod_surfaceproduct_mode_both VARCHAR(255) NOT NULL
+			) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;";
+			
+			dbDelta($sql);
+			
+			/**
+			 * Tabelle fÃŒr die FlÃ€chenProdukte
+			 */
+			$sql = "CREATE TABLE ".WPSG_TBL_SURFACEPRODUCT." (
+				id int(11) NOT NULL AUTO_INCREMENT,
+				PRIMARY KEY  (id),
+				wpsg_mod_surfaceproduct_activ int(1) DEFAULT 0 NOT NULL,
+				wpsg_mod_surfaceproduct_einheit VARCHAR(255) NOT NULL,
+				wpsg_mod_surfaceproduct_faktor VARCHAR(255) NOT NULL
+			) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;";
+				
+			dbDelta($sql);
+			
+		} // public function install()
+		
+		public function product_addedit_content(&$product_content, &$product_data)
+		{
+		
+			$product_content['wpsg_mod_surfaceproduct'] = array(
+					'title' => __('Druckerei', 'wpsg'),
+					'content' => $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_surfaceproduct/produkt_edit_sidebar.phtml', false)
+			);
+		}
+		
+		public function settings_edit()
+		{
+		
+			$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_surfaceproduct/settings_edit.phtml');
+		
+		}
+		
+		public function settings_save()
+		{
+
+			$this->shop->update_option('wpsg_mod_surfaceproduct_einheit', $_REQUEST['wpsg_mod_surfaceproduct_einheit']);
+			$this->shop->update_option('wpsg_mod_surfaceproduct_faktor', $_REQUEST['wpsg_mod_surfaceproduct_faktor']);
+
+		} // public function settings_save()
+		
+		public function produkt_save_before(&$produkt_data)
+		{
+			//wpsg_debug($_REQUEST);
+			
+			$produkt_data['wpsg_mod_surfaceproduct_productactiv'] = wpsg_q($_REQUEST['wpsg_mod_surfaceproduct']['wpsg_mod_surfaceproduct_productactiv']);
+			$produkt_data['wpsg_mod_surfaceproduct_mode'] = wpsg_q($_REQUEST['wpsg_mod_surfaceproduct']['wpsg_mod_surfaceproduct_mode']);
+			$produkt_data['wpsg_mod_surfaceproduct_mode_running'] = wpsg_q($_REQUEST['wpsg_mod_surfaceproduct']['wpsg_mod_surfaceproduct_mode_running']);
+			
+			//wpsg_debug($produkt_data);
+			//die;
+			
+		} // public function settings_save()
+		
+		public function order_save(&$order_data)
+		{		  
+		 
+		  $order_data['wpsg_mod_surfaceproduct_running_order'] = wpsg_q($REQUEST['wpsg_mod_surfaceproduct']['wpsg_mod_surfaceproduct_running_order']);
+		  $order_data['wpsg_mod_surfaceproduct_mode_length'] = wpsg_q($REQUEST['wpsg_mod_surfaceproduct']['wpsg_mod_surfaceproduct_mode_length']);
+		  $order_data['wpsg_mod_surfaceproduct_mode_both'] = wpsg_q($REQUEST['wpsg_mod_surfaceproduct']['wpsg_mod_surfaceproduct_mode_both']);
+		 
+		 }
+		 
+		 
+		public function renderTemplate()
+		{
+			
+			return $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_surfaceproduct/product.phtml');
+			
+		}
+		
+		public function mail_row($index, $produkt)
+		{
+		
+			if ($this->shop->htmlMail === true) $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_surfaceproduct/mail_row_html.phtml');
+			else $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_surfaceproduct/mail_row.phtml');
+			
+		}
+		
+		public function basket_row(&$p, $i)
+		{
+			
+			$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_surfaceproduct/basket_row.phtml');
+			
+		}
+		
+		public function overview_row(&$p, $i)
+		{
+			
+			$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_surfaceproduct/order_row.phtml');
+			
+		}
+		
+		public function wpsg_mod_export_loadFields(&$arFields)
+		{
+			
+			$arFields[10]['fields']['mod_surfaceproduct_mode_running'] = __('Laufmeter', 'wpsg');
+			$arFields[10]['fields']['mod_surfaceproduct_running_order'] = __('', 'wpsg');
+			$arFields[10]['fields']['mod_surfaceproduct_mode_length'] = __('LÃ€nge', 'wpsg');
+			$arFields[10]['fields']['mod_surfaceproduct_mode_both'] = __('Breite', 'wpsg');			
+			
+		}
+		
+		/*
+		public function wpsg_mod_export_getValue(&$return, $field_value, $o_id, $p_id ) 
+		{
+			
+			$arOrder = $this->shop->cache->loadOrder($o_id);
+			$value = "";
+			
+			if ($field_value == 'mod_surfaceproduct_mode_running')
+			{
+				$value = $arOrder['mod_surfaceproduct_mode_running'];
+			}
+			if ($field_value == 'mod_surfaceproduct_running_order')
+			{
+				$value = $arOrder['mod_surfaceproduct_running_order'];
+			}
+			if ($field_value == 'mod_surfaceproduct_mode_length')
+			{
+				$value = $arOrder['mod_surfaceproduct_mode_length'];
+			}
+			if ($field_value == 'mod_surfaceproduct_mode_both')
+			{
+				$value = $arOrder['mod_surfaceproduct_mode_both'];
+			}
+			
+			if ($value == "")
+			{
+				$return = $value;
+			}
+			else
+			{
+				
+				$key = $this->shop->get_option("wpsg_mod_surfaceproduct");
+				$return = $value; 
+				
+			}
+		}	
+		*/
+	}
+?>
Index: /views/mods/mod_surfaceproduct/basket_row.phtml
===================================================================
--- /views/mods/mod_surfaceproduct/basket_row.phtml	(revision 6958)
+++ /views/mods/mod_surfaceproduct/basket_row.phtml	(revision 6958)
@@ -0,0 +1,27 @@
+<?php
+
+	/**
+	 * Template fÃŒr die Anzeige der FlÃ€chenProdukte im Warenkorb
+	 */
+
+?>
+<div class="product_info">
+
+	<div>
+		<span class="fa fa-cut"></span>
+		<?php echo __('Bemessungen', 'wpsg');?>:
+		<strong><?php if (($this->hasMod('wpsg_mod_surfaceproduct_mode')) == '1') {?>
+		
+			<?php echo $this->view['wpsg_mod_surface']['surfaceproduct_length']; ?><?php echo $this->view['wpsg_mod_surface']['wpsg_mod_surfaceproduct_einheit']; ?> x
+			<?php echo $this->view['wpsg_mod_surface']['surfaceproduct_both']; ?><?php echo $this->view['wpsg_mod_surface']['wpsg_mod_surfaceproduct_einheit']; ?>	
+		
+		<?php } else {?>
+		
+			<?php echo $this->view['wpsg_mod_surface']['surfaceproduct_running_length']; ?><?php echo $this->view['wpsg_mod_surface']['wpsg_mod_surfaceproduct_einheit']; ?> x
+			<?php echo $this->view['wpsg_mod_surface']['surfaceproduct_running_both']; ?><?php echo $this->view['wpsg_mod_surface']['wpsg_mod_surfaceproduct_einheit']; ?>
+		
+		<?php } ?></strong>	
+		
+	</div>
+
+</div>
Index: /views/mods/mod_surfaceproduct/mail_row.html.phtml
===================================================================
--- /views/mods/mod_surfaceproduct/mail_row.html.phtml	(revision 6958)
+++ /views/mods/mod_surfaceproduct/mail_row.html.phtml	(revision 6958)
@@ -0,0 +1,20 @@
+<?php
+
+    /**
+    * Template fÃŒr die Intergration der FlÃ€chenProdukt-Daten in die HTML Kunden- und Adminmail
+    */
+
+?>
+<tr class="productrow productrow2 <?php echo ((($i % 2) == 0)?'productrow_odd':'productrow_even'); ?>">
+    <td style="padding:4px; line-height:100%; vertical-align:middle;" class="col_pos">&nbsp;</td>
+    <td style="padding:4px; line-height:100%; vertical-align:middle;" class="col_name"><?php echo __('Bemessungen', 'wpsg'); ?></td> 
+	<td style="padding:4px; line-height:100%; vertical-align:middle;" class="col_name">
+		<?php if (($this->hasMod('wpsg_mod_surfaceproduct_mode')) == '1') {?>
+			<?php echo $this->view['wpsg_mod_surface']['surfaceproduct_length']; ?><?php echo $this->view['wpsg_mod_surface']['wpsg_mod_surfaceproduct_einheit']; ?> x
+			<?php echo $this->view['wpsg_mod_surface']['surfaceproduct_both']; ?><?php echo $this->view['wpsg_mod_surface']['wpsg_mod_surfaceproduct_einheit']; ?>			
+		<?php } else {?>
+			<?php echo $this->view['wpsg_mod_surface']['surfaceproduct_running_length']; ?><?php echo $this->view['wpsg_mod_surface']['wpsg_mod_surfaceproduct_einheit']; ?> x
+			<?php echo $this->view['wpsg_mod_surface']['surfaceproduct_running_both']; ?><?php echo $this->view['wpsg_mod_surface']['wpsg_mod_surfaceproduct_einheit']; ?>
+		<?php } ?>
+	</td>
+</tr>
Index: /views/mods/mod_surfaceproduct/mail_row.phtml
===================================================================
--- /views/mods/mod_surfaceproduct/mail_row.phtml	(revision 6958)
+++ /views/mods/mod_surfaceproduct/mail_row.phtml	(revision 6958)
@@ -0,0 +1,21 @@
+<?php
+
+   /**
+    * Template fÃŒr die Intergration der FlÃ€chenProdukt-Daten 
+    *
+ 	*/
+
+?>
+<?php if (($this->hasMod('wpsg_mod_surfaceproduct_mode')) == '1') {?>
+
+<?php echo wpsg_pad_left(__('Bemessungen', 'wpsg').' ', 15); ?>: <?php echo $this->view['wpsg_mod_surface']['']; ?><?php echo $this->view['wpsg_mod_surface']['wpsg_mod_surfaceproduct_einheit']; ?>
+	
+	<?php echo $this->view['wpsg_mod_surface']['surfaceproduct_length']; ?><?php echo $this->view['wpsg_mod_surface']['wpsg_mod_surfaceproduct_einheit']; ?> x
+	<?php echo $this->view['wpsg_mod_surface']['surfaceproduct_both']; ?><?php echo $this->view['wpsg_mod_surface']['wpsg_mod_surfaceproduct_einheit']; ?>
+
+<?php } else {?>
+
+<?php echo wpsg_pad_left(__('Bemessungen', 'wpsg').' ', 15); ?>: 
+	<?php echo $this->view['wpsg_mod_surface']['surfaceproduct_running_length']; ?><?php echo $this->view['wpsg_mod_surface']['wpsg_mod_surfaceproduct_einheit']; ?> x
+	<?php echo $this->view['wpsg_mod_surface']['surfaceproduct_running_both']; ?><?php echo $this->view['wpsg_mod_surface']['wpsg_mod_surfaceproduct_einheit']; ?>
+<?php } ?>
Index: /views/mods/mod_surfaceproduct/overview_row.phtml
===================================================================
--- /views/mods/mod_surfaceproduct/overview_row.phtml	(revision 6958)
+++ /views/mods/mod_surfaceproduct/overview_row.phtml	(revision 6958)
@@ -0,0 +1,27 @@
+<?php
+
+	/**
+	 * Template fÃŒr die Anzeige der FlÃ€chenProdukte im Overview
+	 */
+
+?>
+<div class="product_info">
+
+	<div>
+		<span class="fa fa-cut"></span>
+		<?php echo __('Bemessungen', 'wpsg');?>:
+		<strong><?php if (($this->hasMod('wpsg_mod_surfaceproduct_mode')) == '1') {?>
+		
+			<?php echo $this->view['wpsg_mod_surface']['surfaceproduct_length']; ?><?php echo $this->view['wpsg_mod_surface']['wpsg_mod_surfaceproduct_einheit']; ?> x
+			<?php echo $this->view['wpsg_mod_surface']['surfaceproduct_both']; ?><?php echo $this->view['wpsg_mod_surface']['wpsg_mod_surfaceproduct_einheit']; ?>	
+		
+		<?php } else {?>
+		
+			<?php echo $this->view['wpsg_mod_surface']['surfaceproduct_running_length']; ?><?php echo $this->view['wpsg_mod_surface']['wpsg_mod_surfaceproduct_einheit']; ?> x
+			<?php echo $this->view['wpsg_mod_surface']['surfaceproduct_running_both']; ?><?php echo $this->view['wpsg_mod_surface']['wpsg_mod_surfaceproduct_einheit']; ?>
+		
+		<?php } ?></strong>	
+		
+	</div>
+
+</div>
Index: /views/mods/mod_surfaceproduct/product.phtml
===================================================================
--- /views/mods/mod_surfaceproduct/product.phtml	(revision 6958)
+++ /views/mods/mod_surfaceproduct/product.phtml	(revision 6958)
@@ -0,0 +1,42 @@
+<?php
+
+	/**
+	 * Template fÃŒr die FlÃ€chenprodukte wird vom Produkttemplate z.B. standard.phtml geladen
+	 */
+  
+?>	
+<?php /* FlÃ€chenprodukt Anzeige START */ ?>
+<?php if ($this->hasMod('wpsg_mod_surfaceproduct') && $this->get_option('wpsg_mod_surfaceproduct_productactiv') == '1') { ?>
+
+	<?php if (($this->hasMod('wpsg_mod_surfaceproduct_mode')) == '1') {?>
+
+		<?php /* FlÃ€chenprodukt (HÃ¶he x Breite) */ ?>
+		<span class="label label_surfaceproduct">
+			<label class="surfaceproduct_length"><?php echo wpsg_translate (__('Bitte die LÃ€nge eintragen [in #1#]:', 'wpsg')); ?></label>	
+			<input />	
+			<label class="surfaceproduct_both"><?php echo wpsg_translate (__('Bitte die Breite eintragen [in #1#]:', 'wpsg')); ?></label>
+			<input />
+		</span>
+		
+		<?php /* Lagerbestand beachten --> St. zu Quadratmeter */ ?>
+	
+	<?php } else {?>
+		
+		<?php /* FlÃ€chenprodukt (Laufmeter)*/ ?>
+		<span class="label label_surfaceproduct">
+			<label class="surfaceproduct_running_both"><?php echo wpsg_translate (__('Die Breite liegt bei #1# #2#', 'wpsg')); ?>
+			<?php echo $this->view['data']['wpsg_mod_surfaceproduct_einheit']; ?></label>
+			<label class="surfaceproduct_running_length"><?php echo wpsg_translate(__('Bitte die Laufmeter eintragen [in #1#]:', 'wpsg')); ?>
+			<input />
+		</span>
+		
+		<br />
+		
+		<?php echo wpsg_translate (__('LaufmeterlÃ€nge bitte eintragen [in #1#]:', 'wpsg')); ?>			
+	
+		
+		<?php /* Lagerbestand beachten --> St. zu Laufmeter */ ?>
+		
+	<?php } ?>
+		
+<?php } ?>
Index: /views/mods/mod_surfaceproduct/produkt_edit_sidebar.phtml
===================================================================
--- /views/mods/mod_surfaceproduct/produkt_edit_sidebar.phtml	(revision 6958)
+++ /views/mods/mod_surfaceproduct/produkt_edit_sidebar.phtml	(revision 6958)
@@ -0,0 +1,58 @@
+<php
+
+	/**
+	 * Integriert die FlÃ€chenProdukt-Einstellungen in das Produkt
+	 * Es werden folgende Module in Kombination empfohlen: Staffelpreise (Staffelung von FlÃ€cheneinheiten), Produktvarianten (Spezifizierunge mit GrÃ¶Ãen, Farben, DruckmÃ¶glichkeiten, ...), Bestellupload (Bilderupload pro Produkt)
+	 */
+	
+?>
+<?php echo wpsg_drawForm_AdminboxStart(__('Berechnungsgrundlage fÃŒr das FlÃ€chenProdukt', 'wpsg')); ?>
+	
+	<?php /* Druckereiprodukt? --> Preisberechnungssonderfall (hinzufÃŒgen von Optionen in Varianten */ ?>
+	<?php echo wpsg_drawForm_Checkbox('wpsg_mod_surfaceproduct[wpsg_mod_surfaceproduct_productactiv]', __('Produkt ist ein Druckereiprodukt', 'wpsg'), wpsg_getStr($this->view['data']['wpsg_mod_surfaceproduct_productactiv'], '0'), array('help' => 'wpsg_mod_surfaceproductactiv')); ?>
+		
+	<div class="wpsg_mod_surfaceproduct_product wpsg_mod_surfaceproduct_product_1">	
+	
+		<br />
+		
+		<?php echo wpsg_drawForm_Select('wpsg_mod_surfaceproduct[wpsg_mod_surfaceproduct_mode]', __('Eingabetyp', 'wpsg'), array(
+			wpsg_mod_surfaceproduct::MODE_HEIGHTWIDE => __('HÃ¶he x Breite', 'wpsg'),
+			wpsg_mod_surfaceproduct::MODE_RUNNING => __('Laufmeter', 'wpsg')		
+		), $this->view['data']['wpsg_mod_surfaceproduct_mode'], array('help' => 'wpsg_mod_surfaceproduct_mode')); ?>
+		<div id="wpsg_mod_surfaceproduct_mode_<?php echo wpsg_mod_surfaceproduct::MODE_RUNNING; ?>" class="wpsg_mod_surfaceproduct_mode">
+			<?php echo wpsg_drawForm_Input('wpsg_mod_surfaceproduct[wpsg_mod_surfaceproduct_mode_running]', __('vordefinierte Breite:', 'wpsg'), $this->view['data']['wpsg_mod_surfaceproduct_mode_running'], array('help' => 'wpsg_mod_surfaceproduct_mode_running')); ?>
+		</div>
+		<?php echo wpsg_drawForm_Text(__('Einheit:', 'wpsg'), $this->view['data']['wpsg_mod_surfaceproduct_einheit'], array('help' => 'wpsg_mod_surfaceproduct_einheit')); ?>
+		<div id="wpsg_mod_surfaceproduct_mode_<?php echo wpsg_mod_surfaceproduct::MODE_HEIGHTWIDE; ?>" class="wpsg_mod_surfaceproduct_mode"></div>
+			
+	</div>
+	
+	<br />
+	
+	<a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_surfaceproduct"><span class="wpsg-glyphicon glyphicon glyphicon-wrench"></span><?php echo __('Zur Konfiguration des Druckereimoduls', 'wpsg'); ?></a>
+	
+	
+<?php echo wpsg_drawForm_AdminboxEnd(); ?>	
+
+<script type="text/javascript">/* <![CDATA[ */
+
+	jQuery(document).ready(function() {
+	
+		 jQuery('#wpsg_mod_surfaceproduct_productactiv').bind('change', function() {
+
+	            jQuery('.wpsg_mod_surfaceproduct_product').hide();
+	            if (jQuery(this).prop('checked')) jQuery('.wpsg_mod_surfaceproduct_product_1').show();
+
+	    } ).change();
+		
+
+		 jQuery('#wpsg_mod_surfaceproduct_mode').on('change', function() { 
+
+			 jQuery('.wpsg_mod_surfaceproduct_mode').hide();
+			 jQuery ('#wpsg_mod_surfaceproduct_mode_'+jQuery(this).val()).show();
+		 							
+		} );	
+				
+	} );
+	
+/* ]]> */</script>
Index: /views/mods/mod_surfaceproduct/settings_edit.phtml
===================================================================
--- /views/mods/mod_surfaceproduct/settings_edit.phtml	(revision 6958)
+++ /views/mods/mod_surfaceproduct/settings_edit.phtml	(revision 6958)
@@ -0,0 +1,13 @@
+<?php
+
+	/**
+	 * Template fÃŒr die Einstellungen des Moduls "FlÃ€chenProdukt"
+	 */
+
+?>
+<?php /* Einheiten: mÂ², cmÂ², ... */ ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_surfaceproduct_einheit', __('FlÃ€cheneinheit', 'wpsg'), $this->get_option('wpsg_mod_surfaceproduct_einheit'), array('help' => 'wpsg_mod_surfaceproduct_einheit')); ?>
+<?php /* Auswahl von Vorgabe */ ?>
+
+<?php /* Faktor Frontend-Backend */ ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_surfaceproduct_faktor', __('Umrechnungsfaktor', 'wpsg'), $this->get_option('wpsg_mod_surfaceproduct_faktor'), array('help' => 'wpsg_mod_surfaceproduct_faktor')); ?>
