* InfoLog: fixed not able to remove already selected project

This commit is contained in:
Ralf Becker 2015-03-10 11:31:40 +00:00
parent 0e4cb1bdb6
commit e59fecc0e7
2 changed files with 14 additions and 4 deletions

View File

@ -1702,14 +1702,24 @@ class infolog_ui
}
$content['info_link_id'] = (int)($info_link_id = egw_link::link('infolog',$content['link_to']['to_id'],$app,$id));
}
else
{
unset($content['info_link_id']);
}
if ($old_link_id && $old_link_id != $content['info_link_id'])
{
$link = egw_link::get_link($old_link_id);
// Keep projectmanager link if it's the same project as before
if(!($link['link_app2'] == 'projectmanager' && $link['link_id2'] == $content['old_pm_id']))
// remove selected project, if removed link is that project
if($link['link_app2'] == 'projectmanager' && $link['link_id2'] == $content['old_pm_id'])
{
egw_link::unlink($old_link_id);
unset($content['pm_id'], $content['old_pm_id']);
}
egw_link::unlink($old_link_id);
}
// if added link is a project and no other project selected, also add as project
if ($app == 'projectmanager' && $id && !$content['pm_id'])
{
$content['old_pm_id'] = $content['pm_id'] = $id;
}
}
if (is_array($content['link_to']['to_id']) && count($content['link_to']['to_id']))

View File

@ -41,7 +41,7 @@
</row>
<row class="row">
<description value="Project"/>
<link-entry id="pm_id" onchange="1" only_app='projectmanager' blur='None' class="infolog_projectName"/>
<link-entry id="pm_id" only_app='projectmanager' blur='None' class="infolog_projectName"/>
</row>
<row class="row">
<description value="Price"/>