ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

Hide fields when you create and update issues

Added by Lenny Ansir at 2013-03-13 02:24 pm

Hi, I want to hide some fields (Priority and due date) when you create and update issues for certain users. At the moment I have added jQuery to hide the elements (This is global unfortunately but the developers can use firebug to unhide it) it works when you create an issue. The file that was edited was chiliproject/app/views/issues/new.rhtml. I also need to implements it when the user updates the issue but I can’t find the file so I can use the same jquery. I have tried chiliproject/app/views/issues/edit.rhtml but it’s not the one. Any help would be great.

Thanks
Lenny


Replies (4)

RE: Hide fields when you create and update issues - Added by Chris Dähn at 2013-03-14 08:55 pm

Hi,

how about realizing this by not hacking the sources and instead injecting the jQuery stuff inside an own theme.

So you can include your jQuery stuff globally with a clean way and just execute the hiding stuff for special urls or forms... would that be a way?

If you need an example for a theme with own jQuery stuff you can look here:
https://github.com/asinteg/chiliproject-orange-theme

I could support you a little bit, if you need help integrating it...

ciao,
Chris

RE: Hide fields when you create and update issues - Added by Chris Dähn at 2013-03-14 08:56 pm

PS: Would be interested in your solution - would be great to have the hiding functionality for my own CP site ;-)

RE: Hide fields when you create and update issues - Added by Lenny Ansir at 2013-03-16 04:20 pm

Hi,
Thanks Chris that worked a treat.
So basically i created a new folder in chiliproject/public/themes/(my folder name)
Created 2 more folders stylesheets and javascrripts.
Inside stylesheets create application.css.
Inside javascript create theme.js.
You have to create these 2 files in order for Cp to pick it up.

The code in the theme.js file is:
jQuery(document).ready(function(){
jQuery("#issue_priority_id").parent().hide();
jQuery("#issue_due_date").parent().hide();
});

Find the element by id, go up to the parent tag that has the label, span and text and hide the whole thing.

Thanks again guys.

RE: Hide fields when you create and update issues - Added by Chris Dähn at 2013-03-16 04:43 pm

Hi,

and thanks for your detailed instructions - I'll test that for my company CP installation :)

ciao,
Chris

(1-4/4)