From ba7a288abba4d8bbfb94cb115ca9193ab5844e7e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 1 Oct 2019 23:28:13 +0200 Subject: [PATCH] Fix colspan and columns of contact of thirdparties --- htdocs/core/lib/company.lib.php | 28 ++++++++++++++-------------- htdocs/societe/card.php | 5 ++--- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 2b5a3271b4a..084c543a8c2 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -917,18 +917,18 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') $contactstatic->fields=array( 'name' =>array('type'=>'varchar(128)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1), - 'poste' =>array('type'=>'varchar(128)', 'label'=>'PostOfFunction', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20), + 'poste' =>array('type'=>'varchar(128)', 'label'=>'PostOrFunction', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20), 'address' =>array('type'=>'varchar(128)', 'label'=>'Address', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>30), 'statut' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>40, 'arrayofkeyval'=>array(0=>$contactstatic->LibStatut(0, 1), 1=>$contactstatic->LibStatut(1, 1))), ); // Definition of fields for list $arrayfields=array( - 't.rowid'=>array('label'=>"TechnicalID", 'checked'=>($conf->global->MAIN_SHOW_TECHNICAL_ID?1:0), 'enabled'=>($conf->global->MAIN_SHOW_TECHNICAL_ID?1:0), 'position'=>1), - 't.name'=>array('label'=>"Name", 'checked'=>1, 'position'=>10), - 't.poste'=>array('label'=>"PostOrFunction", 'checked'=>1, 'position'=>20), - 't.address'=>array('label'=>(empty($conf->dol_optimize_smallscreen) ? $langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email") : $langs->trans("Address")), 'checked'=>1, 'position'=>30), - 't.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>40, 'class'=>'center'), + 't.rowid'=>array('label'=>"TechnicalID", 'checked'=>($conf->global->MAIN_SHOW_TECHNICAL_ID?1:0), 'enabled'=>($conf->global->MAIN_SHOW_TECHNICAL_ID?1:0), 'position'=>1), + 't.name'=>array('label'=>"Name", 'checked'=>1, 'position'=>10), + 't.poste'=>array('label'=>"PostOrFunction", 'checked'=>1, 'position'=>20), + 't.address'=>array('label'=>(empty($conf->dol_optimize_smallscreen) ? $langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email") : $langs->trans("Address")), 'checked'=>1, 'position'=>30), + 't.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>40, 'class'=>'center'), ); // Extra fields if (is_array($extrafields->attributes[$contactstatic->table_element]['label']) && count($extrafields->attributes[$contactstatic->table_element]['label'])) @@ -939,7 +939,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') $arrayfields["ef.".$key]=array( 'label'=>$extrafields->attributes[$contactstatic->table_element]['label'][$key], 'checked'=>(($extrafields->attributes[$contactstatic->table_element]['list'][$key]<0)?0:1), - 'position'=>$extrafields->attributes[$contactstatic->table_element]['pos'][$key], + 'position'=>1000+$extrafields->attributes[$contactstatic->table_element]['pos'][$key], 'enabled'=>(abs($extrafields->attributes[$contactstatic->table_element]['list'][$key])!=3 && $extrafields->attributes[$contactstatic->table_element]['perms'][$key])); } } @@ -1036,16 +1036,16 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') // Fields title search // -------------------------------------------------------------------- print ''; - foreach($arrayfields as $key => $val) + foreach($contactstatic->fields as $key => $val) { $align=''; - if (in_array($val['type'], array('t.date','t.datetime','t.timestamp'))) $align.=($align?' ':'').'center'; - if (in_array($val['type'], array('t.timestamp'))) $align.=($align?' ':'').'nowrap'; - if ($key == 't.status' || $key == 't.statut') $align.=($align?' ':'').'center'; - if (! empty($arrayfields[$key]['checked'])) + if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center'; + if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap'; + if ($key == 'status' || $key == 'statut') $align.=($align?' ':'').'center'; + if (! empty($arrayfields['t.'.$key]['checked'])) { print ''; - if (in_array($key, array('t.statut'))){ + if (in_array($key, array('statut'))){ print $form->selectarray('search_status', array('-1'=>'','0'=>$contactstatic->LibStatut(0, 1),'1'=>$contactstatic->LibStatut(1, 1)), $search_status); }else{ $fieldName = substr($key, 2); @@ -1078,7 +1078,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center'; if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap'; if ($key == 'status' || $key == 'statut') $align.=($align?' ':'').'center'; - if (! empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align?'class="'.$align.'"':''), $sortfield, $sortorder, $align.' ')."\n"; + if (! empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($val['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align?'class="'.$align.'"':''), $sortfield, $sortorder, $align.' ')."\n"; } // Extra fields $extrafieldsobjectkey=$contactstatic->table_element; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 44f95cfd513..d0eb73ff481 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2568,14 +2568,13 @@ else // Parent company if (empty($conf->global->SOCIETE_DISABLE_PARENTCOMPANY)) { - // Payment term print ''; print ''; if ($action != 'editparentcompany') print ''; print '
'; print $langs->trans('ParentCompany'); print 'id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'
'; - print ''; + print ''; if ($action == 'editparentcompany') { $form->form_thirdparty($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->parent, 'editparentcompany', 's.rowid <> '.$object->id, 1); @@ -2596,7 +2595,7 @@ else { $langs->load("members"); print ''.$langs->trans("LinkedToDolibarrMember").''; - print ''; + print ''; $adh=new Adherent($db); $result=$adh->fetch('', '', $object->id); if ($result > 0)