From 9a5743187984a948a7bc2fba664e7cede7035e60 Mon Sep 17 00:00:00 2001 From: jfefe Date: Sat, 16 Mar 2013 00:28:45 +0100 Subject: [PATCH] Show extrafield separator on thirdparty and contact --- htdocs/contact/fiche.php | 47 ++++++++++++++------ htdocs/societe/soc.php | 95 ++++++++++++++++++++++++---------------- 2 files changed, 91 insertions(+), 51 deletions(-) diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 2f1f061374031..885711bb526ed 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -521,11 +521,18 @@ foreach($extrafields->attribute_label as $key=>$label) { $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options["options_".$key])?$object->array_options["options_".$key]:'')); - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''; - print $extrafields->showInputField($key,$value); - print ''."\n"; + 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"; + } } } @@ -736,11 +743,18 @@ 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"; + 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"; + } } } @@ -948,9 +962,16 @@ foreach($extrafields->attribute_label as $key=>$label) { $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options['options_'.$key])?$object->array_options['options_'.$key]:'')); - print ''.$label.''; - print $extrafields->showOutputField($key,$value); - print "\n"; + if ($extrafields->attribute_type[$key] == 'separate') + { + print $extrafields->showSeparator($key); + } + else + { + print ''.$label.''; + print $extrafields->showOutputField($key,$value); + print "\n"; + } } } diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index b45bf5a8e59b0..80de6ec7146a9 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -985,20 +985,27 @@ { $colspan='3'; $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options["options_".$key])?$object->array_options["options_".$key]:'')); - if (($e % 2) == 0) + if ($extrafields->attribute_type[$key] == 'separate') { - print ''; - $colspan='0'; - } - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''; - print ''; - print $extrafields->showInputField($key,$value); - print ''; - - if (($e % 2) == 1) print ''."\n"; - $e++; + print $extrafields->showSeparator($key); + } + else + { + if (($e % 2) == 0) + { + print ''; + $colspan='0'; + } + print 'attribute_required[$key])) print ' class="fieldrequired"'; + print '>'.$label.''; + print ''; + print $extrafields->showInputField($key,$value); + print ''; + + if (($e % 2) == 1) print ''."\n"; + $e++; + } } } @@ -1414,25 +1421,30 @@ { $colspan = '3'; $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); - - if (($e % 2) == 0) + if ($extrafields->attribute_type[$key] == 'separate') { - print ''."\n"; - $colspan = '0'; + print $extrafields->showSeparator($key); } - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''."\n"; - print ''; - print $extrafields->showInputField($key,$value); - print ""."\n"; - - if (($e % 2) == 1 ) + else { - print "\n"; + if (($e % 2) == 0) + { + print ''."\n"; + $colspan = '0'; + } + print 'attribute_required[$key])) print ' class="fieldrequired"'; + print '>'.$label.''."\n"; + print ''; + print $extrafields->showInputField($key,$value); + print ""."\n"; + + if (($e % 2) == 1 ) + { + print "\n"; + } + $e++; } - $old_pos = $extrafields->attribute_pos[$key]; - $e++; } } // Logo @@ -1753,18 +1765,25 @@ { $colspan='3'; $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options['options_'.$key])?$object->array_options['options_'.$key]:'')); - if (($e % 2) == 0) + if ($extrafields->attribute_type[$key] == 'separate') + { + print $extrafields->showSeparator($key); + } + else { - print ''; - $colspan='0'; + if (($e % 2) == 0) + { + print ''; + $colspan='0'; + } + print ''.$label.''; + print ''; + print $extrafields->showOutputField($key,$value); + print ""; + + if (($e % 2) == 1) print ''; + $e++; } - print ''.$label.''; - print ''; - print $extrafields->showOutputField($key,$value); - print ""; - - if (($e % 2) == 1) print ''; - $e++; } }