The dashboard governs the instrument panel, which is the user's home page in AFIDS.
The instrument panel is drawn based on the user's role. The components or modules included in the instrument panel are drawn in symfony partials.
In the future, it would be beneficial to move to a configurable instrument panel. In this scenario, each module can be added (depending on the role), removed, or moved around on the page by the user to suit their preferences.
I think it makes the most sense to wrap all the role-based logic into the index.php template, even though it feels like the business logic should be in a method. The index template can load partials, but then again, so could the method. Even if the method creates the partials, there will still need to be logic in the template to determine how they are displayed. If we go with the customizable layout, then the user preferences will need to be factored in as well.
The index action generates some values which are used in the index template. Since some of these are dependent on roles, we should consolidate all of this into somewhere where the business logic is based on roles.
dashboard components class
Eventually, we want to end up with a tabbed module which has tabs appropriate for the user's role. Then, we need to load each tab with the framework for the metrics displays in that tab, the contents of which will be loaded by ajax. (The first tab needs to be loaded as a part of the framework.)
Where do we define the framework for each tab, and the tabs for each role?
Each dashboard will have a dataset which can be created using a data model. The data model would be called from the components class. Since they'll be loaded by ajax, we may want to set up the data set methods as web services so they can be loaded elsewhere as well. This would argue for a metrics module. I assume that a partial can be loaded via ajax?
- personal notepad
- team notepad
- priority list (role based notifications for advanced users)
- recent items (things you did recently)
- recent notification (role based notifications for pilots)
- current missions (map view of all upcoming mission legs)
- available missions (not currently used)