Commit 96298eac authored by Eric Davis's avatar Eric Davis

Merge branch 'ticket/unstable/262-line-endings' into unstable

parents bc249871 a85b6780
<h2><%=h @status %></h2> <h2><%=h @status %></h2>
<p id="errorExplanation"><%=h @message %></p> <p id="errorExplanation"><%=h @message %></p>
<p><a href="javascript:history.back()">Back</a></p> <p><a href="javascript:history.back()">Back</a></p>
<% html_title @status %> <% html_title @status %>
<% form_tag(project_project_enumerations_path(@project), :method => :put, :class => "tabular") do %> <% form_tag(project_project_enumerations_path(@project), :method => :put, :class => "tabular") do %>
<table class="list"> <table class="list">
<thead><tr> <thead><tr>
<th><%= l(:field_name) %></th> <th><%= l(:field_name) %></th>
<th><%= l(:enumeration_system_activity) %></th> <th><%= l(:enumeration_system_activity) %></th>
<% TimeEntryActivity.new.available_custom_fields.each do |value| %> <% TimeEntryActivity.new.available_custom_fields.each do |value| %>
<th><%= h value.name %></th> <th><%= h value.name %></th>
<% end %> <% end %>
<th style="width:15%;"><%= l(:field_active) %></th> <th style="width:15%;"><%= l(:field_active) %></th>
</tr></thead> </tr></thead>
<% @project.activities(true).each do |enumeration| %> <% @project.activities(true).each do |enumeration| %>
<% fields_for "enumerations[#{enumeration.id}]", enumeration do |ff| %> <% fields_for "enumerations[#{enumeration.id}]", enumeration do |ff| %>
<tr class="<%= cycle('odd', 'even') %>"> <tr class="<%= cycle('odd', 'even') %>">
<td> <td>
<%= ff.hidden_field :parent_id, :value => enumeration.id unless enumeration.project %> <%= ff.hidden_field :parent_id, :value => enumeration.id unless enumeration.project %>
<%= h(enumeration) %> <%= h(enumeration) %>
</td> </td>
<td align="center" style="width:15%;"><%= checked_image !enumeration.project %></td> <td align="center" style="width:15%;"><%= checked_image !enumeration.project %></td>
<% enumeration.custom_field_values.each do |value| %> <% enumeration.custom_field_values.each do |value| %>
<td align="center"> <td align="center">
<%= custom_field_tag "enumerations[#{enumeration.id}]", value %> <%= custom_field_tag "enumerations[#{enumeration.id}]", value %>
</td> </td>
<% end %> <% end %>
<td align="center" style="width:15%;"> <td align="center" style="width:15%;">
<%= ff.check_box :active %> <%= ff.check_box :active %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
<% end %> <% end %>
</table> </table>
<div class="contextual"> <div class="contextual">
<%= link_to(l(:button_reset), project_project_enumerations_path(@project), <%= link_to(l(:button_reset), project_project_enumerations_path(@project),
:method => :delete, :method => :delete,
:confirm => l(:text_are_you_sure), :confirm => l(:text_are_you_sure),
:class => 'icon icon-del') %> :class => 'icon icon-del') %>
</div> </div>
<%= submit_tag l(:button_save) %> <%= submit_tag l(:button_save) %>
<% end %> <% end %>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
namespace :code do
desc "Fix line endings of all source files"
task :fix_line_endings do
unless `which fromdos`.present?
raise "fromdos command not found"
end
Dir['**/**{.rb,.html.erb,.rhtml,.rjs,.rsb,.plain.erb,.rxml,.yml,.rake,.eml}'].each do |file_name|
next if file_name.include?("vendor")
system("fromdos #{file_name}")
end
end
end
This diff is collapsed.
desc 'Create YAML test fixtures from data in an existing database. desc 'Create YAML test fixtures from data in an existing database.
Defaults to development database. Set RAILS_ENV to override.' Defaults to development database. Set RAILS_ENV to override.'
task :extract_fixtures => :environment do task :extract_fixtures => :environment do
sql = "SELECT * FROM %s" sql = "SELECT * FROM %s"
skip_tables = ["schema_info"] skip_tables = ["schema_info"]
ActiveRecord::Base.establish_connection ActiveRecord::Base.establish_connection
(ActiveRecord::Base.connection.tables - skip_tables).each do |table_name| (ActiveRecord::Base.connection.tables - skip_tables).each do |table_name|
i = "000" i = "000"
File.open("#{RAILS_ROOT}/#{table_name}.yml", 'w' ) do |file| File.open("#{RAILS_ROOT}/#{table_name}.yml", 'w' ) do |file|
data = ActiveRecord::Base.connection.select_all(sql % table_name) data = ActiveRecord::Base.connection.select_all(sql % table_name)
file.write data.inject({}) { |hash, record| file.write data.inject({}) { |hash, record|
# cast extracted values # cast extracted values
ActiveRecord::Base.connection.columns(table_name).each { |col| ActiveRecord::Base.connection.columns(table_name).each { |col|
record[col.name] = col.type_cast(record[col.name]) if record[col.name] record[col.name] = col.type_cast(record[col.name]) if record[col.name]
} }
hash["#{table_name}_#{i.succ!}"] = record hash["#{table_name}_#{i.succ!}"] = record
hash hash
}.to_yaml }.to_yaml
end end
end end
end end
\ No newline at end of file
# redMine - project management software # redMine - project management software
# Copyright (C) 2006-2008 Jean-Philippe Lang # Copyright (C) 2006-2008 Jean-Philippe Lang
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License # modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2 # as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version. # of the License, or (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
desc 'Fetch changesets from the repositories' desc 'Fetch changesets from the repositories'
namespace :redmine do namespace :redmine do
task :fetch_changesets => :environment do task :fetch_changesets => :environment do
Repository.fetch_changesets Repository.fetch_changesets
end end
end end
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment