Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2022-07-26 13:15:37 +02:00
commit 60dd3577ec
6 changed files with 38 additions and 37 deletions

View File

@ -1174,7 +1174,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
$errors[] = $langs->transnoentitiesnoconv('NoMotifRefuseCP');
break;
case 'mail':
$errors[] = $langs->transnoentitiesnoconv('ErrorMailNotSend')."\n".$_GET['error_content'];
$errors[] = $langs->transnoentitiesnoconv('ErrorMailNotSend');
break;
}

View File

@ -147,10 +147,10 @@ if ($action == "set") {
// To disable some code, so you can call step2 with url like
// http://localhost/dolibarrnew/install/step2.php?action=set&token='.newToken().'&createtables=0&createkeys=0&createfunctions=0&createdata=llx_20_c_departements
$createtables = isset($_GET['createtables']) ?GETPOST('createtables') : 1;
$createkeys = isset($_GET['createkeys']) ?GETPOST('createkeys') : 1;
$createfunctions = isset($_GET['createfunctions']) ?GETPOST('createfunction') : 1;
$createdata = isset($_GET['createdata']) ?GETPOST('createdata') : 1;
$createtables = GETPOSTISSET('createtables') ? GETPOST('createtables') : 1;
$createkeys = GETPOSTISSET('createkeys') ? GETPOST('createkeys') : 1;
$createfunctions = GETPOSTISSET('createfunctions') ? GETPOST('createfunction') : 1;
$createdata = GETPOSTISSET('createdata') ? GETPOST('createdata') : 1;
// To say sql requests are escaped for mysql so we need to unescape them

View File

@ -41,7 +41,7 @@ if (!defined('NOREQUIRESOC')) {
if (!defined('NOCSRFCHECK')) {
define('NOCSRFCHECK', '1');
}
if (empty($_GET['keysearch']) && !defined('NOREQUIREHTML')) {
if (!defined('NOREQUIREHTML')) {
define('NOREQUIREHTML', '1');
}

View File

@ -1867,7 +1867,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
// Date
if (!empty($arrayfields['t.task_date']['checked'])) {
print '<td class="nowrap">';
if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) {
if ($action == 'editline' && GETPOST('lineid', 'int') == $task_time->rowid) {
if (empty($task_time->task_date_withhour)) {
print $form->selectDate(($date2 ? $date2 : $date1), 'timeline', 3, 3, 2, "timespent_date", 1, 0);
} else {
@ -1920,7 +1920,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
if (!empty($arrayfields['t.task_ref']['checked'])) {
if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task
print '<td class="nowrap">';
if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) {
if ($action == 'editline' && GETPOST('lineid', 'int') == $task_time->rowid) {
$formproject->selectTasks(-1, GETPOST('taskid', 'int') ? GETPOST('taskid', 'int') : $task_time->fk_task, 'taskid', 0, 0, 1, 1, 0, 0, 'maxwidth300', $projectstatic->id, '');
} else {
$tasktmp->id = $task_time->fk_task;
@ -1952,7 +1952,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
// By User
if (!empty($arrayfields['author']['checked'])) {
print '<td class="tdoverflowmax100">';
if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) {
if ($action == 'editline' && GETPOST('lineid', 'int') == $task_time->rowid) {
if (empty($object->id)) {
$object->fetch($id);
}
@ -1983,7 +1983,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
// Note
if (!empty($arrayfields['t.note']['checked'])) {
print '<td class="small">';
if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) {
if ($action == 'editline' && GETPOST('lineid', 'int') == $task_time->rowid) {
print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note).'</textarea>';
} else {
print dol_nl2br($task_time->note);
@ -1992,14 +1992,14 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
if (!$i) {
$totalarray['nbfield']++;
}
} elseif ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) {
} elseif ($action == 'editline' && GETPOST('lineid', 'int') == $task_time->rowid) {
print '<input type="hidden" name="timespent_note_line" value="'.dol_escape_htmltag($task_time->note).'">';
}
// Time spent
if (!empty($arrayfields['t.task_duration']['checked'])) {
print '<td class="right nowraponall">';
if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) {
if ($action == 'editline' && GETPOST('lineid', 'int') == $task_time->rowid) {
print '<input type="hidden" name="old_duration" value="'.$task_time->task_duration.'">';
print $form->select_duration('new_duration', $task_time->task_duration, 0, 'text');
} else {
@ -2136,13 +2136,13 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
// Add line to split
if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid) {
if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) {
print '<tr class="oddeven">';
// Date
if (!empty($arrayfields['t.task_date']['checked'])) {
print '<td class="nowrap">';
if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid) {
if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) {
if (empty($task_time->task_date_withhour)) {
print $form->selectDate(($date2 ? $date2 : $date1), 'timeline', 3, 3, 2, "timespent_date", 1, 0);
} else {
@ -2186,7 +2186,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
// User
if (!empty($arrayfields['author']['checked'])) {
print '<td>';
if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid) {
if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) {
if (empty($object->id)) {
$object->fetch($id);
}
@ -2214,20 +2214,20 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
// Note
if (!empty($arrayfields['t.note']['checked'])) {
print '<td class="tdoverflowmax300">';
if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid) {
if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) {
print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note).'</textarea>';
} else {
print dol_nl2br($task_time->note);
}
print '</td>';
} elseif ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid) {
} elseif ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) {
print '<input type="hidden" name="timespent_note_line" rows="'.ROWS_1.'" value="'.dol_escape_htmltag($task_time->note).'">';
}
// Time spent
if (!empty($arrayfields['t.task_duration']['checked'])) {
print '<td class="right">';
if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid) {
if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) {
print '<input type="hidden" name="old_duration" value="'.$task_time->task_duration.'">';
print $form->select_duration('new_duration', $task_time->task_duration, 0, 'text');
} else {
@ -2280,7 +2280,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
// Date
if (!empty($arrayfields['t.task_date']['checked'])) {
print '<td class="nowrap">';
if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid) {
if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) {
if (empty($task_time->task_date_withhour)) {
print $form->selectDate(($date2 ? $date2 : $date1), 'timeline_2', 3, 3, 2, "timespent_date", 1, 0);
} else {
@ -2324,7 +2324,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
// User
if (!empty($arrayfields['author']['checked'])) {
print '<td>';
if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid) {
if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) {
if (empty($object->id)) {
$object->fetch($id);
}
@ -2352,20 +2352,20 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
// Note
if (!empty($arrayfields['t.note']['checked'])) {
print '<td class="small tdoverflowmax300"">';
if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid) {
if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) {
print '<textarea name="timespent_note_line_2" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note).'</textarea>';
} else {
print dol_nl2br($task_time->note);
}
print '</td>';
} elseif ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid) {
} elseif ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) {
print '<input type="hidden" name="timespent_note_line_2" value="'.dol_escape_htmltag($task_time->note).'">';
}
// Time spent
if (!empty($arrayfields['t.task_duration']['checked'])) {
print '<td class="right">';
if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid) {
if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) {
print '<input type="hidden" name="old_duration_2" value="0">';
print $form->select_duration('new_duration_2', 0, 0, 'text');
} else {

View File

@ -111,7 +111,7 @@ if ($action == 'delete') {
/*
if ($action == 'valide')
{
$facid = $_GET['facid'];
$facid = GETPOST('facid', 'int');
print $form->formconfirm('card.php?id='.$object->id.'&amp;facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2);
}

View File

@ -50,17 +50,11 @@ $show_files = GETPOST('show_files', 'int');
$confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'thirdpartylist';
$optioncss = GETPOST('optioncss', 'alpha');
if ($contextpage == 'poslist') {
$_GET['optioncss'] = 'print';
$optioncss = 'print';
}
// Security check
$socid = GETPOST('socid', 'int');
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'societe', $socid, '');
$mode = GETPOST("mode", 'alpha');
$search_all = trim(GETPOST('search_all', 'alphanohtml') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$search_cti = preg_replace('/^0+/', '', preg_replace('/[^0-9]/', '', GETPOST('search_cti', 'alphanohtml'))); // Phone number without any special chars
@ -105,8 +99,6 @@ $search_import_key = trim(GETPOST("search_import_key", "alpha"));
$search_parent_name = trim(GETPOST('search_parent_name', 'alpha'));
$type = GETPOST('type', 'alpha');
$optioncss = GETPOST('optioncss', 'alpha');
$mode = GETPOST("mode", 'alpha');
$place = GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : '0'; // $place is string id of table for Bar or Restaurant
$diroutputmassaction = $conf->societe->dir_output.'/temp/massgeneration/'.$user->id;
@ -268,6 +260,14 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
// Security check
$socid = GETPOST('socid', 'int');
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'societe', $socid, '');
/*
* Actions
@ -1737,9 +1737,10 @@ while ($i < min($num, $limit)) {
$totalarray['nbfield']++;
}
}
// Import key
if (!empty($arrayfields['s.import_key']['checked'])) {
print '<td class="tdoverflowmax100">';
print $obj->import_key;
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->import_key).'">';
print dol_escape_htmltag($obj->import_key);
print "</td>\n";
if (!$i) {
$totalarray['nbfield']++;