--- /tmp/dsg/dolibarr/htdocs/projet/admin/github_19.0.3_project.php +++ /tmp/dsg/dolibarr/htdocs/projet/admin/client_project.php @@ -30 +29,0 @@ -// Load Dolibarr environment @@ -40,6 +39 @@ -if (!$user->admin) { - accessforbidden(); -} - -$action = GETPOST('action', 'aZ09'); -$modulepart = GETPOST('modulepart', 'aZ09'); +if (!$user->admin) accessforbidden(); @@ -47,0 +42 @@ +$action = GETPOST('action', 'alpha'); @@ -59,2 +54,3 @@ -if ($action == 'updateMask') { - $maskconstproject = GETPOST('maskconstproject', 'aZ09'); +if ($action == 'updateMask') +{ + $maskconstproject = GETPOST('maskconstproject', 'alpha'); @@ -63,9 +59,6 @@ - if ($maskconstproject && preg_match('/_MASK$/', $maskconstproject)) { - $res = dolibarr_set_const($db, $maskconstproject, $maskproject, 'chaine', 0, '', $conf->entity); - } - - if (!($res > 0)) { - $error++; - } - - if (!$error) { + if ($maskconstproject) $res = dolibarr_set_const($db, $maskconstproject, $maskproject, 'chaine', 0, '', $conf->entity); + + if (!$res > 0) $error++; + + if (!$error) + { @@ -73 +66,3 @@ - } else { + } + else + { @@ -78,2 +73,3 @@ -if ($action == 'updateMaskTask') { - $maskconstmasktask = GETPOST('maskconsttask', 'aZ09'); +if ($action == 'updateMaskTask') +{ + $maskconstmasktask = GETPOST('maskconsttask', 'alpha'); @@ -82,9 +78,6 @@ - if ($maskconstmasktask && preg_match('/_MASK$/', $maskconstmasktask)) { - $res = dolibarr_set_const($db, $maskconstmasktask, $masktaskt, 'chaine', 0, '', $conf->entity); - } - - if (!($res > 0)) { - $error++; - } - - if (!$error) { + if ($maskconstmasktask) $res = dolibarr_set_const($db, $maskconstmasktask, $masktaskt, 'chaine', 0, '', $conf->entity); + + if (!$res > 0) $error++; + + if (!$error) + { @@ -92 +85,3 @@ - } else { + } + else + { @@ -95 +90,4 @@ -} elseif ($action == 'specimen') { +} + +elseif ($action == 'specimen') +{ @@ -102,3 +100 @@ - $file = ''; - $classname = ''; - $filefound = 0; + $file = ''; $classname = ''; $filefound = 0; @@ -106 +102,2 @@ - foreach ($dirmodels as $reldir) { + foreach ($dirmodels as $reldir) + { @@ -108 +105,2 @@ - if (file_exists($file)) { + if (file_exists($file)) + { @@ -115 +113,2 @@ - if ($filefound) { + if ($filefound) + { @@ -120 +119,2 @@ - if ($module->write_file($project, $langs) > 0) { + if ($module->write_file($project, $langs) > 0) + { @@ -123 +123,3 @@ - } else { + } + else + { @@ -127 +129,3 @@ - } else { + } + else + { @@ -131 +135,4 @@ -} elseif ($action == 'specimentask') { +} + +elseif ($action == 'specimentask') +{ @@ -138,3 +145 @@ - $file = ''; - $classname = ''; - $filefound = 0; + $file = ''; $classname = ''; $filefound = 0; @@ -142 +147,2 @@ - foreach ($dirmodels as $reldir) { + foreach ($dirmodels as $reldir) + { @@ -144 +150,2 @@ - if (file_exists($file)) { + if (file_exists($file)) + { @@ -151 +158,2 @@ - if ($filefound) { + if ($filefound) + { @@ -156 +164,2 @@ - if ($module->write_file($project, $langs) > 0) { + if ($module->write_file($project, $langs) > 0) + { @@ -159 +168,3 @@ - } else { + } + else + { @@ -163 +174,3 @@ - } else { + } + else + { @@ -167,2 +180,5 @@ -} elseif ($action == 'set') { - // Activate a model +} + +// Activate a model +elseif ($action == 'set') +{ @@ -170,2 +186,4 @@ -} elseif ($action == 'settask') { - // Activate a model for task +} +// Activate a model for task +elseif ($action == 'settask') +{ @@ -173 +191,4 @@ -} elseif ($action == 'del') { +} + +elseif ($action == 'del') +{ @@ -175,6 +196,7 @@ - if ($ret > 0) { - if ($conf->global->PROJECT_ADDON_PDF == "$value") { - dolibarr_del_const($db, 'PROJECT_ADDON_PDF', $conf->entity); - } - } -} elseif ($action == 'deltask') { + if ($ret > 0) + { + if ($conf->global->PROJECT_ADDON_PDF == "$value") dolibarr_del_const($db, 'PROJECT_ADDON_PDF', $conf->entity); + } +} +if ($action == 'deltask') +{ @@ -182,7 +204,9 @@ - if ($ret > 0) { - if ($conf->global->PROJECT_TASK_ADDON_PDF == "$value") { - dolibarr_del_const($db, 'PROJECT_TASK_ADDON_PDF', $conf->entity); - } - } -} elseif ($action == 'setdoc') { - // Set default model + if ($ret > 0) + { + if ($conf->global->PROJECT_TASK_ADDON_PDF == "$value") dolibarr_del_const($db, 'PROJECT_TASK_ADDON_PDF', $conf->entity); + } +} + +// Set default model +elseif ($action == 'setdoc') +{ @@ -193 +217,2 @@ - if ($ret > 0) { + if ($ret > 0) + { @@ -196,2 +221,6 @@ -} elseif ($action == 'setdoctask') { - if (dolibarr_set_const($db, "PROJECT_TASK_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { +} + +elseif ($action == 'setdoctask') +{ + if (dolibarr_set_const($db, "PROJECT_TASK_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) + { @@ -205 +234,2 @@ - if ($ret > 0) { + if ($ret > 0) + { @@ -208 +238,4 @@ -} elseif ($action == 'setmod') { +} + +elseif ($action == 'setmod') +{ @@ -213 +246,4 @@ -} elseif ($action == 'setmodtask') { +} + +elseif ($action == 'setmodtask') +{ @@ -218,2 +254,5 @@ -} elseif ($action == 'updateoptions') { - if (GETPOST('PROJECT_USE_SEARCH_TO_SELECT')) { +} +elseif ($action == 'updateoptions') +{ + if (GETPOST('PROJECT_USE_SEARCH_TO_SELECT')) + { @@ -221 +260,2 @@ - if (dolibarr_set_const($db, "PROJECT_USE_SEARCH_TO_SELECT", $companysearch, 'chaine', 0, '', $conf->entity)) { + if (dolibarr_set_const($db, "PROJECT_USE_SEARCH_TO_SELECT", $companysearch, 'chaine', 0, '', $conf->entity)) + { @@ -225 +265,2 @@ - if (GETPOST('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY')) { + if (GETPOST('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY')) + { @@ -229,10 +270,2 @@ - if (GETPOST('PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS')) { - $timesheetFreezeDuration = GETPOST('timesheetFreezeDuration', 'alpha'); - dolibarr_set_const($db, 'PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS', intval($timesheetFreezeDuration), 'chaine', 0, '', $conf->entity); //Allow to disable this configuration if empty value - } -} elseif (preg_match('/^(set|del)_?([A-Z_]+)$/', $action, $reg)) { - // Set boolean (on/off) constants - if (!dolibarr_set_const($db, $reg[2], ($reg[1] === 'set' ? '1' : '0'), 'chaine', 0, '', $conf->entity) > 0) { - dol_print_error($db); - } -} +} + @@ -255 +288 @@ -print dol_get_fiche_head($head, 'project', $langs->trans("Projects"), -1, 'project'); +dol_fiche_head($head, 'project', $langs->trans("Projects"), -1, 'project'); @@ -275 +308 @@ -print ajax_constantonoff("PROJECT_USE_OPPORTUNITIES", null, null, 0, 0, 1); +print ajax_constantonoff("PROJECT_USE_OPPORTUNITIES"); @@ -301 +333,0 @@ -print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table @@ -313 +345,2 @@ -foreach ($dirmodels as $reldir) { +foreach ($dirmodels as $reldir) +{ @@ -316 +349,2 @@ - if (is_dir($dir)) { + if (is_dir($dir)) + { @@ -318,3 +352,6 @@ - if (is_resource($handle)) { - while (($file = readdir($handle)) !== false) { - if (preg_match('/^(mod_.*)\.php$/i', $file, $reg)) { + if (is_resource($handle)) + { + while (($file = readdir($handle)) !== false) + { + if (preg_match('/^(mod_.*)\.php$/i', $file, $reg)) + { @@ -326 +363 @@ - $module = new $file(); + $module = new $file; @@ -329,8 +366,5 @@ - if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) { - continue; - } - if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) { - continue; - } - - if ($module->isEnabled()) { + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; + + if ($module->isEnabled()) + { @@ -338 +372 @@ - print $module->info($langs); + print $module->info(); @@ -344,7 +378,9 @@ - if (preg_match('/^Error/', $tmp)) { - $langs->load("errors"); - print '
'.$langs->trans($tmp).'
'; - } elseif ($tmp == 'NotConfigured') { - print $langs->trans($tmp); - } else { - print $tmp; + if (preg_match('/^Error/', $tmp)) print '
'.$langs->trans($tmp).'
'; + elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); + else print $tmp; + print ''."\n"; + + print ''; + if ($conf->global->PROJECT_ADDON == 'mod_'.$classname) + { + print img_picto($langs->trans("Activated"), 'switch_on'); @@ -352,7 +388,3 @@ - print ''."\n"; - - print ''; - if ($conf->global->PROJECT_ADDON == 'mod_'.$classname) { - print img_picto($langs->trans("Activated"), 'switch_on'); - } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + else + { + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; @@ -369 +401,2 @@ - if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval + if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval + { @@ -371 +404,2 @@ - if ($nextval) { + if ($nextval) + { @@ -373 +407,3 @@ - } else { + } + else + { @@ -391,5 +427,5 @@ -print ''; -print '
'; -print '
'; - -if (!getDolGlobalString('PROJECT_HIDE_TASKS')) { +print '
'; + + +if (empty($conf->global->PROJECT_HIDE_TASKS)) +{ @@ -399 +434,0 @@ - print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table @@ -411 +446,2 @@ - foreach ($dirmodels as $reldir) { + foreach ($dirmodels as $reldir) + { @@ -414 +450,2 @@ - if (is_dir($dir)) { + if (is_dir($dir)) + { @@ -416,3 +453,6 @@ - if (is_resource($handle)) { - while (($file = readdir($handle)) !== false) { - if (preg_match('/^(mod_.*)\.php$/i', $file, $reg)) { + if (is_resource($handle)) + { + while (($file = readdir($handle)) !== false) + { + if (preg_match('/^(mod_.*)\.php$/i', $file, $reg)) + { @@ -424 +464 @@ - $module = new $file(); + $module = new $file; @@ -427,8 +467,5 @@ - if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) { - continue; - } - if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) { - continue; - } - - if ($module->isEnabled()) { + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; + + if ($module->isEnabled()) + { @@ -436 +473 @@ - print $module->info($langs); + print $module->info(); @@ -442,7 +479,9 @@ - if (preg_match('/^Error/', $tmp)) { - $langs->load("errors"); - print '
'.$langs->trans($tmp).'
'; - } elseif ($tmp == 'NotConfigured') { - print $langs->trans($tmp); - } else { - print $tmp; + if (preg_match('/^Error/', $tmp)) print '
'.$langs->trans($tmp).'
'; + elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); + else print $tmp; + print ''."\n"; + + print ''; + if ($conf->global->PROJECT_TASK_ADDON == 'mod_'.$classname) + { + print img_picto($langs->trans("Activated"), 'switch_on'); @@ -450,7 +489,3 @@ - print ''."\n"; - - print ''; - if ($conf->global->PROJECT_TASK_ADDON == 'mod_'.$classname) { - print img_picto($langs->trans("Activated"), 'switch_on'); - } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + else + { + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; @@ -467 +502,2 @@ - if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval + if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval + { @@ -469 +505,2 @@ - if ($nextval) { + if ($nextval) + { @@ -471 +508,3 @@ - } else { + } + else + { @@ -489,3 +528 @@ - print ''; - print '
'; - print '
'; + print '
'; @@ -507 +544 @@ -$sql .= " WHERE type = '".$db->escape($type)."'"; +$sql .= " WHERE type = '".$type."'"; @@ -511 +548,2 @@ -if ($resql) { +if ($resql) +{ @@ -514 +552,2 @@ - while ($i < $num_rows) { + while ($i < $num_rows) + { @@ -519 +558,3 @@ -} else { +} +else +{ @@ -523,3 +564,2 @@ -print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table -print ''."\n"; -print ''."\n"; +print "
\n"; +print "\n"; @@ -536,2 +576,4 @@ -foreach ($dirmodels as $reldir) { - foreach (array('', '/doc') as $valdir) { +foreach ($dirmodels as $reldir) +{ + foreach (array('', '/doc') as $valdir) + { @@ -540 +582,2 @@ - if (is_dir($dir)) { + if (is_dir($dir)) + { @@ -542,2 +585,4 @@ - if (is_resource($handle)) { - while (($file = readdir($handle)) !== false) { + if (is_resource($handle)) + { + while (($file = readdir($handle)) !== false) + { @@ -549,3 +594,6 @@ - foreach ($filelist as $file) { - if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { - if (file_exists($dir.'/'.$file)) { + foreach ($filelist as $file) + { + if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) + { + if (file_exists($dir.'/'.$file)) + { @@ -559,8 +607,5 @@ - if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) { - $modulequalified = 0; - } - if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) { - $modulequalified = 0; - } - - if ($modulequalified) { + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified = 0; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0; + + if ($modulequalified) + { @@ -568 +613 @@ - print(empty($module->name) ? $name : $module->name); + print (empty($module->name) ? $name : $module->name); @@ -570,5 +615,2 @@ - if (method_exists($module, 'info')) { - print $module->info($langs); - } else { - print $module->description; - } + if (method_exists($module, 'info')) print $module->info($langs); + else print $module->description; @@ -578 +620,2 @@ - if (in_array($name, $def)) { + if (in_array($name, $def)) + { @@ -580 +623 @@ - print 'scandir).'&label='.urlencode($module->name).'">'; + print 'scandir.'&label='.urlencode($module->name).'">'; @@ -584 +627,3 @@ - } else { + } + else + { @@ -586 +631 @@ - print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; @@ -592 +637,2 @@ - if ($conf->global->PROJECT_ADDON_PDF == "$name") { + if ($conf->global->PROJECT_ADDON_PDF == "$name") + { @@ -594,2 +640,4 @@ - } else { - print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + } + else + { + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; @@ -602 +650,2 @@ - if ($module->type == 'pdf') { + if ($module->type == 'pdf') + { @@ -614 +663,2 @@ - if ($module->type == 'pdf') { + if ($module->type == 'pdf') + { @@ -616 +666,3 @@ - } else { + } + else + { @@ -631,7 +683,6 @@ -print '
'; -print '
'; -print '
'; - - - -if (!getDolGlobalString('PROJECT_HIDE_TASKS')) { +print '
'; + + + +if (empty($conf->global->PROJECT_HIDE_TASKS)) +{ @@ -650 +701 @@ - $sql .= " WHERE type = '".$db->escape($type)."'"; + $sql .= " WHERE type = '".$type."'"; @@ -654 +705,2 @@ - if ($resql) { + if ($resql) + { @@ -657 +709,2 @@ - while ($i < $num_rows) { + while ($i < $num_rows) + { @@ -662 +715,3 @@ - } else { + } + else + { @@ -666,3 +721,2 @@ - print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table - print ''."\n"; - print ''."\n"; + print "
\n"; + print "\n"; @@ -679,2 +733,4 @@ - foreach ($dirmodels as $reldir) { - foreach (array('', '/doc') as $valdir) { + foreach ($dirmodels as $reldir) + { + foreach (array('', '/doc') as $valdir) + { @@ -683 +739,2 @@ - if (is_dir($dir)) { + if (is_dir($dir)) + { @@ -685,2 +742,4 @@ - if (is_resource($handle)) { - while (($file = readdir($handle)) !== false) { + if (is_resource($handle)) + { + while (($file = readdir($handle)) !== false) + { @@ -692,3 +751,6 @@ - foreach ($filelist as $file) { - if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { - if (file_exists($dir.'/'.$file)) { + foreach ($filelist as $file) + { + if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) + { + if (file_exists($dir.'/'.$file)) + { @@ -702,8 +764,5 @@ - if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) { - $modulequalified = 0; - } - if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) { - $modulequalified = 0; - } - - if ($modulequalified) { + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified = 0; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0; + + if ($modulequalified) + { @@ -711 +770 @@ - print(empty($module->name) ? $name : $module->name); + print (empty($module->name) ? $name : $module->name); @@ -713,5 +772,2 @@ - if (method_exists($module, 'info')) { - print $module->info($langs); - } else { - print $module->description; - } + if (method_exists($module, 'info')) print $module->info($langs); + else print $module->description; @@ -721,3 +777,4 @@ - if (in_array($name, $def)) { - print '
'."\n"; - print 'scandir).'&label='.urlencode($module->name).'">'; + if (in_array($name, $def)) + { + print "\n"; + print 'scandir.'&label='.urlencode($module->name).'">'; @@ -727,3 +784,5 @@ - } else { - print ''."\n"; - print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + } + else + { + print "\n"; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; @@ -734,2 +793,3 @@ - print ''; - if ($conf->global->PROJECT_TASK_ADDON_PDF == "$name") { + print ""; + if ($conf->global->PROJECT_TASK_ADDON_PDF == "$name") + { @@ -737,2 +797,4 @@ - } else { - print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + } + else + { + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; @@ -745 +807,2 @@ - if ($module->type == 'pdf') { + if ($module->type == 'pdf') + { @@ -757 +820,2 @@ - if ($module->type == 'pdf') { + if ($module->type == 'pdf') + { @@ -759 +823,3 @@ - } else { + } + else + { @@ -773,3 +839 @@ - print '
'; - print '
'; - print '
'; + print '
'; @@ -787,3 +851 @@ -print ''; - -print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table + @@ -798 +860,2 @@ -if (!$conf->use_javascript_ajax) { +if (!$conf->use_javascript_ajax) +{ @@ -802 +865,3 @@ -} else { +} +else +{ @@ -809 +874 @@ - print $form->selectarray("activate_PROJECT_USE_SEARCH_TO_SELECT", $arrval, getDolGlobalString("PROJECT_USE_SEARCH_TO_SELECT")); + print $form->selectarray("activate_PROJECT_USE_SEARCH_TO_SELECT", $arrval, $conf->global->PROJECT_USE_SEARCH_TO_SELECT); @@ -811 +876 @@ - print ''; + print ''; @@ -820 +885 @@ -print ' '; +print ' '; @@ -822 +887 @@ -print ''; +print ''; @@ -824,20 +889 @@ -print ''; - -$key = 'PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE'; -echo '', - '', - $form->textwithpicto($langs->transnoentities($key), $langs->transnoentities($key . '_help')), - '', - '', - ajax_constantonoff($key), - '', - ''; - -print ''; -print ''.$langs->trans("TimesheetPreventAfterFollowingMonths").''; - -print ''; -print ' '; -print ''; -print ''; -print ''; + @@ -845 +891 @@ -print '
'; + --- /tmp/dsg/dolibarr/htdocs/projet/admin/github_19.0.3_project_extrafields.php +++ /tmp/dsg/dolibarr/htdocs/projet/admin/client_project_extrafields.php @@ -29 +28,0 @@ -// Load Dolibarr environment @@ -42,3 +41 @@ -foreach ($tmptype2label as $key => $val) { - $type2label[$key] = $langs->transnoentitiesnoconv($val); -} +foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val); @@ -46 +43 @@ -$action = GETPOST('action', 'aZ09'); +$action = GETPOST('action', 'alpha'); @@ -50,3 +47 @@ -if (!$user->admin) { - accessforbidden(); -} +if (!$user->admin) accessforbidden(); @@ -77 +72 @@ -print dol_get_fiche_head($head, 'attributes', $langs->trans("Projects"), -1, 'project'); +dol_fiche_head($head, 'attributes', $langs->trans("Projects"), -1, 'project'); @@ -81 +76 @@ -print dol_get_fiche_end(); +dol_fiche_end(); @@ -84,2 +79,17 @@ -// Creation of an optional field -if ($action == 'create') { +// Buttons +if ($action != 'create' && $action != 'edit') +{ + print '
'; + print '
".$langs->trans("NewAttribute").'
'; + print "
"; +} + + +/* ************************************************************************** */ +/* */ +/* Creation of an optional field */ +/* */ +/* ************************************************************************** */ + +if ($action == 'create') +{ @@ -89 +99 @@ - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; @@ -92,2 +102,7 @@ -// Edition of an optional field -if ($action == 'edit' && !empty($attrname)) { +/* ************************************************************************** */ +/* */ +/* Edition of an optional field */ +/* */ +/* ************************************************************************** */ +if ($action == 'edit' && !empty($attrname)) +{ @@ -97 +112 @@ - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; --- /tmp/dsg/dolibarr/htdocs/projet/admin/github_19.0.3_project_task_extrafields.php +++ /tmp/dsg/dolibarr/htdocs/projet/admin/client_project_task_extrafields.php @@ -29 +28,0 @@ -// Load Dolibarr environment @@ -43,3 +42 @@ -foreach ($tmptype2label as $key => $val) { - $type2label[$key] = $langs->transnoentitiesnoconv($val); -} +foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val); @@ -47 +44 @@ -$action = GETPOST('action', 'aZ09'); +$action = GETPOST('action', 'alpha'); @@ -51,3 +48 @@ -if (!$user->admin) { - accessforbidden(); -} +if (!$user->admin) accessforbidden(); @@ -77 +72 @@ -print dol_get_fiche_head($head, 'attributes_task', $langs->trans("Projects"), -1, 'project'); +dol_fiche_head($head, 'attributes_task', $langs->trans("Projects"), -1, 'project'); @@ -81 +76 @@ -print dol_get_fiche_end(); +dol_fiche_end(); @@ -84,2 +79,17 @@ -// Creation of an optional field -if ($action == 'create') { +// Buttons +if ($action != 'create' && $action != 'edit') +{ + print '
'; + print '
".$langs->trans("NewAttribute").'
'; + print "
"; +} + + +/* ************************************************************************** */ +/* */ +/* Creation of an optional field */ +/* */ +/* ************************************************************************** */ + +if ($action == 'create') +{ @@ -89 +99 @@ - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; @@ -92,2 +102,7 @@ -// Edition of an optional field -if ($action == 'edit' && !empty($attrname)) { +/* ************************************************************************** */ +/* */ +/* Edition of an optional field */ +/* */ +/* ************************************************************************** */ +if ($action == 'edit' && !empty($attrname)) +{ @@ -97 +112 @@ - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';