* Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke * * 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 2 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 . */ /** * \file htdocs/contact/fiche.php * \ingroup societe * \brief Card of a contact */ require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/comm/action/class/actioncomm.class.php"); require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/contact.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/html.formcompany.class.php"); $langs->load("companies"); $langs->load("users"); $langs->load("other"); $langs->load("commercial"); $mesg=''; $error=0; $errors=array(); $action = GETPOST('action'); $id = GETPOST("id"); $socid = GETPOST("socid"); if ($user->societe_id) $socid=$user->societe_id; $object = new Contact($db); // Get object canvas (By default, this is not defined, so standard usage of dolibarr) $object->getCanvas($id); $canvas = $object->canvas?$object->canvas:GETPOST("canvas"); if (! empty($canvas)) { require_once(DOL_DOCUMENT_ROOT."/core/class/canvas.class.php"); $objcanvas = new Canvas($db,$action); $objcanvas->getCanvas('contact','contactcard',$canvas); } // Security check $result = restrictedArea($user, 'contact', $id, 'socpeople', '', '', '', $objcanvas); // If we create a contact with no company (shared contacts), no check on write permission // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($db); $hookmanager->callHooks(array('contactcard')); /* * Actions */ $parameters=array('id'=>$id); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks // ---------- start deprecated. Use hook to hook actions. // If canvas actions are defined, because on url, or because contact was created with canvas feature on, we use the canvas feature. // If canvas actions are not defined, we use standard feature. if (method_exists($objcanvas->control,'doActions')) { $objcanvas->doActions($id); if (! empty($objcanvas->error) || (! empty($objcanvas->errors) && count($objcanvas->errors) > 0)) { $error=$objcanvas->error; $errors=$objcanvas->errors; if ($action=='add') { $objcanvas->action='create'; $action='create'; } if ($action=='update') { $objcanvas->action='edit'; $action='edit'; } } } // ---------- end deprecated. if (empty($reshook)) { // Cancel if (GETPOST("cancel") && GETPOST('backtopage')) { header("Location: ".GETPOST('backtopage')); exit; } // Creation utilisateur depuis contact if ($_POST["action"] == 'confirm_create_user' && $_POST["confirm"] == 'yes' && $user->rights->user->user->creer) { // Recuperation contact actuel $result = $object->fetch($_GET["id"]); if ($result > 0) { $db->begin(); // Creation user $nuser = new User($db); $result=$nuser->create_from_contact($object,$_POST["login"]); if ($result > 0) { $result2=$nuser->setPassword($user,$_POST["password"],0,1,1); if ($result2) { $db->commit(); } else { $error=$nuser->error; $errors=$nuser->errors; $db->rollback(); } } else { $error=$nuser->error; $errors=$nuser->errors; $db->rollback(); } } else { $error=$object->error; $errors=$object->errors; } } // Add contact if (GETPOST("action") == 'add' && $user->rights->societe->contact->creer) { $db->begin(); if ($canvas) $object->canvas=$canvas; $object->socid = $_POST["socid"]; $object->name = $_POST["name"]; $object->firstname = $_POST["firstname"]; $object->civilite_id = $_POST["civilite_id"]; $object->poste = $_POST["poste"]; $object->address = $_POST["address"]; $object->zip = $_POST["zipcode"]; $object->town = $_POST["town"]; $object->fk_pays = $_POST["pays_id"]; $object->fk_departement = $_POST["departement_id"]; $object->email = $_POST["email"]; $object->phone_pro = $_POST["phone_pro"]; $object->phone_perso = $_POST["phone_perso"]; $object->phone_mobile = $_POST["phone_mobile"]; $object->fax = $_POST["fax"]; $object->jabberid = $_POST["jabberid"]; $object->priv = $_POST["priv"]; $object->note = $_POST["note"]; // Note: Correct date should be completed with location to have exact GM time of birth. $object->birthday = dol_mktime(0,0,0,$_POST["birthdaymonth"],$_POST["birthdayday"],$_POST["birthdayyear"]); $object->birthday_alert = $_POST["birthday_alert"]; if (! $_POST["name"]) { $error++; $errors[]=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname").' / '.$langs->transnoentities("Label")); $_GET["action"] = $_POST["action"] = 'create'; } if ($_POST["name"]) { $id = $object->create($user); if ($id <= 0) { $error++; $errors[]=($object->error?array($object->error):$object->errors); $_GET["action"] = $_POST["action"] = 'create'; } } if (! $error && $id > 0) { $db->commit(); if (GETPOST('backtopage')) $url=GETPOST('backtopage'); else $url='fiche.php?id='.$id; Header("Location: ".$url); exit; } else { $db->rollback(); } } if (GETPOST("action") == 'confirm_delete' && GETPOST("confirm") == 'yes' && $user->rights->societe->contact->supprimer) { $result=$object->fetch($_GET["id"]); $object->old_name = $_POST["old_name"]; $object->old_firstname = $_POST["old_firstname"]; $result = $object->delete(); if ($result > 0) { Header("Location: ".DOL_URL_ROOT.'/contact/list.php'); exit; } else { $error=$object->error; $errors[]=$object->errors; } } if ($_POST["action"] == 'update' && ! $_POST["cancel"] && $user->rights->societe->contact->creer) { if (empty($_POST["name"])) { $error++; $errors=array($langs->trans("ErrorFieldRequired",$langs->transnoentities("Name").' / '.$langs->transnoentities("Label"))); $_GET["action"] = $_POST["action"] = 'edit'; } if (! count($errors)) { $object->fetch($_POST["contactid"]); $object->oldcopy=dol_clone($object); $object->old_name = $_POST["old_name"]; $object->old_firstname = $_POST["old_firstname"]; $object->socid = $_POST["socid"]; $object->name = $_POST["name"]; $object->firstname = $_POST["firstname"]; $object->civilite_id = $_POST["civilite_id"]; $object->poste = $_POST["poste"]; $object->address = $_POST["address"]; $object->zip = $_POST["zipcode"]; $object->town = $_POST["town"]; $object->fk_departement = $_POST["departement_id"]; $object->fk_pays = $_POST["pays_id"]; $object->email = $_POST["email"]; $object->phone_pro = $_POST["phone_pro"]; $object->phone_perso = $_POST["phone_perso"]; $object->phone_mobile = $_POST["phone_mobile"]; $object->fax = $_POST["fax"]; $object->jabberid = $_POST["jabberid"]; $object->priv = $_POST["priv"]; $object->note = $_POST["note"]; $result = $object->update($_POST["contactid"], $user); if ($result > 0) { $object->old_name=''; $object->old_firstname=''; } else { $error=$object->error; $errors=$object->errors; } } } } /* * View */ $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('',$langs->trans("ContactsAddresses"),$help_url); $form = new Form($db); $formcompany = new FormCompany($db); $countrynotdefined=$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; if ($socid > 0) { $objsoc = new Societe($db); $objsoc->fetch($socid); } // TODO Mutualize this part of code (same than societe/soc.php and product/fiche.php) if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // ----------------------------------------- // When used with CANVAS // ----------------------------------------- if ($action == 'create') { $objcanvas->assign_values($action); // Set value for templates $objcanvas->display_canvas($action); // Show template } else if ($action == 'edit') { $objcanvas->control->object=$objcanvas->getObject($id); // TODO: Getting and storing object should be done into assign_values (for template with no code) or into tpl if (empty($objcanvas->control->object)) { $object = new Contact($db); $object->fetch($id,$user); $objcanvas->control->object=$object; } $objcanvas->assign_values($action); // Set value for templates $objcanvas->display_canvas($action); // Show template } else { $objcanvas->control->object=$objcanvas->getObject($id); // TODO: Getting and storing object should be done into assign_values (for template with no code) or into tpl if (empty($objcanvas->control->object)) { $object = new Contact($db); $object->fetch($id,$user); $objcanvas->control->object=$object; } $objcanvas->assign_values('view'); // Assign values $objcanvas->display_canvas('view'); // Show template } } else { // ----------------------------------------- // When used in standard mode // ----------------------------------------- // Confirm deleting contact if ($user->rights->societe->contact->supprimer) { if ($_GET["action"] == 'delete') { $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"],$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete",'',0,1); if ($ret == 'html') print '
'; } } /* * Onglets */ if (GETPOST("id") > 0) { // Si edition contact deja existant $object = new Contact($db); $return=$object->fetch($id, $user); if ($return <= 0) { dol_print_error('',$object->error); $_GET["id"]=0; } // Show tabs $head = contact_prepare_head($object); dol_fiche_head($head, 'card', $langs->trans("ContactsAddresses"), 0, 'contact'); } if ($user->rights->societe->contact->creer) { if (GETPOST("action") == 'create') { /* * Fiche en mode creation */ $object->fk_departement = $_POST["departement_id"]; // We set pays_id, pays_code and label for the selected country $object->fk_pays=$_POST["pays_id"]?$_POST["pays_id"]:$mysoc->pays_id; if ($object->fk_pays) { $sql = "SELECT code, libelle"; $sql.= " FROM ".MAIN_DB_PREFIX."c_pays"; $sql.= " WHERE rowid = ".$object->fk_pays; $resql=$db->query($sql); if ($resql) { $obj = $db->fetch_object($resql); } else { dol_print_error($db); } $object->pays_code=$obj->code; $object->pays=$obj->libelle; } print_fiche_titre($langs->trans("AddContact")); // Affiche les erreurs dol_htmloutput_errors($error,$errors); if ($conf->use_javascript_ajax) { print "\n".''."\n"; } print '
'; print '
'; print ''; print ''; print ''; print ''; // Name print ''; print ''; // Company if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { if ($socid > 0) { print ''; print ''; print ''; print ''; } else { print ''; } } // Civility print ''; print ''; // Address if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->address)) == 0) $object->address = $objsoc->address; // Predefined with third party print ''; // Zip / Town if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->zip)) == 0) $object->zip = $objsoc->zip; // Predefined with third party if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->town)) == 0) $object->town = $objsoc->town; // Predefined with third party print ''; // Country if (dol_strlen(trim($object->fk_pays)) == 0) $object->fk_pays = $objsoc->pays_id; // Predefined with third party print ''; // State if (empty($conf->global->SOCIETE_DISABLE_STATE)) { print ''; } // Phone / Fax if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->phone_pro)) == 0) $object->phone_pro = $objsoc->tel; // Predefined with third party print ''; print ''; if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->fax)) == 0) $object->fax = $objsoc->fax; // Predefined with third party print ''; print ''; // EMail if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->email)) == 0) $object->email = $objsoc->email; // Predefined with third party print ''; // Instant message print ''; // Visibility print ''; // Note print ''; print "
'.$langs->trans("Lastname").' / '.$langs->trans("Label").'name).'">'.$langs->trans("Firstname").'firstname).'">
'.$langs->trans("Company").''; print $objsoc->getNomUrl(1); print '
'.$langs->trans("Company").''; print $form->select_societes(isset($_POST["socid"])?$_POST["socid"]:'','socid','',1); //print $form->select_societes('','socid',''); //print $langs->trans("ContactNotLinkedToCompany"); print '
'.$langs->trans("UserTitle").''; print $formcompany->select_civilite(isset($_POST["civilite_id"])?$_POST["civilite_id"]:$object->civilite_id); print '
'.$langs->trans("PostOrFunction").'poste).'">
'.$langs->trans("Address").'
'.$langs->trans("Zip").' / '.$langs->trans("Town").''; print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectpays_id','departement_id'),6).' '; print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectpays_id','departement_id')); print '
'.$langs->trans("Country").''; $form->select_pays((isset($_POST["pays_id"])?$_POST["pays_id"]:$object->fk_pays),'pays_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); print '
'.$langs->trans('State').''; if ($object->fk_pays) { $formcompany->select_departement(isset($_POST["departement_id"])?$_POST["departement_id"]:$object->fk_departement,$object->pays_code); } else { print $countrynotdefined; } print '
'.$langs->trans("PhonePro").'phone_pro).'">'.$langs->trans("PhonePerso").'phone_perso).'">
'.$langs->trans("PhoneMobile").'phone_mobile).'">'.$langs->trans("Fax").'fax).'">
'.$langs->trans("Email").'email).'">
'.$langs->trans("IM").'jabberid).'">
'.$langs->trans("ContactVisibility").''; $selectarray=array('0'=>$langs->trans("ContactPublic"),'1'=>$langs->trans("ContactPrivate")); print $form->selectarray('priv',$selectarray,(isset($_POST["priv"])?$_POST["priv"]:$object->priv),0); print '
'.$langs->trans("Note").'

"; // Add personnal information print_fiche_titre('
'.$langs->trans("PersonalInformations").'
','',''); print ''; // Date To Birth print ''; print ''; } else { print ''; } print ''; print "
'.$langs->trans("DateToBirth").''; $html=new Form($db); if ($object->birthday) { print $html->select_date($object->birthday,'birthday',0,0,0,"perso"); } else { print $html->select_date('','birthday',0,0,1,"perso"); } print ''.$langs->trans("Alert").': '; if ($object->birthday_alert) { print '


"; print '
'; print ''; if (GETPOST('backtopage')) { print '     '; print ''; } print '
'; print "
"; } elseif (GETPOST("action") == 'edit' && GETPOST("id")) { /* * Fiche en mode edition */ // We set pays_id, and pays_code label of the chosen country if (isset($_POST["pays_id"]) || $object->fk_pays) { $sql = "SELECT code, libelle from ".MAIN_DB_PREFIX."c_pays where rowid = ".(isset($_POST["pays_id"])?$_POST["pays_id"]:$object->fk_pays); $resql=$db->query($sql); if ($resql) { $obj = $db->fetch_object($resql); } else { dol_print_error($db); } $object->pays_code=$obj->code; $object->pays=$langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle; } // Affiche les erreurs dol_htmloutput_errors($error,$errors); if ($conf->use_javascript_ajax) { print ''; } print '
'; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; // Ref print ''; // Name print ''; print ''; // Company if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { print ''; print ''; print ''; } // Civility print ''; print ''; // Address print ''; // Zip / Town print ''; // Country print ''; // State if (empty($conf->global->SOCIETE_DISABLE_STATE)) { print ''; } // Phone print ''; print ''; print ''; print ''; // EMail print ''; if ($conf->mailing->enabled) { $langs->load("mails"); print ''; print ''; } else { print ''; } print ''; // Jabberid print ''; // Visibility print ''; print ''; $object->load_ref_elements(); if ($conf->commande->enabled) { print ''; } if ($conf->propal->enabled) { print ''; } if ($conf->contrat->enabled) { print ''; } if ($conf->facture->enabled) { print ''; } // Login Dolibarr print ''; print '
'.$langs->trans("Ref").''; print $object->ref; print '
'.$langs->trans("Lastname").' / '.$langs->trans("Label").'name).'">'.$langs->trans("Firstname").'firstname).'">
'.$langs->trans("Company").''; print $form->select_societes(isset($_POST["socid"])?$_POST["socid"]:($object->socid?$object->socid:-1),'socid','',1); print '
'.$langs->trans("UserTitle").''; print $formcompany->select_civilite(isset($_POST["civilite_id"])?$_POST["civilite_id"]:$object->civilite_id); print '
'.$langs->trans("PostOrFunction" ).'poste).'">
'.$langs->trans("Address").'
'.$langs->trans("Zip").' / '.$langs->trans("Town").''; print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectpays_id','departement_id'),6).' '; print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectpays_id','departement_id')); print '
'.$langs->trans("Country").''; $form->select_pays(isset($_POST["pays_id"])?$_POST["pays_id"]:$object->fk_pays,'pays_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); print '
'.$langs->trans('State').''; $formcompany->select_departement($object->fk_departement,$object->pays_code); print '
'.$langs->trans("PhonePro").'phone_pro).'">'.$langs->trans("PhonePerso").'phone_perso).'">
'.$langs->trans("PhoneMobile").'phone_mobile).'">'.$langs->trans("Fax").'fax).'">
'.$langs->trans("EMail").'email).'">'.$langs->trans("NbOfEMailingsReceived").''.$object->getNbOfEMailings().' 
Jabberidjabberid).'">
'.$langs->trans("ContactVisibility").''; $selectarray=array('0'=>$langs->trans("ContactPublic"),'1'=>$langs->trans("ContactPrivate")); print $form->selectarray('priv',$selectarray,$object->priv,0); print '
'.$langs->trans("Note").''; print '
'.$langs->trans("ContactForOrders").''; print $object->ref_commande?$object->ref_commande:$langs->trans("NoContactForAnyOrder"); print '
'.$langs->trans("ContactForProposals").''; print $object->ref_propal?$object->ref_propal:$langs->trans("NoContactForAnyProposal"); print '
'.$langs->trans("ContactForContracts").''; print $object->ref_contrat?$object->ref_contrat:$langs->trans("NoContactForAnyContract"); print '
'.$langs->trans("ContactForInvoices").''; print $object->ref_facturation?$object->ref_facturation:$langs->trans("NoContactForAnyInvoice"); print '
'.$langs->trans("DolibarrLogin").''; if ($object->user_id) { $dolibarr_user=new User($db); $result=$dolibarr_user->fetch($object->user_id); print $dolibarr_user->getLoginUrl(1); } else print $langs->trans("NoDolibarrAccess"); print '

'; print '
'; print ''; print '   '; print ''; print '
'; print "
"; } } if (GETPOST("id") && GETPOST("action") != 'edit') { $objsoc = new Societe($db); /* * Fiche en mode visualisation */ dol_htmloutput_errors($error,$errors); if ($_GET["action"] == 'create_user') { // Full firstname and name separated with a dot : firstname.name include_once(DOL_DOCUMENT_ROOT.'/lib/functions2.lib.php'); $login=dol_buildlogin($object->nom,$object->prenom); $generated_password=''; if (! $ldap_sid) // TODO ldap_sid ? { $generated_password=getRandomPassword(''); } $password=$generated_password; // Create a form array $formquestion=array( array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login), array('label' => $langs->trans("Password"), 'type' => 'text', 'name' => 'password', 'value' => $password), //array('label' => $form->textwithpicto($langs->trans("Type"),$langs->trans("InternalExternalDesc")), 'type' => 'select', 'name' => 'intern', 'default' => 1, 'values' => array(0=>$langs->trans('Internal'),1=>$langs->trans('External'))) ); $text=$langs->trans("ConfirmCreateContact").'
'; if ($conf->societe->enabled) { if ($object->socid > 0) $text.=$langs->trans("UserWillBeExternalUser"); else $text.=$langs->trans("UserWillBeInternalUser"); } $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("CreateDolibarrLogin"),$text,"confirm_create_user",$formquestion,'yes'); if ($ret == 'html') print '
'; } print ''; // Ref print ''; // Name print ''; print ''; // Company if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { print ''; } // Civility print ''; // Role print ''; // Address print ''; // Zip Town print ''; // Country print ''; // State if (empty($conf->global->SOCIETE_DISABLE_STATE)) { print ''; } // Phone print ''; print ''; print ''; print ''; // Email print ''; if ($conf->mailing->enabled) { $langs->load("mails"); print ''; print ''; } else { print ''; } print ''; // Instant message print ''; print ''; print ''; $object->load_ref_elements(); if ($conf->commande->enabled) { print ''; } if ($conf->propal->enabled) { print ''; } if ($conf->contrat->enabled) { print ''; } if ($conf->facture->enabled) { print ''; } print ''; print "
'.$langs->trans("Ref").''; print $form->showrefnav($object,'id'); print '
'.$langs->trans("Lastname").' / '.$langs->trans("Label").''.$object->name.''.$langs->trans("Firstname").''.$object->firstname.'
'.$langs->trans("Company").''; if ($object->socid > 0) { $objsoc->fetch($object->socid); print $objsoc->getNomUrl(1); } else { print $langs->trans("ContactNotLinkedToCompany"); } print '
'.$langs->trans("UserTitle").''; print $object->getCivilityLabel(); print '
'.$langs->trans("PostOrFunction" ).''.$object->poste.'
'.$langs->trans("Address").''; dol_print_address($object->address,'gmap','contact',$object->id); print '
'.$langs->trans("Zip").' / '.$langs->trans("Town").''; print $object->cp; if ($object->cp) print ' '; print $object->ville.'
'.$langs->trans("Country").''; $img=picto_from_langcode($object->pays_code); if ($img) print $img.' '; print $object->pays; print '
'.$langs->trans('State').''.$object->departement.'
'.$langs->trans("PhonePro").''.dol_print_phone($object->phone_pro,$object->pays_code,$object->id,$object->socid,'AC_TEL').''.$langs->trans("PhonePerso").''.dol_print_phone($object->phone_perso,$object->pays_code,$object->id,$object->socid,'AC_TEL').'
'.$langs->trans("PhoneMobile").''.dol_print_phone($object->phone_mobile,$object->pays_code,$object->id,$object->socid,'AC_TEL').''.$langs->trans("Fax").''.dol_print_phone($object->fax,$object->pays_code,$object->id,$object->socid,'AC_FAX').'
'.$langs->trans("EMail").''.dol_print_email($object->email,$object->id,$object->socid,'AC_EMAIL').''.$langs->trans("NbOfEMailingsReceived").''.$object->getNbOfEMailings().' 
'.$langs->trans("IM").''.$object->jabberid.'
'.$langs->trans("ContactVisibility").''; print $object->LibPubPriv($object->priv); print '
'.$langs->trans("Note").''; print nl2br($object->note); print '
'.$langs->trans("ContactForOrders").''; print $object->ref_commande?$object->ref_commande:$langs->trans("NoContactForAnyOrder"); print '
'.$langs->trans("ContactForProposals").''; print $object->ref_propal?$object->ref_propal:$langs->trans("NoContactForAnyProposal"); print '
'.$langs->trans("ContactForContracts").''; print $object->ref_contrat?$object->ref_contrat:$langs->trans("NoContactForAnyContract"); print '
'.$langs->trans("ContactForInvoices").''; print $object->ref_facturation?$object->ref_facturation:$langs->trans("NoContactForAnyInvoice"); print '
'.$langs->trans("DolibarrLogin").''; if ($object->user_id) { $dolibarr_user=new User($db); $result=$dolibarr_user->fetch($object->user_id); print $dolibarr_user->getLoginUrl(1); } else print $langs->trans("NoDolibarrAccess"); print '
"; print ""; // Barre d'actions if (! $user->societe_id) { print '
'; if ($user->rights->societe->contact->creer) { print ''.$langs->trans('Modify').''; } if (! $object->user_id && $user->rights->user->user->creer) { print ''.$langs->trans("CreateDolibarrLogin").''; } if ($user->rights->societe->contact->supprimer) { print ''.$langs->trans('Delete').''; } print "

"; } print show_actions_todo($conf,$langs,$db,$objsoc,$object); print show_actions_done($conf,$langs,$db,$objsoc,$object); } } $db->close(); llxFooter(); ?>