diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 2f6c474e632..8d862d3a9af 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -896,6 +896,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') 't.name'=>array('label'=>"Name", 'checked'=>1, 'position'=>10), 't.poste'=>array('label'=>"PostOrFunction", 'checked'=>1, 'position'=>20), 't.address'=>array('label'=>(empty($conf->dol_optimize_smallscreen) ? $langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email") : $langs->trans("Address")), 'checked'=>1, 'position'=>30), + 't.address'=>array('label'=>(empty($conf->dol_optimize_smallscreen) ? $langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email") : $langs->trans("Address")), 'checked'=>1, 'position'=>30), 't.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>40, 'class'=>'center'), ); // Extra fields diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index 8efe44db103..5bc114c2294 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -89,5 +89,18 @@ ALTER TABLE llx_projet ADD COLUMN usage_organize_event integer DEFAULT 0; UPDATE llx_projet set usage_opportunity = 1 WHERE fk_opp_status > 0; - - \ No newline at end of file +create table llx_societe_contact +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + datec datetime NULL, -- date de creation de l'enregistrement + statut smallint DEFAULT 5, -- 5 inactif, 4 actif + + element_id int NOT NULL, -- la reference de l'element. + fk_c_type_contact int NOT NULL, -- nature du contact. + fk_socpeople integer NOT NULL +)ENGINE=innodb; + +ALTER TABLE llx_societe_contact ADD UNIQUE INDEX idx_societe_contact_idx1 (element_id, fk_c_type_contact, fk_socpeople); + +ALTER TABLE llx_societe_contact ADD CONSTRAINT fk_societe_contact_fk_c_type_contact FOREIGN KEY (fk_c_type_contact) REFERENCES llx_c_type_contact(rowid); +ALTER TABLE llx_societe_contact ADD CONSTRAINT fk_societe_contact_fk_socpeople FOREIGN KEY (fk_socpeople) REFERENCES llx_socpeople(rowid); diff --git a/htdocs/install/mysql/tables/llx_societe_contact.key.sql b/htdocs/install/mysql/tables/llx_societe_contact.key.sql new file mode 100644 index 00000000000..1409e7edc24 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_societe_contact.key.sql @@ -0,0 +1,22 @@ +-- ======================================================================== +-- Copyright (C) 2019 Florian HENRY +-- +-- 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 +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- ======================================================================== + +ALTER TABLE llx_societe_contact ADD UNIQUE INDEX idx_societe_contact_idx1 (element_id, fk_c_type_contact, fk_socpeople); + +ALTER TABLE llx_societe_contact ADD CONSTRAINT fk_societe_contact_fk_c_type_contact FOREIGN KEY (fk_c_type_contact) REFERENCES llx_c_type_contact(rowid); +ALTER TABLE llx_societe_contact ADD CONSTRAINT fk_societe_contact_fk_socpeople FOREIGN KEY (fk_socpeople) REFERENCES llx_socpeople(rowid); diff --git a/htdocs/install/mysql/tables/llx_societe_contact.sql b/htdocs/install/mysql/tables/llx_societe_contact.sql new file mode 100644 index 00000000000..040f8ded124 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_societe_contact.sql @@ -0,0 +1,29 @@ +-- ======================================================================== +-- Copyright (C) 2019 Florian HENRY +-- +-- 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 +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- ======================================================================== + + +create table llx_societe_contact +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + datec datetime NULL, -- date de creation de l'enregistrement + statut smallint DEFAULT 5, -- 5 inactif, 4 actif + + element_id int NOT NULL, -- la reference de l'element. + fk_c_type_contact int NOT NULL, -- nature du contact. + fk_socpeople integer NOT NULL +)ENGINE=innodb;