From 8be41b79763273b6f164731c58bfd38801b28de1 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 27 Sep 2010 19:18:21 +0000 Subject: [PATCH] When deleting but keeping infolog entries, hold on to links as well so they can be restored if contact is restored --- infolog/inc/class.infolog_bo.inc.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/infolog/inc/class.infolog_bo.inc.php b/infolog/inc/class.infolog_bo.inc.php index fe40af292f..658757b30a 100644 --- a/infolog/inc/class.infolog_bo.inc.php +++ b/infolog/inc/class.infolog_bo.inc.php @@ -626,7 +626,7 @@ class infolog_bo $this->so->write($deleted); - egw_link::unlink(0,'infolog',$info_id,'','!file'); // keep the file attachments, only delete the rest + egw_link::unlink(0,'infolog',$info_id,'','!file','',true); // keep the file attachments, hide the rest } else { @@ -875,6 +875,12 @@ class infolog_bo // create (and remove) links in custom fields customfields_widget::update_customfield_links('infolog',$values,$old,'info_id'); + // Check for restore of deleted entry, restore held links + if($old['info_status'] == 'deleted' && $values['info_status'] != 'deleted') + { + egw_link::restore('infolog', $info_id); + } + // notify the link-class about the update, as other apps may be subscribt to it egw_link::notify_update('infolog',$info_id,$values);