From e0bbb78f56de33605eafe6c600a2e4f9eeb72aa7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Feb 2013 17:28:07 +0100 Subject: [PATCH] Fix: Merge customer and prospect tab --- htdocs/comm/fiche.php | 49 +++++++++++++++++---------------- htdocs/core/lib/company.lib.php | 4 ++- 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 397fb9da835..fcecbf0a552 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -386,29 +386,32 @@ if ($id > 0) } // Level of prospect - print ''; - print ''; - print '
'; - print $langs->trans('ProspectLevelShort'); - print ''; - if ($action != 'editlevel' && $user->rights->societe->creer) print 'id.'">'.img_edit($langs->trans('Modify'),1).'
'; - print ''; - if ($action == 'editlevel') - $formcompany->form_prospect_level($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->fk_prospectlevel,'prospect_level_id',1); - else - print $object->getLibProspLevel(); - print ""; - print ''; - - // Status - print ''.$langs->trans("StatusProsp").''.$object->getLibProspCommStatut(4).''; - print ''; - if ($object->stcomm_id != -1) print ''.img_action(0,-1).''; - if ($object->stcomm_id != 0) print ''.img_action(0,0).''; - if ($object->stcomm_id != 1) print ''.img_action(0,1).''; - if ($object->stcomm_id != 2) print ''.img_action(0,2).''; - if ($object->stcomm_id != 3) print ''.img_action(0,3).''; - print ''; + if ($object->client == 2 || $object->client == 3) + { + print ''; + print ''; + print '
'; + print $langs->trans('ProspectLevel'); + print ''; + if ($action != 'editlevel' && $user->rights->societe->creer) print 'id.'">'.img_edit($langs->trans('Modify'),1).'
'; + print ''; + if ($action == 'editlevel') + $formcompany->form_prospect_level($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->fk_prospectlevel,'prospect_level_id',1); + else + print $object->getLibProspLevel(); + print ""; + print ''; + + // Status + print ''.$langs->trans("StatusProsp").''.$object->getLibProspCommStatut(4).''; + print ''; + if ($object->stcomm_id != -1) print ''.img_action(0,-1).''; + if ($object->stcomm_id != 0) print ''.img_action(0,0).''; + if ($object->stcomm_id != 1) print ''.img_action(0,1).''; + if ($object->stcomm_id != 2) print ''.img_action(0,2).''; + if ($object->stcomm_id != 3) print ''.img_action(0,3).''; + print ''; + } // Sales representative include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php'; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 4fb851ce4d3..afd9522801a 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -45,7 +45,9 @@ function societe_prepare_head($object) if ($object->client==1 || $object->client==2 || $object->client==3 || (isset($object->object) && $object->object->client==1) || (isset($object->object) && $object->object->client==3)) { $head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$object->id; - $head[$h][1] = $langs->trans("Customer"); + if ($object->client==2 || $object->client==3) $head[$h][1] = $langs->trans("Prospect"); + if ($object->client==3) $head[$h][1] .= '/'; + if ($object->client==1 || $object->client==3) $head[$h][1] .= $langs->trans("Customer"); $head[$h][2] = 'customer'; $h++; }