diff --git a/htdocs/commonobject.class.php b/htdocs/commonobject.class.php index 1a69e3e21a4..5d89ae47c31 100644 --- a/htdocs/commonobject.class.php +++ b/htdocs/commonobject.class.php @@ -249,20 +249,21 @@ class CommonObject /** * \brief La liste des valeurs possibles de type de contacts - * \param source internal ou externam + * \param source internal ou external + * \param order Sort order by : code or rowid * \return array La liste des natures */ - function liste_type_contact($source) + function liste_type_contact($source, $order='code') { global $langs; $tab = array(); - $sql = "SELECT distinct tc.rowid, tc.code, tc.libelle"; + $sql = "SELECT DISTINCT tc.rowid, tc.code, tc.libelle"; $sql.= " FROM ".MAIN_DB_PREFIX."c_type_contact as tc"; - $sql.= " WHERE element='".$this->element."'"; - $sql.= " AND source='".$source."'"; - $sql.= " ORDER by tc.code"; + $sql.= " WHERE tc.element='".$this->element."'"; + $sql.= " AND tc.source='".$source."'"; + $sql.= " ORDER by tc.".$order; $resql=$this->db->query($sql); if ($resql) diff --git a/htdocs/html.formcompany.class.php b/htdocs/html.formcompany.class.php index b394cc2d281..98079a31409 100644 --- a/htdocs/html.formcompany.class.php +++ b/htdocs/html.formcompany.class.php @@ -534,15 +534,15 @@ class FormCompany /** * */ - function selectTypeContact($object, $defValue, $htmlname = 'type', $source) + function selectTypeContact($object, $defValue, $htmlname = 'type', $source, $order='code') { - $lesTypes = $object->liste_type_contact($source); - print '\n"; + $lesTypes = $object->liste_type_contact($source, $order); + print '\n"; } diff --git a/htdocs/install/mysql/data/llx_c_type_contact.sql b/htdocs/install/mysql/data/llx_c_type_contact.sql index 52233d1ae65..3eac9e208c4 100644 --- a/htdocs/install/mysql/data/llx_c_type_contact.sql +++ b/htdocs/install/mysql/data/llx_c_type_contact.sql @@ -41,14 +41,16 @@ insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) v insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (40, 'propal', 'external', 'BILLING', 'Contact client facturation propale', 1); insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (41, 'propal', 'external', 'CUSTOMER', 'Contact client suivi propale', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (80, 'project', 'internal', 'PROJECTLEADER', 'Chef de Projet', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (81, 'project', 'external', 'PROJECTLEADER', 'Chef de Projet', 1); - insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (50, 'facture', 'internal', 'SALESREPFOLL', 'Responsable suivi du paiement', 1); insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (60, 'facture', 'external', 'BILLING', 'Contact client facturation', 1); insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (61, 'facture', 'external', 'SHIPPING', 'Contact client livraison', 1); insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (62, 'facture', 'external', 'SERVICE', 'Contact client prestation', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (70, 'facture_fourn', 'internal', 'SALESREPFOLL', 'Responsable suivi du paiement', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (71, 'facture_fourn', 'external', 'BILLING', 'Contact fournisseur facturation', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (72, 'facture_fourn', 'external', 'SHIPPING', 'Contact fournisseur livraison', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (73, 'facture_fourn', 'external', 'SERVICE', 'Contact fournisseur prestation', 1); + insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (91, 'commande','internal', 'SALESREPFOLL', 'Responsable suivi de la commande', 1); insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (100,'commande','external', 'BILLING', 'Contact client facturation commande', 1); insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (101,'commande','external', 'CUSTOMER', 'Contact client suivi commande', 1); @@ -59,13 +61,18 @@ insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) v insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (130, 'fichinter','external', 'BILLING', 'Contact client facturation intervention', 1); insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (131, 'fichinter','external', 'CUSTOMER', 'Contact client suivi de l''intervention', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (70, 'facture_fourn', 'internal', 'SALESREPFOLL', 'Responsable suivi du paiement', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (71, 'facture_fourn', 'external', 'BILLING', 'Contact fournisseur facturation', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (72, 'facture_fourn', 'external', 'SHIPPING', 'Contact fournisseur livraison', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (73, 'facture_fourn', 'external', 'SERVICE', 'Contact fournisseur prestation', 1); - insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (140,'order_supplier','internal', 'SALESREPFOLL', 'Responsable suivi de la commande', 1); insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (141,'order_supplier','internal', 'SHIPPING', 'Responsable réception de la commande', 1); insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (142,'order_supplier','external', 'BILLING', 'Contact fournisseur facturation commande', 1); insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (143,'order_supplier','external', 'CUSTOMER', 'Contact fournisseur suivi commande', 1); insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (145,'order_supplier','external', 'SHIPPING', 'Contact fournisseur livraison commande', 1); + +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (160, 'project', 'internal', 'PROJECTLEADER', 'Chef de Projet', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (161, 'project', 'internal', 'CONTRIBUTOR', 'Intervenant', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (170, 'project', 'external', 'PROJECTLEADER', 'Chef de Projet', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (171, 'project', 'external', 'CONTRIBUTOR', 'Intervenant', 1); + +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (180, 'project_task', 'internal', 'TASKEXECUTIVE', 'Responsable', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (181, 'project_task', 'internal', 'CONTRIBUTOR', 'Intervenant', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (190, 'project_task', 'external', 'TASKEXECUTIVE', 'Responsable', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (191, 'project_task', 'external', 'CONTRIBUTOR', 'Intervenant', 1); diff --git a/htdocs/install/mysql/migration/2.7.0-2.8.0.sql b/htdocs/install/mysql/migration/2.7.0-2.8.0.sql index 9482560bd5d..0718e2c7dc4 100755 --- a/htdocs/install/mysql/migration/2.7.0-2.8.0.sql +++ b/htdocs/install/mysql/migration/2.7.0-2.8.0.sql @@ -125,3 +125,19 @@ ALTER TABLE llx_projet_task CHANGE statut fk_statut smallint DEFAULT 0 NOT NULL; ALTER TABLE llx_projet_task CHANGE note note_private text; ALTER TABLE llx_projet_task ADD COLUMN note_public text AFTER note_private; +ALTER TABLE llx_element_contact DROP FOREIGN KEY fk_element_contact_fk_c_type_contact; +ALTER TABLE llx_element_contact DROP INDEX fk_element_contact_fk_c_type_contact; +UPDATE llx_c_type_contact SET rowid='160' WHERE rowid='80'; +UPDATE llx_c_type_contact SET rowid='170' WHERE rowid='81'; +UPDATE llx_element_contact SET fk_c_type_contact='160' WHERE rowid='80'; +UPDATE llx_element_contact SET fk_c_type_contact='170' WHERE rowid='81'; +ALTER TABLE llx_element_contact ADD CONSTRAINT fk_element_contact_fk_c_type_contact FOREIGN KEY (fk_c_type_contact) REFERENCES llx_c_type_contact(rowid); + +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (161, 'project', 'internal', 'CONTRIBUTOR', 'Intervenant', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (171, 'project', 'external', 'CONTRIBUTOR', 'Intervenant', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (180, 'project_task', 'internal', 'TASKEXECUTIVE', 'Responsable', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (181, 'project_task', 'internal', 'CONTRIBUTOR', 'Intervenant', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (190, 'project_task', 'external', 'TASKEXECUTIVE', 'Responsable', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (191, 'project_task', 'external', 'CONTRIBUTOR', 'Intervenant', 1); + + diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 352c15df25b..04735a576e4 100755 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -63,5 +63,11 @@ ProjectContact=Project contacts ##### Types de contacts ##### TypeContact_project_internal_PROJECTLEADER=Project leader TypeContact_project_external_PROJECTLEADER=Project leader +TypeContact_project_internal_CONTRIBUTOR=Contributor +TypeContact_project_external_CONTRIBUTOR=Contributor +TypeContact_project_task_internal_TASKEXECUTIVE=Task executive +TypeContact_project_task_external_TASKEXECUTIVE=Task executive +TypeContact_project_task_internal_CONTRIBUTOR=Contributor +TypeContact_project_task_external_CONTRIBUTOR=Contributor # Documents models DocumentModelBaleine=A complete project's report model (logo...) diff --git a/htdocs/langs/fr_FR/projects.lang b/htdocs/langs/fr_FR/projects.lang index 53e9f957efc..500549d43ba 100755 --- a/htdocs/langs/fr_FR/projects.lang +++ b/htdocs/langs/fr_FR/projects.lang @@ -63,5 +63,11 @@ ProjectContact=Contacts projet ##### Types de contacts ##### TypeContact_project_internal_PROJECTLEADER=Chef de projet TypeContact_project_external_PROJECTLEADER=Chef de projet +TypeContact_project_internal_CONTRIBUTOR=Intervenant +TypeContact_project_external_CONTRIBUTOR=Intervenant +TypeContact_project_task_internal_TASKEXECUTIVE=Responsable +TypeContact_project_task_external_TASKEXECUTIVE=Responsable +TypeContact_project_task_internal_CONTRIBUTOR=Intervenant +TypeContact_project_task_external_CONTRIBUTOR=Intervenant # Documents models DocumentModelBaleine=Modèle de rapport de projet complet (logo...) diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index e79b9eda977..43e294370ba 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -248,7 +248,7 @@ if ($id > 0 || ! empty($ref)) $html->select_users($user->id,'contactid',0); print ''; print '