Index: /lib/wpsg_basket.class.php
===================================================================
--- /lib/wpsg_basket.class.php	(revision 6828)
+++ /lib/wpsg_basket.class.php	(revision 6830)
@@ -130,5 +130,5 @@
 			else
 			{
-
+                
 				// Nur einmal mit beliebiger Menge
 				// Basket durchgehen und schauen ob es schon drin ist und dann abbrechen sonst neu hinzufÃŒgen
@@ -140,7 +140,8 @@
 
 						$bOK = $this->shop->callMods('basket_produkttosession', array($produkt_key, &$menge, &$_SESSION['wpsg']['basket'][$p_key]));
+ 
 						if ($bOK === false)
 						{
-
+						    
 							return false;
 
@@ -153,9 +154,9 @@
 						if ($_SESSION['wpsg']['basket'][$p_key]['menge'] <= 0)
 						{
-
+                            
 							unset($_SESSION['wpsg']['basket'][$p_key]);
 
 						}
-
+                         
 						return true;
 
@@ -171,9 +172,9 @@
 			if ($bOK === false)
 			{
-
+                
 				return false;
 
 			}
-
+            
 			// War noch nicht drin => neu hinzufÃŒgen
 			$ses_data = wpsg_array_merge($ses_data, array(
@@ -527,5 +528,5 @@
 			$this->shop->view['order'] = $this->shop->cache->loadOrder($order_id);
 			$this->shop->view['customer'] = $this->shop->cache->loadKunden($this->shop->view['oOrder']->k_id);
-
+ 
 			if ($bDebug === true)
 			{
@@ -626,5 +627,5 @@
 		 * Ist der Parameter $finish_order auf false so bleiben die Bestelldaten in der Session (Zur Vorspeicherung)
 		 */
-		public function save($finish_order = true)
+		public function save($finish_order = true, $sendmail = true)
 		{
 
@@ -632,8 +633,8 @@
 			try
 			{
-
+               
 				// Berechnen
 				$arBasket = $this->toArray();
-
+ 
 				// Keine Produkte nix speichern
 				// Sonst wurden schon beim Betreten des leeren Warenkorb (Bots) leere Bestellungen erzeugt
@@ -649,5 +650,5 @@
 
 				$this->shop->callMods('basket_save_kunde', array(&$data, &$this->arCheckout));
-
+               
 				$saved_order_db = array();
 				$k_id = wpsg_getStr($this->arCheckout['id']);
@@ -716,5 +717,5 @@
 					$this->db->UpdateQuery(WPSG_TBL_KU, $data, "`id` = '".wpsg_q($k_id)."'");
 					$knr = $this->db->fetchOne("SELECT `knr` FROM `".WPSG_TBL_KU."` WHERE `id` = '".wpsg_q($k_id)."'");
-
+ 
 					$this->shop->callMods('customer_updatePwd', array(&$k_id, &$this->arCheckout['password']));
 					$this->shop->callMods('customer_updated', array(&$k_id));
@@ -1076,5 +1077,5 @@
 
 					// Wenn CrefoPay aktiv, werden die Mails spÃ€ter versendet
-					if (!$this->shop->hasMod('wpsg_mod_crefopay')) $this->sendOrderSaveMails($o_id, $arBasket);
+					if (!$this->shop->hasMod('wpsg_mod_crefopay') && $sendmail) $this->sendOrderSaveMails($o_id, $arBasket);
 
 					// Bestellung direkt auf "Zahlung akzeptiert setzen" wenn option aktiv ist
@@ -1546,5 +1547,5 @@
 				WPSG_BRUTTO => array()
 			);
-
+            
 			foreach ($this->arProdukte as $product_index => &$b)
 			{
Index: /model/wpsg_model.class.php
===================================================================
--- /model/wpsg_model.class.php	(revision 6828)
+++ /model/wpsg_model.class.php	(revision 6830)
@@ -84,5 +84,5 @@
 		 * Gibt eine Instanz dieses Models zurÃŒck anhand des PrimÃ€rschlÃŒssels
 		 * @param int $id
-		 * @return self
+		 * @return static
 		 */
 		public static function getInstance($id, $noCache = false)
Index: /model/wpsg_order.class.php
===================================================================
--- /model/wpsg_order.class.php	(revision 6828)
+++ /model/wpsg_order.class.php	(revision 6830)
@@ -312,4 +312,5 @@
 		/**
 		 * Gibt einen Array mit allen bestellten Produkten zurÃŒck
+         * @return wpsg_order_product[]
 		 */
 		public function getOrderProducts()
Index: /mods/wpsg_mod_abo.class.php
===================================================================
--- /mods/wpsg_mod_abo.class.php	(revision 6828)
+++ /mods/wpsg_mod_abo.class.php	(revision 6830)
@@ -13,4 +13,14 @@
 		var $version = "9.9.9";
 
+        const EXPIRE_MAIL = '1';
+        const EXPIRE_AUTO = '2';
+         
+        const CUSTOMER_AUTO_NOTHING = '0'; // Kunde kann im Frontend nicht auf die automatische VerlÃ€ngeurng eingreifen
+        const CUSTOMER_AUTO_DIRECT = '1'; // Kunde kann die automatische VerlÃ€ngerung direkt stoppen
+        const CUSTOMER_AUTO_MAIL = '2'; // Kunde kann die automatische VerlÃ€ngerung ÃŒber eine Mail an den Admin stoppen
+        
+        const STATUS_ACTIVE = '0'; // Standard
+        const STATUS_STOPPED = '1'; // Abo ist gestoppt, es erfolgt keine manuelle oder automatische VerlÃ€ngerung
+        
 		/**
 		 * Costructor
@@ -27,4 +37,12 @@
 		} // public function __construct()
 
+        public function init()
+        {
+            
+            // Option gab es frÃŒher nicht und wird hier auf den Default Wert korrigiert.
+            if ($this->shop->get_option('wpsg_mod_abo_expiremode') === false) $this->shop->update_option('wpsg_mod_abo_expiremode', self::EXPIRE_MAIL);
+                        
+        } // public function init()
+         
 		public function install()
 		{
@@ -56,4 +74,5 @@
 				inform_expiration int(1) DEFAULT '0' NOT NULL,
 				rebuy int(11) DEFAULT '0' NOT NULL,
+				status int(1) DEFAULT '0' NOT NULL,
 				PRIMARY KEY  (id),
 	  			KEY order_id (order_id),
@@ -98,5 +117,10 @@
 			$this->shop->update_option('wpsg_mod_abo_wpsgmodaboexpiration', $_REQUEST['wpsg_mod_abo_wpsgmodaboexpiration']);
 			$this->shop->update_option('wpsg_mod_abo_wpsgmodabrebuy', $_REQUEST['wpsg_mod_abo_wpsgmodabrebuy']);
-
+            $this->shop->update_option('wpsg_mod_abo_expiremode', $_REQUEST['wpsg_mod_abo_expiremode']);            
+            
+            $this->shop->update_option('wpsg_mod_abo_autoexpire_payment', $_REQUEST['wpsg_mod_abo_autoexpire_payment']);
+            $this->shop->update_option('wpsg_mod_abo_autoexpire_customermail', $_REQUEST['wpsg_mod_abo_autoexpire_customermail']);
+            $this->shop->update_option('wpsg_mod_abo_autoexpire_adminmail', $_REQUEST['wpsg_mod_abo_autoexpire_adminmail']);
+            
 		} // public function settings_save()
 
@@ -313,5 +337,5 @@
 		public function cron()
 		{
-
+ 
 			$arAboExpiration = $this->db->fetchAssoc("
 				SELECT
@@ -321,7 +345,8 @@
 				WHERE
 					A.`expiration` < NOW() AND
+					A.`status` = '".wpsg_q(self::STATUS_ACTIVE)."' AND
 					A.`inform_expiration` != '1'
 			");
-
+  
 			foreach ($arAboExpiration as $a)
 			{
@@ -336,6 +361,17 @@
 				));
 
-				// Mail mit Benachrichtigung senden
-				$this->sendAboExpirationMail($a['order_id'], $a['product_key']);
+                if ($this->shop->get_option('wpsg_mod_abo_expiremode') == self::EXPIRE_AUTO)
+                {
+                    
+                    $this->autoExtendOrder($a['order_id'], $a['product_key']);
+                 die();   
+                }
+                else
+                {
+                
+				    // Mail mit Benachrichtigung senden
+				    $this->sendAboExpirationMail($a['order_id'], $a['product_key']);
+                    
+                }
 
 				// Damit der Cron das nicht stÃ€ndig macht
@@ -550,5 +586,5 @@
 				$this->shop->view['wpsg_mod_abo']['order'] = $this->shop->cache->loadOrder($this->getOrderIDFromKey($produkt['id']));
 				$this->shop->view['wpsg_mod_abo']['product'] = $this->shop->cache->loadProduct($this->shop->getProduktID($produkt['id']));
-				$this->shop->view['wpsg_mod_abo']['wpsg_mod_abo_durration_menge'] = $p['menge'] * $this->shop->view['wpsg_mod_abo']['product']['wpsg_mod_abo_durration'];
+				$this->shop->view['wpsg_mod_abo']['wpsg_mod_abo_durration_menge'] = $produkt['menge'] * $this->shop->view['wpsg_mod_abo']['product']['wpsg_mod_abo_durration'];
 
 				if ($this->shop->htmlMail === true)
@@ -611,6 +647,184 @@
 		} // public function order_view_row(&$p, $i)
 
+        public function order_view($order_id, &$arSidebarArray) 
+        {
+
+            if ($this->isAboOrder($order_id) === 1)
+            {
+                
+                $this->shop->view['arOrderedAboProducts'] = $this->getAboProductsFromOrder($order_id);
+                
+                $arSidebarArray['abo'] = [
+                    'title' => _('Abo Produkte'),
+                    'content' => $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_abo/order_view.phtml', false)
+                ];
+                
+            }
+            
+        } // public function order_view($order_id, &$arSidebarArray)
+
+        public function order_ajax()
+        {
+
+            if (wpsg_isSizedString($_REQUEST['do'], 'run'))
+            {
+                
+                $abo_status = $this->getAboProductStatus($_REQUEST['edit_id'], $_REQUEST['product_key']);
+                
+                $this->db->UpdateQuery(WPSG_TBL_ABO, Array('status' => self::STATUS_ACTIVE), " `id` = '".wpsg_q($abo_status['id'])."' ");
+                
+                if ($this->shop->get_option('wpsg_mod_abo_expiremode') === self::EXPIRE_AUTO) $this->shop->addBackendMessage(__('Wenn das Abo auslÃ€uft, wird wieder automatisch eine Bestellung ausgelÃ¶st.', 'wpsg'));
+                else if ($this->shop->get_option('wpsg_mod_abo_expiremode') === self::EXPIRE_MAIL) $this->shop->addBackendMessage(__('Wenn das Abo auslÃ€uft, wird dem Kunden wieder die MÃ¶glichkeit gegeben mit einer neuen Bestellung das Abo zu verlÃ€ngern.', 'wpsg'));
+
+                $url = $this->getNotifyURL($this->shop->getProduktID($_REQUEST['product_key']));
+
+                if (wpsg_isSizedString($url))
+                {
+
+                    $this->shop->notifyURL($url, $_REQUEST['product_key'], 1, $_REQUEST['edit_id'], 3, array(
+                        'typ' => 'abo_status_started',
+                        'abo_baseOrderID' => $_REQUEST['edit_id']
+                    ));
+
+                    $this->shop->addBackendMessage(wpsg_translate(__('URL Benachrichtigung an: #1# ausgelÃ¶st. (type=abo_status_started)', 'wpsg'), $url));
+
+                }
+                
+                $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['do'], 'stop'))
+            {
+
+                $abo_status = $this->getAboProductStatus($_REQUEST['edit_id'], $_REQUEST['product_key']);
+
+                $this->db->UpdateQuery(WPSG_TBL_ABO, Array('status' => self::STATUS_STOPPED), " `id` = '".wpsg_q($abo_status['id'])."' ");
+
+                if ($this->shop->get_option('wpsg_mod_abo_expiremode') === self::EXPIRE_AUTO) $this->shop->addBackendMessage(__('Wenn das Abo auslÃ€uft, wird keine Bestellung mehr ausgelÃ¶st.', 'wpsg'));
+                else if ($this->shop->get_option('wpsg_mod_abo_expiremode') === self::EXPIRE_MAIL) $this->shop->addBackendMessage(__('Wenn das Abo auslÃ€uft, wird dem Kunden keine MÃ¶glichkeit gegeben mit einer neuen Bestellung das Abo zu verlÃ€ngern.', 'wpsg'));
+
+                $url = $this->getNotifyURL($this->shop->getProduktID($_REQUEST['product_key']));
+                
+                if (wpsg_isSizedString($url))
+                {
+                
+                    $this->shop->notifyURL($url, $_REQUEST['product_key'], 1, $_REQUEST['edit_id'], 3, array(
+                        'typ' => 'abo_status_stopp',
+                        'abo_baseOrderID' => $_REQUEST['edit_id']
+                    ));
+                    
+                    $this->shop->addBackendMessage(wpsg_translate(__('URL Benachrichtigung an: #1# ausgelÃ¶st. (type=abo_status_stopped)', 'wpsg'), $url));
+                    
+                }
+                
+                $this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&action=view&edit_id='.$_REQUEST['edit_id']);
+
+            }
+            
+        }
+        
 		/** Modulfunktionen */
 
+        /**
+         * Erstellt automatisch eine Bestellung wenn ein Abo ausgelaufen ist
+         * 
+         * @param $order_id
+         * @param $product_key
+         */
+		public function autoExtendOrder($order_id, $product_key)
+        {
+            
+            $this->shop->addShipPay();
+            
+            $oOrder = wpsg_order::getInstance($order_id); 
+ 
+            unset($_SESSION['wpsg']['basket']);
+            unset($_SESSION['wpsg']['checkout']);
+
+            $_SESSION['wpsg']['checkout']['id'] = $oOrder->k_id;
+            $_SESSION['wpsg']['checkout']['payment'] = $this->shop->get_option('wpsg_mod_abo_autoexpire_payment');
+            $_SESSION['wpsg']['checkout']['shipping'] = $oOrder->type_shipping;
+            
+            $customer_db_data = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_KU."` WHERE `id` = '".wpsg_q($oOrder->k_id)."' ");
+            $customer_address = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_ADRESS."` WHERE `id` = '".wpsg_q($customer_db_data['adress_id'])."' ");
+             
+            $_SESSION['wpsg']['checkout']['firma'] = $customer_address['firma'];
+            $_SESSION['wpsg']['checkout']['title'] = $customer_address['title'];
+            $_SESSION['wpsg']['checkout']['vname'] = $customer_address['vname'];
+            $_SESSION['wpsg']['checkout']['name'] = $customer_address['name'];
+            $_SESSION['wpsg']['checkout']['email'] = $customer_db_data['email'];
+            $_SESSION['wpsg']['checkout']['geb'] = $customer_address['geb'];
+            $_SESSION['wpsg']['checkout']['fax'] = $customer_address['fax'];
+            $_SESSION['wpsg']['checkout']['tel'] = $customer_address['tel'];
+            $_SESSION['wpsg']['checkout']['strasse'] = $customer_address['strasse'];
+            $_SESSION['wpsg']['checkout']['nr'] = $customer_address['nr'];
+            $_SESSION['wpsg']['checkout']['plz'] = $customer_address['plz'];
+            $_SESSION['wpsg']['checkout']['ort'] = $customer_address['ort'];
+            $_SESSION['wpsg']['checkout']['land'] = $customer_address['land'];
+                        
+            $oBasket = new wpsg_basket();
+          
+            $oBasket->addProduktToSession($product_key, 1);
+            
+            $oBasket->initFromSession(true); $arBasket = $oBasket->toArray();
+            $new_o_id = $oBasket->save(true, false);
+            
+            $arBasket['checkout']['knr'] = $customer_db_data['knr'];
+            $arBasket['checkout']['onr'] = $this->db->fetchOne("SELECT `onr` FROM `".WPSG_TBL_ORDER."` WHERE `id` = '".wpsg_q($new_o_id)."' ");
+            $arBasket['checkout']['datum'] = time();
+ 
+            $bCustomerMail = false;
+            $bAdminMail = false;
+            
+            if ($this->shop->get_option('wpsg_mod_abo_autoexpire_customermail')) $bCustomerMail = true;
+            if ($this->shop->get_option('wpsg_mod_abo_autoexpire_adminmail')) $bAdminMail = true;
+            
+            $oBasket->sendOrderSaveMails($new_o_id, $arBasket, $bCustomerMail, $bAdminMail);
+            
+        } // public function autoExtendOrder($order_id, $product_key)
+
+        /**
+         * Gibt einen Array mit AboProdukten einer Bestellung zurÃŒck
+         * @param int $order_id
+         * @return wpsg_order_product[]
+         */
+        public function getAboProductsFromOrder($order_id)
+        {
+            
+            $oOrder = wpsg_order::getInstance($order_id);
+            $arOrderProducts = Array();
+            
+            foreach ($oOrder->getOrderProducts() as $oOrderProduct)
+            {
+                
+                if ($oOrderProduct->getProduct()->wpsg_mod_abo_activ)
+                {
+                    
+                    $arOrderProducts[] = $oOrderProduct;
+                    
+                }
+                
+            }
+            
+            return $arOrderProducts;
+            
+        } // public function getAboProductsFromOrder($order_id)
+
+        /**
+         * Gibt die Informationen zu dem Abo aus der Abo Tabelle zurÃŒck
+         * 
+         * @param $order_id
+         * @param $product_key
+         * @return mixed
+         */
+        public function getAboProductStatus($order_id, $product_key)
+        {
+            
+            $abo_product = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_ABO."` WHERE `order_id` = '".wpsg_q($order_id)."' AND `product_key` = '".wpsg_q('abo_'.$order_id.'_'.$product_key)."' ");
+            
+            return $abo_product;
+                        
+        } // public function getAboProductStatus($order_id, $product_id)
+        
 		/**
 		 * Gibt das Datum im MySQL Format zurÃŒck, wann das Abo ablÃ€uft wenn es heute gekauft wird
@@ -895,4 +1109,3 @@
 
 	} // class wpsg_mod_abo extends wpsg_mod_basic
-
-?>
+ 
Index: /views/admin/form/checkbox.phtml
===================================================================
--- /views/admin/form/checkbox.phtml	(revision 6828)
+++ /views/admin/form/checkbox.phtml	(revision 6830)
@@ -37,4 +37,8 @@
 					<?php } ?>
 					
+					<?php if (wpsg_isSizedString($this->view['field_config']['hint'])) { ?>
+						<div class="hint info"><?php echo $this->view['field_config']['hint']; ?></div>
+					<?php } ?>
+					
 				</div>
 				
Index: /views/css/admin.css
===================================================================
--- /views/css/admin.css	(revision 6828)
+++ /views/css/admin.css	(revision 6830)
@@ -218,5 +218,5 @@
 .wpsg_order .col_checkbox { width:20px; }
 .wpsg_order .col_checkbox input { margin-top:-2px; }
-.wpsg_order .col_nr { width:200px; }
+.wpsg_order .col_nr { width:250px; }
 .wpsg_order .col_nr .actions a { font-size:0.9em; }
 .wpsg_order .col_nr .glyphicon { margin-top:5px; font-size:1.2em; margin-right:5px; text-decoration:none; }
@@ -258,4 +258,8 @@
 .form-checkbox label { font-size:12px; line-height:200%; }
 
+/* Modul AboProdukte */
+.wpsg_mod_abo_expired { color:red; }
+.wpsg_mod_abo_future_expire { color:green; }
+
 /* Modul Produktbilder (wpsg_mod_produktbilder) */
 #produktbilder_target img { }
Index: /views/mods/mod_abo/order_view.phtml
===================================================================
--- /views/mods/mod_abo/order_view.phtml	(revision 6830)
+++ /views/mods/mod_abo/order_view.phtml	(revision 6830)
@@ -0,0 +1,44 @@
+<?php
+
+    /**
+     * Template fÃŒr die Anzeige des Abo Statuses in der Hauptbestellung
+     */
+    
+    
+?>
+      
+<?php foreach ($this->view['arOrderedAboProducts'] as $oOrderProduct) { ?>
+
+    <?php echo wpsg_drawForm_AdminboxStart($oOrderProduct->getProduct()->getProductName()); ?>
+         
+        <?php echo wpsg_drawForm_TextStart(); ?>
+            
+            <?php $abo_product_status = $this->callMod('wpsg_mod_abo', 'getAboProductStatus', Array($_REQUEST['edit_id'], $oOrderProduct->getProductKey())); ?>
+    
+            <?php if ($abo_product_status['status'] === wpsg_mod_abo::STATUS_ACTIVE) { ?>
+        
+                <?php echo __('Aktiv', 'wpsg'); ?>
+
+                &nbsp;[&nbsp;<a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_abo&edit_id=<?php echo $_REQUEST['edit_id'] ?>&product_key=<?php echo $oOrderProduct->getProductKey(); ?>&do=stop&noheader=1"><?php echo __('Anhalten'); ?></a>&nbsp;]
+        
+            <?php } else if ($abo_product_status['status'] === wpsg_mod_abo::STATUS_STOPPED) { ?>
+        
+                <?php echo __('Angehalten', 'wpsg'); ?>
+
+                &nbsp;[&nbsp;<a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_abo&edit_id=<?php echo $_REQUEST['edit_id'] ?>&product_key=<?php echo $oOrderProduct->getProductKey(); ?>&do=run&noheader=1"><?php echo __('Fortsetzen'); ?></a>&nbsp;]
+        
+            <?php } ?>
+    
+        <?php echo wpsg_drawForm_TextEnd(__('VerlÃ€ngerung')); ?>
+    
+        <?php $tExpire = strtotime($this->callMod('wpsg_mod_abo', 'getOrderAboExpiration', Array($_REQUEST['edit_id']))); echo wpsg_drawForm_Text(__('Abo lÃ€uft bis'), wpsg_formatTimestamp($tExpire), false, Array('class_content_wrap' => (($tExpire > time())?'wpsg_mod_abo_future_expire':'wpsg_mod_abo_expired'))); ?>
+     
+        <?php /* echo wpsg_drawForm_TextStart(); ?>
+
+            <?php echo wpsg_translate(_('Erstkauf am #1#', 'wpsg'), $this->view['data']['cdate']); ?>
+    
+        <?php echo wpsg_drawForm_TextEnd(__('Verlauf', 'wpsg')); */ ?>
+    
+    <?php echo wpsg_drawForm_AdminboxEnd(); ?>
+    
+<?php } ?>
Index: /views/mods/mod_abo/settings_edit.phtml
===================================================================
--- /views/mods/mod_abo/settings_edit.phtml	(revision 6828)
+++ /views/mods/mod_abo/settings_edit.phtml	(revision 6830)
@@ -4,9 +4,52 @@
 	 * Template fÃŒr die Einstellungen des Abo Moduls
 	 */
-
+	
+	$arPaymentSelect = Array();
+	foreach ($this->arPayment as $p) { $arPaymentSelect[$p['id']] = $p['name']; }
+	
 ?>
 <?php echo wpsg_drawForm_Input('wpsg_mod_abo_url', __('Standard URL fÃŒr Ablauf/VerlÃ€ngerung', 'wpsg'), $this->get_option('wpsg_mod_abo_url'), array ('help' => 'wpsg_mod_abo_url')); ?>
 <br />
 <?php echo wpsg_drawForm_Checkbox('wpsg_mod_abo_wpsgmodabofirstbuy', __('Mail bei erstem Kauf eines Abos', 'wpsg'), $this->get_option('wpsg_mod_abo_wpsgmodabofirstbuy'), array('hint' => wpsg_translate(__('nohspc_Mail wird bei Bezahlung der Abo Bestellung zusÃ€tzlich versendet. (mail_firstbuy.phtml) -> <a href="#1#">Konfiguration</a>', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=emailconf#wpsgmodabofirstbuy'), 'help' => 'wpsg_mod_abo_wpsgmodabofirstbuy',)); ?>
-<?php echo wpsg_drawForm_Checkbox('wpsg_mod_abo_wpsgmodaboexpiration', __('Mail bei Auslauf eines Abos', 'wpsg'), $this->get_option('wpsg_mod_abo_wpsgmodaboexpiration'), array('hint' => wpsg_translate(__('nohspc_Mail wird bei Auslauf eines Abos versendet. (mail_expiration.phtml) -> <a href="#1#">Konfiguration</a>', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=emailconf#wpsgmodaboexpiration'), 'help' => 'wpsg_mod_abo_wpsgmodaboexpiration',)); ?>
 <?php echo wpsg_drawForm_Checkbox('wpsg_mod_abo_wpsgmodabrebuy', __('Mail bei Kauf einer VerlÃ€ngerung', 'wpsg'), $this->get_option('wpsg_mod_abo_wpsgmodabrebuy'), array('hint' => wpsg_translate(__('nohspc_Mail wird bei Bezahlung einer Abo VerlÃ€ngerung versendet. (mail_rebuy.phtml) -> <a href="#1#">Konfiguration</a>', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=emailconf#wpsgmodabrebuy'), 'help' => 'wpsg_mod_abo_wpsgmodabrebuy',)); ?>
+
+<br />
+ 
+<?php echo wpsg_drawForm_Select('wpsg_mod_abo_expiremode', __('Nach Ablauf des Abos', 'wpsg'), Array(
+	wpsg_mod_abo::EXPIRE_MAIL => _('Mail versenden', 'wpsg'),
+	wpsg_mod_abo::EXPIRE_AUTO => _('Automatisch verlÃ€ngern', 'wpsg')
+), $this->get_option('wpsg_mod_abo_expiremode'), array('help' => 'wpsg_mod_abo_expiremode')); ?>
+
+<div class="wpsg_mod_expiremode wpsg_mod_expiremode_<?php echo wpsg_mod_abo::EXPIRE_MAIL; ?>" style="display:<?php echo (($this->get_option('wpsg_mod_abo_expiremode') == wpsg_mod_abo::EXPIRE_MAIL || $this->get_option('wpsg_mod_abo_expiremode') === false)?'block':'none'); ?>;">
+
+	<?php echo wpsg_drawForm_Checkbox('wpsg_mod_abo_wpsgmodaboexpiration', __('Mail bei Auslauf eines Abos', 'wpsg'), $this->get_option('wpsg_mod_abo_wpsgmodaboexpiration'), array('hint' => wpsg_translate(__('nohspc_Mail wird bei Auslauf eines Abos versendet. (mail_expiration.phtml) -> <a href="#1#">Konfiguration</a>', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=emailconf#wpsgmodaboexpiration'), 'help' => 'wpsg_mod_abo_wpsgmodaboexpiration',)); ?>
+
+</div>
+
+<div class="wpsg_mod_expiremode wpsg_mod_expiremode_<?php echo wpsg_mod_abo::EXPIRE_AUTO; ?>" style="display:<?php echo (($this->get_option('wpsg_mod_abo_expiremode') == wpsg_mod_abo::EXPIRE_AUTO)?'block':'none'); ?>;">
+	
+	<?php echo wpsg_drawForm_Select('wpsg_mod_abo_autoexpire_payment', __('Zahlungsart fÃŒr automatische VerlÃ€ngerung'), $arPaymentSelect, $this->get_option('wpsg_mod_abo_autoexpire_payment'), array()); ?>
+	<?php echo wpsg_drawForm_Checkbox('wpsg_mod_abo_autoexpire_customermail', __('Mail an Kunden'), $this->get_option('wpsg_mod_abo_autoexpire_customermail')); ?>
+	<?php echo wpsg_drawForm_Checkbox('wpsg_mod_abo_autoexpire_adminmail', __('Mail an Administrator'), $this->get_option('wpsg_mod_abo_autoexpire_adminmail')); ?>
+	<?php echo wpsg_drawForm_Select('wpsg_mod_abo_autoexpire_customer', __('Kunde kann im Frontend'), Array(
+		wpsg_mod_abo::CUSTOMER_AUTO_NOTHING => _('Nichts', 'wpsg'),
+		wpsg_mod_abo::CUSTOMER_AUTO_DIRECT => _('VerlÃ€ngerung direkt stoppen', 'wpsg'),
+		wpsg_mod_abo::CUSTOMER_AUTO_MAIL => _('VerlÃ€ngerung ÃŒber Mail an Administrator stoppen', 'wpsg')
+	), $this->get_option('wpsg_mod_abo_autoexpire_customer'), array()); ?>	
+	
+</div>
+
+<script type="text/javascript">/* <![CDATA[ */
+
+    jQuery(document).ready(function() {
+    	
+    	jQuery('#wpsg_mod_abo_expiremode').on('change', function() {
+    		
+    		jQuery('.wpsg_mod_expiremode').hide();
+			jQuery('.wpsg_mod_expiremode_' + jQuery(this).val()).show();
+    		
+		} ); 
+    	
+	} );
+
+/* ]]> */</script>
Index: /views/order/index.phtml
===================================================================
--- /views/order/index.phtml	(revision 6828)
+++ /views/order/index.phtml	(revision 6830)
@@ -172,7 +172,21 @@
 
                             <?php if ($this->hasMod('wpsg_mod_abo')) { ?>
-                                <?php if ($this->callMod('wpsg_mod_abo', 'isAboOrder', array($oOrder->id)) === 1) { ?>
-                                    <?php echo $this->callMod('wpsg_mod_abo', 'getOrderAboExpiration', array($oOrder->id)) ?>
-                                <?php } else if ($this->callMod('wpsg_mod_abo', 'isAboOrder', array($oOrder->id)) === 2) { ?>
+                            
+                                <?php if (in_array(strval($this->callMod('wpsg_mod_abo', 'isAboOrder', array($oOrder->id))), array(1))) { ?>
+                                    
+                                    <?php $abo_expiration = strtotime($this->callMod('wpsg_mod_abo', 'getOrderAboExpiration', array($oOrder->id))); ?>
+
+                                    <?php echo __('Abo:', 'wpsg'); ?>
+                                    
+                                    <?php if ($abo_expiration > time()) { ?>
+                                        <span class="wpsg_mod_abo_future_expire"><?php echo wpsg_formatTimestamp($abo_expiration); ?></span>
+                                    <?php } else { ?>
+                                        <span class="wpsg_mod_abo_expired"><?php echo wpsg_formatTimestamp($abo_expiration); ?></span>    
+                                    <?php } ?>
+                                    
+                                <?php } ?>
+                                
+                                <?php if ($this->callMod('wpsg_mod_abo', 'isAboOrder', array($oOrder->id)) === 2) { ?>
+                                    
                                     <?php
 
@@ -181,9 +195,9 @@
 
                                     ?>
-                                    <?php echo $this->callMod('wpsg_mod_abo', 'getOrderAboExpiration', array($origin_order_data['id'])) ?><br />
                                     <?php echo wpsg_translate(__('VerlÃ€ngerung zu Bestellung <a href="#1#">#2#</a>', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&action=view&edit_id='.$origin_order_id, $origin_order_data['onr']); ?>
+                                    
                                 <?php } ?>
-                            </td>
-                            <?php } ?>
+                            
+                            <?php } ?>                            
 
                         </td>
