diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-12-15 10:41:49 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-12-15 10:41:49 +0000 |
commit | b6e6f557f01bebcd90e034e4b6cc5b755a95c006 (patch) | |
tree | 38b97ccf7c7f6efdf78b66b84b1e14e0e857b0b0 /app/views/issues/_attributes.html.erb | |
parent | 31f2e848b56b8ed260128ba0d9fc245b06800e09 (diff) | |
download | redmine-b6e6f557f01bebcd90e034e4b6cc5b755a95c006.tar.gz redmine-b6e6f557f01bebcd90e034e4b6cc5b755a95c006.zip |
Display issue form fields according to permissions.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8227 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/issues/_attributes.html.erb')
-rw-r--r-- | app/views/issues/_attributes.html.erb | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/app/views/issues/_attributes.html.erb b/app/views/issues/_attributes.html.erb index 6303ccf79..802c7194a 100644 --- a/app/views/issues/_attributes.html.erb +++ b/app/views/issues/_attributes.html.erb @@ -1,15 +1,21 @@ <% labelled_fields_for :issue, @issue do |f| %> <div class="splitcontentleft"> -<% if @issue.new_record? || @allowed_statuses.any? %> +<% if @issue.safe_attribute? 'status_id' %> <p><%= f.select :status_id, (@allowed_statuses.collect {|p| [p.name, p.id]}), :required => true %></p> <% else %> <p><label><%= l(:field_status) %></label> <%= h(@issue.status.name) %></p> <% end %> +<% if @issue.safe_attribute? 'priority_id' %> <p><%= f.select :priority_id, (@priorities.collect {|p| [p.name, p.id]}), {:required => true}, :disabled => !@issue.leaf? %></p> +<% end %> + +<% if @issue.safe_attribute? 'assigned_to_id' %> <p><%= f.select :assigned_to_id, principals_options_for_select(@issue.assignable_users, @issue.assigned_to), :include_blank => true %></p> -<% unless @project.issue_categories.empty? %> +<% end %> + +<% if @issue.safe_attribute?('category_id') && @project.issue_categories.any? %> <p><%= f.select :category_id, (@project.issue_categories.collect {|c| [c.name, c.id]}), :include_blank => true %> <%= prompt_to_remote(image_tag('add.png', :style => 'vertical-align: middle;'), l(:label_issue_category_new), @@ -18,7 +24,8 @@ :title => l(:label_issue_category_new), :tabindex => 199) if authorize_for('issue_categories', 'new') %></p> <% end %> -<% unless @issue.assignable_versions.empty? %> + +<% if @issue.safe_attribute?('fixed_version_id') && @issue.assignable_versions.any? %> <p><%= f.select :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.fixed_version), :include_blank => true %> <%= prompt_to_remote(image_tag('add.png', :style => 'vertical-align: middle;'), l(:label_version_new), @@ -36,15 +43,27 @@ <div id="parent_issue_candidates" class="autocomplete"></div> <%= javascript_tag "observeParentIssueField('#{auto_complete_issues_path(:id => @issue, :project_id => @project) }')" %> <% end %> + +<% if @issue.safe_attribute? 'start_date' %> <p><%= f.text_field :start_date, :size => 10, :disabled => !@issue.leaf? %><%= calendar_for('issue_start_date') if @issue.leaf? %></p> +<% end %> + +<% if @issue.safe_attribute? 'due_date' %> <p><%= f.text_field :due_date, :size => 10, :disabled => !@issue.leaf? %><%= calendar_for('issue_due_date') if @issue.leaf? %></p> +<% end %> + +<% if @issue.safe_attribute? 'estimated_hours' %> <p><%= f.text_field :estimated_hours, :size => 3, :disabled => !@issue.leaf? %> <%= l(:field_hours) %></p> -<% if @issue.leaf? && Issue.use_field_for_done_ratio? %> +<% end %> + +<% if @issue.safe_attribute?('done_ratio') && @issue.leaf? && Issue.use_field_for_done_ratio? %> <p><%= f.select :done_ratio, ((0..10).to_a.collect {|r| ["#{r*10} %", r*10] }) %></p> <% end %> </div> <div style="clear:both;"> </div> +<% if @issue.safe_attribute? 'custom_field_values' %> <%= render :partial => 'issues/form_custom_fields' %> +<% end %> <% end %> |