Fix error management and SQL resquest in action comm
This commit is contained in:
parent
87329068e2
commit
5acdbfa8f0
@ -188,8 +188,8 @@ class ActionComm extends CommonObject
|
||||
$sql.= (strval($this->datep)!=''?"'".$this->db->idate($this->datep)."'":"null").",";
|
||||
$sql.= (strval($this->datef)!=''?"'".$this->db->idate($this->datef)."'":"null").",";
|
||||
$sql.= (isset($this->durationp) && $this->durationp >= 0 && $this->durationp != ''?"'".$this->durationp."'":"null").",";
|
||||
$sql.= " '".$this->type_id."',";
|
||||
$sql.= " '".$this->code."',";
|
||||
$sql.= (isset($this->type_id)?$this->type_id:"null");
|
||||
$sql.= (isset($this->code)?" '".$this->code."'":"null")."," ;
|
||||
$sql.= (isset($this->societe->id) && $this->societe->id > 0?" '".$this->societe->id."'":"null").",";
|
||||
$sql.= (isset($this->fk_project) && $this->fk_project > 0?" '".$this->fk_project."'":"null").",";
|
||||
$sql.= " '".$this->db->escape($this->note)."',";
|
||||
|
||||
@ -243,6 +243,7 @@ if ($action == 'add_action')
|
||||
$db->rollback();
|
||||
$langs->load("errors");
|
||||
$error=$langs->trans($actioncomm->error);
|
||||
setEventMessage($error,'errors');
|
||||
$action = 'create';
|
||||
}
|
||||
}
|
||||
@ -251,6 +252,7 @@ if ($action == 'add_action')
|
||||
$db->rollback();
|
||||
$langs->load("errors");
|
||||
$error=$langs->trans($actioncomm->error);
|
||||
setEventMessage($error,'errors');
|
||||
$action = 'create';
|
||||
}
|
||||
}
|
||||
@ -277,6 +279,7 @@ if ($action == 'confirm_delete' && GETPOST("confirm") == 'yes')
|
||||
else
|
||||
{
|
||||
$mesg=$actioncomm->error;
|
||||
setEventMessage($mesg,'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user