From 6c008c9f0f51ba69b770fb06ac8e503c4e451058 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 25 Jan 2006 09:55:28 +0000 Subject: [PATCH] Some cosmetic changes git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2577 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/class_glpiPrinterCartridges.inc | 18 +++++++++++++----- .../admin/systems/glpiPrinterCartridges.tpl | 12 ++++++------ 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/plugins/admin/systems/class_glpiPrinterCartridges.inc b/plugins/admin/systems/class_glpiPrinterCartridges.inc index 0276ce1e2..4f31fdfa5 100644 --- a/plugins/admin/systems/class_glpiPrinterCartridges.inc +++ b/plugins/admin/systems/class_glpiPrinterCartridges.inc @@ -104,8 +104,16 @@ class glpiPrinterCartridges extends plugin /* Delete this entry */ if(isset($_POST['delete_glpi_confirm'])&&($this->del)) { - if(count($this->parent->handle->getCartridgesWhichUseThisType($this->del))){ - print_red(_("You can't delete this cartridge type, it is still in use.")); + $tmp = $this->parent->handle->is_cartridgeTypeUsed($this->del); + if(count($tmp)){ + + $str = ""; + foreach($tmp as $id => $name){ + $str .= $name.", "; + } + $str = preg_replace("/, $/","",$str); + + print_red(sprintf(_("You can't delete this cartridge type, it is still in use by this printer(s) '%s'."),$str)); }else{ $val = ($this->parent->handle->getCartridgeTypeInformations($this->del)); $this->cur_dialog = new glpiPrinterCartridgesEdit($this->config,$this->dn,$this->PrinterType,$val[$this->del]); @@ -122,12 +130,12 @@ class glpiPrinterCartridges extends plugin /* Save changes if check is ok */ if(isset($_POST['SaveCartridge'])){ + $this->cur_dialog->save_object(); if(count($this->cur_dialog->check())) { foreach($this->cur_dialog->check() as $checks){ print_red($checks); } }else{ - $this->cur_dialog->save_object(); $this->cur_dialog->save(); $this->cur_dialog = false; } @@ -209,8 +217,8 @@ class glpiPrinterCartridges extends plugin $smarty->assign("search_image", get_template_path('images/search.png')); $smarty->assign("searchu_image", get_template_path('images/search_user.png')); $smarty->assign("tree_image", get_template_path('images/tree.png')); - $smarty->assign("infoimage", get_template_path('images/info.png')); - $smarty->assign("launchimage", get_template_path('images/launch.png')); + $smarty->assign("infoimage", get_template_path('images/info_small.png')); + $smarty->assign("launchimage", get_template_path('images/small_filter.png')); $smarty->assign("apply", apply_filter()); $smarty->assign("alphabet", generate_alphabet()); $smarty->assign("cartridge_regex", $filter); diff --git a/plugins/admin/systems/glpiPrinterCartridges.tpl b/plugins/admin/systems/glpiPrinterCartridges.tpl index d1cea4997..334b62b64 100644 --- a/plugins/admin/systems/glpiPrinterCartridges.tpl +++ b/plugins/admin/systems/glpiPrinterCartridges.tpl @@ -1,8 +1,8 @@
-
-

+

+

{t}List of available cartridge type for this type of printer{/t}

@@ -16,8 +16,8 @@
-
-

[i]{t}Information{/t}

+
+

[i]{t}Information{/t}

@@ -25,8 +25,8 @@


-
-

[F]{t}Filters{/t}

+
+

[F]{t}Filters{/t}

-- 2.30.2