changes to keep track of changed content

This commit is contained in:
Lars Kneschke 2005-02-27 23:33:14 +00:00
parent 8149f57cad
commit f6c2029094
3 changed files with 39 additions and 1 deletions

View File

@ -563,6 +563,11 @@
} }
$id = $this->so->add_entry($fields); $id = $this->so->add_entry($fields);
if(id)
{
$GLOBALS['phpgw']->contenthistory->updateTimeStamp('contacts', $id, 'add', time());
}
if ($this->xmlrpc && !$id) if ($this->xmlrpc && !$id)
{ {
$GLOBALS['server']->xmlrpc_error($GLOBALS['xmlrpcerr']['no_access'],$GLOBALS['xmlrpcstr']['no_access']); $GLOBALS['server']->xmlrpc_error($GLOBALS['xmlrpcerr']['no_access'],$GLOBALS['xmlrpcstr']['no_access']);
@ -589,6 +594,11 @@
$fields = $this->xmlrpc2data($fields); $fields = $this->xmlrpc2data($fields);
} }
$ok = $this->so->update_entry($fields); $ok = $this->so->update_entry($fields);
if(ok)
{
$GLOBALS['phpgw']->contenthistory->updateTimeStamp('contacts', $fields['ab_id'], 'modify', time());
}
} }
if ($this->xmlrpc && !$ok) if ($this->xmlrpc && !$ok)
{ {
@ -617,6 +627,7 @@
if($this->check_perms($id,PHPGW_ACL_DELETE)) if($this->check_perms($id,PHPGW_ACL_DELETE))
{ {
$this->so->delete_entry($id); $this->so->delete_entry($id);
$GLOBALS['phpgw']->contenthistory->updateTimeStamp('contacts', $id, 'delete', time());
} }
elseif ($this->xmlrpc) elseif ($this->xmlrpc)
{ {

View File

@ -603,6 +603,7 @@
if($this->check_perms(PHPGW_ACL_DELETE,$id)) if($this->check_perms(PHPGW_ACL_DELETE,$id))
{ {
$this->so->delete_entry($id); $this->so->delete_entry($id);
$GLOBALS['phpgw']->contenthistory->updateTimeStamp('calendar', $id, 'delete', time());
if ($this->xmlrpc) if ($this->xmlrpc)
{ {
@ -1095,6 +1096,7 @@
{ {
$this->so->add_entry($event); $this->so->add_entry($event);
$this->send_update(MSG_ADDED,$event['participants'],'',$this->get_cached_event()); $this->send_update(MSG_ADDED,$event['participants'],'',$this->get_cached_event());
$GLOBALS['phpgw']->contenthistory->updateTimeStamp('calendar', $event['id'], 'add', time());
print_debug('New Event ID',$event['id']); print_debug('New Event ID',$event['id']);
} }
else else
@ -1117,6 +1119,7 @@
} }
$this->so->cal->event = $event; $this->so->cal->event = $event;
$this->so->add_entry($event); $this->so->add_entry($event);
$GLOBALS['phpgw']->contenthistory->updateTimeStamp('calendar', $event['id'], 'modify', time());
$this->prepare_recipients($new_event,$old_event); $this->prepare_recipients($new_event,$old_event);
} }

View File

@ -279,7 +279,11 @@
$this->link->unlink(0,'infolog',$info_id); $this->link->unlink(0,'infolog',$info_id);
$info = $this->read($info_id);
$this->so->delete($info_id,$delete_children,$new_parent); $this->so->delete($info_id,$delete_children,$new_parent);
$GLOBALS['phpgw']->contenthistory->updateTimeStamp('infolog_'.$info['info_type'], $info_id, 'delete', time());
} }
/** /**
@ -379,7 +383,27 @@
{ {
if ($values[$time]) $values[$time] -= $this->tz_offset_s; if ($values[$time]) $values[$time] -= $this->tz_offset_s;
} }
return $this->so->write($values); if($infoID = $this->so->write($values))
{
if($values['info_id'])
{
// update
$GLOBALS['phpgw']->contenthistory->updateTimeStamp(
'infolog_'.$values['info_type'],
$infoID, 'modify', time()
);
}
else
{
// add
$GLOBALS['phpgw']->contenthistory->updateTimeStamp(
'infolog_'.$values['info_type'],
$infoID, 'add', time()
);
}
}
return $infoID;
} }
function anzSubs( $info_id ) function anzSubs( $info_id )