New: Function plimit of databases drivers accept -1 as value (it means

default value set into conf->liste_limit).
This commit is contained in:
Laurent Destailleur 2013-02-25 12:51:38 +01:00
parent 1224e79ee3
commit 2dc4b91521
6 changed files with 31 additions and 30 deletions

View File

@ -28,7 +28,8 @@ For developers:
- Renamed some database fields, code variables and parameters from french to english.
- First change to manage margins on contracts.
- Add hook getFormMail.
- Function plimit of databases drivers accept -1 as value (it means default value set
into conf->liste_limit).
For translators:
- Update language files.

View File

@ -499,16 +499,16 @@ class DoliDBMssql
/**
* Define limits of request
*
* @param int $limit nombre maximum de lignes retournees
* @param int $offset numero de la ligne a partir de laquelle recuperer les ligne
* @return string chaine exprimant la syntax sql de la limite
* Define limits and offset of request
*
* @param int $limit Maximum number of lines returned (-1=conf->liste_limit, 0=no limit)
* @param int $offset Numero of line from where starting fetch
* @return string String with SQL syntax to add a limit and offset
*/
function plimit($limit=0,$offset=0)
{
global $conf;
if (! $limit) $limit=$conf->liste_limit;
if ($limit < 0) $limit=$conf->liste_limit;
if ($offset > 0) return " LIMIT $offset,$limit ";
else return " LIMIT $limit ";
}

View File

@ -479,16 +479,16 @@ class DoliDBMysql
/**
* Define limits of request
*
* @param int $limit nombre maximum de lignes retournees
* @param int $offset numero de la ligne a partir de laquelle recuperer les ligne
* @return string chaine exprimant la syntax sql de la limite
* Define limits and offset of request
*
* @param int $limit Maximum number of lines returned (-1=conf->liste_limit, 0=no limit)
* @param int $offset Numero of line from where starting fetch
* @return string String with SQL syntax to add a limit and offset
*/
function plimit($limit=0,$offset=0)
{
global $conf;
if (! $limit) $limit=$conf->liste_limit;
if ($limit < 0) $limit=$conf->liste_limit;
if ($offset > 0) return " LIMIT $offset,$limit ";
else return " LIMIT $limit ";
}

View File

@ -481,16 +481,16 @@ class DoliDBMysqli
/**
* Defini les limites de la requete
* Define limits and offset of request
*
* @param int $limit nombre maximum de lignes retournees
* @param int $offset numero de la ligne a partir de laquelle recuperer les ligne
* @return string chaine exprimant la syntax sql de la limite
* @param int $limit Maximum number of lines returned (-1=conf->liste_limit, 0=no limit)
* @param int $offset Numero of line from where starting fetch
* @return string String with SQL syntax to add a limit and offset
*/
function plimit($limit=0,$offset=0)
{
global $conf;
if (! $limit) $limit=$conf->liste_limit;
if ($limit < 0) $limit=$conf->liste_limit;
if ($offset > 0) return " LIMIT $offset,$limit ";
else return " LIMIT $limit ";
}

View File

@ -691,16 +691,16 @@ class DoliDBPgsql
/**
* Defini les limites de la requete
*
* @param int $limit nombre maximum de lignes retournees
* @param int $offset numero de la ligne a partir de laquelle recuperer les lignes
* @return string chaine exprimant la syntax sql de la limite
* Define limits and offset of request
*
* @param int $limit Maximum number of lines returned (-1=conf->liste_limit, 0=no limit)
* @param int $offset Numero of line from where starting fetch
* @return string String with SQL syntax to add a limit and offset
*/
function plimit($limit=0,$offset=0)
{
global $conf;
if (! $limit) $limit=$conf->liste_limit;
if ($limit < 0) $limit=$conf->liste_limit;
if ($offset > 0) return " LIMIT ".$limit." OFFSET ".$offset." ";
else return " LIMIT $limit ";
}

View File

@ -620,16 +620,16 @@ class DoliDBSqlite
/**
* Define limits of request
*
* @param int $limit nombre maximum de lignes retournees
* @param int $offset numero de la ligne a partir de laquelle recuperer les ligne
* @return string chaine exprimant la syntax sql de la limite
* Define limits and offset of request
*
* @param int $limit Maximum number of lines returned (-1=conf->liste_limit, 0=no limit)
* @param int $offset Numero of line from where starting fetch
* @return string String with SQL syntax to add a limit and offset
*/
function plimit($limit=0,$offset=0)
{
global $conf;
if (! $limit) $limit=$conf->liste_limit;
if ($limit < 0) $limit=$conf->liste_limit;
if ($offset > 0) return " LIMIT $offset,$limit ";
else return " LIMIT $limit ";
}