Code

removed description *must
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 4 Oct 2005 12:06:02 +0000 (12:06 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 4 Oct 2005 12:06:02 +0000 (12:06 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1466 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/fai/class_faiScript.inc
plugins/admin/fai/class_faiScriptEntry.inc
plugins/admin/fai/faiScript.tpl
plugins/admin/fai/faiScriptEntry.tpl

index 8e4513d7fb97d82c06bc5cb96335cc386d744d6f..e3ee13884290e442b9094a2fcdab36c4212efe2d 100644 (file)
@@ -159,7 +159,11 @@ class faiScript extends plugin
     $a_return=array();
     foreach($this->SubObjects as $obj){
       if($obj['status'] != "delete"){
-        $a_return[$obj['cn']]= $obj['cn']." [".$obj['description']."]";
+        if((isset($obj['description']))&&(!empty($obj['description']))){
+          $a_return[$obj['cn']]= $obj['cn']." [".$obj['description']."]";
+        }else{
+          $a_return[$obj['cn']]= $obj['cn'];
+        }
       }
     }
     return($a_return);
@@ -194,7 +198,7 @@ class faiScript extends plugin
   {
     $message= array();
     $str = utf8_encode("üöä");
-    if((empty($this->description))||(preg_match("/[^a-z0-9".$str."\.,;:\-_\? ]/i",$this->description))){
+    if(preg_match("/[^a-z0-9".$str."\.,;:\-_\? ]/i",$this->description)){
       $message[]=_("Please enter a valid description.");
     }
     return ($message);
@@ -266,6 +270,9 @@ class faiScript extends plugin
         $ldap->modify($tmp);
         $this->handle_post_events("modify");
       }elseif($obj['status']=="new"){
+        if($tmp['description']==array()){
+          unset($tmp['description']);
+        }
         $ldap->cd($this->config->current['BASE']);
         $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
         $ldap->cd($sub_dn);
index 903230055977e3de746c576b549f0be8bc5e72ca..ebaf792f41f74a5d3b5c7e6cc233e2f2d2781b1f 100644 (file)
@@ -94,10 +94,6 @@ class faiScriptEntry extends plugin
       $message[]=_("Please specify a script.");
     }
     
-    if(empty($this->Object_description)){
-      $message[] = _("Please enter a description.");
-    }
-
     if(preg_match("/[^a-z0-9".$str."\.,;:\-_\? ]/i",$this->Object_description)){
       $message[] = _("Invalid character in description. Please enter a valid description.");
     }
index 23345a41627b7537d5f0ecaf661e1e38595a8d4e..7896626c7f0e3e344c1d87db8dd671d2544a5ff5 100644 (file)
@@ -6,7 +6,7 @@
                                        <tr>
                                                <td>
                                                        <LABEL for="cn">
-                                                       {t}Name{/t}
+                                                       {t}Name{/t}{$must}
                                                        </LABEL>
                                                </td>
                                                <td>
@@ -16,7 +16,7 @@
                                        <tr>
                                                <td>
                                                        <LABEL for="description">
-                                                       {t}Description{/t}{$must}
+                                                       {t}Description{/t}
                                                        </LABEL>
                                                </td>
                                                <td>
index a410994a4982c33dcb350a337db8ab7c6d63ee41..7f6b7ada08836ab4b1afe7b899c36f31797bc082 100644 (file)
@@ -14,7 +14,7 @@
                                        </tr>
                                        <tr>
                                                <td>
-                                                       {t}Description{/t}{$must}&nbsp;
+                                                       {t}Description{/t}&nbsp;
                                                </td>
                                                <td>
                                                        <input size=40 value="{$Object_description}" name="Object_description">