Merge branch 'develop' of https://github.com/dolibarr/dolibarr into develop

This commit is contained in:
novalore 2016-06-04 18:32:27 +02:00
commit d750401eb0
2 changed files with 12 additions and 3 deletions

View File

@ -253,7 +253,8 @@ if (empty($reshook))
} }
$lastname=$_POST["lastname"]; $lastname=$_POST["lastname"];
$firstname=$_POST["firstname"]; $firstname=$_POST["firstname"];
$morphy=$morphy=$_POST["morphy"]; $morphy=$_POST["morphy"];
$login=$_POST["login"];
if ($morphy != 'mor' && empty($lastname)) { if ($morphy != 'mor' && empty($lastname)) {
$error++; $error++;
$langs->load("errors"); $langs->load("errors");
@ -264,7 +265,14 @@ if (empty($reshook))
$langs->load("errors"); $langs->load("errors");
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Firstname")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Firstname")), null, 'errors');
} }
// Test si le login existe deja
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{
if (empty($login)) {
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Login")), null, 'errors');
}
}
// Create new object // Create new object
if ($result > 0 && ! $error) if ($result > 0 && ! $error)
{ {

View File

@ -744,7 +744,8 @@ abstract class CommonObject
$sql = "DELETE FROM ".MAIN_DB_PREFIX."element_contact"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."element_contact";
$sql.= " WHERE element_id = ".$this->id; $sql.= " WHERE element_id = ".$this->id;
$sql.= " AND fk_c_type_contact IN (".$listId.")"; if ($listId)
$sql.= " AND fk_c_type_contact IN (".$listId.")";
dol_syslog(get_class($this)."::delete_linked_contact", LOG_DEBUG); dol_syslog(get_class($this)."::delete_linked_contact", LOG_DEBUG);
if ($this->db->query($sql)) if ($this->db->query($sql))