If user selected an entry to link to, but didn't click 'Link' button, link anyway on save.

This commit is contained in:
Nathan Gray 2014-02-24 20:26:26 +00:00
parent 7a35d59f65
commit cd3387448a

View File

@ -260,6 +260,15 @@ class etemplate_widget_link extends etemplate_widget
{
$value = $value_in =& self::get_array($content, $form_name);
// Automatically do link if user selected entry but didn't click 'Link' button
$link = self::get_array($content, self::form_name($cname, $this->id . '_link_entry'));
if($this->type =='link-to' && is_array($link) && $link['app'] && $link['id'] &&
is_array($value) && $value['to_id']
)
{
$result = egw_link::link($value['to_app'], $value['to_id'], $link['app'], $link['id']);
}
// Look for files
$files = self::get_array($content, self::form_name($cname, $this->id . '_file'));
if(is_array($files) && !(is_array($value) && $value['to_id']))