update code towards php8 compliance

This commit is contained in:
Philippe GRAND
2022-10-06 16:44:52 +02:00
parent 06d787713a
commit d6e12d3589
3 changed files with 3 additions and 3 deletions

View File

@@ -6581,7 +6581,7 @@ function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart = '
$path = ''; $path = '';
$arrayforoldpath = array('cheque', 'category', 'holiday', 'supplier_invoice', 'invoice_supplier', 'mailing', 'supplier_payment'); $arrayforoldpath = array('cheque', 'category', 'holiday', 'supplier_invoice', 'invoice_supplier', 'mailing', 'supplier_payment');
if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) { if (getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO')) {
$arrayforoldpath[] = 'product'; $arrayforoldpath[] = 'product';
} }
if (!empty($level) && in_array($modulepart, $arrayforoldpath)) { if (!empty($level) && in_array($modulepart, $arrayforoldpath)) {

View File

@@ -183,7 +183,7 @@ function product_prepare_head($object)
$upload_dir = $conf->service->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref); $upload_dir = $conf->service->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref);
} }
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) { if (getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO')) {
if (isModEnabled("product") && ($object->type == Product::TYPE_PRODUCT)) { if (isModEnabled("product") && ($object->type == Product::TYPE_PRODUCT)) {
$upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir($object->id, 2, 0, 0, $object, 'product').$object->id.'/photos'; $upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir($object->id, 2, 0, 0, $object, 'product').$object->id.'/photos';
} }

View File

@@ -241,7 +241,7 @@ class pdf_standard_asset extends ModelePDFAsset
if (empty($object->lines[$i]->fk_product)) continue; if (empty($object->lines[$i]->fk_product)) continue;
//var_dump($objphoto->ref);exit; //var_dump($objphoto->ref);exit;
if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) { if (getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO')) {
$pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; $pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/";
$pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; $pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/';
} else { } else {