mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-07 10:08:27 +01:00
update code towards php8 compliance
This commit is contained in:
@@ -6581,7 +6581,7 @@ function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart = '
|
||||
$path = '';
|
||||
|
||||
$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';
|
||||
}
|
||||
if (!empty($level) && in_array($modulepart, $arrayforoldpath)) {
|
||||
|
||||
@@ -183,7 +183,7 @@ function product_prepare_head($object)
|
||||
$upload_dir = $conf->service->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref);
|
||||
}
|
||||
$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)) {
|
||||
$upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir($object->id, 2, 0, 0, $object, 'product').$object->id.'/photos';
|
||||
}
|
||||
|
||||
@@ -241,7 +241,7 @@ class pdf_standard_asset extends ModelePDFAsset
|
||||
if (empty($object->lines[$i]->fk_product)) continue;
|
||||
|
||||
//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[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/';
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user