+
+
+ trans("Ref"); ?>
+ control->tpl['showrefnav']; ?>
+
+
+
+ trans("Lastname"); ?>
+ control->tpl['name']; ?>
+ trans("Firstname"); ?>
+ control->tpl['firstname']; ?>
+
+
+
+ trans("Company"); ?>
+ control->tpl['company']; ?>
+
+
+
+ trans("UserTitle"); ?>
+ control->tpl['civility']; ?>
+
+
+
+ trans("PostOrFunction" ); ?>
+ control->tpl['poste']; ?>
+
+
+
+ trans("Address"); ?>
+ control->tpl['address']; ?>
+
+
+
+ trans("Zip").' / '.$langs->trans("Town"); ?>
+ control->tpl['zip'].$this->control->tpl['ville']; ?>
+
+
+
+ trans("Country"); ?>
+ control->tpl['country']; ?>
+
+
+
+ trans('State'); ?>
+ control->tpl['departement']; ?>
+
+
+
+ trans("PhonePro"); ?>
+ control->tpl['phone_pro']; ?>
+ trans("PhonePerso"); ?>
+ control->tpl['phone_perso']; ?>
+
+
+
+ trans("PhoneMobile"); ?>
+ control->tpl['phone_mobile']; ?>
+ trans("Fax"); ?>
+ control->tpl['fax']; ?>
+
+
+
+ trans("EMail"); ?>
+ control->tpl['email']; ?>
+ control->tpl['nb_emailing']) { ?>
+ trans("NbOfEMailingsReceived"); ?>
+ control->tpl['nb_emailing']; ?>
+
+
+
+
+
+
+ trans("Jabberid"); ?>
+ control->tpl['jabberid']; ?>
+
+
+
+ trans("ContactVisibility"); ?>
+ control->tpl['visibility']; ?>
+
+
+
+ trans("Note"); ?>
+ control->tpl['note']; ?>
+
+control->tpl['contact_element'] as $element) { ?>
+
+
+
+
+
+
+
+ trans("DolibarrLogin"); ?>
+ control->tpl['dolibarr_user']; ?>
+
+
+
+
+
\ No newline at end of file
diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php
index e0dd4dd58c0..f93ae6c8a64 100644
--- a/htdocs/contact/fiche.php
+++ b/htdocs/contact/fiche.php
@@ -38,168 +38,189 @@ $langs->load("companies");
$langs->load("users");
$errors = array();
-$socid=$_GET["socid"]?$_GET["socid"]:$_POST["socid"];
+$socid = GETPOST("socid");
// Security check
-$contactid = isset($_GET["id"])?$_GET["id"]:'';
+$id = isset($_GET["id"])?$_GET["id"]:'';
if ($user->societe_id) $socid=$user->societe_id;
-$result = restrictedArea($user, 'contact', $contactid, 'socpeople'); // If we create a contact with no company (shared contacts), no check on write permission
+$object = new Contact($db);
+
+// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
+if (!empty($id)) $object->getCanvas($id);
+$canvas = (!empty($object->canvas)?$object->canvas:GETPOST("canvas"));
+if (! empty($canvas))
+{
+ require_once(DOL_DOCUMENT_ROOT."/core/class/canvas.class.php");
+ $objcanvas = new Canvas($db);
+
+ $objcanvas->getCanvas('thirdparty','contactcard',$canvas);
+
+ // Security check
+ $result = $objcanvas->restrictedArea($user, 'contact', $id, 'socpeople');
+}
+else
+{
+ // Security check
+ $result = restrictedArea($user, 'contact', $id, 'socpeople'); // If we create a contact with no company (shared contacts), no check on write permission
+}
/*
* Actions
*/
-// Creation utilisateur depuis contact
-if ($_POST["action"] == 'confirm_create_user' && $_POST["confirm"] == 'yes' && $user->rights->user->user->creer)
+// If canvas is defined, because on url, or because contact was created with canvas feature on,
+// we use the canvas feature.
+// If canvas is not defined, we use standard feature.
+if (! empty($canvas))
{
- // Recuperation contact actuel
- $contact = new Contact($db);
- $result = $contact->fetch($_GET["id"]);
+ // -----------------------------------------
+ // When used with CANVAS
+ // -----------------------------------------
- if ($result > 0)
- {
- // Creation user
- $nuser = new User($db);
- $result=$nuser->create_from_contact($contact,$_POST["login"]);
-
- if ($result < 0)
- {
- $msg=$nuser->error;
- }
- }
- else
- {
- $msg=$contact->error;
- }
+ // Load data control
+ $objcanvas->doActions($id);
}
-
-// Creation contact
-if ($_POST["action"] == 'add' && $user->rights->societe->contact->creer)
+else
{
- $contact = new Contact($db);
-
- $contact->socid = $_POST["socid"];
-
- $contact->name = $_POST["name"];
- $contact->firstname = $_POST["firstname"];
- $contact->civilite_id = $_POST["civilite_id"];
- $contact->poste = $_POST["poste"];
- $contact->address = $_POST["address"];
- $contact->cp = $_POST["cp"];
- $contact->ville = $_POST["ville"];
- $contact->fk_pays = $_POST["pays_id"];
- $contact->fk_departement = $_POST["departement_id"];
- $contact->email = $_POST["email"];
- $contact->phone_pro = $_POST["phone_pro"];
- $contact->phone_perso = $_POST["phone_perso"];
- $contact->phone_mobile = $_POST["phone_mobile"];
- $contact->fax = $_POST["fax"];
- $contact->jabberid = $_POST["jabberid"];
- $contact->priv = $_POST["priv"];
-
- $contact->note = $_POST["note"];
-
- if (! $_POST["name"])
- {
- array_push($errors,$langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname").' / '.$langs->transnoentities("Label")));
- $_GET["action"] = 'create';
- $_POST["action"] = 'create';
- $_REQUEST["action"] = 'create';
- }
-
- if ($_POST["name"])
- {
- $id = $contact->create($user);
- if ($id > 0)
- {
- Header("Location: fiche.php?id=".$id);
- exit;
- }
- else
- {
- $errors=array($contact->error);
- $_GET["action"] = 'create';
- $_POST["action"] = 'create';
- $_REQUEST["action"] = 'create';
- }
- }
-}
-
-if ($_REQUEST["action"] == 'confirm_delete' && $_REQUEST["confirm"] == 'yes' && $user->rights->societe->contact->supprimer)
-{
- $contact = new Contact($db);
- $result=$contact->fetch($_GET["id"]);
-
- $contact->old_name = $_POST["old_name"];
- $contact->old_firstname = $_POST["old_firstname"];
-
- $result = $contact->delete();
- if ($result > 0)
+ // Creation utilisateur depuis contact
+ if ($_POST["action"] == 'confirm_create_user' && $_POST["confirm"] == 'yes' && $user->rights->user->user->creer)
{
- Header("Location: index.php");
- exit;
- }
- else
- {
- $mesg=$contact->error;
- }
-}
-
-if ($_POST["action"] == 'update' && ! $_POST["cancel"] && $user->rights->societe->contact->creer)
-{
- if (empty($_POST["name"]))
- {
- $errors=array($langs->trans("ErrorFieldRequired",$langs->transnoentities("Name").' / '.$langs->transnoentities("Label")));
- $error++;
- $_GET["action"] = 'edit';
- $_POST["action"] = 'edit';
- $_REQUEST["action"] = 'edit';
- }
-
- if (! sizeof($errors))
- {
- $contact = new Contact($db);
- $contact->fetch($_POST["contactid"]);
-
- $contact->oldcopy=dol_clone($contact);
-
- $contact->old_name = $_POST["old_name"];
- $contact->old_firstname = $_POST["old_firstname"];
-
- $contact->socid = $_POST["socid"];
- $contact->name = $_POST["name"];
- $contact->firstname = $_POST["firstname"];
- $contact->civilite_id = $_POST["civilite_id"];
- $contact->poste = $_POST["poste"];
-
- $contact->address = $_POST["address"];
- $contact->cp = $_POST["cp"];
- $contact->ville = $_POST["ville"];
- $contact->fk_departement= $_POST["departement_id"];
- $contact->fk_pays = $_POST["pays_id"];
-
- $contact->email = $_POST["email"];
- $contact->phone_pro = $_POST["phone_pro"];
- $contact->phone_perso = $_POST["phone_perso"];
- $contact->phone_mobile = $_POST["phone_mobile"];
- $contact->fax = $_POST["fax"];
- $contact->jabberid = $_POST["jabberid"];
- $contact->priv = $_POST["priv"];
-
- $contact->note = $_POST["note"];
-
- $result = $contact->update($_POST["contactid"], $user);
-
+ // Recuperation contact actuel
+ $result = $object->fetch($_GET["id"]);
+
if ($result > 0)
{
- $contact->old_name='';
- $contact->old_firstname='';
+ // Creation user
+ $nuser = new User($db);
+ $result=$nuser->create_from_contact($object,$_POST["login"]);
+
+ if ($result < 0)
+ {
+ $msg=$nuser->error;
+ }
}
else
{
- $mesg=$contact->error;
+ $msg=$object->error;
+ }
+ }
+
+ // Creation contact
+ if ($_POST["action"] == 'add' && $user->rights->societe->contact->creer)
+ {
+ $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->cp = $_POST["cp"];
+ $object->ville = $_POST["ville"];
+ $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"];
+
+ if (! $_POST["name"])
+ {
+ array_push($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)
+ {
+ Header("Location: fiche.php?id=".$id);
+ exit;
+ }
+ else
+ {
+ $errors=array($object->error);
+ $_GET["action"] = $_POST["action"] = 'create';
+ }
+ }
+ }
+
+ 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: index.php");
+ exit;
+ }
+ else
+ {
+ $mesg=$object->error;
+ }
+ }
+
+ if ($_POST["action"] == 'update' && ! $_POST["cancel"] && $user->rights->societe->contact->creer)
+ {
+ if (empty($_POST["name"]))
+ {
+ $errors=array($langs->trans("ErrorFieldRequired",$langs->transnoentities("Name").' / '.$langs->transnoentities("Label")));
+ $error++;
+ $_GET["action"] = $_POST["action"] = 'edit';
+ }
+
+ if (! sizeof($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->cp = $_POST["cp"];
+ $object->ville = $_POST["ville"];
+ $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
+ {
+ $mesg=$object->error;
+ }
}
}
}
@@ -222,537 +243,658 @@ if ($socid > 0)
$objsoc->fetch($socid);
}
-
-/*
- * Onglets
- */
-if ($_GET["id"] > 0)
+if (! empty($canvas))
{
- // Si edition contact deja existant
- $contact = new Contact($db);
- $return=$contact->fetch($_GET["id"], $user);
- if ($return <= 0)
+ // -----------------------------------------
+ // When used with CANVAS
+ // -----------------------------------------
+
+ if ($user->rights->societe->contact->creer)
{
- dol_print_error('',$contact->error);
- $_GET["id"]=0;
- }
-
- /*
- * Affichage onglets
- */
- $head = contact_prepare_head($contact);
-
- dol_fiche_head($head, 'general', $langs->trans("Contact"), 0, 'contact');
-}
-
-
-/*
- * Confirmation de la suppression du 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 '';
-
+
// Ref
- print ''.$langs->trans("Ref").' ';
- print $contact->ref;
+ print ' '.$langs->trans("Ref").' ';
+ print $form->showrefnav($object,'id');
print ' ';
-
+
// Name
- print ''.$langs->trans("Lastname").' / '.$langs->trans("Label").' name).'"> ';
- print ''.$langs->trans("Firstname").' firstname).'"> ';
-
+ print ''.$langs->trans("Lastname").' '.$object->name.' ';
+ print ''.$langs->trans("Firstname").' '.$object->firstname.' ';
+
// Company
- print ''.$langs->trans("Company").' ';
- print '';
- print $form->select_societes(isset($_POST["socid"])?$_POST["socid"]:($contact->socid?$contact->socid:-1),'socid','',1);
- print ' ';
- print ' ';
-
- // Civility
- print ''.$langs->trans("UserTitle").' ';
- print $formcompany->select_civilite(isset($_POST["civilite_id"])?$_POST["civilite_id"]:$contact->civilite_id);
+ print ' '.$langs->trans("Company").' ';
+ if ($object->socid > 0)
+ {
+ $objsoc->fetch($object->socid);
+ print $objsoc->getNomUrl(1);
+ }
+ else
+ {
+ print $langs->trans("ContactNotLinkedToCompany");
+ }
print ' ';
-
- print ''.$langs->trans("PostOrFunction" ).' poste).'"> ';
-
+
+ // Civility
+ print ''.$langs->trans("UserTitle").' ';
+ print $object->getCivilityLabel();
+ print ' ';
+
+ print ''.$langs->trans("PostOrFunction" ).' '.$object->poste.' ';
+
// Address
- print ''.$langs->trans("Address").' ';
-
- // Zip / Town
- print ''.$langs->trans("Zip").' / '.$langs->trans("Town").' cp).'"> ';
- print ' ville).'" maxlength="80"> ';
-
+ print ''.$langs->trans("Address").' '.nl2br($object->address).' ';
+
+ // Zip Town
+ print ''.$langs->trans("Zip").' / '.$langs->trans("Town").' ';
+ print $object->cp;
+ if ($object->cp) print ' ';
+ print $object->ville.' ';
+
// Country
print ''.$langs->trans("Country").' ';
- $form->select_pays(isset($_POST["pays_id"])?$_POST["pays_id"]:$contact->fk_pays,'pays_id');
- if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
+ $img=picto_from_langcode($object->pays_code);
+ if ($img) print $img.' ';
+ print $object->pays;
print ' ';
-
+
// Department
- print ''.$langs->trans('State').' ';
- $formcompany->select_departement($contact->fk_departement,$contact->pays_code);
- print ' ';
-
+ print ''.$langs->trans('State').' '.$object->departement.' ';
+
// Phone
- print ''.$langs->trans("PhonePro").' phone_pro).'"> ';
- print ''.$langs->trans("PhonePerso").' phone_perso).'"> ';
-
- print ''.$langs->trans("PhoneMobile").' phone_mobile).'"> ';
- print ''.$langs->trans("Fax").' fax).'"> ';
-
- // EMail
- print ''.$langs->trans("EMail").' email).'"> ';
+ print ''.$langs->trans("PhonePro").' '.dol_print_phone($object->phone_pro,$object->pays_code,$object->id,$object->socid,'AC_TEL').' ';
+ print ''.$langs->trans("PhonePerso").' '.dol_print_phone($object->phone_perso,$object->pays_code,$object->id,$object->socid,'AC_TEL').' ';
+
+ print ''.$langs->trans("PhoneMobile").' '.dol_print_phone($object->phone_mobile,$object->pays_code,$object->id,$object->socid,'AC_TEL').' ';
+ print ''.$langs->trans("Fax").' '.dol_print_phone($object->fax,$object->pays_code,$object->id,$object->socid,'AC_FAX').' ';
+
+ // Email
+ print ''.$langs->trans("EMail").' '.dol_print_email($object->email,$object->id,$object->socid,'AC_EMAIL').' ';
if ($conf->mailing->enabled)
{
$langs->load("mails");
print ''.$langs->trans("NbOfEMailingsReceived").' ';
- print ''.$contact->getNbOfEMailings().' ';
+ print ''.$object->getNbOfEMailings().' ';
}
else
{
print ' ';
}
print ' ';
-
+
// Jabberid
- print 'Jabberid jabberid).'"> ';
-
- // Visibility
+ print 'Jabberid '.$object->jabberid.' ';
+
print ''.$langs->trans("ContactVisibility").' ';
- $selectarray=array('0'=>$langs->trans("ContactPublic"),'1'=>$langs->trans("ContactPrivate"));
- print $form->selectarray('priv',$selectarray,$contact->priv,0);
+ print $object->LibPubPriv($object->priv);
print ' ';
-
+
print ''.$langs->trans("Note").' ';
- print ' ';
-
- $contact->load_ref_elements();
-
+ print nl2br($object->note);
+ print '';
+
+ $object->load_ref_elements();
+
if ($conf->commande->enabled)
{
print ''.$langs->trans("ContactForOrders").' ';
- print $contact->ref_commande?$contact->ref_commande:$langs->trans("NoContactForAnyOrder");
+ print $object->ref_commande?$object->ref_commande:$langs->trans("NoContactForAnyOrder");
print ' ';
}
-
+
if ($conf->propal->enabled)
{
print ''.$langs->trans("ContactForProposals").' ';
- print $contact->ref_propal?$contact->ref_propal:$langs->trans("NoContactForAnyProposal");
+ print $object->ref_propal?$object->ref_propal:$langs->trans("NoContactForAnyProposal");
print ' ';
}
-
+
if ($conf->contrat->enabled)
{
print ''.$langs->trans("ContactForContracts").' ';
- print $contact->ref_contrat?$contact->ref_contrat:$langs->trans("NoContactForAnyContract");
+ print $object->ref_contrat?$object->ref_contrat:$langs->trans("NoContactForAnyContract");
print ' ';
}
-
+
if ($conf->facture->enabled)
{
print ''.$langs->trans("ContactForInvoices").' ';
- print $contact->ref_facturation?$contact->ref_facturation:$langs->trans("NoContactForAnyInvoice");
+ print $object->ref_facturation?$object->ref_facturation:$langs->trans("NoContactForAnyInvoice");
print ' ';
}
-
- // Login Dolibarr
+
print ''.$langs->trans("DolibarrLogin").' ';
- if ($contact->user_id)
+ if ($object->user_id)
{
$dolibarr_user=new User($db);
- $result=$dolibarr_user->fetch($contact->user_id);
+ $result=$dolibarr_user->fetch($object->user_id);
print $dolibarr_user->getLoginUrl(1);
}
else print $langs->trans("NoDolibarrAccess");
print ' ';
-
- print '';
- print ' ';
- print ' ';
- print ' ';
- print ' ';
- print '
';
-
- print "";
- }
-}
-
-if ($_REQUEST["id"] && $_REQUEST["action"] != 'edit')
-{
- $objsoc = new Societe($db);
-
- /*
- * Fiche en mode visualisation
- *
- */
- if ($msg)
- {
- $langs->load("errors");
- print '';
-
- // Ref
- print ''.$langs->trans("Ref").' ';
- print $form->showrefnav($contact,'id');
- print ' ';
-
- // Name
- print ''.$langs->trans("Lastname").' '.$contact->name.' ';
- print ''.$langs->trans("Firstname").' '.$contact->firstname.' ';
-
- // Company
- print ''.$langs->trans("Company").' ';
- if ($contact->socid > 0)
- {
- $objsoc->fetch($contact->socid);
- print $objsoc->getNomUrl(1);
- }
- else
- {
- print $langs->trans("ContactNotLinkedToCompany");
- }
- print ' ';
-
- // Civility
- print ''.$langs->trans("UserTitle").' ';
- print $contact->getCivilityLabel();
- print ' ';
-
- print ''.$langs->trans("PostOrFunction" ).' '.$contact->poste.' ';
-
- // Address
- print ''.$langs->trans("Address").' '.nl2br($contact->address).' ';
-
- // Zip Town
- print ''.$langs->trans("Zip").' / '.$langs->trans("Town").' ';
- print $contact->cp;
- if ($contact->cp) print ' ';
- print $contact->ville.' ';
-
- // Country
- print ''.$langs->trans("Country").' ';
- $img=picto_from_langcode($contact->pays_code);
- if ($img) print $img.' ';
- print $contact->pays;
- print ' ';
-
- // Department
- print ''.$langs->trans('State').' '.$contact->departement.' ';
-
- // Phone
- print ''.$langs->trans("PhonePro").' '.dol_print_phone($contact->phone_pro,$contact->pays_code,$contact->id,$contact->socid,'AC_TEL').' ';
- print ''.$langs->trans("PhonePerso").' '.dol_print_phone($contact->phone_perso,$contact->pays_code,$contact->id,$contact->socid,'AC_TEL').' ';
-
- print ''.$langs->trans("PhoneMobile").' '.dol_print_phone($contact->phone_mobile,$contact->pays_code,$contact->id,$contact->socid,'AC_TEL').' ';
- print ''.$langs->trans("Fax").' '.dol_print_phone($contact->fax,$contact->pays_code,$contact->id,$contact->socid,'AC_FAX').' ';
-
- // Email
- print ''.$langs->trans("EMail").' '.dol_print_email($contact->email,$contact->id,$contact->socid,'AC_EMAIL').' ';
- if ($conf->mailing->enabled)
- {
- $langs->load("mails");
- print ''.$langs->trans("NbOfEMailingsReceived").' ';
- print ''.$contact->getNbOfEMailings().' ';
- }
- else
- {
- print ' ';
- }
- print ' ';
-
- // Jabberid
- print 'Jabberid '.$contact->jabberid.' ';
-
- print ''.$langs->trans("ContactVisibility").' ';
- print $contact->LibPubPriv($contact->priv);
- print ' ';
-
- print ''.$langs->trans("Note").' ';
- print nl2br($contact->note);
- print ' ';
-
- $contact->load_ref_elements();
-
- if ($conf->commande->enabled)
- {
- print ''.$langs->trans("ContactForOrders").' ';
- print $contact->ref_commande?$contact->ref_commande:$langs->trans("NoContactForAnyOrder");
- print ' ';
- }
-
- if ($conf->propal->enabled)
- {
- print ''.$langs->trans("ContactForProposals").' ';
- print $contact->ref_propal?$contact->ref_propal:$langs->trans("NoContactForAnyProposal");
- print ' ';
- }
-
- if ($conf->contrat->enabled)
- {
- print ''.$langs->trans("ContactForContracts").' ';
- print $contact->ref_contrat?$contact->ref_contrat:$langs->trans("NoContactForAnyContract");
- print ' ';
- }
-
- if ($conf->facture->enabled)
- {
- print ''.$langs->trans("ContactForInvoices").' ';
- print $contact->ref_facturation?$contact->ref_facturation:$langs->trans("NoContactForAnyInvoice");
- print ' ';
- }
-
- print ''.$langs->trans("DolibarrLogin").' ';
- if ($contact->user_id)
- {
- $dolibarr_user=new User($db);
- $result=$dolibarr_user->fetch($contact->user_id);
- print $dolibarr_user->getLoginUrl(1);
- }
- else print $langs->trans("NoDolibarrAccess");
- print ' ';
-
- print "
";
-
- print "";
-
-
- // Barre d'actions
- if (! $user->societe_id)
- {
- print '';
-
- if ($user->rights->societe->contact->creer)
+
+ print "";
+
+ print "
";
+
+ // Barre d'actions
+ if (! $user->societe_id)
{
- print '