2004-10-19 20:43:23 +00:00
|
|
|
<?php
|
2018-09-09 07:36:12 +00:00
|
|
|
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
|
|
|
|
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
2018-10-27 12:43:12 +00:00
|
|
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
2018-09-09 07:36:12 +00:00
|
|
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
2004-01-31 11:56:45 +00: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 14:36:08 +00:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2004-01-31 11:56:45 +00: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
|
2019-09-23 19:55:30 +00:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2004-01-31 11:56:45 +00:00
|
|
|
*/
|
2004-11-11 21:15:34 +00:00
|
|
|
|
2004-12-25 18:37:40 +00:00
|
|
|
/**
|
2010-03-26 22:11:11 +00:00
|
|
|
* \file htdocs/contact/perso.php
|
|
|
|
|
* \ingroup societe
|
|
|
|
|
* \brief Onglet informations personnelles d'un contact
|
|
|
|
|
*/
|
2004-11-11 21:15:34 +00:00
|
|
|
|
2012-08-22 21:24:21 +00:00
|
|
|
require '../main.inc.php';
|
2012-08-22 21:11:24 +00:00
|
|
|
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
|
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php';
|
2004-01-31 11:56:45 +00:00
|
|
|
|
2018-05-26 18:32:23 +00:00
|
|
|
// Load translation files required by the page
|
|
|
|
|
$langs->loadLangs(array('companies', 'other'));
|
2004-11-11 21:15:34 +00:00
|
|
|
|
2020-04-10 08:59:32 +00:00
|
|
|
$id = GETPOST('id', 'int');
|
|
|
|
|
$action = GETPOST('action', 'alpha');
|
2012-01-10 16:16:17 +00:00
|
|
|
|
2008-02-25 16:30:43 +00:00
|
|
|
// Security check
|
2020-04-10 08:59:32 +00:00
|
|
|
if ($user->socid) $socid = $user->socid;
|
2012-01-10 16:16:17 +00:00
|
|
|
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
|
|
|
|
|
$object = new Contact($db);
|
2010-11-19 21:24:48 +00:00
|
|
|
|
2008-06-12 11:51:11 +00:00
|
|
|
/*
|
|
|
|
|
* Action
|
|
|
|
|
*/
|
|
|
|
|
|
2020-04-10 08:59:32 +00:00
|
|
|
if ($action == 'update' && !$_POST["cancel"] && $user->rights->societe->contact->creer)
|
2008-06-12 11:51:11 +00:00
|
|
|
{
|
2012-01-10 16:16:17 +00:00
|
|
|
$ret = $object->fetch($id);
|
2012-02-05 11:40:08 +00:00
|
|
|
|
2012-01-10 16:16:17 +00:00
|
|
|
// Note: Correct date should be completed with location to have exact GM time of birth.
|
2019-01-27 10:55:16 +00:00
|
|
|
$object->birthday = dol_mktime(0, 0, 0, $_POST["birthdaymonth"], $_POST["birthdayday"], $_POST["birthdayyear"]);
|
2012-01-10 16:16:17 +00:00
|
|
|
$object->birthday_alert = $_POST["birthday_alert"];
|
2012-02-05 11:40:08 +00:00
|
|
|
|
2020-04-10 08:59:32 +00:00
|
|
|
if (GETPOST('deletephoto')) $object->photo = '';
|
|
|
|
|
elseif (!empty($_FILES['photo']['name'])) $object->photo = dol_sanitizeFileName($_FILES['photo']['name']);
|
2016-03-26 17:12:03 +00:00
|
|
|
|
2012-01-10 16:16:17 +00:00
|
|
|
$result = $object->update_perso($id, $user);
|
|
|
|
|
if ($result > 0)
|
|
|
|
|
{
|
2020-04-10 08:59:32 +00:00
|
|
|
$object->old_name = '';
|
|
|
|
|
$object->old_firstname = '';
|
2016-03-26 17:12:03 +00:00
|
|
|
// Logo/Photo save
|
2020-04-10 08:59:32 +00:00
|
|
|
$dir = $conf->societe->dir_output.'/contact/'.get_exdir($object->id, 0, 0, 1, $object, 'contact').'/photos';
|
2017-10-03 14:00:52 +00:00
|
|
|
|
2016-03-26 17:12:03 +00:00
|
|
|
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
|
|
|
|
|
if ($file_OK)
|
|
|
|
|
{
|
|
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
|
|
|
|
if (GETPOST('deletephoto'))
|
|
|
|
|
{
|
2020-04-10 08:59:32 +00:00
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
|
|
|
|
$fileimg = $conf->societe->dir_output.'/contact/'.get_exdir($object->id, 0, 0, 1, $object, 'contact').'/photos/'.$object->photo;
|
|
|
|
|
$dirthumbs = $conf->societe->dir_output.'/contact/'.get_exdir($object->id, 0, 0, 1, $object, 'contact').'/photos/thumbs';
|
2016-03-26 17:12:03 +00:00
|
|
|
dol_delete_file($fileimg);
|
|
|
|
|
dol_delete_dir_recursive($dirthumbs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (image_format_supported($_FILES['photo']['name']) > 0)
|
|
|
|
|
{
|
|
|
|
|
dol_mkdir($dir);
|
|
|
|
|
|
|
|
|
|
if (@is_dir($dir))
|
|
|
|
|
{
|
2020-04-10 08:59:32 +00:00
|
|
|
$newfile = $dir.'/'.dol_sanitizeFileName($_FILES['photo']['name']);
|
|
|
|
|
if (!dol_move_uploaded_file($_FILES['photo']['tmp_name'], $newfile, 1, 0, $_FILES['photo']['error']) > 0)
|
2016-03-26 17:12:03 +00:00
|
|
|
{
|
|
|
|
|
setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors');
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2016-04-09 12:12:21 +00:00
|
|
|
// Create thumbs
|
2017-10-03 14:00:52 +00:00
|
|
|
$object->addThumbs($newfile);
|
2016-03-26 17:12:03 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
setEventMessages("ErrorBadImageFormat", null, 'errors');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-04-10 08:59:32 +00:00
|
|
|
switch ($_FILES['photo']['error'])
|
2016-03-26 17:12:03 +00:00
|
|
|
{
|
|
|
|
|
case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini
|
|
|
|
|
case 2: //uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form
|
|
|
|
|
$errors[] = "ErrorFileSizeTooLarge";
|
|
|
|
|
break;
|
|
|
|
|
case 3: //uploaded file was only partially uploaded
|
|
|
|
|
$errors[] = "ErrorFilePartiallyUploaded";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-01-10 16:16:17 +00:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$error = $object->error;
|
|
|
|
|
}
|
2008-06-12 11:51:11 +00:00
|
|
|
}
|
|
|
|
|
|
2005-07-16 00:52:29 +00:00
|
|
|
|
2004-01-31 11:56:45 +00:00
|
|
|
/*
|
2011-08-20 15:11:31 +00:00
|
|
|
* View
|
|
|
|
|
*/
|
|
|
|
|
|
2020-04-10 08:59:32 +00:00
|
|
|
$now = dol_now();
|
2005-07-02 11:29:15 +00:00
|
|
|
|
2020-04-10 08:59:32 +00:00
|
|
|
$title = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
|
|
|
|
|
if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/contactnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->lastname) $title = $object->lastname;
|
|
|
|
|
$help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
|
2015-10-15 12:13:31 +00:00
|
|
|
llxHeader('', $title, $helpurl);
|
2004-01-31 11:56:45 +00:00
|
|
|
|
2005-07-16 00:52:29 +00:00
|
|
|
$form = new Form($db);
|
|
|
|
|
|
2012-01-10 16:16:17 +00:00
|
|
|
$object->fetch($id, $user);
|
2004-11-11 21:15:34 +00:00
|
|
|
|
2012-01-10 16:16:17 +00:00
|
|
|
$head = contact_prepare_head($object);
|
2004-11-11 21:15:34 +00:00
|
|
|
|
2012-01-10 16:16:17 +00:00
|
|
|
if ($action == 'edit')
|
2004-01-31 11:56:45 +00:00
|
|
|
{
|
2016-08-02 14:55:32 +00:00
|
|
|
/*
|
2012-01-10 16:16:17 +00:00
|
|
|
* Fiche en mode edition
|
|
|
|
|
*/
|
2005-02-15 22:38:40 +00:00
|
|
|
|
2012-01-10 16:16:17 +00:00
|
|
|
print '<form name="perso" method="POST" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
2019-12-18 22:12:31 +00:00
|
|
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
2005-07-02 11:29:15 +00:00
|
|
|
print '<input type="hidden" name="action" value="update">';
|
2012-01-10 16:16:17 +00:00
|
|
|
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
2004-01-31 11:56:45 +00:00
|
|
|
|
2016-08-02 14:55:32 +00:00
|
|
|
dol_fiche_head($head, 'perso', $title, 0, 'contact');
|
2017-10-03 14:00:52 +00:00
|
|
|
|
2019-11-05 20:24:41 +00:00
|
|
|
print '<table class="border centpercent">';
|
2012-02-05 11:40:08 +00:00
|
|
|
|
2011-08-20 15:11:31 +00:00
|
|
|
// Ref
|
2016-08-10 13:01:43 +00:00
|
|
|
print '<tr><td class="titlefieldcreate">'.$langs->trans("Ref").'</td><td colspan="3">';
|
2012-01-10 16:16:17 +00:00
|
|
|
print $object->id;
|
2016-03-26 17:12:03 +00:00
|
|
|
print '</td>';
|
2017-10-03 14:00:52 +00:00
|
|
|
|
2016-03-26 17:12:03 +00:00
|
|
|
// Photo
|
2019-02-24 13:30:02 +00:00
|
|
|
print '<td class="center hideonsmartphone valignmiddle" rowspan="6">';
|
2019-01-27 10:55:16 +00:00
|
|
|
print $form->showphoto('contact', $object)."\n";
|
2016-03-26 17:12:03 +00:00
|
|
|
if ($object->photo) print "<br>\n";
|
2017-10-03 14:00:52 +00:00
|
|
|
|
2016-03-26 17:12:03 +00:00
|
|
|
print '<table class="nobordernopadding">';
|
2017-10-03 14:00:52 +00:00
|
|
|
|
2019-02-24 13:30:02 +00:00
|
|
|
if ($object->photo) print '<tr><td class="center"><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> '.$langs->trans("Delete").'<br><br></td></tr>';
|
2016-03-26 17:12:03 +00:00
|
|
|
print '<tr><td>'.$langs->trans("PhotoFile").'</td></tr>';
|
|
|
|
|
print '<tr><td><input type="file" class="flat" name="photo" id="photoinput"></td></tr>';
|
|
|
|
|
print '</table>';
|
2017-10-03 14:00:52 +00:00
|
|
|
|
2007-11-05 18:35:45 +00:00
|
|
|
print '</td></tr>';
|
2009-08-05 17:49:12 +00:00
|
|
|
|
2011-08-20 15:11:31 +00:00
|
|
|
// Name
|
2016-08-10 13:01:43 +00:00
|
|
|
print '<tr><td>'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td colspan="3">'.$object->lastname.'</td></tr>';
|
|
|
|
|
print '<tr><td>'.$langs->trans("Firstname").'</td><td colspan="3">'.$object->firstname.'</td>';
|
2007-11-05 18:35:45 +00:00
|
|
|
|
|
|
|
|
// Company
|
2011-02-13 12:55:40 +00:00
|
|
|
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
2004-01-31 11:56:45 +00:00
|
|
|
{
|
2012-01-10 16:16:17 +00:00
|
|
|
if ($object->socid > 0)
|
2011-02-13 12:55:40 +00:00
|
|
|
{
|
|
|
|
|
$objsoc = new Societe($db);
|
2012-01-10 16:16:17 +00:00
|
|
|
$objsoc->fetch($object->socid);
|
2011-02-13 12:55:40 +00:00
|
|
|
|
2014-12-07 17:24:45 +00:00
|
|
|
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td colspan="3">'.$objsoc->getNomUrl(1).'</td>';
|
2011-02-13 12:55:40 +00:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2014-12-07 17:24:45 +00:00
|
|
|
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td colspan="3">';
|
2011-02-13 12:55:40 +00:00
|
|
|
print $langs->trans("ContactNotLinkedToCompany");
|
|
|
|
|
print '</td></tr>';
|
|
|
|
|
}
|
2005-08-25 21:38:24 +00:00
|
|
|
}
|
2009-08-05 17:49:12 +00:00
|
|
|
|
2011-08-20 15:11:31 +00:00
|
|
|
// Civility
|
2005-08-25 21:38:24 +00:00
|
|
|
print '<tr><td>'.$langs->trans("UserTitle").'</td><td colspan="3">';
|
2012-01-10 16:16:17 +00:00
|
|
|
print $object->getCivilityLabel();
|
2005-08-25 21:38:24 +00:00
|
|
|
print '</td></tr>';
|
2009-08-05 17:49:12 +00:00
|
|
|
|
2011-08-20 15:11:31 +00:00
|
|
|
// Date To Birth
|
2008-09-28 03:39:39 +00:00
|
|
|
print '<tr><td>'.$langs->trans("DateToBirth").'</td><td>';
|
2020-04-10 08:59:32 +00:00
|
|
|
$form = new Form($db);
|
2019-01-27 10:55:16 +00:00
|
|
|
print $form->selectDate($object->birthday, 'birthday', 0, 0, 1, "perso", 1, 0);
|
2005-07-02 11:29:15 +00:00
|
|
|
print '</td>';
|
2004-07-17 17:14:36 +00:00
|
|
|
|
2005-07-16 00:52:29 +00:00
|
|
|
print '<td colspan="2">'.$langs->trans("Alert").': ';
|
2020-04-10 08:59:32 +00:00
|
|
|
if (!empty($object->birthday_alert))
|
2004-01-31 11:56:45 +00:00
|
|
|
{
|
2015-05-07 09:39:26 +00:00
|
|
|
print '<input type="checkbox" name="birthday_alert" checked></td>';
|
2004-01-31 11:56:45 +00:00
|
|
|
}
|
2005-07-02 11:29:15 +00:00
|
|
|
else
|
2004-01-31 11:56:45 +00:00
|
|
|
{
|
2005-07-02 11:29:15 +00:00
|
|
|
print '<input type="checkbox" name="birthday_alert"></td>';
|
2004-01-31 11:56:45 +00:00
|
|
|
}
|
2005-07-02 11:29:15 +00:00
|
|
|
print '</tr>';
|
2004-01-31 11:56:45 +00:00
|
|
|
|
2016-08-02 14:55:32 +00:00
|
|
|
print "</table>";
|
2010-11-19 21:24:48 +00:00
|
|
|
|
2016-08-02 14:55:32 +00:00
|
|
|
dol_fiche_end();
|
2017-10-03 14:00:52 +00:00
|
|
|
|
2014-11-25 19:13:43 +00:00
|
|
|
print '<div class="center">';
|
2010-11-19 21:24:48 +00:00
|
|
|
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
2014-11-25 19:13:43 +00:00
|
|
|
print ' ';
|
2010-11-19 21:24:48 +00:00
|
|
|
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
2014-11-25 19:13:43 +00:00
|
|
|
print '</div>';
|
2004-01-31 11:56:45 +00:00
|
|
|
|
2005-07-02 11:29:15 +00:00
|
|
|
print "</form>";
|
2004-01-31 11:56:45 +00:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2015-10-15 12:13:31 +00:00
|
|
|
// View mode
|
2017-10-03 14:00:52 +00:00
|
|
|
|
2017-05-22 23:32:19 +00:00
|
|
|
dol_fiche_head($head, 'perso', $title, -1, 'contact');
|
2017-10-03 14:00:52 +00:00
|
|
|
|
|
|
|
|
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
|
|
|
|
|
2020-04-10 08:59:32 +00:00
|
|
|
$morehtmlref = '<div class="refidno">';
|
2016-12-19 15:35:40 +00:00
|
|
|
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
|
|
|
|
{
|
2020-04-10 08:59:32 +00:00
|
|
|
$objsoc = new Societe($db);
|
2016-12-19 15:35:40 +00:00
|
|
|
$objsoc->fetch($object->socid);
|
|
|
|
|
// Thirdparty
|
2020-04-10 08:59:32 +00:00
|
|
|
$morehtmlref .= $langs->trans('ThirdParty').' : ';
|
|
|
|
|
if ($objsoc->id > 0) $morehtmlref .= $objsoc->getNomUrl(1);
|
|
|
|
|
else $morehtmlref .= $langs->trans("ContactNotLinkedToCompany");
|
2016-12-19 15:35:40 +00:00
|
|
|
}
|
2020-04-10 08:59:32 +00:00
|
|
|
$morehtmlref .= '</div>';
|
2017-10-03 14:00:52 +00:00
|
|
|
|
|
|
|
|
|
2016-12-19 15:35:40 +00:00
|
|
|
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
|
2017-10-03 14:00:52 +00:00
|
|
|
|
|
|
|
|
|
2015-10-15 12:13:31 +00:00
|
|
|
print '<div class="fichecenter">';
|
2017-10-03 14:00:52 +00:00
|
|
|
|
2015-10-15 12:13:31 +00:00
|
|
|
print '<div class="underbanner clearboth"></div>';
|
2019-12-21 13:08:37 +00:00
|
|
|
print '<table class="border centpercent tableforfield">';
|
2007-11-05 18:35:45 +00:00
|
|
|
|
|
|
|
|
// Company
|
2016-12-19 15:35:40 +00:00
|
|
|
/*
|
2011-02-13 12:55:40 +00:00
|
|
|
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
2005-08-25 21:38:24 +00:00
|
|
|
{
|
2012-01-10 16:16:17 +00:00
|
|
|
if ($object->socid > 0)
|
2011-02-13 12:55:40 +00:00
|
|
|
{
|
|
|
|
|
$objsoc = new Societe($db);
|
2012-01-10 16:16:17 +00:00
|
|
|
$objsoc->fetch($object->socid);
|
2011-02-13 12:55:40 +00:00
|
|
|
|
2014-12-07 17:24:45 +00:00
|
|
|
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td colspan="3">'.$objsoc->getNomUrl(1).'</td></tr>';
|
2011-02-13 12:55:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
{
|
2014-12-07 17:24:45 +00:00
|
|
|
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td colspan="3">';
|
2011-02-13 12:55:40 +00:00
|
|
|
print $langs->trans("ContactNotLinkedToCompany");
|
|
|
|
|
print '</td></tr>';
|
|
|
|
|
}
|
2016-12-19 15:35:40 +00:00
|
|
|
}*/
|
2009-08-05 17:49:12 +00:00
|
|
|
|
2011-08-20 15:11:31 +00:00
|
|
|
// Civility
|
2015-10-15 12:13:31 +00:00
|
|
|
print '<tr><td class="titlefield">'.$langs->trans("UserTitle").'</td><td colspan="3">';
|
2012-01-10 16:16:17 +00:00
|
|
|
print $object->getCivilityLabel();
|
2005-08-25 21:38:24 +00:00
|
|
|
print '</td></tr>';
|
2009-08-05 17:49:12 +00:00
|
|
|
|
2011-08-20 15:11:31 +00:00
|
|
|
// Date To Birth
|
2012-02-05 11:40:08 +00:00
|
|
|
print '<tr>';
|
2020-04-10 08:59:32 +00:00
|
|
|
if (!empty($object->birthday))
|
2007-01-16 22:02:36 +00:00
|
|
|
{
|
2012-08-23 00:04:35 +00:00
|
|
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
2011-08-20 15:11:31 +00:00
|
|
|
|
2019-01-27 10:55:16 +00:00
|
|
|
print '<td>'.$langs->trans("DateToBirth").'</td><td colspan="3">'.dol_print_date($object->birthday, "day");
|
2011-08-20 15:11:31 +00:00
|
|
|
|
|
|
|
|
print ' ';
|
|
|
|
|
//var_dump($birthdatearray);
|
2020-04-10 08:59:32 +00:00
|
|
|
$ageyear = convertSecondToTime($now - $object->birthday, 'year') - 1970;
|
|
|
|
|
$agemonth = convertSecondToTime($now - $object->birthday, 'month') - 1;
|
2011-08-20 15:11:31 +00:00
|
|
|
if ($ageyear >= 2) print '('.$ageyear.' '.$langs->trans("DurationYears").')';
|
2019-01-27 09:49:34 +00:00
|
|
|
elseif ($agemonth >= 2) print '('.$agemonth.' '.$langs->trans("DurationMonths").')';
|
2011-08-20 15:11:31 +00:00
|
|
|
else print '('.$agemonth.' '.$langs->trans("DurationMonth").')';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print ' - ';
|
2012-01-10 16:16:17 +00:00
|
|
|
if ($object->birthday_alert) print $langs->trans("BirthdayAlertOn");
|
2009-03-10 21:21:45 +00:00
|
|
|
else print $langs->trans("BirthdayAlertOff");
|
2011-08-20 15:11:31 +00:00
|
|
|
print '</td>';
|
2005-07-02 11:29:15 +00:00
|
|
|
}
|
2007-01-16 22:02:36 +00:00
|
|
|
else
|
|
|
|
|
{
|
2016-08-02 14:55:32 +00:00
|
|
|
print '<td>'.$langs->trans("DateToBirth").'</td><td colspan="3"></td>';
|
2005-07-02 11:29:15 +00:00
|
|
|
}
|
|
|
|
|
print "</tr>";
|
|
|
|
|
|
2005-07-11 00:49:16 +00:00
|
|
|
print "</table>";
|
2005-07-02 11:29:15 +00:00
|
|
|
|
2015-10-15 12:13:31 +00:00
|
|
|
print '</div>';
|
2016-08-02 14:55:32 +00:00
|
|
|
|
|
|
|
|
dol_fiche_end();
|
2012-02-05 11:40:08 +00:00
|
|
|
}
|
2005-07-02 11:29:15 +00:00
|
|
|
|
2005-07-16 00:52:29 +00:00
|
|
|
|
2012-02-05 11:40:08 +00:00
|
|
|
if ($action != 'edit')
|
|
|
|
|
{
|
2005-07-02 11:29:15 +00:00
|
|
|
// Barre d'actions
|
2019-10-31 19:46:31 +00:00
|
|
|
if ($user->socid == 0)
|
2004-01-31 11:56:45 +00:00
|
|
|
{
|
2005-07-02 11:29:15 +00:00
|
|
|
print '<div class="tabsAction">';
|
2009-08-05 17:49:12 +00:00
|
|
|
|
2011-08-20 15:11:31 +00:00
|
|
|
if ($user->rights->societe->contact->creer)
|
|
|
|
|
{
|
2012-01-10 16:16:17 +00:00
|
|
|
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit">'.$langs->trans('Modify').'</a>';
|
2005-12-02 11:55:43 +00:00
|
|
|
}
|
2004-01-31 11:56:45 +00:00
|
|
|
|
2005-07-02 11:29:15 +00:00
|
|
|
print "</div>";
|
2004-01-31 11:56:45 +00:00
|
|
|
}
|
|
|
|
|
}
|
2004-11-11 21:15:34 +00:00
|
|
|
|
2012-02-05 11:40:08 +00:00
|
|
|
|
2012-01-10 16:16:17 +00:00
|
|
|
llxFooter();
|
|
|
|
|
|
2004-11-11 21:15:34 +00:00
|
|
|
$db->close();
|