small enhancement to keep the attachments, 'til the infolog entry gets finally deleted

This commit is contained in:
Ralf Becker 2007-06-14 06:16:19 +00:00
parent 3e34a63035
commit 04ba662494
2 changed files with 7 additions and 5 deletions

View File

@ -540,15 +540,17 @@ class boinfolog
if ($info['info_status'] == 'deleted') return false; // entry already deleted if ($info['info_status'] == 'deleted') return false; // entry already deleted
$this->so->write($deleted); $this->so->write($deleted);
$this->link->unlink(0,'infolog',$info_id,'','!file'); // keep the file attachments, only delete the rest
} }
else else
{ {
$this->so->delete($info_id,false); // we delete the children via bo to get all notifications! $this->so->delete($info_id,false); // we delete the children via bo to get all notifications!
$this->link->unlink(0,'infolog',$info_id);
} }
if ($info['info_status'] != 'deleted') // dont notify of final purge of already deleted items if ($info['info_status'] != 'deleted') // dont notify of final purge of already deleted items
{ {
$this->link->unlink(0,'infolog',$info_id);
$GLOBALS['egw']->contenthistory->updateTimeStamp('infolog_'.$info['info_type'], $info_id, 'delete', time()); $GLOBALS['egw']->contenthistory->updateTimeStamp('infolog_'.$info['info_type'], $info_id, 'delete', time());
// send email notifications and do the history logging // send email notifications and do the history logging

View File

@ -357,7 +357,7 @@ class bolink extends solink
* @param $link_id link-id to remove if > 0 * @param $link_id link-id to remove if > 0
* @param string $app='' appname of first endpoint * @param string $app='' appname of first endpoint
* @param string/array &$id='' id in $app or array with links, if 1. entry not yet created * @param string/array &$id='' id in $app or array with links, if 1. entry not yet created
* @param string $app2='' app of second endpoint * @param string $app2='' app of second endpoint, or !file (other !app are not yet supported!)
* @param string $id2='' id in $app2 * @param string $id2='' id in $app2
* @return the number of links deleted * @return the number of links deleted
*/ */
@ -381,12 +381,12 @@ class bolink extends solink
} }
if (!is_array($id)) if (!is_array($id))
{ {
if (!$link_id && !$app2 && !$id2) if (!$link_id && !$app2 && !$id2 && $app2 != '!'.$this->vfs_appname)
{ {
$this->delete_attached($app,$id); // deleting all attachments $this->delete_attached($app,$id); // deleting all attachments
unset($this->title_cache[$app.':'.$id]); unset($this->title_cache[$app.':'.$id]);
} }
$deleted =& solink::unlink($link_id,$app,$id,$owner,$app2,$id2); $deleted =& solink::unlink($link_id,$app,$id,$owner,$app2 != '!'.$this->vfs_appname ? $app2 : '',$id2);
// only notify on real links, not the one cached for writing or fileattachments // only notify on real links, not the one cached for writing or fileattachments
$this->notify_unlink($deleted); $this->notify_unlink($deleted);