Ability to link 'types' to 'projects', so when you select a project in the FE, the types field only displays the linked types, not the whole list. There should be an option to enable this linking, because people may want all types to be available to all projects, and one doesn't want to have to duplicate the list of issue types for each project!
Issue types, such as 'Defect', 'Enhancement', 'Documentation' etc. currently have no specific association and can be chosen for any project. To implement this feature we would require additional linkage in the 'create issue form' such that the list is generated based upon the selected project. This could be done with some Javascript that would make an Ajax call to the system to retrieve the 'new' list of possible issue types. We would therefore need to implement a new controller task to return to the browser the available options. In addition we would need, on the server the 'association list' which would relate each 'type' to one or more projects. This sounds like an ideal candidate for a database link table. The table would consist of a couple of fields, a project field which is a 'link' to the projects table, and a types field which is a link to the 'types' table. There would be one entry in the table for each type that is associated with a project. There would need to be a back end screen to enable the admin to be able to create the association. Not seen such an idea on any other Joomla component before so it could be interesting to implement.
Another idea could be that each project has an additional (JSON) field that would contain the list of issue types that are applicable for that specific project. We could have a multi select drop down list in the back end for each project that the administrator would select. The default would be that all types are available. In the front end the drop down list selection for the issue type would have to have an additional parameter such that the project id is passed to the drop down selector code so that the type information for that project could be selected.
The final implementation (release 1.6.5) is as follows:
There is an addition field named itypes added to the it_projects table. This is accessed in the back end Projects view, and requires that we add the new field to the itprojects.xml model file. A new model field file named issuetrackertypes.php is created which is used to provide the possible entries from the it_types table. The project view itself enables the administrator to add all the required 'issue types' that are applicable for the project. In the back end projects model class there are two changes required. The first is in the project save routine where we JSON encode the returned values and store them in the table field. The second is in the get method where the record is fetched from the database and the issue types field is JSON decoded.
There are a couple of language strings to provide the table label and description.
The changes in the front end are that we need a new Javascript file that will call the server and populate the select options for the type field. This requires a controller task that is called by the Javascript to return the determined values for the specific project. The javascript is initiated by the user choosing a new project in the front end from the dropdown project list. This is coded in the model field issuetrackerprojectfe.php file. There is already a call in the file to invoke the display of any Custom fields for the project, and this is just an additional call.
There are specific checks such that it if the project 'itypes' field is empty of contains the entry of '0', that the defined types for the component 'default project' file is used. An additional check is that the 'default type' is marked as the selected value providing that default is one of the types acceptable for the project chosen.