fix: php8.0 warnings

This commit is contained in:
lmarcouiller 2022-06-02 11:14:35 +02:00
parent 43dedcb2b1
commit 0bad3664fb
5 changed files with 15 additions and 1 deletions

View File

@ -9326,7 +9326,7 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0)
$reg = array();
preg_match('/([<>=]+)/', $crit, $reg);
if ($reg[1]) {
if (!empty($reg[1])) {
$operator = $reg[1];
}
if ($newcrit != '') {

View File

@ -49,6 +49,7 @@ $confirm = GETPOST('confirm', 'alpha');
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$fuserid = (GETPOST('fuserid', 'int') ?GETPOST('fuserid', 'int') : $user->id);
$socid = GETPOST('socid', 'int');
// Load translation files required by the page
$langs->loadLangs(array("other", "holiday", "mails", "trips"));
@ -987,6 +988,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
print dol_get_fiche_head('', '', '', -1);
$out = '';
$nb_holiday = 0;
$typeleaves = $object->getTypes(1, 1);
foreach ($typeleaves as $key => $val) {
$nb_type = $object->getCPforUser($user->id, $val['rowid']);

View File

@ -35,6 +35,8 @@ $langs->loadlangs(array('users', 'other', 'holiday', 'hrm'));
$action = GETPOST('action', 'aZ09');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'defineholidaylist';
$massaction = GETPOST('massaction', 'alpha');
$optioncss = GETPOST('optioncss', 'alpha');
$search_name = GETPOST('search_name', 'alpha');
$search_supervisor = GETPOST('search_supervisor', 'int');

View File

@ -36,6 +36,8 @@ $langs->loadLangs(array('holiday', 'hrm'));
// Security check
$socid = 0;
$id = GETPOST('id', 'int');
if ($user->socid > 0) { // Protection if external user
//$socid = $user->socid;
accessforbidden();
@ -63,6 +65,11 @@ if (!$sortorder) {
$sortorder = "ASC";
}
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) {
$page = 0;
}
$hookmanager->initHooks(array('leavemovementlist'));
$arrayfields = array();

View File

@ -306,6 +306,9 @@ print '</div>';
print '<br>';
$moreforfilter = '';
$morefilter = '';
$disabled = 0;
$include = '';
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
$selectedfields = '';