X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fadmin%2Fsystems%2Fclass_glpiAttachmentPool.inc;h=fcfa664a12fd3b9e09d21b4ad582be16f32d269a;hb=d77692031a0b3343cb7306f9bdd449208291eb17;hp=853d2190ef640b40f389c8307290dce48735ed0c;hpb=704e9727a48d7451a8810c274f38a2e5038428d4;p=gosa.git diff --git a/plugins/admin/systems/class_glpiAttachmentPool.inc b/plugins/admin/systems/class_glpiAttachmentPool.inc index 853d2190e..fcfa664a1 100644 --- a/plugins/admin/systems/class_glpiAttachmentPool.inc +++ b/plugins/admin/systems/class_glpiAttachmentPool.inc @@ -23,6 +23,8 @@ class glpiAttachmentPool extends plugin var $Selected = array(); + var $delAttach= ""; + function glpiAttachmentPool ($config, $dn= NULL,$used=NULL) { plugin::plugin ($config, $dn); @@ -67,9 +69,11 @@ class glpiAttachmentPool extends plugin $str = base64_decode(preg_replace("/_.*$/","",$str)); /* remove attach from db */ - $this->parent->handle->deleteAttachment($str); + $this->delAttach = $str; + $smarty->assign("warning", sprintf(_("You're about to delete the glpi attachment component '%s'."), $attach[$str]['name'])); + return($smarty->fetch(get_template_path('remove_glpi.tpl', TRUE))); } - + /* Start editing entry */ if((preg_match("/^editAttach_/",$name))&&($only_once)){ $only_once = false; @@ -92,6 +96,11 @@ class glpiAttachmentPool extends plugin } } + if((isset($_POST['delete_glpi_confirm']))&&(isset($attach[$this->delAttach]))){ + $this->parent->handle->deleteAttachment($this->delAttach); + $attach = $this->parent->handle->getAttachments(); + } + /* Someone tries to upload a file */ if(($this->edit == true)&&(isset($_POST['upload']))){ if(!isset($_FILES['filename'])){ @@ -229,7 +238,6 @@ class glpiAttachmentPool extends plugin name='new_attach' alt='"._("New Attachment"). "'> ". ""; - $smarty->assign("attachments", $divlist->DrawList()); $smarty->assign("attachmenthead", $listhead); $smarty->assign("search_image", get_template_path('images/search.png')); @@ -241,7 +249,6 @@ class glpiAttachmentPool extends plugin $smarty->assign("alphabet", generate_alphabet()); $smarty->assign("attachment_regex", $_SESSION['GlpiAttachmentFilter']['filter']); - $display.= $smarty->fetch(get_template_path('glpiAttachmentPool.tpl', TRUE)); return($display); }