2005-07-16 02:52:29 +02:00
|
|
|
<?php
|
2010-03-26 23:11:11 +01:00
|
|
|
/* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
2012-12-30 15:13:49 +01:00
|
|
|
* Copyright (C) 2006-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
2005-07-16 02:52:29 +02:00
|
|
|
*
|
|
|
|
|
* 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
|
2013-01-16 15:36:08 +01:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2005-07-16 02:52:29 +02:00
|
|
|
* (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
|
2011-08-01 01:54:11 +02:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2005-07-16 02:52:29 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
2010-03-26 23:11:11 +01:00
|
|
|
* \file htdocs/contact/exportimport.php
|
|
|
|
|
* \ingroup societe
|
|
|
|
|
* \brief Onglet exports-imports d'un contact
|
|
|
|
|
*/
|
2005-07-16 02:52:29 +02:00
|
|
|
|
2012-08-22 23:24:21 +02:00
|
|
|
require '../main.inc.php';
|
2012-08-22 23:11:24 +02:00
|
|
|
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
|
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php';
|
2005-07-16 02:52:29 +02:00
|
|
|
|
|
|
|
|
$langs->load("companies");
|
|
|
|
|
|
2008-02-25 17:30:43 +01:00
|
|
|
// Security check
|
2013-04-26 12:35:31 +02:00
|
|
|
$id = GETPOST('id', 'int');
|
2008-02-25 21:03:21 +01:00
|
|
|
if ($user->societe_id) $socid=$user->societe_id;
|
2013-04-26 12:35:31 +02:00
|
|
|
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
|
2006-03-11 17:04:19 +01:00
|
|
|
|
2005-07-16 02:52:29 +02:00
|
|
|
|
|
|
|
|
/*
|
2010-03-26 23:11:11 +01:00
|
|
|
* View
|
|
|
|
|
*/
|
2005-07-16 02:52:29 +02:00
|
|
|
|
2013-04-26 12:35:31 +02:00
|
|
|
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
|
|
|
|
|
|
|
|
|
|
llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
2005-07-16 02:52:29 +02:00
|
|
|
|
|
|
|
|
$form = new Form($db);
|
|
|
|
|
|
|
|
|
|
$contact = new Contact($db);
|
2013-04-26 12:35:31 +02:00
|
|
|
$contact->fetch($id, $user);
|
2005-07-16 02:52:29 +02:00
|
|
|
|
|
|
|
|
|
2006-11-19 05:56:10 +01:00
|
|
|
$head = contact_prepare_head($contact);
|
2005-07-16 02:52:29 +02:00
|
|
|
|
2013-04-26 12:35:31 +02:00
|
|
|
dol_fiche_head($head, 'exportimport', $title, 0, 'contact');
|
2005-07-16 02:52:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Fiche en mode visu
|
|
|
|
|
*/
|
|
|
|
|
print '<table class="border" width="100%">';
|
|
|
|
|
|
2012-07-28 21:54:36 +02:00
|
|
|
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
|
|
|
|
|
|
2007-11-05 19:35:45 +01:00
|
|
|
// Ref
|
|
|
|
|
print '<tr><td>'.$langs->trans("Ref").'</td><td colspan="3">';
|
2012-07-28 21:54:36 +02:00
|
|
|
print $form->showrefnav($contact, 'id', $linkback);
|
2007-11-05 19:35:45 +01:00
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
// Name
|
2013-03-09 20:34:38 +01:00
|
|
|
print '<tr><td width="20%">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td>'.$contact->lastname.'</td>';
|
2007-11-05 19:35:45 +01:00
|
|
|
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="25%">'.$contact->firstname.'</td></tr>';
|
|
|
|
|
|
|
|
|
|
// Company
|
2011-02-13 13:55:40 +01:00
|
|
|
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
2005-07-16 02:52:29 +02:00
|
|
|
{
|
2011-02-13 13:55:40 +01:00
|
|
|
if ($contact->socid > 0)
|
|
|
|
|
{
|
|
|
|
|
$objsoc = new Societe($db);
|
|
|
|
|
$objsoc->fetch($contact->socid);
|
|
|
|
|
|
|
|
|
|
print '<tr><td width="15%">'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->getNomUrl(1).'</td></tr>';
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
print '<tr><td width="15%">'.$langs->trans("Company").'</td><td colspan="3">';
|
|
|
|
|
print $langs->trans("ContactNotLinkedToCompany");
|
|
|
|
|
print '</td></tr>';
|
|
|
|
|
}
|
2005-08-25 23:38:24 +02:00
|
|
|
}
|
2005-07-16 02:52:29 +02:00
|
|
|
|
2007-11-05 19:35:45 +01:00
|
|
|
// Civility
|
2005-07-16 02:52:29 +02:00
|
|
|
print '<tr><td>'.$langs->trans("UserTitle").'</td><td colspan="3">';
|
2008-01-10 18:12:07 +01:00
|
|
|
print $contact->getCivilityLabel();
|
2005-07-16 02:52:29 +02:00
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
print '</table>';
|
|
|
|
|
|
|
|
|
|
print '</div>';
|
|
|
|
|
|
|
|
|
|
print '<br>';
|
|
|
|
|
|
|
|
|
|
print $langs->trans("ExportCardToFormat").': ';
|
2013-04-26 12:35:31 +02:00
|
|
|
print '<a href="'.DOL_URL_ROOT.'/contact/vcard.php?id='.$contact->id.'">';
|
2008-11-16 02:09:04 +01:00
|
|
|
print img_picto($langs->trans("VCard"),'vcard.png').' ';
|
2005-07-16 02:52:29 +02:00
|
|
|
print $langs->trans("VCard");
|
|
|
|
|
print '</a>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$db->close();
|
|
|
|
|
|
2011-08-27 16:24:16 +02:00
|
|
|
llxFooter();
|
2005-07-16 02:52:29 +02:00
|
|
|
?>
|