From 05e0af0f23f7db59a5bc2514fa661ddf84c864b4 Mon Sep 17 00:00:00 2001 From: Florian Henry Date: Thu, 14 Nov 2013 19:41:27 +0100 Subject: [PATCH] WebService contact with statut (the new field) --- htdocs/contact/class/contact.class.php | 1 + htdocs/webservices/server_contact.php | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index ef2cfba8480..39cc96a9f32 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -119,6 +119,7 @@ class Contact extends CommonObject if (! empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname=ucwords($this->firstname); if (! $this->socid) $this->socid = 0; if (! $this->priv) $this->priv = 0; + if (empty($this->statut)) $this->statut = 0; $sql = "INSERT INTO ".MAIN_DB_PREFIX."socpeople ("; $sql.= " datec"; diff --git a/htdocs/webservices/server_contact.php b/htdocs/webservices/server_contact.php index a4538772e1a..126e4202018 100644 --- a/htdocs/webservices/server_contact.php +++ b/htdocs/webservices/server_contact.php @@ -113,7 +113,8 @@ $contact_fields = array( 'user_id' => array('name'=>'user_id','type'=>'xsd:string'), 'user_login' => array('name'=>'user_login','type'=>'xsd:string'), 'civility_id' => array('name'=>'civility_id','type'=>'xsd:string'), - 'poste' => array('name'=>'poste','type'=>'xsd:string') + 'poste' => array('name'=>'poste','type'=>'xsd:string'), + 'statut' => array('name'=>'statut','type'=>'xsd:string') //... ); //Retreive all extrafield for contact @@ -302,7 +303,8 @@ function getContact($authentication,$id,$ref='',$ref_ext='') 'user_id' => $contact->user_id, 'user_login' => $contact->user_login, 'civilite_id' => $contact->civility_id, - 'poste' => $contact->poste + 'poste' => $contact->poste, + 'statut' => $contact->statut ); //Retreive all extrafield for thirdsparty @@ -412,6 +414,7 @@ function createContact($authentication,$contact) $newobject->user_id=$contact['user_id']; $newobject->user_login=$contact['user_login']; $newobject->poste=$contact['poste']; + $newobject->statut=$contact['statut']; //Retreive all extrafield for thirdsparty // fetch optionals attributes and labels @@ -488,7 +491,7 @@ function getContactsForThirdParty($authentication,$idthirdparty) { $linesinvoice=array(); - $sql = "SELECT c.rowid, c.fk_soc, c.civilite as civility_id, c.lastname, c.firstname,"; + $sql = "SELECT c.rowid, c.fk_soc, c.civilite as civility_id, c.lastname, c.firstname, c.statut,"; $sql.= " c.address, c.zip, c.town,"; $sql.= " c.fk_pays as country_id,"; $sql.= " c.fk_departement,"; @@ -565,7 +568,8 @@ function getContactsForThirdParty($authentication,$idthirdparty) 'ref_commande' => $contact->ref_commande?$contact->ref_commande:'', 'ref_propal' => $contact->ref_propal?$contact->ref_propal:'', 'user_id' => $contact->user_id?$contact->user_id:'', - 'user_login' => $contact->no_email?$contact->user_login:'' + 'user_login' => $contact->user_login?$contact->user_login:'', + 'statut' => $contact->statut?$contact->statut:'' @@ -659,6 +663,8 @@ function updateContact($authentication,$contact) $object->civilite_id=$contact['civility_id']; $object->poste=$contact['poste']; + $object->statut=$contact['statut']; + //Retreive all extrafield for contact // fetch optionals attributes and labels