1

I would like to change two aspects of the Activities table on the Civicase summary screen.

  1. Change the default number of rows to be shown from 10 -> 100
  2. Also have a filter to automatically hide the actvity 'edit custom data' which is created whenever any custom data relating to the case is updated. This is especially relevant as i'm using Multiple case clients and this seems to create 3 instances of the activity 'change custom data' (if there are 3 clients) for each single edit of the data.

For number 1, I've looked into the templates and have so far found the template . /CRM/Case/Page/CaseDetails.tpl is being called. I think the bit concerned is {foreach from $rows item row} ,

I've not got to point 2 yet.

Any answers or guidance very much appreciated.

4 Answers 4

1

Point 1 is probably not the part, that just reads from the array $rows. I think you have to go to CRM/Case/Form/CaseView.tpl and change the 10 in here to 100:

  oTable = cj('#activities-selector').dataTable({
    "bFilter"    : false,
    "bAutoWidth" : false,
    "aaSorting"  : [],
    "aoColumns"  : columns,
    "bProcessing": true,
    "bJQueryUI": true,
    "asStripClasses" : [ "odd-row", "even-row" ],
    "sPaginationType": "full_numbers",
    "sDom"       : '<"crm-datatable-pager-top"lfp>rt<"crm-datatable-pager-bottom"ip>',
    "bServerSide": true,
    "sAjaxSource": sourceUrl,
    "iDisplayLength": 10,
    "fnDrawCallback": function() { setSelectorClass(); },
    "fnServerData": function ( sSource, aoData, fnCallback ) {

      if ( filterSearch ) {
        var activity_deleted = 0;
        if ( cj("#activity_deleted:checked").val() == 1 ) {
          activity_deleted = 1;
        }
        aoData.push(
          {name:'status_id', value: cj("select#status_id").val()},
          {name:'activity_type_id', value: cj("select#activity_type_filter_id").val()},
          {name:'activity_date_low', value: cj("#activity_date_low").val()},
          {name:'activity_date_high', value: cj("#activity_date_high").val() },
          {name:'activity_deleted', value: activity_deleted }
        );
      }
      cj.ajax( {
        "dataType": 'json',
        "type": "POST",
        "url": sSource,
        "data": aoData,
        "success": fnCallback
      } );

But try! And it is best to modify this in an extension. The same for number two, identify the button and hiding it in a specific template which you add with a combination of buildForm or pageRun hook and CRM_Core_Region like so:

CRM_Core_Region::instance('page-body')->add(array(
    'template' => 'yourtemplate.tpl'
1

For point 1 i found that the code was in CRM/Case/Form/ActivityTab.tpl which i believe is called from CRM/Case/Form/CaseView.tpl

I changed the figure from 10 in here to 100:

oTable = $('#case_id_'+CaseId).dataTable({
 "bFilter": false, 
...
...
 "sAjaxSource": sourceUrl,
 "iDisplayLength": 100,   
 "bDestro": true
...
...
0

I'm trying to make the same change in 4.7, but everything seems to have changed. Where should I be looking now for these CiviCase activity table display tweaks? Thanks.

0

Point one has been addressed by this improvement which will remember users' preference about how many rows to display (using local browser storage, so works even between sessions).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.