From f1a05528ad49e06ec1592089c0bcc5dfc162eba0 Mon Sep 17 00:00:00 2001 From: jfefe Date: Sat, 16 Mar 2013 00:16:30 +0100 Subject: [PATCH] Show extrafield separator on invoice --- htdocs/compta/facture.php | 40 ++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 6b0cd0dfb93..4e0652a9d1d 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2101,11 +2101,19 @@ if ($action == 'create') foreach($extrafields->attribute_label as $key=>$label) { $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''; - print $extrafields->showInputField($key,$value); - print ''."\n"; + // Show separator only + if ($extrafields->attribute_type[$key] == 'separate') + { + print $extrafields->showSeparator($key); + } + else + { + print 'attribute_required[$key])) print ' class="fieldrequired"'; + print '>'.$label.''; + print $extrafields->showInputField($key,$value); + print ''."\n"; + } } } @@ -3090,19 +3098,25 @@ else if ($id > 0 || ! empty($ref)) foreach($extrafields->attribute_label as $key=>$label) { $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''; - if ($action == 'edit_extras' && $user->rights->propal->creer) + if ($extrafields->attribute_type[$key] == 'separate') { - print $extrafields->showInputField($key,$value); + print $extrafields->showSeparator($key); } else { - print $extrafields->showOutputField($key,$value); + print 'attribute_required[$key])) print ' class="fieldrequired"'; + print '>'.$label.''; + if ($action == 'edit_extras' && $user->rights->propal->creer) + { + print $extrafields->showInputField($key,$value); + } + else + { + print $extrafields->showOutputField($key,$value); + } + print ''."\n"; } - - print ''."\n"; } if(count($extrafields->attribute_label) > 0) {