* Copyright (C) 2013-2015 Laurent Destailleur * Copyright (C) 2015-2016 Charlie BENKE * * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * * This template needs: * $object * $withproject (if we are on task contact) */ // Protection to avoid direct call of template if (empty($object) || ! is_object($object)) { print "Error, template page can't be called as URL"; exit; } require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; $module = $object->element; // Special cases if ($module == 'propal') { $permission=$user->rights->propale->creer; } elseif ($module == 'fichinter') { $permission=$user->rights->ficheinter->creer; } elseif ($module == 'order_supplier') { $permission=$user->rights->fournisseur->commande->creer; } elseif ($module == 'invoice_supplier') { $permission=$user->rights->fournisseur->facture->creer; } elseif ($module == 'project') { $permission=$user->rights->projet->creer; } elseif ($module == 'action') { $permission=$user->rights->agenda->myactions->create; } elseif ($module == 'shipping') { $permission=$user->rights->expedition->creer; } elseif ($module == 'project_task') { $permission=$user->rights->projet->creer; } elseif (! isset($permission) && isset($user->rights->$module->creer)) { $permission=$user->rights->$module->creer; } elseif (! isset($permission) && isset($user->rights->$module->write)) { $permission=$user->rights->$module->write; } $formcompany= new FormCompany($db); $companystatic=new Societe($db); $contactstatic=new Contact($db); $userstatic=new User($db); ?>
trans("Nature"); ?>
trans("ThirdParty"); ?>
trans("Users").'/'.$langs->trans("Contacts"); ?>
trans("ContactType"); ?>
 
 
" /> '; ?>
trans("Users"); ?>
global->MAIN_INFO_SOCIETE_NOM; ?>
select_dolusers($user->id, 'userid', 0, (! empty($userAlreadySelected)?$userAlreadySelected:null), 0, null, null, 0, 56, '', 0, '', 'minwidth200imp'); ?>
element == 'shipping' && is_object($objectsrc)) $tmpobject=$objectsrc; echo $formcompany->selectTypeContact($tmpobject, '', 'type','internal'); ?>
 
">
" /> '; ?>
trans("ThirdPartyContacts"); ?>
socid; ?> selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', '', 0, '', 'minwidth300imp'); ?>
select_contacts(($selectedCompany > 0 ? $selectedCompany : -1), '', 'contactid', 3, '', '', 0, 'minwidth100imp'); ?>
element == 'shipping' && is_object($objectsrc)) $tmpobject=$objectsrc; $formcompany->selectTypeContact($tmpobject, '', 'type','external', 'position', 0, 'minwidth100imp'); ?>
 
">
trans("Nature"); ?>
trans("ThirdParty"); ?>
trans("Users").'/'.$langs->trans("Contacts"); ?>
trans("ContactType"); ?>
trans("Status"); ?>
 
element == 'shipping' && is_object($objectsrc)) $tmpobject=$objectsrc; $tab = $tmpobject->liste_contact(-1,$source); $num=count($tab); $i = 0; while ($i < $num) { ?>
trans("User"); ?> trans("ThirdPartyContact"); ?>
0) { $companystatic->fetch($tab[$i]['socid']); echo $companystatic->getNomUrl(1); } if ($tab[$i]['socid'] < 0) { echo $conf->global->MAIN_INFO_SOCIETE_NOM; } if (! $tab[$i]['socid']) { echo ' '; } ?>
fetch($tab[$i]['id']); echo $userstatic->getNomUrl(-1); } if ($tab[$i]['source']=='external') { $contactstatic->fetch($tab[$i]['id']); echo $contactstatic->getNomUrl(1); } ?>
initHooks(array('contacttpl')); $parameters=array(); $reshook=$hookmanager->executeHooks('formContactTpl',$parameters,$object,$action); } ?>