Show more Case fields in Advanced Open Portal

Hello,

I was looking for a way to show some extra fields for every case shown in the Advanced Open Portal. For example, I would like to show the case priority and some other custom fields.

I looked through the files inside /components/com_advancedopenportal/ (in the joomla installation) and couldn’t find where to start from.

Do you have any ideas on how I can accomplish this?

Thanks in advance.
George

I searched a little more on this and I just found that inside components/com_advancedopenportal/models/SugarCasesConnection.php, in the following code lines

class SugarCasesConnection {

    private $case_fields = array('id','name','date_entered','date_modified','description','case_number','type','status','state','priority');
...

… it looks like it loads the fields that can be used from every case. Is this true?
Then I wonder, can I load this way any custom field using the field name?

I also created a template override for the listcases view in:
templates/my-template/html/com_advancedopenportal/listcases/default.php

At the following code lines, can I just show some more of the already loaded fields?


        <td><?php echo $case->case_number;?></td>
        <td><a href='?option=com_advancedopenportal&view=showcase&id=<?php echo $case->id;?>'><?php echo $case->name;?></a></td>
        <td><?php echo $case->status_display;?></td>
        <td><?php echo $case->state;?></td>
        <td><?php echo $case->date_entered_display;?></td>
        <td><?php echo $case->date_modified_display;?></td>

Thanks in advance for any hint!
George

Hi George.

Yep, extra fields can be added to the $case_fields array (i.e. just add ‘my_custom_field_c’ to the array).

This will then be available in the $case object.

Note that some fields may require extra processing (like dates or dropdowns) this can be done in the components/com_advancedopenportal/models/SugarCase.php and examples can be found in that file or the one it extends (SugarObject.php).

Hope this helps,

Jim

1 Like

Hello,

I have one more little related question. I have created a ‘One to Many’ relationship between Projects and Cases so for every case I can choose a related project.

What should I do to show the related project for every case in the Joomla Portal?

Thanks in advance.
George

Hello,

Maybe I will try a workaround since I’m not sure if I can directly access the value of a related field.

In case I cannot access the related field I will create a hidden extra field which using a workflow will copy the value of the related field.

If anybody has a better idea to suggest, please share!

Regards,
George

Hi George,

Sorry for the delay in replying.

The solution you mention would be the simplest option. To do it properly you would have to edit the Sugar connection class so that when it fetches cases from the sugar api it also fetches the related project but this would require custom coding on the joomla end.

Thanks,
Jim