diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index 9a1c98273cb..c153e3ecb98 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -313,9 +313,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $disposal_type_form = $object->showInputField(null, 'fk_disposal_type', (string) $fk_disposal_type, '', '', '', 0); $object->fields['fk_disposal_type']['visible'] = -2; - $object->fields['disposal_invoice_id'] = array('type' => 'integer:Facture:compta/facture/class/facture.class.php::(entity:in:__SHARED_ENTITIES__)', 'enabled' => '1', 'notnull' => 1, 'visible' => 1, 'index' => 1, 'validate' => '1',); - $disposal_invoice_form = $object->showInputField(null, 'disposal_invoice_id', (string) $disposal_invoice_id, '', '', '', 0); - unset($object->fields['disposal_invoice_id']); + $disposal_invoice_form = $form->selectForForms('Facture:compta/facture/class/facture.class.php::(entity:IN:__SHARED_ENTITIES__)', 'disposal_invoice_id', $disposal_invoice_id); // Create an array for form $formquestion = array( diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index fa2e2a8ce6c..64fd8fdef7c 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -2085,7 +2085,9 @@ if ($action == 'create') { if ($objp->fk_product > 0) { $product = new Product($db); $product->fetch($objp->fk_product); - $dateactend = dol_time_plus_duree(time(), $product->duration_value, $product->duration_unit); + if (!empty($product->duration_value) && !empty($product->duration_unit)) { + $dateactend = dol_time_plus_duree(time(), $product->duration_value, $product->duration_unit); + } } } diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index b3a4134d4b9..9eca62ab720 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -331,7 +331,11 @@ class CMailFile // Note because media links are public, this should be useless, except avoid blocking images with email browser. // This converts an embed file with src="/viewimage.php?modulepart... into a cid link // TODO Exclude viewimage used for the read tracker ? - $findimg = $this->findHtmlImages($dolibarr_main_data_root.'/medias'); + $dolibarr_main_data_root_images = $dolibarr_main_data_root; + if ($conf->entity !== 1) { + $dolibarr_main_data_root_images.='/'.$conf->entity.'/'; + } + $findimg = $this->findHtmlImages($dolibarr_main_data_root_images.'/medias'); if ($findimg < 0) { dol_syslog("CMailFile::CMailfile: Error on findHtmlImages"); $this->error = 'ErrorInAddAttachmentsImageBaseOnMedia'; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f1da4c852a7..668614289cd 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2024 Laurent Destailleur + * Copyright (C) 2004-2025 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2004 Christophe Combelles diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index a60fc341832..9c33922bf92 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -6,6 +6,7 @@ * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Nick Fragoulis + * Copyright (C) 2025 Joachim Küter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -806,7 +807,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("EscompteOfferedShort"), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 0, $outputlangs), $useborder, 'R', true); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 0, $outputlangs), $useborder, 'R', true); $resteapayer = 0; } diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 4e8d495d50f..4328520dfc5 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -64,7 +64,7 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield } $value = $datenotinstring; } elseif (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('int'))) { - $value = (!empty($obj->$tmpkey) || $obj->$tmpkey === '0' ? $obj->$tmpkey : ''); + $value = $obj->$tmpkey ?? (isset($obj->array_options[$tmpkey]) ? $obj->array_options[$tmpkey] : null) ?? ''; } else { // The key may be in $obj->array_options if not in $obj $value = (isset($obj->$tmpkey) ? $obj->$tmpkey : @@ -79,7 +79,7 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield } } - $valuetoshow = $extrafields->showOutputField($key, $value, '', $extrafieldsobjectkey, null, $object); + $valuetoshow = $extrafields->showOutputField($key, $value, '', $extrafieldsobjectkey, null, $object ?? null); $title = dol_string_nohtmltag($valuetoshow); print 'trans('TicketNotificationRecipient').' : '.$recipient.'
' : ''); + $message .= (!empty($recipient) ? '
'.$langs->trans('TicketNotificationRecipient').' : '.$recipient.'
' : ''); } } $message .= '
'; @@ -2971,7 +2971,7 @@ class Ticket extends CommonObject } $recipient = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'], -1).' ('.strtolower((string) $info_sendto['libelle']).')'; - $message .= (!empty($recipient) ? $langs->trans('TicketNotificationRecipient').' : '.$recipient.'
' : ''); + $message .= (!empty($recipient) ? '
'.$langs->trans('TicketNotificationRecipient').' : '.$recipient.'
' : ''); } }