forked from Wavyzz/dolibarr
@@ -31,7 +31,11 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php");
|
|||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
|
|
||||||
$mode=GETPOST('mode', 'alpha')?GETPOST('mode', 'alpha'):(isset($_SESSION['mode'])?$_SESSION['mode']:0);
|
$mode=GETPOST('mode', 'alpha');
|
||||||
|
if (!isset($mode)) {
|
||||||
|
if (isset($_SESSION['mode'])) { $mode=$_SESSION['mode'];}
|
||||||
|
else {$mode=0;}
|
||||||
|
}
|
||||||
$mesg=GETPOST("mesg");
|
$mesg=GETPOST("mesg");
|
||||||
$action=GETPOST('action', 'alpha');
|
$action=GETPOST('action', 'alpha');
|
||||||
$value=GETPOST('value', 'alpha');
|
$value=GETPOST('value', 'alpha');
|
||||||
|
|||||||
@@ -1025,23 +1025,35 @@ class DoliDBPgsql
|
|||||||
*
|
*
|
||||||
* @param string $table Name of table
|
* @param string $table Name of table
|
||||||
* @return array Tableau des informations des champs de la table
|
* @return array Tableau des informations des champs de la table
|
||||||
* TODO modify for postgresql
|
*
|
||||||
*/
|
*/
|
||||||
function DDLInfoTable($table)
|
function DDLInfoTable($table)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
$infotables=array();
|
$infotables=array();
|
||||||
|
|
||||||
$sql="SHOW FULL COLUMNS FROM ".$table.";";
|
$sql="SELECT ";
|
||||||
|
$sql.=" infcol.column_name as \"Column\",";
|
||||||
|
$sql.=" CASE WHEN infcol.character_maximum_length IS NOT NULL THEN infcol.udt_name || '('||infcol.character_maximum_length||')'";
|
||||||
|
$sql.=" ELSE infcol.udt_name";
|
||||||
|
$sql.=" END as \"Type\",";
|
||||||
|
$sql.=" infcol.collation_name as \"Collation\",";
|
||||||
|
$sql.=" infcol.is_nullable as \"Null\",";
|
||||||
|
$sql.=" '' as \"Key\",";
|
||||||
|
$sql.=" infcol.column_default as \"Default\",";
|
||||||
|
$sql.=" '' as \"Extra\",";
|
||||||
|
$sql.=" '' as \"Privileges\"";
|
||||||
|
$sql.=" FROM information_schema.columns infcol";
|
||||||
|
$sql.=" WHERE table_schema='public' ";
|
||||||
|
$sql.=" AND table_name='".$table."'";
|
||||||
|
$sql.=" ORDER BY ordinal_position;";
|
||||||
|
|
||||||
dol_syslog($sql,LOG_DEBUG);
|
dol_syslog($sql,LOG_DEBUG);
|
||||||
$result = $this->pg_query($this->db,$sql);
|
$result = $this->query($sql);
|
||||||
while($row = $this->fetch_row($result))
|
while($row = $this->fetch_row($result))
|
||||||
{
|
{
|
||||||
$infotables[] = $row;
|
$infotables[] = $row;
|
||||||
}
|
}
|
||||||
return $infotables;
|
return $infotables;
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user