Compare commits

...

1 Commits

Author SHA1 Message Date
v-dumas
fcea589a35 N°9699 - Enable AddMeToContact without write access on Ticket 2026-06-17 09:06:24 +02:00

View File

@@ -300,7 +300,7 @@
*
* Add the current contact associated Person to the contacts_list of this Ticket
* No error if there is no associated Person or if the Person is already in the list
* @return bool Return true on success
* @return bool Return true if link was created, false otherwise
*/
</comment>
<static>false</static>
@@ -314,12 +314,11 @@
$oLnk = MetaModel::NewObject('lnkContactToTicket');
$oLnk->Set('contact_id', $iPersonId);
$oLnk->Set('ticket_id', $this->GetKey());
$oContactsSet->AddItem($oLnk);
$this->Set('contacts_list', $oContactsSet);
$this->DBUpdate();
$oLnk->DBInsert();
return true;
}
}
return true;
return false;
}]]></code>
<arguments/>
</method>
@@ -328,7 +327,7 @@
*
* Remove the current user associated Person from the contacts_list of this Ticket
* No error if there is no associated Person or if the Person is not in the list
* @return bool Return true
* @return bool Return true if link was deleted, false otherwise
*/
</comment>
<static>false</static>
@@ -340,14 +339,12 @@
$oContactsSet = $this->Get('contacts_list');
foreach ($oContactsSet as $oLnk) {
if ($oLnk->Get('contact_id') == $iPersonId) {
$oContactsSet->RemoveItem($oLnk->GetKey());
$this->Set('contacts_list', $oContactsSet);
$this->DBUpdate();
$oLnk->DBDelete();
return true;
}
}
}
return true;
return false;
}]]></code>
<arguments/>
</method>