Code

Some updates
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 25 Jan 2006 06:04:17 +0000 (06:04 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 25 Jan 2006 06:04:17 +0000 (06:04 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2557 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_glpiManufacturer.inc
plugins/admin/systems/glpi.tpl

index 0c950d366a2837c35bbfc09f4249a9aa35564d9a..e7a9b65cb7a1a4bdb7cf227d2ebcde095f8a18a3 100644 (file)
@@ -42,7 +42,23 @@ class glpiManufacturer extends plugin
 
     /* Remove enterprise from db */
     if((isset($_POST['remove_manu']))&&(isset($_POST['manufacturer']))){
-      $this->parent->handle->removeEnterprise($_POST['manufacturer']);
+
+      $tmp = $this->parent->handle->is_manufacturerUsed($_POST['manufacturer']);
+      if(count($tmp)){
+
+        $names = "";
+        foreach($tmp as $name){
+          $names .= ", ".$name;
+        }
+        $names = preg_replace("/^, /","",$names);
+        $names = trim($names);
+        if(count($tmp) == 3){
+          $names .= " ...";
+        }
+        print_red(sprintf(_("You can't delete this manufacturer, it is still in use by these system(s) '%s'"),$names));
+      }else{
+        //$this->parent->handle->removeEnterprise($_POST['manufacturer']);
+      }
     }
 
     /* Add new Manufactuer : Open dialog with empty fields */
index 1cf9da4ee2addc1a2590a31453c435ccc748ccf2..99e72ba8ea7158ef55967d92c6615ba7559601fb 100644 (file)
@@ -6,7 +6,7 @@
                        <h2>{t}Generic{/t}</h2>
                        <table summary="" cellpadding=5>
                                <tr>
-                                       <td width="150">{t}System type{/t}
+                                       <td >{t}System type{/t}
                                        </td>
                                        <td>
                                                <select name="type" {$typeACL}>
                                        </td>
                                        <td>
                                                <i>{$tech_num}&nbsp; </i>&nbsp;
-                                               <input type="submit" value="{t}Choose{/t}" name="SelectTechPerson" {$tech_numACL}>
+                                               <input type="submit" value="{t}Edit{/t}" name="SelectTechPerson" {$tech_numACL}>
                                        </td>
                                </tr>
                        </table>
-                       <p class="seperator" >&nbsp;</p>
-                       <h2>{t}Installed devices{/t}</h2>
-                       <table summary="" width="100%"> 
-                               <tr>
-                                       <td>
-                                               <select name="InstalledDevices" {$InstalledDevicesACL} style="height:120px;width:100%;" multiple>
-                                                       {html_options values=$InstalledDeviceKeys output=$InstalledDevices}
-                                               </select>
-                                               <input name="AddDevice" value="{t}Edit{/t}" type="submit" {$InstalledDevicesACL}>       
-                                       </td>
-                               </tr>
-                       </table>
-                       <p class="seperator" >&nbsp;</p>
-                       <input type="submit" value="{t}Trading{/t}" name="Trading">     
-                       <input type="submit" value="{t}Software{/t}" name="Software">   
-                       <input type="submit" value="{t}Contracts{/t}" name="Contracts"> 
                </td>
                <td style="border-left: 1px solid rgb(160, 160, 160); vertical-align: top; padding-right: 5px;">
+
                        <!--Upper right-->
                        <h2>{t}Contacts{/t}</h2>
                        <table summary="" width="100%">
                                        </td>
                                </tr>
                        </table>
+               </td>
+       </tr>
+</table>
+<p class="seperator" >&nbsp;</p>
+<table summary="" style="width:100%;">
+       <tr>
+               <td style="width:50%;">
+                       <h2>{t}Installed devices{/t}</h2>
+                       <table summary="" width="100%"> 
+                               <tr>
+                                       <td>
+                                               <select name="InstalledDevices" {$InstalledDevicesACL} style="height:120px;width:100%;" multiple>
+                                                       {html_options values=$InstalledDeviceKeys output=$InstalledDevices}
+                                               </select>
+                                               <input name="AddDevice" value="{t}Edit{/t}" type="submit" {$InstalledDevicesACL}>       
+                                       </td>
+                               </tr>
+                       </table>
                        <p class="seperator" >&nbsp;</p>
+                       <input type="submit" value="{t}Trading{/t}" name="Trading">     
+                       <input type="submit" value="{t}Software{/t}" name="Software">   
+                       <input type="submit" value="{t}Contracts{/t}" name="Contracts"> 
+               </td>
+               <td style="border-left: 1px solid rgb(160, 160, 160); vertical-align: top; padding-right: 5px;">
                        <h2>{t}Attachments{/t}</h2>
                        <table summary="" width="100%"> 
                                <tr>