2
0
forked from Wavyzz/dolibarr

Clean code/options

This commit is contained in:
Laurent Destailleur
2022-10-25 11:13:34 +02:00
parent 1618bfc902
commit 1f9424a4b3
10 changed files with 32 additions and 38 deletions

View File

@@ -100,8 +100,11 @@ if ($action == 'update' && !GETPOST("cancel") && $user->rights->projet->creer) {
$object->ref = $taskref ? $taskref : GETPOST("ref", 'alpha', 2);
$object->label = GETPOST("label", "alphanohtml");
if (empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) $object->description = GETPOST('description', "alphanohtml");
else $object->description = GETPOST('description', "restricthtml");
if (empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) {
$object->description = GETPOST('description', "alphanohtml");
} else {
$object->description = GETPOST('description', "restricthtml");
}
$object->fk_task_parent = $task_parent;
$object->planned_workload = $planned_workload;
$object->date_start = dol_mktime(GETPOST('dateohour', 'int'), GETPOST('dateomin', 'int'), 0, GETPOST('dateomonth', 'int'), GETPOST('dateoday', 'int'), GETPOST('dateoyear', 'int'));
@@ -491,18 +494,14 @@ if ($id > 0 || !empty($ref)) {
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td>';
print '<td>';
if (empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) {
print '<textarea name="description" class="quatrevingtpercent" rows="'.ROWS_4.'">'.$object->description.'</textarea>';
} else {
// WYSIWYG editor
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$cked_enabled = (!empty($conf->global->FCKEDITOR_ENABLE_DETAILS) ? $conf->global->FCKEDITOR_ENABLE_DETAILS : 0);
if (!empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) {
$nbrows = $conf->global->MAIN_INPUT_DESC_HEIGHT;
}
$doleditor = new DolEditor('description', $object->description, '', 80, 'dolibarr_details', '', false, true, $cked_enabled, $nbrows);
print $doleditor->Create();
// WYSIWYG editor
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$cked_enabled = (!empty($conf->global->FCKEDITOR_ENABLE_SOCIETE) ? $conf->global->FCKEDITOR_ENABLE_SOCIETE : 0);
if (!empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) {
$nbrows = $conf->global->MAIN_INPUT_DESC_HEIGHT;
}
$doleditor = new DolEditor('description', $object->description, '', 80, 'dolibarr_details', '', false, true, $cked_enabled, $nbrows);
print $doleditor->Create();
print '</td></tr>';
print '<tr><td>'.$langs->trans("Budget").'</td>';