Code

Moved timezone settings to config step 2
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 16 Jul 2007 09:30:12 +0000 (09:30 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 16 Jul 2007 09:30:12 +0000 (09:30 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6872 594d385d-05f5-0310-b6e9-bd551577e9d8

setup/class_setupStep_Config2.inc
setup/class_setupStep_Language.inc
setup/setup_config2.tpl
setup/setup_language.tpl

index e42e5e03298a4d5040cd1af3f1a572d69abf49e4..872d8ccfa3f1fb5014480b09dbdc65ed2509094e 100644 (file)
@@ -51,7 +51,10 @@ class Step_Config2 extends setup_step
   var $use_netatalk         = FALSE;
   var $enableFAI_management = FALSE;
 
-  var $attributes = array("governmentmode","sambaidmapping","cyrusunixstyle","mail","use_netatalk","enableFAI_management");
+  var $timezone       = "Europe/Berlin";
+  var $timezones      = array();
+
+  var $attributes = array("governmentmode","sambaidmapping","cyrusunixstyle","mail","use_netatalk","enableFAI_management","timezone");
   var $called = FALSE;
 
   function Step_Config2()
@@ -71,6 +74,7 @@ class Step_Config2 extends setup_step
       $pwdhash= 'perl -MCrypt::SmbHash -e "print join(q[:], ntlmgen \$ARGV[0]), $/;"';
     }
 
+    $this->timezones = get_timezones_array();
     $this->samba_settings['smbhash'] = $pwdhash;
   }
 
@@ -142,6 +146,8 @@ class Step_Config2 extends setup_step
         foreach($this->attributes as $attr){
       $smarty->assign($attr,$this->$attr);
     }
+    $smarty->assign("timezone"     ,$this->timezone);
+    $smarty->assign("timezones"    ,$this->timezones);
     return($smarty -> fetch (get_template_path("../setup/setup_config2.tpl")));
   }
 
@@ -149,6 +155,10 @@ class Step_Config2 extends setup_step
   {
     if(isset($_POST['step6_posted'])){
 
+      if(isset($_POST['timezone']) && isset($this->timezones[$_POST['timezone']])){
+        $this->timezone = $_POST['timezone'];
+      }
+
       /* Get attributes */
       foreach($this->attributes as $attr){
         if(isset($_POST[$attr])){
index 6bbc22c3717b346d8fc460e8eb16171d11bdd650..986c3354251792de7d6930210bf8036a456729b1 100644 (file)
@@ -25,17 +25,14 @@ class Step_Language extends setup_step
   var $lang_selected  = "";       /* Language selected from select box  */
   var $lang           = "en_EN";  /* Detected language */
   var $languages      = array();
-  var $attributes     = array("lang","lang_selected","timezone");
+  var $attributes     = array("lang","lang_selected");
   var $header_image   = "images/locale.png";
-  var $timezone       = "Europe/Berlin";
-  var $timezones      = array();
 
   function Step_Language()
   {
     $this->lang           = get_browser_language();
     $this->lang_selected  = "";
     $this->update_strings(); 
-    $this->timezones = get_timezones_array();
   }
 
   function update_strings()
@@ -58,8 +55,6 @@ class Step_Language extends setup_step
     $smarty->assign("languages",    $this->languages);
     $smarty->assign("lang",         $this->lang);
     $smarty->assign("lang_selected",$this->lang_selected);
-    $smarty->assign("timezone"     ,$this->timezone);
-    $smarty->assign("timezones"    ,$this->timezones);
     return($smarty->fetch(get_template_path("setup_language.tpl",TRUE,dirname(__FILE__))));
   }
 
@@ -74,10 +69,6 @@ class Step_Language extends setup_step
       }else{
         $_SESSION['lang'] = $this->lang;
       }
-
-      if(isset($_POST['timezone']) && isset($this->timezones[$_POST['timezone']])){
-        $this->timezone = $_POST['timezone'];
-      }
     }
   }
 }
index 5189d7c509a95ceb1ee915aafd2da8b49a406723..bce647ec1fb008357f2cb30b192091072455b24f 100644 (file)
             </select>
         </div>
     </div>
+       <div class='step4_container'>
+        <div class='step4_name'>
+            {t}Timezone{/t}
+        </div>
+        <div class='step4_value'>
+            <select name='timezone' title='{t}Please your preferred timezone here{/t}' style="width:100%">
+        {foreach from=$timezones item=val key=key}
+            {if $val.name == $timezone}
+            <option selected value="{$val.name}">{$val.name}</option>
+            {else}
+            <option value="{$val.name}">{$val.name}</option>
+            {/if}
+        {/foreach}
+            </select>
+        </div>
+    </div>
+
 
     <p><b>{t}Additional GOsa settings{/t}</b></p>
 
index c0bd4b582c93b4eae460d14f50606a48fed8b5ae..6d1b30b980221bf2548231e09e4da7be4ba63d16 100644 (file)
                {html_options options=$languages selected=$lang_selected}
                </select>
        </div>
-       <div class='step4_container'>
-        <div class='step4_name'>
-            {t}Timezone{/t}
-        </div>
-        <div class='step4_value'>
-                       <select name='timezone' title='{t}Please your preferred timezone here{/t}' style="width:100%">
-               {foreach from=$timezones item=val key=key}
-                       {if $val.name == $timezone}
-                       <option selected value="{$val.name}">{$val.name}</option>
-                       {else}
-                       <option value="{$val.name}">{$val.name}</option>
-                       {/if}
-               {/foreach}
-                       </select>
-        </div>
-    </div>
 </div>