FIX avoid php8 warnings
This commit is contained in:
parent
4ae0e6ed09
commit
3b00c76cdd
2 changed files with 11 additions and 9 deletions
|
|
@ -141,17 +141,18 @@ if ($id > 0 || !empty($ref)) {
|
|||
if ($result < 0) {
|
||||
dol_print_error($db, $object->error, $object->errors);
|
||||
}
|
||||
$entity = (!empty($object->entity) ? $object->entity : $conf->entity);
|
||||
if (isModEnabled("product")) {
|
||||
$upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref);
|
||||
$upload_dir = $conf->product->multidir_output[$entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref);
|
||||
} elseif (isModEnabled("service")) {
|
||||
$upload_dir = $conf->service->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref);
|
||||
$upload_dir = $conf->service->multidir_output[$entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref);
|
||||
}
|
||||
|
||||
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";
|
||||
$upload_dirold = $conf->product->multidir_output[$entity].'/'.substr(substr("000".$object->id, -2), 1, 1).'/'.substr(substr("000".$object->id, -2), 0, 1).'/'.$object->id."/photos";
|
||||
} else {
|
||||
$upload_dirold = $conf->service->multidir_output[$object->entity].'/'.substr(substr("000".$object->id, -2), 1, 1).'/'.substr(substr("000".$object->id, -2), 0, 1).'/'.$object->id."/photos";
|
||||
$upload_dirold = $conf->service->multidir_output[$entity].'/'.substr(substr("000".$object->id, -2), 1, 1).'/'.substr(substr("000".$object->id, -2), 0, 1).'/'.$object->id."/photos";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -497,10 +498,11 @@ if (empty($reshook)) {
|
|||
if (!$error) {
|
||||
$units = GETPOST('units', 'int');
|
||||
|
||||
$object->ref = $ref;
|
||||
$object->label = GETPOST('label', $label_security_check);
|
||||
$object->price_base_type = GETPOST('price_base_type', 'aZ09');
|
||||
$object->mandatory_period = !empty(GETPOST("mandatoryperiod", 'alpha')) ? 1 : 0;
|
||||
$object->entity = $conf->entity;
|
||||
$object->ref = $ref;
|
||||
$object->label = GETPOST('label', $label_security_check);
|
||||
$object->price_base_type = GETPOST('price_base_type', 'aZ09');
|
||||
$object->mandatory_period = !empty(GETPOST("mandatoryperiod", 'alpha')) ? 1 : 0;
|
||||
if ($object->price_base_type == 'TTC') {
|
||||
$object->price_ttc = GETPOST('price');
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -770,7 +770,7 @@ class Product extends CommonObject
|
|||
$sql .= ", mandatory_period";
|
||||
$sql .= ") VALUES (";
|
||||
$sql .= "'".$this->db->idate($now)."'";
|
||||
$sql .= ", ".((int) $conf->entity);
|
||||
$sql .= ", ".(!empty($this->entity) ? (int) $this->entity : (int) $conf->entity);
|
||||
$sql .= ", '".$this->db->escape($this->ref)."'";
|
||||
$sql .= ", ".(!empty($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'" : "null");
|
||||
$sql .= ", ".price2num($price_min_ht);
|
||||
|
|
|
|||
Loading…
Reference in a new issue