FIX: delete all contact categories
Delete all contact categories is not necessary on contact card. Current function setCategories will do it when necessary.
This commit is contained in:
parent
2225d0a41e
commit
932e5ef0b5
@ -9,6 +9,7 @@
|
|||||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
|
* Copyright (C) 2019 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -40,9 +41,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT. '/core/class/html.form.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('companies', 'users', 'other', 'commercial'));
|
$langs->loadLangs(array('companies', 'users', 'other', 'commercial'));
|
||||||
@ -378,12 +379,6 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
// Categories association
|
// Categories association
|
||||||
// First we delete all categories association
|
|
||||||
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . 'categorie_contact';
|
|
||||||
$sql .= ' WHERE fk_socpeople = ' . $object->id;
|
|
||||||
$db->query($sql);
|
|
||||||
|
|
||||||
// Then we add the associated categories
|
|
||||||
$categories = GETPOST('contcats', 'array');
|
$categories = GETPOST('contcats', 'array');
|
||||||
$object->setCategories($categories);
|
$object->setCategories($categories);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user