summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-08-11 18:24:39 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-08-11 18:24:39 +0000
commit237a3f52a2d9d269b56f5cdb022f0ff4f8197100 (patch)
treeb392885d15032d8ae09af3106fffa7779c4bec15 /app
parent1631019026089cb7dc49b50365274bb07ba44025 (diff)
downloadredmine-237a3f52a2d9d269b56f5cdb022f0ff4f8197100.tar.gz
redmine-237a3f52a2d9d269b56f5cdb022f0ff4f8197100.zip
Fixes custom fields display order at several places (#1768).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1731 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/controllers/account_controller.rb2
-rw-r--r--app/models/custom_field.rb2
-rw-r--r--app/models/project.rb2
-rw-r--r--app/views/issues/_form.rhtml2
-rw-r--r--app/views/issues/_form_custom_fields.rhtml2
5 files changed, 5 insertions, 5 deletions
diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb
index 96a2fc921..4b2ec8317 100644
--- a/app/controllers/account_controller.rb
+++ b/app/controllers/account_controller.rb
@@ -25,7 +25,7 @@ class AccountController < ApplicationController
# Show user's account
def show
@user = User.find_active(params[:id])
- @custom_values = @user.custom_values.find(:all, :include => :custom_field)
+ @custom_values = @user.custom_values
# show only public projects and private projects that the logged in user is also a member of
@memberships = @user.memberships.select do |membership|
diff --git a/app/models/custom_field.rb b/app/models/custom_field.rb
index 7ad19437f..704fbe010 100644
--- a/app/models/custom_field.rb
+++ b/app/models/custom_field.rb
@@ -66,7 +66,7 @@ class CustomField < ActiveRecord::Base
# to move in project_custom_field
def self.for_all
- find(:all, :conditions => ["is_for_all=?", true])
+ find(:all, :conditions => ["is_for_all=?", true], :order => 'position')
end
def type_name
diff --git a/app/models/project.rb b/app/models/project.rb
index 5679344bc..9e4bd6971 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -198,7 +198,7 @@ class Project < ActiveRecord::Base
# Returns an array of all custom fields enabled for project issues
# (explictly associated custom fields and custom fields enabled for all projects)
def all_issue_custom_fields
- @all_issue_custom_fields ||= (IssueCustomField.for_all + issue_custom_fields).uniq
+ @all_issue_custom_fields ||= (IssueCustomField.for_all + issue_custom_fields).uniq.sort
end
def project
diff --git a/app/views/issues/_form.rhtml b/app/views/issues/_form.rhtml
index 9bb74fd34..4eca3cb4a 100644
--- a/app/views/issues/_form.rhtml
+++ b/app/views/issues/_form.rhtml
@@ -42,7 +42,7 @@
</div>
<div style="clear:both;"> </div>
-<%= render :partial => 'form_custom_fields', :locals => {:values => @custom_values} %>
+<%= render :partial => 'form_custom_fields' %>
<% if @issue.new_record? %>
<p><label><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form' %></p>
diff --git a/app/views/issues/_form_custom_fields.rhtml b/app/views/issues/_form_custom_fields.rhtml
index ebd4c3219..752fb4d37 100644
--- a/app/views/issues/_form_custom_fields.rhtml
+++ b/app/views/issues/_form_custom_fields.rhtml
@@ -1,5 +1,5 @@
<div class="splitcontentleft">
-<% i = 1 %>
+<% i = 0 %>
<% split_on = @issue.custom_field_values.size / 2 %>
<% @issue.custom_field_values.each do |value| %>
<p><%= custom_field_tag_with_label :issue, value %></p>