QUAL Clean code
This commit is contained in:
parent
631b87f9af
commit
aa3a4fbf52
8 changed files with 11 additions and 11 deletions
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -407,7 +407,7 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||
// List of directories area
|
||||
$texte .= '<tr><td>';
|
||||
$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);
|
||||
|
|
|
|||
|
|
@ -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 = '';
|
||||
|
|
|
|||
|
|
@ -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 '</td>'."\n";
|
||||
|
||||
print '<td class="center">';
|
||||
if ($conf->global->PROJECT_ADDON == 'mod_'.$classname) {
|
||||
if (getDolGlobalString('PROJECT_ADDON') == 'mod_'.$classname) {
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
} else {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&value=mod_'.$classname.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
|
|
@ -594,7 +594,7 @@ foreach ($dirmodels as $reldir) {
|
|||
|
||||
// Default
|
||||
print "<td class=\"center\">";
|
||||
if ($conf->global->PROJECT_ADDON_PDF == "$name") {
|
||||
if (getDolGlobalString('PROJECT_ADDON_PDF') == "$name") {
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
} else {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
|
|
|
|||
|
|
@ -617,7 +617,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
|
|||
print '<table class="border centpercent tableforfieldcreate">';
|
||||
|
||||
$defaultref = '';
|
||||
$modele = !getDolGlobalString('PROJECT_ADDON') ? 'mod_project_simple' : $conf->global->PROJECT_ADDON;
|
||||
$modele = getDolGlobalString('PROJECT_ADDON', 'mod_project_simple');
|
||||
|
||||
// Search template files
|
||||
$file = '';
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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 = '';
|
||||
|
|
|
|||
|
|
@ -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 = '';
|
||||
|
|
|
|||
Loading…
Reference in a new issue