diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index a34ea519d2a..20137d7c905 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -315,7 +315,7 @@ class modProjet extends DolibarrModules // End add extra fields $this->import_fieldshidden_array[$r] = array('t.fk_user_creat'=>'user->id', 'extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'projet'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) $this->import_convertvalue_array[$r] = array( - 't.ref'=>array('rule'=>'getrefifauto', 'class'=>(!getDolGlobalString('PROJECT_ADDON') ? 'mod_project_simple' : $conf->global->PROJECT_ADDON), 'path'=>"/core/modules/project/".(!getDolGlobalString('PROJECT_ADDON') ? 'mod_project_simple' : $conf->global->PROJECT_ADDON).'.php'), + 't.ref' => array('rule' => 'getrefifauto', 'class' => getDolGlobalString('PROJECT_ADDON', 'mod_project_simple'), 'path' => "/core/modules/project/".getDolGlobalString('PROJECT_ADDON', 'mod_project_simple').'.php'), 't.fk_soc' => array( 'rule' => 'fetchidfromref', 'file' => '/societe/class/societe.class.php', diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 3168aa7261c..41e3a5247b3 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -407,7 +407,7 @@ class doc_generic_project_odt extends ModelePDFProjects // List of directories area $texte .= ''; $texttitle = $langs->trans("ListOfDirectories"); - $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim($conf->global->PROJECT_ADDON_PDF_ODT_PATH))); + $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim(getDolGlobalString('PROJECT_ADDON_PDF_ODT_PATH')))); $listoffiles = array(); foreach ($listofdir as $key => $tmpdir) { $tmpdir = trim($tmpdir); diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 24c452541e9..ab10ad402da 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -3092,7 +3092,7 @@ class EmailCollector extends CommonObject if (empty($projecttocreate->ref)) { // Get next Ref $defaultref = ''; - $modele = !getDolGlobalString('PROJECT_ADDON') ? 'mod_project_simple' : $conf->global->PROJECT_ADDON; + $modele = getDolGlobalString('PROJECT_ADDON', 'mod_project_simple'); // Search template files $file = ''; diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php index d0d560d8dd2..cd092f0be52 100644 --- a/htdocs/projet/admin/project.php +++ b/htdocs/projet/admin/project.php @@ -175,14 +175,14 @@ if ($action == 'updateMaskTask') { } elseif ($action == 'del') { $ret = delDocumentModel($value, $type); if ($ret > 0) { - if ($conf->global->PROJECT_ADDON_PDF == "$value") { + if (getDolGlobalString('PROJECT_ADDON_PDF') == "$value") { dolibarr_del_const($db, 'PROJECT_ADDON_PDF', $conf->entity); } } } elseif ($action == 'deltask') { $ret = delDocumentModel($value, 'project_task'); if ($ret > 0) { - if ($conf->global->PROJECT_TASK_ADDON_PDF == "$value") { + if (getDolGlobalString('PROJECT_TASK_ADDON_PDF') == "$value") { dolibarr_del_const($db, 'PROJECT_TASK_ADDON_PDF', $conf->entity); } } @@ -354,7 +354,7 @@ foreach ($dirmodels as $reldir) { print ''."\n"; print ''; - if ($conf->global->PROJECT_ADDON == 'mod_'.$classname) { + if (getDolGlobalString('PROJECT_ADDON') == 'mod_'.$classname) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; @@ -594,7 +594,7 @@ foreach ($dirmodels as $reldir) { // Default print ""; - if ($conf->global->PROJECT_ADDON_PDF == "$name") { + if (getDolGlobalString('PROJECT_ADDON_PDF') == "$name") { print img_picto($langs->trans("Default"), 'on'); } else { print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index de5f62dd8f9..4d91ed92903 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -617,7 +617,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) { print ''; $defaultref = ''; - $modele = !getDolGlobalString('PROJECT_ADDON') ? 'mod_project_simple' : $conf->global->PROJECT_ADDON; + $modele = getDolGlobalString('PROJECT_ADDON', 'mod_project_simple'); // Search template files $file = ''; diff --git a/htdocs/projet/class/api_projects.class.php b/htdocs/projet/class/api_projects.class.php index cc71d6f1bf8..8cd7699aa3f 100644 --- a/htdocs/projet/class/api_projects.class.php +++ b/htdocs/projet/class/api_projects.class.php @@ -315,7 +315,7 @@ class Projects extends DolibarrApi $file = ''; $classname = ''; $filefound = 0; - $modele = !getDolGlobalString('PROJECT_ADDON') ? 'mod_project_simple' : $conf->global->PROJECT_ADDON; + $modele = getDolGlobalString('PROJECT_ADDON', 'mod_project_simple'); $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); foreach ($dirmodels as $reldir) { diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index f33b4b08337..7101f5fc736 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1781,7 +1781,7 @@ class Project extends CommonObject //Generate next ref $defaultref = ''; - $obj = !getDolGlobalString('PROJECT_ADDON') ? 'mod_project_simple' : $conf->global->PROJECT_ADDON; + $obj = getDolGlobalString('PROJECT_ADDON', 'mod_project_simple'); // Search template files $file = ''; $classname = ''; diff --git a/htdocs/public/project/new.php b/htdocs/public/project/new.php index 1c0380b475c..1fc8b87725c 100644 --- a/htdocs/public/project/new.php +++ b/htdocs/public/project/new.php @@ -258,7 +258,7 @@ if (empty($reshook) && $action == 'add') { if (!$error) { // Defined the ref into $defaultref $defaultref = ''; - $modele = !getDolGlobalString('PROJECT_ADDON') ? 'mod_project_simple' : $conf->global->PROJECT_ADDON; + $modele = getDolGlobalString('PROJECT_ADDON', 'mod_project_simple'); // Search template files $file = '';