From 98727a39fd04db1142790c83d865896051740815 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 25 Jan 2006 06:04:17 +0000 Subject: [PATCH] Some updates git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2557 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/systems/class_glpiManufacturer.inc | 18 +++++++- plugins/admin/systems/glpi.tpl | 44 +++++++++++-------- 2 files changed, 43 insertions(+), 19 deletions(-) diff --git a/plugins/admin/systems/class_glpiManufacturer.inc b/plugins/admin/systems/class_glpiManufacturer.inc index 0c950d366..e7a9b65cb 100644 --- a/plugins/admin/systems/class_glpiManufacturer.inc +++ b/plugins/admin/systems/class_glpiManufacturer.inc @@ -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 */ diff --git a/plugins/admin/systems/glpi.tpl b/plugins/admin/systems/glpi.tpl index 1cf9da4ee..99e72ba8e 100644 --- a/plugins/admin/systems/glpi.tpl +++ b/plugins/admin/systems/glpi.tpl @@ -6,7 +6,7 @@

{t}Generic{/t}

-
{t}System type{/t} + {t}System type{/t} {$tech_num}    - +
-

 

-

{t}Installed devices{/t}

- - - - -
- - -
-

 

- - - +

{t}Contacts{/t}

@@ -83,7 +68,30 @@
+ + + +

 

+ + + +
+

{t}Installed devices{/t}

+ + + + +
+ + +

 

+ + + +

{t}Attachments{/t}

-- 2.30.2