Supprime style obsolete FicheSubmit
This commit is contained in:
parent
679fe48512
commit
1131c45694
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -18,14 +18,13 @@
|
|||||||
*
|
*
|
||||||
* $Id$
|
* $Id$
|
||||||
* $Source$
|
* $Source$
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/contact/perso.php
|
\file htdocs/contact/perso.php
|
||||||
\ingroup societe
|
\ingroup societe
|
||||||
\brief Onglet informations personnelles d'un contact
|
\brief Onglet informations personnelles d'un contact
|
||||||
\version $Revision$
|
\version $Revision$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
@ -35,30 +34,33 @@ require (DOL_DOCUMENT_ROOT."/lib/vcard/vcard.class.php");
|
|||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
|
|
||||||
|
|
||||||
if ($_POST["action"] == 'update')
|
if ($_POST["action"] == 'update')
|
||||||
{
|
{
|
||||||
$contact = new Contact($db);
|
$contact = new Contact($db);
|
||||||
$contact->id = $_POST["contactid"];
|
$contact->id = $_POST["contactid"];
|
||||||
|
|
||||||
if ($_POST["birthdayyear"]) {
|
if ($_POST["birthdayyear"])
|
||||||
if ($_POST["birthdayyear"]<=1970 && $_SERVER["WINDIR"]) {
|
{
|
||||||
# windows mktime does not support negative date timestamp so birthday is not supported for old persons
|
if ($_POST["birthdayyear"]<=1970 && $_SERVER["WINDIR"])
|
||||||
|
{
|
||||||
|
// windows mktime does not support negative date timestamp so birthday is not supported for old persons
|
||||||
$contact->birthday = $_POST["birthdayyear"].'-'.$_POST["birthdaymonth"].'-'.$_POST["birthdayday"];
|
$contact->birthday = $_POST["birthdayyear"].'-'.$_POST["birthdaymonth"].'-'.$_POST["birthdayday"];
|
||||||
//array_push($error,"Windows ne sachant pas gérer des dates avant 1970, les dates de naissance avant cette date ne seront pas sauvegardées");
|
// array_push($error,"Windows ne sachant pas gérer des dates avant 1970, les dates de naissance avant cette date ne seront pas sauvegardées");
|
||||||
} else {
|
} else {
|
||||||
$contact->birthday = mktime(0,0,0,$_POST["birthdaymonth"],$_POST["birthdayday"],$_POST["birthdayyear"]);
|
$contact->birthday = mktime(0,0,0,$_POST["birthdaymonth"],$_POST["birthdayday"],$_POST["birthdayyear"]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$contact->birthday_alert = $_POST["birthday_alert"];
|
$contact->birthday_alert = $_POST["birthday_alert"];
|
||||||
|
|
||||||
$result = $contact->update_perso($_POST["contactid"], $user);
|
$result = $contact->update_perso($_POST["contactid"], $user);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
$contact = new Contact($db);
|
$contact = new Contact($db);
|
||||||
@ -87,104 +89,100 @@ $h++;
|
|||||||
dolibarr_fiche_head($head, $hselected, $langs->trans("Contact").": ".$contact->firstname.' '.$contact->name);
|
dolibarr_fiche_head($head, $hselected, $langs->trans("Contact").": ".$contact->firstname.' '.$contact->name);
|
||||||
|
|
||||||
|
|
||||||
if ($_GET["action"] == 'edit')
|
if ($_GET["action"] == 'edit')
|
||||||
{
|
{
|
||||||
// Fiche info perso en mode edition
|
/*
|
||||||
|
* Fiche en mode edition
|
||||||
|
*/
|
||||||
|
|
||||||
print '<table width="100%"><tr><td>';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
print '<form method="post" action="perso.php?id='.$_GET["id"].'">';
|
print '<form method="post" action="perso.php?id='.$_GET["id"].'">';
|
||||||
print '<input type="hidden" name="action" value="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
print '<input type="hidden" name="contactid" value="'.$contact->id.'">';
|
print '<input type="hidden" name="contactid" value="'.$contact->id.'">';
|
||||||
|
|
||||||
if ($contact->socid > 0)
|
if ($contact->socid > 0)
|
||||||
{
|
{
|
||||||
$objsoc = new Societe($db);
|
$objsoc = new Societe($db);
|
||||||
$objsoc->fetch($contact->socid);
|
$objsoc->fetch($contact->socid);
|
||||||
|
|
||||||
print $langs->trans("Company").' : '.$objsoc->nom_url.'<br>';
|
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="2">'.$objsoc->nom_url.'</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print $langs->trans("Name").' : '.$contact->name.' '.$contact->firstname ."<br>";
|
print '<tr><td>'.$langs->trans("Name").'</td><td colspan="2">'.$contact->name.' '.$contact->firstname .'</td>';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<tr><td>'.$langs->trans("Birthday").'</td><td>';
|
||||||
|
$html=new Form($db);
|
||||||
$html = new Form($db);
|
if ($contact->birthday && $contact->birthday > 0)
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("Birthday").'</td><td>';
|
|
||||||
if ($contact->birthday && $contact->birthday > 0) {
|
|
||||||
print $html->select_date($contact->birthday,'birthday',0,0,0);
|
|
||||||
} else {
|
|
||||||
print $html->select_date(0,'birthday',0,0,1);
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
print '<td>'.$langs->trans("Alert").': ';
|
|
||||||
if ($contact->birthday_alert)
|
|
||||||
{
|
{
|
||||||
print '<input type="checkbox" name="birthday_alert" checked></td>';
|
print $html->select_date($contact->birthday,'birthday',0,0,0);
|
||||||
|
} else {
|
||||||
|
print $html->select_date(0,'birthday',0,0,1);
|
||||||
}
|
}
|
||||||
else
|
print '</td>';
|
||||||
|
|
||||||
|
print '<td>'.$langs->trans("Alert").': ';
|
||||||
|
if ($contact->birthday_alert)
|
||||||
{
|
{
|
||||||
print '<input type="checkbox" name="birthday_alert"></td>';
|
print '<input type="checkbox" name="birthday_alert" checked></td>';
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<input type="checkbox" name="birthday_alert"></td>';
|
||||||
|
}
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
print "</tr></table>";
|
print '<tr><td colspan="3" align="center"><input type="submit" value="'.$langs->trans("Save").'"></td></tr>';
|
||||||
|
print "</table><br>";
|
||||||
|
|
||||||
print "</td></tr>";
|
print "</form>";
|
||||||
print "</table>";
|
|
||||||
|
|
||||||
print '<div class="FicheSubmit"><input type="submit" value="'.$langs->trans("Save").'">';
|
|
||||||
|
|
||||||
print "</form>";
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Visualisation de la fiche
|
* Fiche en mode visu
|
||||||
*
|
*/
|
||||||
*/
|
print '<table class="border" width="100%">';
|
||||||
print '<table width="100%"><tr><td>';
|
|
||||||
|
|
||||||
if ($contact->socid > 0)
|
|
||||||
{
|
|
||||||
$objsoc = new Societe($db);
|
|
||||||
$objsoc->fetch($contact->socid);
|
|
||||||
|
|
||||||
print $langs->trans("Company").' : '.$objsoc->nom_url.'<br>';
|
if ($contact->socid > 0)
|
||||||
|
{
|
||||||
|
$objsoc = new Societe($db);
|
||||||
|
$objsoc->fetch($contact->socid);
|
||||||
|
|
||||||
|
print '<tr><td>'.$langs->trans("Company").'</td><td>'.$objsoc->nom_url.'</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print $langs->trans("Name").' : '.$contact->name.' '.$contact->firstname ."<br>";
|
print '<tr><td>'.$langs->trans("Name").'</td><td>'.$contact->name.' '.$contact->firstname .'</td></tr>';
|
||||||
|
|
||||||
if ($contact->birthday && $contact->birthday > 0) {
|
if ($contact->birthday && $contact->birthday > 0) {
|
||||||
print $langs->trans("Birthdate").' : '.dolibarr_print_date($contact->birthday);
|
print '<tr><td>'.$langs->trans("Birthdate").'</td><td>'.dolibarr_print_date($contact->birthday);
|
||||||
|
|
||||||
if ($contact->birthday_alert)
|
if ($contact->birthday_alert)
|
||||||
print ' (alerte anniversaire active)<br>';
|
print ' (alerte anniversaire active)</td>';
|
||||||
else
|
else
|
||||||
print ' (alerte anniversaire inactive)<br>';
|
print ' (alerte anniversaire inactive)</td>';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print $langs->trans("Birthday").' : '.$langs->trans("Unknown")."<br>";
|
print '<tr><td>'.$langs->trans("Birthday").'</td><td>'.$langs->trans("Unknown")."</td>";
|
||||||
}
|
}
|
||||||
|
print "</tr>";
|
||||||
print "</td></tr>";
|
|
||||||
print "</table><br>";
|
|
||||||
|
|
||||||
print "</div>";
|
print "</table><br>";
|
||||||
|
|
||||||
// Barre d'actions
|
print "</div>";
|
||||||
if ($user->societe_id == 0)
|
|
||||||
|
// Barre d'actions
|
||||||
|
if ($user->societe_id == 0)
|
||||||
{
|
{
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
print '<a class="tabAction" href="perso.php?id='.$_GET["id"].'&action=edit">'.$langs->trans('Edit').'</a>';
|
|
||||||
|
|
||||||
print "</div>";
|
print '<a class="tabAction" href="perso.php?id='.$_GET["id"].'&action=edit">'.$langs->trans('Edit').'</a>';
|
||||||
|
|
||||||
|
print "</div>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
llxFooter('$Date$ - $Revision$');
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user