Code

Description is no longer *must
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 4 Oct 2005 11:57:42 +0000 (11:57 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 4 Oct 2005 11:57:42 +0000 (11:57 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1465 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/fai/class_faiPartitionTable.inc
plugins/admin/fai/class_faiPartitionTableEntry.inc
plugins/admin/fai/faiPartitionTable.tpl
plugins/admin/fai/faiPartitionTableEntry.tpl

index d5feaa4df0e61ba95efc425c845f416320d6a0c0..e00bacd6e133f24d90a3f74bc94067a4b1140c15 100644 (file)
@@ -254,7 +254,7 @@ class faiPartitionTable 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.");
     }
 
@@ -313,14 +313,20 @@ class faiPartitionTable extends plugin
       $disk_attrs['cn']           =  $disk['cn'];
       $disk_attrs['description']  =  $disk['description']; 
       $disk_attrs['objectClass']  =  array("top","FAIclass","FAIpartitionDisk");
-  
       if($disk['status'] == "delete"){
         $ldap->cd($disk_dn);
         $ldap->rmdir_recursive($disk_dn);
       }elseif($disk['status']== "edited"){
+        if(empty($disk_attrs['description'])){
+          $disk_attrs['description']=array();
+        }
         $ldap->cd($disk_dn);
         $ldap->modify($disk_attrs);
       }elseif($disk['status']== "new"){
+        if(empty($disk_attrs['description'])){
+          unset($disk_attrs['description']);
+        }
         $ldap->cd($this->config->current['BASE']);
         $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $disk_dn));
         $ldap->cd($disk_dn);
@@ -354,11 +360,17 @@ class faiPartitionTable extends plugin
           $ldap->cd($partition_dn);
           $ldap->rmdir_recursive($partition_dn);
         }elseif($partition['status'] == "new"){
+          if(empty($partition_attrs['description'])){
+            unset($partition_attrs['description']);
+          }
           $ldap->cd($this->config->current['BASE']);
           $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $partition_dn));
           $ldap->cd($partition_dn);
           $ldap->add($partition_attrs);
         }elseif($partition['status'] == "edited"){
+          if(empty($partition_attrs['description'])){
+            $partition_attrs['description']=array();
+          }
           $ldap->cd($partition_dn);
           $ldap->modify($partition_attrs);
         } 
index 64c716be4dd88e6f3274609f8957e33a10e7b65e..278b498f634ce95722b27f984787f97df380397b 100644 (file)
@@ -299,12 +299,6 @@ class faiPartitionTableEntry extends plugin
   {
     $message= array();
    
-    /* Check descriptions 
-     */ 
-    if(empty($this->DISK_description)){
-      $message[] = _("Please enter a description for your disk.");
-    }
-
     /* check every partition.
      * if there is an invalid value defined, append an errorstr to message
      */
index b8150b892038c798a446da3af6298df971b08e1d..8aae468e9224cdfc1b9f0c35e170166a06484b0f 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 a03dddca20488a71d2a2e6ffc05d7131f98d3aba..cd754c4022c5d39e512dbe28aefc417ae8659d3a 100644 (file)
@@ -9,7 +9,7 @@
                </td>
                <td><LABEL for="DISK_description">
                        &nbsp;{t}Description{/t}
-                       </LABEL>{$must}&nbsp;
+                       </LABEL>&nbsp;
                        <input value="{$DISK_description}" size=50 name="DISK_description" id="DISK_description">
                </td>
        </tr>