From 8d83447222933219b69ae1fbf0b5feade1b1ab94 Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Fri, 28 Oct 2011 12:46:22 +0000 Subject: [PATCH] Added the capability for plug-ins to "listen" to add/remove attachment events. SVN:1.2[1652] --- modules/itop-attachments/model.attachments.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/itop-attachments/model.attachments.php b/modules/itop-attachments/model.attachments.php index d89a689a7..8b6835624 100644 --- a/modules/itop-attachments/model.attachments.php +++ b/modules/itop-attachments/model.attachments.php @@ -389,6 +389,7 @@ EOF { $('#attachment_'+att_id).attr('name', 'removed_attachments[]'); $('#display_attachment_'+att_id).hide(); + $('#attachment_plugin').trigger('remove_attachment', [att_id]); return false; // Do not submit the form ! } function ajaxFileUpload() @@ -433,6 +434,8 @@ EOF { $('#display_attachment_'+data.att_id).hover( function() { $(this).children(':button').toggleClass('btn_hidden'); } ); } + $('#attachment_plugin').trigger('add_attachment', [data.att_id, data.msg]); + //alert(data.msg); } } @@ -465,6 +468,7 @@ EOF $oPage->p(Dict::S('Attachments:AddAttachment').' '.$sMaxUpload); //$oPage->p(''); $oPage->p(''); + $oPage->p(''); $oPage->add(''); if ($this->m_bDeleteEnabled) {