mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-21 23:43:17 +01:00
Update infolog & projectmanager on client when you add a timesheet entry
This commit is contained in:
parent
b55da481e3
commit
a0065835a6
@ -11,6 +11,7 @@
|
||||
*/
|
||||
|
||||
use EGroupware\Api;
|
||||
use EGroupware\Api\Hooks;
|
||||
use EGroupware\Api\Link;
|
||||
use EGroupware\Api\Framework;
|
||||
use EGroupware\Api\Egw;
|
||||
@ -72,11 +73,41 @@ class infolog_hooks
|
||||
),
|
||||
'edit_id' => 'info_id',
|
||||
'edit_popup' => '760x570',
|
||||
'notify' => self::class.'::link_notify',
|
||||
'merge' => true,
|
||||
'push_data' => self::class.'::prepareEventPush'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get notified about changes to linked entries
|
||||
*
|
||||
* 'type' => $type,
|
||||
* 'id' => $notify_id,
|
||||
* 'target_app' => $target_app,
|
||||
* 'target_id' => $target_id,
|
||||
* 'link_id' => $link_id,
|
||||
* 'data' => $data,
|
||||
*/
|
||||
static public function link_notify($data)
|
||||
{
|
||||
switch($data['target_app'])
|
||||
{
|
||||
case 'timesheet':
|
||||
// Something changed with a timesheet linked to an infolog. Trigger update in place to update times.
|
||||
$bo = new infolog_bo();
|
||||
$push_data = $bo->read($data['id']);
|
||||
Hooks::process([
|
||||
'location' => 'notify-all',
|
||||
'type' => 'update-in-place',
|
||||
'app' => 'infolog',
|
||||
'id' => $data['id'],
|
||||
'data' => $push_data,
|
||||
], null, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare entry to be pushed via Link::notify_update()
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user