Code

Allow "-100324" "12343-" in size field of fai partition table entries.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Jan 2007 11:58:32 +0000 (11:58 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Jan 2007 11:58:32 +0000 (11:58 +0000)
Do not allow spaces within class names.
Remember entered class name in "aslclassname" dialog

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

plugins/admin/fai/askClassName.tpl
plugins/admin/fai/class_askClassName.inc
plugins/admin/fai/class_faiPartitionTableEntry.inc

index 526b6a587a2be3b450d087100ef0cd4d92ce3842..b6a996707a61fcc4dfb4328d4f943b9a35349030 100644 (file)
@@ -29,7 +29,7 @@
    <tr>
      <td>&nbsp;</td>
      <td>
-      {t}Class name{/t}&nbsp;<input type="text"         name="UseTextInputName" value="" style="width:120px;">
+      {t}Class name{/t}&nbsp;<input type="text"         name="UseTextInputName" value="{$ClassName}" style="width:120px;" >
      </td>
     </tr>
    </table>
index 727e46ca6323c56dd31bc052820912aa310e7632..8f745151b89ecafed00a2213cf0a29947c9ec701 100644 (file)
@@ -110,6 +110,7 @@ class askClassName extends plugin
       $smarty->assign("grey", "");
     }
     $smarty->assign("ClassNames", $used);
+    $smarty->assign("ClassName",  $this->ClassName);
     $display.= $smarty->fetch(get_template_path('askClassName.tpl', TRUE));
     return($display);
   }
@@ -137,7 +138,11 @@ class askClassName extends plugin
   {
     /* Call common method to give check the hook */
     $message= plugin::check();
-  
+    if($this->ClassName != preg_replace("/ /","",trim($this->ClassName))){
+      $message[] = _("Spaces are not allowed within class names.");
+    }
     if(empty($this->ClassName)){
       $message[]=_("The given class name is empty.");
     }
index 09d85eafb5a9fdb29afa23ed17c889b50022f4d0..bf177ed3f5a78ac86f8ec062f2220ee82de57d4a 100644 (file)
@@ -393,7 +393,7 @@ class faiPartitionTableEntry extends plugin
                 break;
                 
         case 2:
-                if((!is_id($tmp[0]))||(!is_id($tmp[1]))){
+                if((!is_id($tmp[0]))&&(!is_id($tmp[1]))){
                   $message[]=sprintf(_("Please enter a valid range for partition %s."),($key)); 
                 }elseif($tmp[0]>=$tmp[1]){
                   $message[]=sprintf(_("Please enter a valid range for partition %s."),($key));