瀏覽代碼

Allow to update ref_ext via webservices
See issue #17967

a-schild 4 年之前
父節點
當前提交
597e8ef671
共有 2 個文件被更改,包括 3 次插入0 次删除
  1. 2 0
      htdocs/contact/class/contact.class.php
  2. 1 0
      htdocs/webservices/server_contact.php

+ 2 - 0
htdocs/contact/class/contact.class.php

@@ -549,6 +549,7 @@ class Contact extends CommonObject
 		$this->fax = trim($this->fax);
 		$this->zip = (empty($this->zip) ? '' : trim($this->zip));
 		$this->town = (empty($this->town) ? '' : trim($this->town));
+		$this->ref_ext = trim($this->ref_ext);		
 		$this->setUpperOrLowerCase();
 		$this->country_id = ($this->country_id > 0 ? $this->country_id : $this->country_id);
 		if (empty($this->statut)) {
@@ -571,6 +572,7 @@ class Contact extends CommonObject
 		$sql .= ", address='".$this->db->escape($this->address)."'";
 		$sql .= ", zip='".$this->db->escape($this->zip)."'";
 		$sql .= ", town='".$this->db->escape($this->town)."'";
+		$sql .= ", ref_ext = ".(!empty($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'" : "null");
 		$sql .= ", fk_pays=".($this->country_id > 0 ? $this->country_id : 'NULL');
 		$sql .= ", fk_departement=".($this->state_id > 0 ? $this->state_id : 'NULL');
 		$sql .= ", poste='".$this->db->escape($this->poste)."'";

+ 1 - 0
htdocs/webservices/server_contact.php

@@ -626,6 +626,7 @@ function updateContact($authentication, $contact)
 		if (!empty($object->id)) {
 			$objectfound = true;
 
+			$object->ref_ext = $contact['ref_ext'];
 
 			$object->firstname = $contact['firstname'];
 			$object->lastname = $contact['lastname'];