Code

Removed must tag from description field
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 4 Oct 2005 12:16:43 +0000 (12:16 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 4 Oct 2005 12:16:43 +0000 (12:16 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1467 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/fai/class_faiTemplate.inc
plugins/admin/fai/class_faiTemplateEntry.inc
plugins/admin/fai/faiProfile.tpl
plugins/admin/fai/faiTemplate.tpl
plugins/admin/fai/faiTemplateEntry.tpl

index 30bd188c5334ed5366824019a2ce022a0843134d..6792e36a265b76785cf6c2d3af4d05d2746070eb 100644 (file)
@@ -194,7 +194,7 @@ class faiTemplate 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);
@@ -264,6 +264,10 @@ class faiTemplate 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('/^[^,]+,/', '', $sub_dn));
         $ldap->cd($sub_dn);
index 24d8d821bb74acdcf8d31640c541617e1741945c..4476c548505e5bede0641538d35952fff0dae1f3 100644 (file)
@@ -83,10 +83,6 @@ class faiTemplateEntry extends plugin
   
     $str = utf8_encode("üöä");
 
-    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 7eec2e8b6799e16b3c8f10a7354022b560dbd728..b38b3377ac33e99403ce9057878808d270d122ea 100644 (file)
@@ -13,7 +13,7 @@
        <tr>
                <td>
                        <LABEL for="description">
-                       {t}Description{/t}{$must}
+                       {t}Description{/t}
                        </LABEL>
                </td>
                <td>
index b22bc910210350ce4ca579cc990a9ed36c69b3a3..ed3d004cd258a50e5747cb7af69d25397997ea47 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 e0fda071b049fd07aa790c8f10700e982bb26b8a..e7ef3a72144e9e4c8efe4175ca90f5ad3e92d8e2 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">