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?
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?
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).
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?
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.