diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index 9e4cfd2923b..df22b17b4fa 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005 Patrick Rouillon * Copyright (C) 2005-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2011-2012 Philippe Grand * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -106,10 +107,10 @@ else if ($action == 'deletecontact' && $user->rights->commande->creer) } } -else if ($action == 'setaddress' && $user->rights->commande->creer) -{ - $object->fetch($id); - $object->setDeliveryAddress($_POST['fk_address']); +else if ($action == 'setaddress' && $user->rights->commande->creer) +{ + $object->fetch($id); + $object->setDeliveryAddress($_POST['fk_address']); } /* @@ -173,27 +174,27 @@ if ($id > 0 || ! empty($ref)) print "".$langs->trans("Company").""; print ''.$object->client->getNomUrl(1).''; - // Delivery address - if ($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) - { - print ''; - print ''; - - if ($action != 'editdelivery_address' && $object->brouillon) print ''; - print '
'; - print $langs->trans('DeliveryAddress'); - print 'socid.'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetDeliveryAddress'),1).'
'; - print ''; - - if ($action == 'editdelivery_address') - { - $formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,GETPOST('socid','int'),'fk_address','commande',$object->id); - } - else - { - $formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,GETPOST('socid','int'),'none','commande',$object->id); - } - print ''; + // Delivery address + if ($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) + { + print ''; + print ''; + + if ($action != 'editdelivery_address' && $object->brouillon) print ''; + print '
'; + print $langs->trans('DeliveryAddress'); + print 'socid.'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetDeliveryAddress'),1).'
'; + print ''; + + if ($action == 'editdelivery_address') + { + $formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,GETPOST('socid','int'),'fk_address','commande',$object->id); + } + else + { + $formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,GETPOST('socid','int'),'none','commande',$object->id); + } + print ''; } print ""; @@ -202,8 +203,15 @@ if ($id > 0 || ! empty($ref)) print '
'; - // Contacts lines - include(DOL_DOCUMENT_ROOT.'/core/tpl/contacts.tpl.php'); + // Select template for Contacts lines + if (file_exists(DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/tpl/contacts.tpl.php")) + { + include(DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/tpl/contacts.tpl.php"); + } + else + { + include(DOL_DOCUMENT_ROOT.'/core/tpl/contacts.tpl.php'); + } } else