Debug v16

This commit is contained in:
Laurent Destailleur 2022-06-14 10:40:10 +02:00
parent f261846990
commit f0f24291d4
4 changed files with 14 additions and 5 deletions

View File

@ -7556,11 +7556,15 @@ abstract class CommonObject
if ($classname && class_exists($classname)) {
$object = new $classname($this->db);
if ($object->element === 'product') { // Special cas for product because default valut of fetch are wrong
$object->fetch($value, '', '', '', 0, 1, 1);
$result = $object->fetch($value, '', '', '', 0, 1, 1);
} else {
$object->fetch($value);
$result = $object->fetch($value);
}
if ($result > 0) {
$value = $object->getNomUrl($getnomurlparam, $getnomurlparam2);
} else {
$value = '';
}
$value = $object->getNomUrl($getnomurlparam, $getnomurlparam2);
}
} else {
dol_syslog('Error bad setup of extrafield', LOG_WARNING);

View File

@ -63,9 +63,11 @@ foreach ($object->fields as $key => $val) {
}
print '</td>';
print '<td class="valuefieldcreate">';
if (!empty($val['picto'])) {
print img_picto('', $val['picto'], '', false, 0, 0, '', 'pictofixedwidth');
}
if (in_array($val['type'], array('int', 'integer'))) {
$value = GETPOSTISSET($key) ?GETPOST($key, 'int') : $object->$key;
} elseif ($val['type'] == 'double') {
@ -78,6 +80,8 @@ foreach ($object->fields as $key => $val) {
$check = 'restricthtml';
}
$value = GETPOSTISSET($key) ? GETPOST($key, $check) : $object->$key;
} elseif (in_array($val['type'], array('date', 'datetime'))) {
$value = GETPOSTISSET($key) ? dol_mktime(GETPOST($key.'hour', 'int'), GETPOST($key.'min', 'int'), GETPOST($key.'sec', 'int'), GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')) : $object->$key;
} elseif ($val['type'] == 'price') {
$value = GETPOSTISSET($key) ? price2num(GETPOST($key)) : price2num($object->$key);
} elseif ($key == 'lang') {

View File

@ -287,6 +287,7 @@ ErrorInvoiceLoadThirdParty=Can't load third-party object for invoice "%s"
ErrorInvoiceLoadThirdPartyKey=Third-party key "%s" no set for invoice "%s"
ErrorDeleteLineNotAllowedByObjectStatus=Delete line is not allowed by current object status
ErrorAjaxRequestFailed=Request failed
ErrorThirpdartyOrMemberidIsMandatory=Third party or Member of partnership is mandatory
# Warnings
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.

View File

@ -247,7 +247,7 @@ class Partnership extends CommonObject
public function create(User $user, $notrigger = false)
{
if ($this->fk_soc <= 0 && $this->fk_member <= 0) {
$this->error[] = "ErrorThirpdartyOrMemberidIsManadatory";
$this->error[] = "ErrorThirpdartyOrMemberidIsMandatory";
return -1;
}
@ -555,7 +555,7 @@ class Partnership extends CommonObject
public function update(User $user, $notrigger = false)
{
if ($this->fk_soc <= 0 && $this->fk_member <= 0) {
$this->error[] = "ErrorThirpdartyOrMemberidIsManadatory";
$this->error[] = "ErrorThirpdartyOrMemberidIsMandatory";
return -1;
}