diff --git a/htdocs/adherents/adherent.class.php b/htdocs/adherents/adherent.class.php index 2546422a4b9779a84f82eb94266bc8d60c07c5c2..0dfe17ea9867a9af5aebecda7d9b78e487cc6424 100644 --- a/htdocs/adherents/adherent.class.php +++ b/htdocs/adherents/adherent.class.php @@ -18,8 +18,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ */ /** @@ -31,7 +29,7 @@ \author Laurent Destailleur \author Sebastien Di Cintio \author Benoit Mortier - \version $Revision$ + \version $Id$ */ require_once(DOL_DOCUMENT_ROOT."/commonobject.class.php"); @@ -491,26 +489,26 @@ class Adherent extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET"; $sql.= " prenom = ".($this->prenom?"'".addslashes($this->prenom)."'":"null"); - $sql.= ",nom=" .($this->nom?"'".addslashes($this->nom)."'":"null"); - $sql.= ",login=" .($this->login?"'".addslashes($this->login)."'":"null"); - $sql.= ",societe=" .($this->societe?"'".addslashes($this->societe)."'":"null"); - $sql.= ",adresse=" .($this->adresse?"'".addslashes($this->adresse)."'":"null"); - $sql.= ",cp=" .($this->cp?"'".addslashes($this->cp)."'":"null"); - $sql.= ",ville=" .($this->ville?"'".addslashes($this->ville)."'":"null"); - $sql.= ",pays=" ."'".$this->pays_id."'"; - $sql.= ",email=" ."'".$this->email."'"; - $sql.= ",phone=" .($this->phone?"'".addslashes($this->phone)."'":"null"); - $sql.= ",phone_perso=" .($this->phone_perso?"'".addslashes($this->phone_perso)."'":"null"); - $sql.= ",phone_mobile=" .($this->phone_mobile?"'".addslashes($this->phone_mobile)."'":"null"); - $sql.= ",note=" .($this->commentaire?"'".addslashes($this->commentaire)."'":"null"); - $sql.= ",photo=" .($this->photo?"'".$this->photo."'":"null"); - $sql.= ",public=" ."'".$this->public."'"; - $sql.= ",statut=" .$this->statut; - $sql.= ",fk_adherent_type=".$this->typeid; - $sql.= ",morphy=" ."'".$this->morphy."'"; - $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->datevalid) $sql.= ",datevalid='".$this->db->idate($this->datevalid)."'"; // Ne doit etre modifie que par validation adherent + $sql.= ", nom=" .($this->nom?"'".addslashes($this->nom)."'":"null"); + $sql.= ", login=" .($this->login?"'".addslashes($this->login)."'":"null"); + $sql.= ", societe=" .($this->societe?"'".addslashes($this->societe)."'":"null"); + $sql.= ", adresse=" .($this->adresse?"'".addslashes($this->adresse)."'":"null"); + $sql.= ", cp=" .($this->cp?"'".addslashes($this->cp)."'":"null"); + $sql.= ", ville=" .($this->ville?"'".addslashes($this->ville)."'":"null"); + $sql.= ", pays=" ."'".$this->pays_id."'"; + $sql.= ", email=" ."'".$this->email."'"; + $sql.= ", phone=" .($this->phone?"'".addslashes($this->phone)."'":"null"); + $sql.= ", phone_perso=" .($this->phone_perso?"'".addslashes($this->phone_perso)."'":"null"); + $sql.= ", phone_mobile=" .($this->phone_mobile?"'".addslashes($this->phone_mobile)."'":"null"); + $sql.= ", note=" .($this->commentaire?"'".addslashes($this->commentaire)."'":"null"); + $sql.= ", photo=" .($this->photo?"'".$this->photo."'":"null"); + $sql.= ", public=" ."'".$this->public."'"; + $sql.= ", statut=" .$this->statut; + $sql.= ", fk_adherent_type=".$this->typeid; + $sql.= ", morphy=" ."'".$this->morphy."'"; + $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->datevalid) $sql.= ", datevalid='".$this->db->idate($this->datevalid)."'"; // Ne doit etre modifie que par validation adherent $sql.= " WHERE rowid = ".$this->id; dolibarr_syslog("Adherent::update sql=".$sql); diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 9f43417bfb7bd889f58ece81cc7eb79825c89559..232a82f1c85c7791888bc28491dfc9f85625611b 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -16,15 +16,13 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ */ /** \file htdocs/adherents/fiche.php \ingroup adherent \brief Page d'ajout, edition, suppression d'une fiche adherent - \version $Revision$ + \version $Id$ */ 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"]); - 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 - $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) + $datenaiss=''; + if (isset($_POST["naissday"]) && $_POST["naissday"] + && isset($_POST["naissmonth"]) && $_POST["naissmonth"] + && isset($_POST["naissyear"]) && $_POST["naissyear"]) { - if (ereg("^options_",$key)) - { - //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]); - } + $datenaiss=dolibarr_mktime(12, 0, 0, $_POST["naissmonth"], $_POST["naissday"], $_POST["naissyear"]); } + //print $_POST["naissmonth"].", ".$_POST["naissday"].", ".$_POST["naissyear"]." ".$datenaiss." ".adodb_strftime('%Y-%m-%d %H:%M:%S',$datenaiss); - $result=$adh->update($user,0); - if ($result >= 0 && ! sizeof($adh->errors)) + // Charge objet actuel + 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 (! is_dir($conf->adherent->dir_output)) + if (ereg("^options_",$key)) { - 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 (! doliMoveFileUpload($_FILES['photo']['tmp_name'],$newfile)) + // If photo is provided + 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); - exit; - } - else - { - if ($adh->error) - { - $errmsg=$adh->error; + Header("Location: fiche.php?rowid=".$adh->id); + exit; } else { - foreach($adh->errors as $error) + if ($adh->error) + { + $errmsg=$adh->error; + } + else { - if ($errmsg) $errmsg.='<br>'; - $errmsg.=$error; + foreach($adh->errors as $error) + { + if ($errmsg) $errmsg.='<br>'; + $errmsg.=$error; + } } + $action=''; } - $action=''; } } } @@ -539,6 +543,7 @@ if ($action == 'edit') $adho->fetch_optionals(); $adht = new AdherentType($db); + $adht->fetch($adh->typeid); /* @@ -598,7 +603,15 @@ if ($action == 'edit') // Type 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>"; // Physique-Moral @@ -965,56 +978,77 @@ if ($rowid && $action != 'edit') */ 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>"; } + else + { + print "<font class=\"butActionRefused\" href=\"#\">".$langs->trans("Modify")."</font>"; + } - if ($user->rights->adherent->creer) + // Valider + if ($adh->statut == -1) { - // Valider - 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) + { + 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>"; + } } - if ($user->rights->adherent->creer) + // Reactiver + if ($adh->statut == 0) { - // 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"; } + 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 ($adh->statut >= 1 && $adh->email) + if ($user->rights->adherent->creer) { 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 ($adh->statut >= 1) - { + if ($user->rights->adherent->supprimer) + { 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 - 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.'&action=create_user">'.$langs->trans("CreateDolibarrLogin").'</a>'; - } + print '<a class="butAction" href="fiche.php?rowid='.$adh->id.'&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"; } + else + { + print "<font class=\"butActionRefused\" href=\"#\">".$langs->trans("Delete")."</font>"; + } // Action SPIP if ($conf->global->ADHERENT_USE_SPIP) diff --git a/htdocs/includes/modules/modAdherent.class.php b/htdocs/includes/modules/modAdherent.class.php index 36a69836818fcf43b770eb1e3c652ac27fdb8bc5..bfb97fb52ef9b378937eb49c2e2142f731bca990 100644 --- a/htdocs/includes/modules/modAdherent.class.php +++ b/htdocs/includes/modules/modAdherent.class.php @@ -18,8 +18,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ */ /** @@ -31,6 +29,7 @@ \file htdocs/includes/modules/modAdherent.class.php \ingroup adherent \brief Fichier de description et activation du module adherents + \version $Id$ */ include_once(DOL_DOCUMENT_ROOT ."/includes/modules/DolibarrModules.class.php"); @@ -130,11 +129,19 @@ class modAdherent extends DolibarrModules $r++; $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][3] = 0; $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++; $this->rights[$r][0] = 74; $this->rights[$r][1] = 'Supprimer les adherents'; diff --git a/htdocs/includes/modules/modUser.class.php b/htdocs/includes/modules/modUser.class.php index 1b65f33f7f69f98fab409eff211a7ef7e495080c..b68ee1c94d5dea04ed5533cb97f97b29528c73ee 100644 --- a/htdocs/includes/modules/modUser.class.php +++ b/htdocs/includes/modules/modUser.class.php @@ -94,7 +94,7 @@ class modUser extends DolibarrModules $r++; $this->rights[$r][0] = 252; - $this->rights[$r][1] = 'Cr�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][3] = 0; $this->rights[$r][4] = 'user'; @@ -110,7 +110,7 @@ class modUser extends DolibarrModules $r++; $this->rights[$r][0] = 254; - $this->rights[$r][1] = 'Supprimer ou d�sactiver les autres utilisateurs'; + $this->rights[$r][1] = 'Supprimer ou desactiver les autres utilisateurs'; $this->rights[$r][2] = 'd'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'user'; @@ -118,7 +118,7 @@ class modUser extends DolibarrModules $r++; $this->rights[$r][0] = 255; - $this->rights[$r][1] = 'Cr�er/modifier ses propres infos utilisateur'; + $this->rights[$r][1] = 'Creer/modifier ses propres infos utilisateur'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 1; $this->rights[$r][4] = 'self'; diff --git a/htdocs/lib/databases/mssql.lib.php b/htdocs/lib/databases/mssql.lib.php index c502f8fb556ae628791e63c7cc92f5d940485e6c..472ebdc6ff339cbd5dd106a2544fa52c385ad63c 100644 --- a/htdocs/lib/databases/mssql.lib.php +++ b/htdocs/lib/databases/mssql.lib.php @@ -1,6 +1,6 @@ <?php /* 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) 2007 Simon Desee <simon@dedisoft.com> * @@ -17,21 +17,24 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ */ /** - \file htdocs/lib/databases/mssql.lib.php - \brief Fichier de la classe permettant de g�rer une base mssql + \file htdocs/lib/databases/mssql.lib.php + \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 - \brief Classe de gestion de la database de dolibarr + \class DoliDb + \brief Classe de gestion de la database de dolibarr */ - class DoliDb { //! Handler de base @@ -514,7 +517,7 @@ class DoliDb function idate($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); } diff --git a/htdocs/lib/databases/mysql.lib.php b/htdocs/lib/databases/mysql.lib.php index c54d17090a801ad01a925f73b9e1056fe7a29759..7b1f7a9df5ca9dfd1aee488a3dcb793035e74f80 100644 --- a/htdocs/lib/databases/mysql.lib.php +++ b/htdocs/lib/databases/mysql.lib.php @@ -1,7 +1,7 @@ <?php /* Copyright (C) 2001 Fabien Seisen <seisen@linuxfr.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) 2005-2007 Regis Houssin <regis@dolibarr.fr> * @@ -18,21 +18,25 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ */ /** - \file htdocs/lib/databases/mysql.lib.php - \brief Fichier de la classe permettant de g�rer une base mysql + \file htdocs/lib/databases/mysql.lib.php + \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 - \brief Classe de gestion de la database de dolibarr + \class DoliDb + \brief Classe de gestion de la database de dolibarr */ - class DoliDb { //! Handler de base @@ -534,7 +538,7 @@ class DoliDb */ function idate($param) { - return strftime("%Y%m%d%H%M%S",$param); + return adodb_strftime("%Y%m%d%H%M%S",$param); } diff --git a/htdocs/lib/databases/mysqli.lib.php b/htdocs/lib/databases/mysqli.lib.php index f4828400c2698b12ddb0e13d1f1873808e94e9b8..3f5b631f9a4d2fa12f5d08869f3fa7a26af7034c 100644 --- a/htdocs/lib/databases/mysqli.lib.php +++ b/htdocs/lib/databases/mysqli.lib.php @@ -1,7 +1,7 @@ <?php /* Copyright (C) 2001 Fabien Seisen <seisen@linuxfr.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) 2005-2007 Regis Houssin <regis@dolibarr.fr> * @@ -18,21 +18,25 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ */ /** \file htdocs/lib/databases/mysqli.lib.php \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 \brief Classe permettant de g�r�r la database de dolibarr */ - class DoliDb { //! Handler de base @@ -549,7 +553,7 @@ class DoliDb */ function idate($param) { - return strftime("%Y%m%d%H%M%S",$param); + return adodb_strftime("%Y%m%d%H%M%S",$param); } diff --git a/htdocs/lib/databases/pgsql.lib.php b/htdocs/lib/databases/pgsql.lib.php index 4711bb52663720eabaf38fa84a4e77eedaa45f16..3460b8513c7f19a8d62d8d1da06528600a8b40f4 100644 --- a/htdocs/lib/databases/pgsql.lib.php +++ b/htdocs/lib/databases/pgsql.lib.php @@ -1,7 +1,7 @@ <?php /* Copyright (C) 2001 Fabien Seisen <seisen@linuxfr.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 Benoit Mortier <benoit.mortier@opensides.be> * @@ -18,21 +18,25 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ */ /** \file htdocs/lib/databases/pgsql.lib.php \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 \brief Classe permettant de g�r�r la database de dolibarr */ - class DoliDb { var $db; // Handler de base @@ -475,7 +479,7 @@ class DoliDb */ function idate($param) { - return strftime("%Y%m%d%H%M%S",$param); + return adodb_strftime("%Y%m%d%H%M%S",$param); } diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php index 994004f362edd0cb8f1e489fef194cb5da562a93..378718c5b5e9b45c60a657dfe87d375117eee350 100644 --- a/htdocs/lib/functions.inc.php +++ b/htdocs/lib/functions.inc.php @@ -560,12 +560,12 @@ function dolibarr_print_date($time,$format='') $smin = $reg[5]; $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 { // Date est un timestamps - return strftime($format,$time); + return adodb_strftime($format,$time); } } diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 4aa4cad90c617443b99b89b9089532dab23267da..cd73693ddd09563e4a3c5b00d6ae7f2e072c7f2a 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -202,6 +202,7 @@ print '<tr><td width="25%" valign="top">'.$langs->trans("Firstname").'</td>'; print '<td colspan="2">'.$fuser->prenom.'</td>'; print "</tr>\n"; +print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules")); print '</table><br>';