diff --git a/plugins/admin/systems/class_glpiPrinterCartridges.inc b/plugins/admin/systems/class_glpiPrinterCartridges.inc
index 0276ce1e2870d7c89dbb2902ddbb396b572696c3..708da0f4f24faaa6f93fd12bdd9ef7da39ee5051 100644 (file)
/* 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]);
/* 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;
}
$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);
*/
function check($attr)
{
- $message = array();
+ /* Call common method to give check the hook */
+ $message= plugin::check();
+
return($message);
}