diff --git a/redmine/app/controllers/account_controller.rb b/redmine/app/controllers/account_controller.rb index d5c98f58..54e0ef70 100644 --- a/redmine/app/controllers/account_controller.rb +++ b/redmine/app/controllers/account_controller.rb @@ -16,31 +16,30 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class AccountController < ApplicationController - layout 'base' + layout 'base' + # prevents login action to be filtered by check_if_login_required application scope filter skip_before_filter :check_if_login_required, :only => :login - before_filter :require_login, :except => [:show, :login] + before_filter :require_login, :except => [:show, :login] - def show - @user = User.find(params[:id]) - end - - # Login request and validation - def login - if request.get? - session[:user] = nil - @user = User.new - else - @user = User.new(params[:user]) - logged_in_user = @user.try_to_login - if logged_in_user - session[:user] = logged_in_user - redirect_back_or_default :controller => 'account', :action => 'my_page' - else - flash[:notice] = _('Invalid user/password') - end - end - end + def show + @user = User.find(params[:id]) + end + + # Login request and validation + def login + if request.get? + session[:user] = nil + else + logged_in_user = User.try_to_login(params[:login], params[:password]) + if logged_in_user + session[:user] = logged_in_user + redirect_back_or_default :controller => 'account', :action => 'my_page' + else + flash[:notice] = _('Invalid user/password') + end + end + end # Log out current user and redirect to welcome page def logout @@ -64,20 +63,15 @@ class AccountController < ApplicationController end end - # Change current user's password - def change_password - @user = User.find(session[:user].id) - if @user.check_password?(@params[:old_password]) - if @params[:new_password] == @params[:new_password_confirmation] - if @user.change_password(@params[:old_password], @params[:new_password]) - flash[:notice] = 'Password was successfully updated.' - end - else - flash[:notice] = 'Password confirmation doesn\'t match!' - end - else - flash[:notice] = 'Wrong password' - end - render :action => 'my_account' - end + # Change current user's password + def change_password + @user = User.find(session[:user].id) + if @user.check_password?(@params[:password]) + @user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation] + flash[:notice] = 'Password was successfully updated.' if @user.save + else + flash[:notice] = 'Wrong password' + end + render :action => 'my_account' + end end diff --git a/redmine/app/controllers/admin_controller.rb b/redmine/app/controllers/admin_controller.rb index fa34baff..68d08137 100644 --- a/redmine/app/controllers/admin_controller.rb +++ b/redmine/app/controllers/admin_controller.rb @@ -16,26 +16,32 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class AdminController < ApplicationController - layout 'base' - before_filter :require_admin - - helper :sort - include SortHelper + layout 'base' + before_filter :require_admin - def index - end + helper :sort + include SortHelper + + def index + end def projects - sort_init 'projects.name', 'asc' - sort_update - @project_pages, @projects = paginate :projects, :per_page => 15, :order => sort_clause + sort_init 'name', 'asc' + sort_update + @project_count = Project.count + @project_pages = Paginator.new self, @project_count, + 15, + @params['page'] + @projects = Project.find :all, :order => sort_clause, + :limit => @project_pages.items_per_page, + :offset => @project_pages.current.offset end - + def mail_options - @actions = Permission.find(:all, :conditions => ["mail_option=?", true]) || [] + @actions = Permission.find(:all, :conditions => ["mail_option=?", true]) || [] if request.post? @actions.each { |a| - a.mail_enabled = params[:action_ids].include? a.id.to_s + a.mail_enabled = (params[:action_ids] || []).include? a.id.to_s a.save } flash[:notice] = "Mail options were successfully updated." @@ -44,6 +50,5 @@ class AdminController < ApplicationController def info @adapter_name = ActiveRecord::Base.connection.adapter_name - end - + end end diff --git a/redmine/app/controllers/application.rb b/redmine/app/controllers/application.rb index a9dd6b80..9cc37cfa 100644 --- a/redmine/app/controllers/application.rb +++ b/redmine/app/controllers/application.rb @@ -24,63 +24,73 @@ class ApplicationController < ActionController::Base end def set_localization - Localization.lang = session[:user].nil? ? RDM_DEFAULT_LANG : (session[:user].language || RDM_DEFAULT_LANG) + Localization.lang = begin + if session[:user] + session[:user].language + elsif request.env['HTTP_ACCEPT_LANGUAGE'] + accept_lang = HTTPUtils.parse_qvalues(request.env['HTTP_ACCEPT_LANGUAGE']).first.split('-').first + if Localization.langs.collect{ |l| l[1] }.include? accept_lang + accept_lang + end + end + rescue + nil + end || RDM_DEFAULT_LANG end - def require_login - unless session[:user] - store_location - redirect_to(:controller => "account", :action => "login") - end - end + def require_login + unless session[:user] + store_location + redirect_to(:controller => "account", :action => "login") + end + end - def require_admin - if session[:user].nil? - store_location - redirect_to(:controller => "account", :action => "login") - else - unless session[:user].admin? - flash[:notice] = "Acces not allowed" - redirect_to(:controller => "projects", :action => "list") - end - end - end + def require_admin + if session[:user].nil? + store_location + redirect_to(:controller => "account", :action => "login") + else + unless session[:user].admin? + flash[:notice] = "Acces not allowed" + redirect_to(:controller => "projects", :action => "list") + end + end + end - # authorizes the user for the requested action. - def authorize + # authorizes the user for the requested action. + def authorize # check if action is allowed on public projects - if @project.public? and Permission.allowed_to_public "%s/%s" % [ @params[:controller], @params[:action] ] + if @project.is_public? and Permission.allowed_to_public "%s/%s" % [ @params[:controller], @params[:action] ] return true end - # if user is not logged in, he is redirect to login form - unless session[:user] - store_location - redirect_to(:controller => "account", :action => "login") - return false - end - # check if user is authorized + # if user not logged in, redirect to login form + unless session[:user] + store_location + redirect_to(:controller => "account", :action => "login") + return false + end + # if logged in, check if authorized if session[:user].admin? or Permission.allowed_to_role( "%s/%s" % [ @params[:controller], @params[:action] ], session[:user].role_for_project(@project.id) ) return true - end + end flash[:notice] = "Acces denied" redirect_to(:controller => "") - return false - end + false + end - # store current uri in the session. - # we can return to this location by calling redirect_back_or_default - def store_location - session[:return_to] = @request.request_uri - end - - # move to the last store_location call or to the passed default one - def redirect_back_or_default(default) - if session[:return_to].nil? - redirect_to default - else - redirect_to_url session[:return_to] - session[:return_to] = nil - end - end - + # store current uri in session. + # return to this location by calling redirect_back_or_default + def store_location + session[:return_to] = @request.request_uri + end + + # move to the last store_location call or to the passed default one + def redirect_back_or_default(default) + if session[:return_to].nil? + redirect_to default + else + redirect_to_url session[:return_to] + session[:return_to] = nil + end + end end \ No newline at end of file diff --git a/redmine/app/controllers/help_controller.rb b/redmine/app/controllers/help_controller.rb index 4b555d59..e51d077a 100644 --- a/redmine/app/controllers/help_controller.rb +++ b/redmine/app/controllers/help_controller.rb @@ -16,28 +16,32 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class HelpController < ApplicationController - - skip_before_filter :check_if_login_required - before_filter :load_help_config - def index - if @params[:ctrl] and @help_config[@params[:ctrl]] - if @params[:page] and @help_config[@params[:ctrl]][@params[:page]] - template = @help_config[@params[:ctrl]][@params[:page]] - else - template = @help_config[@params[:ctrl]]['index'] - end - end - - if template - redirect_to "/manual/#{template}" - else - redirect_to "/manual/" + skip_before_filter :check_if_login_required + before_filter :load_help_config + + # displays help page for the requested controller/action + def index + # select help page to display + if @params[:ctrl] and @help_config['pages'][@params[:ctrl]] + if @params[:page] and @help_config['pages'][@params[:ctrl]][@params[:page]] + template = @help_config['pages'][@params[:ctrl]][@params[:page]] + else + template = @help_config['pages'][@params[:ctrl]]['index'] + end end - end + # choose language according to available help translations + lang = (@help_config['langs'].include? Localization.lang) ? Localization.lang : @help_config['langs'].first + + if template + redirect_to "/manual/#{lang}/#{template}" + else + redirect_to "/manual/#{lang}/" + end + end private - def load_help_config - @help_config = YAML::load(File.open("#{RAILS_ROOT}/config/help.yml")) - end + def load_help_config + @help_config = YAML::load(File.open("#{RAILS_ROOT}/config/help.yml")) + end end diff --git a/redmine/app/controllers/projects_controller.rb b/redmine/app/controllers/projects_controller.rb index a9737aa1..2bef221b 100644 --- a/redmine/app/controllers/projects_controller.rb +++ b/redmine/app/controllers/projects_controller.rb @@ -32,58 +32,62 @@ class ProjectsController < ApplicationController render :action => 'list' end - # Lists public projects - def list - sort_init 'projects.name', 'asc' - sort_update - @project_count = Project.count(["public=?", true]) - @project_pages = Paginator.new self, @project_count, + # Lists public projects + def list + sort_init 'name', 'asc' + sort_update + @project_count = Project.count(["is_public=?", true]) + @project_pages = Paginator.new self, @project_count, 15, @params['page'] - @projects = Project.find :all, :order => sort_clause, - :conditions => ["public=?", true], + @projects = Project.find :all, :order => sort_clause, + :conditions => ["is_public=?", true], :limit => @project_pages.items_per_page, :offset => @project_pages.current.offset end # Add a new project - def add - @custom_fields = CustomField::find_all - @project = Project.new(params[:project]) - if request.post? - @project.custom_fields = CustomField.find(@params[:custom_field_ids]) if @params[:custom_field_ids] - if @project.save - flash[:notice] = 'Project was successfully created.' - redirect_to :controller => 'admin', :action => 'projects' - end - end - end + def add + @custom_fields = CustomField::find_all + @root_projects = Project::find(:all, :conditions => "parent_id is null") + @project = Project.new(params[:project]) + if request.post? + @project.custom_fields = CustomField.find(@params[:custom_field_ids]) if @params[:custom_field_ids] + if @project.save + flash[:notice] = 'Project was successfully created.' + redirect_to :controller => 'admin', :action => 'projects' + end + end + end - # Show @project - def show - @members = @project.members.find(:all, :include => [:user, :role]) - end + # Show @project + def show + @members = @project.members.find(:all, :include => [:user, :role]) + @subprojects = @project.children if @project.children_count > 0 + @news = @project.news.find(:all, :limit => 5, :include => [ :author, :project ], :order => "news.created_on DESC") + end def settings - @custom_fields = CustomField::find_all - @issue_category ||= IssueCategory.new + @root_projects = Project::find(:all, :conditions => ["parent_id is null and id <> ?", @project.id]) + @custom_fields = CustomField::find_all + @issue_category ||= IssueCategory.new @member ||= @project.members.new @roles = Role.find_all @users = User.find_all - @project.members.find(:all, :include => :user).collect{|m| m.user } end - # Edit @project - def edit - if request.post? - @project.custom_fields = CustomField.find(@params[:custom_field_ids]) if @params[:custom_field_ids] - if @project.update_attributes(params[:project]) - flash[:notice] = 'Project was successfully updated.' - redirect_to :action => 'settings', :id => @project + # Edit @project + def edit + if request.post? + @project.custom_fields = CustomField.find(@params[:custom_field_ids]) if @params[:custom_field_ids] + if @project.update_attributes(params[:project]) + flash[:notice] = 'Project was successfully updated.' + redirect_to :action => 'settings', :id => @project else settings render :action => 'settings' - end - end + end + end end # Delete @project @@ -181,7 +185,7 @@ class ProjectsController < ApplicationController end end - # Show issues list of @project + # Show filtered/sorted issues list of @project def list_issues sort_init 'issues.id', 'desc' sort_update @@ -189,10 +193,10 @@ class ProjectsController < ApplicationController search_filter_init_list_issues search_filter_update if params[:set_filter] or request.post? - @issue_count = Issue.count(:include => :status, :conditions => search_filter_clause) + @issue_count = Issue.count(:include => [:status, :project], :conditions => search_filter_clause) @issue_pages = Paginator.new self, @issue_count, 15, @params['page'] @issues = Issue.find :all, :order => sort_clause, - :include => [ :author, :status, :tracker ], + :include => [ :author, :status, :tracker, :project ], :conditions => search_filter_clause, :limit => @issue_pages.items_per_page, :offset => @issue_pages.current.offset @@ -206,7 +210,7 @@ class ProjectsController < ApplicationController search_filter_init_list_issues @issues = Issue.find :all, :order => sort_clause, - :include => [ :author, :status, :tracker ], + :include => [ :author, :status, :tracker, :project ], :conditions => search_filter_clause export = StringIO.new diff --git a/redmine/app/controllers/roles_controller.rb b/redmine/app/controllers/roles_controller.rb index 6e4fc74e..657f62e0 100644 --- a/redmine/app/controllers/roles_controller.rb +++ b/redmine/app/controllers/roles_controller.rb @@ -62,9 +62,6 @@ class RolesController < ApplicationController end def workflow - @roles = Role.find_all - @trackers = Tracker.find_all - @statuses = IssueStatus.find_all @role = Role.find_by_id(params[:role_id]) @tracker = Tracker.find_by_id(params[:tracker_id]) @@ -80,5 +77,8 @@ class RolesController < ApplicationController flash[:notice] = 'Workflow was successfully updated.' end end + @roles = Role.find_all + @trackers = Tracker.find_all + @statuses = IssueStatus.find(:all, :include => :workflows) end end diff --git a/redmine/app/controllers/users_controller.rb b/redmine/app/controllers/users_controller.rb index 64c9fd31..3a604271 100644 --- a/redmine/app/controllers/users_controller.rb +++ b/redmine/app/controllers/users_controller.rb @@ -16,58 +16,62 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class UsersController < ApplicationController - layout 'base' - before_filter :require_admin - - helper :sort - include SortHelper - - def index - list - render :action => 'list' - end + layout 'base' + before_filter :require_admin + + helper :sort + include SortHelper - def list - sort_init 'users.login', 'asc' - sort_update - @user_count = User.count - @user_pages = Paginator.new self, @user_count, + def index + list + render :action => 'list' + end + + def list + sort_init 'login', 'asc' + sort_update + @user_count = User.count + @user_pages = Paginator.new self, @user_count, 15, @params['page'] - @users = User.find :all, :order => sort_clause, + @users = User.find :all,:order => sort_clause, :limit => @user_pages.items_per_page, :offset => @user_pages.current.offset - end + end - def add - if request.get? - @user = User.new - else - @user = User.new(params[:user]) - @user.admin = params[:user][:admin] - if @user.save - flash[:notice] = 'User was successfully created.' - redirect_to :action => 'list' - end - end - end + def add + if request.get? + @user = User.new + else + @user = User.new(params[:user]) + @user.admin = params[:user][:admin] || false + @user.login = params[:user][:login] + @user.password, @user.password_confirmation = params[:password], params[:password_confirmation] + if @user.save + flash[:notice] = 'User was successfully created.' + redirect_to :action => 'list' + end + end + end - def edit - @user = User.find(params[:id]) - if request.post? - @user.admin = params[:user][:admin] if params[:user][:admin] - if @user.update_attributes(params[:user]) - flash[:notice] = 'User was successfully updated.' - redirect_to :action => 'list' - end - end - end + def edit + @user = User.find(params[:id]) + if request.post? + @user.admin = params[:user][:admin] if params[:user][:admin] + @user.login = params[:user][:login] if params[:user][:login] + @user.password, @user.password_confirmation = params[:password], params[:password_confirmation] unless params[:password].nil? or params[:password].empty? + if @user.update_attributes(params[:user]) + flash[:notice] = 'User was successfully updated.' + redirect_to :action => 'list' + end + end + end - def destroy - User.find(params[:id]).destroy - redirect_to :action => 'list' + def destroy + User.find(params[:id]).destroy + redirect_to :action => 'list' rescue flash[:notice] = "Unable to delete user" redirect_to :action => 'list' - end + end end diff --git a/redmine/app/controllers/versions_controller.rb b/redmine/app/controllers/versions_controller.rb index c4fd241a..c462867c 100644 --- a/redmine/app/controllers/versions_controller.rb +++ b/redmine/app/controllers/versions_controller.rb @@ -38,6 +38,9 @@ class VersionsController < ApplicationController @attachment = @version.attachments.find(params[:attachment_id]) @attachment.increment_download send_file @attachment.diskfile, :filename => @attachment.filename + rescue + flash[:notice]="Requested file doesn't exist or has been deleted." + redirect_to :controller => 'projects', :action => 'list_files', :id => @project end def destroy_file diff --git a/redmine/app/helpers/application_helper.rb b/redmine/app/helpers/application_helper.rb index 4a50b949..de53f2ad 100644 --- a/redmine/app/helpers/application_helper.rb +++ b/redmine/app/helpers/application_helper.rb @@ -27,7 +27,7 @@ module ApplicationHelper def authorize_for(controller, action) # check if action is allowed on public projects - if @project.public? and Permission.allowed_to_public "%s/%s" % [ controller, action ] + if @project.is_public? and Permission.allowed_to_public "%s/%s" % [ controller, action ] return true end # check if user is authorized diff --git a/redmine/app/helpers/search_filter_helper.rb b/redmine/app/helpers/search_filter_helper.rb index 7acc8b28..0999dfbc 100644 --- a/redmine/app/helpers/search_filter_helper.rb +++ b/redmine/app/helpers/search_filter_helper.rb @@ -18,68 +18,73 @@ module SearchFilterHelper def search_filter_criteria(name, options = {}) - session[:search_filter] ||= {} - session[:search_filter][name] ||= {} - unless session[:search_filter][name][:options] and session[:search_filter][name][:conditions] - session[:search_filter][name][:options] = [] - session[:search_filter][name][:conditions] = {} - yield.each { |c| - session[:search_filter][name][:options] << [c[0], c[1].to_s] - session[:search_filter][name][:conditions].store(c[1].to_s, c[2]) - } - end + @search_filter ||= {} + @search_filter[name] ||= {} + @search_filter[name][:options] = [] + @search_filter[name][:conditions] = {} + yield.each { |c| + @search_filter[name][:options] << [c[0], c[1].to_s] + @search_filter[name][:conditions].store(c[1].to_s, c[2]) + } end def search_filter_update - session[:search_filter].each_key {|field| session[:search_filter][field][:value] = params[field] } + @search_filter.each_key {|field| session[:search_filter][field] = params[field] } end def search_filter_clause - clause = ["issues.project_id=?", @project.id] - session[:search_filter].each { |k, v| - v[:value] ||= v[:options][0][1] - if (!v[:conditions][v[:value]][0].empty?) - clause[0] = clause[0] + " AND " + v[:conditions][v[:value]][0] - clause << v[:conditions][v[:value]][1] if !v[:conditions][v[:value]][1].nil? + clause = ["1=1"] + @search_filter.each { |k, v| + filter_value = session[:search_filter][k] || v[:options][0][1] + if v[:conditions][filter_value] + clause[0] = clause[0] + " AND " + v[:conditions][filter_value].first + clause += v[:conditions][filter_value][1..-1] end } clause end - def search_filter_tag(criteria) + def search_filter_tag(criteria, options = {}) + options[:name] = criteria content_tag("select", - options_for_select(session[:search_filter][criteria][:options], session[:search_filter][criteria][:value]), - :name => criteria + options_for_select(@search_filter[criteria][:options], session[:search_filter][criteria]), + options ) end def search_filter_init_list_issues search_filter_criteria('status_id') { - [ ["[Open]", "O", ["issue_statuses.is_closed=?", false]], - ["[All]", "A", ["", false]] + [ [_('[Open]'), "O", ["issue_statuses.is_closed=?", false]], + [_('[All]'), "A", nil] ] + IssueStatus.find(:all).collect {|s| [s.name, s.id, ["issues.status_id=?", s.id]] } } search_filter_criteria('tracker_id') { - [ ["[All]", "A", ["", false]] + [ [_('[All]'), "A", nil] ] + Tracker.find(:all).collect {|s| [s.name, s.id, ["issues.tracker_id=?", s.id]] } } search_filter_criteria('priority_id') { - [ ["[All]", "A", ["", false]] + [ [_('[All]'), "A", nil] ] + Enumeration.find(:all, :conditions => ['opt=?','IPRI']).collect {|s| [s.name, s.id, ["issues.priority_id=?", s.id]] } } search_filter_criteria('category_id') { - [ ["[All]", "A", ["", false]], - ["[None]", "N", ["issues.category_id is null"]] + [ [_('[All]'), "A", nil], + [_('[None]'), "N", ["issues.category_id is null"]] ] + @project.issue_categories.find(:all).collect {|s| [s.name, s.id, ["issues.category_id=?", s.id]] } } search_filter_criteria('assigned_to_id') { - [ ["[All]", "A", ["", false]], - ["[Nobody]", "N", ["issues.assigned_to_id is null"]] - ] + User.find(:all).collect {|s| [s.display_name, s.id, ["issues.assigned_to_id=?", s.id]] } - } + [ [_('[All]'), "A", nil], + [_('[None]'), "N", ["issues.assigned_to_id is null"]] + ] + @project.users.collect {|s| [s.display_name, s.id, ["issues.assigned_to_id=?", s.id]] } + } + + search_filter_criteria('subproject_id') { + [ [_('[None]'), "N", ["issues.project_id=?", @project.id]], + [_('[All]'), "A", ["(issues.project_id=? or projects.parent_id=?)", @project.id, @project.id]] + ] + } end end \ No newline at end of file diff --git a/redmine/app/models/attachment.rb b/redmine/app/models/attachment.rb index bc1ff5d8..1e5bd22b 100644 --- a/redmine/app/models/attachment.rb +++ b/redmine/app/models/attachment.rb @@ -30,7 +30,7 @@ class Attachment < ActiveRecord::Base self.filename = sanitize_filename(@temp_file.original_filename) self.disk_filename = DateTime.now.strftime("%y%m%d%H%M%S") + "_" + self.filename self.content_type = @temp_file.content_type - self.size = @temp_file.size + self.filesize = @temp_file.size end end end diff --git a/redmine/app/models/enumeration.rb b/redmine/app/models/enumeration.rb index d93db444..7f985d2f 100644 --- a/redmine/app/models/enumeration.rb +++ b/redmine/app/models/enumeration.rb @@ -19,6 +19,7 @@ class Enumeration < ActiveRecord::Base before_destroy :check_integrity validates_presence_of :opt, :name + validates_uniqueness_of :name, :scope => [:opt] OPTIONS = [ ["Issue priorities", "IPRI"], diff --git a/redmine/app/models/issue_category.rb b/redmine/app/models/issue_category.rb index b7d4e262..74adb8f5 100644 --- a/redmine/app/models/issue_category.rb +++ b/redmine/app/models/issue_category.rb @@ -17,9 +17,10 @@ class IssueCategory < ActiveRecord::Base before_destroy :check_integrity - belongs_to :project - + belongs_to :project + validates_presence_of :name + validates_uniqueness_of :name, :scope => [:project_id] private def check_integrity diff --git a/redmine/app/models/issue_status.rb b/redmine/app/models/issue_status.rb index ff34cb66..ef986209 100644 --- a/redmine/app/models/issue_status.rb +++ b/redmine/app/models/issue_status.rb @@ -17,24 +17,26 @@ class IssueStatus < ActiveRecord::Base before_destroy :check_integrity - has_many :workflows, :foreign_key => "old_status_id" - - validates_presence_of :name - validates_uniqueness_of :name + has_many :workflows, :foreign_key => "old_status_id" - # Returns the default status for new issues - def self.default - find(:first, :conditions =>["is_default=?", true]) - end - - # Returns an array of all statuses the given role can switch to - def new_statuses_allowed_to(role, tracker) - statuses = [] - for workflow in self.workflows.find(:all, :include => :new_status) - statuses << workflow.new_status if workflow.role_id == role.id and workflow.tracker_id == tracker.id - end unless role.nil? - statuses - end + validates_presence_of :name + validates_uniqueness_of :name + validates_length_of :html_color, :is=>6 + validates_format_of :html_color, :with => /^[a-f0-9]*$/i + + # Returns the default status for new issues + def self.default + find(:first, :conditions =>["is_default=?", true]) + end + + # Returns an array of all statuses the given role can switch to + def new_statuses_allowed_to(role, tracker) + statuses = [] + for workflow in self.workflows + statuses << workflow.new_status if workflow.role_id == role.id and workflow.tracker_id == tracker.id + end unless role.nil? or tracker.nil? + statuses + end def name _ self.attributes['name'] diff --git a/redmine/app/models/permission.rb b/redmine/app/models/permission.rb index f6621411..e05ca0fb 100644 --- a/redmine/app/models/permission.rb +++ b/redmine/app/models/permission.rb @@ -43,7 +43,7 @@ class Permission < ActiveRecord::Base end def self.allowed_to_public(action) - @@cached_perms_for_public ||= find(:all, :conditions => ["public=?", true]).collect {|p| "#{p.controller}/#{p.action}"} + @@cached_perms_for_public ||= find(:all, :conditions => ["is_public=?", true]).collect {|p| "#{p.controller}/#{p.action}"} @@cached_perms_for_public.include? action end diff --git a/redmine/app/models/project.rb b/redmine/app/models/project.rb index 7c50ee8c..e5b5779c 100644 --- a/redmine/app/models/project.rb +++ b/redmine/app/models/project.rb @@ -16,29 +16,33 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class Project < ActiveRecord::Base - has_many :versions, :dependent => true, :order => "versions.date DESC" + has_many :versions, :dependent => true, :order => "versions.effective_date DESC" has_many :members, :dependent => true + has_many :users, :through => :members has_many :issues, :dependent => true, :order => "issues.created_on DESC", :include => :status has_many :documents, :dependent => true - has_many :news, :dependent => true, :order => "news.created_on DESC", :include => :author + has_many :news, :dependent => true, :include => :author has_many :issue_categories, :dependent => true has_and_belongs_to_many :custom_fields + acts_as_tree :order => "name", :counter_cache => true validates_presence_of :name, :descr + validates_uniqueness_of :name # returns 5 last created projects def self.latest find(:all, :limit => 5, :order => "created_on DESC") end - # Returns current version of the project - def current_version - versions.find(:first, :conditions => [ "date <= ?", Date.today ], :order => "date DESC, id DESC") - end - # Returns an array of all custom fields enabled for project issues # (explictly associated custom fields and custom fields enabled for all projects) def custom_fields_for_issues (CustomField.for_all + custom_fields).uniq - end + end + +protected + def validate + errors.add(parent_id, " must be a root project") if parent and parent.parent + errors.add_to_base("A project with subprojects can't be a subproject") if parent and projects_count > 0 + end end diff --git a/redmine/app/models/tracker.rb b/redmine/app/models/tracker.rb index 6b123d79..4283f471 100644 --- a/redmine/app/models/tracker.rb +++ b/redmine/app/models/tracker.rb @@ -20,6 +20,9 @@ class Tracker < ActiveRecord::Base has_many :issues has_many :workflows, :dependent => true + validates_presence_of :name + validates_uniqueness_of :name + def name _ self.attributes['name'] end diff --git a/redmine/app/models/user.rb b/redmine/app/models/user.rb index 1bc1b580..e0adbb0d 100644 --- a/redmine/app/models/user.rb +++ b/redmine/app/models/user.rb @@ -18,58 +18,46 @@ require "digest/sha1" class User < ActiveRecord::Base - has_many :memberships, :class_name => 'Member', :include => [ :project, :role ], :dependent => true + has_many :memberships, :class_name => 'Member', :include => [ :project, :role ], :dependent => true - attr_accessor :password - attr_accessor :last_before_login_on - # Prevents unauthorized assignments - attr_protected :admin + attr_accessor :password, :password_confirmation + attr_accessor :last_before_login_on + # Prevents unauthorized assignments + attr_protected :login, :admin, :password, :password_confirmation, :hashed_password - validates_presence_of :login, :firstname, :lastname, :mail - validates_uniqueness_of :login, :mail - - # Login must contain lettres, numbers, underscores only - validates_format_of :login, :with => /^[a-z0-9_]+$/i - validates_format_of :mail, :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i - - def before_create - self.hashed_password = User.hash_password(self.password) - end - - def after_create - @password = nil - end + validates_presence_of :login, :firstname, :lastname, :mail + validates_uniqueness_of :login, :mail + # Login must contain lettres, numbers, underscores only + validates_format_of :login, :with => /^[a-z0-9_]+$/i + validates_format_of :mail, :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i + # Password length between 4 and 12 + validates_length_of :password, :in => 4..12, :allow_nil => true + validates_confirmation_of :password, :allow_nil => true - # Returns the user that matches user's login and password - def try_to_login - @user = User.login(self.login, self.password) - unless @user.nil? - @user.last_before_login_on = @user.last_login_on - @user.update_attribute(:last_login_on, DateTime.now) - end - @user - end + def before_save + # update hashed_password if password was set + self.hashed_password = User.hash_password(self.password) if self.password + end - # Return user's full name for display - def display_name - firstname + " " + lastname #+ (self.admin ? " (Admin)" : "" ) - end + # Returns the user that matches provided login and password, or nil + def self.try_to_login(login, password) + user = find(:first, :conditions => ["login=? and hashed_password=? and locked=?", login, User.hash_password(password), false]) + if user + user.last_before_login_on = user.last_login_on + user.update_attribute(:last_login_on, Time.now) + end + user + end + + # Return user's full name for display + def display_name + firstname + " " + lastname + end + + def check_password?(clear_password) + User.hash_password(clear_password) == self.hashed_password + end - # Returns the user that matches the given login and password - def self.login(login, password) - hashed_password = hash_password(password || "") - find(:first, - :conditions => ["login = ? and hashed_password = ? and locked = ?", login, hashed_password, false]) - end - - def check_password?(clear_password) - User.hash_password(clear_password) == self.hashed_password - end - - def change_password(current_password, new_password) - self.hashed_password = User.hash_password(new_password) - save - end def role_for_project(project_id) @role_for_projects ||= @@ -82,8 +70,8 @@ class User < ActiveRecord::Base end private - # Return password digest - def self.hash_password(clear_password) - Digest::SHA1.hexdigest(clear_password) - end + # Return password digest + def self.hash_password(clear_password) + Digest::SHA1.hexdigest(clear_password || "") + end end diff --git a/redmine/app/models/version.rb b/redmine/app/models/version.rb index 02dee15c..70bd6e1c 100644 --- a/redmine/app/models/version.rb +++ b/redmine/app/models/version.rb @@ -16,12 +16,13 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class Version < ActiveRecord::Base - before_destroy :check_integrity - belongs_to :project - has_many :fixed_issues, :class_name => 'Issue', :foreign_key => 'fixed_version_id' + before_destroy :check_integrity + belongs_to :project + has_many :fixed_issues, :class_name => 'Issue', :foreign_key => 'fixed_version_id' has_many :attachments, :as => :container, :dependent => true - - validates_presence_of :name, :descr + + validates_presence_of :name + validates_uniqueness_of :name, :scope => [:project_id] private def check_integrity diff --git a/redmine/app/models/workflow.rb b/redmine/app/models/workflow.rb index 212e3335..22c873fc 100644 --- a/redmine/app/models/workflow.rb +++ b/redmine/app/models/workflow.rb @@ -16,10 +16,9 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class Workflow < ActiveRecord::Base + belongs_to :role + belongs_to :old_status, :class_name => 'IssueStatus', :foreign_key => 'old_status_id' + belongs_to :new_status, :class_name => 'IssueStatus', :foreign_key => 'new_status_id' - belongs_to :role - belongs_to :old_status, :class_name => 'IssueStatus', :foreign_key => 'old_status_id' - belongs_to :new_status, :class_name => 'IssueStatus', :foreign_key => 'new_status_id' - - validates_presence_of :role, :old_status, :new_status + validates_presence_of :role, :old_status, :new_status end diff --git a/redmine/app/views/account/login.rhtml b/redmine/app/views/account/login.rhtml index cc360eba..bc2b5a56 100644 --- a/redmine/app/views/account/login.rhtml +++ b/redmine/app/views/account/login.rhtml @@ -1,12 +1,12 @@
-

<%=_ 'Please login' %>

+

<%=_('Please login') %>

<%= start_form_tag :action=> "login" %> -


-

+


+<%= text_field_tag 'login', nil, :size => 25 %>


-

+<%= password_field_tag 'password', nil, :size => 25 %>

<%= end_form_tag %> diff --git a/redmine/app/views/account/my_account.rhtml b/redmine/app/views/account/my_account.rhtml index 34ae4885..7248f0e4 100644 --- a/redmine/app/views/account/my_account.rhtml +++ b/redmine/app/views/account/my_account.rhtml @@ -3,13 +3,14 @@

<%=_('Login')%>: <%= @user.login %>
<%=_('Created on')%>: <%= format_time(@user.created_on) %>, <%=_('Last update')%>: <%= format_time(@user.updated_on) %>

+ +<%= error_messages_for 'user' %>

<%=_('Information')%>

  <%= start_form_tag :action => 'my_account' %> - <%= error_messages_for 'user' %>


@@ -39,14 +40,14 @@   <%= start_form_tag :action => 'change_password' %> -


- <%= password_field_tag 'old_password' %>

+


+ <%= password_field_tag 'password', nil, :size => 25 %>


- <%= password_field_tag 'new_password' %>

+ <%= password_field_tag 'new_password', nil, :size => 25 %>


- <%= password_field_tag 'new_password_confirmation' %>

+ <%= password_field_tag 'new_password_confirmation', nil, :size => 25 %>

<%= submit_tag _('Save') %>
<%= end_form_tag %> diff --git a/redmine/app/views/admin/info.rhtml b/redmine/app/views/admin/info.rhtml index c73f59c2..c987805c 100644 --- a/redmine/app/views/admin/info.rhtml +++ b/redmine/app/views/admin/info.rhtml @@ -1,4 +1,10 @@

<%=_('Information')%>

-<%=_('Version')%>: <%= RDM_APP_NAME %> <%= RDM_APP_VERSION %>
-<%=_('Database')%>: <%= @adapter_name %> \ No newline at end of file +

<%=_('Version')%>: <%= RDM_APP_NAME %> <%= RDM_APP_VERSION %>

+ +Environment: +
    +<% Rails::Info.properties.each do |name, value| %> +
  • <%= name %>: <%= value %>
  • +<% end %> +
\ No newline at end of file diff --git a/redmine/app/views/admin/projects.rhtml b/redmine/app/views/admin/projects.rhtml index dd395351..bcb940b4 100644 --- a/redmine/app/views/admin/projects.rhtml +++ b/redmine/app/views/admin/projects.rhtml @@ -2,20 +2,20 @@ - <%= sort_header_tag('projects.name', :caption => _('Project')) %> + <%= sort_header_tag('name', :caption => _('Project')) %> - - <%= sort_header_tag('projects.created_on', :caption => _('Created on')) %> + + + <%= sort_header_tag('created_on', :caption => _('Created on')) %> -<% odd_or_even = 1 - for project in @projects - odd_or_even = 1 - odd_or_even %> - +<% for project in @projects %> + ">
<%=_('Description')%><%=_('Public')%><%=_('Public')%><%=_('Subprojects')%>
<%= link_to project.name, :controller => 'projects', :action => 'settings', :id => project %> <%= project.descr %> - <%= image_tag 'true' if project.public? %> + <%= image_tag 'true' if project.is_public? %> + <%= project.projects_count %> <%= format_date(project.created_on) %> <%= start_form_tag({:controller => 'projects', :action => 'destroy', :id => project}) %> @@ -26,10 +26,7 @@ <% end %>
-<%= link_to ('« ' + _('Previous')), { :page => @project_pages.current.previous } if @project_pages.current.previous %> -<%= pagination_links(@project_pages) %> -<%= link_to (_('Next') + ' »'), { :page => @project_pages.current.next } if @project_pages.current.next %> - -
- -<%= link_to ('» ' + _('New project')), :controller => 'projects', :action => 'add' %> \ No newline at end of file +

<%= pagination_links_full @project_pages %> +[ <%= @project_pages.current.first_item %> - <%= @project_pages.current.last_item %> / <%= @project_count %> ]

+ +

<%= link_to ('» ' + _('New project')), :controller => 'projects', :action => 'add' %>

\ No newline at end of file diff --git a/redmine/app/views/custom_fields/list.rhtml b/redmine/app/views/custom_fields/list.rhtml index 0e29a5b3..2e654072 100644 --- a/redmine/app/views/custom_fields/list.rhtml +++ b/redmine/app/views/custom_fields/list.rhtml @@ -10,7 +10,7 @@ <% for custom_field in @custom_fields %> - + "> <%= link_to custom_field.name, :action => 'edit', :id => custom_field %> <%= CustomField::TYPES[custom_field.typ][0] %> <%= image_tag 'true' if custom_field.is_required? %> diff --git a/redmine/app/views/documents/show.rhtml b/redmine/app/views/documents/show.rhtml index bc9557e5..8e09bb2f 100644 --- a/redmine/app/views/documents/show.rhtml +++ b/redmine/app/views/documents/show.rhtml @@ -24,14 +24,16 @@ <%= link_to attachment.filename, :action => 'download', :id => @document, :attachment_id => attachment %> <%= format_date(attachment.created_on) %> <%= attachment.author.display_name %> - <%= human_size(attachment.size) %>
<%= attachment.downloads %> <%=_('download')%>(s) + <%= human_size(attachment.filesize) %>
<%= attachment.downloads %> <%=_('download')%>(s) + <% if authorize_for('documents', 'destroy_attachment') %> <%= start_form_tag :action => 'destroy_attachment', :id => @document, :attachment_id => attachment %> <%= submit_tag _('Delete'), :class => "button-small" %> <%= end_form_tag %> - <% end %> + <% end %> + <% end %>
diff --git a/redmine/app/views/issue_statuses/_form.rhtml b/redmine/app/views/issue_statuses/_form.rhtml index 5f4b9ce3..7c4d6367 100644 --- a/redmine/app/views/issue_statuses/_form.rhtml +++ b/redmine/app/views/issue_statuses/_form.rhtml @@ -1,7 +1,7 @@ <%= error_messages_for 'issue_status' %> -


+

*
<%= text_field 'issue_status', 'name' %>

<%= check_box 'issue_status', 'is_closed' %> @@ -11,7 +11,7 @@

-#<%= text_field 'issue_status', 'html_color', :size => 6 %>

+#<%= text_field 'issue_status', 'html_color', :maxlength => 6 %> *

diff --git a/redmine/app/views/issue_statuses/list.rhtml b/redmine/app/views/issue_statuses/list.rhtml index 050e08f0..8c053226 100644 --- a/redmine/app/views/issue_statuses/list.rhtml +++ b/redmine/app/views/issue_statuses/list.rhtml @@ -10,10 +10,10 @@ <% for status in @issue_statuses %> - + "> <%= link_to status.name, :action => 'edit', :id => status %> - <%= image_tag 'true' if status.is_default %> - <%= image_tag 'true' if status.is_closed %> + <%= image_tag 'true' if status.is_default? %> + <%= image_tag 'true' if status.is_closed? %>   <%= start_form_tag :action => 'destroy', :id => status %> diff --git a/redmine/app/views/issues/show.rhtml b/redmine/app/views/issues/show.rhtml index 1c20c92d..58c9b357 100644 --- a/redmine/app/views/issues/show.rhtml +++ b/redmine/app/views/issues/show.rhtml @@ -10,7 +10,7 @@

<%=_('Assigned to')%>: <%= @issue.assigned_to.display_name unless @issue.assigned_to.nil? %>

<%=_('Subject')%>: <%= @issue.subject %>

-

<%=_('Description')%>: <%= @issue.descr %>

+

<%=_('Description')%>: <%= simple_format auto_link @issue.descr %>

<%=_('Created on')%>: <%= format_date(@issue.created_on) %>

<% if authorize_for('issues', 'edit') %> @@ -65,7 +65,7 @@ <% for attachment in @issue.attachments %> - + <% if authorize_for('issues', 'destroy_attachment') %> diff --git a/redmine/app/views/layouts/base.rhtml b/redmine/app/views/layouts/base.rhtml index 731632fa..21bb036d 100644 --- a/redmine/app/views/layouts/base.rhtml +++ b/redmine/app/views/layouts/base.rhtml @@ -81,7 +81,7 @@ diff --git a/redmine/app/views/news/show.rhtml b/redmine/app/views/news/show.rhtml index 30aa2cda..d6773cda 100644 --- a/redmine/app/views/news/show.rhtml +++ b/redmine/app/views/news/show.rhtml @@ -6,5 +6,5 @@ <%=_('Date')%>: <%= format_time(@news.created_on) %>

-<%= @news.descr %> +<%= simple_format auto_link @news.descr %> diff --git a/redmine/app/views/projects/_form.rhtml b/redmine/app/views/projects/_form.rhtml index 2d38117a..89f58354 100644 --- a/redmine/app/views/projects/_form.rhtml +++ b/redmine/app/views/projects/_form.rhtml @@ -4,15 +4,23 @@


<%= text_field 'project', 'name' %>

+<% if session[:user].admin %> +


+

+<% end %> +


-<%= text_field 'project', 'descr', :size => 60 %>

+<%= text_area 'project', 'descr', :cols => 60, :rows => 3 %>


<%= text_field 'project', 'homepage', :size => 40 %>

-

<%= check_box 'project', 'public' %> -

- +

<%= check_box 'project', 'is_public' %> +

+
<%=_('Custom fields')%> <% for custom_field in @custom_fields %> <% fixed_issues.each do |version, issues| %> -

<%= version.name %> - <%= format_date(version.date) %>
+

<%= version.name %> - <%= format_date(version.effective_date) %>
<%=h version.descr %>

    <% issues.each do |i| %> diff --git a/redmine/app/views/projects/list.rhtml b/redmine/app/views/projects/list.rhtml index 2b2ac2d1..bee507af 100644 --- a/redmine/app/views/projects/list.rhtml +++ b/redmine/app/views/projects/list.rhtml @@ -2,15 +2,13 @@
<%= link_to attachment.filename, :action => 'download', :id => @issue, :attachment_id => attachment %> (<%= human_size(attachment.size) %>)<%= link_to attachment.filename, :action => 'download', :id => @issue, :attachment_id => attachment %> (<%= human_size(attachment.filesize) %>) <%= format_date(attachment.created_on) %> <%= attachment.author.display_name %>
- <%= sort_header_tag('projects.name', :caption => _('Project')) %> + <%= sort_header_tag('name', :caption => _('Project')) %> - <%= sort_header_tag('projects.created_on', :caption => _('Created on')) %> + <%= sort_header_tag('created_on', :caption => _('Created on')) %> -<% odd_or_even = 1 - for project in @projects - odd_or_even = 1 - odd_or_even %> - +<% for project in @projects %> + "> - <% odd_or_even = 1 - for file in version.attachments - odd_or_even = 1 - odd_or_even %> - + <% for file in version.attachments %> + "> - + <% if delete_allowed %> @@ -35,7 +33,8 @@ <% end %> - <% end %> + <% end + reset_cycle %> <% end %>
Description
<%= link_to project.name, :action => 'show', :id => project %> <%= project.descr %> <%= format_date(project.created_on) %> diff --git a/redmine/app/views/projects/list_files.rhtml b/redmine/app/views/projects/list_files.rhtml index 217e679b..ced6400b 100644 --- a/redmine/app/views/projects/list_files.rhtml +++ b/redmine/app/views/projects/list_files.rhtml @@ -17,14 +17,12 @@
<%= image_tag 'package' %> <%= version.name %>
<%= link_to file.filename, :controller => 'versions', :action => 'download', :id => version, :attachment_id => file %> <%= format_date(file.created_on) %><%= human_size(file.size) %><%= human_size(file.filesize) %> <%= file.downloads %> <%= file.digest %>
diff --git a/redmine/app/views/projects/list_issues.rhtml b/redmine/app/views/projects/list_issues.rhtml index c01358ef..7e32fb25 100644 --- a/redmine/app/views/projects/list_issues.rhtml +++ b/redmine/app/views/projects/list_issues.rhtml @@ -3,17 +3,19 @@
- - - - - + + + + + + + diff --git a/redmine/app/views/projects/show.rhtml b/redmine/app/views/projects/show.rhtml index 3f10654f..4fdbe51b 100644 --- a/redmine/app/views/projects/show.rhtml +++ b/redmine/app/views/projects/show.rhtml @@ -13,8 +13,8 @@ <% for tracker in Tracker.find_all %>
  • <%= link_to tracker.name, :controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1, - "issues.tracker_id" => tracker.id %>: - <%= tracker.issues.count(["project_id=?", @project.id]) %> <%=_('open')%> + "tracker_id" => tracker.id %>: + <%= Issue.count(:conditions => ["project_id=? and tracker_id=? and issue_statuses.is_closed=?", @project.id, tracker.id, false], :include => :status) %> <%=_('open')%>
  • <% end %> @@ -32,9 +32,18 @@ <% end %> + <% if @subprojects %> +
    +

    <%= image_tag "projects" %> <%=_('Subprojects')%>

    + <% for subproject in @subprojects %> + <%= link_to subproject.name, :action => 'show', :id => subproject %>
    + <% end %> +
    + <% end %> +

    <%=_('Latest news')%>

    - <% for news in @project.news %> + <% for news in @news %>

    <%= news.title %> (<%= link_to_user news.author %> <%= format_time(news.created_on) %>)
    <%= news.shortdescr %> diff --git a/redmine/app/views/roles/list.rhtml b/redmine/app/views/roles/list.rhtml index 146e4588..eb1a9ecc 100644 --- a/redmine/app/views/roles/list.rhtml +++ b/redmine/app/views/roles/list.rhtml @@ -7,7 +7,7 @@ <% for role in @roles %> -

    + "> <% for tracker in @trackers %> - + ">
    <%=_('Status')%>:
    <%= search_filter_tag("status_id") %>
    <%=_('Tracker')%>:
    <%= search_filter_tag("tracker_id") %>
    <%=_('Priority')%>:
    <%= search_filter_tag("priority_id") %>
    <%=_('Category')%>:
    <%= search_filter_tag("category_id") %>
    <%=_('Assigned to')%>:
    <%= search_filter_tag("assigned_to_id") %>
    <%=_('Status')%>:
    <%= search_filter_tag 'status_id', :class => 'select-small' %>
    <%=_('Tracker')%>:
    <%= search_filter_tag 'tracker_id', :class => 'select-small' %>
    <%=_('Priority')%>:
    <%= search_filter_tag 'priority_id', :class => 'select-small' %>
    <%=_('Category')%>:
    <%= search_filter_tag 'category_id', :class => 'select-small' %>
    <%=_('Assigned to')%>:
    <%= search_filter_tag 'assigned_to_id', :class => 'select-small' %>
    <%=_('Subprojects')%>:
    <%= search_filter_tag 'subproject_id', :class => 'select-small' %>
    - <%= submit_tag _('Apply filter') %> + <%= submit_tag _('Apply filter'), :class => 'button-small' %> <%= end_form_tag %> <%= start_form_tag %> - <%= submit_tag _('Reset') %> + <%= submit_tag _('Reset'), :class => 'button-small' %> <%= end_form_tag %>
    <%= link_to role.name, :action => 'edit', :id => role %> <%= start_form_tag :action => 'destroy', :id => role %> diff --git a/redmine/app/views/trackers/list.rhtml b/redmine/app/views/trackers/list.rhtml index 3622a40f..8b03a141 100644 --- a/redmine/app/views/trackers/list.rhtml +++ b/redmine/app/views/trackers/list.rhtml @@ -7,7 +7,7 @@
    <%= link_to tracker.name, :action => 'edit', :id => tracker %> <%= start_form_tag :action => 'destroy', :id => tracker %> diff --git a/redmine/app/views/users/_form.rhtml b/redmine/app/views/users/_form.rhtml index 92f1e0e5..6574cb02 100644 --- a/redmine/app/views/users/_form.rhtml +++ b/redmine/app/views/users/_form.rhtml @@ -2,10 +2,13 @@


    -<%= text_field 'user', 'login' %>

    +<%= text_field 'user', 'login', :size => 25 %>

    -


    -<%= password_field 'user', 'password' %>

    +


    +<%= password_field_tag 'password', nil, :size => 25 %>

    + +


    +<%= password_field_tag 'password_confirmation', nil, :size => 25 %>


    <%= text_field 'user', 'firstname' %>

    diff --git a/redmine/app/views/users/list.rhtml b/redmine/app/views/users/list.rhtml index b1bf937a..3e3c2165 100644 --- a/redmine/app/views/users/list.rhtml +++ b/redmine/app/views/users/list.rhtml @@ -2,18 +2,18 @@ - <%= sort_header_tag('users.login', :caption => _('Login')) %> - <%= sort_header_tag('users.firstname', :caption => _('Firstname')) %> - <%= sort_header_tag('users.lastname', :caption => _('Lastname')) %> + <%= sort_header_tag('login', :caption => _('Login')) %> + <%= sort_header_tag('firstname', :caption => _('Firstname')) %> + <%= sort_header_tag('lastname', :caption => _('Lastname')) %> - <%= sort_header_tag('users.admin', :caption => _('Admin')) %> - <%= sort_header_tag('users.locked', :caption => _('Locked')) %> - <%= sort_header_tag('users.created_on', :caption => _('Created on')) %> - <%= sort_header_tag('users.last_login_on', :caption => _('Last login')) %> + <%= sort_header_tag('admin', :caption => _('Admin')) %> + <%= sort_header_tag('locked', :caption => _('Locked')) %> + <%= sort_header_tag('created_on', :caption => _('Created on')) %> + <%= sort_header_tag('last_login_on', :caption => _('Last login')) %> <% for user in @users %> - + "> @@ -25,10 +25,10 @@
    <%=_('Mail')%>
    <%= link_to user.login, :action => 'edit', :id => user %> <%= user.firstname %> <%= user.lastname %> <%= start_form_tag :action => 'edit', :id => user %> <% if user.locked? %> - <%= hidden_field_tag 'user[locked]', false %> + <%= hidden_field_tag 'user[locked]', 0 %> <%= submit_tag _('Unlock'), :class => "button-small" %> <% else %> - <%= hidden_field_tag 'user[locked]', true %> + <%= hidden_field_tag 'user[locked]', 1 %> <%= submit_tag _('Lock'), :class => "button-small" %> <% end %> <%= end_form_tag %> diff --git a/redmine/app/views/versions/_form.rhtml b/redmine/app/views/versions/_form.rhtml index 189e106c..71c761e3 100644 --- a/redmine/app/views/versions/_form.rhtml +++ b/redmine/app/views/versions/_form.rhtml @@ -1,13 +1,13 @@ <%= error_messages_for 'version' %> -


    +

    *
    <%= text_field 'version', 'name', :size => 20 %>


    <%= text_field 'version', 'descr', :size => 60 %>

    -


    -<%= date_select 'version', 'date' %>

    +


    +<%= date_select 'version', 'effective_date' %>

    diff --git a/redmine/app/views/welcome/index.rhtml b/redmine/app/views/welcome/index.rhtml index cbffa82e..89a18f10 100644 --- a/redmine/app/views/welcome/index.rhtml +++ b/redmine/app/views/welcome/index.rhtml @@ -2,7 +2,7 @@

    <%=_('Welcome')%> !

    -

    Latest news

    +

    <%=_('Latest news')%>

    <% for news in @news %>

    <%= news.title %> (<%= link_to_user news.author %> <%= format_time(news.created_on) %> - <%= news.project.name %>)
    @@ -16,7 +16,7 @@

    -

    Latest projects

    +

    <%=_('Latest projects')%>

      <% for project in @projects %>
    • diff --git a/redmine/config/database.yml b/redmine/config/database.yml index f65dc8cb..cfb6f13d 100644 --- a/redmine/config/database.yml +++ b/redmine/config/database.yml @@ -5,6 +5,14 @@ # (on OS X: gem install mysql -- --include=/usr/local/lib) # And be sure to use new-style password hashing: # http://dev.mysql.com/doc/refman/5.0/en/old-client.html + +production: + adapter: mysql + database: redmine + host: localhost + username: root + password: + development: adapter: mysql database: redmine_development @@ -18,6 +26,17 @@ development_pgsql: host: localhost username: postgres password: "postgres" + +development_oracle: + adapter: oci + host: 192.168.0.14 + username: rails + password: "rails" + +development_sqlserver: + adapter: sqlserver + host: localhost,1157 + database: redmine test: adapter: mysql @@ -25,15 +44,26 @@ test: host: localhost username: root password: - + +test_pgsql: + adapter: postgresql + database: redmine + host: localhost + username: postgres + password: "postgres" + +test_oracle: + adapter: oci + host: 192.168.0.14 + username: rails_test + password: "rails" + +test_sqlserver: + adapter: sqlserver + host: localhost,1157 + database: redmine_test + demo: adapter: sqlite3 dbfile: db/redmine_demo.db -production: - adapter: mysql - database: redmine - host: localhost - username: root - password: - \ No newline at end of file diff --git a/redmine/config/environment.rb b/redmine/config/environment.rb index de12e7c3..acba82e7 100644 --- a/redmine/config/environment.rb +++ b/redmine/config/environment.rb @@ -73,7 +73,7 @@ end # application name RDM_APP_NAME = "redMine" # application version -RDM_APP_VERSION = "0.1.0" +RDM_APP_VERSION = "0.2.0" # application host name RDM_HOST_NAME = "somenet.foo" # file storage path diff --git a/redmine/config/environments/development_oracle.rb b/redmine/config/environments/development_oracle.rb new file mode 100644 index 00000000..04b77920 --- /dev/null +++ b/redmine/config/environments/development_oracle.rb @@ -0,0 +1,19 @@ +# Settings specified here will take precedence over those in config/environment.rb + +# In the development environment your application's code is reloaded on +# every request. This slows down response time but is perfect for development +# since you don't have to restart the webserver when you make code changes. +config.cache_classes = false + +# Log error messages when you accidentally call methods on nil. +config.whiny_nils = true + +# Enable the breakpoint server that script/breakpointer connects to +config.breakpoint_server = true + +# Show full error reports and disable caching +config.action_controller.consider_all_requests_local = true +config.action_controller.perform_caching = false + +# Don't care if the mailer can't send +config.action_mailer.raise_delivery_errors = false diff --git a/redmine/config/environments/development_sqlserver.rb b/redmine/config/environments/development_sqlserver.rb new file mode 100644 index 00000000..04b77920 --- /dev/null +++ b/redmine/config/environments/development_sqlserver.rb @@ -0,0 +1,19 @@ +# Settings specified here will take precedence over those in config/environment.rb + +# In the development environment your application's code is reloaded on +# every request. This slows down response time but is perfect for development +# since you don't have to restart the webserver when you make code changes. +config.cache_classes = false + +# Log error messages when you accidentally call methods on nil. +config.whiny_nils = true + +# Enable the breakpoint server that script/breakpointer connects to +config.breakpoint_server = true + +# Show full error reports and disable caching +config.action_controller.consider_all_requests_local = true +config.action_controller.perform_caching = false + +# Don't care if the mailer can't send +config.action_mailer.raise_delivery_errors = false diff --git a/redmine/config/environments/test_oracle.rb b/redmine/config/environments/test_oracle.rb new file mode 100644 index 00000000..0b34ef19 --- /dev/null +++ b/redmine/config/environments/test_oracle.rb @@ -0,0 +1,15 @@ +# Settings specified here will take precedence over those in config/environment.rb + +# The test environment is used exclusively to run your application's +# test suite. You never need to work with it otherwise. Remember that +# your test database is "scratch space" for the test suite and is wiped +# and recreated between test runs. Don't rely on the data there! +config.cache_classes = true + +# Log error messages when you accidentally call methods on nil. +config.whiny_nils = true + +# Show full error reports and disable caching +config.action_controller.consider_all_requests_local = true +config.action_controller.perform_caching = false + diff --git a/redmine/config/environments/test_pgsql.rb b/redmine/config/environments/test_pgsql.rb new file mode 100644 index 00000000..0b34ef19 --- /dev/null +++ b/redmine/config/environments/test_pgsql.rb @@ -0,0 +1,15 @@ +# Settings specified here will take precedence over those in config/environment.rb + +# The test environment is used exclusively to run your application's +# test suite. You never need to work with it otherwise. Remember that +# your test database is "scratch space" for the test suite and is wiped +# and recreated between test runs. Don't rely on the data there! +config.cache_classes = true + +# Log error messages when you accidentally call methods on nil. +config.whiny_nils = true + +# Show full error reports and disable caching +config.action_controller.consider_all_requests_local = true +config.action_controller.perform_caching = false + diff --git a/redmine/config/environments/test_sqlserver.rb b/redmine/config/environments/test_sqlserver.rb new file mode 100644 index 00000000..0b34ef19 --- /dev/null +++ b/redmine/config/environments/test_sqlserver.rb @@ -0,0 +1,15 @@ +# Settings specified here will take precedence over those in config/environment.rb + +# The test environment is used exclusively to run your application's +# test suite. You never need to work with it otherwise. Remember that +# your test database is "scratch space" for the test suite and is wiped +# and recreated between test runs. Don't rely on the data there! +config.cache_classes = true + +# Log error messages when you accidentally call methods on nil. +config.whiny_nils = true + +# Show full error reports and disable caching +config.action_controller.consider_all_requests_local = true +config.action_controller.perform_caching = false + diff --git a/redmine/config/help.yml b/redmine/config/help.yml index a48798e0..362165bf 100644 --- a/redmine/config/help.yml +++ b/redmine/config/help.yml @@ -1,21 +1,62 @@ -# administration -admin: - index: administration.html - mail_options: administration.html#mail_notifications - info: administration.html#app_info -users: - index: administration.html#users -roles: - index: administration.html#roles - workflow: administration.html#workflow -trackers: - index: administration.html#trackers -issue_statuses: - index: administration.html#issue_statuses +# redMine - project management software +# Copyright (C) 2006 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# projects -projects: - add: projects.html#settings +# available languages for help pages +langs: + - fr - -# issues \ No newline at end of file +# mapping between controller/action and help pages +# if action is not defined here, 'index' page will be displayed +pages: + # administration + admin: + index: ch01.html + mail_options: ch01s08.html + info: ch01s09.html + users: + index: ch01s01.html + roles: + index: ch01s02.html + workflow: ch01s06.html + trackers: + index: ch01s03.html + issue_statuses: + index: ch01s05.html + # projects + projects: + index: ch02.html + add: ch02s08.html + show: ch02s01.html + add_document: ch02s06.html + list_documents: ch02s06.html + add_issue: ch02s02.html + list_issues: ch02s02.html + add_news: ch02s05.html + list_news: ch02s05.html + add_file: ch02s07.html + list_files: ch02s07.html + changelog: ch02s04.html + issues: + index: ch02s02.html + documents: + index: ch02s06.html + news: + index: ch02s05.html + versions: + index: ch02s08.html + reports: + index: ch02s03.html \ No newline at end of file diff --git a/redmine/db/migrate/001_setup.rb b/redmine/db/migrate/001_setup.rb index c075c89f..17487fcc 100644 --- a/redmine/db/migrate/001_setup.rb +++ b/redmine/db/migrate/001_setup.rb @@ -1,3 +1,20 @@ +# redMine - project management software +# Copyright (C) 2006 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + class Setup < ActiveRecord::Migration def self.up create_table "attachments", :force => true do |t| @@ -5,8 +22,8 @@ class Setup < ActiveRecord::Migration t.column "container_type", :string, :limit => 30, :default => "", :null => false t.column "filename", :string, :default => "", :null => false t.column "disk_filename", :string, :default => "", :null => false - t.column "size", :integer, :default => 0, :null => false - t.column "content_type", :string, :limit => 60, :default => "", :null => false + t.column "filesize", :integer, :default => 0, :null => false + t.column "content_type", :string, :limit => 60, :default => "" t.column "digest", :string, :limit => 40, :default => "", :null => false t.column "downloads", :integer, :default => 0, :null => false t.column "author_id", :integer, :default => 0, :null => false @@ -18,8 +35,8 @@ class Setup < ActiveRecord::Migration t.column "typ", :integer, :default => 0, :null => false t.column "is_required", :boolean, :default => false, :null => false t.column "is_for_all", :boolean, :default => false, :null => false - t.column "possible_values", :text, :default => "", :null => false - t.column "regexp", :string, :default => "", :null => false + t.column "possible_values", :text, :default => "" + t.column "regexp", :string, :default => "" t.column "min_length", :integer, :default => 0, :null => false t.column "max_length", :integer, :default => 0, :null => false end @@ -59,7 +76,7 @@ class Setup < ActiveRecord::Migration t.column "issue_id", :integer, :default => 0, :null => false t.column "status_id", :integer, :default => 0, :null => false t.column "author_id", :integer, :default => 0, :null => false - t.column "notes", :text, :default => "", :null => false + t.column "notes", :text, :default => "" t.column "created_on", :timestamp end @@ -99,7 +116,7 @@ class Setup < ActiveRecord::Migration create_table "news", :force => true do |t| t.column "project_id", :integer t.column "title", :string, :limit => 60, :default => "", :null => false - t.column "shortdescr", :string, :default => "", :null => false + t.column "shortdescr", :string, :default => "" t.column "descr", :text, :default => "", :null => false t.column "author_id", :integer, :default => 0, :null => false t.column "created_on", :timestamp @@ -109,7 +126,7 @@ class Setup < ActiveRecord::Migration t.column "controller", :string, :limit => 30, :default => "", :null => false t.column "action", :string, :limit => 30, :default => "", :null => false t.column "descr", :string, :limit => 60, :default => "", :null => false - t.column "public", :boolean, :default => false, :null => false + t.column "is_public", :boolean, :default => false, :null => false t.column "sort", :integer, :default => 0, :null => false t.column "mail_option", :boolean, :default => false, :null => false t.column "mail_enabled", :boolean, :default => false, :null => false @@ -125,8 +142,10 @@ class Setup < ActiveRecord::Migration create_table "projects", :force => true do |t| t.column "name", :string, :limit => 30, :default => "", :null => false t.column "descr", :string, :default => "", :null => false - t.column "homepage", :string, :limit => 60, :default => "", :null => false - t.column "public", :boolean, :default => true, :null => false + t.column "homepage", :string, :limit => 60, :default => "" + t.column "is_public", :boolean, :default => true, :null => false + t.column "parent_id", :integer + t.column "projects_count", :integer, :default => 0 t.column "created_on", :timestamp t.column "updated_on", :timestamp end @@ -158,8 +177,8 @@ class Setup < ActiveRecord::Migration create_table "versions", :force => true do |t| t.column "project_id", :integer, :default => 0, :null => false t.column "name", :string, :limit => 30, :default => "", :null => false - t.column "descr", :string, :default => "", :null => false - t.column "date", :date, :null => false + t.column "descr", :string, :default => "" + t.column "effective_date", :date, :null => false t.column "created_on", :timestamp t.column "updated_on", :timestamp end @@ -172,13 +191,13 @@ class Setup < ActiveRecord::Migration end # project - Permission.create :controller => "projects", :action => "show", :descr => "Overview", :sort => 100, :public => true - Permission.create :controller => "projects", :action => "changelog", :descr => "View change log", :sort => 105, :public => true - Permission.create :controller => "reports", :action => "issue_report", :descr => "View reports", :sort => 110, :public => true + Permission.create :controller => "projects", :action => "show", :descr => "Overview", :sort => 100, :is_public => true + Permission.create :controller => "projects", :action => "changelog", :descr => "View change log", :sort => 105, :is_public => true + Permission.create :controller => "reports", :action => "issue_report", :descr => "View reports", :sort => 110, :is_public => true Permission.create :controller => "projects", :action => "settings", :descr => "Settings", :sort => 150 Permission.create :controller => "projects", :action => "edit", :descr => "Edit", :sort => 151 # members - Permission.create :controller => "projects", :action => "list_members", :descr => "View list", :sort => 200, :public => true + Permission.create :controller => "projects", :action => "list_members", :descr => "View list", :sort => 200, :is_public => true Permission.create :controller => "projects", :action => "add_member", :descr => "New member", :sort => 220 Permission.create :controller => "members", :action => "edit", :descr => "Edit", :sort => 221 Permission.create :controller => "members", :action => "destroy", :descr => "Delete", :sort => 222 @@ -191,9 +210,9 @@ class Setup < ActiveRecord::Migration Permission.create :controller => "issue_categories", :action => "edit", :descr => "Edit", :sort => 421 Permission.create :controller => "issue_categories", :action => "destroy", :descr => "Delete", :sort => 422 # issues - Permission.create :controller => "projects", :action => "list_issues", :descr => "View list", :sort => 1000, :public => true - Permission.create :controller => "issues", :action => "show", :descr => "View", :sort => 1005, :public => true - Permission.create :controller => "issues", :action => "download", :descr => "Download file", :sort => 1010, :public => true + Permission.create :controller => "projects", :action => "list_issues", :descr => "View list", :sort => 1000, :is_public => true + Permission.create :controller => "issues", :action => "show", :descr => "View", :sort => 1005, :is_public => true + Permission.create :controller => "issues", :action => "download", :descr => "Download file", :sort => 1010, :is_public => true Permission.create :controller => "projects", :action => "add_issue", :descr => "Report an issue", :sort => 1050, :mail_option => 1, :mail_enabled => 1 Permission.create :controller => "issues", :action => "edit", :descr => "Edit", :sort => 1055 Permission.create :controller => "issues", :action => "change_status", :descr => "Change status", :sort => 1060, :mail_option => 1, :mail_enabled => 1 @@ -201,28 +220,30 @@ class Setup < ActiveRecord::Migration Permission.create :controller => "issues", :action => "add_attachment", :descr => "Add file", :sort => 1070 Permission.create :controller => "issues", :action => "destroy_attachment", :descr => "Delete file", :sort => 1075 # news - Permission.create :controller => "projects", :action => "list_news", :descr => "View list", :sort => 1100, :public => true - Permission.create :controller => "news", :action => "show", :descr => "View", :sort => 1101, :public => true + Permission.create :controller => "projects", :action => "list_news", :descr => "View list", :sort => 1100, :is_public => true + Permission.create :controller => "news", :action => "show", :descr => "View", :sort => 1101, :is_public => true Permission.create :controller => "projects", :action => "add_news", :descr => "Add", :sort => 1120 Permission.create :controller => "news", :action => "edit", :descr => "Edit", :sort => 1121 Permission.create :controller => "news", :action => "destroy", :descr => "Delete", :sort => 1122 # documents - Permission.create :controller => "projects", :action => "list_documents", :descr => "View list", :sort => 1200, :public => true - Permission.create :controller => "documents", :action => "show", :descr => "View", :sort => 1201, :public => true - Permission.create :controller => "documents", :action => "download", :descr => "Download", :sort => 1202, :public => true + Permission.create :controller => "projects", :action => "list_documents", :descr => "View list", :sort => 1200, :is_public => true + Permission.create :controller => "documents", :action => "show", :descr => "View", :sort => 1201, :is_public => true + Permission.create :controller => "documents", :action => "download", :descr => "Download", :sort => 1202, :is_public => true Permission.create :controller => "projects", :action => "add_document", :descr => "Add", :sort => 1220 Permission.create :controller => "documents", :action => "edit", :descr => "Edit", :sort => 1221 Permission.create :controller => "documents", :action => "destroy", :descr => "Delete", :sort => 1222 Permission.create :controller => "documents", :action => "add_attachment", :descr => "Add file", :sort => 1223 Permission.create :controller => "documents", :action => "destroy_attachment", :descr => "Delete file", :sort => 1224 # files - Permission.create :controller => "projects", :action => "list_files", :descr => "View list", :sort => 1300, :public => true - Permission.create :controller => "versions", :action => "download", :descr => "Download", :sort => 1301, :public => true + Permission.create :controller => "projects", :action => "list_files", :descr => "View list", :sort => 1300, :is_public => true + Permission.create :controller => "versions", :action => "download", :descr => "Download", :sort => 1301, :is_public => true Permission.create :controller => "projects", :action => "add_file", :descr => "Add", :sort => 1320 Permission.create :controller => "versions", :action => "destroy_file", :descr => "Delete", :sort => 1322 # create default administrator account - user = User.create :login => "admin", :password => "admin", :firstname => "redMine", :lastname => "Admin", :mail => "admin@somenet.foo", :mail_notification => true, :language => "en" + user = User.create :firstname => "redMine", :lastname => "Admin", :mail => "admin@somenet.foo", :mail_notification => true, :language => "en" + user.login = "admin" + user.password = "admin" user.admin = true user.save diff --git a/redmine/db/migrate/002_default_configuration.rb b/redmine/db/migrate/002_default_configuration.rb index 8f851dfb..794a96b2 100644 --- a/redmine/db/migrate/002_default_configuration.rb +++ b/redmine/db/migrate/002_default_configuration.rb @@ -1,12 +1,29 @@ +# redMine - project management software +# Copyright (C) 2006 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + class DefaultConfiguration < ActiveRecord::Migration def self.up # roles r = Role.create(:name => "Manager") r.permissions = Permission.find(:all) r = Role.create :name => "Developer" - r.permissions = Permission.find([1, 2, 3, 6, 10, 11, 12, 16, 17, 18, 19, 20, 21, 23, 25, 26, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41]) + r.permissions = Permission.find(:all) r = Role.create :name => "Reporter" - r.permissions = Permission.find([1, 2, 3, 6, 16, 17, 18, 19, 20, 21, 23, 25, 26, 30, 31, 32, 38, 39]) + r.permissions = Permission.find(:all) # trackers Tracker.create(:name => "Bug", :is_in_chlog => true) Tracker.create(:name => "Feature request", :is_in_chlog => true) diff --git a/redmine/doc/CHANGELOG b/redmine/doc/CHANGELOG index bae2e1bd..a6964124 100644 --- a/redmine/doc/CHANGELOG +++ b/redmine/doc/CHANGELOG @@ -2,13 +2,22 @@ redMine - project management software Copyright (C) 2006 Jean-Philippe Lang -http://redmine.sourceforge.net/ +http://redmine.org/ -== xx/xx/2006 +== 07/09/2006 - v0.2.0 -* More filter options in issues list -* Issues list exportable to CSV +* new databases supported: Oracle, PostgreSQL, SQL Server +* projects/subprojects hierarchy (1 level of subprojects only) +* environment information display in admin/info +* more filter options in issues list (rev6) +* default language based on browser settings (Accept-Language HTTP header) +* issues list exportable to CSV (rev6) +* simple_format and auto_link on long text fields +* more data validations +* Fixed: error when all mail notifications are unchecked in admin/mail_options +* Fixed: all project news are displayed on project summary +* Fixed: Can't change user password in users/edit * Fixed: Error on tables creation with PostgreSQL (rev5) * Fixed: SQL error in "issue reports" view with PostgreSQL (rev5) diff --git a/redmine/doc/INSTALL b/redmine/doc/INSTALL index 72a99368..e263a66e 100644 --- a/redmine/doc/INSTALL +++ b/redmine/doc/INSTALL @@ -2,15 +2,23 @@ redMine - project management software Copyright (C) 2006 Jean-Philippe Lang -http://redmine.sourceforge.net/ +http://redmine.org/ == Requirements * Ruby on Rails 1.1 -* Any database supported by Rails (developped using MySQL 5) +* a database (see compatibility below) * (recommended) Apache/Lighttpd with FCGI support +Supported databases: + +* MySQL (tested with MySQL 5) +* PostgreSQL (tested with PostgreSQL 8.1) +* Oracle (tested with Oracle 10g) +* SQL Server (tested with SQL Server 2005) +* SQLite (tested with SQLite 3) + == Installation @@ -20,9 +28,9 @@ http://redmine.sourceforge.net/ 2. Create an empty database: "redmine" for example 3. Configure database parameters in config/database.yml - for "production" environment + for "production" environment (default database is MySQL) -4. Create database structure. Under application main directory: +4. Create the database structure. Under application main directory: rake migrate RAILS_ENV="production" It will create tables and default configuration data diff --git a/redmine/doc/README b/redmine/doc/README index 1c794e45..874ac76a 100644 --- a/redmine/doc/README +++ b/redmine/doc/README @@ -2,7 +2,7 @@ redMine - project management software Copyright (C) 2006 Jean-Philippe Lang -http://redmine.sourceforge.net/ +http://redmine.org/ == License @@ -34,6 +34,12 @@ redMine is a project management software written using Ruby on Rails. * multilanguage support +== User documentation + +User documentation for redMine is written using DocBook XML format. +It's also avaible as HTML files in /public/manual (contextual help) + + == Versioning redMine versioning scheme is major.minor.revision diff --git a/redmine/lang/fr_FR.rb b/redmine/lang/fr_FR.rb index 5dc7a59e..0a7ce01a 100644 --- a/redmine/lang/fr_FR.rb +++ b/redmine/lang/fr_FR.rb @@ -10,7 +10,11 @@ Localization.define('fr', 'Français') do |l| l.store 'Resolved', 'Résolue' l.store 'Closed', 'Fermée' l.store 'Rejected', 'Rejetée' - l.store 'Feedback', 'Commentaire' + l.store 'Feedback', 'Commentaire' + # filters + l.store '[All]', '[Tous]' + l.store '[Open]', '[Ouvert]' + l.store '[None]', '[Aucun]' # issue priorities l.store 'Issue priorities', 'Priorités des demandes' @@ -53,6 +57,9 @@ Localization.define('fr', 'Français') do |l| l.store 'Reported issues', 'Demandes soumises' l.store 'Assigned to me', 'Demandes qui me sont assignées' + # ./script/../config/../app/views/account/login.rhtml + l.store 'Please login', 'Identification' + # ./script/../config/../app/views/account/show.rhtml l.store 'Registered on', 'Inscrit le' l.store 'Projects', 'Projets' @@ -231,6 +238,7 @@ Localization.define('fr', 'Français') do |l| l.store 'New file', 'Nouveau fichier' # ./script/../config/../app/views/projects/list_issues.rhtml + l.store 'Subprojects', 'Sous-projets' l.store 'Apply filter', 'Appliquer' l.store 'Reset', 'Annuler' l.store 'Report an issue', 'Nouvelle demande' @@ -311,6 +319,6 @@ Localization.define('fr', 'Français') do |l| # ./script/../config/../app/views/versions/_form.rhtml # ./script/../config/../app/views/welcome/index.rhtml - + l.store 'Latest projects', 'Derniers projets' end diff --git a/redmine/public/manual/administration.html b/redmine/public/manual/administration.html deleted file mode 100644 index 22016c4d..00000000 --- a/redmine/public/manual/administration.html +++ /dev/null @@ -1,121 +0,0 @@ - - - -redMine - Aide en ligne - - - - - - - -

      [ Index ]

      -

      Administration

      -Sommaire: -
        -
      1. Utilisateurs
      2. -
      3. Rôles et permissions
      4. -
      5. Trackers
      6. -
      7. Champs personnalisés
      8. -
      9. Statuts de demande
      10. -
      11. Workflow
      12. -
      13. Listes de valeurs
      14. -
      15. Notifications par mail
      16. -
      17. Informations
      18. -
      - - -

      1. Utilisateurs

      -

      Ces écrans vous permettent de gérer les utilisateurs de l'application.

      -

      1.1 Liste des utilisateurs

      -

      -Liste des utilisateurs
      -

      1.2 Création ou modification d'un utilisateur

      -
        -
      • Administrateur: déclare l'utilisateur comme administrateur de l'application.
      • -
      • Notifications par mail: permet d'activer ou non l'envoi automatique de notifications par mail pour cet utilisateur
      • -
      • Verrouillé: désactive le compte de l'utilisateur
      • -
      -

      En mode modification, laissez le champ Password vide pour laisser le mot de passe de l'utilisateur inchangé.

      -

      Un utilisateur déclaré comme administrateur dispose de toutes les permissions sur l'application et sur tous les projets.

      - - -

      2. Rôles et permissions

      -

      Les rôles permettent de définir les permissions des différents membres d'un projet.
      -Chaque membre d'un projet dispose d'un rôle unique au sein d'un projet. -Un utilisateur peut avoir différents rôles au sein de différents projets.

      -

      Sur l'écran d'édition du rôle, cochez les actions que vous souhaitez autoriser pour le rôle.

      - - -

      3. Trackers

      -

      Les trackers permettent de typer les demandes et de définir des workflows spécifiques pour chacun de ces types.

      - -

      4. Champs personnalisés

      -

      Les champs personnalisés vous permettent d'ajouter des informations supplémentaires sur les demandes.

      -Un champ personnalisé peut être de l'un des types suivants: -
        -
      • Integer: entier positif ou négatif
      • -
      • String: chaîne de caractère
      • -
      • Date: date
      • -
      • Boolean: booléen (case à cocher)
      • -
      • List: valeur à sélectionnée parmi une liste prédéfinie (liste déroulante)
      • -
      -Des éléments de validation peuvent être définis: -
        -
      • Required: champ dont la saisie est obligatoire sur les demandes
      • -
      • For all projects: champ automatiquement associé à l'ensemble des projets
      • -
      • Min - max length: longueurs minimales et maximales pour les champs en saisie libre (0 signifie qu'il n'y a pas de restriction)
      • -
      • Regular expression: expression régulière permettant de valider la valeur saisie
      • -
      • Possible values (only for lists): valeurs possibles pour les champs de type "List". Les valeurs sont séparées par le caractère |
      • -
      -

      Si l'option For all projects n'est pas activée, chaque projet pourra ou non utilisé le champ personnalisé pour ses demandes -(voir Project settings).

      - - -

      5. Statuts des demandes

      -

      Cet écran vous permet de définir les différents statuts possibles des demandes.

      -
        -
      • Closed: indique que le statut correspond à une demande considérée comme fermée
      • -
      • Default: statut appliqué par défaut aux nouvelles demandes (seul un statut peut être déclaré comme statut par défaut)
      • -
      • HTML color: code de couleur HTML représentant le statut à l'affichage
      • -
      - - -

      6. Workflow

      -

      Le workflow permet de définir quels changements les différents membres d'un projet sont autorisés à effectuer sur le statut des demandes, en fonction de leur type.

      -

      Sélectionnez le rôle et le type de demande pour lesquels vous souhaitez modifier le workflow, puis cliquez sur Edit. -L'écran vous permet alors de modifier, pour le rôle et le type de demande choisi, les changements autorisés.

      -

      Les lignes représentent les statuts initiaux des demandes. Les colonnes représentent les statuts autorisés à être appliqués.

      -

      Dans l'exemple ci-dessous, les demandes de type Bug au statut New pourront être passées au statut Assigned ou Resolved par le rôle Développeur.
      -Celles au statut Assigned pourront être passées au statut Resolved.
      -Le statut de toutes les autres demandes de type Bug ne pourra pas être modifié par le Développeur.

      -

      -Exemple de configuration d'un workflow
      -

      Remarque: pour qu'un rôle puisse changer le statut des demandes, la permission "Changer le statut des demandes" doit lui être explicitement donnée indépendemment de la configuration du workflow (voir Roles et permissions). - - -

      7. Listes de valeurs

      -

      Les listes de valeurs utilisées par l'application (exemple: les priorités des demandes) peuvent être personnalisées en fonction de vos besoins.
      -Cet écran vous permet de définir les valeurs possibles pour chacune des listes suivantes:

      -
        -
      • Priorités des demandes
      • -
      • Catégories de documents
      • -
      - - -

      8. Notifications par mail

      -

      Cet écran vous permet de sélectionner les actions qui donneront lieu à une notification par mail aux membres du projet.

      -

      Remarque: l'envoi de mails doit être activé dans la configuration de l'application si souhaitez effectuer des notifications.

      - - -

      9. Informations

      -

      Affiche des informations relatives à l'application

      -
        -
      • Version: version de l'application
      • -
      • Database: type de base de données utilisée
      • -
      - - - - - diff --git a/redmine/public/manual/fr/ch01.html b/redmine/public/manual/fr/ch01.html new file mode 100644 index 00000000..b5f1129d --- /dev/null +++ b/redmine/public/manual/fr/ch01.html @@ -0,0 +1,3 @@ + + + Chapter 1. Administration \ No newline at end of file diff --git a/redmine/public/manual/fr/ch01s01.html b/redmine/public/manual/fr/ch01s01.html new file mode 100644 index 00000000..f2ac52c7 --- /dev/null +++ b/redmine/public/manual/fr/ch01s01.html @@ -0,0 +1,3 @@ + + + 1. Utilisateurs

      1. Utilisateurs

      Ces écrans vous permettent de gérer les utilisateurs de l'application.

      1.1. Liste des utilisateurs

      Les boutons Lock/Unlock vous permettent de vérouiller/dévérouiller les comptes utilisateurs.

      Un utilisateur dont le compte est vérouillé ne peut plus s'identifier pour accéder à l'application.

      1.2. Création ou modification d'un utilisateur

      En mode modification, laissez le champ Password vide pour laisser le mot de passe de l'utilisateur inchangé.

      Un utilisateur déclaré comme administrateur dispose de toutes les permissions sur l'application et sur tous les projets.

      • Administrateur: déclare l'utilisateur comme administrateur de l'application.

      • Notifications par mail: permet d'activer ou non l'envoi automatique de notifications par mail pour cet utilisateur

      • Vérouillé: désactive le compte de l'utilisateur

      \ No newline at end of file diff --git a/redmine/public/manual/fr/ch01s02.html b/redmine/public/manual/fr/ch01s02.html new file mode 100644 index 00000000..c0251d97 --- /dev/null +++ b/redmine/public/manual/fr/ch01s02.html @@ -0,0 +1,3 @@ + + + 2. Rôles et permissions

      2. Rôles et permissions

      Les rôles permettent de définir les permissions des différents membres d'un projet. Chaque membre d'un projet dispose d'un rôle unique au sein d'un projet. Un utilisateur peut avoir différents rôles au sein de différents projets.

      Sur l'écran d'édition du rôle, cochez les actions que vous souhaitez autoriser pour le rôle.

      \ No newline at end of file diff --git a/redmine/public/manual/fr/ch01s03.html b/redmine/public/manual/fr/ch01s03.html new file mode 100644 index 00000000..07ce84f6 --- /dev/null +++ b/redmine/public/manual/fr/ch01s03.html @@ -0,0 +1,3 @@ + + + 3. Trackers

      3. Trackers

      Les trackers permettent de typer les demandes et de définir des workflows spécifiques pour chacun de ces types.

      \ No newline at end of file diff --git a/redmine/public/manual/fr/ch01s04.html b/redmine/public/manual/fr/ch01s04.html new file mode 100644 index 00000000..3882317e --- /dev/null +++ b/redmine/public/manual/fr/ch01s04.html @@ -0,0 +1,3 @@ + + + 4. Champs personnalisés

      4. Champs personnalisés

      Les champs personnalisés vous permettent d'ajouter des informations supplémentaires sur les demandes. Un champ personnalisé peut être de l'un des types suivants:

      • Integer: entier positif ou négatif

      • String: chaîne de caractère

      • Date: date

      • Boolean: booléen (case à cocher)

      • List: valeur à sélectionnée parmi une liste prédéfinie (liste déroulante)

      Des éléments de validation peuvent être définis:

      • Obligatoire: champ dont la saisie est obligatoire sur les demandes

      • Pour tous les projects: champ automatiquement associé à l'ensemble des projets

      • Min - max length: longueurs minimales et maximales pour les champs en saisie libre (0 signifie qu'il n'y a pas de restriction)

      • Expression régulière: expression régulière permettant de valider la valeur saisie

      • Valeurs possibles: valeurs possibles pour les champs de type "Liste". Les valeurs sont séparées par le caractère |

      Si l'option Pour tous les projets n'est pas activée, chaque projet pourra choisir d'utiliser ou non le champ pour ses demandes.

      \ No newline at end of file diff --git a/redmine/public/manual/fr/ch01s05.html b/redmine/public/manual/fr/ch01s05.html new file mode 100644 index 00000000..46ede48d --- /dev/null +++ b/redmine/public/manual/fr/ch01s05.html @@ -0,0 +1,3 @@ + + + 5. Statut des demandes

      5. Statut des demandes

      Ces écrans vous permettent de définir les différents statuts possibles des demandes.

      • Demande fermée: indique que le statut correspond à une demande considérée comme fermée

      • Statut par défaut: statut appliqué par défaut aux nouvelles demandes (seul un statut peut être déclaré comme statut par défaut)

      • Couleur: code couleur HTML (6 caractères) représentant le statut à l'affichage

      \ No newline at end of file diff --git a/redmine/public/manual/fr/ch01s06.html b/redmine/public/manual/fr/ch01s06.html new file mode 100644 index 00000000..daf622cd --- /dev/null +++ b/redmine/public/manual/fr/ch01s06.html @@ -0,0 +1,3 @@ + + + 6. Workflow

      6. Workflow

      Le workflow permet de définir les changements que les différents membres d'un projet sont autorisés à effectuer sur les demandes, en fonction de leur type.

      Sélectionnez le rôle et le tracker pour lesquels vous souhaitez modifier le workflow, puis cliquez sur Edit. L'écran vous permet alors de modifier, pour le rôle et le tracker choisi, les changements autorisés. Les lignes représentent les statuts initiaux des demandes. Les colonnes représentent les statuts autorisés à être appliqués.

      Remarque: pour qu'un rôle puisse changer le statut des demandes, la permission doit lui être explicitement donnée indépendemment de la configuration du workflow.

      Dans l'exemple ci-dessus, les demandes de type Bug au statut Nouveau pourront être passées au statut Assignée ou Résolue par le rôle Développeur. Celles au statut Assignée pourront être passées au statut Résolue. Le statut de toutes les autres demandes de type Bug ne pourra pas être modifié par le Développeur.

      \ No newline at end of file diff --git a/redmine/public/manual/fr/ch01s07.html b/redmine/public/manual/fr/ch01s07.html new file mode 100644 index 00000000..d6763da7 --- /dev/null +++ b/redmine/public/manual/fr/ch01s07.html @@ -0,0 +1,3 @@ + + + 7. Listes de valeurs

      7. Listes de valeurs

      Les listes de valeurs utilisées par l'application (exemple: les priorités des demandes) peuvent être personnalisées. Cet écran vous permet de définir les valeurs possibles pour chacune des listes suivantes:

      • Priorités des demandes

      • Catégories de documents

      \ No newline at end of file diff --git a/redmine/public/manual/fr/ch01s08.html b/redmine/public/manual/fr/ch01s08.html new file mode 100644 index 00000000..7b44c92c --- /dev/null +++ b/redmine/public/manual/fr/ch01s08.html @@ -0,0 +1,3 @@ + + + 8. Notifications par mail

      8. Notifications par mail

      Cet écran vous permet de sélectionner les actions qui donneront lieu à une notification par mail aux membres du projet.

      Remarque: l'envoi de mails doit être activé dans la configuration de l'application si souhaitez effectuer des notifications.

      \ No newline at end of file diff --git a/redmine/public/manual/fr/ch01s09.html b/redmine/public/manual/fr/ch01s09.html new file mode 100644 index 00000000..7093b94c --- /dev/null +++ b/redmine/public/manual/fr/ch01s09.html @@ -0,0 +1,3 @@ + + + 9. Informations

      9. Informations

      Affiche des informations relatives à l'application et à son environnement.

      \ No newline at end of file diff --git a/redmine/public/manual/fr/ch02.html b/redmine/public/manual/fr/ch02.html new file mode 100644 index 00000000..06e1456e --- /dev/null +++ b/redmine/public/manual/fr/ch02.html @@ -0,0 +1,3 @@ + + + Chapter 2. Projets \ No newline at end of file diff --git a/redmine/public/manual/fr/ch02s01.html b/redmine/public/manual/fr/ch02s01.html new file mode 100644 index 00000000..0893ab8d --- /dev/null +++ b/redmine/public/manual/fr/ch02s01.html @@ -0,0 +1,3 @@ + + + 1. Aperçu du projet

      1. Aperçu du projet

      L'aperçu vous présente les informations générales relatives au projet, les principaux membres, les dernières annonces, ainsi qu'une synthèse du nombre de demandes ouvertes par tracker.

      \ No newline at end of file diff --git a/redmine/public/manual/fr/ch02s02.html b/redmine/public/manual/fr/ch02s02.html new file mode 100644 index 00000000..a016c41c --- /dev/null +++ b/redmine/public/manual/fr/ch02s02.html @@ -0,0 +1,3 @@ + + + 2. Gestion des demandes

      2. Gestion des demandes

      2.1. Liste des demandes

      Par défaut, l'ensemble des demandes ouvertes du projet sont affichées. Différents filtres vous permettent de sélectionner les demandes à afficher. Si le projet comporte des sous-projets, vous avez la possibilité d'afficher également les demandes relatives aux sous-projets (non affichées par défaut).

      Une fois appliqué, un filtre reste valable durant toute votre session. Vous pouvez le redéfinir, ou le supprimer en cliquant sur Annuler.

      \ No newline at end of file diff --git a/redmine/public/manual/fr/ch02s03.html b/redmine/public/manual/fr/ch02s03.html new file mode 100644 index 00000000..cd97fb8d --- /dev/null +++ b/redmine/public/manual/fr/ch02s03.html @@ -0,0 +1,3 @@ + + + 3. Rapports

      3. Rapports

      Cet écran présente la synthèse du nombre de demandes par statut et selon différents critères (tracker, priorité, catégorie). Des liens directs permettent d'accéder à la liste détaillée des demandes pour chaque critère.

      \ No newline at end of file diff --git a/redmine/public/manual/fr/ch02s04.html b/redmine/public/manual/fr/ch02s04.html new file mode 100644 index 00000000..6d20bbb8 --- /dev/null +++ b/redmine/public/manual/fr/ch02s04.html @@ -0,0 +1,3 @@ + + + 4. Historique

      4. Historique

      Cette page présente l'ensemble des demandes résolues dans chacune des versions du projet. Certains types de demande peuvent être exclus de cet affichage.

      \ No newline at end of file diff --git a/redmine/public/manual/fr/ch02s05.html b/redmine/public/manual/fr/ch02s05.html new file mode 100644 index 00000000..4fb95b49 --- /dev/null +++ b/redmine/public/manual/fr/ch02s05.html @@ -0,0 +1,3 @@ + + + 5. Annonces

      5. Annonces

      Les nouvelles vous permettent d'informer les utilisateurs sur l'activité du projet.

      \ No newline at end of file diff --git a/redmine/public/manual/fr/ch02s06.html b/redmine/public/manual/fr/ch02s06.html new file mode 100644 index 00000000..98c03c78 --- /dev/null +++ b/redmine/public/manual/fr/ch02s06.html @@ -0,0 +1,3 @@ + + + 6. Documents

      6. Documents

      Les documents sont groupés par catégories (voir Listes de valeurs). Un document peut contenir plusieurs fichiers (exemple: révisions ou versions successives).

      \ No newline at end of file diff --git a/redmine/public/manual/fr/ch02s07.html b/redmine/public/manual/fr/ch02s07.html new file mode 100644 index 00000000..221e8337 --- /dev/null +++ b/redmine/public/manual/fr/ch02s07.html @@ -0,0 +1,3 @@ + + + 7. Fichiers

      7. Fichiers

      Ce module vous permet de publier les différents fichiers (sources, binaires, ...) pour chaque version de l'application.

      \ No newline at end of file diff --git a/redmine/public/manual/fr/ch02s08.html b/redmine/public/manual/fr/ch02s08.html new file mode 100644 index 00000000..37657dcd --- /dev/null +++ b/redmine/public/manual/fr/ch02s08.html @@ -0,0 +1,3 @@ + + + 8. Configuration du projet

      8. Configuration du projet

      8.1. Propriétés du projet

      • Public: si le projet est public, il sera visible (consultation des demandes, des documents, ...) pour l'ensemble des utilisateurs, y compris ceux qui ne sont pas membres du projet. Si le projet n'est pas public, seuls les membres du projet y ont accès, en fonction de leur rôle.

      • Champs personnalisés: sélectionner les champs personnalisés que vous souhaitez utiliser au sein du projet. Seul l'administrateur peut ajouter de nouveaux champs personnalisés.

      8.2. Membres

      Cet écran vous permet de définir les membres du projet ainsi que leurs rôles respectifs. Un utilisateur ne peut avoir qu'un rôle au sein d'un projet donné. Le rôle d'un membre détermine les permissions dont il bénéficie sur le projet.

      8.3. Versions

      Les versions vous permettent de suivre les changements survenus tout au long du projet. A la fermeture d'une demande, vous pouvez par exemple indiquer quelle version la prend en compte. Vous pouvez par ailleurs publier les différentes versions de l'application (voir Fichiers).

      8.4. Catégories des demandes

      Les catégories de demande vous permettent de typer les demandes. Les catégories peuvent par exemple correspondre aux différents modules du projet.

      \ No newline at end of file diff --git a/redmine/public/manual/fr/html.css b/redmine/public/manual/fr/html.css new file mode 100644 index 00000000..c1b2a6fc --- /dev/null +++ b/redmine/public/manual/fr/html.css @@ -0,0 +1,55 @@ +body { + background: #FFFFFF; + font: 0.8em Verdana,Tahoma,Arial,sans-serif; +} + +h1, h2, h3, h4, h5 { + color: #800000; + font-family: sans-serif; +} + +table { + font-size: 1em; +} + +a{ +color:#467aa7; +font-weight:bold; +text-decoration:none; +background-color:inherit; +} + +a:hover{ + color: #800000; + text-decoration:underline; + background-color:inherit; +} + +a img{border:none;} + +.screenshot { + text-align: center; +} + +.guilabel { + font-weight: bold; +} + +span.term { + font-weight: bold; +} + +div.sidebar { + background: #F0F0F0; + border: 1px solid gray; + padding: 5px; + margin: 20px; +} + +pre.programlisting { + background: #F0F0F0; + border: 1px solid gray; + padding: 2px; + font-size: 10pt; + white-space: pre; +} diff --git a/redmine/public/manual/fr/index.html b/redmine/public/manual/fr/index.html new file mode 100644 index 00000000..1f485fe8 --- /dev/null +++ b/redmine/public/manual/fr/index.html @@ -0,0 +1,3 @@ + + + Documentation redMine \ No newline at end of file diff --git a/redmine/public/manual/fr/resources/issues_list.png b/redmine/public/manual/fr/resources/issues_list.png new file mode 100644 index 00000000..47eab0fc Binary files /dev/null and b/redmine/public/manual/fr/resources/issues_list.png differ diff --git a/redmine/public/manual/images/users_list.png b/redmine/public/manual/fr/resources/users_list.png similarity index 100% rename from redmine/public/manual/images/users_list.png rename to redmine/public/manual/fr/resources/users_list.png diff --git a/redmine/public/manual/fr/resources/workflow.png b/redmine/public/manual/fr/resources/workflow.png new file mode 100644 index 00000000..04e79d61 Binary files /dev/null and b/redmine/public/manual/fr/resources/workflow.png differ diff --git a/redmine/public/manual/images/issues_list.png b/redmine/public/manual/images/issues_list.png deleted file mode 100644 index 2fa6dc1b..00000000 Binary files a/redmine/public/manual/images/issues_list.png and /dev/null differ diff --git a/redmine/public/manual/images/users_edit.png b/redmine/public/manual/images/users_edit.png deleted file mode 100644 index 3a4797e9..00000000 Binary files a/redmine/public/manual/images/users_edit.png and /dev/null differ diff --git a/redmine/public/manual/images/workflow.png b/redmine/public/manual/images/workflow.png deleted file mode 100644 index 26071cad..00000000 Binary files a/redmine/public/manual/images/workflow.png and /dev/null differ diff --git a/redmine/public/manual/index.html b/redmine/public/manual/index.html deleted file mode 100644 index 3f0cb1e6..00000000 --- a/redmine/public/manual/index.html +++ /dev/null @@ -1,64 +0,0 @@ - - - -redMine - Aide en ligne - - - - - - - -

      Aide

      - -

      Documentation en ligne redMine

      - -Sommaire: - - - - \ No newline at end of file diff --git a/redmine/public/manual/projects.html b/redmine/public/manual/projects.html deleted file mode 100644 index 13922f69..00000000 --- a/redmine/public/manual/projects.html +++ /dev/null @@ -1,109 +0,0 @@ - - - -redMine - Aide en ligne - - - - - - - -

      [ Index ]

      -

      Projets

      -Sommaire: -
        -
      1. Aperçu
      2. -
      3. Demandes -
          -
        • Liste des demandes
        • -
        • Nouvelle demande
        • -
        • Changer le statut d'une demande
        • -
        -
      4. -
      5. Rapports
      6. -
      7. Annonces
      8. -
      9. Historique
      10. -
      11. Documents
      12. -
      13. Membres
      14. -
      15. Fichiers
      16. -
      17. Configuration
      18. -
          -
        • Projet
        • -
        • Membres
        • -
        • Versions
        • -
        • Catégories de demande
        • -
        -
      - - -

      1. Aperçu

      -

      L'aperçu vous présente les informations générales relatives au projet, les principaux membres, les dernières annonces, ainsi qu'une synthèse du nombre de demandes ouvertes par tracker. - - -

      2. Demandes

      -

      2.1 Liste des demandes

      -Par défaut, l'ensemble des demandes sont affichées. Vous pouvez utiliser les différents filtres pour limiter l'affichage à certaines demandes seulement.
      -Lorsque vous appliquez un filtre, il reste en place durant toute votre session. Vous pouvez le redéfinir, ou le supprimer en cliquant sur Annuler. -

      -Liste des demandes
      - -

      2.2 Nouvelle demande

      -

      TODO

      - -

      2.3 Changer le statut d'une demande

      -

      TODO

      - - -

      3. Rapports

      -

      Synthèse du nombre de demandes par statut et selon différents critères (tracker, priorité, catégorie). -Des liens directs permettent d'accéder à la liste détaillée des demandes pour chaque critère.

      - - -

      4. Annonces

      -

      Les nouvelles vous permettent d'informer les utilisateurs sur l'activité du projet.

      - - -

      5. Historique

      -

      Cette page présente l'ensemble des demandes résolues dans chacune des versions du projet. -Certains types de demande peuvent être exclus de cet affichage (voir Trackers).

      - - -

      6. Documents

      -

      Les documents sont groupés par catégories (voir Listes de valeurs).
      -Un document peut contenir plusieurs fichiers (exemple: révisions ou versions successives)

      - - -

      7. Membres

      -

      Affichage de l'ensemble des membres du projet, par rôle

      - - -

      8. Fichiers

      -

      Ce module vous permet de publier les fichiers de l'application (sources, binaires, ...) pour chaque version de l'application .

      - -

      9. Configuration

      -

      9.1 Projet

      -
        -
      • Public: si le projet est public, il sera visible (consultation des demandes, des documents, ...) pour l'ensemble des utilisateurs, y compris ceux qui ne sont pas membres du projet.
        - Si le projet n'est pas public, seuls les membres du projet y ont accès, en fonction de leur rôle.
      • -
      • Champs personnalisés: sélectionner les champs personnalisés que vous souhaitez utiliser au sein du projet.
        - Seul l'administrateur peut ajouter de nouveaux champs personnalisés.
      • -
      -

      9.2 Membres

      -

      Cette section vous permet de définir les membres du projet ainsi que leurs rôles respectifs.
      -Un utilisateur ne peut avoir qu'un rôle au sein d'un projet donné. Le rôle d'un membre détermine les permissions dont il bénéficie sur le projet.

      - -

      9.3 Versions

      -

      Les versions vous permettent de suivre les changements survenus tout au long du projet. -A la fermeture d'une demande, vous pouvez indiquer quelle version la prend en compte.
      -Vous pouvez par ailleurs publier les différentes versions de l'application (voir Fichiers). -

      - - -

      9.4 Catégories de demande

      -

      Les catégories de demande vous permettent de typer les demandes. Les catégories peuvent par exemple correspondre aux modules de l'application.

      - - - - - diff --git a/redmine/public/manual/stylesheets/help.css b/redmine/public/manual/stylesheets/help.css deleted file mode 100644 index f67bc72b..00000000 --- a/redmine/public/manual/stylesheets/help.css +++ /dev/null @@ -1,70 +0,0 @@ -/* andreas08 - an open source xhtml/css website layout by Andreas Viklund - http://andreasviklund.com . Free to use in any way and for any purpose as long as the proper credits are given to the original designer. Version: 1.0, November 28, 2005 */ - -/**************** Body and tag styles ****************/ - - - -body{ -font:76% Verdana,Tahoma,Arial,sans-serif; -line-height:1.4em; -color:#303030; -margin: 20px; -} - -a{ -color:#467aa7; -font-weight:bold; -text-decoration:none; -background-color:inherit; -} - -a:hover{color:#2a5a8a; text-decoration:none; background-color:inherit;} -a img{border:none;} - -p{padding:0 0 0.2em 0;} -p form{margin-top:0; margin-bottom:20px;} - -h1 { -display:block; - -font-size:1.7em; -font-weight:normal; -letter-spacing:-1px; -color:#505050; -background-color:inherit; -} - -h2 { -display:block; -margin: 30px 0 0 0; -font-size:1.5em; -font-weight:normal; -letter-spacing:-1px; -color:#505050; -background-color:inherit; -} - -hr { border:0px; border-bottom:1px dashed #000000; } - - -/**************** Misc classes and styles ****************/ - -.splitcontentleft{float:left; width:49%;} -.splitcontentright{float:right; width:49%;} -.clear{clear:both;} -.small{font-size:0.8em;line-height:1.4em;padding:0 0 0 0;} -.hide{display:none;} -.textcenter{text-align:center;} -.textright{text-align:right;} -.important{color:#f02025; background-color:inherit; } - -.box{ -margin:0 0 20px 0; -padding:10px; -border:1px solid #c0c0c0; -background-color:#fafbfc; -color:#505050; -line-height:1.5em; -} - - diff --git a/redmine/public/stylesheets/application.css b/redmine/public/stylesheets/application.css index ac661052..43f2bac5 100644 --- a/redmine/public/stylesheets/application.css +++ b/redmine/public/stylesheets/application.css @@ -189,11 +189,20 @@ input.button-small font-size: 0.8em; } +select.select-small +{ + font-size: 0.8em; +} + label { font-weight: bold; font-size: 1em; } +fieldset { + border:1px solid #7F9DB9; +} + .required { color: #bb0000; } @@ -220,10 +229,10 @@ tr.ListHead a { text-decoration:underline; } -tr.ListLine0 { +tr.odd { background-color: #C1E2F7; } -tr.ListLine1 { +tr.even { background-color:#CEE1ED; } diff --git a/redmine/test/fixtures/attachments.yml b/redmine/test/fixtures/attachments.yml deleted file mode 100644 index 8794d28a..00000000 --- a/redmine/test/fixtures/attachments.yml +++ /dev/null @@ -1,5 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -first: - id: 1 -another: - id: 2 diff --git a/redmine/test/fixtures/custom_fields.yml b/redmine/test/fixtures/custom_fields.yml deleted file mode 100644 index 8794d28a..00000000 --- a/redmine/test/fixtures/custom_fields.yml +++ /dev/null @@ -1,5 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -first: - id: 1 -another: - id: 2 diff --git a/redmine/test/fixtures/documents.yml b/redmine/test/fixtures/documents.yml deleted file mode 100644 index 8794d28a..00000000 --- a/redmine/test/fixtures/documents.yml +++ /dev/null @@ -1,5 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -first: - id: 1 -another: - id: 2 diff --git a/redmine/test/fixtures/enumerations.yml b/redmine/test/fixtures/enumerations.yml deleted file mode 100644 index 8794d28a..00000000 --- a/redmine/test/fixtures/enumerations.yml +++ /dev/null @@ -1,5 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -first: - id: 1 -another: - id: 2 diff --git a/redmine/test/fixtures/issue_categories.yml b/redmine/test/fixtures/issue_categories.yml deleted file mode 100644 index 8794d28a..00000000 --- a/redmine/test/fixtures/issue_categories.yml +++ /dev/null @@ -1,5 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -first: - id: 1 -another: - id: 2 diff --git a/redmine/test/fixtures/issue_custom_fields.yml b/redmine/test/fixtures/issue_custom_fields.yml deleted file mode 100644 index 8794d28a..00000000 --- a/redmine/test/fixtures/issue_custom_fields.yml +++ /dev/null @@ -1,5 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -first: - id: 1 -another: - id: 2 diff --git a/redmine/test/fixtures/issue_custom_values.yml b/redmine/test/fixtures/issue_custom_values.yml deleted file mode 100644 index 8794d28a..00000000 --- a/redmine/test/fixtures/issue_custom_values.yml +++ /dev/null @@ -1,5 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -first: - id: 1 -another: - id: 2 diff --git a/redmine/test/fixtures/issue_histories.yml b/redmine/test/fixtures/issue_histories.yml deleted file mode 100644 index 8794d28a..00000000 --- a/redmine/test/fixtures/issue_histories.yml +++ /dev/null @@ -1,5 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -first: - id: 1 -another: - id: 2 diff --git a/redmine/test/fixtures/issue_statuses.yml b/redmine/test/fixtures/issue_statuses.yml deleted file mode 100644 index 8794d28a..00000000 --- a/redmine/test/fixtures/issue_statuses.yml +++ /dev/null @@ -1,5 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -first: - id: 1 -another: - id: 2 diff --git a/redmine/test/fixtures/issues.yml b/redmine/test/fixtures/issues.yml deleted file mode 100644 index 8794d28a..00000000 --- a/redmine/test/fixtures/issues.yml +++ /dev/null @@ -1,5 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -first: - id: 1 -another: - id: 2 diff --git a/redmine/test/fixtures/mailer/issue_closed b/redmine/test/fixtures/mailer/issue_closed deleted file mode 100644 index bb5e51d9..00000000 --- a/redmine/test/fixtures/mailer/issue_closed +++ /dev/null @@ -1,3 +0,0 @@ -Mailer#issue_closed - -Find me in app/views/mailer/issue_closed.rhtml diff --git a/redmine/test/fixtures/members.yml b/redmine/test/fixtures/members.yml deleted file mode 100644 index 8794d28a..00000000 --- a/redmine/test/fixtures/members.yml +++ /dev/null @@ -1,5 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -first: - id: 1 -another: - id: 2 diff --git a/redmine/test/fixtures/news.yml b/redmine/test/fixtures/news.yml deleted file mode 100644 index 8794d28a..00000000 --- a/redmine/test/fixtures/news.yml +++ /dev/null @@ -1,5 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -first: - id: 1 -another: - id: 2 diff --git a/redmine/test/fixtures/permissions.yml b/redmine/test/fixtures/permissions.yml deleted file mode 100644 index 8794d28a..00000000 --- a/redmine/test/fixtures/permissions.yml +++ /dev/null @@ -1,5 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -first: - id: 1 -another: - id: 2 diff --git a/redmine/test/fixtures/projects.yml b/redmine/test/fixtures/projects.yml index 8794d28a..0358c5f7 100644 --- a/redmine/test/fixtures/projects.yml +++ b/redmine/test/fixtures/projects.yml @@ -1,5 +1,26 @@ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -first: +ecookbook: id: 1 -another: + name: eCookbook + descr: Recipes management application + homepage: http://ecookbook.somenet.foo/ + projects_count: 1 + created_on: 2005-01-01 01:00:00 + updated_on: 2005-01-01 01:00:00 +onlinestore: id: 2 + name: OnlineStore + descr: E-commerce web site + is_public: false + projects_count: 0 + created_on: 2005-01-01 01:00:00 + updated_on: 2005-01-01 01:00:00 +tracker: + id: 3 + name: tracker + descr: bug tracker + is_public: true + projects_count: 0 + parent_id: 1 + created_on: 2005-01-01 01:00:00 + updated_on: 2005-01-01 01:00:00 \ No newline at end of file diff --git a/redmine/test/fixtures/roles.yml b/redmine/test/fixtures/roles.yml index 8794d28a..ce676309 100644 --- a/redmine/test/fixtures/roles.yml +++ b/redmine/test/fixtures/roles.yml @@ -1,5 +1,10 @@ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -first: +manager: id: 1 -another: + name: manager +developer: id: 2 + name: developer +reporter: + id: 3 + name: reporter diff --git a/redmine/test/fixtures/trackers.yml b/redmine/test/fixtures/trackers.yml deleted file mode 100644 index 8794d28a..00000000 --- a/redmine/test/fixtures/trackers.yml +++ /dev/null @@ -1,5 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -first: - id: 1 -another: - id: 2 diff --git a/redmine/test/fixtures/users.yml b/redmine/test/fixtures/users.yml index 8794d28a..1d6ca5c0 100644 --- a/redmine/test/fixtures/users.yml +++ b/redmine/test/fixtures/users.yml @@ -1,5 +1,19 @@ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -first: +admin: id: 1 -another: + login: admin + firstname: admin + lastname: admin + mail: admin@somenet.foo + hashed_password: d033e22ae348aeb5660fc2140aec35850c4da997 + admin: true + language: en +paulochon: id: 2 + login: plochon + firstname: Paul + lastname: Ochon + mail: plochon@somenet.foo + hashed_password: d033e22ae348aeb5660fc2140aec35850c4da997 + admin: false + language: en \ No newline at end of file diff --git a/redmine/test/fixtures/versions.yml b/redmine/test/fixtures/versions.yml deleted file mode 100644 index 8794d28a..00000000 --- a/redmine/test/fixtures/versions.yml +++ /dev/null @@ -1,5 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -first: - id: 1 -another: - id: 2 diff --git a/redmine/test/fixtures/workflow.yml b/redmine/test/fixtures/workflow.yml deleted file mode 100644 index 8794d28a..00000000 --- a/redmine/test/fixtures/workflow.yml +++ /dev/null @@ -1,5 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -first: - id: 1 -another: - id: 2 diff --git a/redmine/test/functional/account_controller_test.rb b/redmine/test/functional/account_controller_test.rb deleted file mode 100644 index 537eb8ff..00000000 --- a/redmine/test/functional/account_controller_test.rb +++ /dev/null @@ -1,18 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' -require 'account_controller' - -# Re-raise errors caught by the controller. -class AccountController; def rescue_action(e) raise e end; end - -class AccountControllerTest < Test::Unit::TestCase - def setup - @controller = AccountController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end - - # Replace this with your real tests. - def test_truth - assert true - end -end diff --git a/redmine/test/functional/admin_controller_test.rb b/redmine/test/functional/admin_controller_test.rb deleted file mode 100644 index e44ac942..00000000 --- a/redmine/test/functional/admin_controller_test.rb +++ /dev/null @@ -1,18 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' -require 'admin_controller' - -# Re-raise errors caught by the controller. -class AdminController; def rescue_action(e) raise e end; end - -class AdminControllerTest < Test::Unit::TestCase - def setup - @controller = AdminController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end - - # Replace this with your real tests. - def test_truth - assert true - end -end diff --git a/redmine/test/functional/custom_fields_controller_test.rb b/redmine/test/functional/custom_fields_controller_test.rb deleted file mode 100644 index f86e3256..00000000 --- a/redmine/test/functional/custom_fields_controller_test.rb +++ /dev/null @@ -1,88 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' -require 'custom_fields_controller' - -# Re-raise errors caught by the controller. -class CustomFieldsController; def rescue_action(e) raise e end; end - -class CustomFieldsControllerTest < Test::Unit::TestCase - fixtures :custom_fields - - def setup - @controller = CustomFieldsController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end - - def test_index - get :index - assert_response :success - assert_template 'list' - end - - def test_list - get :list - - assert_response :success - assert_template 'list' - - assert_not_nil assigns(:custom_fields) - end - - def test_show - get :show, :id => 1 - - assert_response :success - assert_template 'show' - - assert_not_nil assigns(:custom_field) - assert assigns(:custom_field).valid? - end - - def test_new - get :new - - assert_response :success - assert_template 'new' - - assert_not_nil assigns(:custom_field) - end - - def test_create - num_custom_fields = CustomField.count - - post :create, :custom_field => {} - - assert_response :redirect - assert_redirected_to :action => 'list' - - assert_equal num_custom_fields + 1, CustomField.count - end - - def test_edit - get :edit, :id => 1 - - assert_response :success - assert_template 'edit' - - assert_not_nil assigns(:custom_field) - assert assigns(:custom_field).valid? - end - - def test_update - post :update, :id => 1 - assert_response :redirect - assert_redirected_to :action => 'show', :id => 1 - end - - def test_destroy - assert_not_nil CustomField.find(1) - - post :destroy, :id => 1 - assert_response :redirect - assert_redirected_to :action => 'list' - - assert_raise(ActiveRecord::RecordNotFound) { - CustomField.find(1) - } - end -end diff --git a/redmine/test/functional/documents_controller_test.rb b/redmine/test/functional/documents_controller_test.rb deleted file mode 100644 index c9bd463d..00000000 --- a/redmine/test/functional/documents_controller_test.rb +++ /dev/null @@ -1,88 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' -require 'documents_controller' - -# Re-raise errors caught by the controller. -class DocumentsController; def rescue_action(e) raise e end; end - -class DocumentsControllerTest < Test::Unit::TestCase - fixtures :documents - - def setup - @controller = DocumentsController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end - - def test_index - get :index - assert_response :success - assert_template 'list' - end - - def test_list - get :list - - assert_response :success - assert_template 'list' - - assert_not_nil assigns(:documents) - end - - def test_show - get :show, :id => 1 - - assert_response :success - assert_template 'show' - - assert_not_nil assigns(:document) - assert assigns(:document).valid? - end - - def test_new - get :new - - assert_response :success - assert_template 'new' - - assert_not_nil assigns(:document) - end - - def test_create - num_documents = Document.count - - post :create, :document => {} - - assert_response :redirect - assert_redirected_to :action => 'list' - - assert_equal num_documents + 1, Document.count - end - - def test_edit - get :edit, :id => 1 - - assert_response :success - assert_template 'edit' - - assert_not_nil assigns(:document) - assert assigns(:document).valid? - end - - def test_update - post :update, :id => 1 - assert_response :redirect - assert_redirected_to :action => 'show', :id => 1 - end - - def test_destroy - assert_not_nil Document.find(1) - - post :destroy, :id => 1 - assert_response :redirect - assert_redirected_to :action => 'list' - - assert_raise(ActiveRecord::RecordNotFound) { - Document.find(1) - } - end -end diff --git a/redmine/test/functional/enumerations_controller_test.rb b/redmine/test/functional/enumerations_controller_test.rb deleted file mode 100644 index e9f4b766..00000000 --- a/redmine/test/functional/enumerations_controller_test.rb +++ /dev/null @@ -1,88 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' -require 'enumerations_controller' - -# Re-raise errors caught by the controller. -class EnumerationsController; def rescue_action(e) raise e end; end - -class EnumerationsControllerTest < Test::Unit::TestCase - fixtures :enumerations - - def setup - @controller = EnumerationsController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end - - def test_index - get :index - assert_response :success - assert_template 'list' - end - - def test_list - get :list - - assert_response :success - assert_template 'list' - - assert_not_nil assigns(:enumerations) - end - - def test_show - get :show, :id => 1 - - assert_response :success - assert_template 'show' - - assert_not_nil assigns(:enumeration) - assert assigns(:enumeration).valid? - end - - def test_new - get :new - - assert_response :success - assert_template 'new' - - assert_not_nil assigns(:enumeration) - end - - def test_create - num_enumerations = Enumeration.count - - post :create, :enumeration => {} - - assert_response :redirect - assert_redirected_to :action => 'list' - - assert_equal num_enumerations + 1, Enumeration.count - end - - def test_edit - get :edit, :id => 1 - - assert_response :success - assert_template 'edit' - - assert_not_nil assigns(:enumeration) - assert assigns(:enumeration).valid? - end - - def test_update - post :update, :id => 1 - assert_response :redirect - assert_redirected_to :action => 'show', :id => 1 - end - - def test_destroy - assert_not_nil Enumeration.find(1) - - post :destroy, :id => 1 - assert_response :redirect - assert_redirected_to :action => 'list' - - assert_raise(ActiveRecord::RecordNotFound) { - Enumeration.find(1) - } - end -end diff --git a/redmine/test/functional/help_controller_test.rb b/redmine/test/functional/help_controller_test.rb deleted file mode 100644 index 291838b8..00000000 --- a/redmine/test/functional/help_controller_test.rb +++ /dev/null @@ -1,18 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' -require 'help_controller' - -# Re-raise errors caught by the controller. -class HelpController; def rescue_action(e) raise e end; end - -class HelpControllerTest < Test::Unit::TestCase - def setup - @controller = HelpController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end - - # Replace this with your real tests. - def test_truth - assert true - end -end diff --git a/redmine/test/functional/issue_categories_controller_test.rb b/redmine/test/functional/issue_categories_controller_test.rb deleted file mode 100644 index 4ea4e1c5..00000000 --- a/redmine/test/functional/issue_categories_controller_test.rb +++ /dev/null @@ -1,88 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' -require 'issue_categories_controller' - -# Re-raise errors caught by the controller. -class IssueCategoriesController; def rescue_action(e) raise e end; end - -class IssueCategoriesControllerTest < Test::Unit::TestCase - fixtures :issue_categories - - def setup - @controller = IssueCategoriesController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end - - def test_index - get :index - assert_response :success - assert_template 'list' - end - - def test_list - get :list - - assert_response :success - assert_template 'list' - - assert_not_nil assigns(:issue_categories) - end - - def test_show - get :show, :id => 1 - - assert_response :success - assert_template 'show' - - assert_not_nil assigns(:issue_category) - assert assigns(:issue_category).valid? - end - - def test_new - get :new - - assert_response :success - assert_template 'new' - - assert_not_nil assigns(:issue_category) - end - - def test_create - num_issue_categories = IssueCategory.count - - post :create, :issue_category => {} - - assert_response :redirect - assert_redirected_to :action => 'list' - - assert_equal num_issue_categories + 1, IssueCategory.count - end - - def test_edit - get :edit, :id => 1 - - assert_response :success - assert_template 'edit' - - assert_not_nil assigns(:issue_category) - assert assigns(:issue_category).valid? - end - - def test_update - post :update, :id => 1 - assert_response :redirect - assert_redirected_to :action => 'show', :id => 1 - end - - def test_destroy - assert_not_nil IssueCategory.find(1) - - post :destroy, :id => 1 - assert_response :redirect - assert_redirected_to :action => 'list' - - assert_raise(ActiveRecord::RecordNotFound) { - IssueCategory.find(1) - } - end -end diff --git a/redmine/test/functional/issue_statuses_controller_test.rb b/redmine/test/functional/issue_statuses_controller_test.rb deleted file mode 100644 index 17f11ef5..00000000 --- a/redmine/test/functional/issue_statuses_controller_test.rb +++ /dev/null @@ -1,88 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' -require 'issue_statuses_controller' - -# Re-raise errors caught by the controller. -class IssueStatusesController; def rescue_action(e) raise e end; end - -class IssueStatusesControllerTest < Test::Unit::TestCase - fixtures :issue_statuses - - def setup - @controller = IssueStatusesController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end - - def test_index - get :index - assert_response :success - assert_template 'list' - end - - def test_list - get :list - - assert_response :success - assert_template 'list' - - assert_not_nil assigns(:issue_statuses) - end - - def test_show - get :show, :id => 1 - - assert_response :success - assert_template 'show' - - assert_not_nil assigns(:issue_status) - assert assigns(:issue_status).valid? - end - - def test_new - get :new - - assert_response :success - assert_template 'new' - - assert_not_nil assigns(:issue_status) - end - - def test_create - num_issue_statuses = IssueStatus.count - - post :create, :issue_status => {} - - assert_response :redirect - assert_redirected_to :action => 'list' - - assert_equal num_issue_statuses + 1, IssueStatus.count - end - - def test_edit - get :edit, :id => 1 - - assert_response :success - assert_template 'edit' - - assert_not_nil assigns(:issue_status) - assert assigns(:issue_status).valid? - end - - def test_update - post :update, :id => 1 - assert_response :redirect - assert_redirected_to :action => 'show', :id => 1 - end - - def test_destroy - assert_not_nil IssueStatus.find(1) - - post :destroy, :id => 1 - assert_response :redirect - assert_redirected_to :action => 'list' - - assert_raise(ActiveRecord::RecordNotFound) { - IssueStatus.find(1) - } - end -end diff --git a/redmine/test/functional/issues_controller_test.rb b/redmine/test/functional/issues_controller_test.rb deleted file mode 100644 index 1be41f86..00000000 --- a/redmine/test/functional/issues_controller_test.rb +++ /dev/null @@ -1,88 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' -require 'issues_controller' - -# Re-raise errors caught by the controller. -class IssuesController; def rescue_action(e) raise e end; end - -class IssuesControllerTest < Test::Unit::TestCase - fixtures :issues - - def setup - @controller = IssuesController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end - - def test_index - get :index - assert_response :success - assert_template 'list' - end - - def test_list - get :list - - assert_response :success - assert_template 'list' - - assert_not_nil assigns(:issues) - end - - def test_show - get :show, :id => 1 - - assert_response :success - assert_template 'show' - - assert_not_nil assigns(:issue) - assert assigns(:issue).valid? - end - - def test_new - get :new - - assert_response :success - assert_template 'new' - - assert_not_nil assigns(:issue) - end - - def test_create - num_issues = Issue.count - - post :create, :issue => {} - - assert_response :redirect - assert_redirected_to :action => 'list' - - assert_equal num_issues + 1, Issue.count - end - - def test_edit - get :edit, :id => 1 - - assert_response :success - assert_template 'edit' - - assert_not_nil assigns(:issue) - assert assigns(:issue).valid? - end - - def test_update - post :update, :id => 1 - assert_response :redirect - assert_redirected_to :action => 'show', :id => 1 - end - - def test_destroy - assert_not_nil Issue.find(1) - - post :destroy, :id => 1 - assert_response :redirect - assert_redirected_to :action => 'list' - - assert_raise(ActiveRecord::RecordNotFound) { - Issue.find(1) - } - end -end diff --git a/redmine/test/functional/members_controller_test.rb b/redmine/test/functional/members_controller_test.rb deleted file mode 100644 index 5f47c358..00000000 --- a/redmine/test/functional/members_controller_test.rb +++ /dev/null @@ -1,88 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' -require 'members_controller' - -# Re-raise errors caught by the controller. -class MembersController; def rescue_action(e) raise e end; end - -class MembersControllerTest < Test::Unit::TestCase - fixtures :members - - def setup - @controller = MembersController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end - - def test_index - get :index - assert_response :success - assert_template 'list' - end - - def test_list - get :list - - assert_response :success - assert_template 'list' - - assert_not_nil assigns(:members) - end - - def test_show - get :show, :id => 1 - - assert_response :success - assert_template 'show' - - assert_not_nil assigns(:member) - assert assigns(:member).valid? - end - - def test_new - get :new - - assert_response :success - assert_template 'new' - - assert_not_nil assigns(:member) - end - - def test_create - num_members = Member.count - - post :create, :member => {} - - assert_response :redirect - assert_redirected_to :action => 'list' - - assert_equal num_members + 1, Member.count - end - - def test_edit - get :edit, :id => 1 - - assert_response :success - assert_template 'edit' - - assert_not_nil assigns(:member) - assert assigns(:member).valid? - end - - def test_update - post :update, :id => 1 - assert_response :redirect - assert_redirected_to :action => 'show', :id => 1 - end - - def test_destroy - assert_not_nil Member.find(1) - - post :destroy, :id => 1 - assert_response :redirect - assert_redirected_to :action => 'list' - - assert_raise(ActiveRecord::RecordNotFound) { - Member.find(1) - } - end -end diff --git a/redmine/test/functional/news_controller_test.rb b/redmine/test/functional/news_controller_test.rb deleted file mode 100644 index b360c6cb..00000000 --- a/redmine/test/functional/news_controller_test.rb +++ /dev/null @@ -1,88 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' -require 'news_controller' - -# Re-raise errors caught by the controller. -class NewsController; def rescue_action(e) raise e end; end - -class NewsControllerTest < Test::Unit::TestCase - fixtures :news - - def setup - @controller = NewsController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end - - def test_index - get :index - assert_response :success - assert_template 'list' - end - - def test_list - get :list - - assert_response :success - assert_template 'list' - - assert_not_nil assigns(:news) - end - - def test_show - get :show, :id => 1 - - assert_response :success - assert_template 'show' - - assert_not_nil assigns(:news) - assert assigns(:news).valid? - end - - def test_new - get :new - - assert_response :success - assert_template 'new' - - assert_not_nil assigns(:news) - end - - def test_create - num_news = News.count - - post :create, :news => {} - - assert_response :redirect - assert_redirected_to :action => 'list' - - assert_equal num_news + 1, News.count - end - - def test_edit - get :edit, :id => 1 - - assert_response :success - assert_template 'edit' - - assert_not_nil assigns(:news) - assert assigns(:news).valid? - end - - def test_update - post :update, :id => 1 - assert_response :redirect - assert_redirected_to :action => 'show', :id => 1 - end - - def test_destroy - assert_not_nil News.find(1) - - post :destroy, :id => 1 - assert_response :redirect - assert_redirected_to :action => 'list' - - assert_raise(ActiveRecord::RecordNotFound) { - News.find(1) - } - end -end diff --git a/redmine/test/functional/projects_controller_test.rb b/redmine/test/functional/projects_controller_test.rb index 8da34ec7..23776ed9 100644 --- a/redmine/test/functional/projects_controller_test.rb +++ b/redmine/test/functional/projects_controller_test.rb @@ -1,3 +1,20 @@ +# redMine - project management software +# Copyright (C) 2006 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + require File.dirname(__FILE__) + '/../test_helper' require 'projects_controller' @@ -27,62 +44,4 @@ class ProjectsControllerTest < Test::Unit::TestCase assert_not_nil assigns(:projects) end - - def test_show - get :show, :id => 1 - - assert_response :success - assert_template 'show' - - assert_not_nil assigns(:project) - assert assigns(:project).valid? - end - - def test_new - get :new - - assert_response :success - assert_template 'new' - - assert_not_nil assigns(:project) - end - - def test_create - num_projects = Project.count - - post :create, :project => {} - - assert_response :redirect - assert_redirected_to :action => 'list' - - assert_equal num_projects + 1, Project.count - end - - def test_edit - get :edit, :id => 1 - - assert_response :success - assert_template 'edit' - - assert_not_nil assigns(:project) - assert assigns(:project).valid? - end - - def test_update - post :update, :id => 1 - assert_response :redirect - assert_redirected_to :action => 'show', :id => 1 - end - - def test_destroy - assert_not_nil Project.find(1) - - post :destroy, :id => 1 - assert_response :redirect - assert_redirected_to :action => 'list' - - assert_raise(ActiveRecord::RecordNotFound) { - Project.find(1) - } - end end diff --git a/redmine/test/functional/reports_controller_test.rb b/redmine/test/functional/reports_controller_test.rb deleted file mode 100644 index 4b52ffab..00000000 --- a/redmine/test/functional/reports_controller_test.rb +++ /dev/null @@ -1,18 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' -require 'reports_controller' - -# Re-raise errors caught by the controller. -class ReportsController; def rescue_action(e) raise e end; end - -class ReportsControllerTest < Test::Unit::TestCase - def setup - @controller = ReportsController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end - - # Replace this with your real tests. - def test_truth - assert true - end -end diff --git a/redmine/test/functional/roles_controller_test.rb b/redmine/test/functional/roles_controller_test.rb deleted file mode 100644 index 299aef21..00000000 --- a/redmine/test/functional/roles_controller_test.rb +++ /dev/null @@ -1,88 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' -require 'roles_controller' - -# Re-raise errors caught by the controller. -class RolesController; def rescue_action(e) raise e end; end - -class RolesControllerTest < Test::Unit::TestCase - fixtures :roles - - def setup - @controller = RolesController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end - - def test_index - get :index - assert_response :success - assert_template 'list' - end - - def test_list - get :list - - assert_response :success - assert_template 'list' - - assert_not_nil assigns(:roles) - end - - def test_show - get :show, :id => 1 - - assert_response :success - assert_template 'show' - - assert_not_nil assigns(:role) - assert assigns(:role).valid? - end - - def test_new - get :new - - assert_response :success - assert_template 'new' - - assert_not_nil assigns(:role) - end - - def test_create - num_roles = Role.count - - post :create, :role => {} - - assert_response :redirect - assert_redirected_to :action => 'list' - - assert_equal num_roles + 1, Role.count - end - - def test_edit - get :edit, :id => 1 - - assert_response :success - assert_template 'edit' - - assert_not_nil assigns(:role) - assert assigns(:role).valid? - end - - def test_update - post :update, :id => 1 - assert_response :redirect - assert_redirected_to :action => 'show', :id => 1 - end - - def test_destroy - assert_not_nil Role.find(1) - - post :destroy, :id => 1 - assert_response :redirect - assert_redirected_to :action => 'list' - - assert_raise(ActiveRecord::RecordNotFound) { - Role.find(1) - } - end -end diff --git a/redmine/test/functional/trackers_controller_test.rb b/redmine/test/functional/trackers_controller_test.rb deleted file mode 100644 index 75063c6c..00000000 --- a/redmine/test/functional/trackers_controller_test.rb +++ /dev/null @@ -1,88 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' -require 'trackers_controller' - -# Re-raise errors caught by the controller. -class TrackersController; def rescue_action(e) raise e end; end - -class TrackersControllerTest < Test::Unit::TestCase - fixtures :trackers - - def setup - @controller = TrackersController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end - - def test_index - get :index - assert_response :success - assert_template 'list' - end - - def test_list - get :list - - assert_response :success - assert_template 'list' - - assert_not_nil assigns(:trackers) - end - - def test_show - get :show, :id => 1 - - assert_response :success - assert_template 'show' - - assert_not_nil assigns(:tracker) - assert assigns(:tracker).valid? - end - - def test_new - get :new - - assert_response :success - assert_template 'new' - - assert_not_nil assigns(:tracker) - end - - def test_create - num_trackers = Tracker.count - - post :create, :tracker => {} - - assert_response :redirect - assert_redirected_to :action => 'list' - - assert_equal num_trackers + 1, Tracker.count - end - - def test_edit - get :edit, :id => 1 - - assert_response :success - assert_template 'edit' - - assert_not_nil assigns(:tracker) - assert assigns(:tracker).valid? - end - - def test_update - post :update, :id => 1 - assert_response :redirect - assert_redirected_to :action => 'show', :id => 1 - end - - def test_destroy - assert_not_nil Tracker.find(1) - - post :destroy, :id => 1 - assert_response :redirect - assert_redirected_to :action => 'list' - - assert_raise(ActiveRecord::RecordNotFound) { - Tracker.find(1) - } - end -end diff --git a/redmine/test/functional/users_controller_test.rb b/redmine/test/functional/users_controller_test.rb deleted file mode 100644 index f1e22817..00000000 --- a/redmine/test/functional/users_controller_test.rb +++ /dev/null @@ -1,88 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' -require 'users_controller' - -# Re-raise errors caught by the controller. -class UsersController; def rescue_action(e) raise e end; end - -class UsersControllerTest < Test::Unit::TestCase - fixtures :users - - def setup - @controller = UsersController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end - - def test_index - get :index - assert_response :success - assert_template 'list' - end - - def test_list - get :list - - assert_response :success - assert_template 'list' - - assert_not_nil assigns(:users) - end - - def test_show - get :show, :id => 1 - - assert_response :success - assert_template 'show' - - assert_not_nil assigns(:user) - assert assigns(:user).valid? - end - - def test_new - get :new - - assert_response :success - assert_template 'new' - - assert_not_nil assigns(:user) - end - - def test_create - num_users = User.count - - post :create, :user => {} - - assert_response :redirect - assert_redirected_to :action => 'list' - - assert_equal num_users + 1, User.count - end - - def test_edit - get :edit, :id => 1 - - assert_response :success - assert_template 'edit' - - assert_not_nil assigns(:user) - assert assigns(:user).valid? - end - - def test_update - post :update, :id => 1 - assert_response :redirect - assert_redirected_to :action => 'show', :id => 1 - end - - def test_destroy - assert_not_nil User.find(1) - - post :destroy, :id => 1 - assert_response :redirect - assert_redirected_to :action => 'list' - - assert_raise(ActiveRecord::RecordNotFound) { - User.find(1) - } - end -end diff --git a/redmine/test/functional/versions_controller_test.rb b/redmine/test/functional/versions_controller_test.rb deleted file mode 100644 index 85b2ef76..00000000 --- a/redmine/test/functional/versions_controller_test.rb +++ /dev/null @@ -1,88 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' -require 'versions_controller' - -# Re-raise errors caught by the controller. -class VersionsController; def rescue_action(e) raise e end; end - -class VersionsControllerTest < Test::Unit::TestCase - fixtures :versions - - def setup - @controller = VersionsController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end - - def test_index - get :index - assert_response :success - assert_template 'list' - end - - def test_list - get :list - - assert_response :success - assert_template 'list' - - assert_not_nil assigns(:versions) - end - - def test_show - get :show, :id => 1 - - assert_response :success - assert_template 'show' - - assert_not_nil assigns(:version) - assert assigns(:version).valid? - end - - def test_new - get :new - - assert_response :success - assert_template 'new' - - assert_not_nil assigns(:version) - end - - def test_create - num_versions = Version.count - - post :create, :version => {} - - assert_response :redirect - assert_redirected_to :action => 'list' - - assert_equal num_versions + 1, Version.count - end - - def test_edit - get :edit, :id => 1 - - assert_response :success - assert_template 'edit' - - assert_not_nil assigns(:version) - assert assigns(:version).valid? - end - - def test_update - post :update, :id => 1 - assert_response :redirect - assert_redirected_to :action => 'show', :id => 1 - end - - def test_destroy - assert_not_nil Version.find(1) - - post :destroy, :id => 1 - assert_response :redirect - assert_redirected_to :action => 'list' - - assert_raise(ActiveRecord::RecordNotFound) { - Version.find(1) - } - end -end diff --git a/redmine/test/functional/welcome_controller_test.rb b/redmine/test/functional/welcome_controller_test.rb deleted file mode 100644 index d773945e..00000000 --- a/redmine/test/functional/welcome_controller_test.rb +++ /dev/null @@ -1,18 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' -require 'welcome_controller' - -# Re-raise errors caught by the controller. -class WelcomeController; def rescue_action(e) raise e end; end - -class WelcomeControllerTest < Test::Unit::TestCase - def setup - @controller = WelcomeController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end - - # Replace this with your real tests. - def test_truth - assert true - end -end diff --git a/redmine/test/integration/account_test.rb b/redmine/test/integration/account_test.rb new file mode 100644 index 00000000..7652d4a5 --- /dev/null +++ b/redmine/test/integration/account_test.rb @@ -0,0 +1,76 @@ +# redMine - project management software +# Copyright (C) 2006 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +require "#{File.dirname(__FILE__)}/../test_helper" + +class AccountTest < ActionController::IntegrationTest + fixtures :users + + # Replace this with your real tests. + def test_login + get "account/my_page" + assert_redirected_to "account/login" + log_user('plochon', 'admin') + + get "account/my_account" + assert_response :success + assert_template "account/my_account" + end + + def test_change_password + log_user('plochon', 'admin') + get "account/my_account" + assert_response :success + assert_template "account/my_account" + + post "account/change_password", :password => 'admin', :new_password => "hello", :new_password_confirmation => "hello2" + assert_response :success + assert_tag :tag => "div", :attributes => { :class => "errorExplanation" } + + post "account/change_password", :password => 'admiN', :new_password => "hello", :new_password_confirmation => "hello" + assert_response :success + assert_equal 'Wrong password', flash[:notice] + + post "account/change_password", :password => 'admin', :new_password => "hello", :new_password_confirmation => "hello" + assert_response :success + log_user('plochon', 'hello') + end + + def test_my_account + log_user('plochon', 'admin') + get "account/my_account" + assert_response :success + assert_template "account/my_account" + + post "account/my_account", :user => {:firstname => "Joe", :login => "root", :admin => 1} + assert_response :success + assert_template "account/my_account" + user = User.find(2) + assert_equal "Joe", user.firstname + assert_equal "plochon", user.login + assert_equal false, user.admin? + + log_user('plochon', 'admin') + end + + def test_my_page + log_user('plochon', 'admin') + get "account/my_page" + assert_response :success + assert_template "account/my_page" + end +end diff --git a/redmine/test/integration/admin_test.rb b/redmine/test/integration/admin_test.rb new file mode 100644 index 00000000..3b01d28d --- /dev/null +++ b/redmine/test/integration/admin_test.rb @@ -0,0 +1,61 @@ +# redMine - project management software +# Copyright (C) 2006 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +require "#{File.dirname(__FILE__)}/../test_helper" + +class AdminTest < ActionController::IntegrationTest + fixtures :users + + def test_add_user + log_user("admin", "admin") + get "/users/add" + assert_response :success + assert_template "users/add" + post "/users/add", :user => { :login => "jsmith", :firstname => "John", :lastname => "Smith", :mail => "jsmith@somenet.foo", :language => "en" }, :password => "jsmith09", :password_confirmation => "jsmith09" + assert_redirected_to "users/list" + + user = User.find_by_login("jsmith") + assert_kind_of User, user + logged_user = User.try_to_login("jsmith", "jsmith09") + assert_kind_of User, logged_user + assert_equal "John", logged_user.firstname + + post "users/edit", :id => user.id, :user => { :locked => 1 } + assert_redirected_to "users/list" + locked_user = User.try_to_login("jsmith", "jsmith09") + assert_equal nil, locked_user + end + + def test_add_project + log_user("admin", "admin") + get "projects/add" + assert_response :success + assert_template "projects/add" + post "projects/add", :project => { :name => "blog", :descr => "weblog", :is_public => 1} + assert_redirected_to "admin/projects" + assert_equal 'Project was successfully created.', flash[:notice] + + project = Project.find_by_name("blog") + assert_kind_of Project, project + assert_equal "weblog", project.descr + assert_equal true, project.is_public? + + get "admin/projects" + assert_response :success + assert_template "admin/projects" + end +end diff --git a/redmine/test/test_helper.rb b/redmine/test/test_helper.rb index a299c7f6..edc7c5c4 100644 --- a/redmine/test/test_helper.rb +++ b/redmine/test/test_helper.rb @@ -1,4 +1,21 @@ -ENV["RAILS_ENV"] = "test" +# redMine - project management software +# Copyright (C) 2006 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +ENV["RAILS_ENV"] ||= "test" require File.expand_path(File.dirname(__FILE__) + "/../config/environment") require 'test_help' @@ -25,4 +42,14 @@ class Test::Unit::TestCase self.use_instantiated_fixtures = false # Add more helper methods to be used by all tests here... + + def log_user(login, password) + get "/account/login" + assert_equal nil, session[:user] + assert_response :success + assert_template "account/login" + post "/account/login", :login => login, :password => password + assert_redirected_to "account/my_page" + assert_equal login, session[:user].login + end end diff --git a/redmine/test/unit/attachment_test.rb b/redmine/test/unit/attachment_test.rb deleted file mode 100644 index 6f66833d..00000000 --- a/redmine/test/unit/attachment_test.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class AttachmentTest < Test::Unit::TestCase - fixtures :attachments - - # Replace this with your real tests. - def test_truth - assert true - end -end diff --git a/redmine/test/unit/custom_field_test.rb b/redmine/test/unit/custom_field_test.rb deleted file mode 100644 index 886bd517..00000000 --- a/redmine/test/unit/custom_field_test.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class CustomFieldTest < Test::Unit::TestCase - fixtures :custom_fields - - # Replace this with your real tests. - def test_truth - assert_kind_of CustomField, custom_fields(:first) - end -end diff --git a/redmine/test/unit/document_test.rb b/redmine/test/unit/document_test.rb deleted file mode 100644 index acd96ddb..00000000 --- a/redmine/test/unit/document_test.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class DocumentTest < Test::Unit::TestCase - fixtures :documents - - # Replace this with your real tests. - def test_truth - assert true - end -end diff --git a/redmine/test/unit/enumeration_test.rb b/redmine/test/unit/enumeration_test.rb deleted file mode 100644 index ea8c0140..00000000 --- a/redmine/test/unit/enumeration_test.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class EnumerationTest < Test::Unit::TestCase - fixtures :enumerations - - # Replace this with your real tests. - def test_truth - assert true - end -end diff --git a/redmine/test/unit/issue_category_test.rb b/redmine/test/unit/issue_category_test.rb deleted file mode 100644 index 6f5051be..00000000 --- a/redmine/test/unit/issue_category_test.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class IssueCategoryTest < Test::Unit::TestCase - fixtures :issue_categories - - # Replace this with your real tests. - def test_truth - assert true - end -end diff --git a/redmine/test/unit/issue_custom_field_test.rb b/redmine/test/unit/issue_custom_field_test.rb deleted file mode 100644 index 2adee106..00000000 --- a/redmine/test/unit/issue_custom_field_test.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class IssueCustomFieldTest < Test::Unit::TestCase - fixtures :issue_custom_fields - - # Replace this with your real tests. - def test_truth - assert_kind_of IssueCustomField, issue_custom_fields(:first) - end -end diff --git a/redmine/test/unit/issue_custom_value_test.rb b/redmine/test/unit/issue_custom_value_test.rb deleted file mode 100644 index 09c0551b..00000000 --- a/redmine/test/unit/issue_custom_value_test.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class IssueCustomValueTest < Test::Unit::TestCase - fixtures :issue_custom_values - - # Replace this with your real tests. - def test_truth - assert true - end -end diff --git a/redmine/test/unit/issue_history_test.rb b/redmine/test/unit/issue_history_test.rb deleted file mode 100644 index 3da38e73..00000000 --- a/redmine/test/unit/issue_history_test.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class IssueHistoryTest < Test::Unit::TestCase - fixtures :issue_histories - - # Replace this with your real tests. - def test_truth - assert_kind_of IssueHistory, issue_histories(:first) - end -end diff --git a/redmine/test/unit/issue_status_test.rb b/redmine/test/unit/issue_status_test.rb deleted file mode 100644 index 8e7c0b97..00000000 --- a/redmine/test/unit/issue_status_test.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class IssueStatusTest < Test::Unit::TestCase - fixtures :issue_statuses - - # Replace this with your real tests. - def test_truth - assert_kind_of IssueStatus, issue_statuses(:first) - end -end diff --git a/redmine/test/unit/issue_test.rb b/redmine/test/unit/issue_test.rb deleted file mode 100644 index 3b318778..00000000 --- a/redmine/test/unit/issue_test.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class IssueTest < Test::Unit::TestCase - fixtures :issues - - # Replace this with your real tests. - def test_truth - assert_kind_of Issue, issues(:first) - end -end diff --git a/redmine/test/unit/mailer_test.rb b/redmine/test/unit/mailer_test.rb deleted file mode 100644 index 70615d71..00000000 --- a/redmine/test/unit/mailer_test.rb +++ /dev/null @@ -1,35 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' -require 'mailer' - -class MailerTest < Test::Unit::TestCase - FIXTURES_PATH = File.dirname(__FILE__) + '/../fixtures' - CHARSET = "utf-8" - - include ActionMailer::Quoting - - def setup - ActionMailer::Base.delivery_method = :test - ActionMailer::Base.perform_deliveries = true - ActionMailer::Base.deliveries = [] - - @expected = TMail::Mail.new - @expected.set_content_type "text", "plain", { "charset" => CHARSET } - end - - def test_issue_closed - @expected.subject = 'Mailer#issue_closed' - @expected.body = read_fixture('issue_closed') - @expected.date = Time.now - - assert_equal @expected.encoded, Mailer.create_issue_closed(@expected.date).encoded - end - - private - def read_fixture(action) - IO.readlines("#{FIXTURES_PATH}/mailer/#{action}") - end - - def encode(subject) - quoted_printable(subject, CHARSET) - end -end diff --git a/redmine/test/unit/member_test.rb b/redmine/test/unit/member_test.rb deleted file mode 100644 index 443c096e..00000000 --- a/redmine/test/unit/member_test.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class MemberTest < Test::Unit::TestCase - fixtures :members - - # Replace this with your real tests. - def test_truth - assert_kind_of Member, members(:first) - end -end diff --git a/redmine/test/unit/news_test.rb b/redmine/test/unit/news_test.rb deleted file mode 100644 index db9b3ab0..00000000 --- a/redmine/test/unit/news_test.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class NewsTest < Test::Unit::TestCase - fixtures :news - - # Replace this with your real tests. - def test_truth - assert_kind_of News, news(:first) - end -end diff --git a/redmine/test/unit/packages_test.rb b/redmine/test/unit/packages_test.rb deleted file mode 100644 index a5ebcdf1..00000000 --- a/redmine/test/unit/packages_test.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class PackagesTest < Test::Unit::TestCase - fixtures :packages - - # Replace this with your real tests. - def test_truth - assert_kind_of Packages, packages(:first) - end -end diff --git a/redmine/test/unit/permission_test.rb b/redmine/test/unit/permission_test.rb deleted file mode 100644 index 306c2e61..00000000 --- a/redmine/test/unit/permission_test.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class PermissionTest < Test::Unit::TestCase - fixtures :permissions - - # Replace this with your real tests. - def test_truth - assert_kind_of Permission, permissions(:first) - end -end diff --git a/redmine/test/unit/project_test.rb b/redmine/test/unit/project_test.rb index 8a991257..9bafe9c9 100644 --- a/redmine/test/unit/project_test.rb +++ b/redmine/test/unit/project_test.rb @@ -1,10 +1,77 @@ +# redMine - project management software +# Copyright (C) 2006 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + require File.dirname(__FILE__) + '/../test_helper' class ProjectTest < Test::Unit::TestCase fixtures :projects - # Replace this with your real tests. + def setup + @project = projects(:ecookbook) + end + def test_truth - assert_kind_of Project, projects(:first) + assert_kind_of Project, @project + assert_equal "eCookbook", @project.name + end + + def test_update + assert_equal "eCookbook", @project.name + @project.name = "eCook" + assert @project.save, @project.errors.full_messages.join("; ") + @project.reload + assert_equal "eCook", @project.name + end + + def test_validate + @project.name = "" + assert !@project.save + assert_equal 1, @project.errors.count + assert_equal "can't be blank", @project.errors.on(:name) + end + + def test_public_projects + public_projects = Project.find(:all, :conditions => ["is_public=?", true]) + assert_equal 2, public_projects.length + assert_equal true, public_projects[0].is_public? + end + + def test_destroy + @project.destroy + assert_raise(ActiveRecord::RecordNotFound) { Project.find(@project.id) } + end + + def test_subproject_ok + sub = Project.find(2) + sub.parent = Project.find(1) + assert sub.save + assert_equal 1, sub.parent.id + assert_equal 2, Project.find(1).projects_count + end + + def test_subproject_invalid + sub = Project.find(2) + sub.parent = projects(:tracker) + assert !sub.save + end + + def test_subproject_invalid_2 + sub = Project.find(1) + sub.parent = projects(:onlinestore) + assert !sub.save end end diff --git a/redmine/test/unit/role_test.rb b/redmine/test/unit/role_test.rb deleted file mode 100644 index 90565ae8..00000000 --- a/redmine/test/unit/role_test.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class RoleTest < Test::Unit::TestCase - fixtures :roles - - # Replace this with your real tests. - def test_truth - assert_kind_of Role, roles(:first) - end -end diff --git a/redmine/test/unit/tracker_test.rb b/redmine/test/unit/tracker_test.rb deleted file mode 100644 index f738f288..00000000 --- a/redmine/test/unit/tracker_test.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class TrackerTest < Test::Unit::TestCase - fixtures :trackers - - # Replace this with your real tests. - def test_truth - assert true - end -end diff --git a/redmine/test/unit/user_test.rb b/redmine/test/unit/user_test.rb index d6a2a224..df255ae8 100644 --- a/redmine/test/unit/user_test.rb +++ b/redmine/test/unit/user_test.rb @@ -1,10 +1,64 @@ +# redMine - project management software +# Copyright (C) 2006 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + require File.dirname(__FILE__) + '/../test_helper' class UserTest < Test::Unit::TestCase fixtures :users - # Replace this with your real tests. def test_truth - assert_kind_of User, users(:first) + assert_kind_of User, users(:paulochon) + end + + def test_update + user = User.find(1) + assert_equal "admin", user.login + user.login = "john" + assert user.save, user.errors.full_messages.join("; ") + user.reload + assert_equal "john", user.login + end + + def test_validate + user = User.find(1) + user.login = "" + assert !user.save + assert_equal 2, user.errors.count + end + + def test_password + user = User.try_to_login("admin", "admin") + assert_kind_of User, user + assert_equal "admin", user.login + user.password = "hello" + assert user.save + + user = User.try_to_login("admin", "hello") + assert_kind_of User, user + assert_equal "admin", user.login + assert_equal User.hash_password("hello"), user.hashed_password + end + + def test_lock + user = User.find(1) + user.locked = true + assert user.save + + user = User.try_to_login("admin", "admin") + assert_equal nil, user end end diff --git a/redmine/test/unit/version_test.rb b/redmine/test/unit/version_test.rb deleted file mode 100644 index 91c52d4a..00000000 --- a/redmine/test/unit/version_test.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class VersionTest < Test::Unit::TestCase - fixtures :versions - - # Replace this with your real tests. - def test_truth - assert_kind_of Version, versions(:first) - end -end diff --git a/redmine/test/unit/workflow_test.rb b/redmine/test/unit/workflow_test.rb deleted file mode 100644 index ff88a976..00000000 --- a/redmine/test/unit/workflow_test.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class WorkflowTest < Test::Unit::TestCase - fixtures :workflows - - # Replace this with your real tests. - def test_truth - assert_kind_of Workflow, workflows(:first) - end -end