From bd1acca2cd029563418f4d056c6dcc60c31f0690 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 10 Jan 2018 12:38:12 +0100 Subject: [PATCH 1/5] Fix: wrong entity with multicompany thirdparty sharing --- htdocs/contact/card.php | 105 +++++++++++++------------ htdocs/contact/class/contact.class.php | 29 +++---- 2 files changed, 69 insertions(+), 65 deletions(-) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index dc6d19614f9..12dc4ac3e9d 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004-2005 Rodolphe Quiedeville * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2013 Florian Henry * Copyright (C) 2013-2016 Alexandre Spangaro @@ -50,8 +50,8 @@ $langs->load("commercial"); $mesg=''; $error=0; $errors=array(); $action = (GETPOST('action','alpha') ? GETPOST('action','alpha') : 'view'); -$confirm = GETPOST('confirm','alpha'); -$backtopage = GETPOST('backtopage','alpha'); +$confirm = GETPOST('confirm','alpha'); +$backtopage = GETPOST('backtopage','alpha'); $id = GETPOST('id','int'); $socid = GETPOST('socid','int'); @@ -137,63 +137,64 @@ if (empty($reshook)) } - // Confirmation desactivation - if ($action == 'disable') - { - $object->fetch($id); - if ($object->setstatus(0)<0) - { - setEventMessages($object->error, $object->errors, 'errors'); - } - else - { - header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); - exit; - } - } + // Confirmation desactivation + if ($action == 'disable') + { + $object->fetch($id); + if ($object->setstatus(0)<0) + { + setEventMessages($object->error, $object->errors, 'errors'); + } + else + { + header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); + exit; + } + } - // Confirmation activation - if ($action == 'enable') - { - $object->fetch($id); - if ($object->setstatus(1)<0) - { - setEventMessages($object->error, $object->errors, 'errors'); - } - else - { - header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); - exit; - } - } + // Confirmation activation + if ($action == 'enable') + { + $object->fetch($id); + if ($object->setstatus(1)<0) + { + setEventMessages($object->error, $object->errors, 'errors'); + } + else + { + header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); + exit; + } + } - // Add contact - if ($action == 'add' && $user->rights->societe->contact->creer) - { - $db->begin(); + // Add contact + if ($action == 'add' && $user->rights->societe->contact->creer) + { + $db->begin(); if ($canvas) $object->canvas=$canvas; + $object->entity = (GETPOSTISSET('entity')?GETPOST('entity', 'int'):$conf->entity); $object->socid = GETPOST("socid",'int'); $object->lastname = GETPOST("lastname"); $object->firstname = GETPOST("firstname"); - $object->civility_id = GETPOST("civility_id",'alpha'); + $object->civility_id = GETPOST("civility_id",'alpha'); $object->poste = GETPOST("poste"); - $object->address = GETPOST("address"); - $object->zip = GETPOST("zipcode"); + $object->address = GETPOST("address"); + $object->zip = GETPOST("zipcode"); $object->town = GETPOST("town"); $object->country_id = GETPOST("country_id",'int'); - $object->state_id = GETPOST("state_id",'int'); + $object->state_id = GETPOST("state_id",'int'); $object->skype = GETPOST("skype"); $object->email = GETPOST("email",'alpha'); $object->phone_pro = GETPOST("phone_pro"); - $object->phone_perso = GETPOST("phone_perso"); + $object->phone_perso = GETPOST("phone_perso"); $object->phone_mobile = GETPOST("phone_mobile"); - $object->fax = GETPOST("fax"); + $object->fax = GETPOST("fax"); $object->jabberid = GETPOST("jabberid",'alpha'); $object->no_email = GETPOST("no_email",'int'); $object->priv = GETPOST("priv",'int'); - $object->note_public = GETPOST("note_public"); + $object->note_public = GETPOST("note_public"); $object->note_private = GETPOST("note_private"); $object->statut = 1; //Defult status to Actif @@ -347,26 +348,26 @@ if (empty($reshook)) $object->socid = GETPOST("socid",'int'); $object->lastname = GETPOST("lastname"); $object->firstname = GETPOST("firstname"); - $object->civility_id = GETPOST("civility_id",'alpha'); + $object->civility_id = GETPOST("civility_id",'alpha'); $object->poste = GETPOST("poste"); - $object->address = GETPOST("address"); - $object->zip = GETPOST("zipcode"); + $object->address = GETPOST("address"); + $object->zip = GETPOST("zipcode"); $object->town = GETPOST("town"); - $object->state_id = GETPOST("state_id",'int'); + $object->state_id = GETPOST("state_id",'int'); $object->fk_departement = GETPOST("state_id",'int'); // For backward compatibility $object->country_id = GETPOST("country_id",'int'); $object->email = GETPOST("email",'alpha'); $object->skype = GETPOST("skype",'alpha'); $object->phone_pro = GETPOST("phone_pro"); - $object->phone_perso = GETPOST("phone_perso"); + $object->phone_perso = GETPOST("phone_perso"); $object->phone_mobile = GETPOST("phone_mobile"); - $object->fax = GETPOST("fax"); + $object->fax = GETPOST("fax"); $object->jabberid = GETPOST("jabberid",'alpha'); $object->no_email = GETPOST("no_email",'int'); $object->priv = GETPOST("priv",'int'); - $object->note_public = GETPOST("note_public"); + $object->note_public = GETPOST("note_public"); $object->note_private = GETPOST("note_private"); // Fill array 'array_options' with data from add form @@ -531,12 +532,14 @@ else print ''; print ''; print ''; + if (! empty($objsoc)) { + print ''; + } dol_fiche_head($head, 'card', '', 0, ''); print ''; - // Name print ''; print ''; @@ -673,7 +676,7 @@ else } // Other attributes - $parameters=array('colspan' => ' colspan="3"','cols'=>3); + $parameters=array('socid' => $socid, 'objsoc' => $objsoc, 'colspan' => ' colspan="3"', 'cols' => 3); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 08fe253dffd..ca4880d68b8 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -187,7 +187,7 @@ class Contact extends CommonObject $sql.= ", statut"; $sql.= ", canvas"; $sql.= ", entity"; - $sql.= ",ref_ext"; + $sql.= ", ref_ext"; $sql.= ", import_key"; $sql.= ") VALUES ("; $sql.= "'".$this->db->idate($now)."',"; @@ -199,7 +199,7 @@ class Contact extends CommonObject $sql.= " ".$this->priv.","; $sql.= " ".$this->statut.","; $sql.= " ".(! empty($this->canvas)?"'".$this->db->escape($this->canvas)."'":"null").","; - $sql.= " ".$conf->entity.","; + $sql.= " ".$this->entity.","; $sql.= "'".$this->db->escape($this->ref_ext)."',"; $sql.= " ".(! empty($this->import_key)?"'".$this->db->escape($this->import_key)."'":"null"); $sql.= ")"; @@ -642,7 +642,7 @@ class Contact extends CommonObject $langs->load("companies"); - $sql = "SELECT c.rowid, c.fk_soc, c.ref_ext, c.civility as civility_id, c.lastname, c.firstname,"; + $sql = "SELECT c.rowid, c.entity, c.fk_soc, c.ref_ext, c.civility as civility_id, c.lastname, c.firstname,"; $sql.= " c.address, c.statut, c.zip, c.town,"; $sql.= " c.fk_pays as country_id,"; $sql.= " c.fk_departement,"; @@ -671,41 +671,42 @@ class Contact extends CommonObject $obj = $this->db->fetch_object($resql); $this->id = $obj->rowid; + $this->entity = $obj->entity; $this->ref = $obj->rowid; $this->ref_ext = $obj->ref_ext; $this->civility_id = $obj->civility_id; - $this->civility_code = $obj->civility_id; + $this->civility_code = $obj->civility_id; $this->lastname = $obj->lastname; - $this->firstname = $obj->firstname; + $this->firstname = $obj->firstname; $this->address = $obj->address; $this->zip = $obj->zip; $this->town = $obj->town; $this->fk_departement = $obj->fk_departement; // deprecated $this->state_id = $obj->fk_departement; - $this->departement_code = $obj->state_code; // deprecated - $this->state_code = $obj->state_code; + $this->departement_code = $obj->state_code; // deprecated + $this->state_code = $obj->state_code; $this->departement = $obj->state; // deprecated - $this->state = $obj->state; + $this->state = $obj->state; $this->country_id = $obj->country_id; $this->country_code = $obj->country_id?$obj->country_code:''; $this->country = $obj->country_id?($langs->trans('Country'.$obj->country_code)!='Country'.$obj->country_code?$langs->transnoentities('Country'.$obj->country_code):$obj->country):''; - $this->socid = $obj->fk_soc; + $this->socid = $obj->fk_soc; $this->socname = $obj->socname; - $this->poste = $obj->poste; + $this->poste = $obj->poste; $this->statut = $obj->statut; - $this->phone_pro = trim($obj->phone); + $this->phone_pro = trim($obj->phone); $this->fax = trim($obj->fax); $this->phone_perso = trim($obj->phone_perso); $this->phone_mobile = trim($obj->phone_mobile); - $this->email = $obj->email; + $this->email = $obj->email; $this->jabberid = $obj->jabberid; - $this->skype = $obj->skype; - $this->photo = $obj->photo; + $this->skype = $obj->skype; + $this->photo = $obj->photo; $this->priv = $obj->priv; $this->mail = $obj->email; From 4cc0e889c1bee83b43826741b9f221285d24ef68 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 10 Jan 2018 12:38:27 +0100 Subject: [PATCH 2/5] Fix: restore broken feature --- htdocs/societe/card.php | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index e5c548d40a7..2f3e42f62ac 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2477,11 +2477,11 @@ else print $formfile->showdocuments('company', $object->id, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 0, 0, 0, 28, 0, 'entity='.$object->entity, 0, '', $object->default_lang); } - // Subsidiaries list - if (empty($conf->global->SOCIETE_DISABLE_SUBSIDIARIES)) - { - $result=show_subsidiaries($conf,$langs,$db,$object); - } + // Subsidiaries list + if (empty($conf->global->SOCIETE_DISABLE_SUBSIDIARIES)) + { + $result=show_subsidiaries($conf,$langs,$db,$object); + } print '
'; @@ -2497,6 +2497,21 @@ else $somethingshown = $formactions->showactions($object, '', $socid, 1, '', $MAXEVENT, '', $morehtmlright); // Show all action for thirdparty print '
'; + + if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) + { + // Contacts list + if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) + { + $result=show_contacts($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); + } + + // Addresses list + if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT)) + { + $result=show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); + } + } } // Presend form From 4683a35532b63219ea6268f308bd7fe4efdecfc1 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 10 Jan 2018 12:52:30 +0100 Subject: [PATCH 3/5] Fix: wrong image path with multicompany sharing --- htdocs/contact/card.php | 14 ++++++-------- htdocs/contact/document.php | 7 ++++--- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 12dc4ac3e9d..bc0031b5992 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -279,15 +279,13 @@ if (empty($reshook)) $action = 'edit'; } + if (! $error) + { + $contactid=GETPOST("contactid",'int'); + $object->fetch($contactid); - if (! $error) - { - $contactid=GETPOST("contactid",'int'); - - $object->fetch($contactid); - - // Photo save - $dir = $conf->societe->dir_output."/contact/".$object->id."/photos"; + // Photo save + $dir = $conf->societe->multidir_output[$object->entity]."/contact/".$object->id."/photos"; $file_OK = is_uploaded_file($_FILES['photo']['tmp_name']); if (GETPOST('deletephoto') && $object->photo) { diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php index a016fa87b31..37b2436c226 100644 --- a/htdocs/contact/document.php +++ b/htdocs/contact/document.php @@ -1,6 +1,7 @@ - * Copyright (C) 2015 Frederic France +/* Copyright (C) 2014 Alexandre Spangaro + * Copyright (C) 2015 Frederic France + * Copyright (C) 2017 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -69,7 +70,7 @@ if (! $sortfield) $sortfield="name"; if ($id > 0) $object->fetch($id); -$upload_dir = $conf->societe->dir_output.'/contact/'.dol_sanitizeFileName($object->ref); +$upload_dir = $conf->societe->multidir_output[$object->entity].'/contact/'.dol_sanitizeFileName($object->ref); $modulepart='contact'; From 8c3b4f62db33508f3d1938cef30f1ef312e110f1 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 10 Jan 2018 13:30:57 +0100 Subject: [PATCH 4/5] Fix: wrong entity with thirdparty sharing --- htdocs/societe/card.php | 129 +++++++++++++------------ htdocs/societe/class/societe.class.php | 2 +- 2 files changed, 66 insertions(+), 65 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 2f3e42f62ac..fa5f20b094e 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -3,7 +3,7 @@ * Copyright (C) 2003 Brian Fraval * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005 Eric Seigne - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2008 Patrick Raguin * Copyright (C) 2010-2016 Juanjo Menent * Copyright (C) 2011-2013 Alexandre Spangaro @@ -56,9 +56,9 @@ if (! empty($conf->notification->enabled)) $langs->load("mails"); $mesg=''; $error=0; $errors=array(); $action = (GETPOST('action','aZ09') ? GETPOST('action','aZ09') : 'view'); -$cancel = GETPOST('cancel','alpha'); -$backtopage = GETPOST('backtopage','alpha'); -$confirm = GETPOST('confirm'); +$cancel = GETPOST('cancel','alpha'); +$backtopage = GETPOST('backtopage','alpha'); +$confirm = GETPOST('confirm'); $socid = GETPOST('socid','int')?GETPOST('socid','int'):GETPOST('id','int'); if ($user->societe_id) $socid=$user->societe_id; @@ -351,82 +351,83 @@ if (empty($reshook)) if (! $error) { - if ($action == 'update') + if ($action == 'update') { - $ret=$object->fetch($socid); + $ret=$object->fetch($socid); $object->oldcopy = clone $object; } else $object->canvas=$canvas; if (GETPOST("private") == 1) // Ask to create a contact { - $object->particulier = GETPOST("private"); + $object->particulier = GETPOST("private"); - $object->name = dolGetFirstLastname(GETPOST('firstname','alpha'),GETPOST('name','alpha')); - $object->civility_id = GETPOST('civility_id'); // Note: civility id is a code, not an int + $object->name = dolGetFirstLastname(GETPOST('firstname','alpha'),GETPOST('name','alpha')); + $object->civility_id = GETPOST('civility_id'); // Note: civility id is a code, not an int // Add non official properties - $object->name_bis = GETPOST('name','alpha'); - $object->firstname = GETPOST('firstname','alpha'); + $object->name_bis = GETPOST('name','alpha'); + $object->firstname = GETPOST('firstname','alpha'); } else { - $object->name = GETPOST('name', 'alpha'); + $object->name = GETPOST('name', 'alpha'); } - $object->name_alias = GETPOST('name_alias'); - $object->address = GETPOST('address'); - $object->zip = GETPOST('zipcode', 'alpha'); - $object->town = GETPOST('town', 'alpha'); - $object->country_id = GETPOST('country_id', 'int'); - $object->state_id = GETPOST('state_id', 'int'); - $object->skype = GETPOST('skype', 'alpha'); - $object->phone = GETPOST('phone', 'alpha'); - $object->fax = GETPOST('fax','alpha'); - $object->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL)); - $object->url = trim(GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL)); - $object->idprof1 = trim(GETPOST('idprof1', 'alpha')); - $object->idprof2 = trim(GETPOST('idprof2', 'alpha')); - $object->idprof3 = trim(GETPOST('idprof3', 'alpha')); - $object->idprof4 = trim(GETPOST('idprof4', 'alpha')); - $object->idprof5 = trim(GETPOST('idprof5', 'alpha')); - $object->idprof6 = trim(GETPOST('idprof6', 'alpha')); - $object->prefix_comm = GETPOST('prefix_comm', 'alpha'); - $object->code_client = GETPOST('code_client', 'alpha'); - $object->code_fournisseur = GETPOST('code_fournisseur', 'alpha'); - $object->capital = GETPOST('capital', 'alpha'); - $object->barcode = GETPOST('barcode', 'alpha'); + $object->entity = (GETPOSTISSET('entity')?GETPOST('entity', 'int'):$conf->entity); + $object->name_alias = GETPOST('name_alias'); + $object->address = GETPOST('address'); + $object->zip = GETPOST('zipcode', 'alpha'); + $object->town = GETPOST('town', 'alpha'); + $object->country_id = GETPOST('country_id', 'int'); + $object->state_id = GETPOST('state_id', 'int'); + $object->skype = GETPOST('skype', 'alpha'); + $object->phone = GETPOST('phone', 'alpha'); + $object->fax = GETPOST('fax','alpha'); + $object->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL)); + $object->url = trim(GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL)); + $object->idprof1 = trim(GETPOST('idprof1', 'alpha')); + $object->idprof2 = trim(GETPOST('idprof2', 'alpha')); + $object->idprof3 = trim(GETPOST('idprof3', 'alpha')); + $object->idprof4 = trim(GETPOST('idprof4', 'alpha')); + $object->idprof5 = trim(GETPOST('idprof5', 'alpha')); + $object->idprof6 = trim(GETPOST('idprof6', 'alpha')); + $object->prefix_comm = GETPOST('prefix_comm', 'alpha'); + $object->code_client = GETPOST('code_client', 'alpha'); + $object->code_fournisseur = GETPOST('code_fournisseur', 'alpha'); + $object->capital = GETPOST('capital', 'alpha'); + $object->barcode = GETPOST('barcode', 'alpha'); - $object->tva_intra = GETPOST('tva_intra', 'alpha'); - $object->tva_assuj = GETPOST('assujtva_value', 'alpha'); - $object->status = GETPOST('status', 'alpha'); + $object->tva_intra = GETPOST('tva_intra', 'alpha'); + $object->tva_assuj = GETPOST('assujtva_value', 'alpha'); + $object->status = GETPOST('status', 'alpha'); // Local Taxes - $object->localtax1_assuj = GETPOST('localtax1assuj_value', 'alpha'); - $object->localtax2_assuj = GETPOST('localtax2assuj_value', 'alpha'); + $object->localtax1_assuj = GETPOST('localtax1assuj_value', 'alpha'); + $object->localtax2_assuj = GETPOST('localtax2assuj_value', 'alpha'); - $object->localtax1_value = GETPOST('lt1', 'alpha'); - $object->localtax2_value = GETPOST('lt2', 'alpha'); + $object->localtax1_value = GETPOST('lt1', 'alpha'); + $object->localtax2_value = GETPOST('lt2', 'alpha'); - $object->forme_juridique_code = GETPOST('forme_juridique_code', 'int'); - $object->effectif_id = GETPOST('effectif_id', 'int'); - $object->typent_id = GETPOST('typent_id','int'); + $object->forme_juridique_code = GETPOST('forme_juridique_code', 'int'); + $object->effectif_id = GETPOST('effectif_id', 'int'); + $object->typent_id = GETPOST('typent_id','int'); - $object->typent_code = dol_getIdFromCode($db, $object->typent_id, 'c_typent', 'id', 'code'); // Force typent_code too so check in verify() will be done on new type + $object->typent_code = dol_getIdFromCode($db, $object->typent_id, 'c_typent', 'id', 'code'); // Force typent_code too so check in verify() will be done on new type - $object->client = GETPOST('client', 'int'); - $object->fournisseur = GETPOST('fournisseur', 'int'); + $object->client = GETPOST('client', 'int'); + $object->fournisseur = GETPOST('fournisseur', 'int'); - $object->commercial_id = GETPOST('commercial_id', 'int'); - $object->default_lang = GETPOST('default_lang'); + $object->commercial_id = GETPOST('commercial_id', 'int'); + $object->default_lang = GETPOST('default_lang'); // Webservices url/key - $object->webservices_url = GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL); - $object->webservices_key = GETPOST('webservices_key', 'san_alpha'); + $object->webservices_url = GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL); + $object->webservices_key = GETPOST('webservices_key', 'san_alpha'); // Incoterms if (!empty($conf->incoterm->enabled)) { - $object->fk_incoterms = GETPOST('incoterm_id', 'int'); - $object->location_incoterms = GETPOST('location_incoterms', 'alpha'); + $object->fk_incoterms = GETPOST('incoterm_id', 'int'); + $object->location_incoterms = GETPOST('location_incoterms', 'alpha'); } // Multicurrency @@ -499,17 +500,17 @@ if (empty($reshook)) $result = $object->create($user); if ($result >= 0) - { - if ($object->particulier) - { - dol_syslog("We ask to create a contact/address too", LOG_DEBUG); - $result=$object->create_individual($user); - if ($result < 0) - { - setEventMessages($object->error, $object->errors, 'errors'); - $error++; - } - } + { + if ($object->particulier) + { + dol_syslog("We ask to create a contact/address too", LOG_DEBUG); + $result=$object->create_individual($user); + if ($result < 0) + { + setEventMessages($object->error, $object->errors, 'errors'); + $error++; + } + } // Customer categories association $custcats = GETPOST('custcats', 'array'); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 9f8c57d145f..d17f9a266e4 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -472,7 +472,7 @@ class Societe extends CommonObject if ($result >= 0) { $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe (nom, name_alias, entity, datec, fk_user_creat, canvas, status, ref_int, ref_ext, fk_stcomm, fk_incoterms, location_incoterms ,import_key, fk_multicurrency, multicurrency_code)"; - $sql.= " VALUES ('".$this->db->escape($this->name)."', '".$this->db->escape($this->name_alias)."', ".$conf->entity.", '".$this->db->idate($now)."'"; + $sql.= " VALUES ('".$this->db->escape($this->name)."', '".$this->db->escape($this->name_alias)."', ".$this->entity.", '".$this->db->idate($now)."'"; $sql.= ", ".(! empty($user->id) ? "'".$user->id."'":"null"); $sql.= ", ".(! empty($this->canvas) ? "'".$this->db->escape($this->canvas)."'":"null"); $sql.= ", ".$this->status; From a11cb8dcbf1a3fdf5a6d0414cbed47581e25f722 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Jan 2018 01:06:50 +0100 Subject: [PATCH 5/5] Update card.php --- htdocs/societe/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index fa5f20b094e..2dc70b74c7d 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2499,7 +2499,7 @@ else print ''; - if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) + if (! empty($conf->global->MAIN_DUPLICATE_CONTACTS_TAB_ON_MAIN_CARD)) { // Contacts list if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
lastname).'" autofocus="autofocus">