update code towards php8 compliance
This commit is contained in:
parent
c6484b1df0
commit
82c7a6e9f0
@ -241,7 +241,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
||||
$objphoto = new Product($this->db);
|
||||
$objphoto->fetch($object->lines[$i]->fk_product);
|
||||
|
||||
if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) {
|
||||
if (getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO')) {
|
||||
$pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/";
|
||||
$dir = $conf->product->dir_output.'/'.$pdir;
|
||||
} else {
|
||||
|
||||
@ -206,7 +206,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
||||
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 {
|
||||
|
||||
@ -147,7 +147,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
$upload_dir = $conf->service->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref);
|
||||
}
|
||||
|
||||
if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) { // For backward compatiblity, we scan also old dirs
|
||||
if (getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO')) { // For backward compatiblity, we scan also old dirs
|
||||
if (isModEnabled("product")) {
|
||||
$upload_dirold = $conf->product->multidir_output[$object->entity].'/'.substr(substr("000".$object->id, -2), 1, 1).'/'.substr(substr("000".$object->id, -2), 0, 1).'/'.$object->id."/photos";
|
||||
} else {
|
||||
|
||||
@ -90,7 +90,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
$upload_dir = $conf->service->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'product');
|
||||
}
|
||||
|
||||
if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) { // For backward compatiblity, we scan also old dirs
|
||||
if (getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO')) { // For backward compatiblity, we scan also old dirs
|
||||
if (isModEnabled("product")) {
|
||||
$upload_dirold = $conf->product->multidir_output[$object->entity].'/'.substr(substr("000".$object->id, -2), 1, 1).'/'.substr(substr("000".$object->id, -2), 0, 1).'/'.$object->id."/photos";
|
||||
} else {
|
||||
@ -228,7 +228,7 @@ if ($object->id) {
|
||||
// Build file list
|
||||
$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
|
||||
|
||||
if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) { // For backward compatiblity, we scan also old dirs
|
||||
if (getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO')) { // For backward compatiblity, we scan also old dirs
|
||||
$filearrayold = dol_dir_list($upload_dirold, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
|
||||
$filearray = array_merge($filearray, $filearrayold);
|
||||
}
|
||||
@ -283,7 +283,7 @@ if ($object->id) {
|
||||
|
||||
$filearray = dol_dir_list($upload_dir, "files", 0, '', '\.meta$', 'name', SORT_ASC, 1);
|
||||
|
||||
if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) { // For backward compatiblity, we scan also old dirs
|
||||
if (getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO')) { // For backward compatiblity, we scan also old dirs
|
||||
$filearray = array_merge($filearray, dol_dir_list($upload_dirold, "files", 0, '', '\.meta$', 'name', SORT_ASC, 1));
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user