Fix: Enregistrement en base date < 1940

New: Ajout permission "modifier ses propres infos adhérents"
This commit is contained in:
Laurent Destailleur 2008-01-25 17:40:07 +00:00
parent 6ef1ab52b2
commit dc3128e489
10 changed files with 217 additions and 158 deletions

View File

@ -18,8 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/ */
/** /**
@ -31,7 +29,7 @@
\author Laurent Destailleur \author Laurent Destailleur
\author Sebastien Di Cintio \author Sebastien Di Cintio
\author Benoit Mortier \author Benoit Mortier
\version $Revision$ \version $Id$
*/ */
require_once(DOL_DOCUMENT_ROOT."/commonobject.class.php"); require_once(DOL_DOCUMENT_ROOT."/commonobject.class.php");
@ -491,26 +489,26 @@ class Adherent extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET"; $sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
$sql.= " prenom = ".($this->prenom?"'".addslashes($this->prenom)."'":"null"); $sql.= " prenom = ".($this->prenom?"'".addslashes($this->prenom)."'":"null");
$sql.= ",nom=" .($this->nom?"'".addslashes($this->nom)."'":"null"); $sql.= ", nom=" .($this->nom?"'".addslashes($this->nom)."'":"null");
$sql.= ",login=" .($this->login?"'".addslashes($this->login)."'":"null"); $sql.= ", login=" .($this->login?"'".addslashes($this->login)."'":"null");
$sql.= ",societe=" .($this->societe?"'".addslashes($this->societe)."'":"null"); $sql.= ", societe=" .($this->societe?"'".addslashes($this->societe)."'":"null");
$sql.= ",adresse=" .($this->adresse?"'".addslashes($this->adresse)."'":"null"); $sql.= ", adresse=" .($this->adresse?"'".addslashes($this->adresse)."'":"null");
$sql.= ",cp=" .($this->cp?"'".addslashes($this->cp)."'":"null"); $sql.= ", cp=" .($this->cp?"'".addslashes($this->cp)."'":"null");
$sql.= ",ville=" .($this->ville?"'".addslashes($this->ville)."'":"null"); $sql.= ", ville=" .($this->ville?"'".addslashes($this->ville)."'":"null");
$sql.= ",pays=" ."'".$this->pays_id."'"; $sql.= ", pays=" ."'".$this->pays_id."'";
$sql.= ",email=" ."'".$this->email."'"; $sql.= ", email=" ."'".$this->email."'";
$sql.= ",phone=" .($this->phone?"'".addslashes($this->phone)."'":"null"); $sql.= ", phone=" .($this->phone?"'".addslashes($this->phone)."'":"null");
$sql.= ",phone_perso=" .($this->phone_perso?"'".addslashes($this->phone_perso)."'":"null"); $sql.= ", phone_perso=" .($this->phone_perso?"'".addslashes($this->phone_perso)."'":"null");
$sql.= ",phone_mobile=" .($this->phone_mobile?"'".addslashes($this->phone_mobile)."'":"null"); $sql.= ", phone_mobile=" .($this->phone_mobile?"'".addslashes($this->phone_mobile)."'":"null");
$sql.= ",note=" .($this->commentaire?"'".addslashes($this->commentaire)."'":"null"); $sql.= ", note=" .($this->commentaire?"'".addslashes($this->commentaire)."'":"null");
$sql.= ",photo=" .($this->photo?"'".$this->photo."'":"null"); $sql.= ", photo=" .($this->photo?"'".$this->photo."'":"null");
$sql.= ",public=" ."'".$this->public."'"; $sql.= ", public=" ."'".$this->public."'";
$sql.= ",statut=" .$this->statut; $sql.= ", statut=" .$this->statut;
$sql.= ",fk_adherent_type=".$this->typeid; $sql.= ", fk_adherent_type=".$this->typeid;
$sql.= ",morphy=" ."'".$this->morphy."'"; $sql.= ", morphy=" ."'".$this->morphy."'";
$sql.= ",naiss=" .($this->naiss?"'".$this->db->idate($this->naiss)."'":"null"); $sql.= ", naiss=" .($this->naiss?"'".$this->db->idate($this->naiss)."'":"null");
if ($this->datefin) $sql.= ",datefin='".$this->db->idate($this->datefin)."'"; // Ne doit etre modifie que par effacement cotisation if ($this->datefin) $sql.= ", datefin='".$this->db->idate($this->datefin)."'"; // Ne doit etre modifie que par effacement cotisation
if ($this->datevalid) $sql.= ",datevalid='".$this->db->idate($this->datevalid)."'"; // Ne doit etre modifie que par validation adherent if ($this->datevalid) $sql.= ", datevalid='".$this->db->idate($this->datevalid)."'"; // Ne doit etre modifie que par validation adherent
$sql.= " WHERE rowid = ".$this->id; $sql.= " WHERE rowid = ".$this->id;
dolibarr_syslog("Adherent::update sql=".$sql); dolibarr_syslog("Adherent::update sql=".$sql);

View File

@ -16,15 +16,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/ */
/** /**
\file htdocs/adherents/fiche.php \file htdocs/adherents/fiche.php
\ingroup adherent \ingroup adherent
\brief Page d'ajout, edition, suppression d'une fiche adherent \brief Page d'ajout, edition, suppression d'une fiche adherent
\version $Revision$ \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -109,97 +107,103 @@ if ($_POST["action"] == 'confirm_sendinfo' && $_POST["confirm"] == 'yes')
} }
} }
if ($user->rights->adherent->creer && $_REQUEST["action"] == 'update' && ! $_POST["cancel"]) if ($_REQUEST["action"] == 'update' && ! $_POST["cancel"])
{ {
$datenaiss='';
if (isset($_POST["naissday"]) && $_POST["naissday"]
&& isset($_POST["naissmonth"]) && $_POST["naissmonth"]
&& isset($_POST["naissyear"]) && $_POST["naissyear"])
{
$datenaiss=dolibarr_mktime(12, 0, 0, $_POST["naissmonth"], $_POST["naissday"], $_POST["naissyear"]);
}
// Charge objet actuel
$result=$adh->fetch($_POST["rowid"]); $result=$adh->fetch($_POST["rowid"]);
if ($result > 0)
// If change (allowed on all members) or (allowed on myself and i am edited memeber)
if ($user->rights->adherent->creer || ($user->rights->adherent->self->creer && $adh->user_id == $user->id))
{ {
// Modifie valeures $datenaiss='';
$adh->prenom = $_POST["prenom"]; if (isset($_POST["naissday"]) && $_POST["naissday"]
$adh->nom = $_POST["nom"]; && isset($_POST["naissmonth"]) && $_POST["naissmonth"]
$adh->fullname = trim($adh->prenom.' '.$adh->nom); && isset($_POST["naissyear"]) && $_POST["naissyear"])
$adh->login = $_POST["login"];
$adh->pass = $_POST["pass"];
$adh->societe = $_POST["societe"];
$adh->adresse = $_POST["adresse"];
$adh->cp = $_POST["cp"];
$adh->ville = $_POST["ville"];
$adh->pays_id = $_POST["pays"];
$adh->phone = $_POST["phone"];
$adh->phone_perso = $_POST["phone_perso"];
$adh->phone_mobile= $_POST["phone_mobile"];
$adh->email = $_POST["email"];
$adh->naiss = $datenaiss;
$adh->typeid = $_POST["type"];
$adh->commentaire = $_POST["comment"];
$adh->morphy = $_POST["morphy"];
$adh->amount = $_POST["amount"];
// recuperation du statut et public
$adh->statut = $_POST["statut"];
$adh->public = $_POST["public"];
foreach($_POST as $key => $value)
{ {
if (ereg("^options_",$key)) $datenaiss=dolibarr_mktime(12, 0, 0, $_POST["naissmonth"], $_POST["naissday"], $_POST["naissyear"]);
{
//escape values from POST, at least with addslashes, to avoid obvious SQL injections
//(array_options is directly input in the DB in adherent.class.php::update())
$adh->array_options[$key]=addslashes($_POST[$key]);
}
} }
//print $_POST["naissmonth"].", ".$_POST["naissday"].", ".$_POST["naissyear"]." ".$datenaiss." ".adodb_strftime('%Y-%m-%d %H:%M:%S',$datenaiss);
$result=$adh->update($user,0); // Charge objet actuel
if ($result >= 0 && ! sizeof($adh->errors)) if ($result > 0)
{ {
if (isset($_FILES['photo']['tmp_name']) && trim($_FILES['photo']['tmp_name'])) // Modifie valeures
$adh->prenom = $_POST["prenom"];
$adh->nom = $_POST["nom"];
$adh->fullname = trim($adh->prenom.' '.$adh->nom);
$adh->login = $_POST["login"];
$adh->pass = $_POST["pass"];
$adh->societe = $_POST["societe"];
$adh->adresse = $_POST["adresse"];
$adh->cp = $_POST["cp"];
$adh->ville = $_POST["ville"];
$adh->pays_id = $_POST["pays"];
$adh->phone = $_POST["phone"];
$adh->phone_perso = $_POST["phone_perso"];
$adh->phone_mobile= $_POST["phone_mobile"];
$adh->email = $_POST["email"];
$adh->naiss = $datenaiss;
$adh->typeid = $_POST["type"];
$adh->commentaire = $_POST["comment"];
$adh->morphy = $_POST["morphy"];
$adh->amount = $_POST["amount"];
// recuperation du statut et public
$adh->statut = $_POST["statut"];
$adh->public = $_POST["public"];
foreach($_POST as $key => $value)
{ {
// If photo is provided if (ereg("^options_",$key))
if (! is_dir($conf->adherent->dir_output))
{ {
create_exdir($conf->adherent->dir_output); //escape values from POST, at least with addslashes, to avoid obvious SQL injections
//(array_options is directly input in the DB in adherent.class.php::update())
$adh->array_options[$key]=addslashes($_POST[$key]);
} }
if (is_dir($conf->adherent->dir_output)) }
$result=$adh->update($user,0);
if ($result >= 0 && ! sizeof($adh->errors))
{
if (isset($_FILES['photo']['tmp_name']) && trim($_FILES['photo']['tmp_name']))
{ {
$newfile=$conf->adherent->dir_output . "/" . $adh->id . ".jpg"; // If photo is provided
if (! doliMoveFileUpload($_FILES['photo']['tmp_name'],$newfile)) if (! is_dir($conf->adherent->dir_output))
{ {
$message .= '<div class="error">'.$langs->trans("ErrorFailedToSaveFile").'</div>'; create_exdir($conf->adherent->dir_output);
}
if (is_dir($conf->adherent->dir_output))
{
$newfile=$conf->adherent->dir_output . "/" . $adh->id . ".jpg";
if (! doliMoveFileUpload($_FILES['photo']['tmp_name'],$newfile))
{
$message .= '<div class="error">'.$langs->trans("ErrorFailedToSaveFile").'</div>';
}
} }
} }
}
Header("Location: fiche.php?rowid=".$adh->id); Header("Location: fiche.php?rowid=".$adh->id);
exit; exit;
}
else
{
if ($adh->error)
{
$errmsg=$adh->error;
} }
else else
{ {
foreach($adh->errors as $error) if ($adh->error)
{ {
if ($errmsg) $errmsg.='<br>'; $errmsg=$adh->error;
$errmsg.=$error;
} }
else
{
foreach($adh->errors as $error)
{
if ($errmsg) $errmsg.='<br>';
$errmsg.=$error;
}
}
$action='';
} }
$action='';
} }
} }
} }
@ -539,6 +543,7 @@ if ($action == 'edit')
$adho->fetch_optionals(); $adho->fetch_optionals();
$adht = new AdherentType($db); $adht = new AdherentType($db);
$adht->fetch($adh->typeid);
/* /*
@ -598,7 +603,15 @@ if ($action == 'edit')
// Type // Type
print '<tr><td>'.$langs->trans("Type").'*</td><td>'; print '<tr><td>'.$langs->trans("Type").'*</td><td>';
$htmls->select_array("type", $adht->liste_array(), $adh->typeid); if ($user->rights->adherent->creer) // If $user->rights->adherent->self->creer, we do not allow.
{
$htmls->select_array("type", $adht->liste_array(), $adh->typeid);
}
else
{
print $adht->getNomUrl(1);
print '<input type="hidden" name="type" value="'.$adh->typeid.'">';
}
print "</td></tr>"; print "</td></tr>";
// Physique-Moral // Physique-Moral
@ -965,56 +978,77 @@ if ($rowid && $action != 'edit')
*/ */
print '<div class="tabsAction">'; print '<div class="tabsAction">';
if ($user->rights->adherent->creer) if ($user->rights->adherent->creer || ($user->rights->adherent->self->creer && $adh->user_id == $user->id))
{ {
print "<a class=\"butAction\" href=\"fiche.php?rowid=$rowid&action=edit\">".$langs->trans("Modify")."</a>"; print "<a class=\"butAction\" href=\"fiche.php?rowid=$rowid&action=edit\">".$langs->trans("Modify")."</a>";
} }
else
if ($user->rights->adherent->creer)
{ {
// Valider print "<font class=\"butActionRefused\" href=\"#\">".$langs->trans("Modify")."</font>";
if ($adh->statut == -1)
{
print "<a class=\"butAction\" href=\"fiche.php?rowid=$rowid&action=valid\">".$langs->trans("Validate")."</a>\n";
}
} }
if ($user->rights->adherent->creer) // Valider
if ($adh->statut == -1)
{ {
// Reactiver if ($user->rights->adherent->creer)
if ($adh->statut == 0) {
{ print "<a class=\"butAction\" href=\"fiche.php?rowid=$rowid&action=valid\">".$langs->trans("Validate")."</a>\n";
}
else
{
print "<font class=\"butActionRefused\" href=\"#\">".$langs->trans("Validate")."</font>";
}
}
// Reactiver
if ($adh->statut == 0)
{
if ($user->rights->adherent->creer)
{
print "<a class=\"butAction\" href=\"fiche.php?rowid=$rowid&action=valid\">".$langs->trans("Reenable")."</a>\n"; print "<a class=\"butAction\" href=\"fiche.php?rowid=$rowid&action=valid\">".$langs->trans("Reenable")."</a>\n";
} }
else
{
print "<font class=\"butActionRefused\" href=\"#\">".$langs->trans("Reenable")."</font>";
}
} }
if ($user->rights->adherent->creer) // Envoi fiche par mail
if ($adh->statut >= 1 && $adh->email)
{ {
// Envoi fiche par mail if ($user->rights->adherent->creer)
if ($adh->statut >= 1 && $adh->email)
{ {
print "<a class=\"butAction\" href=\"fiche.php?rowid=$adh->id&action=sendinfo\">".$langs->trans("SendCardByMail")."</a>\n"; print "<a class=\"butAction\" href=\"fiche.php?rowid=$adh->id&action=sendinfo\">".$langs->trans("SendCardByMail")."</a>\n";
} }
else
{
print "<font class=\"butActionRefused\" href=\"#\">".$langs->trans("SendCardByMail")."</font>";
}
} }
if ($user->rights->adherent->supprimer) // Resilier
if ($adh->statut >= 1)
{ {
// Resilier if ($user->rights->adherent->supprimer)
if ($adh->statut >= 1) {
{
print "<a class=\"butAction\" href=\"fiche.php?rowid=$rowid&action=resign\">".$langs->trans("Resiliate")."</a>\n"; print "<a class=\"butAction\" href=\"fiche.php?rowid=$rowid&action=resign\">".$langs->trans("Resiliate")."</a>\n";
} }
else
{
print "<font class=\"butActionRefused\" href=\"#\">".$langs->trans("Resiliate")."</font>";
}
} }
// Barre d'actions // Barre d'actions
if ($user->rights->user->user->creer) if (! $user->societe_id && ! $adh->user_id)
{ {
if (! $user->societe_id) if ($user->rights->user->user->creer)
{ {
if (! $adh->user_id) print '<a class="butAction" href="fiche.php?rowid='.$adh->id.'&amp;action=create_user">'.$langs->trans("CreateDolibarrLogin").'</a>';
{ }
print '<a class="butAction" href="fiche.php?rowid='.$adh->id.'&amp;action=create_user">'.$langs->trans("CreateDolibarrLogin").'</a>'; else
} {
print "<font class=\"butActionRefused\" href=\"#\">".$langs->trans("CreateDolibarrLogin")."</font>";
} }
} }
@ -1023,6 +1057,10 @@ if ($rowid && $action != 'edit')
{ {
print "<a class=\"butActionDelete\" href=\"fiche.php?rowid=$adh->id&action=delete\">".$langs->trans("Delete")."</a>\n"; print "<a class=\"butActionDelete\" href=\"fiche.php?rowid=$adh->id&action=delete\">".$langs->trans("Delete")."</a>\n";
} }
else
{
print "<font class=\"butActionRefused\" href=\"#\">".$langs->trans("Delete")."</font>";
}
// Action SPIP // Action SPIP
if ($conf->global->ADHERENT_USE_SPIP) if ($conf->global->ADHERENT_USE_SPIP)

View File

@ -18,8 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/ */
/** /**
@ -31,6 +29,7 @@
\file htdocs/includes/modules/modAdherent.class.php \file htdocs/includes/modules/modAdherent.class.php
\ingroup adherent \ingroup adherent
\brief Fichier de description et activation du module adherents \brief Fichier de description et activation du module adherents
\version $Id$
*/ */
include_once(DOL_DOCUMENT_ROOT ."/includes/modules/DolibarrModules.class.php"); include_once(DOL_DOCUMENT_ROOT ."/includes/modules/DolibarrModules.class.php");
@ -130,11 +129,19 @@ class modAdherent extends DolibarrModules
$r++; $r++;
$this->rights[$r][0] = 72; $this->rights[$r][0] = 72;
$this->rights[$r][1] = 'Creer/modifier les adherents'; $this->rights[$r][1] = 'Creer/modifier tous les adherents';
$this->rights[$r][2] = 'w'; $this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'creer'; $this->rights[$r][4] = 'creer';
$r++;
$this->rights[$r][0] = 73;
$this->rights[$r][1] = 'Creer/modifier ses propres infos adherents';
$this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'self';
$this->rights[$r][5] = 'creer';
$r++; $r++;
$this->rights[$r][0] = 74; $this->rights[$r][0] = 74;
$this->rights[$r][1] = 'Supprimer les adherents'; $this->rights[$r][1] = 'Supprimer les adherents';

View File

@ -94,7 +94,7 @@ class modUser extends DolibarrModules
$r++; $r++;
$this->rights[$r][0] = 252; $this->rights[$r][0] = 252;
$this->rights[$r][1] = 'Cr<EFBFBD>er/modifier les autres utilisateurs, les groupes et leurs permissions'; $this->rights[$r][1] = 'Creer/modifier les autres utilisateurs, les groupes et leurs permissions';
$this->rights[$r][2] = 'w'; $this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'user'; $this->rights[$r][4] = 'user';
@ -110,7 +110,7 @@ class modUser extends DolibarrModules
$r++; $r++;
$this->rights[$r][0] = 254; $this->rights[$r][0] = 254;
$this->rights[$r][1] = 'Supprimer ou d<EFBFBD>sactiver les autres utilisateurs'; $this->rights[$r][1] = 'Supprimer ou desactiver les autres utilisateurs';
$this->rights[$r][2] = 'd'; $this->rights[$r][2] = 'd';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'user'; $this->rights[$r][4] = 'user';
@ -118,7 +118,7 @@ class modUser extends DolibarrModules
$r++; $r++;
$this->rights[$r][0] = 255; $this->rights[$r][0] = 255;
$this->rights[$r][1] = 'Cr<EFBFBD>er/modifier ses propres infos utilisateur'; $this->rights[$r][1] = 'Creer/modifier ses propres infos utilisateur';
$this->rights[$r][2] = 'w'; $this->rights[$r][2] = 'w';
$this->rights[$r][3] = 1; $this->rights[$r][3] = 1;
$this->rights[$r][4] = 'self'; $this->rights[$r][4] = 'self';

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2007 Simon Desee <simon@dedisoft.com> * Copyright (C) 2007 Simon Desee <simon@dedisoft.com>
* *
@ -17,21 +17,24 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/ */
/** /**
\file htdocs/lib/databases/mssql.lib.php \file htdocs/lib/databases/mssql.lib.php
\brief Fichier de la classe permettant de gérer une base mssql \brief Fichier de la classe permettant de gérer une base mssql
\version $Id$
*/ */
// Pour compatibilité lors de l'upgrade
if (! defined('DOL_DOCUMENT_ROOT'))
{
define('DOL_DOCUMENT_ROOT', '../..');
}
/** /**
\class DoliDb \class DoliDb
\brief Classe de gestion de la database de dolibarr \brief Classe de gestion de la database de dolibarr
*/ */
class DoliDb class DoliDb
{ {
//! Handler de base //! Handler de base
@ -514,7 +517,7 @@ class DoliDb
function idate($param) function idate($param)
{ {
//return "dbo.from_unixtime(".$param.")"; //return "dbo.from_unixtime(".$param.")";
return strftime("%d/%m/%Y %H:%M:%S",$param); return adodb_strftime("%d/%m/%Y %H:%M:%S",$param);
} }

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2001 Fabien Seisen <seisen@linuxfr.org> /* Copyright (C) 2001 Fabien Seisen <seisen@linuxfr.org>
* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
* *
@ -18,21 +18,25 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/ */
/** /**
\file htdocs/lib/databases/mysql.lib.php \file htdocs/lib/databases/mysql.lib.php
\brief Fichier de la classe permettant de gérer une base mysql \brief Fichier de la classe permettant de gérer une base mysql
\version $Id$
*/ */
// Pour compatibilité lors de l'upgrade
if (! defined('DOL_DOCUMENT_ROOT'))
{
define('DOL_DOCUMENT_ROOT', '../..');
}
include_once(DOL_DOCUMENT_ROOT."/includes/adodbtime/adodb-time.inc.php");
/** /**
\class DoliDb \class DoliDb
\brief Classe de gestion de la database de dolibarr \brief Classe de gestion de la database de dolibarr
*/ */
class DoliDb class DoliDb
{ {
//! Handler de base //! Handler de base
@ -534,7 +538,7 @@ class DoliDb
*/ */
function idate($param) function idate($param)
{ {
return strftime("%Y%m%d%H%M%S",$param); return adodb_strftime("%Y%m%d%H%M%S",$param);
} }

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2001 Fabien Seisen <seisen@linuxfr.org> /* Copyright (C) 2001 Fabien Seisen <seisen@linuxfr.org>
* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
* *
@ -18,21 +18,25 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/ */
/** /**
\file htdocs/lib/databases/mysqli.lib.php \file htdocs/lib/databases/mysqli.lib.php
\brief Fichier de la classe permettant de gérer une base mysql \brief Fichier de la classe permettant de gérer une base mysql
\version $Id$
*/ */
// Pour compatibilité lors de l'upgrade
if (! defined('DOL_DOCUMENT_ROOT'))
{
define('DOL_DOCUMENT_ROOT', '../..');
}
include_once(DOL_DOCUMENT_ROOT."/includes/adodbtime/adodb-time.inc.php");
/** /**
\class DoliDb \class DoliDb
\brief Classe permettant de gérér la database de dolibarr \brief Classe permettant de gérér la database de dolibarr
*/ */
class DoliDb class DoliDb
{ {
//! Handler de base //! Handler de base
@ -549,7 +553,7 @@ class DoliDb
*/ */
function idate($param) function idate($param)
{ {
return strftime("%Y%m%d%H%M%S",$param); return adodb_strftime("%Y%m%d%H%M%S",$param);
} }

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2001 Fabien Seisen <seisen@linuxfr.org> /* Copyright (C) 2001 Fabien Seisen <seisen@linuxfr.org>
* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* *
@ -18,21 +18,25 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/ */
/** /**
\file htdocs/lib/databases/pgsql.lib.php \file htdocs/lib/databases/pgsql.lib.php
\brief Fichier de la classe permettant de gérér une base pgsql \brief Fichier de la classe permettant de gérér une base pgsql
\version $Id$
*/ */
// Pour compatibilité lors de l'upgrade
if (! defined('DOL_DOCUMENT_ROOT'))
{
define('DOL_DOCUMENT_ROOT', '../..');
}
include_once(DOL_DOCUMENT_ROOT."/includes/adodbtime/adodb-time.inc.php");
/** /**
\class DoliDb \class DoliDb
\brief Classe permettant de gérér la database de dolibarr \brief Classe permettant de gérér la database de dolibarr
*/ */
class DoliDb class DoliDb
{ {
var $db; // Handler de base var $db; // Handler de base
@ -475,7 +479,7 @@ class DoliDb
*/ */
function idate($param) function idate($param)
{ {
return strftime("%Y%m%d%H%M%S",$param); return adodb_strftime("%Y%m%d%H%M%S",$param);
} }

View File

@ -560,12 +560,12 @@ function dolibarr_print_date($time,$format='')
$smin = $reg[5]; $smin = $reg[5];
$ssec = $reg[6]; $ssec = $reg[6];
return strftime($format,dolibarr_mktime($shour,$smin,$ssec,$smonth,$sday,$syear)); return adodb_strftime($format,dolibarr_mktime($shour,$smin,$ssec,$smonth,$sday,$syear));
} }
else else
{ {
// Date est un timestamps // Date est un timestamps
return strftime($format,$time); return adodb_strftime($format,$time);
} }
} }

View File

@ -202,6 +202,7 @@ print '<tr><td width="25%" valign="top">'.$langs->trans("Firstname").'</td>';
print '<td colspan="2">'.$fuser->prenom.'</td>'; print '<td colspan="2">'.$fuser->prenom.'</td>';
print "</tr>\n"; print "</tr>\n";
print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules"));
print '</table><br>'; print '</table><br>';