Index: /changelog
===================================================================
--- /changelog	(revision 7057)
+++ /changelog	(revision 7058)
@@ -136,5 +136,4 @@
 - Bugfix: Abfrage, ob Column bei Import schon vorhanden ist
 - Bugfix: Produktvarianten - Lagerbestand der aktuell ausgewÃ€hlten Variante wird jetzt im Produkttemplate angezeigt 
-- Feature: Satolo Newsletter-Abonnentenstatus bei Neuregistrierung optional auswÃ€hlbar
 - Feature: Satolo Newsletter-Registrierung mittels Double-OptIn
 - Feature: Satolo Newsletter-Abonnenten in gewÃ€hlte Liste integrieren
Index: /mods/wpsg_mod_nlsatolo.class.php
===================================================================
--- /mods/wpsg_mod_nlsatolo.class.php	(revision 7057)
+++ /mods/wpsg_mod_nlsatolo.class.php	(revision 7058)
@@ -1,208 +1,163 @@
 <?php
 
-	/**
-	 * Integriert die Anmeldung fÃŒr das Satollo Newsletter Plugin in den Shop
-	 * @author daniel
-	 */
-	class wpsg_mod_nlsatolo extends wpsg_mod_basic 
-	{
+/**
+ * Integriert die Anmeldung fÃŒr das Satollo Newsletter Plugin in den Shop
+ * @author daniel
+ */
+class wpsg_mod_nlsatolo extends wpsg_mod_basic {
 
-		var $lizenz = 1;
-		var $id = 600;
-		
-		/**
-		 * Costructor
-		 */
-		public function __construct()
-		{
-			
-			parent::__construct();
-			
-			$this->name = __('Satollo Newsletter', 'wpsg');
-			$this->group = __('Sonstiges', 'wpsg');
-			$this->desc = __('ErmÃ¶glicht die Anmeldung an das "<a href="http://wordpress.org/extend/plugins/newsletter/">Newsletter</a>" Plugin von Satollo.', 'wpsg');
-						
-		} // public function __construct()
-		
-		public function order_done(&$order_id, &$done_view) 
-		{ 
+    var $lizenz = 1;
+    var $id = 600;
 
-			if (isset($_SESSION['wpsg']['wpsg_mod_nlsatolo']))
-			{
-				
-				global $newsletter;
-			  			
-				if (function_exists("newsletter_subscribe"))
-				{
-					
-					// Version <= 1.5.9
-					
-					newsletter_subscribe($done_view['basket']['checkout']['email'], $done_view['basket']['checkout']['vname'].' '.$done_view['basket']['checkout']['name']);
-					$this->addFrontendMessage(__("Sie wurden erfolgreich in unseren Newsletter eingetragen.", "wpsg"));
-					
-				}
-				else if (get_class($newsletter) == "Newsletter")
-				{
-				
-					// Version >= 2.5.0
-					
-					$_REQUEST['na'] = 's';
-					$_REQUEST['nn'] = $done_view['basket']['checkout']['vname'];
-					$_REQUEST['ns'] = $done_view['basket']['checkout']['name'];
-					$_REQUEST['ne'] = $done_view['basket']['checkout']['email'];
- 
-					$newsletter->hook_init();
-					
-					$this->shop->addFrontendMessage(__("Sie wurden erfolgreich in unseren Newsletter eingetragen.", "wpsg"));
-					
-				}
-				else
-				{
-					
-					$this->shop->addFrontendError(__('Sie wurden nicht zum Newsletter angemeldet, da das Plugin "newsletter" nicht installiert ist.', 'wpsg'));
-				
-				}
-				
-			} 
-						
-		} // public function order_done(&$order_id)
+    /**
+     * Costructor
+     */
+    public function __construct() {
 
-		public function install()
-		{
-				
-			$this->shop->checkDefault('wpsg_mod_nlsatolo_action', '0');
-				
-		} // public function install()		
-		
-		public function settings_edit()
-		{
-				
-			$this->shop->view['plugin_active'] = $this->checkNewsletterPlugin();
-				
-			if ($this->shop->view['plugin_active'] === true)
-			{
-		
-				$this->shop->view['arGroup'] = wpng_Group::loadAllGroupNames();
-		
-			}
-				
-			$this->render(WPSG_PATH_VIEW.'/mods/mod_nlsatolo/settings_edit.phtml');
-				
-		} // public function settings_edit()
-				
-		public function settings_save()
-		{
-			
-			$this->shop->update_option('wpsg_mod_nlsatolo_status', $REQUEST['wpsg_mod_nlsatolo_status']);
-			$this->shop->update_option('wpsg_mod_nlsatolo_group', $REQUEST['wpsg_mod_nlsatolo_group']); 
-			$this->shop->update_option('wpsg_mod_nlsatolo_action', $_REQUEST['wpsg_mod_nlsatolo_action']);
-				
-		} // public function settings_save()
-		
-		public function basket_save_done(&$o_id, &$k_id, &$oBasket)
-		{
-			
-			global $newsletter;
-						
-			$arBasket = $oBasket->toArray();
-			
-			if ($arBasket['checkout']['wpsg_mod_nlsatolo'] == '1')
-			{
-				
-				if (function_exists("newsletter_subscribe"))
-				{
-					
-					// Version <= 1.5.9
-					newsletter_subscribe($arBasket['checkout']['email'], $arBasket['checkout']['vname'].' '.$arBasket['checkout']['name']);
-					$this->shop->addFrontendMessage(__("Sie wurden erfolgreich in unseren Newsletter eingetragen.", "wpsg"));
-					
-				}
-				else if (get_class($newsletter) == "Newsletter")
-				{
-					//fÃŒr Versionen >= 3.0.2
-					if (version_compare(NEWSLETTER_VERSION, '3.0.2') >= 0)
-					{
+        parent::__construct();
 
-						global $newsletter;
-						
-						$user = array(
-							'email' 	=> $arBasket['checkout']['email'],
-							'name' 		=> $arBasket['checkout']['vname'],
-							'surname' 	=> $arBasket['checkout']['name'],
-							'status'	=> 'C'
-						);
-						
-						$newsletter->save_user($user);
+        $this->name = __('Satollo Newsletter', 'wpsg');
+        $this->group = __('Sonstiges', 'wpsg');
+        $this->desc = __('ErmÃ¶glicht die Anmeldung an das "<a href="http://wordpress.org/extend/plugins/newsletter/">Newsletter</a>" Plugin von Satollo.', 'wpsg');
 
-					} 
-					else 
-					{
+    } // public function __construct()
 
-						//fÃŒr Version >= 2.5.0
-						$_REQUEST['na'] = 's';
-						$_REQUEST['nn'] = $arBasket['checkout']['vname'];
-						$_REQUEST['ns'] = $arBasket['checkout']['name'];
-						$_REQUEST['ne'] = $arBasket['checkout']['email'];
-						 
-						$newsletter->hook_init();
-						 
-					}
-					$this->shop->addFrontendMessage(__("Sie wurden erfolgreich in unseren Newsletter eingetragen.", "wpsg"));
-				}
-				else
-				{
-					
-					$this->shop->addFrontendError(__('Sie wurden nicht zum Newsletter angemeldet, da das Plugin "newsletter" nicht installiert ist.', 'wpsg'));
-					
-				}
-				
-			}
-			
-		} // public function basket_save_done(&$o_id, &$k_id, &$oBasket)
-				 
-		public function checkout_customer_inner()
-		{
-			
-			$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_nlsatolo/checkout_customer_inner.phtml');
-			
-		} // public function checkout_inner_prebutton()
-		
-		public function clearSession() 
-		{
-			 
-			if ($this->shop->get_option('wpsg_afterorder') == '1')
-			{
-			
-				unset($_SESSION['wpsg']['wpsg_mod_nlsatolo']);
-				
-			}
-			
-		} // public function clearSession()
-		
-		/** 
-		 * Gibt true zurÃŒck, wenn das Satolo Newsletter Plugin installiert und aktiv ist
-		 */
-		private function checkNewsletterPlugin()
-		{
-				
-			require_once(ABSPATH.'wp-admin/includes/plugin.php');
-				
-			if (is_plugin_active('newsletter/plugin.php'))
-			{
-					
-				if ($GLOBALS['wpng_pc']->hasActiveLicence() || $GLOBALS['wpng_pc']->getDemoDays() > 0)
-				{
-						
-					return true;
-						
-				}
-		
-			}
-				
-			return false;
-				
-		} // private function checkNewsletterPlugin()
-				
-	} // class wpsg_mod_nlsatolo extends wpsg_mod_basic
+    public function install() {
+
+        $this->shop->checkDefault('wpsg_mod_nlsatolo_action', '0');
+
+    } // public function install()		
+
+    public function settings_edit() {
+
+        $this->shop->view['plugin_active'] = $this->checkNewsletterPlugin();
+
+        if ($this->shop->view['plugin_active'] === true) {
+
+            $options_profile = NewsletterSubscription::instance()->options_lists;
+
+            $arLists = array();
+
+            for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
+
+                $arLists['' . $i] = '(' . $i . ') ' . $options_profile['list_' . $i];
+
+            }
+
+            $this->shop->view['arLists'] = $arLists;
+
+        }
+
+        $this->render(WPSG_PATH_VIEW.'/mods/mod_nlsatolo/settings_edit.phtml');
+
+    } // public function settings_edit()
+
+    public function settings_save() {
+
+        $this->shop->update_option('wpsg_mod_nlsatolo_doubleoptin', $_REQUEST['wpsg_mod_nlsatolo_doubleoptin']);
+        $this->shop->update_option('wpsg_mod_nlsatolo_group', $_REQUEST['wpsg_mod_nlsatolo_group']);
+
+    } // public function settings_save()
+
+    public function basket_save_done(&$o_id, &$k_id, &$oBasket) {
+
+        global $newsletter;
+
+        $arBasket = $oBasket->toArray();
+
+        if ($arBasket['checkout']['wpsg_mod_nlsatolo'] == '1') {
+
+            if (function_exists("newsletter_subscribe")) {
+
+                // Version <= 1.5.9
+                newsletter_subscribe($arBasket['checkout']['email'], $arBasket['checkout']['vname'].' '.$arBasket['checkout']['name']);
+                $this->shop->addFrontendMessage(__("Sie wurden erfolgreich in unseren Newsletter eingetragen.", "wpsg"));
+
+            } else if (get_class($newsletter) == "Newsletter") {
+
+                global $newsletter;
+
+                $user = new stdClass();
+
+                $user->email = $arBasket['checkout']['email'];
+                $user->name = $arBasket['checkout']['vname'];
+                $user->surname = $arBasket['checkout']['name'];
+
+                $newsletterSubscription = NewsletterSubscription::instance();
+                $newsletterSubscription->hook_init();
+
+                if ($this->shop->get_option('wpsg_mod_nlsatolo_doubleoptin') === '1') {
+
+                    $user->status = 'S';
+                    $newsletter->save_user($user);
+
+                    $user = $newsletterSubscription->get_user($user->email);
+
+                    $newsletterSubscription->send_message('confirmation', $user);
+                    $newsletterSubscription->set_user_list($user, $this->shop->get_option('wpsg_mod_nlsatolo_group'), '1');
+
+                    $this->shop->addFrontendMessage(__("Sie wurden erfolgreich in unseren Newsletter eingetragen, mÃŒssen diese aber noch bestÃ€tigen. Sie haben dazu eine E-Mail erhalten.", "wpsg"));
+
+                } else {
+
+                    $user->status = 'C';
+                    $newsletter->save_user($user);
+
+                    $user = $newsletterSubscription->get_user($user->email);
+
+                    $newsletterSubscription->set_user_list($user, $this->shop->get_option('wpsg_mod_nlsatolo_group'), '1');
+
+                    $this->shop->addFrontendMessage(__("Sie wurden erfolgreich in unseren Newsletter eingetragen.", "wpsg"));
+
+                }
+
+            } else {
+
+                $this->shop->addFrontendError(__('Sie wurden nicht zum Newsletter angemeldet, da das Plugin "newsletter" nicht installiert ist.', 'wpsg'));
+
+            }
+
+        }
+
+    } // public function basket_save_done(&$o_id, &$k_id, &$oBasket)
+
+    public function checkout_customer_inner() {
+
+        $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_nlsatolo/checkout_customer_inner.phtml');
+
+    } // public function checkout_inner_prebutton()
+
+    public function clearSession()  {
+
+        if ($this->shop->get_option('wpsg_afterorder') == '1') {
+
+            unset($_SESSION['wpsg']['wpsg_mod_nlsatolo']);
+
+        }
+
+    } // public function clearSession()
+
+    /**
+     * Gibt true zurÃŒck, wenn das Satolo Newsletter Plugin installiert und aktiv ist
+     */
+    private function checkNewsletterPlugin() {
+
+        require_once(ABSPATH.'wp-admin/includes/plugin.php');
+
+        if (is_plugin_active('newsletter/plugin.php')) {
+
+            if ($GLOBALS['wpng_pc']->hasActiveLicence() || $GLOBALS['wpng_pc']->getDemoDays() > 0) {
+
+                return true;
+
+            }
+
+        }
+
+        return false;
+
+    } // private function checkNewsletterPlugin()
+
+} // class wpsg_mod_nlsatolo extends wpsg_mod_basic
 
 ?>
Index: /views/mods/mod_nlsatolo/settings_edit.phtml
===================================================================
--- /views/mods/mod_nlsatolo/settings_edit.phtml	(revision 7057)
+++ /views/mods/mod_nlsatolo/settings_edit.phtml	(revision 7058)
@@ -1,23 +1,19 @@
 <?php
 
-	/**
-	 * Template fÃŒr die Einstellungen des Satollo Newsletter Moduls
-	 */
+/**
+ * Template fÃŒr die Einstellungen des Satollo Newsletter Moduls
+ */
 
 ?>
 <?php if ($this->view['plugin_active'] !== true) { ?>
 
-	<div class="wpsg_error"><br /><?php echo __('Das Modul ist nur mit aktiviertem Satollo Newsletter Plugin funktionsfaehig.', 'wpsg'); ?><br /></div>
+    <div class="wpsg_error"><br /><?php echo __('Das Modul ist nur mit aktiviertem Satollo Newsletter Plugin funktionsfaehig.', 'wpsg'); ?><br /></div>
 
 <?php } else { ?>
 
-	<?php echo wpsg_drawForm_Select('wpsg_mod_nlsatolo_status', __('Statuszuordnung nach Registrierung', 'wpsg'), array('0' => __('bestaetigt', 'wpsg'), '1' => __('nicht bestaetigt', 'wpsg')), $this->get_option('wpsg_mod_nlsatolo_status'), array('help' => 'wpsg_mod_nlsatolo_status')); ?>
-	
-	<?php /* Listen werden im Satolo-Newsletter-Plugin unter Subscribers > Listen erstellen > Listen angelegt*/ ?>
-	<?php echo wpsg_drawForm_Select('wpsg_mod_nlsatolo_group', __('Gruppezuordnung nach Registrierung', 'wpsg'), array('0' => __(' TODO ', 'wpsg')), $this->get_option('wpsg_mod_nlsatolo_group'), array('help' => 'wpsg_mod_nlsatolo_group')); ?>
+    <?php echo wpsg_drawForm_Select('wpsg_mod_nlsatolo_doubleoptin', __('Double Opt-In', 'wpsg'), array('0' => __('Nein', 'wpsg'), '1' => __('Ja', 'wpsg')), $this->get_option('wpsg_mod_nlsatolo_doubleoptin'), array('help' => 'wpsg_mod_nlsatolo_doubleoptin')); ?>
 
-	<br />
-	
-	<?php echo wpsg_drawForm_Select('wpsg_mod_nlsatolo_action', __('Aktion', 'wpsg'), array('0' => __('Opt-In Mail versenden', 'wpsg'), '1' => __('Direkt anmelden', 'wpsg')), $this->get_option('wpsg_mod_nlsatolo_action'), array('help' => 'wpsg_mod_nlsatolo_action')); ?>
-	
+    <?php /* Listen werden im Satolo-Newsletter-Plugin unter Subscribers > Listen erstellen > Listen angelegt*/ ?>
+    <?php echo wpsg_drawForm_Select('wpsg_mod_nlsatolo_group', __('Gruppezuordnung nach Registrierung', 'wpsg'), $this->view['arLists'], $this->get_option('wpsg_mod_nlsatolo_group'), array('help' => 'wpsg_mod_nlsatolo_group')); ?>
+
 <?php } ?>
