mirror of
https://github.com/Combodo/iTop.git
synced 2026-06-26 17:56:40 +02:00
Compare commits
3 Commits
feature/96
...
feature/96
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
997dd0421f | ||
|
|
ecfa3fe937 | ||
|
|
fcea589a35 |
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user