Update commonobject.class.php

This commit is contained in:
Laurent Destailleur 2018-12-14 11:01:27 +01:00 committed by GitHub
parent f0d8a5da9a
commit 42de7da334
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5799,11 +5799,14 @@ 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.='<a class="butActionNew" href="'.$url_path.'?action=create&backtopage='.$_SERVER['PHP_SELF'].'"><span class="fa fa-plus-circle valignmiddle"></span></a>';
//TODO Add Javascript code to add input fields contents to new elements urls
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
{
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.='<a class="butActionNew" href="'.$url_path.'?action=create&backtopage='.$_SERVER['PHP_SELF'].'"><span class="fa fa-plus-circle valignmiddle"></span></a>';
// TODO Add Javascript code to add input fields contents to new elements urls
}
}
elseif ($type == 'password')
{