Adding a column for Document Links to the Activity table in CaseView
Finally, I solved the problem like this:

sites/all/modules/civicrm/templates/CRM/Case/Form/ActivityTab.tpl -&gt; add another cell to the activity table:
&lt;th data-data=&quot;document_links&quot; data-orderable=&quot;false&quot; class=&quot;crm-case-activities-status&quot;&gt;&amp;nbsp;Dokumente &lt;/th&gt;
sites/all/modules/civicrm/CRM/Case/Selector/Search.php -&gt; add the function addDocumentLinks() that is basically only the document-link part of the original function addCaseActivityLinks():

public static function addDocumentLinks($caseID, $contactID, $userID, $context, $dao, $allowView = TRUE) {
$caseDeleted = CRM_Core_DAO::getFieldValue('CRM_Case_DAO_Case', $caseID, 'is_deleted');
$actionLinks = self::actionLinks();
// Check logged in user for permission.
if (CRM_Case_BAO_Case::checkPermission($dao-&gt;id, 'view', $dao-&gt;activity_type_id, $userID)) {
$permissions[] = CRM_Core_Permission::VIEW;
  }
if (!$allowView) {
unset($actionLinks[CRM_Core_Action::VIEW]);
  }
$linksMarkup = &quot;&quot;;
// if there are file attachments we will return how many and, if only one, add a link to it
if (!empty($dao-&gt;attachment_ids)) {
$linksMarkup .= implode(' ', CRM_Core_BAO_File::paperIconAttachment('civicrm_activity', $dao-&gt;id));
  }
return $linksMarkup;
}


sites/all/modules/civicrm/CRM/Case/Selector/Search.php -&gt; delete the document-link part from the original function addCaseActivityLinks():

public static function addCaseActivityLinks($caseID, $contactID, $userID, $context, $dao, $allowView = TRUE) {
$caseDeleted = CRM_Core_DAO::getFieldValue('CRM_Case_DAO_Case', $caseID, 'is_deleted');
$actionLinks = self::actionLinks();
// Check logged in user for permission.
if (CRM_Case_BAO_Case::checkPermission($dao-&gt;id, 'view', $dao-&gt;activity_type_id, $userID)) {
$permissions[] = CRM_Core_Permission::VIEW;
  }
if (!$allowView) {
unset($actionLinks[CRM_Core_Action::VIEW]);
  }
if (!$dao-&gt;deleted) {
// Activity is not deleted, allow user to edit/delete if they have permission
    // hide Edit link if:
    // 1. User does not have edit permission.
    // 2. Activity type is NOT editable (special case activities).CRM-5871
if (CRM_Case_BAO_Case::checkPermission($dao-&gt;id, 'edit', $dao-&gt;activity_type_id, $userID)) {
$permissions[] = CRM_Core_Permission::EDIT;
    }
if (in_array($dao-&gt;activity_type_id, CRM_Activity_BAO_Activity::getViewOnlyActivityTypeIDs())) {
unset($actionLinks[CRM_Core_Action::UPDATE]);
    }
if (CRM_Case_BAO_Case::checkPermission($dao-&gt;id, 'delete', $dao-&gt;activity_type_id, $userID)) {
$permissions[] = CRM_Core_Permission::DELETE;
    }
unset($actionLinks[CRM_Core_Action::RENEW]);
  }
$extraMask = 0;
if ($dao-&gt;deleted &amp;&amp; !$caseDeleted
&amp;&amp; (CRM_Case_BAO_Case::checkPermission($dao-&gt;id, 'delete', $dao-&gt;activity_type_id, $userID))) {
// Case is not deleted but activity is.
    // Allow user to restore activity if they have delete permissions
unset($actionLinks[CRM_Core_Action::DELETE]);
$extraMask = CRM_Core_Action::RENEW;
  }
if (!CRM_Case_BAO_Case::checkPermission($dao-&gt;id, 'Move To Case', $dao-&gt;activity_type_id)) {
unset($actionLinks[CRM_Core_Action::DETACH]);
  }
if (!CRM_Case_BAO_Case::checkPermission($dao-&gt;id, 'Copy To Case', $dao-&gt;activity_type_id)) {
unset($actionLinks[CRM_Core_Action::COPY]);
  }
$actionMask = CRM_Core_Action::mask($permissions) | $extraMask;
$values = [
'aid' =&gt; $dao-&gt;id,
'cid' =&gt; $contactID,
'cxt' =&gt; empty($context) ? '' : &quot;&amp;context={$context}&quot;,
'caseid' =&gt; $caseID,
  ];
$linksMarkup = CRM_Core_Action::formLink($actionLinks,
$actionMask,
$values,
ts('more'),
FALSE,
'case.tab.row',
'Activity',
$dao-&gt;id
);

// deleted part

return $linksMarkup;
}


sites/all/modules/civicrm/CRM/Case/BAO/Case.php -&gt; add the function call for addDocumentLinks() inside the function getCaseActivity() inside the while loop while($dao-&gt;fetch()) { } (approx. line 1091):

$caseActivities[$caseActivityId]['document_links']
        = CRM_Case_Selector_Search::addDocumentLinks($caseID, $contactID, $userID, $context, $dao);