diff --git a/htdocs/core/db/mysql.class.php b/htdocs/core/db/mysql.class.php index 4868fb81642..287fba04bcc 100644 --- a/htdocs/core/db/mysql.class.php +++ b/htdocs/core/db/mysql.class.php @@ -879,30 +879,33 @@ class DoliDBMysql { // cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra // ex. : $fields['rowid'] = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); - $sql = "create table ".$table."("; + $sql = "CREATE TABLE ".$table."("; $i=0; foreach($fields as $field_name => $field_desc) { $sqlfields[$i] = $field_name." "; $sqlfields[$i] .= $field_desc['type']; - if( preg_match("/^[^\s]/i",$field_desc['value'])) + if( preg_match("/^[^\s]/i",$field_desc['value'])) { $sqlfields[$i] .= "(".$field_desc['value'].")"; - if( preg_match("/^[^\s]/i",$field_desc['attribute'])) + } + if( preg_match("/^[^\s]/i",$field_desc['attribute'])) { $sqlfields[$i] .= " ".$field_desc['attribute']; + } if( preg_match("/^[^\s]/i",$field_desc['default'])) { - if(preg_match("/null/i",$field_desc['default'])) + if ((preg_match("/null/i",$field_desc['default'])) || (preg_match("/CURRENT_TIMESTAMP/i",$field_desc['default']))) { $sqlfields[$i] .= " default ".$field_desc['default']; - elseif ($field_desc['default'] == 'CURRENT_TIMESTAMP') - $sqlfields[$i] .= " default ".$field_desc['default']; - else + } + else { $sqlfields[$i] .= " default '".$field_desc['default']."'"; + } } - if( preg_match("/^[^\s]/i",$field_desc['null'])) + if( preg_match("/^[^\s]/i",$field_desc['null'])) { $sqlfields[$i] .= " ".$field_desc['null']; - - if( preg_match("/^[^\s]/i",$field_desc['extra'])) + } + if( preg_match("/^[^\s]/i",$field_desc['extra'])) { $sqlfields[$i] .= " ".$field_desc['extra']; + } $i++; } if($primary_key != "") diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index e7ccebbd0ee..2ae51e7def5 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -873,33 +873,33 @@ class DoliDBMysqli { // cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra // ex. : $fields['rowid'] = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); - $sql = "create table ".$table."("; + $sql = "CREATE TABLE ".$table."("; $i=0; foreach($fields as $field_name => $field_desc) { - $sqlfields[$i] = $field_name." "; - $sqlfields[$i] .= $field_desc['type']; - - if( preg_match("/^[^\s]/i",$field_desc['value'])) - $sqlfields[$i] .= "(".$field_desc['value'].")"; - - if( preg_match("/^[^\s]/i",$field_desc['attribute'])) - $sqlfields[$i] .= " ".$field_desc['attribute']; - - if( preg_match("/^[^\s]/i",$field_desc['default'])) - { - if(preg_match("/null/i",$field_desc['default'])) - $sqlfields[$i] .= " default ".$field_desc['default']; - elseif ($field_desc['default'] == 'CURRENT_TIMESTAMP') - $sqlfields[$i] .= " default ".$field_desc['default']; - else - $sqlfields[$i] .= " default '".$field_desc['default']."'"; - } - if( preg_match("/^[^\s]/i",$field_desc['null'])) - $sqlfields[$i] .= " ".$field_desc['null']; - - if( preg_match("/^[^\s]/i",$field_desc['extra'])) - $sqlfields[$i] .= " ".$field_desc['extra']; + $sqlfields[$i] = $field_name." "; + $sqlfields[$i] .= $field_desc['type']; + if( preg_match("/^[^\s]/i",$field_desc['value'])) { + $sqlfields[$i] .= "(".$field_desc['value'].")"; + } + if( preg_match("/^[^\s]/i",$field_desc['attribute'])) { + $sqlfields[$i] .= " ".$field_desc['attribute']; + } + if( preg_match("/^[^\s]/i",$field_desc['default'])) + { + if ((preg_match("/null/i",$field_desc['default'])) || (preg_match("/CURRENT_TIMESTAMP/i",$field_desc['default']))) { + $sqlfields[$i] .= " default ".$field_desc['default']; + } + else { + $sqlfields[$i] .= " default '".$field_desc['default']."'"; + } + } + if( preg_match("/^[^\s]/i",$field_desc['null'])) { + $sqlfields[$i] .= " ".$field_desc['null']; + } + if( preg_match("/^[^\s]/i",$field_desc['extra'])) { + $sqlfields[$i] .= " ".$field_desc['extra']; + } $i++; } if($primary_key != "") diff --git a/htdocs/core/get_menudiv.php b/htdocs/core/get_menudiv.php index 0f1da52c46e..f320b7cc8eb 100644 --- a/htdocs/core/get_menudiv.php +++ b/htdocs/core/get_menudiv.php @@ -45,6 +45,8 @@ $left=($langs->trans("DIRECTION")=='rtl'?'right':'left'); * View */ +$title=$langs->trans("Menu"); + // URL http://mydolibarr/core/get_menudiv.php?dol_use_jmobile=1 can be used for tests $arrayofjs=array(); $arrayofcss=array(); diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index d1526e04984..abdb1006266 100755 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -68,7 +68,7 @@ $conffiletoshow = "htdocs/conf/conf.php"; // Include configuration -$result=include_once $conffile; +$result=@include_once $conffile; // Keep @ because with some error reporting this break the redirect if (! $result && ! empty($_SERVER["GATEWAY_INTERFACE"])) // If install not done and we are in a web session { diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index d4010f6c495..3a157d74ceb 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -95,7 +95,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes') $result=$object->createFromClone($id); if ($result > 0) { - header("Location: ".$_SERVER['PHP_SELF'].'?action=editfacnumber&id='.$result); + header("Location: ".$_SERVER['PHP_SELF'].'?action=editref_supplier&id='.$result); exit; } else @@ -1158,7 +1158,7 @@ if ($action == 'create') print '