Merge remote-tracking branch 'origin/3.4' into develop
This commit is contained in:
commit
701d8485ef
@ -879,30 +879,33 @@ class DoliDBMysql
|
|||||||
{
|
{
|
||||||
// cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra
|
// 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');
|
// ex. : $fields['rowid'] = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
|
||||||
$sql = "create table ".$table."(";
|
$sql = "CREATE TABLE ".$table."(";
|
||||||
$i=0;
|
$i=0;
|
||||||
foreach($fields as $field_name => $field_desc)
|
foreach($fields as $field_name => $field_desc)
|
||||||
{
|
{
|
||||||
$sqlfields[$i] = $field_name." ";
|
$sqlfields[$i] = $field_name." ";
|
||||||
$sqlfields[$i] .= $field_desc['type'];
|
$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'].")";
|
$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'];
|
$sqlfields[$i] .= " ".$field_desc['attribute'];
|
||||||
|
}
|
||||||
if( preg_match("/^[^\s]/i",$field_desc['default']))
|
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'];
|
$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']."'";
|
$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'];
|
$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'];
|
$sqlfields[$i] .= " ".$field_desc['extra'];
|
||||||
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
if($primary_key != "")
|
if($primary_key != "")
|
||||||
|
|||||||
@ -873,33 +873,33 @@ class DoliDBMysqli
|
|||||||
{
|
{
|
||||||
// cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra
|
// 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');
|
// ex. : $fields['rowid'] = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
|
||||||
$sql = "create table ".$table."(";
|
$sql = "CREATE TABLE ".$table."(";
|
||||||
$i=0;
|
$i=0;
|
||||||
foreach($fields as $field_name => $field_desc)
|
foreach($fields as $field_name => $field_desc)
|
||||||
{
|
{
|
||||||
$sqlfields[$i] = $field_name." ";
|
$sqlfields[$i] = $field_name." ";
|
||||||
$sqlfields[$i] .= $field_desc['type'];
|
$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'].")";
|
||||||
$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'];
|
||||||
$sqlfields[$i] .= " ".$field_desc['attribute'];
|
}
|
||||||
|
if( preg_match("/^[^\s]/i",$field_desc['default']))
|
||||||
if( preg_match("/^[^\s]/i",$field_desc['default']))
|
{
|
||||||
{
|
if ((preg_match("/null/i",$field_desc['default'])) || (preg_match("/CURRENT_TIMESTAMP/i",$field_desc['default']))) {
|
||||||
if(preg_match("/null/i",$field_desc['default']))
|
$sqlfields[$i] .= " default ".$field_desc['default'];
|
||||||
$sqlfields[$i] .= " default ".$field_desc['default'];
|
}
|
||||||
elseif ($field_desc['default'] == 'CURRENT_TIMESTAMP')
|
else {
|
||||||
$sqlfields[$i] .= " default ".$field_desc['default'];
|
$sqlfields[$i] .= " default '".$field_desc['default']."'";
|
||||||
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'];
|
||||||
$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'];
|
||||||
$sqlfields[$i] .= " ".$field_desc['extra'];
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
if($primary_key != "")
|
if($primary_key != "")
|
||||||
|
|||||||
@ -45,6 +45,8 @@ $left=($langs->trans("DIRECTION")=='rtl'?'right':'left');
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$title=$langs->trans("Menu");
|
||||||
|
|
||||||
// URL http://mydolibarr/core/get_menudiv.php?dol_use_jmobile=1 can be used for tests
|
// URL http://mydolibarr/core/get_menudiv.php?dol_use_jmobile=1 can be used for tests
|
||||||
$arrayofjs=array();
|
$arrayofjs=array();
|
||||||
$arrayofcss=array();
|
$arrayofcss=array();
|
||||||
|
|||||||
@ -68,7 +68,7 @@ $conffiletoshow = "htdocs/conf/conf.php";
|
|||||||
|
|
||||||
|
|
||||||
// Include configuration
|
// 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
|
if (! $result && ! empty($_SERVER["GATEWAY_INTERFACE"])) // If install not done and we are in a web session
|
||||||
{
|
{
|
||||||
|
|||||||
@ -95,7 +95,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes')
|
|||||||
$result=$object->createFromClone($id);
|
$result=$object->createFromClone($id);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
header("Location: ".$_SERVER['PHP_SELF'].'?action=editfacnumber&id='.$result);
|
header("Location: ".$_SERVER['PHP_SELF'].'?action=editref_supplier&id='.$result);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -1113,6 +1113,9 @@ class User extends CommonObject
|
|||||||
$this->note = trim($this->note);
|
$this->note = trim($this->note);
|
||||||
$this->openid = trim(empty($this->openid)?'':$this->openid); // Avoid warning
|
$this->openid = trim(empty($this->openid)?'':$this->openid); // Avoid warning
|
||||||
$this->admin = $this->admin?$this->admin:0;
|
$this->admin = $this->admin?$this->admin:0;
|
||||||
|
$this->address = empty($this->address)?'':$this->address;
|
||||||
|
$this->zip = empty($this->zip)?'':$this->zip;
|
||||||
|
$this->town = empty($this->town)?'':$this->town;
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (! empty($conf->global->USER_MAIL_REQUIRED) && ! isValidEMail($this->email))
|
if (! empty($conf->global->USER_MAIL_REQUIRED) && ! isValidEMail($this->email))
|
||||||
@ -1133,8 +1136,8 @@ class User extends CommonObject
|
|||||||
$sql.= ", address = '".$this->db->escape($this->address)."'";
|
$sql.= ", address = '".$this->db->escape($this->address)."'";
|
||||||
$sql.= ", zip = '".$this->db->escape($this->zip)."'";
|
$sql.= ", zip = '".$this->db->escape($this->zip)."'";
|
||||||
$sql.= ", town = '".$this->db->escape($this->town)."'";
|
$sql.= ", town = '".$this->db->escape($this->town)."'";
|
||||||
$sql.= ", fk_state = ".($this->state_id > 0?"'".$this->db->escape($this->state_id)."'":"null");
|
$sql.= ", fk_state = ".((! empty($this->state_id) && $this->state_id > 0)?"'".$this->db->escape($this->state_id)."'":"null");
|
||||||
$sql.= ", fk_country = ".($this->country_id > 0?"'".$this->db->escape($this->country_id)."'":"null");
|
$sql.= ", fk_country = ".((! empty($this->country_id) && $this->country_id > 0)?"'".$this->db->escape($this->country_id)."'":"null");
|
||||||
$sql.= ", office_phone = '".$this->db->escape($this->office_phone)."'";
|
$sql.= ", office_phone = '".$this->db->escape($this->office_phone)."'";
|
||||||
$sql.= ", office_fax = '".$this->db->escape($this->office_fax)."'";
|
$sql.= ", office_fax = '".$this->db->escape($this->office_fax)."'";
|
||||||
$sql.= ", user_mobile = '".$this->db->escape($this->user_mobile)."'";
|
$sql.= ", user_mobile = '".$this->db->escape($this->user_mobile)."'";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user