Compare commits

...

3 Commits

Author SHA1 Message Date
v-dumas
997dd0421f Remove useless revision # in XML tag 2026-06-26 08:15:43 +02:00
v-dumas
ecfa3fe937 N°9699 - Greptile feedbacks 2026-06-26 08:13:17 +02:00
v-dumas
fcea589a35 N°9699 - Enable AddMeToContact without write access on Ticket 2026-06-17 09:06:24 +02:00

View File

@@ -295,12 +295,13 @@
}
]]></code>
</method>
<method id="AddCurrentUserToContacts" _revision_id="294">
<method id="AddCurrentUserToContacts">
<comment>/**
*
* 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
* Must be called while the Ticket is not under modification by the current user
* Can fail if the person was linked to the Ticket by another user since the Ticket was last loaded by the current user (concurrent access)
* @return void
*/
</comment>
<static>false</static>
@@ -314,21 +315,19 @@
$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;
}]]></code>
<arguments/>
</method>
<method id="RemoveCurrentUserFromContacts" _revision_id="296">
<method id="RemoveCurrentUserFromContacts">
<comment>/**
*
* 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
* Must be called while the Ticket is not under modification by the current user
* Can fail if the person was removed from the Ticket by another user since the Ticket was last loaded by the current user (concurrent access)
* @return void
*/
</comment>
<static>false</static>
@@ -340,14 +339,10 @@
$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();
return true;
$oLnk->DBDelete();
}
}
}
return true;
}]]></code>
<arguments/>
</method>