In the CiviCRM Case View, I want to add another column to the Activities table. Right now, the last column contains some links ("View", "Edit", "Delete") and one link to an attached document if existent. I want to split this last column in two, so the link to attachments and the other links are in two different columns.
Therefore, I doubled the last column inside the sites/all/modules/civicrm/templates/CRM/Case/Form/ActivityTab.tpl template:
<th data-data="links" data-orderable="false" class="crm-case-activities-status"> </th>
<th data-data="links" data-orderable="false" class="crm-case-activities-status"> </th>
Then, I adapted the first column like this:
<th data-data="links" class="crm-case-activities-status"> Dokumente </th>
<th data-data="links" data-orderable="false" class="crm-case-activities-status"> </th>
Now, I am stuck at the content part. Does anyone know from which location "links" is called or created? I read that the html "data" attribute can be used by a JavaScript script. As I need only the links to any attached documents, but not the others, I would need to alter that script.
Edit: Alternatively, it would be helpful to know where the Activity table is created (<table id="case_id_{$caseid}" class="nestedActivitySelector crm-ajax-table" data-page-length="100">
).
Edit: Reading Demerit's answer, I have checked the addCaseActivityLinks() function. To adapt it for my documents column, I thought about copying the function, renaming it, adapting it, and make the ActivityTab.tpl call it inside my document tag.
Another solution would be to use an existing param of the addCaseActivityLinks() function in order to determine with which value of data-data the function has been called (data-data="links"
or data-data="documents"
). These existing params are: $caseID, $contactID, $userID, $context, $dao, $allowView = TRUE
I think I am still missing understanding of how/where the addCaseActivityLinks() function is called, so I would be able to implement one of the abovementioned solutions. I searched the whole project for a fucntion call, but couldn't find one. Any hint anyone?