Update Common Object update_contact method to allow to change the
fk_socppoeple linked
This commit is contained in:
parent
a171ecd2a2
commit
f456a4d0fe
@ -221,14 +221,16 @@ abstract class CommonObject
|
|||||||
* @param int $rowid Id of line contact-element
|
* @param int $rowid Id of line contact-element
|
||||||
* @param int $statut New status of link
|
* @param int $statut New status of link
|
||||||
* @param int $type_contact_id Id of contact type (not modified if 0)
|
* @param int $type_contact_id Id of contact type (not modified if 0)
|
||||||
|
* @param int $fk_socpeople Id of soc_people to update (not modified if 0)
|
||||||
* @return int <0 if KO, >= 0 if OK
|
* @return int <0 if KO, >= 0 if OK
|
||||||
*/
|
*/
|
||||||
function update_contact($rowid, $statut, $type_contact_id=0)
|
function update_contact($rowid, $statut, $type_contact_id=0, $fk_socpeople=0)
|
||||||
{
|
{
|
||||||
// Insertion dans la base
|
// Insertion dans la base
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."element_contact set";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."element_contact set";
|
||||||
$sql.= " statut = ".$statut;
|
$sql.= " statut = ".$statut;
|
||||||
if ($type_contact_id) $sql.= ", fk_c_type_contact = '".$type_contact_id ."'";
|
if ($type_contact_id) $sql.= ", fk_c_type_contact = '".$type_contact_id ."'";
|
||||||
|
if ($fk_socpeople) $sql.= ", fk_socpeople = '".$fk_socpeople ."'";
|
||||||
$sql.= " where rowid = ".$rowid;
|
$sql.= " where rowid = ".$rowid;
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
@ -3035,4 +3037,4 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
Loading…
Reference in New Issue
Block a user