From c2fec407ba03388bec59b466ed339594b9c24156 Mon Sep 17 00:00:00 2001 From: Lynda Date: Mon, 1 Jun 2026 16:59:18 +0300 Subject: [PATCH 1/4] Fix two options for expedition --- ...rface_90_modInfrastructure_infrastructuretrigger.class.php | 2 +- langs/en_US/infrastructure.lang | 4 ++-- langs/es_ES/infrastructure.lang | 4 ++-- langs/fr_FR/infrastructure.lang | 4 ++-- langs/it_IT/infrastructure.lang | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/triggers/interface_90_modInfrastructure_infrastructuretrigger.class.php b/core/triggers/interface_90_modInfrastructure_infrastructuretrigger.class.php index 355b45b..2fd7268 100644 --- a/core/triggers/interface_90_modInfrastructure_infrastructuretrigger.class.php +++ b/core/triggers/interface_90_modInfrastructure_infrastructuretrigger.class.php @@ -568,7 +568,7 @@ private function ShippingCreate($object, $user, $langs) foreach ($object->lines as &$line) { $orderline = new OrderLine($this->db); $orderline->fetch($line->origin_line_id); - if (getDolGlobalString('NO_TITLE_SHOW_ON_EXPED_GENERATION')) { + if (getDolGlobalString('INFRASTRUCTURE_NO_TITLE_SHOW_ON_EXPED_GENERATION')) { if (!isset($line->special_code) && $cmd) { foreach ($cmd->lines as $cmdLine) { if ($cmdLine->id == $line->origin_line_id) { diff --git a/langs/en_US/infrastructure.lang b/langs/en_US/infrastructure.lang index 1d1d177..02a4e4f 100644 --- a/langs/en_US/infrastructure.lang +++ b/langs/en_US/infrastructure.lang @@ -247,5 +247,5 @@ InfrastructurePdfTotalBackgroundCellHeightOffset = Height offset (mm) of t InfrastructurePdfTotalBackgroundCellPosYOffset = Vertical offset (mm) of the colored background cell for totals in PDFs InfrastructureBackgroundCellOffsetInfo = Allows fine-tuning of the colored background cell rendering to compensate for differences between text height and cell height. No effect if no background color is defined. InfrastructureBackgroundCellOffsetInfo1 = Allows fine-tuning of the colored background cell rendering to compensate for differences between text height and cell height. No effect if no background color is defined. Positive number moves down, otherwise moves up. -InfrastructureDefaultCheckShippingListForTitleDesc = Pre-check « Include shipping list » by default when adding a title -InfrastructureDefaultCheckShippingListForTitleDescInfo = When enabled, the « Add shipping list to title description » checkbox is pre-checked in the title add/edit form. +InfrastructureDefaultCheckShippingListForTitleDesc = Pre-check the « Add the reference list of related shipping or delivery notes to the title block description » checkbox by default when invoicing orders in bulk. +InfrastructureDefaultCheckShippingListForTitleDescInfo = When enabled, the « Add the reference list of related shipping or delivery notes to the title block description » checkbox is pre-checked by default in the mass order invoicing form. diff --git a/langs/es_ES/infrastructure.lang b/langs/es_ES/infrastructure.lang index 8f50d85..a1efc06 100644 --- a/langs/es_ES/infrastructure.lang +++ b/langs/es_ES/infrastructure.lang @@ -247,5 +247,5 @@ InfrastructurePdfTotalBackgroundCellHeightOffset = Desplazamiento de altur InfrastructurePdfTotalBackgroundCellPosYOffset = Desplazamiento vertical (mm) de la celda de fondo coloreada de los subtotales en los PDF InfrastructureBackgroundCellOffsetInfo = Permite ajustar finamente la representación de la celda de fondo coloreada para compensar las diferencias entre la altura del texto y la altura de la celda. Sin efecto si no se define un color de fondo. InfrastructureBackgroundCellOffsetInfo1 = Permite ajustar finamente la representación de la celda de fondo coloreada para compensar las diferencias entre la altura del texto y la altura de la celda. Sin efecto si no se define un color de fondo. Número positivo desplaza hacia abajo, de lo contrario hacia arriba. -InfrastructureDefaultCheckShippingListForTitleDesc = Marcar por defecto « Incluir lista de envíos » al añadir un título -InfrastructureDefaultCheckShippingListForTitleDescInfo = Cuando se activa, la casilla « Añadir la lista de envíos a la descripción del título » se marca previamente en el formulario de añadir/editar título. +InfrastructureDefaultCheckShippingListForTitleDesc = Marcar por defecto « Agregar la lista de referencias de los albaranes o notas de entrega relacionados a la descripción del bloque de título » al facturar pedidos en masa. +InfrastructureDefaultCheckShippingListForTitleDescInfo = Cuando se activa, la casilla « Agregar la lista de referencias de los albaranes o notas de entrega relacionados a la descripción del bloque de título » se marca previamente por defecto en el formulario de facturación masiva de pedidos. diff --git a/langs/fr_FR/infrastructure.lang b/langs/fr_FR/infrastructure.lang index 5a06116..ef30a30 100644 --- a/langs/fr_FR/infrastructure.lang +++ b/langs/fr_FR/infrastructure.lang @@ -247,5 +247,5 @@ InfrastructurePdfTotalBackgroundCellHeightOffset = Augmentation de la haut InfrastructurePdfTotalBackgroundCellPosYOffset = Décalage vertical du fond des sous-totaux dans les PDF InfrastructureBackgroundCellOffsetInfo = Permet d'ajuster finement le rendu de la cellule de fond colorée pour compenser les écarts entre la hauteur de texte et la hauteur de cellule. Sans effet si aucune couleur de fond n'est définie. InfrastructureBackgroundCellOffsetInfo1 = Permet d'ajuster finement le rendu de la cellule de fond colorée pour compenser les écarts entre la hauteur de texte et la hauteur de cellule. Sans effet si aucune couleur de fond n'est définie. Chiffre positive décalage vers le bas, sinon vers le haut. -InfrastructureDefaultCheckShippingListForTitleDesc = Cocher par défaut « Inclure la liste des expéditions » lors de l'ajout d'un titre -InfrastructureDefaultCheckShippingListForTitleDescInfo = Quand activée, la case à cocher « Ajouter la liste des expéditions à la description du titre » est pré-cochée dans le formulaire d'ajout/édition de titre. +InfrastructureDefaultCheckShippingListForTitleDesc = Cocher par défaut « Ajouter à la description du bloc titre la liste des références des bons d'expédition ou de livraison liés » lors de la facturation commande en masse. +InfrastructureDefaultCheckShippingListForTitleDescInfo = Quand activée, la case à cocher « Ajouter à la description du bloc titre la liste des références des bons d'expédition ou de livraison liés » est pré-cochée par défaut dans le formulaire de facturation groupée de commandes. diff --git a/langs/it_IT/infrastructure.lang b/langs/it_IT/infrastructure.lang index 8908391..ccaa220 100644 --- a/langs/it_IT/infrastructure.lang +++ b/langs/it_IT/infrastructure.lang @@ -247,5 +247,5 @@ InfrastructurePdfTotalBackgroundCellHeightOffset = Aumento dell'altezza de InfrastructurePdfTotalBackgroundCellPosYOffset = Spostamento verticale dello sfondo dei subtotali nei PDF InfrastructureBackgroundCellOffsetInfo = Permette di regolare finemente il rendering della cella di sfondo colorata per compensare le differenze tra altezza del testo e altezza della cella. Senza effetto se non è definito alcun colore di sfondo. InfrastructureBackgroundCellOffsetInfo1 = Permette di regolare finemente il rendering della cella di sfondo colorata per compensare le differenze tra altezza del testo e altezza della cella. Senza effetto se non è definito alcun colore di sfondo. Numero positivo sposta verso il basso, altrimenti verso l'alto. -InfrastructureDefaultCheckShippingListForTitleDesc = Spuntare per default « Includi lista spedizioni » quando si aggiunge un titolo -InfrastructureDefaultCheckShippingListForTitleDescInfo = Quando attivata, la casella « Aggiungi la lista delle spedizioni alla descrizione del titolo » è pre-selezionata nel modulo di aggiunta/modifica del titolo. +InfrastructureDefaultCheckShippingListForTitleDesc = Spuntare per default « Aggiungere alla descrizione del blocco titolo la lista dei riferimenti dei documenti di spedizione o di consegna collegati » durante la fatturazione massiva degli ordini. +InfrastructureDefaultCheckShippingListForTitleDescInfo = Quando attivata, la casella « Aggiungere alla descrizione del blocco titolo la lista dei riferimenti dei documenti di spedizione o di consegna collegati » è pre-selezionata per default nel modulo di fatturazione massiva degli ordini. From b9adb2befde9fdc9babea2285a767be34540783a Mon Sep 17 00:00:00 2001 From: Lynda Date: Tue, 2 Jun 2026 16:59:51 +0300 Subject: [PATCH 2/4] fix on supplier card --- class/actions_infrastructure.class.php | 4 +--- class/infrastructure.class.php | 18 ++++++++---------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/class/actions_infrastructure.class.php b/class/actions_infrastructure.class.php index 6f2d28f..faf2197 100644 --- a/class/actions_infrastructure.class.php +++ b/class/actions_infrastructure.class.php @@ -360,9 +360,7 @@ public function formBuilddocOptions($parameters, &$object, &$action, HookManager if (($object instanceof Propal && getDolGlobalString('INFRASTRUCTURE_PROPAL_ADD_RECAP')) || ($object instanceof Commande && getDolGlobalString('INFRASTRUCTURE_COMMANDE_ADD_RECAP')) || ($object instanceof Facture && getDolGlobalString('INFRASTRUCTURE_INVOICE_ADD_RECAP')) || - ($object instanceof FactureRec && getDolGlobalString('INFRASTRUCTURE_INVOICE_ADD_RECAP')) || - ($object instanceof CommandeFournisseur && getDolGlobalString('INFRASTRUCTURE_COMMANDE_ADD_RECAP')) || - ($object instanceof FactureFournisseur && getDolGlobalString('INFRASTRUCTURE_INVOICE_ADD_RECAP'))) + ($object instanceof FactureRec && getDolGlobalString('INFRASTRUCTURE_INVOICE_ADD_RECAP'))) { $this->resprints .= ' diff --git a/class/infrastructure.class.php b/class/infrastructure.class.php index 0fd656e..48a9618 100644 --- a/class/infrastructure.class.php +++ b/class/infrastructure.class.php @@ -146,18 +146,17 @@ static function showQtyForObjectLine($line, $show_by_default = false) */ static function addInfrastructureLine(&$object, $label, $qty, $rang=-1, $desc = '') { - $res = 0; - $desc = ''; - $TNotElements = ['invoice_supplier', 'order_supplier']; + $res = 0; + $desc = ''; + $TNotElements = ['invoice_supplier', 'order_supplier']; if ($qty == 50 && !in_array($object->element, $TNotElements)) { - $desc = $label; - $label = ''; + $desc = $label; + $label = ''; } if ($object->element=='facture') { $res = $object->addline($desc, 0, $qty, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 'HT', 0, 9, $rang, TInfrastructure::getModuleNumber(), '', 0, 0, null, 0, $label); } elseif ($object->element=='invoice_supplier') { - $object->special_code = TInfrastructure::getModuleNumber(); - $res = $object->addline($label, 0, 0, 0, 0, $qty, 0, 0, 0, 0, 0, 0, 'HT', 9, $rang, false, [], null, 0, 0, '', TInfrastructure::getModuleNumber()); + $res = $object->addline($label, 0, 0, 0, 0, $qty, 0, 0, 0, 0, 0, 0, 'HT', 9, $rang, false, [], null, 0, 0, '', TInfrastructure::getModuleNumber()); } elseif ($object->element=='propal') { $res = $object->addline($desc, 0, $qty, 0, 0, 0, 0, 0, 'HT', 0, 0, 9, $rang, TInfrastructure::getModuleNumber(), 0, 0, 0, $label); } elseif ($object->element=='supplier_proposal') { @@ -165,10 +164,9 @@ static function addInfrastructureLine(&$object, $label, $qty, $rang=-1, $desc = } elseif ($object->element=='commande') { $res = $object->addline($desc, 0, $qty, 0, 0, 0, 0, 0, 0, 0, 'HT', 0, '', '', 9, $rang, TInfrastructure::getModuleNumber(), 0, null, 0, $label); } elseif ($object->element=='order_supplier') { - $object->special_code = TInfrastructure::getModuleNumber(); // à garder pour la rétrocompatibilité - $res = $object->addline($label, 0, $qty, 0, 0, 0, 0, 0, '', 0, 'HT', 0, 9, 0, false, null, null, 0, null, 0, '', 0, -1, TInfrastructure::getModuleNumber()); + $res = $object->addline($label, 0, $qty, 0, 0, 0, 0, 0, '', 0, 'HT', 0, 9, 0, false, null, null, 0, null, 0, '', 0, $rang, TInfrastructure::getModuleNumber()); } elseif ($object->element=='facturerec') { - $res = $object->addline($desc, 0, $qty, 0, 0, 0, 0, 0, 'HT', 0, '', 0, 9, $rang, TInfrastructure::getModuleNumber(), $label); + $res = $object->addline($desc, 0, $qty, 0, 0, 0, 0, 0, 'HT', 0, '', 0, 9, $rang, TInfrastructure::getModuleNumber(), $label); } self::generateDoc($object); return $res; From 9f6d0d595bd6e7bb7f4e91da3afe5571ecca116e Mon Sep 17 00:00:00 2001 From: Lynda Date: Wed, 3 Jun 2026 16:55:40 +0300 Subject: [PATCH 3/4] Fix parameters related to extra fields --- admin/infrastructuresetup.php | 6 ++-- core/lib/infrastructure.lib.php | 28 ++++++++++++++++--- .../infrastructureline_row_document.tpl.php | 2 +- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/admin/infrastructuresetup.php b/admin/infrastructuresetup.php index 1d5b68d..ef270b9 100644 --- a/admin/infrastructuresetup.php +++ b/admin/infrastructuresetup.php @@ -248,11 +248,11 @@ function infrastructureResetSelect2Width($container) { infrastructure_print_subTitle(4, 'InfrastructureSetupForExtrafields'); $metas = ['class' => 'flat infrastructurewidth270 infrastructurefontsizeinherit']; $num = infrastructure_print_input('INFRASTRUCTURE_ALLOW_EXTRAFIELDS_ON_TITLE', 'on_off', $langs->trans('InfrastructureAllowExtrafieldsOnTitle'), '', [], 2, 1, '', $num); - $metas = $form->multiselectarray('INFRASTRUCTURE_LIST_OF_EXTRAFIELDS_PROPALDET', $extrafields->fetch_name_optionals_label('propaldet'), $propalSelected, 0, 0, 'flat infrastructurewidth270 infrastructurefontsizeinherit', 0, 0, '', '', ''); + $metas = $form->multiselectarray('INFRASTRUCTURE_LIST_OF_EXTRAFIELDS_PROPALDET', getVisibleExtrafields('propaldet'), $propalSelected, 0, 0, 'flat infrastructurewidth270 infrastructurefontsizeinherit', 0, 0, '', '', ''); $num = infrastructure_print_input('', 'select', $langs->trans('InfrastructureListOfExtrafieldsPropaldet'), '', $metas, 1, 2, '', $num); - $metas = $form->multiselectarray('INFRASTRUCTURE_LIST_OF_EXTRAFIELDS_COMMANDEDET', $extrafields->fetch_name_optionals_label('commandedet'), $orderSelected, 0, 0, 'flat infrastructurewidth270 infrastructurefontsizeinherit', 0, 0, '', '', ''); + $metas = $form->multiselectarray('INFRASTRUCTURE_LIST_OF_EXTRAFIELDS_COMMANDEDET', getVisibleExtrafields('commandedet'), $orderSelected, 0, 0, 'flat infrastructurewidth270 infrastructurefontsizeinherit', 0, 0, '', '', ''); $num = infrastructure_print_input('', 'select', $langs->trans('InfrastructureListOfExtrafieldsCommandedet'), '', $metas, 1, 2, '', $num); - $metas = $form->multiselectarray('INFRASTRUCTURE_LIST_OF_EXTRAFIELDS_FACTUREDET', $extrafields->fetch_name_optionals_label('facturedet'), $invoiceSelected, 0, 0, 'flat infrastructurewidth270 infrastructurefontsizeinherit', 0, 0, '', '', ''); + $metas = $form->multiselectarray('INFRASTRUCTURE_LIST_OF_EXTRAFIELDS_FACTUREDET', getVisibleExtrafields('facturedet'), $invoiceSelected, 0, 0, 'flat infrastructurewidth270 infrastructurefontsizeinherit', 0, 0, '', '', ''); $num = infrastructure_print_input('', 'select', $langs->trans('InfrastructureListOfExtrafieldsFacturedet'), '', $metas, 1, 2, '', $num); // num = 10 infrastructure_print_subTitle(4, 'InfrastructureSetupForShipping'); diff --git a/core/lib/infrastructure.lib.php b/core/lib/infrastructure.lib.php index b276cb5..ce7dbe9 100644 --- a/core/lib/infrastructure.lib.php +++ b/core/lib/infrastructure.lib.php @@ -101,6 +101,26 @@ function infrastructure_addNumerotation(&$object) } } + /** + * List extrafields with "list"(Visible field) attribute > 0 for a given element type (propaldet, commandedet, ...) + * + * @param string $elementtype Element type (propaldet, commandedet, facturedet, ...) + * @return array List of extrafields [fieldname => label] + */ + function getVisibleExtrafields($elementtype) { + global $db; + + $extrafields = new ExtraFields($db); + $all = $extrafields->fetch_name_optionals_label($elementtype); + $list = []; + foreach ($all as $key => $label) { + if ((int) ($extrafields->attributes[$elementtype]['list'][$key] ?? 0) > 0) { + $list[$key] = $label; + } + } + return $list; + } + /** * Ajax block order JS * @@ -229,10 +249,10 @@ function infrastructure_billOrdersAddCheckBoxForTitleBlocks() ob_start(); $jsConf = ['langs' => ['AddTitleBlocFromOrdersToInvoice' => $langs->trans('InfrastructureAddTitleBlocFromOrderstoinvoice'), - 'AddShippingListToTile' => $langs->trans('InfrastructureAddShippingListToTile'), - 'InfrastructureOptions' => $langs->trans('InfrastructureOptions'), - 'UseHiddenConfToAutoCheck' => $langs->trans('InfrastructureUseHiddenConfToAutoCheck'), - ], + 'AddShippingListToTile' => $langs->trans('InfrastructureAddShippingListToTile'), + 'InfrastructureOptions' => $langs->trans('InfrastructureOptions'), + 'UseHiddenConfToAutoCheck' => $langs->trans('InfrastructureUseHiddenConfToAutoCheck'), + ], 'isModShippingEnable' => isModEnabled('expedition'), 'INFRASTRUCTURE_DEFAULT_CHECK_SHIPPING_LIST_FOR_TITLE_DESC' => getDolGlobalInt('INFRASTRUCTURE_DEFAULT_CHECK_SHIPPING_LIST_FOR_TITLE_DESC') ]; diff --git a/core/tpl/infrastructureline_row_document.tpl.php b/core/tpl/infrastructureline_row_document.tpl.php index c789361..eda7c5e 100644 --- a/core/tpl/infrastructureline_row_document.tpl.php +++ b/core/tpl/infrastructureline_row_document.tpl.php @@ -260,7 +260,7 @@ $line->element = 'tr_extrafield_title '.$line->element; // Pour pouvoir manipuler ces tr $isExtraSelected = false; $colspan += 5; - print $line->showOptionals($extrafieldsline, $mode, ['style' => ' style="background:#eeffee;" ', 'colspan' => $colspan]); + print $line->showOptionals($extrafieldsline, $mode, ['style' => ' style="background:'.getDolGlobalString('INFRASTRUCTURE_TOTAL_BACKGROUND_COLOR').';color:'.getDolGlobalString('INFRASTRUCTURE_TOTAL_COLOR').';" ', 'colspan' => $colspan]); foreach ($line->array_options as $option) { if (!empty($option) && $option != "-1") { $isExtraSelected = true; From 7e58125f7819c99d36dc8d76ead70a2104c4df57 Mon Sep 17 00:00:00 2001 From: Lynda Date: Thu, 4 Jun 2026 15:43:38 +0300 Subject: [PATCH 4/4] Improve ExtraFields --- core/lib/infrastructure.lib.php | 34 ++++++++++++------- core/tpl/infrastructureline_edit.tpl.php | 24 +------------ .../infrastructureline_row_document.tpl.php | 9 ++--- docs/changelog.xml | 3 +- 4 files changed, 30 insertions(+), 40 deletions(-) diff --git a/core/lib/infrastructure.lib.php b/core/lib/infrastructure.lib.php index ce7dbe9..2d3844c 100644 --- a/core/lib/infrastructure.lib.php +++ b/core/lib/infrastructure.lib.php @@ -773,15 +773,11 @@ function infrastructure_updateInfrastructureLine(&$object, &$line) } // TODO ajouter la partie fournisseur if (!empty($TKey)) { - $extrafields = new ExtraFields($object->db); - $extrafields->fetch_name_optionals_label($line->element); - $TPost = $extrafields->getOptionalsFromPost($line->element, '', 'infrastructure_'); - $TLine = TInfrastructure::getLinesFromTitleId($object, $line->id); + $TLine = TInfrastructure::getLinesFromTitleId($object, $line->id); foreach ($TLine as $object_line) { foreach ($TKey as $key) { - // TODO remove "true" - if (isset($TPost['infrastructure_options_'.$key])) { - $object_line->array_options['options_'.$key] = $TPost['infrastructure_options_'.$key]; + if (array_key_exists('options_'.$key, $line->array_options)) { + $object_line->array_options['options_'.$key] = $line->array_options['options_'.$key]; } } $object_line->insertExtraFields(); @@ -801,14 +797,20 @@ function infrastructure_updateInfrastructureBloc($object, $line) { global $langs; - $infrastructure_tva_tx = $infrastructure_tva_tx_init = GETPOST('infrastructure_tva_tx', 'int'); - $infrastructure_progress = $infrastructure_progress_init = GETPOST('infrastructure_progress', 'int'); - $array_options = $line->array_options; - $showBlockExtrafields = GETPOST('showBlockExtrafields', 'aZ09'); + $infrastructure_tva_tx = $infrastructure_tva_tx_init = GETPOST('infrastructure_tva_tx', 'int'); + $infrastructure_progress = $infrastructure_progress_init = GETPOST('infrastructure_progress', 'int'); + $array_options = $line->array_options; + $showBlockExtrafields = GETPOST('showBlockExtrafields', 'aZ09'); if ($infrastructure_tva_tx != '' || $infrastructure_progress != '' || (!empty($showBlockExtrafields) && !empty($array_options))) { $error_progress = $nb_progress_update = $nb_progress_not_updated = 0; - $TLine = TInfrastructure::getLinesFromTitleId($object, $line->id); + $parentTitleId = $line->id; + $TLine = TInfrastructure::getLinesFromTitleId($object, $line->id, true); + // Clés propres au module infrastructure — ne pas les propager aux titres enfants + $infrastructureOwnKeys = ['options_show_total_ht', 'options_show_reduc', 'options_infrastructure_show_qty', 'options_hideblock', 'options_show_table_header_before', 'options_print_as_list', 'options_print_condensed', 'options_infrastructure_ol']; foreach ($TLine as &$line) { + if ($line->id == $parentTitleId || TInfrastructure::isTotal($line)) { + continue; // Ignorer le titre parent lui-même et les sous-totaux + } if (!TInfrastructure::isModInfrastructureLine($line)) { $infrastructure_tva_tx = $infrastructure_tva_tx_init; // ré-init car la variable peut évoluer if (!empty($showBlockExtrafields)) { @@ -835,6 +837,14 @@ function infrastructure_updateInfrastructureBloc($object, $line) } else { $error_updated_line++; } + } elseif (TInfrastructure::isTitle($line) && !empty($showBlockExtrafields) && !empty($array_options)) { + // Titre enfant : propager uniquement les extrafields non gérés par infrastructure + foreach ($array_options as $optKey => $optVal) { + if (!in_array($optKey, $infrastructureOwnKeys)) { + $line->array_options[$optKey] = $optVal; + } + } + $line->insertExtraFields(); } } if ($nb_progress_not_updated > 0) { diff --git a/core/tpl/infrastructureline_edit.tpl.php b/core/tpl/infrastructureline_edit.tpl.php index e6e80ae..cd90a06 100644 --- a/core/tpl/infrastructureline_edit.tpl.php +++ b/core/tpl/infrastructureline_edit.tpl.php @@ -190,31 +190,9 @@ if (getDolGlobalString('FCKEDITOR_ENABLE_DETAILS_FULL')) { $toolbarname = 'dolibarr_notes'; } + echo '
'; $doleditor = new DolEditor('line-description', $line->description, '', 100, $toolbarname, '', false, true, $cked_enabled, $nbrows, '98%', (bool) $readonlyForSituation); $doleditor->Create(); - $TKey = null; - if ($line->element == 'propaldet') { - $TKey = explode(',', getDolGlobalString('INFRASTRUCTURE_LIST_OF_EXTRAFIELDS_PROPALDET')); - } elseif ($line->element == 'commandedet') { - $TKey = explode(',', getDolGlobalString('INFRASTRUCTURE_LIST_OF_EXTRAFIELDS_COMMANDEDET')); - } elseif ($line->element == 'facturedet') { - $TKey = explode(',', getDolGlobalString('INFRASTRUCTURE_LIST_OF_EXTRAFIELDS_FACTUREDET')); - } - // TODO ajouter la partie fournisseur - if (!empty($TKey)) { - $extrafields = new ExtraFields($this->db); - $extrafields->fetch_name_optionals_label($object->table_element_line); - if (!empty($extrafields->attributes[$line->element]['param'])) { - foreach ($extrafields->attributes[$line->element]['param'] as $code => $val) { - if (in_array($code, $TKey) && $extrafields->attributes[$line->element]['list'][$code] > 0) { - print '
- '; - print $extrafields->showInputField($code, $line->array_options['options_'.$code], '', '', 'infrastructure_', '', 0, $object->table_element_line); - print '
'; - } - } - } - } } ?> \ No newline at end of file diff --git a/core/tpl/infrastructureline_row_document.tpl.php b/core/tpl/infrastructureline_row_document.tpl.php index eda7c5e..e2b6910 100644 --- a/core/tpl/infrastructureline_row_document.tpl.php +++ b/core/tpl/infrastructureline_row_document.tpl.php @@ -252,15 +252,15 @@ fetch_name_optionals_label($object->table_element_line); $mode = $action === 'editline' && $line->rowid == GETPOST('lineid', 'int') ? 'edit' : 'view'; $ex_element = $line->element; $line->element = 'tr_extrafield_title '.$line->element; // Pour pouvoir manipuler ces tr $isExtraSelected = false; + $bgBrightness = colorLighten(getDolGlobalString('INFRASTRUCTURE_TITLE_BACKGROUND_COLOR'), 25); $colspan += 5; - print $line->showOptionals($extrafieldsline, $mode, ['style' => ' style="background:'.getDolGlobalString('INFRASTRUCTURE_TOTAL_BACKGROUND_COLOR').';color:'.getDolGlobalString('INFRASTRUCTURE_TOTAL_COLOR').';" ', 'colspan' => $colspan]); foreach ($line->array_options as $option) { if (!empty($option) && $option != "-1") { $isExtraSelected = true; @@ -268,7 +268,8 @@ } } if ($mode === 'edit') { - ?> + print $line->showOptionals($extrafieldsline, $mode, ['style' => ' style="background:'.$bgBrightness.';color:'.getDolGlobalString('INFRASTRUCTURE_TITLE_COLOR').';" ', 'colspan' => $colspan]); + ?>