From bd2d9cdd3e39282dc904e2ab26ee2d482a7d89e7 Mon Sep 17 00:00:00 2001 From: jfefe Date: Mon, 18 Feb 2013 00:41:50 +0100 Subject: [PATCH] Split extrafields display into 2 columns (thirdparty) --- htdocs/societe/soc.php | 57 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 47 insertions(+), 10 deletions(-) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index c1dd0c4c09d..ee8f6e984b1 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -998,14 +998,25 @@ else $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook if (empty($reshook) && ! empty($extrafields->attribute_label)) { + $e=0; foreach($extrafields->attribute_label as $key=>$label) { + $colspan='3'; $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options["options_".$key])?$object->array_options["options_".$key]:'')); - print ''; + $colspan='0'; + } + print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''; + print '>'.$label.''; + print ''; print $extrafields->showInputField($key,$value); - print ''."\n"; + print ''; + + if (($e % 2) == 1) print ''."\n"; + $e++; } } @@ -1426,23 +1437,38 @@ else print ''; print ''; } - // Other attributes $parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook if (empty($reshook) && ! empty($extrafields->attribute_label)) { + $old_pos=0; + $e=0; foreach($extrafields->attribute_label as $key=>$label) { + $colspan = '3'; $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); - print ''."\n"; + $colspan = '0'; + } + print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''; + print '>'.$label.''."\n"; + print ''; print $extrafields->showInputField($key,$value); - print "\n"; + print ""."\n"; + + if (($e % 2) == 1 ) + { + print "\n"; + } + $old_pos = $extrafields->attribute_pos[$key]; + $e++; } } - // Logo print ''; print ''.$langs->trans("Logo").''; @@ -1756,12 +1782,23 @@ else $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook if (empty($reshook) && ! empty($extrafields->attribute_label)) { + $e=0; foreach($extrafields->attribute_label as $key=>$label) { + $colspan='3'; $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options['options_'.$key])?$object->array_options['options_'.$key]:'')); - print ''.$label.''; + if (($e % 2) == 0) + { + print ''; + $colspan='0'; + } + print ''.$label.''; + print ''; print $extrafields->showOutputField($key,$value); - print "\n"; + print ""; + + if (($e % 2) == 1) print ''; + $e++; } }