2
0
forked from Wavyzz/dolibarr

Qual: Uniformize code

This commit is contained in:
Juanjo Menent
2011-09-02 16:51:19 +00:00
parent 8eec591dd6
commit 808f8607c5
16 changed files with 684 additions and 772 deletions

View File

@@ -261,7 +261,7 @@ if ($action == 'create')
if ($res)
{
while ($menu = $db->fetch_array($res))
while ($menu = $db->fetch_array ($res))
{
$parent_rowid = $menu['rowid'];
$parent_mainmenu = $menu['mainmenu'];

View File

@@ -300,7 +300,7 @@ if ($conf->use_javascript_ajax)
$num = $db->num_rows($res);
$i = 1;
while ($menu = $db->fetch_array($res))
while ($menu = $db->fetch_array ($res))
{
if (! empty($menu['langs'])) $langs->load($menu['langs']);
$titre = $langs->trans($menu['titre']);

View File

@@ -32,7 +32,7 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
session_cache_limiter(FALSE);
session_cache_limiter( FALSE );
require_once("../../master.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/functions.lib.php");

View File

@@ -1,7 +1,6 @@
<?php
/* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
*
* 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
@@ -43,27 +42,16 @@ $action=GETPOST('action');
* Actions
*/
if ($action == 'updateMask')
if ($_POST["action"] == 'updateMask')
{
$maskconstproject=GETPOST("maskconstproject");
$maskproject=GETPOST("maskproject");
if ($maskconstproject) $res = dolibarr_set_const($db,$maskconstproject,$maskproject,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
if (! $error)
{
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
}
else
{
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
}
$maskconstproject=$_POST['maskconstproject'];
$maskproject=$_POST['maskproject'];
if ($maskconstproject) dolibarr_set_const($db,$maskconstproject,$maskproject,'chaine',0,'',$conf->entity);
}
if ($action == 'specimen')
if ($_GET["action"] == 'specimen')
{
$modele=GETPOST("module");
$modele=$_GET["module"];
$project = new Project($db);
$project->initAsSpecimen();
@@ -96,16 +84,13 @@ if ($action == 'specimen')
}
}
if ($action == 'set')
if ($_GET["action"] == 'set')
{
$label = GETPOST("label");
$scandir = GETPOST("scandir");
$type='project';
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
$sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", ";
$sql.= ($label?"'".$db->escape($label)."'":'null').", ";
$sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null");
$sql.= " VALUES ('".$db->escape($_GET["value"])."','".$type."',".$conf->entity.", ";
$sql.= ($_GET["label"]?"'".$db->escape($_GET["label"])."'":'null').", ";
$sql.= (! empty($_GET["scandir"])?"'".$db->escape($_GET["scandir"])."'":"null");
$sql.= ")";
if ($db->query($sql))
{
@@ -113,7 +98,7 @@ if ($action == 'set')
}
}
if ($action == 'del')
if ($_GET["action"] == 'del')
{
$type='project';
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
@@ -126,30 +111,27 @@ if ($action == 'del')
}
}
if ($action == 'setdoc')
if ($_GET["action"] == 'setdoc')
{
$label = GETPOST("label");
$scandir = GETPOST("scandir");
$db->begin();
if (dolibarr_set_const($db, "PROJECT_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
if (dolibarr_set_const($db, "PROJECT_ADDON_PDF",$_GET["value"],'chaine',0,'',$conf->entity))
{
$conf->global->PROJECT_ADDON_PDF = $value;
$conf->global->PROJECT_ADDON_PDF = $_GET["value"];
}
// On active le modele
$type='project';
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
$sql_del.= " WHERE nom = '".$db->escape($value)."'";
$sql_del.= " WHERE nom = '".$db->escape($_GET["value"])."'";
$sql_del.= " AND type = '".$type."'";
$sql_del.= " AND entity = ".$conf->entity;
$result1=$db->query($sql_del);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
$sql.= " VALUES ('".$db->escape($value)."', '".$type."', ".$conf->entity.", ";
$sql.= ($label?"'".$db->escape($label)."'":'null').", ";
$sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null");
$sql.= " VALUES ('".$db->escape($_GET["value"])."', '".$type."', ".$conf->entity.", ";
$sql.= ($_GET["label"]?"'".$db->escape($_GET["label"])."'":'null').", ";
$sql.= (! empty($_GET["scandir"])?"'".$db->escape($_GET["scandir"])."'":"null");
$sql.= ")";
$result2=$db->query($sql);
if ($result1 && $result2)
@@ -162,7 +144,7 @@ if ($action == 'setdoc')
}
}
if ($action == 'setmod')
if ($_GET["action"] == 'setmod')
{
// TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated
@@ -398,9 +380,5 @@ if (is_resource($handle))
print '</table><br/>';
dol_htmloutput_mesg($mesg);
$db->close();
llxFooter();
?>

View File

@@ -1804,7 +1804,7 @@ else
print_liste_field_titre($langs->trans('Price'),$_SERVER["PHP_SELF"],'p.total_ht','',$param, 'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Author'),$_SERVER["PHP_SELF"],'u.login','',$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Status'),$_SERVER["PHP_SELF"],'p.fk_statut','',$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre('');
print '<td class="liste_titre">&nbsp;</td>';
print "</tr>\n";
// Lignes des champs de filtre
print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">';

View File

@@ -73,16 +73,14 @@ class DoliDb
/**
* Constructor.
* This create an opened connexion to a database server and eventually to a database
*
* @param string $type Type of database (mysql, pgsql...)
* @param string $host Address of database server
* @param string $user Nom de l'utilisateur autorise
* @param string $pass Mot de passe
* @param string $name Nom de la database
* @param int $port Port of database server
* @return int 1 if OK, 0 if not
* Ouverture d'une connexion vers le serveur et eventuellement une database.
* @param type Type de base de donnees (mysql ou pgsql)
* @param host Addresse de la base de donnees
* @param user Nom de l'utilisateur autorise
* @param pass Mot de passe
* @param name Nom de la database
* @param port Port of database server
* @return int 1 en cas de succes, 0 sinon
*/
function DoliDb($type='mssql', $host, $user, $pass, $name='', $port=0)
{
@@ -155,10 +153,9 @@ class DoliDb
}
/**
* Convert a SQL request in Mysql syntax to native syntax
*
* @param string $line SQL request line to convert
* @param string $type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...)
* Convert a SQL request in Mysql syntax to PostgreSQL syntax
* @param line SQL request line to convert
* @param type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...)
* @return string SQL request line converted
*/
function convertSQLFromMysql($line,$type='ddl')
@@ -167,10 +164,9 @@ class DoliDb
}
/**
* Select a database
*
* @param string $database Name of database
* @return boolean true if OK, false if KO
* Selectionne une database.
* @param database Nom de la database
* @return boolean true si ok, false si ko
*/
function select_db($database)
{
@@ -178,14 +174,13 @@ class DoliDb
}
/**
* Connexion to server
*
* @param string $host database server host
* @param string $login login
* @param string $passwd password
* @param string $name name of database (not used for mysql, used for pgsql)
* @param string $port Port of database server
* @return resource Database access handler
* Connection vers le serveur
* @param host addresse de la base de donnees
* @param login nom de l'utilisateur autoris
* @param passwd mot de passe
* @param name nom de la database (ne sert pas sous mysql, sert sous pgsql)
* @param port Port of database server
* @return resource handler d'acces a la base
* @see close
*/
function connect($host, $login, $passwd, $name, $port=0)
@@ -203,9 +198,8 @@ class DoliDb
}
/**
* Return label of manager
*
* @return string Label
* \brief Return label of manager
* \return string Label
*/
function getLabel()
{
@@ -213,9 +207,8 @@ class DoliDb
}
/**
* Return version of database server
*
* @return string Version string
* \brief Renvoie la version du serveur
* \return string Chaine version
*/
function getVersion()
{
@@ -226,9 +219,8 @@ class DoliDb
/**
* Return version of database server into an array
*
* @return array Version array
* \brief Renvoie la version du serveur dans un tableau
* \return array Tableau de chaque niveau de version
*/
function getVersionArray()
{
@@ -238,7 +230,6 @@ class DoliDb
/**
* Close database connexion
*
* @return boolean True if disconnect successfull, false otherwise
* @see connect
*/
@@ -255,9 +246,8 @@ class DoliDb
/**
* Start transaction
*
* @return int 1 if transaction successfuly opened or already opened, 0 if error
* \brief Debut d'une transaction.
* \return int 1 si ouverture transaction ok ou deja ouverte, 0 en cas d'erreur
*/
function begin()
{
@@ -280,11 +270,10 @@ class DoliDb
/**
* Validate a database transaction
*
* @param $log Add more log to default log line
* @param log Add more log to default log line
* @return int 1 if validation is OK or transaction level no started, 0 if ERROR
*/
function commit($log='')
function commit()
{
if ($this->transaction_opened <= 1)
{
@@ -304,9 +293,8 @@ class DoliDb
}
/**
* Annulation d'une transaction et retour aux anciennes valeurs
*
* @return int 1 si annulation ok ou transaction non ouverte, 0 en cas d'erreur
* \brief Annulation d'une transaction et retour aux anciennes valeurs
* \return int 1 si annulation ok ou transaction non ouverte, 0 en cas d'erreur
*/
function rollback()
{
@@ -326,7 +314,6 @@ class DoliDb
/**
* Execute a SQL request and return the resultset
*
* @param query SQL query string
* @param usesavepoint 0=Default mode, 1=Run a savepoint before and a rollbock to savepoint if error (this allow to have some request with errors inside global transactions).
* Note that with Mysql, this parameter is not used as Myssql can already commit a transaction even if one request is in error, without using savepoints.
@@ -417,10 +404,9 @@ class DoliDb
}
/**
* Renvoie la ligne courante (comme un objet) pour le curseur resultset
*
* @param resultset Curseur de la requete voulue
* @return object Object result line or false if KO or end of cursor
* \brief Renvoie la ligne courante (comme un objet) pour le curseur resultset.
* \param resultset Curseur de la requete voulue
* \return object Object result line or false if KO or end of cursor
*/
function fetch_object($resultset)
{
@@ -430,10 +416,9 @@ class DoliDb
}
/**
* Renvoie les donnees dans un tableau
*
* @param resultset Curseur de la requete voulue
* @return array
* \brief Renvoie les donnees dans un tableau.
* \param resultset Curseur de la requete voulue
* \return array
*/
function fetch_array($resultset)
{

View File

@@ -72,16 +72,14 @@ class DoliDb
/**
* Constructor.
* This create an opened connexion to a database server and eventually to a database
*
* @param string $type Type of database (mysql, pgsql...)
* @param string $host Address of database server
* @param string $user Nom de l'utilisateur autorise
* @param string $pass Mot de passe
* @param string $name Nom de la database
* @param int $port Port of database server
* @return int 1 if OK, 0 if not
* Ouverture d'une connexion vers le serveur et eventuellement une database.
* @param type Type de base de donnees (mysql ou pgsql)
* @param host Addresse de la base de donnees
* @param user Nom de l'utilisateur autorise
* @param pass Mot de passe
* @param name Nom de la database
* @param port Port of database server
* @return int 1 en cas de succes, 0 sinon
*/
function DoliDb($type='mysql', $host, $user, $pass, $name='', $port=0)
{
@@ -182,10 +180,9 @@ class DoliDb
/**
* Convert a SQL request in Mysql syntax to native syntax
*
* @param string $line SQL request line to convert
* @param string $type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...)
* Convert a SQL request in Mysql syntax to PostgreSQL syntax
* @param line SQL request line to convert
* @param type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...)
* @return string SQL request line converted
*/
function convertSQLFromMysql($line,$type='ddl')
@@ -194,10 +191,9 @@ class DoliDb
}
/**
* Select a database
*
* @param string $database Name of database
* @return boolean true if OK, false if KO
* \brief Selectionne une database.
* \param database Nom de la database
* \return boolean true si ok, false si ko
*/
function select_db($database)
{
@@ -206,15 +202,14 @@ class DoliDb
}
/**
* Connexion to server
*
* @param string $host database server host
* @param string $login login
* @param string $passwd password
* @param string $name name of database (not used for mysql, used for pgsql)
* @param string $port Port of database server
* @return resource Database access handler
* @see close
* \brief Connexion to server
* \param host database server host
* \param login login
* \param passwd password
* \param name nom de la database (ne sert pas sous mysql, sert sous pgsql)
* \param port Port of database server
* \return resource Database access handler
* \seealso close
*/
function connect($host, $login, $passwd, $name, $port=0)
{
@@ -232,9 +227,8 @@ class DoliDb
}
/**
* Return label of manager
*
* @return string Label
* \brief Return label of manager
* \return string Label
*/
function getLabel()
{
@@ -242,9 +236,8 @@ class DoliDb
}
/**
* Return version of database server
*
* @return string Version string
* \brief Renvoie la version du serveur
* \return string Chaine version
*/
function getVersion()
{
@@ -252,9 +245,26 @@ class DoliDb
}
/**
* Return version of database server into an array
*
* @return array Version array
* \brief Renvoie la version du serveur sous forme de nombre
* \return string Chaine version
*/
function getIntVersion()
{
$version= $this->getVersion();
$vlist=preg_split('/[.-]/',$version);
if (dol_strlen($vlist[1])==1){
$vlist[1]="0".$vlist[1];
}
if (dol_strlen($vlist[2])==1){
$vlist[2]="0".$vlist[2];
}
return $vlist[0].$vlist[1].$vlist[2];
}
/**
* \brief Renvoie la version du serveur dans un tableau
* \return array Tableau de chaque niveau de version
*/
function getVersionArray()
{
@@ -264,7 +274,6 @@ class DoliDb
/**
* Close database connexion
*
* @return boolean True if disconnect successfull, false otherwise
* @see connect
*/
@@ -281,9 +290,8 @@ class DoliDb
/**
* Start transaction
*
* @return int 1 if transaction successfuly opened or already opened, 0 if error
* \brief Debut d'une transaction.
* \return int 1 si ouverture transaction ok ou deja ouverte, 0 en cas d'erreur
*/
function begin()
{
@@ -306,8 +314,7 @@ class DoliDb
/**
* Validate a database transaction
*
* @param $log Add more log to default log line
* @param log Add more log to default log line
* @return int 1 if validation is OK or transaction level no started, 0 if ERROR
*/
function commit($log='')
@@ -330,10 +337,9 @@ class DoliDb
}
/**
* Annulation d'une transaction et retour aux anciennes valeurs
*
* @param $log Add more log to default log line
* @return int 1 si annulation ok ou transaction non ouverte, 0 en cas d'erreur
* \brief Annulation d'une transaction et retour aux anciennes valeurs
* \param log Add more log to default log line
* \return int 1 si annulation ok ou transaction non ouverte, 0 en cas d'erreur
*/
function rollback($log='')
{
@@ -353,7 +359,6 @@ class DoliDb
/**
* Execute a SQL request and return the resultset
*
* @param query SQL query string
* @param usesavepoint 0=Default mode, 1=Run a savepoint before and a rollbock to savepoint if error (this allow to have some request with errors inside global transactions).
* Note that with Mysql, this parameter is not used as Myssql can already commit a transaction even if one request is in error, without using savepoints.
@@ -393,10 +398,9 @@ class DoliDb
}
/**
* Renvoie la ligne courante (comme un objet) pour le curseur resultset
*
* @param resultset Curseur de la requete voulue
* @return object Object result line or false if KO or end of cursor
* \brief Renvoie la ligne courante (comme un objet) pour le curseur resultset.
* \param resultset Curseur de la requete voulue
* \return object Object result line or false if KO or end of cursor
*/
function fetch_object($resultset)
{
@@ -406,10 +410,9 @@ class DoliDb
}
/**
* Renvoie les donnees dans un tableau
*
* @param resultset Curseur de la requete voulue
* @return array
* \brief Renvoie les donnees dans un tableau.
* \param resultset Curseur de la requete voulue
* \return array
*/
function fetch_array($resultset)
{
@@ -420,10 +423,9 @@ class DoliDb
/**
* Renvoie les donnees comme un tableau
*
* @param resultset Curseur de la requete voulue
* @return array
* \brief Renvoie les donnees comme un tableau.
* \param resultset Curseur de la requete voulue
* \return array
*/
function fetch_row($resultset)
{
@@ -433,11 +435,10 @@ class DoliDb
}
/**
* Renvoie le nombre de lignes dans le resultat d'une requete SELECT
*
* @see affected_rows
* @param resultset Curseur de la requete voulue
* @return int Nombre de lignes
* \brief Renvoie le nombre de lignes dans le resultat d'une requete SELECT
* \see affected_rows
* \param resultset Curseur de la requete voulue
* \return int Nombre de lignes
*/
function num_rows($resultset)
{
@@ -447,11 +448,10 @@ class DoliDb
}
/**
* Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE
*
* @see num_rows
* @param resultset Curseur de la requete voulue
* @return int Nombre de lignes
* \brief Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE
* \see num_rows
* \param resultset Curseur de la requete voulue
* \return int Nombre de lignes
*/
function affected_rows($resultset)
{
@@ -464,9 +464,8 @@ class DoliDb
/**
* Libere le dernier resultset utilise sur cette connexion.
*
* @param resultset Curseur de la requete voulue
* \brief Libere le dernier resultset utilise sur cette connexion.
* \param resultset Curseur de la requete voulue
*/
function free($resultset=0)
{
@@ -478,11 +477,10 @@ class DoliDb
/**
* Defini les limites de la requete
*
* @param limit nombre maximum de lignes retournees
* @param offset numero de la ligne a partir de laquelle recuperer les ligne
* @return string chaine exprimant la syntax sql de la limite
* \brief Defini les limites de la requete.
* \param limit nombre maximum de lignes retournees
* \param offset numero de la ligne a partir de laquelle recuperer les ligne
* \return string chaine exprimant la syntax sql de la limite
*/
function plimit($limit=0,$offset=0)
{
@@ -495,7 +493,6 @@ class DoliDb
/**
* Define sort criteria of request
*
* @param sortfield List of sort fields
* @param sortorder Sort order
* @return string String to provide syntax of a sort sql string
@@ -525,8 +522,7 @@ class DoliDb
/**
* Escape a string to insert data
*
* Escape a string to insert data.
* @param stringtoencode String to escape
* @return string String escaped
*/
@@ -539,7 +535,6 @@ class DoliDb
/**
* Convert (by PHP) a GM Timestamp date into a string date with PHP server TZ to insert into a date field.
* Function to use to build INSERT, UPDATE or WHERE predica
*
* @param param Date TMS to convert
* @return string Date in a string YYYYMMDDHHMMSS
*/
@@ -551,7 +546,6 @@ class DoliDb
/**
* Convert (by PHP) a PHP server TZ string date into a GM Timestamps date
* 19700101020000 -> 3600 with TZ+1
*
* @param string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS)
* @return date Date TMS
*/
@@ -565,7 +559,6 @@ class DoliDb
/**
* Formate a SQL IF
*
* @param test chaine test
* @param resok resultat si test egal
* @param resko resultat si test non egal

View File

@@ -73,16 +73,14 @@ class DoliDb
/**
* Constructor.
* This create an opened connexion to a database server and eventually to a database
*
* @param string $type Type of database (mysql, pgsql...)
* @param string $host Address of database server
* @param string $user Nom de l'utilisateur autorise
* @param string $pass Mot de passe
* @param string $name Nom de la database
* @param int $port Port of database server
* @return int 1 if OK, 0 if not
* Ouverture d'une connexion vers le serveur et eventuellement une database.
* @param type Type de base de donnees (mysql ou pgsql)
* @param host Addresse de la base de donnees
* @param user Nom de l'utilisateur autorise
* @param pass Mot de passe
* @param name Nom de la database
* @param port Port of database server
* @return int 1 en cas de succes, 0 sinon
*/
function DoliDb($type='mysqli', $host, $user, $pass, $name='', $port=0)
{
@@ -185,10 +183,9 @@ class DoliDb
/**
* Convert a SQL request in Mysql syntax to native syntax
*
* @param string $line SQL request line to convert
* @param string $type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...)
* Convert a SQL request in Mysql syntax to PostgreSQL syntax
* @param line SQL request line to convert
* @param type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...)
* @return string SQL request line converted
*/
function convertSQLFromMysql($line,$type='ddl')
@@ -197,10 +194,9 @@ class DoliDb
}
/**
* Select a database
*
* @param string $database Name of database
* @return boolean true if OK, false if KO
* \brief Selectionne une database.
* \param database Nom de la database
* \return boolean true si ok, false si ko
*/
function select_db($database)
{
@@ -210,15 +206,14 @@ class DoliDb
/**
* Connexion to server
*
* @param string $host database server host
* @param string $login login
* @param string $passwd password
* @param string $name name of database (not used for mysql, used for pgsql)
* @param string $port Port of database server
* @return resource Database access handler
* @see close
* \brief Connexion to server
* \param host database server host
* \param login login
* \param passwd password
* \param name nom de la database (ne sert pas sous mysql, sert sous pgsql)
* \param port Port of database server
* \return resource Database access handler
* \seealso close
*/
function connect($host, $login, $passwd, $name, $port=0)
{
@@ -237,9 +232,8 @@ class DoliDb
}
/**
* Return label of manager
*
* @return string Label
* \brief Return label of manager
* \return string Label
*/
function getLabel()
{
@@ -247,9 +241,8 @@ class DoliDb
}
/**
* Return version of database server
*
* @return string Version string
* \brief Renvoie la version du serveur
* \return string Chaine version
*/
function getVersion()
{
@@ -260,9 +253,25 @@ class DoliDb
}
/**
* Return version of database server into an array
*
* @return array Version array
* \brief Renvoie la version du serveur sous forme de nombre
* \return string Chaine version
*/
function getIntVersion()
{
$version= $this->getVersion();
$vlist=preg_split('/[.-]/',$version);
if (dol_strlen($vlist[1])==1){
$vlist[1]="0".$vlist[1];
}
if (dol_strlen($vlist[2])==1){
$vlist[2]="0".$vlist[2];
}
return $vlist[0].$vlist[1].$vlist[2];
}
/**
* \brief Renvoie la version du serveur dans un tableau
* \return array Tableau de chaque niveau de version
*/
function getVersionArray()
{
@@ -272,7 +281,6 @@ class DoliDb
/**
* Close database connexion
*
* @return boolean True if disconnect successfull, false otherwise
* @see connect
*/
@@ -289,9 +297,8 @@ class DoliDb
/**
* Start transaction
*
* @return int 1 if transaction successfuly opened or already opened, 0 if error
* \brief Debut d'une transaction.
* \return int 1 si ouverture transaction ok ou deja ouverte, 0 en cas d'erreur
*/
function begin()
{
@@ -314,8 +321,7 @@ class DoliDb
/**
* Validate a database transaction
*
* @param $log Add more log to default log line
* @param log Add more log to default log line
* @return int 1 if validation is OK or transaction level no started, 0 if ERROR
*/
function commit($log='')
@@ -338,10 +344,9 @@ class DoliDb
}
/**
* Annulation d'une transaction et retour aux anciennes valeurs
*
* @param $log Add more log to default log line
* @return int 1 si annulation ok ou transaction non ouverte, 0 en cas d'erreur
* \brief Annulation d'une transaction et retour aux anciennes valeurs
* \param log Add more log to default log line
* \return int 1 si annulation ok ou transaction non ouverte, 0 en cas d'erreur
*/
function rollback($log='')
{
@@ -361,7 +366,6 @@ class DoliDb
/**
* Execute a SQL request and return the resultset
*
* @param query SQL query string
* @param usesavepoint 0=Default mode, 1=Run a savepoint before and a rollbock to savepoint if error (this allow to have some request with errors inside global transactions).
* Note that with Mysql, this parameter is not used as Myssql can already commit a transaction even if one request is in error, without using savepoints.
@@ -399,10 +403,9 @@ class DoliDb
}
/**
* Renvoie la ligne courante (comme un objet) pour le curseur resultset
*
* @param resultset Curseur de la requete voulue
* @return object Object result line or false if KO or end of cursor
* \brief Renvoie la ligne courante (comme un objet) pour le curseur resultset.
* \param resultset Curseur de la requete voulue
* \return object Object result line or false if KO or end of cursor
*/
function fetch_object($resultset)
{
@@ -413,10 +416,9 @@ class DoliDb
/**
* Renvoie les donnees dans un tableau
*
* @param resultset Curseur de la requete voulue
* @return array
* \brief Renvoie les donnees dans un tableau.
* \param resultset Curseur de la requete voulue
* \return array
*/
function fetch_array($resultset)
{
@@ -426,10 +428,9 @@ class DoliDb
}
/**
* Renvoie les donnees comme un tableau
*
* @param resultset Curseur de la requete voulue
* @return array
* \brief Renvoie les donnees comme un tableau.
* \param resultset Curseur de la requete voulue
* \return array
*/
function fetch_row($resultset)
{
@@ -447,11 +448,10 @@ class DoliDb
}
/**
* Renvoie le nombre de lignes dans le resultat d'une requete SELECT
*
* @see affected_rows
* @param resultset Curseur de la requete voulue
* @return int Nombre de lignes
* \brief Renvoie le nombre de lignes dans le resultat d'une requete SELECT
* \see affected_rows
* \param resultset Curseur de la requete voulue
* \return int Nombre de lignes
*/
function num_rows($resultset)
{
@@ -461,10 +461,10 @@ class DoliDb
}
/**
* Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE
* @see num_rows
* @param resultset Curseur de la requete voulue
* @return int Nombre de lignes
* \brief Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE
* \see num_rows
* \param resultset Curseur de la requete voulue
* \return int Nombre de lignes
*/
function affected_rows($resultset)
@@ -478,9 +478,8 @@ class DoliDb
/**
* Libere le dernier resultset utilise sur cette connexion
*
* @param resultset Curseur de la requete voulue
* \brief Libere le dernier resultset utilise sur cette connexion.
* \param resultset Curseur de la requete voulue
*/
function free($resultset=0)
{
@@ -492,11 +491,10 @@ class DoliDb
/**
* Defini les limites de la requete
*
* @param limit nombre maximum de lignes retournees
* @param offset numero de la ligne a partir de laquelle recuperer les ligne
* @return string chaine exprimant la syntax sql de la limite
* \brief Defini les limites de la requete.
* \param limit nombre maximum de lignes retournees
* \param offset numero de la ligne a partir de laquelle recuperer les ligne
* \return string chaine exprimant la syntax sql de la limite
*/
function plimit($limit=0,$offset=0)
{
@@ -509,7 +507,6 @@ class DoliDb
/**
* Define sort criteria of request
*
* @param sortfield List of sort fields
* @param sortorder Sort order
* @return string String to provide syntax of a sort sql string
@@ -539,8 +536,7 @@ class DoliDb
/**
* Escape a string to insert data
*
* Escape a string to insert data.
* @param stringtoencode String to escape
* @return string String escaped
*/
@@ -552,7 +548,6 @@ class DoliDb
/**
* Convert (by PHP) a GM Timestamp date into a PHP server TZ to insert into a date field.
* Function to use to build INSERT, UPDATE or WHERE predica
*
* @param param Date TMS to convert
* @return string Date in a string YYYYMMDDHHMMSS
*/
@@ -564,7 +559,6 @@ class DoliDb
/**
* Convert (by PHP) a PHP server TZ string date into a GM Timestamps date
* 19700101020000 -> 3600 with TZ+1
*
* @param string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS)
* @return date Date TMS
*/
@@ -578,7 +572,6 @@ class DoliDb
/**
* Formate a SQL IF
*
* @param test chaine test
* @param resok resultat si test egal
* @param resko resultat si test non egal

View File

@@ -62,16 +62,14 @@ class DoliDb
/**
* Constructor.
* This create an opened connexion to a database server and eventually to a database
*
* @param string $type Type of database (mysql, pgsql...)
* @param string $host Address of database server
* @param string $user Nom de l'utilisateur autorise
* @param string $pass Mot de passe
* @param string $name Nom de la database
* @param int $port Port of database server
* @return int 1 if OK, 0 if not
* \brief Ouverture d'une connexion vers le serveur et une database.
* \param type type de base de donnees (mysql ou pgsql)
* \param host addresse de la base de donnees
* \param user nom de l'utilisateur autorise
* \param pass mot de passe
* \param name nom de la database
* \param port Port of database server
* \return int 1 en cas de succes, 0 sinon
*/
function DoliDb($type='pgsql', $host, $user, $pass, $name='', $port=0)
{
@@ -149,10 +147,9 @@ class DoliDb
/**
* Convert a SQL request in Mysql syntax to native syntax
*
* @param string $line SQL request line to convert
* @param string $type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...)
* Convert a SQL request in Mysql syntax to PostgreSQL syntax
* @param line SQL request line to convert
* @param type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...)
* @return string SQL request line converted
*/
function convertSQLFromMysql($line,$type='auto')
@@ -324,12 +321,11 @@ class DoliDb
}
/**
* Select a database
* Select a database.
* Ici postgresql n'a aucune fonction equivalente de mysql_select_db
* On compare juste manuellement si la database choisie est bien celle activee par la connexion
*
* @param string $database Name of database
* @return boolean true if OK, false if KO
* @param database nom de la database
* @return boolean true si ok, false si ko
*/
function select_db($database)
{
@@ -338,15 +334,13 @@ class DoliDb
}
/**
* Connexion to server
*
* @param string $host database server host
* @param string $login login
* @param string $passwd password
* @param string $name name of database (not used for mysql, used for pgsql)
* @param string $port Port of database server
* @return resource Database access handler
* @see close
* Connection vers le serveur
* @param host addresse de la base de donnees
* @param login nom de l'utilisateur autorise
* @param passwd mot de passe
* @param name nom de la database (ne sert pas sous mysql, sert sous pgsql)
* @param port Port of database server
* @return resource handler d'acces a la base
*/
function connect($host, $login, $passwd, $name, $port=0)
{
@@ -370,9 +364,8 @@ class DoliDb
}
/**
* Return label of manager
*
* @return string Label
* \brief Return label of manager
* \return string Label
*/
function getLabel()
{
@@ -380,9 +373,8 @@ class DoliDb
}
/**
* Return version of database server
*
* @return string Version string
* \brief Return version of server
* \return string String with version
*/
function getVersion()
{
@@ -396,9 +388,25 @@ class DoliDb
}
/**
* Return version of database server into an array
*
* @return array Version array
* \brief Renvoie la version du serveur sous forme de nombre
* \return string Chaine version
*/
function getIntVersion()
{
$version = $this->getVersion();
$vlist = preg_split('/[.-]/',$version);
if (dol_strlen($vlist[1])==1){
$vlist[1]="0".$vlist[1];
}
if (dol_strlen($vlist[2])==1){
$vlist[2]="0".$vlist[2];
}
return $vlist[0].$vlist[1].$vlist[2];
}
/**
* \brief Renvoie la version du serveur dans un tableau
* \return array Tableau de chaque niveau de version
*/
function getVersionArray()
{
@@ -407,7 +415,6 @@ class DoliDb
/**
* Close database connexion
*
* @return boolean True if disconnect successfull, false otherwise
* @see connect
*/
@@ -423,9 +430,8 @@ class DoliDb
}
/**
* Start transaction
*
* @return int 1 if transaction successfuly opened or already opened, 0 if error
* \brief Debut d'une transaction.
* \return int 1 si ouverture transaction ok ou deja ouverte, 0 en cas d'erreur
*/
function begin()
{
@@ -448,7 +454,6 @@ class DoliDb
/**
* Validate a database transaction
*
* @param log Add more log to default log line
* @return int 1 if validation is OK or transaction level no started, 0 if ERROR
*/
@@ -472,8 +477,8 @@ class DoliDb
}
/**
* Annulation d'une transaction et retour aux anciennes valeurs
* @return int 1 si annulation ok ou transaction non ouverte, 0 en cas d'erreur
* \brief Annulation d'une transaction et retour aux anciennes valeurs
* \return int 1 si annulation ok ou transaction non ouverte, 0 en cas d'erreur
*/
function rollback()
{
@@ -493,8 +498,7 @@ class DoliDb
/**
* Convert request to PostgreSQL syntax, execute it and return the resultset
*
* Convert request to PostgreSQL syntax, execute it and return the resultset.
* @param query SQL query string
* @param usesavepoint 0=Default mode, 1=Run a savepoint before and a rollback to savepoint if error (this allow to have some request with errors inside global transactions).
* @param type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...)
@@ -551,10 +555,9 @@ class DoliDb
}
/**
* Renvoie la ligne courante (comme un objet) pour le curseur resultset
*
* @param resultset Curseur de la requete voulue
* @return object Object result line or false if KO or end of cursor
* \brief Renvoie la ligne courante (comme un objet) pour le curseur resultset.
* \param resultset Curseur de la requete voulue
* \return object Object result line or false if KO or end of cursor
*/
function fetch_object($resultset)
{
@@ -564,10 +567,9 @@ class DoliDb
}
/**
* Renvoie les donnees dans un tableau
*
* @param resultset Curseur de la requete voulue
* @return array
* \brief Renvoie les donnees dans un tableau.
* \param resultset Curseur de la requete voulue
* \return array
*/
function fetch_array($resultset)
{
@@ -577,10 +579,9 @@ class DoliDb
}
/**
* Renvoie les donnees comme un tableau
*
* @param resultset Curseur de la requete voulue
* @return array
* \brief Renvoie les donnees comme un tableau.
* \param resultset Curseur de la requete voulue
* \return array
*/
function fetch_row($resultset)
{
@@ -590,11 +591,10 @@ class DoliDb
}
/**
* Renvoie le nombre de lignes dans le resultat d'une requete SELECT
*
* @see affected_rows
* @param resultset Curseur de la requete voulue
* @return int Nombre de lignes
* \brief Renvoie le nombre de lignes dans le resultat d'une requete SELECT
* \see affected_rows
* \param resultset Curseur de la requete voulue
* \return int Nombre de lignes
*/
function num_rows($resultset)
{
@@ -604,11 +604,10 @@ class DoliDb
}
/**
* Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE
*
* @see num_rows
* @param resultset Curseur de la requete voulue
* @return int Nombre de lignes
* \brief Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE
* \see num_rows
* \param resultset Curseur de la requete voulue
* \return int Nombre de lignes
*/
function affected_rows($resultset)
{
@@ -621,9 +620,8 @@ class DoliDb
/**
* Libere le dernier resultset utilise sur cette connexion
*
* @param resultset Curseur de la requete voulue
* \brief Libere le dernier resultset utilise sur cette connexion.
* \param resultset Curseur de la requete voulue
*/
function free($resultset=0)
{
@@ -635,11 +633,10 @@ class DoliDb
/**
* Defini les limites de la requete
*
* @param limit nombre maximum de lignes retournees
* @param offset numero de la ligne a partir de laquelle recuperer les lignes
* @return string chaine exprimant la syntax sql de la limite
* \brief Defini les limites de la requete.
* \param limit nombre maximum de lignes retournees
* \param offset numero de la ligne a partir de laquelle recuperer les lignes
* \return string chaine exprimant la syntax sql de la limite
*/
function plimit($limit=0,$offset=0)
{
@@ -652,7 +649,6 @@ class DoliDb
/**
* Define sort criteria of request
*
* @param sortfield List of sort fields
* @param sortorder Sort order
* @return string String to provide syntax of a sort sql string
@@ -682,8 +678,7 @@ class DoliDb
/**
* Escape a string to insert data
*
* Escape a string to insert data.
* @param stringtoencode String to escape
* @return string String escaped
*/
@@ -695,7 +690,6 @@ class DoliDb
/**
* Convert (by PHP) a GM Timestamp date into a GM string date to insert into a date field.
* Function to use to build INSERT, UPDATE or WHERE predica
*
* @param param Date TMS to convert
* @return string Date in a string YYYYMMDDHHMMSS
*/
@@ -707,7 +701,6 @@ class DoliDb
/**
* Convert (by PHP) a PHP server TZ string date into a GM Timestamps date
* 19700101020000 -> 3600 with TZ+1
*
* @param string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS)
* @return date Date TMS
*/
@@ -721,7 +714,6 @@ class DoliDb
/**
* Formate a SQL IF
*
* @param test chaine test
* @param resok resultat si test egal
* @param resko resultat si test non egal
@@ -734,9 +726,8 @@ class DoliDb
/**
* Renvoie la derniere requete soumise par la methode query()
*
* @return lastquery
* \brief Renvoie la derniere requete soumise par la methode query()
* \return lastquery
*/
function lastquery()
{
@@ -744,9 +735,8 @@ class DoliDb
}
/**
* Renvoie la derniere requete en erreur
*
* @return string lastqueryerror
* \brief Renvoie la derniere requete en erreur
* \return string lastqueryerror
*/
function lastqueryerror()
{
@@ -754,9 +744,8 @@ class DoliDb
}
/**
* Renvoie le libelle derniere erreur
*
* @return string lasterror
* \brief Renvoie le libelle derniere erreur
* \return string lasterror
*/
function lasterror()
{
@@ -764,9 +753,8 @@ class DoliDb
}
/**
* Renvoie le code derniere erreur
*
* @return string lasterrno
* \brief Renvoie le code derniere erreur
* \return string lasterrno
*/
function lasterrno()
{
@@ -774,9 +762,8 @@ class DoliDb
}
/**
* Renvoie le code erreur generique de l'operation precedente.
*
* @return error_num (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...)
* \brief Renvoie le code erreur generique de l'operation precedente.
* \return error_num (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...)
*/
function errno()
{
@@ -840,9 +827,8 @@ class DoliDb
}
/**
* Renvoie le texte de l'erreur pgsql de l'operation precedente
*
* @return error_text
* \brief Renvoie le texte de l'erreur pgsql de l'operation precedente.
* \return error_text
*/
function error()
{
@@ -850,10 +836,9 @@ class DoliDb
}
/**
* Get last ID after an insert INSERT
*
* @param tab Table name concerned by insert. Ne sert pas sous MySql mais requis pour compatibilite avec Postgresql
* @return int id
* \brief Get last ID after an insert INSERT.
* \param tab Table name concerned by insert. Ne sert pas sous MySql mais requis pour compatibilite avec Postgresql
* \return int id
*/
function last_insert_id($tab,$fieldid='rowid')
{
@@ -872,7 +857,6 @@ class DoliDb
/**
* Encrypt sensitive data in database
* Warning: This function includes the escape, so it must use direct value
*
* @param fieldorvalue Field name or value to encrypt
* @param withQuotes Return string with quotes
* @return return XXX(field) or XXX('value') or field or 'value'
@@ -893,10 +877,9 @@ class DoliDb
/**
* Decrypt sensitive data in database
*
* @param value Value to decrypt
* @return return Decrypted value if used
* \brief Decrypt sensitive data in database
* \param value Value to decrypt
* \return return Decrypted value if used
*/
function decrypt($value)
{
@@ -918,9 +901,8 @@ class DoliDb
/**
* Renvoie l'id de la connexion
*
* @return string Id connexion
* \brief Renvoie l'id de la connexion
* \return string Id connexion
*/
function DDLGetConnectId()
{
@@ -930,14 +912,13 @@ class DoliDb
/**
* Create a new database
* Ne pas utiliser les fonctions xxx_create_db (xxx=mysql, ...) car elles sont deprecated
*
* @param database Database name to create
* @param charset Charset used to store data
* @param collation Charset used to sort data
* @param owner Username of database owner
* @return resource resource defined if OK, null if KO
* \brief Create a new database
* \param database Database name to create
* \param charset Charset used to store data
* \param collation Charset used to sort data
* \param owner Username of database owner
* \return resource resource defined if OK, null if KO
* \remarks Ne pas utiliser les fonctions xxx_create_db (xxx=mysql, ...) car elles sont deprecated
*/
function DDLCreateDb($database,$charset='',$collation='',$owner='')
{
@@ -949,9 +930,9 @@ class DoliDb
}
/**
* Liste des tables dans une database.
* @param database Nom de la database
* @return resource
* \brief Liste des tables dans une database.
* \param database Nom de la database
* \return resource
*/
function DDLListTables($database, $table='')
{
@@ -968,9 +949,9 @@ class DoliDb
}
/**
* Liste les informations des champs d'une table.
* @param table Nom de la table
* @return array Tableau des informations des champs de la table
* \brief Liste les informations des champs d'une table.
* \param table Nom de la table
* \return array Tableau des informations des champs de la table
* TODO modifier pour postgresql
*/
function DDLInfoTable($table)
@@ -992,16 +973,15 @@ class DoliDb
/**
* Cree une table
*
* @param table Nom de la table
* @param fields Tableau associatif [nom champ][tableau des descriptions]
* @param primary_key Nom du champ qui sera la clef primaire
* @param unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
* @param fulltext Tableau des Nom de champs qui seront indexes en fulltext
* @param key Tableau des champs cles noms => valeur
* @param type Type de la table
* @return int <0 si KO, >=0 si OK
* \brief Cree une table
* \param table Nom de la table
* \param fields Tableau associatif [nom champ][tableau des descriptions]
* \param primary_key Nom du champ qui sera la clef primaire
* \param unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
* \param fulltext Tableau des Nom de champs qui seront indexes en fulltext
* \param key Tableau des champs cles noms => valeur
* \param type Type de la table
* \return int <0 si KO, >=0 si OK
* TODO
*/
function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys="",$fulltext_keys="",$keys="")
@@ -1070,13 +1050,12 @@ class DoliDb
}
/**
* Create a user
*
* @param dolibarr_main_db_host Ip serveur
* @param dolibarr_main_db_user Nom user a creer
* @param dolibarr_main_db_pass Mot de passe user a creer
* @param dolibarr_main_db_name Database name where user must be granted
* @return int <0 si KO, >=0 si OK
* \brief Create a user
* \param dolibarr_main_db_host Ip serveur
* \param dolibarr_main_db_user Nom user a creer
* \param dolibarr_main_db_pass Mot de passe user a creer
* \param dolibarr_main_db_name Database name where user must be granted
* \return int <0 si KO, >=0 si OK
*/
function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name)
{
@@ -1093,11 +1072,10 @@ class DoliDb
}
/**
* Decrit une table dans une database
*
* @param table Nom de la table
* @param field Optionnel : Nom du champ si l'on veut la desc d'un champ
* @return resource
* \brief decrit une table dans une database.
* \param table Nom de la table
* \param field Optionnel : Nom du champ si l'on veut la desc d'un champ
* \return resource
*/
function DDLDescTable($table,$field="")
{
@@ -1111,13 +1089,12 @@ class DoliDb
}
/**
* Insert a new field in table
*
* @param table Nom de la table
* @param field_name Nom du champ a inserer
* @param field_desc Tableau associatif de description du champ a inserer[nom du parametre][valeur du parametre]
* @param field_position Optionnel ex.: "after champtruc"
* @return int <0 si KO, >0 si OK
* \brief Insert a new field in table
* \param table Nom de la table
* \param field_name Nom du champ a inserer
* \param field_desc Tableau associatif de description du champ a inserer[nom du parametre][valeur du parametre]
* \param field_position Optionnel ex.: "after champtruc"
* \return int <0 si KO, >0 si OK
*/
function DDLAddField($table,$field_name,$field_desc,$field_position="")
{
@@ -1149,7 +1126,6 @@ class DoliDb
/**
* Update format of a field into a table
*
* @param table Name of table
* @param field_name Name of field to modify
* @param field_desc Array with description of field format
@@ -1169,11 +1145,10 @@ class DoliDb
}
/**
* Drop a field in table
*
* @param table Nom de la table
* @param field_name Nom du champ a inserer
* @return int <0 si KO, >0 si OK
* \brief Drop a field in table
* \param table Nom de la table
* \param field_name Nom du champ a inserer
* \return int <0 si KO, >0 si OK
*/
function DDLDropField($table,$field_name)
{
@@ -1188,9 +1163,8 @@ class DoliDb
}
/**
* Return charset used to store data in database
*
* @return string Charset
* \brief Return charset used to store data in database
* \return string Charset
*/
function getDefaultCharacterSetDatabase()
{
@@ -1200,9 +1174,8 @@ class DoliDb
}
/**
* Return list of available charset that can be used to store data in database
*
* @return array List of Charset
* \brief Return list of available charset that can be used to store data in database
* \return array List of Charset
*/
function getListOfCharacterSet()
{
@@ -1225,9 +1198,8 @@ class DoliDb
}
/**
* Return collation used in database
*
* @return string Collation value
* \brief Return collation used in database
* \return string Collation value
*/
function getDefaultCollationDatabase()
{
@@ -1237,9 +1209,8 @@ class DoliDb
}
/**
* Return list of available collation that can be used for database
*
* @return array Liste of Collation
* \brief Return list of available collation that can be used for database
* \return array Liste of Collation
*/
function getListOfCollation()
{
@@ -1262,7 +1233,6 @@ class DoliDb
/**
* Return full path of dump program
*
* @return string Full path of dump program
*/
function getPathOfDump()
@@ -1290,7 +1260,6 @@ class DoliDb
/**
* Return full path of restore program
*
* @return string Full path of restore program
*/
function getPathOfRestore()
@@ -1317,10 +1286,9 @@ class DoliDb
}
/**
* Return value of server parameters
*
* @param filter Filter list on a particular value
* @return string Value for parameter
* \brief Return value of server parameters
* \param filter Filter list on a particular value
* \return string Value for parameter
*/
function getServerParametersValues($filter='')
{

View File

@@ -58,9 +58,9 @@ function dol_shutdown()
/**
* Return value of a param into GET or POST supervariable
*
* @param string $paramname Name of parameter to found
* @param string $check Type of check (''=no check, 'int'=check it's numeric, 'alpha'=check it's alpha only)
* @param int $method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get)
* @param paramname Name of parameter to found
* @param check Type of check (''=no check, 'int'=check it's numeric, 'alpha'=check it's alpha only)
* @param method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get)
* @return string Value found or '' if check fails
*/
function GETPOST($paramname,$check='',$method=0)
@@ -102,7 +102,7 @@ function dol_getprefix()
* To link to a module file from a module file, use include('./mymodulefile');
* To link to a module file from a core file, then this function can be used
*
* @param string $relpath Relative path to file (Ie: mydir/myfile, ../myfile, ...)
* @param relpath Relative path to file (Ie: mydir/myfile, ../myfile, ...)
* @return int false if include fails.
*/
function dol_include_once($relpath)
@@ -115,8 +115,8 @@ function dol_include_once($relpath)
/**
* Return path of url or filesystem. Return default_root or alternate root if file_exist fails
*
* @param string $path Relative path to file (if mode=0, ie: mydir/myfile, ../myfile, ...) or relative url (if mode=1).
* @param int $type 0=Used for a Filesystem path, 1=Used for an URL path (output relative), 2=Used for an URL path (output full path)
* @param path Relative path to file (if mode=0, ie: mydir/myfile, ../myfile, ...) or relative url (if mode=1).
* @param type 0=Used for a Filesystem path, 1=Used for an URL path (output relative), 2=Used for an URL path (output full path)
* @return string Full filsystem path (if mode=0), Full url path (if mode=1)
*/
function dol_buildpath($path,$type=0)
@@ -168,8 +168,8 @@ function dol_buildpath($path,$type=0)
* Create a clone of instance of object (new instance with same properties)
* This function works for both PHP4 and PHP5
*
* @param object $object Object to clone
* @return object Object clone
* @param object Object to clone
* @return date Timestamp
*/
function dol_clone($object)
{
@@ -187,8 +187,8 @@ function dol_clone($object)
/**
* Optimize a size for some browsers (phone, smarphone, ...)
*
* @param int $size Size we want
* @param string $type Type of optimizing:
* @param size Size we want
* @param type Type of optimizing:
* '' = function used to define a size for truncation
* 'width' = function is used to define a width
* @return int New size after optimizing
@@ -318,7 +318,7 @@ function dol_string_nospecial($str,$newstr='_',$badchars='')
/**
* Returns text escaped for inclusion into javascript code
*
* @param string $stringtoescape String to escape
* @param $stringtoescape String to escape
* @return string Escaped string
*/
function dol_escape_js($stringtoescape)
@@ -332,8 +332,8 @@ function dol_escape_js($stringtoescape)
/**
* Returns text escaped for inclusion in HTML alt or title tags
*
* @param string $stringtoescape String to escape
* @param int $keepb Do not clean b tags
* @param $stringtoescape String to escape
* @param $keepb Do not clean b tags
* @return string Escaped string
*/
function dol_escape_htmltag($stringtoescape,$keepb=0)
@@ -358,8 +358,8 @@ function dol_escape_htmltag($stringtoescape,$keepb=0)
* On Windows LOG_ERR=4, LOG_WARNING=5, LOG_NOTICE=LOG_INFO=6, LOG_DEBUG=6 si define_syslog_variables ou PHP 5.3+, 7 si dolibarr
* On Linux LOG_ERR=3, LOG_WARNING=4, LOG_INFO=6, LOG_DEBUG=7
*
* @param string $message Line to log. Ne doit pas etre traduit si level = LOG_ERR
* @param int $level Log level
* @param string message Line to log. Ne doit pas etre traduit si level = LOG_ERR
* @param int level Log level
*/
function dol_syslog($message, $level=LOG_INFO)
{
@@ -469,7 +469,6 @@ function dol_syslog($message, $level=LOG_INFO)
/**
* Show tab header of a card
*
* @param links Array of tabs
* @param active Active tab name
* @param title Title
@@ -483,7 +482,6 @@ function dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto
/**
* Show tab header of a card
*
* @param links Array of tabs
* @param active Active tab name
* @param title Title
@@ -550,8 +548,7 @@ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $p
/**
* Show tab footer of a card
*
* @param int $notab 0=Add tab footer, 1=no tab footer
* @param notab 0=Add tab footer, 1=no tab footer
*/
function dol_fiche_end($notab=0)
{
@@ -560,8 +557,7 @@ function dol_fiche_end($notab=0)
/**
* Return tab footer of a card
*
* @param int $notab 0=Add tab footer, 1=no tab footer
* @param notab 0=Add tab footer, 1=no tab footer
*/
function dol_get_fiche_end($notab=0)
{
@@ -578,8 +574,7 @@ function dolibarr_print_date($time,$format='',$to_gmt=false,$outputlangs='',$enc
/**
* Output date in a string format according to outputlangs (or langs if not defined).
* Return charset is always UTF-8, except if encodetoouput is defined. In this cas charset is output charset
*
* Return charset is always UTF-8, except if encodetoouput is defined. In this cas charset is output charset.
* @param time GM Timestamps date (or deprecated strings 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS')
* @param format Output date format
* "%d %b %Y",
@@ -726,7 +721,6 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e
/**
* Convert a string date into a GM Timestamps date
*
* @param string Date in a string
* YYYYMMDD
* YYYYMMDDHHMMSS
@@ -777,8 +771,7 @@ function dol_stringtotime($string, $gm=1)
/**
* Return an array with date info
* PHP getdate is restricted to the years 1901-2038 on Unix and 1970-2038 on Windows
*
* PHP getdate is restricted to the years 1901-2038 on Unix and 1970-2038 on Windows.
* @param timestamp Timestamp
* @param fast Fast mode
* @return array Array of informations
@@ -832,7 +825,6 @@ function dolibarr_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$chec
* Return a timestamp date built from detailed informations (by default a local PHP server timestamp)
* Replace function mktime not available under Windows if year < 1970
* PHP mktime is restricted to the years 1901-2038 on Unix and 1970-2038 on Windows
*
* @param hour Hour (can be -1 for undefined)
* @param minute Minute (can be -1 for undefined)
* @param second Second (can be -1 for undefined)
@@ -898,7 +890,6 @@ function dolibarr_date($fmt, $timestamp, $gm=false)
/**
* Returns formated date
*
* @param fmt Format (Exemple: 'Y-m-d H:i:s')
* @param timestamp Date. Example: If timestamp=0 and gm=1, return 01/01/1970 00:00:00
* @param gm 1 if timestamp was built with gmmktime, 0 if timestamp was build with mktime
@@ -926,7 +917,6 @@ function dol_date($fmt, $timestamp, $gm=false)
/**
* Return string with formated size
*
* @param size Size to print
* @param shortvalue Tell if we want long value to use another unit (Ex: 1.5Kb instead of 1500b)
* @param shortunit Use short value of size unit
@@ -959,7 +949,6 @@ function dol_print_size($size,$shortvalue=0,$shortunit=0)
/**
* Show Url link
*
* @param url Url to show
* @param target Target for link
* @param max Max number of characters to show
@@ -981,7 +970,6 @@ function dol_print_url($url,$target='_blank',$max=32)
/**
* Show EMail link
*
* @param email EMail to show (only email, without 'Name of recipient' before)
* @param cid Id of contact if known
* @param socid Id of third party if known
@@ -1038,7 +1026,6 @@ function dolibarr_print_phone($phone,$country="FR",$cid=0,$socid=0,$addlink=0,$s
/**
* Format phone numbers according to country
*
* @param phone Phone number to format
* @param country Country to use for formatting
* @param cid Id of contact if known
@@ -1117,7 +1104,6 @@ function dol_print_phone($phone,$country="FR",$cid=0,$socid=0,$addlink=0,$separ=
/**
* Return an IP formated to be shown on screen
*
* @param ip IP
* @param mode 1=return only country/flag,2=return only IP
* @return string Formated IP, with country if GeoIP module is enabled
@@ -1157,7 +1143,6 @@ function dol_print_ip($ip,$mode=0)
/**
* Return country code for current user.
* If software is used inside a local network, detection may fails (we need a public ip)
*
* @return string country code (fr, es, it, us, ...)
*/
function dol_user_country()
@@ -1182,7 +1167,6 @@ function dol_user_country()
/**
* Format address string
*
* @param address Address
* @param htmlid Html ID
* @param mode thirdparty|contact|member|other
@@ -1228,9 +1212,8 @@ function dol_print_address($address, $htmlid='gmap', $mode, $id)
/**
* Return true if email syntax is ok
*
* @param string $address email (Ex: "toto@titi.com", "John Do <johndo@titi.com>")
* Return true if email syntax is ok.
* @param address email (Ex: "toto@titi.com", "John Do <johndo@titi.com>")
* @return boolean true if email syntax is OK, false if KO or empty string
*/
function isValidEmail($address)
@@ -1251,9 +1234,8 @@ function isValidEmail($address)
}
/**
* Return true if phone number syntax is ok
*
* @param string $address phone (Ex: "0601010101")
* Return true if phone number syntax is ok.
* @param address phone (Ex: "0601010101")
* @return boolean true if phone syntax is OK, false if KO or empty string
*/
function isValidPhone($address)
@@ -1263,11 +1245,10 @@ function isValidPhone($address)
/**
* Make a strlen call. Works even if mbstring module not enabled
*
* @param string $string String to calculate length
* @param string $stringencoding Encoding of string
* @return int Length of string
* Make a strlen call. Works even if mbstring module not enabled.
* @param $string
* @param $stringencoding
* @return int
*/
function dol_strlen($string,$stringencoding='UTF-8')
{
@@ -1279,7 +1260,6 @@ function dol_strlen($string,$stringencoding='UTF-8')
/**
* Make a substring. Works even in mbstring module not enabled
*
* @param $string
* @param $start
* @param $length
@@ -2572,36 +2552,43 @@ function print_liste_field_titre($name, $file="", $field="", $begin="", $morepar
/**
* Get title line of an array
*
* @param name Label of field
* @param thead For thead format
* @param file Url used when we click on sort picto
* @param field Field to use for new sorting
* @param begin ("" by defaut)
* @param moreparam Add more parameters on sort url links ("" by default)
* @param moreattrib Add more attributes on th ("" by defaut)
* @param td Options of attribute td ("" by defaut)
* @param sortfield Current field used to sort
* @param sortorder Current sort order
*/
function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="")
function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $td="", $sortfield="", $sortorder="")
{
global $conf;
//print "$name, $file, $field, $begin, $options, $moreattrib, $sortfield, $sortorder<br>\n";
//print "$name, $file, $field, $begin, $options, $td, $sortfield, $sortorder<br>\n";
$out='';
// If field is used as sort criteria we use a specific class
// Example if (sortfield,field)=("nom","xxx.nom") or (sortfield,field)=("nom","nom")
if ($field && ($sortfield == $field || $sortfield == preg_replace("/^[^\.]+\./","",$field)))
if ($thead)
{
$out.= '<th class="liste_titre_sel" '. $moreattrib.'>';
$out.= '<th>'.$name.'</th>';
}
else
{
$out.= '<th class="liste_titre" '. $moreattrib.'>';
// Le champ de tri est mis en evidence.
// Exemple si (sortfield,field)=("nom","xxx.nom") ou (sortfield,field)=("nom","nom")
if ($field && ($sortfield == $field || $sortfield == preg_replace("/^[^\.]+\./","",$field)))
{
$out.= '<td class="liste_titre_sel" '. $td.'>';
}
$out.=$name;
else
{
$out.= '<td class="liste_titre" '. $td.'>';
}
$out.= $name;
if (empty($thead) && $field) // If this is a sort field
// If this is a sort field
if ($field)
{
$options=preg_replace('/sortfield=([a-zA-Z0-9,\s\.]+)/i','',$moreparam);
$options=preg_replace('/sortorder=([a-zA-Z0-9,\s\.]+)/i','',$options);
@@ -2635,7 +2622,8 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m
}
}
}
$out.='</th>';
$out.= "</td>";
}
return $out;
}
@@ -2664,7 +2652,6 @@ function print_fiche_titre($titre, $mesg='', $picto='title.png', $pictoisfullpat
/**
* Load a title with picto
*
* @param titre Title to show
* @param mesg Added message to show on right
* @param picto Icon to use before title (should be a 32x32 transparent png file)
@@ -2697,7 +2684,6 @@ function load_fiche_titre($titre, $mesg='', $picto='title.png', $pictoisfullpath
/**
* Print a title with navigation controls for pagination
*
* @param titre Title to show (required)
* @param page Numero of page (required)
* @param file Url of page (required)
@@ -2807,7 +2793,6 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
/**
* Fonction servant a afficher les fleches de navigation dans les pages de listes
*
* @param page Numero of page
* @param file Lien
* @param options Autres parametres d'url a propager dans les liens ("" par defaut)
@@ -2832,7 +2817,6 @@ function print_fleche_navigation($page,$file,$options='',$nextpage,$betweenarrow
/**
* Fonction qui retourne un taux de tva formate pour visualisation
* Utilisee dans les pdf et les pages html
*
* @param rate Rate value to format (19.6 19,6 19.6% 19,6%,...)
* @param addpercent Add a percent % sign in output
* @param info_bits Miscellanous information on vat
@@ -2861,7 +2845,6 @@ function vatrate($rate,$addpercent=false,$info_bits=0)
/**
* Fonction qui formate un montant pour visualisation
* Fonction utilisee dans les pdf et les pages html
*
* @param amount Montant a formater
* @param html Type de formatage, html ou pas (par defaut)
* @param outlangs Objet langs pour formatage text
@@ -2934,8 +2917,7 @@ function price($amount, $html=0, $outlangs='', $trunc=1, $rounding=-1, $forcerou
/**
* Function that return a number with universal decimal format (decimal separator is '.') from
* an amount typed by a user.
* Function to use on each input amount before any numeric test or database insert
*
* Function to use on each input amount before any numeric test or database insert.
* @param amount Amount to convert/clean
* @param rounding ''=No rounding
* 'MU'=Round to Max unit price (MAIN_MAX_DECIMALS_UNIT)
@@ -3020,7 +3002,6 @@ function price2num($amount,$rounding='',$alreadysqlnb=0)
/**
* Return localtaxe rate for a particular tva
*
* @param tva Vat taxe
* @param local Local taxe to search and return
* @param societe_acheteuse Object of buying third party
@@ -3059,8 +3040,7 @@ function get_localtax($tva, $local, $societe_acheteuse="")
/**
* Return vat rate of a product in a particular selling country or default country
* vat if product is unknown
*
* vat if product is unknown.
* @param idprod Id of product or 0 if not a predefined product
* @param countrycode Country code (FR, US, IT, ...)
* @return int <0 if KO, Vat rate if OK
@@ -3119,7 +3099,6 @@ function get_product_vat_for_country($idprod, $countrycode)
/**
* Return localtax rate of a product in a particular selling country
*
* @param idprod Id of product
* @package local 1 for localtax1, 2 for localtax 2
* @param countrycode Country code (FR, US, IT, ...)
@@ -3277,7 +3256,6 @@ function get_default_localtax($societe_vendeuse, $societe_acheteuse, $local, $id
/**
* Return yes or no in current language
*
* @param yesno Value to test (1, 'yes', 'true' or 0, 'no', 'false')
* @param case 1=Yes/No, 0=yes/no
* @param color 0=texte only, 1=Text is formated with a color font style ('ok' or 'error'), 2=Text is formated with 'ok' color.
@@ -3306,7 +3284,6 @@ function yn($yesno, $case=1, $color=0)
* Return a path to have a directory according to an id
* Examples: '001' with level 3->"0/0/1/", '015' with level 3->"0/1/5/"
* Examples: 'ABC-1' with level 3 ->"0/0/1/", '015' with level 1->"5/"
*
* @param $num Id to develop
* @param $level Level of development (1, 2 or 3 level)
* @param $alpha Use alpha ref
@@ -3333,7 +3310,6 @@ function create_exdir($dir)
/**
* Creation of a directory (recursive)
*
* @param $dir Directory to create
* @return int < 0 if KO, 0 = already exists, > 0 if OK
*/
@@ -3395,7 +3371,6 @@ function dol_mkdir($dir)
/**
* Return picto saying a field is required
*
* @return string Chaine avec picto obligatoire
*/
function picto_required()
@@ -3406,7 +3381,6 @@ function picto_required()
/**
* Clean a string from all HTML tags and entities
*
* @param StringHtml String to clean
* @param removelinefeed Replace also all lines feeds by a space
* @return string String cleaned
@@ -3431,8 +3405,7 @@ function dol_string_nohtmltag($StringHtml,$removelinefeed=1)
/**
* Replace CRLF in string with a HTML BR tag
*
* Replace CRLF in string with a HTML BR tag.
* @param stringtoencode String to encode
* @param nl2brmode 0=Adding br before \n, 1=Replacing \n by br
* @param forxml false=Use <br>, true=Use <br />
@@ -3462,8 +3435,7 @@ function dol_nl2br($stringtoencode,$nl2brmode=0,$forxml=false)
* - writeHTMLCell -> param must be encoded into HTML.
* - MultiCell -> param must not be encoded into HTML.
* Because writeHTMLCell convert also \n into <br>, if function
* is used to build PDF, nl2brmode must be 1
*
* is used to build PDF, nl2brmode must be 1.
* @param stringtoencode String to encode
* @param nl2brmode 0=Adding br before \n, 1=Replacing \n by br (for use with FPDF writeHTMLCell function for example)
* @param pagecodefrom Pagecode stringtoencode is encoded
@@ -3490,7 +3462,6 @@ function dol_htmlentitiesbr($stringtoencode,$nl2brmode=0,$pagecodefrom='UTF-8')
/**
* This function is called to decode a HTML string (it decodes entities and br tags)
*
* @param stringtodecode String to decode
* @param pagecodeto Page code for result
*/
@@ -3506,7 +3477,6 @@ function dol_htmlentitiesbr_decode($stringtodecode,$pagecodeto='UTF-8')
/**
* This function remove all ending \n and br at end
*
* @param stringtodecode String to decode
*/
function dol_htmlcleanlastbr($stringtodecode)
@@ -3517,7 +3487,6 @@ function dol_htmlcleanlastbr($stringtodecode)
/**
* This function is called to decode a string with HTML entities (it decodes entities tags)
*
* @param stringhtml stringhtml
* @param pagecodeto Encoding of input string
* @return string decodestring
@@ -3530,7 +3499,6 @@ function dol_entity_decode($stringhtml,$pagecodeto='UTF-8')
/**
* Replace html_entity_decode functions to manage errors
*
* @param a
* @param b
* @param c
@@ -3545,7 +3513,6 @@ function dol_html_entity_decode($a,$b,$c)
/**
* Replace htmlentities functions to manage errors
*
* @param a
* @param b
* @param c
@@ -3562,8 +3529,7 @@ function dol_htmlentities($a,$b,$c)
/**
* Check if a string is a correct iso string
* If not, it will we considered not HTML encoded even if it is by FPDF.
* Example, if string contains euro symbol that has ascii code 128
*
* Example, if string contains euro symbol that has ascii code 128.
* @param s String to check
* @return int 0 if bad iso, 1 if good iso
*/
@@ -3584,7 +3550,6 @@ function dol_string_is_good_iso($s)
/**
* Return nb of lines of a clear text
*
* @param s String to check
* @param maxchar Not yet used
* @return int Number of lines
@@ -3601,7 +3566,6 @@ function dol_nboflines($s,$maxchar=0)
/**
* Return nb of lines of a formated text with \n and <br>
*
* @param text Text
* @param maxlinesize Largeur de ligne en caracteres (ou 0 si pas de limite - defaut)
* @param charset Give the charset used to encode the $text variable in memory.
@@ -3638,7 +3602,6 @@ function dol_nboflines_bis($text,$maxlinesize=0,$charset='UTF-8')
/**
* Same function than microtime in PHP 5 but compatible with PHP4
*
* @return float Time (millisecondes) with microsecondes in decimal part
*/
function dol_microtime_float()
@@ -3649,7 +3612,6 @@ function dol_microtime_float()
/**
* Return if a text is a html content
*
* @param msg Content to check
* @param option 0=Full detection, 1=Fast check
* @return boolean true/false
@@ -4112,8 +4074,7 @@ function verifCond($strRights)
/**
* Replace eval function to add more security.
* This function is called by verifCond()
*
* This function is called by verifCond().
* @param string $s
*/
function dol_eval($s)

View File

@@ -125,26 +125,26 @@ print '<td>'.$langs->trans("Value").'</td>';
print "</tr>\n";
$var=!$var;
print '<tr '.$bc[$var].'><td class="fieldrequired">';
print '<tr '.$bc[$var].'><td>';
print $langs->trans("PAYPAL_API_SANDBOX").'</td><td>';
print $form->selectyesno("PAYPAL_API_SANDBOX",$conf->global->PAYPAL_API_SANDBOX,1);
print '</td></tr>';
$var=!$var;
print '<tr '.$bc[$var].'><td class="fieldrequired">';
print '<tr '.$bc[$var].'><td>';
print $langs->trans("PAYPAL_API_USER").'</td><td>';
print '<input size="32" type="text" name="PAYPAL_API_USER" value="'.$conf->global->PAYPAL_API_USER.'">';
print ' &nbsp; '.$langs->trans("Example").': paypal_api1.mywebsite.com';
print '</td></tr>';
$var=!$var;
print '<tr '.$bc[$var].'><td class="fieldrequired">';
print '<tr '.$bc[$var].'><td>';
print $langs->trans("PAYPAL_API_PASSWORD").'</td><td>';
print '<input size="32" type="text" name="PAYPAL_API_PASSWORD" value="'.$conf->global->PAYPAL_API_PASSWORD.'">';
print '</td></tr>';
$var=!$var;
print '<tr '.$bc[$var].'><td class="fieldrequired">';
print '<tr '.$bc[$var].'><td>';
print $langs->trans("PAYPAL_API_SIGNATURE").'</td><td>';
print '<input size="64" type="text" name="PAYPAL_API_SIGNATURE" value="'.$conf->global->PAYPAL_API_SIGNATURE.'">';
print '<br>'.$langs->trans("Example").': ASsqXEmw4KzmX-CPChWSVDNCNfd.A3YNR7uz-VncXXAERFDFDFDF';
@@ -157,7 +157,7 @@ print '<td>'.$langs->trans("Value").'</td>';
print "</tr>\n";
$var=!$var;
print '<tr '.$bc[$var].'><td class="fieldrequired">';
print '<tr '.$bc[$var].'><td>';
print $langs->trans("PAYPAL_API_INTEGRAL_OR_PAYPALONLY").'</td><td>';
print $form->selectarray("PAYPAL_API_INTEGRAL_OR_PAYPALONLY",array('integral'=>'Integral','paypalonly'=>'Paypal only'),$conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY);
print '</td></tr>';
@@ -240,7 +240,7 @@ print '</div>';
print '<br><br>';
$token='';
if (! empty($conf->global->PAYPAL_SECURITY_TOKEN)) $token='&securekey='.$conf->global->PAYPAL_SECURITY_TOKEN;
if (! empty($conf->global->PAYPAL_SECURITY_TOKEN)) $token='&securekey='.dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2);
// Url list
print '<u>'.$langs->trans("FollowingUrlAreAvailableToMakePayments").':</u><br>';

View File

@@ -1200,68 +1200,64 @@ padding: 0px 0px;
/* For lists */
table.liste {
width: 100%;
border-collapse: collapse;
border-top-color: #FEFEFE;
width: 100%;
border-collapse: collapse;
border-top-color: #FEFEFE;
border-left-width: 1px;
border-left-color: #BBBBBB;
border-left-style: solid;
border-left-width: 1px;
border-left-color: #BBBBBB;
border-left-style: solid;
border-right-width: 1px;
border-right-color: #BBBBBB;
border-right-style: solid;
border-right-width: 1px;
border-right-color: #BBBBBB;
border-right-style: solid;
border-bottom-width: 1px;
border-bottom-color: #BBBBBB;
border-bottom-style: solid;
border-bottom-width: 1px;
border-bottom-color: #BBBBBB;
border-bottom-style: solid;
margin-bottom: 2px;
margin-top: 0px;
margin-bottom: 2px;
margin-top: 0px;
-moz-box-shadow: 4px 4px 4px #CCC;
-webkit-box-shadow: 4px 4px 4px #CCC;
box-shadow: 4px 4px 4px #CCC;
-moz-box-shadow: 4px 4px 4px #CCC;
-webkit-box-shadow: 4px 4px 4px #CCC;
box-shadow: 4px 4px 4px #CCC;
}
table.liste td {
padding-right: 2px;
padding-right: 2px;
}
tr.liste_titre
{
height: 24px;
background: #7699A9;
background-image: url(<?php echo $img_liste_titre ?>);
background-repeat: repeat-x;
color: #FFFFFF;
font-family: <?php print $fontlist ?>;
/* border-bottom: 1px solid #FDFFFF; */
white-space: nowrap;
tr.liste_titre {
height: 24px;
background: #7699A9;
background-image: url(<?php echo $img_liste_titre ?>);
background-repeat: repeat-x;
color: #FFFFFF;
font-family: <?php print $fontlist ?>;
/* border-bottom: 1px solid #FDFFFF; */
white-space: nowrap;
}
th.liste_titre, td.liste_titre
{
background: #7699A9;
background-image: url(<?php echo $img_liste_titre ?>);
background-repeat: repeat-x;
color: #FFFFFF;
font-family: <?php print $fontlist ?>;
font-weight: normal;
/* border-bottom: 1px solid #FDFFFF; */
white-space: nowrap;
text-align: <?php echo $left; ?>;
td.liste_titre {
background: #7699A9;
background-image: url(<?php echo $img_liste_titre ?>);
background-repeat: repeat-x;
color: #FFFFFF;
font-family: <?php print $fontlist ?>;
font-weight: normal;
/* border-bottom: 1px solid #FDFFFF; */
white-space: nowrap;
}
th.liste_titre_sel, td.liste_titre_sel
td.liste_titre_sel
{
background: #7699A9;
background-image: url(<?php echo $img_liste_titre ?>);
background-repeat: repeat-x;
color: #FFFFFF;
font-family: <?php print $fontlist ?>;
font-weight: normal;
/* text-decoration: underline; */
/* border-bottom: 1px solid #FDFFFF; */
white-space: nowrap;
text-align: <?php echo $left; ?>;
background: #7699A9;
background-image: url(<?php echo $img_liste_titre ?>);
background-repeat: repeat-x;
color: #FFFFFF;
font-family: <?php print $fontlist ?>;
font-weight: normal;
/* text-decoration: underline; */
/* border-bottom: 1px solid #FDFFFF; */
white-space: nowrap;
}
input.liste_titre {
background: transparent;
@@ -1278,6 +1274,19 @@ font-weight: normal;
white-space: nowrap;
}
th {
/* background: #7699A9; */
background: #91ABB3;
color: #334444;
font-family: <?php print $fontlist ?>;
font-weight: bold;
border-left: 1px solid #FFFFFF;
border-right: 1px solid #FFFFFF;
border-top: 1px solid #FFFFFF;
border-bottom: 1px solid #FFFFFF;
white-space: nowrap;
}
.impair {
/* background: #d0d4d7; */
background: #eaeaea;

View File

@@ -1402,7 +1402,7 @@ tr.liste_titre:first-child {
background-position: top right;
}
th.liste_titre_sel, td.liste_titre_sel,
td.liste_titre_sel,
tr.liste_titre:first-child td {
color: #FFFFFF !important;
}
@@ -1430,8 +1430,7 @@ tr.liste_titre td {
background: none !important;
}
th.liste_titre, td.liste_titre
{
td.liste_titre {
background-repeat: repeat-x;
color: #333333;
font-family: <?php print $fontlist ?>;
@@ -1439,7 +1438,6 @@ th.liste_titre, td.liste_titre
white-space: nowrap;
background-image: none;
background: none;
text-align: <?php echo $left; ?>;
}
/*tr.liste_titre select.flat {
@@ -1455,8 +1453,7 @@ tr.liste_titre input.button {
/*margin: 30px 10px 10px 0px;*/
}
th.liste_titre_sel, td.liste_titre_sel
{
td.liste_titre_sel {
background: #505050;
background-repeat: repeat-x;
color: #FFFFFF;
@@ -1465,7 +1462,6 @@ th.liste_titre_sel, td.liste_titre_sel
/* text-decoration: underline; */
/* border-bottom: 1px solid #FDFFFF; */
white-space: nowrap;
text-align: <?php echo $left; ?>;
}
input.liste_titre {
@@ -1485,6 +1481,19 @@ white-space: nowrap;
padding: 5px;
}
th {
/* background: #7699A9; */
background: #91ABB3;
color: #334444;
font-family: <?php print $fontlist ?>;
font-weight: bold;
border-left: 1px solid #FFFFFF;
border-right: 1px solid #FFFFFF;
border-top: 1px solid #FFFFFF;
border-bottom: 1px solid #FFFFFF;
white-space: nowrap;
}
.impair {
/* background: #d0d4d7; */
background: #eaeaea;

View File

@@ -1339,31 +1339,30 @@ table.liste td {
}
tr.liste_titre {
height: 20px;
color: #842F00;
font-weight: bold;
font-family: "Trebuchet MS",Arial,Helvetica,sans-serif;
/*border-bottom: 1px solid #FDFFFF;*/
border-radius: 8px;
line-height: 18px;
padding-left: 10px;
padding-right: 10px;
white-space: nowrap;
height: 20px;
color: #842F00;
font-weight: bold;
font-family: "Trebuchet MS",Arial,Helvetica,sans-serif;
/*border-bottom: 1px solid #FDFFFF;*/
border-radius: 8px;
line-height: 18px;
padding-left: 10px;
padding-right: 10px;
white-space: nowrap;
}
th.liste_titre, td.liste_titre
{
tr.liste_titre td {
padding-left: 6px;
padding-right: 6px;
/*vertical-align: text-top;*/
text-align: <?php echo $left; ?>;
}
th.liste_titre_sel, td.liste_titre_sel
td.liste_titre_sel
{
background-position: top right;
color: #A51B00;
font-weight: bold;
white-space: nowrap;
text-align: <?php echo $left; ?>;
background-position: top right;
color: #A51B00;
font-weight: bold;
white-space: nowrap;
}
input.liste_titre {
@@ -1384,6 +1383,19 @@ font-weight: normal;
white-space: nowrap;
}
th {
/* background: #7699A9; */
background: #91ABB3;
color: #334444;
font-family: <?php print $fontlist ?>;
font-weight: bold;
border-left: 1px solid #FFFFFF;
border-right: 1px solid #FFFFFF;
border-top: 1px solid #FFFFFF;
border-bottom: 1px solid #FFFFFF;
white-space: nowrap;
}
.impair {
/* background: #d0d4d7; */
background: #eaeaea;

View File

@@ -1222,63 +1222,59 @@ padding: 0px 0px;
/* For lists */
table.liste {
width: 100%;
border-collapse: collapse;
border-top-color: #FEFEFE;
width: 100%;
border-collapse: collapse;
border-top-color: #FEFEFE;
border-right-width: 1px;
border-right-color: #BBBBBB;
border-right-style: solid;
border-right-width: 1px;
border-right-color: #BBBBBB;
border-right-style: solid;
border-bottom-width: 1px;
border-bottom-color: #BBBBBB;
border-bottom-style: solid;
border-bottom-width: 1px;
border-bottom-color: #BBBBBB;
border-bottom-style: solid;
margin-bottom: 2px;
margin-top: 0px;
margin-bottom: 2px;
margin-top: 0px;
-moz-box-shadow: 4px 4px 4px #CCC;
-webkit-box-shadow: 4px 4px 4px #CCC;
box-shadow: 4px 4px 4px #CCC;
-moz-box-shadow: 4px 4px 4px #CCC;
-webkit-box-shadow: 4px 4px 4px #CCC;
box-shadow: 4px 4px 4px #CCC;
}
table.liste td {
padding-right: 2px;
padding-right: 2px;
}
tr.liste_titre
{
height: 20px !important;
background: #7699A9;
background-image: url(<?php echo $img_liste_titre ?>);
background-repeat: repeat-x;
color: #334444;
font-family: <?php print $fontlist ?>;
border-bottom: 1px solid #FDFFFF;
white-space: nowrap;
tr.liste_titre {
height: 20px !important;
background: #7699A9;
background-image: url(<?php echo $img_liste_titre ?>);
background-repeat: repeat-x;
color: #334444;
font-family: <?php print $fontlist ?>;
border-bottom: 1px solid #FDFFFF;
white-space: nowrap;
}
th.liste_titre, td.liste_titre
{
background: #7699A9;
background-image: url(<?php echo $img_liste_titre ?>);
background-repeat: repeat-x;
color: #334444;
font-family: <?php print $fontlist ?>;
font-weight: normal;
border-bottom: 1px solid #FDFFFF;
white-space: nowrap;
text-align: <?php echo $left; ?>;
td.liste_titre {
background: #7699A9;
background-image: url(<?php echo $img_liste_titre ?>);
background-repeat: repeat-x;
color: #334444;
font-family: <?php print $fontlist ?>;
font-weight: normal;
border-bottom: 1px solid #FDFFFF;
white-space: nowrap;
}
th.liste_titre_sel, td.liste_titre_sel
td.liste_titre_sel
{
background: #7699A9;
background-image: url(<?php echo $img_liste_titre ?>);
background-repeat: repeat-x;
color: #F5FFFF;
font-family: <?php print $fontlist ?>;
font-weight: normal;
border-bottom: 1px solid #FDFFFF;
white-space: nowrap;
text-align: <?php echo $left; ?>;
background: #7699A9;
background-image: url(<?php echo $img_liste_titre ?>);
background-repeat: repeat-x;
color: #F5FFFF;
font-family: <?php print $fontlist ?>;
font-weight: normal;
border-bottom: 1px solid #FDFFFF;
white-space: nowrap;
}
input.liste_titre {
background: #7699A9;
@@ -1296,6 +1292,18 @@ font-weight: normal;
white-space: nowrap;
}
th {
/* background: #7699A9; */
background: #91ABB3;
color: #334444;
font-family: <?php print $fontlist ?>;
font-weight: bold;
border-left: 1px solid #FFFFFF;
border-right: 1px solid #FFFFFF;
border-top: 1px solid #FFFFFF;
border-bottom: 1px solid #FFFFFF;
white-space: nowrap;
}
.impair {
/* background: #d0d4d7; */

View File

@@ -316,37 +316,33 @@ padding: 0px 0px;
tr.liste_titre
{
height: 24px;
background: -moz-linear-gradient(center top , #81A8CE, #5E87B0) repeat scroll 0 0 #5E87B0;
border: 1px solid #456F9A;
color: #FFFFFF;
font-family: <?php print $fontlist ?>;
/* border-bottom: 1px solid #FDFFFF; */
white-space: nowrap;
tr.liste_titre {
height: 24px;
background: -moz-linear-gradient(center top , #81A8CE, #5E87B0) repeat scroll 0 0 #5E87B0;
border: 1px solid #456F9A;
color: #FFFFFF;
font-family: <?php print $fontlist ?>;
/* border-bottom: 1px solid #FDFFFF; */
white-space: nowrap;
}
th.liste_titre, td.liste_titre
{
background: -moz-linear-gradient(center top , #81A8CE, #5E87B0) repeat scroll 0 0 #5E87B0;
border: 1px solid #456F9A;
color: #FFFFFF;
font-family: <?php print $fontlist ?>;
font-weight: normal;
/* border-bottom: 1px solid #FDFFFF; */
white-space: nowrap;
text-align: <?php echo $left; ?>;
td.liste_titre {
background: -moz-linear-gradient(center top , #81A8CE, #5E87B0) repeat scroll 0 0 #5E87B0;
border: 1px solid #456F9A;
color: #FFFFFF;
font-family: <?php print $fontlist ?>;
font-weight: normal;
/* border-bottom: 1px solid #FDFFFF; */
white-space: nowrap;
}
th.liste_titre_sel, td.liste_titre_sel
td.liste_titre_sel
{
background: -moz-linear-gradient(center top , #81A8CE, #5E87B0) repeat scroll 0 0 #5E87B0;
color: #FFFFFF;
font-family: <?php print $fontlist ?>;
font-weight: normal;
/* text-decoration: underline; */
/* border-bottom: 1px solid #FDFFFF; */
white-space: nowrap;
text-align: <?php echo $left; ?>;
background: -moz-linear-gradient(center top , #81A8CE, #5E87B0) repeat scroll 0 0 #5E87B0;
color: #FFFFFF;
font-family: <?php print $fontlist ?>;
font-weight: normal;
/* text-decoration: underline; */
/* border-bottom: 1px solid #FDFFFF; */
white-space: nowrap;
}
input.liste_titre {
background: transparent;