From 7d25311ce57a9835c8b1577a393acb603a539fab Mon Sep 17 00:00:00 2001 From: Abbes Bahfir Date: Mon, 8 Oct 2018 10:53:36 +0100 Subject: [PATCH] New : Link to create new element on linked fields --- htdocs/core/class/commonobject.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a11cd3dd49e..0f07feda680 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5799,6 +5799,10 @@ abstract class CommonObject $param_list=array_keys($param['options']); // $param_list='ObjectName:classPath' $showempty=(($required && $default != '')?0:1); $out=$form->selectForForms($param_list[0], $keyprefix.$key.$keysuffix, $value, $showempty); + list($class,$classfile)=explode(':',$param_list[0]); + if(file_exists(dol_buildpath(dirname(dirname($classfile)).'/card.php')))$url_path=dol_buildpath(dirname(dirname($classfile)).'/card.php',1); + else $url_path=dol_buildpath(dirname(dirname($classfile)).'/'.$class.'_card.php',1); + $out.=''; } elseif ($type == 'password') {