Skip to content
Snippets Groups Projects
Commit 99ceb006 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

FIX Bad include and param for project numbering module call

parent 660f825a
No related branches found
No related tags found
No related merge requests found
......@@ -1140,14 +1140,21 @@ class Project extends CommonObject
//Generate next ref
$defaultref='';
$obj = empty($conf->global->PROJECT_ADDON)?'mod_project_simple':$conf->global->PROJECT_ADDON;
if (! empty($conf->global->PROJECT_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/project/".$conf->global->PROJECT_ADDON.".php"))
// Search template files
$file=''; $classname=''; $filefound=0;
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
foreach($dirmodels as $reldir)
{
require_once DOL_DOCUMENT_ROOT ."/core/modules/project/".$conf->global->PROJECT_ADDON.'.php';
$modProject = new $obj;
$defaultref = $modProject->getNextValue(is_object($clone_project->thirdparty)?$clone_project->thirdparty->id:0,$clone_project);
$file=dol_buildpath($reldir."core/modules/project/".$obj.'.php',0);
if (file_exists($file))
{
$filefound=1;
dol_include_once($reldir."core/modules/project/".$obj.'.php');
$modProject = new $obj;
$defaultref = $modProject->getNextValue(is_object($clone_project->thirdparty)?$clone_project->thirdparty:null, $clone_project);
break;
}
}
if (is_numeric($defaultref) && $defaultref <= 0) $defaultref='';
$clone_project->ref=$defaultref;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment