.
This commit is contained in:
parent
9e71d491e6
commit
6cc872abd8
@ -217,7 +217,7 @@ if (empty($reshook) && $action == 'add') {
|
||||
}
|
||||
|
||||
// need to change this part
|
||||
$partnership->statut = 0;
|
||||
$partnership->status = 0;
|
||||
$partnership->firstname = GETPOST('firstname');
|
||||
$partnership->lastname = GETPOST('lastname');
|
||||
$partnership->address = GETPOST('address');
|
||||
@ -235,8 +235,8 @@ if (empty($reshook) && $action == 'add') {
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$sql = "SELECT nom FROM ".MAIN_DB_PREFIX."societe WHERE nom='".$db->escape(GETPOST('societe'))."'";
|
||||
// test if societe already exist
|
||||
$sql = "SELECT nom FROM ".MAIN_DB_PREFIX."societe WHERE nom='".GETPOST('societe')."'";
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
@ -258,6 +258,10 @@ if (empty($reshook) && $action == 'add') {
|
||||
$resql = $db->query($sql);
|
||||
$partnership->fk_soc = $company->id;
|
||||
}
|
||||
else {
|
||||
$don=$result->fetch();
|
||||
$partnership->fk_soc =$don['rowid'];
|
||||
}
|
||||
$result = $partnership->create($user);
|
||||
if ($result > 0) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||
@ -345,7 +349,6 @@ if (empty($reshook) && $action == 'add') {
|
||||
}
|
||||
}*/
|
||||
|
||||
// test if societe or email already exist
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user