Hide certain attributes when adding an issue?

Submitted by mijalis on 2012-03-29

Hi, I would like to hide some attributes when a user is adding an issue...
For example, I would like the user to enter only the issue name and Due Date.
The rest of the fields should still be there but there should be given default values when the ticket is opened for the first time.
Which file should I hack?
I also imagine an extra field in db, eg show_attr (0,1) which could be configured when creating an issue type.
This addition should make much more user friendly, since most of the times users just want to quickly report an issue, without having to enter many fields. This could later be done by the project admin.

If this is for the Web Client, take a look at client/issues/issue.inc.php.

Regards,
Michał

Ok, really thanks for your prompt reply :-)
Actually the only thing that I had to do is modify the query in system/api/typemanager.inc.php, function getAttributeTypesForIssueType (and attr_show=1) and everything is working like magic!

$query = 'SELECT attr_id, attr_name, attr_def FROM {attr_types} WHERE type_id = %d and attr_show=1 ORDER BY attr_name COLLATE LOCALE';

Of course I added the new field in attr_types...
Great code mimec!
FYI, I am also in the process of translating into greek...
The web client has great potential!

One more question: where should I look in order to allow all users (since I am using the ldap hack published earlier) by default to be able to open new issues? (without having to add them as members to every project)

That's great news, I'm just about to release a new version with added Chinese translations. Please send the Greek translation files to me so I can include them as well.

When you add a new user, you should also give the user access to each project by calling $userManager->grantMember(). To get a list of all projects just query the {projects} table.

Regards,
Michał