Code

Updated manufacturer handling
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 25 Jan 2006 07:39:08 +0000 (07:39 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 25 Jan 2006 07:39:08 +0000 (07:39 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2564 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_glpiManufacturer.inc
plugins/admin/systems/glpiManufacturer.tpl
plugins/admin/systems/glpiManufacturerAdd.tpl

index e7a9b65cb7a1a4bdb7cf227d2ebcde095f8a18a3..b021060e48575ee8db996683ac5908ed6f0e6999 100644 (file)
@@ -105,6 +105,21 @@ class glpiManufacturer extends plugin
         $allok = false;
       }
 
+      $attr = $this->parent->handle->getEnterprises();
+
+      if($this->ID == -1 ){
+        if(in_array($tmp['name'],$attr)){
+          $allok = false;
+          print_red(_("Specified name is already in use, please choose another one."));
+        }
+      }else{
+        unset($attr[$this->ID]);
+        if(in_array($tmp['name'],$attr)){
+          $allok = false;
+          print_red(_("Specified name is already in use, please choose another one."));
+        }
+      }
+
       /* all checks are ok , so save changes */
       if($allok){
         if($this->Edit_Add == "add"){
index df6469c9c4bccfc4cb8fdb0640722898160c8422..e422ec2e2115d8077473b3909e7914a480e48187 100644 (file)
@@ -1,5 +1,5 @@
 <br>
-<select name="manufacturer" style="width:600px;" size="8">
+<select name="manufacturer" style="width:100%;" size="12">
   {html_options values=$ManuKeys output=$Manus}
 </select>
 <br>
index f31c6d639fd00c39674ceb231c56b26c11a393da..204578114d4ce1a4f55a0815b5cebb7633a3310e 100644 (file)
@@ -9,13 +9,6 @@
                                                <input type="text" name="name" value="{$name}">
                                        </td>
                                </tr>
-<!--                           <tr>
-                                       <td>{t}Type{/t}
-                                       </td>
-                                       <td>
-                                               <input type="text" name="type" value="{$type}">
-                                       </td>
-                               </tr>-->
                                <tr>
                                        <td>{t}Website{/t}
                                        </td>