mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-25 01:13:25 +01:00
Timesheet - Fix another place where Save & New then changing the project keeps the old project
This commit is contained in:
parent
bd595469ab
commit
27922446d7
@ -606,9 +606,15 @@ class timesheet_bo extends Api\Storage
|
||||
return false;
|
||||
}
|
||||
// Update ts_project to match project
|
||||
if ($this->pm_integration == 'full' && $old && $old['pm_id'] != $new['pm_id'])
|
||||
if ($this->pm_integration == 'full' && (
|
||||
!$old && $this->data['pm_id'] != $this->data['old_pm_id'] || $old && $old['pm_id'] != $new['pm_id']
|
||||
))
|
||||
{
|
||||
$new['ts_title'] = $new['pm_id'] ? Link::title('projectmanager', $new['pm_id']) : '';
|
||||
$this->data['ts_project'] = $this->data['pm_id'] ? Link::title('projectmanager', $this->data['pm_id']) : '';
|
||||
if($this->data['ts_title'] == Link::title('projectmanager', $old['pm_id']))
|
||||
{
|
||||
$this->data['ts_title'] = $this->data['ts_project'];
|
||||
}
|
||||
}
|
||||
|
||||
// Check for restore of deleted contact, restore held links
|
||||
|
@ -291,6 +291,10 @@ class timesheet_ui extends timesheet_bo
|
||||
}
|
||||
// save the selected project, to delete the project-link, if the user changes the project
|
||||
$this->data['old_pm_id'] = $this->data['pm_id'];
|
||||
if($this->pm_integration == 'none')
|
||||
{
|
||||
unset($this->data['pm_id']);
|
||||
}
|
||||
break;
|
||||
}
|
||||
// fall-through for save
|
||||
|
Loading…
Reference in New Issue
Block a user