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
|
||||
// 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 != "")
|
||||
|
||||
@ -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 != "")
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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 '<tr><td>'.$langs->trans('DateMaxPayment').'</td><td>';
|
||||
$form->select_date($datedue,'ech','','','',"add",1,1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
// Project
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
|
||||
@ -1113,7 +1113,10 @@ class User extends CommonObject
|
||||
$this->note = trim($this->note);
|
||||
$this->openid = trim(empty($this->openid)?'':$this->openid); // Avoid warning
|
||||
$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
|
||||
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.= ", zip = '".$this->db->escape($this->zip)."'";
|
||||
$sql.= ", town = '".$this->db->escape($this->town)."'";
|
||||
$sql.= ", fk_state = ".($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_state = ".((! empty($this->state_id) && $this->state_id > 0)?"'".$this->db->escape($this->state_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_fax = '".$this->db->escape($this->office_fax)."'";
|
||||
$sql.= ", user_mobile = '".$this->db->escape($this->user_mobile)."'";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user