Fix php 8 warning in inventory module
This commit is contained in:
parent
5d824899e5
commit
df5878b3d6
@ -49,7 +49,10 @@ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
|
|||||||
// Initialize technical objects
|
// Initialize technical objects
|
||||||
$object = new Inventory($db);
|
$object = new Inventory($db);
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
$diroutputmassaction = $conf->stock->dir_output.'/temp/massgeneration/'.$user->id;
|
// no inventory docs yet
|
||||||
|
$includedocgeneration = false;
|
||||||
|
$diroutputmassaction = null;
|
||||||
|
// $diroutputmassaction = $conf->stock->dir_output.'/temp/massgeneration/'.$user->id;
|
||||||
$hookmanager->initHooks(array('inventorycard', 'globalcard')); // Note that conf->hooks_modules contains array
|
$hookmanager->initHooks(array('inventorycard', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||||
|
|
||||||
// Fetch optionals attributes and labels
|
// Fetch optionals attributes and labels
|
||||||
@ -180,7 +183,7 @@ if ($action == 'create') {
|
|||||||
if ($backtopage) {
|
if ($backtopage) {
|
||||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
}
|
}
|
||||||
if ($backtopageforcancel) {
|
if (isset($backtopageforcancel)) {
|
||||||
print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
|
print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -261,10 +264,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
if ($action == 'delete') {
|
if ($action == 'delete') {
|
||||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteInventory'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteInventory'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
|
||||||
}
|
}
|
||||||
// Confirmation to delete line
|
|
||||||
if ($action == 'deleteline') {
|
|
||||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clone confirmation
|
// Clone confirmation
|
||||||
if ($action == 'clone') {
|
if ($action == 'clone') {
|
||||||
@ -290,7 +289,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Call Hook formConfirm
|
// Call Hook formConfirm
|
||||||
$parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
|
$parameters = array('formConfirm' => $formconfirm);
|
||||||
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
$formconfirm .= $hookmanager->resPrint;
|
$formconfirm .= $hookmanager->resPrint;
|
||||||
@ -469,7 +468,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
// List of actions on element
|
// List of actions on element
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||||
$formactions = new FormActions($db);
|
$formactions = new FormActions($db);
|
||||||
$somethingshown = $formactions->showactions($object, 'inventory', $socid, 1, '', $MAXEVENT, '', $morehtmlright);
|
$somethingshown = $formactions->showactions($object, 'inventory', 0, 1, '', $MAXEVENT, '', $morehtmlright);
|
||||||
|
|
||||||
print '</div></div></div>';
|
print '</div></div></div>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -616,7 +616,7 @@ if ($object->id > 0) {
|
|||||||
while ($i < $num) {
|
while ($i < $num) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
if (is_object($cacheOfWarehouses[$obj->fk_warehouse])) {
|
if (isset($cacheOfWarehouses[$obj->fk_warehouse])) {
|
||||||
$warehouse_static = $cacheOfWarehouses[$obj->fk_warehouse];
|
$warehouse_static = $cacheOfWarehouses[$obj->fk_warehouse];
|
||||||
} else {
|
} else {
|
||||||
$warehouse_static = new Entrepot($db);
|
$warehouse_static = new Entrepot($db);
|
||||||
@ -625,7 +625,7 @@ if ($object->id > 0) {
|
|||||||
$cacheOfWarehouses[$warehouse_static->id] = $warehouse_static;
|
$cacheOfWarehouses[$warehouse_static->id] = $warehouse_static;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_object($cacheOfProducts[$obj->fk_product])) {
|
if (isset($cacheOfProducts[$obj->fk_product])) {
|
||||||
$product_static = $cacheOfProducts[$obj->fk_product];
|
$product_static = $cacheOfProducts[$obj->fk_product];
|
||||||
} else {
|
} else {
|
||||||
$product_static = new Product($db);
|
$product_static = new Product($db);
|
||||||
|
|||||||
@ -59,7 +59,9 @@ $pagenext = $page + 1;
|
|||||||
// Initialize technical objects
|
// Initialize technical objects
|
||||||
$object = new Inventory($db);
|
$object = new Inventory($db);
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
$diroutputmassaction = $conf->inventory->dir_output.'/temp/massgeneration/'.$user->id;
|
// no inventory docs yet
|
||||||
|
// $diroutputmassaction = $conf->inventory->dir_output.'/temp/massgeneration/'.$user->id;
|
||||||
|
$diroutputmassaction = null;
|
||||||
$hookmanager->initHooks(array('inventorylist')); // Note that conf->hooks_modules contains array
|
$hookmanager->initHooks(array('inventorylist')); // Note that conf->hooks_modules contains array
|
||||||
// Fetch optionals attributes and labels
|
// Fetch optionals attributes and labels
|
||||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
@ -127,9 +129,9 @@ if ($user->socid > 0) { // Protection if external user
|
|||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
|
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
|
||||||
$result = restrictedArea($user, 'stock', $objectid);
|
$result = restrictedArea($user, 'stock');
|
||||||
} else {
|
} else {
|
||||||
$result = restrictedArea($user, 'stock', $objectid, '', 'inventory_advance');
|
$result = restrictedArea($user, 'stock', 0, '', 'inventory_advance');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -624,7 +626,8 @@ print '</table>'."\n";
|
|||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
|
|
||||||
print '</form>'."\n";
|
print '</form>'."\n";
|
||||||
|
// no inventory docs yet
|
||||||
|
/*
|
||||||
if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
|
if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
|
||||||
$hidegeneratedfilelistifempty = 1;
|
$hidegeneratedfilelistifempty = 1;
|
||||||
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
|
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
|
||||||
@ -644,7 +647,7 @@ if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $n
|
|||||||
|
|
||||||
print $formfile->showdocuments('massfilesarea_mymodule', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
|
print $formfile->showdocuments('massfilesarea_mymodule', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
// End of page
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user