Code

Updated setup step feedback
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 5 Feb 2009 12:35:36 +0000 (12:35 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 5 Feb 2009 12:35:36 +0000 (12:35 +0000)
-Removed HTML tags and avoid sending feedback twice.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13385 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/setup/class_setupStep_Feedback.inc
gosa-core/setup/setup_feedback.tpl

index 2395fd5908bf143e44893737210c8ac0e9f2773f..d655c2e5e79d756cc72786eff4b9e6db1af16df8 100644 (file)
@@ -49,7 +49,7 @@ class Step_Feedback  extends setup_step
 
   var $features_used        = array();  
   var $initialized          = FALSE; 
-
+  var $feedback_send        = FALSE;
   var $attributes = array("organization","eMail","name","subscribe","use_gosa_announce","get_started","problems_encountered","features_used",
                           "first_use","use_since","distribution","web_server","php_version","ldap_server","object_count","want_to_see_next");
   
@@ -123,7 +123,6 @@ class Step_Feedback  extends setup_step
     }
 
     $additional_info ="";
-
     if(isset($_POST['send_feedback'])){
 
       $msgs = $this->check_feedback();
@@ -147,7 +146,7 @@ class Step_Feedback  extends setup_step
           if(!preg_match("/successful/i",$ret_value)){
             msg_dialog::display(_("Feedback error"), _("Cannot send feedback: service temporarily unavailable"), ERROR_DIALOG);
           }else{
-            $additional_info = "<font color='green'>"._("Feedback sucessfully send")."</font>";
+            $this->feedback_send = TRUE;
           }
         }
         @fclose($ret);
@@ -165,6 +164,7 @@ class Step_Feedback  extends setup_step
     foreach($this->attributes as $attr){
       $smarty->assign($attr,   reverse_html_entities($this->$attr));
     }
+    $smarty->assign("feedback_send",$this->feedback_send);
     $smarty->assign("years",$years);
     $smarty->assign("features_used",$this->features_used);
     $smarty->assign("additional_info", reverse_html_entities($additional_info));
@@ -176,7 +176,7 @@ class Step_Feedback  extends setup_step
   function check_feedback()
   {
     $msgs = array();
-    if(!tests::is_email($this->eMail) || empty($this->eMail)){
+    if($this->subscribe && (!tests::is_email($this->eMail) || empty($this->eMail))){
       $msgs[] = _("Please specify a valid email address.");
     }
 
index 20fae54e6fad93b7b63ad37d2b86ad4d280d79b9..eb326bad09e61eed256ea5b6350a4c71ec3693dd 100644 (file)
@@ -1,3 +1,12 @@
+
+{if $feedback_send}
+
+       <div class='default' style='margin:12px; '>  
+               <font color='green'>{t}Feedback sucessfully send{/t}</font>
+       </div>  
+
+{else}
+       
 <div class='default' style='margin:12px; '>  
 
        <h2>{$additional_info}</h2>
        </table>
 </div>
 <input type='submit' name='send_feedback' value='{t}Send feedback{/t}'>
+{/if}
 <input type='hidden' name='step_feedback' value='1'>