Skip to content

Commit

Permalink
refactor(abstractitiltarget): remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Aug 1, 2023
1 parent 22cd739 commit 55cfa80
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions inc/abstractitiltarget.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -738,34 +738,6 @@ protected function addGroupActor($role, $group) {
return true;
}

/**
* Attach documents of the answer to the target
*/
protected function attachDocument($formAnswerId, $itemtype, $targetID) {
global $CFG_GLPI;

$docItem = new Document_Item();
if (count($this->attachedDocuments) <= 0) {
return;
}

foreach ($this->attachedDocuments as $documentID => $dummy) {
$docItem->add([
'documents_id' => $documentID,
'itemtype' => $itemtype,
'items_id' => $targetID,
]);
if ($itemtype === Ticket::class) {
$document = new Document();
$documentCategoryFk = DocumentCategory::getForeignKeyField();
$document->update([
'id' => $documentID,
$documentCategoryFk => $CFG_GLPI["documentcategories_id_forticket"],
]);
}
}
}

public function addAttachedDocument($documentId) {
$this->attachedDocuments[$documentId] = true;
}
Expand Down

0 comments on commit 55cfa80

Please sign in to comment.