Merge pull request #19588 from Hystepik/develop#2
Fix php 8.0 warnings of modulebuilder
This commit is contained in:
commit
30107837a5
@ -8528,7 +8528,7 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$queryarray[$field] = $this->{$field};
|
$queryarray[$field] = !empty($this->{$field}) ? $this->{$field} : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($info['type'] == 'timestamp' && empty($queryarray[$field])) {
|
if ($info['type'] == 'timestamp' && empty($queryarray[$field])) {
|
||||||
|
|||||||
@ -362,7 +362,7 @@ class MyObject extends CommonObject
|
|||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
// copy external contacts if same company
|
// copy external contacts if same company
|
||||||
if (property_exists($this, 'fk_soc') && $this->fk_soc == $object->socid) {
|
if (!empty($object->socid) && property_exists($this, 'fk_soc') && $this->fk_soc == $object->socid) {
|
||||||
if ($this->copy_linked_contact($object, 'external') < 0) {
|
if ($this->copy_linked_contact($object, 'external') < 0) {
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
@ -918,19 +918,19 @@ class MyObject extends CommonObject
|
|||||||
if ($this->db->num_rows($result)) {
|
if ($this->db->num_rows($result)) {
|
||||||
$obj = $this->db->fetch_object($result);
|
$obj = $this->db->fetch_object($result);
|
||||||
$this->id = $obj->rowid;
|
$this->id = $obj->rowid;
|
||||||
if ($obj->fk_user_author) {
|
if (!empty($obj->fk_user_author)) {
|
||||||
$cuser = new User($this->db);
|
$cuser = new User($this->db);
|
||||||
$cuser->fetch($obj->fk_user_author);
|
$cuser->fetch($obj->fk_user_author);
|
||||||
$this->user_creation = $cuser;
|
$this->user_creation = $cuser;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($obj->fk_user_valid) {
|
if (!empty($obj->fk_user_valid)) {
|
||||||
$vuser = new User($this->db);
|
$vuser = new User($this->db);
|
||||||
$vuser->fetch($obj->fk_user_valid);
|
$vuser->fetch($obj->fk_user_valid);
|
||||||
$this->user_validation = $vuser;
|
$this->user_validation = $vuser;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($obj->fk_user_cloture) {
|
if (!empty($obj->fk_user_cloture)) {
|
||||||
$cluser = new User($this->db);
|
$cluser = new User($this->db);
|
||||||
$cluser->fetch($obj->fk_user_cloture);
|
$cluser->fetch($obj->fk_user_cloture);
|
||||||
$this->user_cloture = $cluser;
|
$this->user_cloture = $cluser;
|
||||||
|
|||||||
@ -129,7 +129,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
|||||||
// Load object
|
// Load object
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||||
if ($id > 0 || !empty($ref)) {
|
if ($id > 0 || !empty($ref)) {
|
||||||
$upload_dir = $conf->mymodule->multidir_output[$object->entity]."/".$object->id;
|
$upload_dir = $conf->mymodule->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
$permissiontoadd = $user->rights->mymodule->myobject->write; // Used by the include of actions_addupdatedelete.inc.php
|
$permissiontoadd = $user->rights->mymodule->myobject->write; // Used by the include of actions_addupdatedelete.inc.php
|
||||||
|
|||||||
@ -92,7 +92,7 @@ $cancel = GETPOST('cancel', 'aZ09');
|
|||||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectcard'; // To manage different context of search
|
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectcard'; // To manage different context of search
|
||||||
$backtopage = GETPOST('backtopage', 'alpha');
|
$backtopage = GETPOST('backtopage', 'alpha');
|
||||||
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
|
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
|
||||||
//$lineid = GETPOST('lineid', 'int');
|
$lineid = GETPOST('lineid', 'int');
|
||||||
|
|
||||||
// Initialize technical objects
|
// Initialize technical objects
|
||||||
$object = new MyObject($db);
|
$object = new MyObject($db);
|
||||||
@ -505,7 +505,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Clone
|
// Clone
|
||||||
print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken(), '', $permissiontoadd);
|
print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($object->socid)?'&socid='.$object->socid:'').'&action=clone&token='.newToken(), '', $permissiontoadd);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if ($permissiontoadd) {
|
if ($permissiontoadd) {
|
||||||
|
|||||||
@ -98,7 +98,7 @@ $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("pa
|
|||||||
if (empty($page) || $page == -1) {
|
if (empty($page) || $page == -1) {
|
||||||
$page = 0;
|
$page = 0;
|
||||||
} // If $page is not defined, or '' or -1
|
} // If $page is not defined, or '' or -1
|
||||||
$offset = $liste_limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
if (!$sortorder) {
|
if (!$sortorder) {
|
||||||
|
|||||||
@ -98,7 +98,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
|||||||
// Load object
|
// Load object
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||||
if ($id > 0 || !empty($ref)) {
|
if ($id > 0 || !empty($ref)) {
|
||||||
$upload_dir = $conf->mymodule->multidir_output[$object->entity]."/".$object->id;
|
$upload_dir = $conf->mymodule->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
$permissionnote = $user->rights->mymodule->myobject->write; // Used by the include of actions_setnotes.inc.php
|
$permissionnote = $user->rights->mymodule->myobject->write; // Used by the include of actions_setnotes.inc.php
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user