fix : php 8.1 warnings

This commit is contained in:
hystepik 2023-01-24 14:32:20 +01:00
parent 58043c5d5e
commit 32da192db4
8 changed files with 23 additions and 7 deletions

View File

@ -144,9 +144,12 @@ $form = new Form($db);
$title = $langs->trans("LT".$object->ltt)." - ".$langs->trans("Card");
$help_url = '';
llxHeader('', $title, $helpurl);
llxHeader('', $title, $help_url);
if ($action == 'create') {
$datev = dol_mktime(12, 0, 0, GETPOST("datevmonth"), GETPOST("datevday"), GETPOST("datevyear"));
$datep = dol_mktime(12, 0, 0, GETPOST("datepmonth"), GETPOST("datepday"), GETPOST("datepyear"));
print load_fiche_titre($langs->transcountry($lttype == 2 ? "newLT2Payment" : "newLT1Payment", $mysoc->country_code));
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" name="formlocaltax" method="post">'."\n";

View File

@ -822,6 +822,9 @@ while ($i < min($num, $limit)) {
if (!$i) {
$totalarray['pos'][$totalarray['nbfield']] = 'cd.qty';
}
if (!$i) {
$totalarray['val']['cd.qty'] = $obj->qty;
}
$totalarray['val']['cd.qty'] += $obj->qty;
}
if (!empty($arrayfields['cd.total_ht']['checked'])) {

View File

@ -66,6 +66,7 @@ $error = 0;
* Actions
*/
$parameters = array();
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@ -291,13 +292,13 @@ if ($action == 'create') {
// Date Start
print "<tr>";
print '<td class="fieldrequired">'.$langs->trans("DateStart").'</td><td>';
print $form->selectDate($datestart ? $datestart : -1, 'start', '', '', '', 'add', 1, 1);
print $form->selectDate(!empty($datestart) ? $datestart : -1, 'start', '', '', '', 'add', 1, 1);
print '</td></tr>';
// Date End
print "<tr>";
print '<td class="fieldrequired">'.$langs->trans("DateEnd").'</td><td>';
print $form->selectDate($dateend ? $dateend : -1, 'end', '', '', '', 'add', 1, 1);
print $form->selectDate(!empty($dateend) ? $dateend : -1, 'end', '', '', '', 'add', 1, 1);
print '</td></tr>';
// Number of terms

View File

@ -42,6 +42,7 @@ $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
$massaction = GETPOST('massaction', 'alpha');
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) {
$page = 0;
} // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
@ -148,6 +149,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
}
$db->free($resql);
}
$arrayfields = array();
// Complete request and execute it with limit
$sql .= $db->order($sortfield, $sortorder);

View File

@ -1485,7 +1485,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
}
if ($type == 1 && $conf->workstation->enabled) {
if ($type == 1 && isModEnabled("workstation")) {
// Default workstation
print '<tr><td>'.$langs->trans("DefaultWorkstation").'</td><td>';
print img_picto($langs->trans("DefaultWorkstation"), 'workstation', 'class="pictofixedwidth"');

View File

@ -133,7 +133,7 @@ $helpurl = 'EN:Module_Stocks_En|FR:Module_Stock|ES:M&oacute;dulo_Stocks';
$form = new Form($db);
$htmlother = new FormOther($db);
if ($objp->stock_physique < 0) { print '<span class="warning">'; }
if (!empty($objp->stock_physique) && $objp->stock_physique < 0) { print '<span class="warning">'; }
$sql = 'SELECT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,';
$sql .= ' p.fk_product_type, p.tms as datem,';

View File

@ -72,7 +72,7 @@ if ($origin == 'reception') {
} else {
if ($origin == 'supplierorder' || $origin == 'order_supplier') {
$result = restrictedArea($user, 'fournisseur', $origin_id, 'commande_fournisseur', 'commande');
} elseif (empty($user->rights->{$origin}->lire) && empty($user->rights->{$origin}->read)) {
} elseif (empty($user->hasRight($origin, "lire")) && empty($user->hasRight($origin, "read"))) {
accessforbidden();
}
}

View File

@ -97,6 +97,7 @@ $search_chq_number = GETPOST('search_chq_number', 'int');
$filtre = GETPOST("filtre", 'restricthtml');
$search_type_id = '';
if (!GETPOST('search_type_id', 'int')) {
$newfiltre = str_replace('filtre=', '', $filtre);
$filterarray = explode('-', $newfiltre);
@ -532,6 +533,7 @@ if (isset($extrafields->attributes[$object->table_element]['computed']) && is_ar
$i = 0;
$total = 0;
$totalarray = array();
$totalarray['nbfield'] = 0;
while ($i < ($limit ? min($num, $limit) : $num)) {
$obj = $db->fetch_object($resql);
if (empty($obj)) {
@ -697,7 +699,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
if (!$i) {
$totalarray['pos'][$totalarray['nbfield']] = 'totalttcfield';
}
$totalarray['val']['totalttcfield'] += $obj->amount;
if (!$i) {
$totalarray['val']['totalttcfield'] = $obj->amount;
} else {
$totalarray['val']['totalttcfield'] += $obj->amount;
}
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';