Compare commits

..

1 Commits
0.4.2 ... 0.4.0

Author SHA1 Message Date
Jean-Philippe Lang
597bb81774 tagged version 0.4.0
git-svn-id: http://redmine.rubyforge.org/svn/tags/0.4.0@144 e93f8b46-1217-0410-a6f0-8f06a7374b81
2007-01-02 18:02:29 +00:00
295 changed files with 1963 additions and 4751 deletions

View File

@@ -1,5 +1,5 @@
# redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
# 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
@@ -22,7 +22,7 @@ class AccountController < ApplicationController
# prevents login action to be filtered by check_if_login_required application scope filter
skip_before_filter :check_if_login_required, :only => [:login, :lost_password, :register]
before_filter :require_login, :only => :logout
before_filter :require_login, :except => [:show, :login, :lost_password, :register]
# Show user's account
def show
@@ -52,15 +52,14 @@ class AccountController < ApplicationController
# Log out current user and redirect to welcome page
def logout
self.logged_in_user = nil
redirect_to :controller => 'welcome'
redirect_to :controller => ''
end
# Enable user to choose a new password
def lost_password
redirect_to :controller => 'welcome' and return unless Setting.lost_password?
if params[:token]
@token = Token.find_by_action_and_value("recovery", params[:token])
redirect_to :controller => 'welcome' and return unless @token and !@token.expired?
redirect_to :controller => '' and return unless @token and !@token.expired?
@user = @token.user
if request.post?
@user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation]
@@ -83,6 +82,8 @@ class AccountController < ApplicationController
# create a new token for password recovery
token = Token.new(:user => user, :action => "recovery")
if token.save
# send token to user via email
Mailer.set_language_if_valid(user.language)
Mailer.deliver_lost_password(token)
flash[:notice] = l(:notice_account_lost_email_sent)
redirect_to :action => 'login'
@@ -94,12 +95,12 @@ class AccountController < ApplicationController
# User self-registration
def register
redirect_to :controller => 'welcome' and return unless Setting.self_registration?
redirect_to :controller => '' and return if $RDM_SELF_REGISTRATION == false
if params[:token]
token = Token.find_by_action_and_value("register", params[:token])
redirect_to :controller => 'welcome' and return unless token and !token.expired?
redirect_to :controller => '' and return unless token and !token.expired?
user = token.user
redirect_to :controller => 'welcome' and return unless user.status == User::STATUS_REGISTERED
redirect_to :controller => '' and return unless user.status == User::STATUS_REGISTERED
user.status = User::STATUS_ACTIVE
if user.save
token.destroy
@@ -109,7 +110,7 @@ class AccountController < ApplicationController
end
else
if request.get?
@user = User.new(:language => Setting.default_language)
@user = User.new(:language => $RDM_DEFAULT_LANG)
@custom_values = UserCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @user) }
else
@user = User.new(params[:user])
@@ -121,9 +122,10 @@ class AccountController < ApplicationController
@user.custom_values = @custom_values
token = Token.new(:user => @user, :action => "register")
if @user.save and token.save
Mailer.set_language_if_valid(@user.language)
Mailer.deliver_register(token)
flash[:notice] = l(:notice_account_register_done)
redirect_to :controller => 'welcome' and return
redirect_to :controller => ''
end
end
end

View File

@@ -51,5 +51,6 @@ class AdminController < ApplicationController
end
def info
@adapter_name = ActiveRecord::Base.connection.adapter_name
end
end

View File

@@ -1,5 +1,5 @@
# redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
# 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
@@ -33,7 +33,7 @@ class ApplicationController < ActionController::Base
# check if login is globally required to access the application
def check_if_login_required
require_login if Setting.login_required?
require_login if $RDM_LOGIN_REQUIRED
end
def set_localization
@@ -48,7 +48,7 @@ class ApplicationController < ActionController::Base
end
rescue
nil
end || Setting.default_language
end || $RDM_DEFAULT_LANG
set_language_if_valid(lang)
end
@@ -92,16 +92,16 @@ class ApplicationController < ActionController::Base
# store current uri in session.
# return to this location by calling redirect_back_or_default
def store_location
session[:return_to_params] = params
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_params].nil?
if session[:return_to].nil?
redirect_to default
else
redirect_to session[:return_to_params]
session[:return_to_params] = nil
redirect_to_url session[:return_to]
session[:return_to] = nil
end
end

View File

@@ -25,8 +25,7 @@ class CustomFieldsController < ApplicationController
end
def list
@custom_fields_by_type = CustomField.find(:all).group_by {|f| f.type.to_s }
@tab = params[:tab] || 'IssueCustomField'
@custom_field_pages, @custom_fields = paginate :custom_fields, :per_page => 15
render :action => "list", :layout => false if request.xhr?
end
@@ -45,9 +44,9 @@ class CustomFieldsController < ApplicationController
end
if request.post? and @custom_field.save
flash[:notice] = l(:notice_successful_create)
redirect_to :action => 'list', :tab => @custom_field.type
redirect_to :action => 'list'
end
@trackers = Tracker.find(:all, :order => 'position')
@trackers = Tracker.find(:all)
end
def edit
@@ -57,14 +56,14 @@ class CustomFieldsController < ApplicationController
@custom_field.trackers = params[:tracker_ids] ? Tracker.find(params[:tracker_ids]) : []
end
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'list', :tab => @custom_field.type
redirect_to :action => 'list'
end
@trackers = Tracker.find(:all, :order => 'position')
@trackers = Tracker.find(:all)
end
def destroy
@custom_field = CustomField.find(params[:id]).destroy
redirect_to :action => 'list', :tab => @custom_field.type
CustomField.find(params[:id]).destroy
redirect_to :action => 'list'
rescue
flash[:notice] = "Unable to delete custom field"
redirect_to :action => 'list'

View File

@@ -1,5 +1,5 @@
# redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
# 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
@@ -46,13 +46,9 @@ class DocumentsController < ApplicationController
def add_attachment
# Save the attachments
@attachments = []
params[:attachments].each { |file|
next unless file.size > 0
a = Attachment.create(:container => @document, :file => file, :author => logged_in_user)
@attachments << a unless a.new_record?
params[:attachments].each { |a|
Attachment.create(:container => @document, :file => a, :author => logged_in_user) unless a.size == 0
} if params[:attachments] and params[:attachments].is_a? Array
Mailer.deliver_attachments_add(@attachments) if !@attachments.empty? and Permission.find_by_controller_and_action(params[:controller], params[:action]).mail_enabled?
redirect_to :action => 'show', :id => @document
end

View File

@@ -20,6 +20,6 @@ class FeedsController < ApplicationController
def news
@news = News.find :all, :order => 'news.created_on DESC', :limit => 10, :include => [ :author, :project ]
headers["Content-Type"] = "application/rss+xml"
@headers["Content-Type"] = "application/rss+xml"
end
end

View File

@@ -16,22 +16,22 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class IssueCategoriesController < ApplicationController
layout 'base'
before_filter :find_project, :authorize
layout 'base'
before_filter :find_project, :authorize
def edit
if request.post? and @category.update_attributes(params[:category])
flash[:notice] = l(:notice_successful_update)
redirect_to :controller => 'projects', :action => 'settings', :tab => 'categories', :id => @project
redirect_to :controller => 'projects', :action => 'settings', :id => @project
end
end
def destroy
@category.destroy
redirect_to :controller => 'projects', :action => 'settings', :tab => 'categories', :id => @project
redirect_to :controller => 'projects', :action => 'settings', :id => @project
rescue
flash[:notice] = "Categorie can't be deleted"
redirect_to :controller => 'projects', :action => 'settings', :tab => 'categories', :id => @project
redirect_to :controller => 'projects', :action => 'settings', :id => @project
end
private

View File

@@ -16,19 +16,16 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class IssueStatusesController < ApplicationController
layout 'base'
before_filter :require_admin
verify :method => :post, :only => [ :destroy, :create, :update, :move ],
:redirect_to => { :action => :list }
layout 'base'
before_filter :require_admin
def index
list
render :action => 'list' unless request.xhr?
end
def list
@issue_status_pages, @issue_statuses = paginate :issue_statuses, :per_page => 25, :order => "position"
@issue_status_pages, @issue_statuses = paginate :issue_statuses, :per_page => 10
render :action => "list", :layout => false if request.xhr?
end
@@ -58,21 +55,6 @@ class IssueStatusesController < ApplicationController
else
render :action => 'edit'
end
end
def move
@issue_status = IssueStatus.find(params[:id])
case params[:position]
when 'highest'
@issue_status.move_to_top
when 'higher'
@issue_status.move_higher
when 'lower'
@issue_status.move_lower
when 'lowest'
@issue_status.move_to_bottom
end if params[:position]
redirect_to :action => 'list'
end
def destroy
@@ -81,5 +63,7 @@ class IssueStatusesController < ApplicationController
rescue
flash[:notice] = "Unable to delete issue status"
redirect_to :action => 'list'
end
end
end

View File

@@ -1,5 +1,5 @@
# redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
# 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
@@ -25,7 +25,7 @@ class IssuesController < ApplicationController
include IfpdfHelper
def show
@status_options = @issue.status.workflows.find(:all, :order => 'position', :include => :new_status, :conditions => ["role_id=? and tracker_id=?", self.logged_in_user.role_for_project(@project.id), @issue.tracker.id]).collect{ |w| w.new_status } if self.logged_in_user
@status_options = @issue.status.workflows.find(:all, :include => :new_status, :conditions => ["role_id=? and tracker_id=?", self.logged_in_user.role_for_project(@project.id), @issue.tracker.id]).collect{ |w| w.new_status } if self.logged_in_user
@custom_values = @issue.custom_values.find(:all, :include => :custom_field)
@journals_count = @issue.journals.count
@journals = @issue.journals.find(:all, :include => [:user, :details], :limit => 15, :order => "journals.created_on desc")
@@ -83,7 +83,7 @@ class IssuesController < ApplicationController
def change_status
#@history = @issue.histories.build(params[:history])
@status_options = @issue.status.workflows.find(:all, :order => 'position', :include => :new_status, :conditions => ["role_id=? and tracker_id=?", self.logged_in_user.role_for_project(@project.id), @issue.tracker.id]).collect{ |w| w.new_status } if self.logged_in_user
@status_options = @issue.status.workflows.find(:all, :conditions => ["role_id=? and tracker_id=?", self.logged_in_user.role_for_project(@project.id), @issue.tracker.id]).collect{ |w| w.new_status } if self.logged_in_user
@new_status = IssueStatus.find(params[:new_status_id])
if params[:confirm]
begin
@@ -115,13 +115,10 @@ class IssuesController < ApplicationController
def add_attachment
# Save the attachments
@attachments = []
params[:attachments].each { |file|
next unless file.size > 0
a = Attachment.create(:container => @issue, :file => file, :author => logged_in_user)
@attachments << a unless a.new_record?
params[:attachments].each { |a|
@attachment = @issue.attachments.build(:file => a, :author => self.logged_in_user) unless a.size == 0
@attachment.save
} if params[:attachments] and params[:attachments].is_a? Array
Mailer.deliver_attachments_add(@attachments) if !@attachments.empty? and Permission.find_by_controller_and_action(params[:controller], params[:action]).mail_enabled?
redirect_to :action => 'show', :id => @issue
end

View File

@@ -16,21 +16,21 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class MembersController < ApplicationController
layout 'base'
before_filter :find_project, :authorize
layout 'base'
before_filter :find_project, :authorize
def edit
if request.post? and @member.update_attributes(params[:member])
flash[:notice] = l(:notice_successful_update)
redirect_to :controller => 'projects', :action => 'settings', :tab => 'members', :id => @project
end
end
def destroy
@member.destroy
def edit
if request.post? and @member.update_attributes(params[:member])
flash[:notice] = l(:notice_successful_update)
redirect_to :controller => 'projects', :action => 'settings', :id => @project
end
end
def destroy
@member.destroy
flash[:notice] = l(:notice_successful_delete)
redirect_to :controller => 'projects', :action => 'settings', :tab => 'members', :id => @project
end
redirect_to :controller => 'projects', :action => 'settings', :id => @project
end
private
def find_project
@@ -38,5 +38,6 @@ private
@project = @member.project
rescue ActiveRecord::RecordNotFound
render_404
end
end
end

View File

@@ -19,17 +19,13 @@ class MyController < ApplicationController
layout 'base'
before_filter :require_login
BLOCKS = { 'issuesassignedtome' => :label_assigned_to_me_issues,
'issuesreportedbyme' => :label_reported_issues,
'news' => :label_news_latest,
BLOCKS = { 'issues_assigned_to_me' => :label_assigned_to_me_issues,
'issues_reported_by_me' => :label_reported_issues,
'latest_news' => :label_news_latest,
'calendar' => :label_calendar,
'documents' => :label_document_plural
}.freeze
DEFAULT_LAYOUT = { 'left' => ['issuesassignedtome'],
'right' => ['issuesreportedbyme']
}.freeze
verify :xhr => true,
:session => :page_layout,
:only => [:add_block, :remove_block, :order_blocks]
@@ -42,7 +38,7 @@ class MyController < ApplicationController
# Show user's page
def page
@user = self.logged_in_user
@blocks = @user.pref[:my_page_layout] || DEFAULT_LAYOUT
@blocks = @user.pref[:my_page_layout] || { 'left' => ['issues_assigned_to_me'], 'right' => ['issues_reported_by_me'] }
end
# Edit user's account
@@ -51,7 +47,7 @@ class MyController < ApplicationController
@pref = @user.pref
@user.attributes = params[:user]
@user.pref.attributes = params[:pref]
if request.post? and @user.save and @user.pref.save
if request.post? and @user.save
set_localization
flash.now[:notice] = l(:notice_account_updated)
self.logged_in_user.reload
@@ -79,7 +75,7 @@ class MyController < ApplicationController
# User's page layout configuration
def page_layout
@user = self.logged_in_user
@blocks = @user.pref[:my_page_layout] || DEFAULT_LAYOUT.dup
@blocks = @user.pref[:my_page_layout] || { 'left' => ['issues_assigned_to_me'], 'right' => ['issues_reported_by_me'] }
session[:page_layout] = @blocks
%w(top left right).each {|f| session[:page_layout][f] ||= [] }
@block_options = []

View File

@@ -16,8 +16,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class NewsController < ApplicationController
layout 'base'
before_filter :find_project, :authorize
layout 'base'
before_filter :find_project, :authorize
def show
end
@@ -45,10 +45,10 @@ class NewsController < ApplicationController
redirect_to :action => 'show', :id => @news
end
def destroy
@news.destroy
redirect_to :controller => 'projects', :action => 'list_news', :id => @project
end
def destroy
@news.destroy
redirect_to :controller => 'projects', :action => 'list_news', :id => @project
end
private
def find_project

View File

@@ -15,8 +15,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require 'csv'
class ProjectsController < ApplicationController
layout 'base'
before_filter :find_project, :authorize, :except => [ :index, :list, :add ]
@@ -41,7 +39,7 @@ class ProjectsController < ApplicationController
def list
sort_init 'name', 'asc'
sort_update
@project_count = Project.count(:all, :conditions => ["is_public=?", true])
@project_count = Project.count(["is_public=?", true])
@project_pages = Paginator.new self, @project_count,
15,
params['page']
@@ -79,11 +77,9 @@ class ProjectsController < ApplicationController
def show
@custom_values = @project.custom_values.find(:all, :include => :custom_field)
@members = @project.members.find(:all, :include => [:user, :role])
@subprojects = @project.children if @project.children.size > 0
@subprojects = @project.children if @project.children_count > 0
@news = @project.news.find(:all, :limit => 5, :include => [ :author, :project ], :order => "news.created_on DESC")
@trackers = Tracker.find(:all, :order => 'position')
@open_issues_by_tracker = Issue.count(:group => :tracker, :joins => "INNER JOIN issue_statuses ON issue_statuses.id = issues.status_id", :conditions => ["project_id=? and issue_statuses.is_closed=?", @project.id, false])
@total_issues_by_tracker = Issue.count(:group => :tracker, :conditions => ["project_id=?", @project.id])
@trackers = Tracker.find(:all)
end
def settings
@@ -91,8 +87,8 @@ class ProjectsController < ApplicationController
@custom_fields = IssueCustomField.find(:all)
@issue_category ||= IssueCategory.new
@member ||= @project.members.new
@roles = Role.find(:all, :order => 'position')
@users = User.find_active(:all) - @project.users
@roles = Role.find(:all)
@users = User.find(:all) - @project.members.find(:all, :include => :user).collect{|m| m.user }
@custom_values ||= ProjectCustomField.find(:all).collect { |x| @project.custom_values.find_by_custom_field_id(x.id) || CustomValue.new(:custom_field => x) }
end
@@ -138,7 +134,7 @@ class ProjectsController < ApplicationController
@issue_category = @project.issue_categories.build(params[:issue_category])
if @issue_category.save
flash[:notice] = l(:notice_successful_create)
redirect_to :action => 'settings', :tab => 'categories', :id => @project
redirect_to :action => 'settings', :id => @project
else
settings
render :action => 'settings'
@@ -151,7 +147,7 @@ class ProjectsController < ApplicationController
@version = @project.versions.build(params[:version])
if request.post? and @version.save
flash[:notice] = l(:notice_successful_create)
redirect_to :action => 'settings', :tab => 'versions', :id => @project
redirect_to :action => 'settings', :id => @project
end
end
@@ -161,7 +157,7 @@ class ProjectsController < ApplicationController
if request.post?
if @member.save
flash[:notice] = l(:notice_successful_create)
redirect_to :action => 'settings', :tab => 'members', :id => @project
redirect_to :action => 'settings', :id => @project
else
settings
render :action => 'settings'
@@ -171,7 +167,7 @@ class ProjectsController < ApplicationController
# Show members list of @project
def list_members
@members = @project.members.find(:all)
@members = @project.members
end
# Add a new document to @project
@@ -184,7 +180,6 @@ class ProjectsController < ApplicationController
Attachment.create(:container => @document, :file => a, :author => logged_in_user) unless a.size == 0
} if params[:attachments] and params[:attachments].is_a? Array
flash[:notice] = l(:notice_successful_create)
Mailer.deliver_document_add(@document) if Permission.find_by_controller_and_action(params[:controller], params[:action]).mail_enabled?
redirect_to :action => 'list_documents', :id => @project
end
end
@@ -240,12 +235,12 @@ class ProjectsController < ApplicationController
@issue_count = Issue.count(:include => [:status, :project], :conditions => @query.statement)
@issue_pages = Paginator.new self, @issue_count, @results_per_page, params['page']
@issues = Issue.find :all, :order => sort_clause,
:include => [ :author, :status, :tracker, :project, :priority ],
:include => [ :author, :status, :tracker, :project ],
:conditions => @query.statement,
:limit => @issue_pages.items_per_page,
:offset => @issue_pages.current.offset
end
@trackers = Tracker.find :all, :order => 'position'
@trackers = Tracker.find :all
render :layout => false if request.xhr?
end
@@ -258,42 +253,21 @@ class ProjectsController < ApplicationController
render :action => 'list_issues' and return unless @query.valid?
@issues = Issue.find :all, :order => sort_clause,
:include => [ :author, :status, :tracker, :priority, {:custom_values => :custom_field} ],
:conditions => @query.statement,
:limit => Setting.issues_export_limit
:include => [ :author, :status, :tracker, :project, :custom_values ],
:conditions => @query.statement
ic = Iconv.new('ISO-8859-1', 'UTF-8')
export = StringIO.new
CSV::Writer.generate(export, l(:general_csv_separator)) do |csv|
# csv header fields
headers = [ "#", l(:field_status),
l(:field_tracker),
l(:field_priority),
l(:field_subject),
l(:field_author),
l(:field_start_date),
l(:field_due_date),
l(:field_done_ratio),
l(:field_created_on),
l(:field_updated_on)
]
headers = [ "#", l(:field_status), l(:field_tracker), l(:field_subject), l(:field_author), l(:field_created_on), l(:field_updated_on) ]
for custom_field in @project.all_custom_fields
headers << custom_field.name
end
csv << headers.collect {|c| ic.iconv(c) }
# csv lines
@issues.each do |issue|
fields = [issue.id, issue.status.name,
issue.tracker.name,
issue.priority.name,
issue.subject,
issue.author.display_name,
issue.start_date ? l_date(issue.start_date) : nil,
issue.due_date ? l_date(issue.due_date) : nil,
issue.done_ratio,
l_datetime(issue.created_on),
l_datetime(issue.updated_on)
]
fields = [issue.id, issue.status.name, issue.tracker.name, issue.subject, issue.author.display_name, l_datetime(issue.created_on), l_datetime(issue.updated_on)]
for custom_field in @project.all_custom_fields
fields << (show_value issue.custom_value_for(custom_field))
end
@@ -313,9 +287,8 @@ class ProjectsController < ApplicationController
render :action => 'list_issues' and return unless @query.valid?
@issues = Issue.find :all, :order => sort_clause,
:include => [ :author, :status, :tracker, :priority ],
:conditions => @query.statement,
:limit => Setting.issues_export_limit
:include => [ :author, :status, :tracker, :project, :custom_values ],
:conditions => @query.statement
@options_for_rfpdf ||= {}
@options_for_rfpdf[:file_name] = "export.pdf"
@@ -388,13 +361,9 @@ class ProjectsController < ApplicationController
if request.post?
@version = @project.versions.find_by_id(params[:version_id])
# Save the attachments
@attachments = []
params[:attachments].each { |file|
next unless file.size > 0
a = Attachment.create(:container => @version, :file => file, :author => logged_in_user)
@attachments << a unless a.new_record?
params[:attachments].each { |a|
Attachment.create(:container => @version, :file => a, :author => logged_in_user) unless a.size == 0
} if params[:attachments] and params[:attachments].is_a? Array
Mailer.deliver_attachments_add(@attachments) if !@attachments.empty? and Permission.find_by_controller_and_action(params[:controller], params[:action]).mail_enabled?
redirect_to :controller => 'projects', :action => 'list_files', :id => @project
end
@versions = @project.versions
@@ -406,7 +375,7 @@ class ProjectsController < ApplicationController
# Show changelog for @project
def changelog
@trackers = Tracker.find(:all, :conditions => ["is_in_chlog=?", true], :order => 'position')
@trackers = Tracker.find(:all, :conditions => ["is_in_chlog=?", true])
if request.get?
@selected_tracker_ids = @trackers.collect {|t| t.id.to_s }
else
@@ -421,20 +390,6 @@ class ProjectsController < ApplicationController
@fixed_issues ||= []
end
def roadmap
@trackers = Tracker.find(:all, :conditions => ["is_in_roadmap=?", true], :order => 'position')
if request.get?
@selected_tracker_ids = @trackers.collect {|t| t.id.to_s }
else
@selected_tracker_ids = params[:tracker_ids].collect { |id| id.to_i.to_s } if params[:tracker_ids] and params[:tracker_ids].is_a? Array
end
@selected_tracker_ids ||= []
@versions = @project.versions.find(:all,
:conditions => [ "versions.effective_date>?", Date.today],
:order => "versions.effective_date ASC"
)
end
def activity
if params[:year] and params[:year].to_i > 1900
@year = params[:year].to_i
@@ -506,7 +461,7 @@ class ProjectsController < ApplicationController
# finish on sunday
@date_to = @date_to + (7-@date_to.cwday)
@issues = @project.issues.find(:all, :include => [:tracker, :status, :assigned_to, :priority], :conditions => ["((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?))", @date_from, @date_to, @date_from, @date_to])
@issues = @project.issues.find(:all, :include => :tracker, :conditions => ["((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?))", @date_from, @date_to, @date_from, @date_to])
render :layout => false if request.xhr?
end
@@ -528,7 +483,7 @@ class ProjectsController < ApplicationController
@date_from = Date.civil(@year_from, @month_from, 1)
@date_to = (@date_from >> @months) - 1
@issues = @project.issues.find(:all, :order => "start_date, due_date", :include => [:tracker, :status, :assigned_to, :priority], :conditions => ["(((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?) or (start_date<? and due_date>?)) and start_date is not null and due_date is not null)", @date_from, @date_to, @date_from, @date_to, @date_from, @date_to])
@issues = @project.issues.find(:all, :order => "start_date, due_date", :conditions => ["(((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?) or (start_date<? and due_date>?)) and start_date is not null and due_date is not null)", @date_from, @date_to, @date_from, @date_to, @date_from, @date_to])
if params[:output]=='pdf'
@options_for_rfpdf ||= {}
@@ -554,7 +509,6 @@ private
def retrieve_query
if params[:query_id]
@query = @project.queries.find(params[:query_id])
session[:query] = @query
else
if params[:set_filter] or !session[:query] or session[:query].project_id != @project.id
# Give it a name, required to be valid

View File

@@ -16,16 +16,16 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class ReportsController < ApplicationController
layout 'base'
before_filter :find_project, :authorize
layout 'base'
before_filter :find_project, :authorize
def issue_report
@statuses = IssueStatus.find(:all, :order => 'position')
@statuses = IssueStatus.find :all
case params[:detail]
when "tracker"
@field = "tracker_id"
@rows = Tracker.find :all, :order => 'position'
@rows = Tracker.find :all
@data = issues_by_tracker
@report_title = l(:field_tracker)
render :template => "reports/issue_report_details"
@@ -49,7 +49,7 @@ class ReportsController < ApplicationController
render :template => "reports/issue_report_details"
else
@queries = @project.queries.find :all, :conditions => ["is_public=? or user_id=?", true, (logged_in_user ? logged_in_user.id : 0)]
@trackers = Tracker.find(:all, :order => 'position')
@trackers = Tracker.find(:all)
@priorities = Enumeration::get_values('IPRI')
@categories = @project.issue_categories
@authors = @project.members.collect { |m| m.user }
@@ -104,8 +104,8 @@ private
rescue ActiveRecord::RecordNotFound
render_404
end
def issues_by_tracker
def issues_by_tracker
@issues_by_tracker ||=
ActiveRecord::Base.connection.select_all("select s.id as status_id,
s.is_closed as closed,
@@ -118,9 +118,9 @@ private
and i.tracker_id=t.id
and i.project_id=#{@project.id}
group by s.id, s.is_closed, t.id")
end
end
def issues_by_priority
def issues_by_priority
@issues_by_priority ||=
ActiveRecord::Base.connection.select_all("select s.id as status_id,
s.is_closed as closed,
@@ -133,9 +133,9 @@ private
and i.priority_id=p.id
and i.project_id=#{@project.id}
group by s.id, s.is_closed, p.id")
end
end
def issues_by_category
def issues_by_category
@issues_by_category ||=
ActiveRecord::Base.connection.select_all("select s.id as status_id,
s.is_closed as closed,
@@ -148,9 +148,9 @@ private
and i.category_id=c.id
and i.project_id=#{@project.id}
group by s.id, s.is_closed, c.id")
end
end
def issues_by_author
def issues_by_author
@issues_by_author ||=
ActiveRecord::Base.connection.select_all("select s.id as status_id,
s.is_closed as closed,
@@ -163,5 +163,5 @@ private
and i.author_id=a.id
and i.project_id=#{@project.id}
group by s.id, s.is_closed, a.id")
end
end
end

View File

@@ -16,19 +16,16 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class RolesController < ApplicationController
layout 'base'
before_filter :require_admin
verify :method => :post, :only => [ :destroy, :move ],
:redirect_to => { :action => :list }
layout 'base'
before_filter :require_admin
def index
list
render :action => 'list' unless request.xhr?
end
def list
@role_pages, @roles = paginate :roles, :per_page => 10, :order => "position"
@role_pages, @roles = paginate :roles, :per_page => 10
render :action => "list", :layout => false if request.xhr?
end
@@ -65,21 +62,6 @@ class RolesController < ApplicationController
redirect_to :action => 'list'
end
def move
@role = Role.find(params[:id])
case params[:position]
when 'highest'
@role.move_to_top
when 'higher'
@role.move_higher
when 'lower'
@role.move_lower
when 'lowest'
@role.move_to_bottom
end if params[:position]
redirect_to :action => 'list'
end
def workflow
@role = Role.find_by_id(params[:role_id])
@tracker = Tracker.find_by_id(params[:tracker_id])
@@ -95,8 +77,8 @@ class RolesController < ApplicationController
flash[:notice] = l(:notice_successful_update)
end
end
@roles = Role.find(:all, :order => 'position')
@trackers = Tracker.find(:all, :order => 'position')
@statuses = IssueStatus.find(:all, :include => :workflows, :order => 'position')
@roles = Role.find :all
@trackers = Tracker.find :all
@statuses = IssueStatus.find(:all, :include => :workflows)
end
end

View File

@@ -1,33 +0,0 @@
# redMine - project management software
# Copyright (C) 2006-2007 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 SettingsController < ApplicationController
layout 'base'
before_filter :require_admin
def index
edit
render :action => 'edit'
end
def edit
if request.post? and params[:settings] and params[:settings].is_a? Hash
params[:settings].each { |name, value| Setting[name] = value }
redirect_to :action => 'edit' and return
end
end
end

View File

@@ -25,10 +25,10 @@ class TrackersController < ApplicationController
end
# GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
verify :method => :post, :only => [ :destroy, :move ], :redirect_to => { :action => :list }
verify :method => :post, :only => [ :destroy ], :redirect_to => { :action => :list }
def list
@tracker_pages, @trackers = paginate :trackers, :per_page => 10, :order => 'position'
@tracker_pages, @trackers = paginate :trackers, :per_page => 10
render :action => "list", :layout => false if request.xhr?
end
@@ -47,22 +47,7 @@ class TrackersController < ApplicationController
redirect_to :action => 'list'
end
end
def move
@tracker = Tracker.find(params[:id])
case params[:position]
when 'highest'
@tracker.move_to_top
when 'higher'
@tracker.move_higher
when 'lower'
@tracker.move_lower
when 'lowest'
@tracker.move_to_bottom
end if params[:position]
redirect_to :action => 'list'
end
def destroy
@tracker = Tracker.find(params[:id])
unless @tracker.issues.empty?
@@ -71,5 +56,6 @@ class TrackersController < ApplicationController
@tracker.destroy
end
redirect_to :action => 'list'
end
end
end

View File

@@ -1,5 +1,5 @@
# redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
# 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
@@ -45,7 +45,7 @@ class UsersController < ApplicationController
def add
if request.get?
@user = User.new(:language => Setting.default_language)
@user = User.new(:language => $RDM_DEFAULT_LANG)
@custom_values = UserCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @user) }
else
@user = User.new(params[:user])
@@ -80,7 +80,7 @@ class UsersController < ApplicationController
end
end
@auth_sources = AuthSource.find(:all)
@roles = Role.find(:all, :order => 'position')
@roles = Role.find :all
@projects = Project.find(:all) - @user.projects
@membership ||= Member.new
end

View File

@@ -22,16 +22,16 @@ class VersionsController < ApplicationController
def edit
if request.post? and @version.update_attributes(params[:version])
flash[:notice] = l(:notice_successful_update)
redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
redirect_to :controller => 'projects', :action => 'settings', :id => @project
end
end
def destroy
@version.destroy
redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
redirect_to :controller => 'projects', :action => 'settings', :id => @project
rescue
flash[:notice] = "Unable to delete version"
redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
redirect_to :controller => 'projects', :action => 'settings', :id => @project
end
def download

View File

@@ -1,5 +1,5 @@
# redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
# 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
@@ -50,14 +50,6 @@ module ApplicationHelper
link_to user.display_name, :controller => 'account', :action => 'show', :id => user
end
def image_to_function(name, function, html_options = {})
html_options.symbolize_keys!
tag(:input, html_options.merge({
:type => "image", :src => image_path(name),
:onclick => (html_options[:onclick] ? "#{html_options[:onclick]}; " : "") + "#{function};"
}))
end
def format_date(date)
l_date(date) if date
end
@@ -93,7 +85,7 @@ module ApplicationHelper
end
def textilizable(text)
(Setting.text_formatting == 'textile') && (ActionView::Helpers::TextHelper.method_defined? "textilize") ? RedCloth.new(h(text)).to_html : simple_format(auto_link(h(text)))
$RDM_TEXTILE_DISABLED ? simple_format(auto_link(h(text))) : RedCloth.new(h(text)).to_html
end
def error_messages_for(object_name, options = {})
@@ -131,9 +123,8 @@ module ApplicationHelper
end
end
def lang_options_for_select(blank=true)
(blank ? [["(auto)", ""]] : []) +
(GLoc.valid_languages.sort {|x,y| x.to_s <=> y.to_s }).collect {|lang| [ l_lang_name(lang.to_s, lang), lang.to_s]}
def lang_options_for_select
(GLoc.valid_languages.sort {|x,y| x.to_s <=> y.to_s }).collect {|lang| [ l_lang_name(lang.to_s, lang), lang.to_s]}
end
def label_tag_for(name, option_tags = nil, options = {})
@@ -154,7 +145,7 @@ module ApplicationHelper
end
def calendar_for(field_id)
image_tag("calendar.png", {:id => "#{field_id}_trigger",:class => "calendar-trigger"}) +
image_tag("calendar", {:id => "#{field_id}_trigger",:class => "calendar-trigger"}) +
javascript_tag("Calendar.setup({inputField : '#{field_id}', ifFormat : '%Y-%m-%d', button : '#{field_id}_trigger' });")
end
end

View File

@@ -34,7 +34,7 @@ module CustomFieldsHelper
when "bool"
check_box 'custom_value', 'value', :name => field_name, :id => field_id
when "list"
select 'custom_value', 'value', custom_field.possible_values, { :include_blank => true }, :name => field_name, :id => field_id
select 'custom_value', 'value', custom_field.possible_values.split('|'), { :include_blank => true }, :name => field_name, :id => field_id
end
end
@@ -59,10 +59,10 @@ module CustomFieldsHelper
# Return a string used to display a custom value
def format_value(value, field_format)
return "" unless value && !value.empty?
return "" unless value
case field_format
when "date"
begin; l_date(value.to_date); rescue; value end
value.empty? ? "" : l_date(value.to_date)
when "bool"
l_YesNo(value == "1")
else

View File

@@ -22,11 +22,6 @@ module IfpdfHelper
class IFPDF < FPDF
attr_accessor :footer_date
def initialize
super
SetCreator("redMine #{Redmine::VERSION}")
end
def Cell(w,h=0,txt='',border=0,ln=0,align='',fill=0,link='')
@ic ||= Iconv.new('ISO-8859-1', 'UTF-8')

View File

@@ -56,12 +56,12 @@ module IssuesHelper
unless no_html
label = content_tag('strong', label)
old_value = content_tag("i", h(old_value)) if detail.old_value
old_value = content_tag("strike", old_value) if detail.old_value and (!detail.value or detail.value.empty?)
old_value = content_tag("i", h(old_value)) if old_value
old_value = content_tag("strike", h(old_value)) if old_value and !value
value = content_tag("i", h(value)) if value
end
if detail.value and !detail.value.to_s.empty?
if value
if old_value
label + " " + l(:text_journal_changed, old_value, value)
else

View File

@@ -1,19 +0,0 @@
# redMine - project management software
# Copyright (C) 2006-2007 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.
module SettingsHelper
end

View File

@@ -96,10 +96,10 @@ module SortHelper
key, order = session[@sort_name][:key], session[@sort_name][:order]
if key == column
if order.downcase == 'asc'
icon = 'sort_asc.png'
icon = 'sort_asc'
order = 'desc'
else
icon = 'sort_desc.png'
icon = 'sort_desc'
order = 'asc'
end
else

View File

@@ -1,5 +1,5 @@
# redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
# 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
@@ -21,15 +21,12 @@ class Attachment < ActiveRecord::Base
belongs_to :container, :polymorphic => true
belongs_to :author, :class_name => "User", :foreign_key => "author_id"
validates_presence_of :container, :filename
cattr_accessor :storage_path
@@storage_path = "#{RAILS_ROOT}/files"
def validate
errors.add_to_base :too_long if self.filesize > Setting.attachment_max_size.to_i.kilobytes
end
@@max_size = $RDM_ATTACHMENT_MAX_SIZE || 5*1024*1024
cattr_reader :max_size
validates_presence_of :container, :filename
validates_inclusion_of :filesize, :in => 1..@@max_size
def file=(incomming_file)
unless incomming_file.nil?
@temp_file = incomming_file
@@ -66,7 +63,7 @@ class Attachment < ActiveRecord::Base
# Returns file's location on disk
def diskfile
"#{@@storage_path}/#{self.disk_filename}"
"#{$RDM_STORAGE_PATH}/#{self.disk_filename}"
end
def increment_download

View File

@@ -17,8 +17,7 @@
class CustomField < ActiveRecord::Base
has_many :custom_values, :dependent => :delete_all
serialize :possible_values
FIELD_FORMATS = { "string" => { :name => :label_string, :order => 1 },
"text" => { :name => :label_text, :order => 2 },
"int" => { :name => :label_integer, :order => 3 },
@@ -31,23 +30,7 @@ class CustomField < ActiveRecord::Base
validates_uniqueness_of :name
validates_format_of :name, :with => /^[\w\s\'\-]*$/i
validates_inclusion_of :field_format, :in => FIELD_FORMATS.keys
def initialize(attributes = nil)
super
self.possible_values ||= []
end
def before_validation
# remove empty values
self.possible_values = self.possible_values.collect{|v| v unless v.empty?}.compact
end
def validate
if self.field_format == "list"
errors.add(:possible_values, :activerecord_error_blank) if self.possible_values.nil? || self.possible_values.empty?
errors.add(:possible_values, :activerecord_error_invalid) unless self.possible_values.is_a? Array
end
end
validates_presence_of :possible_values, :if => Proc.new { |field| field.field_format == "list" }
# to move in project_custom_field
def self.for_all

View File

@@ -31,7 +31,7 @@ protected
when "date"
errors.add(:value, :activerecord_error_not_a_date) unless value =~ /^\d{4}-\d{2}-\d{2}$/ or value.empty?
when "list"
errors.add(:value, :activerecord_error_inclusion) unless custom_field.possible_values.include? value or value.empty?
errors.add(:value, :activerecord_error_inclusion) unless custom_field.possible_values.split('|').include? value or value.empty?
end
end
end

View File

@@ -18,7 +18,6 @@
class IssueStatus < ActiveRecord::Base
before_destroy :check_integrity
has_many :workflows, :foreign_key => "old_status_id"
acts_as_list
validates_presence_of :name
validates_uniqueness_of :name
@@ -27,7 +26,7 @@ class IssueStatus < ActiveRecord::Base
validates_format_of :html_color, :with => /^[a-f0-9]*$/i
def before_save
IssueStatus.update_all "is_default=#{connection.quoted_false}" if self.is_default?
IssueStatus.update_all "is_default=false" if self.is_default?
end
# Returns the default status for new issues
@@ -46,6 +45,6 @@ class IssueStatus < ActiveRecord::Base
private
def check_integrity
raise "Can't delete status" if Issue.find(:first, :conditions => ["status_id=?", self.id])
raise "Can't delete status" if Issue.find(:first, :conditions => ["status_id=?", self.id]) or IssueHistory.find(:first, :conditions => ["status_id=?", self.id])
end
end

View File

@@ -1,5 +1,5 @@
# redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
# 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
@@ -16,72 +16,37 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class Mailer < ActionMailer::Base
helper IssuesHelper
def issue_add(issue)
set_language_if_valid(Setting.default_language)
def issue_add(issue)
# Sends to all project members
@recipients = issue.project.members.collect { |m| m.user.mail if m.user.mail_notification }.compact
@from = Setting.mail_from
@recipients = issue.project.members.collect { |m| m.user.mail if m.user.mail_notification }
@from = $RDM_MAIL_FROM
@subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}"
@body['issue'] = issue
end
def issue_edit(journal)
set_language_if_valid(Setting.default_language)
# Sends to all project members
issue = journal.journalized
@recipients = issue.project.members.collect { |m| m.user.mail if m.user.mail_notification }.compact
@from = Setting.mail_from
@recipients = issue.project.members.collect { |m| m.user.mail if m.user.mail_notification }
@from = $RDM_MAIL_FROM
@subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}"
@body['issue'] = issue
@body['journal']= journal
end
def document_add(document)
set_language_if_valid(Setting.default_language)
@recipients = document.project.users.collect { |u| u.mail if u.mail_notification }.compact
@from = Setting.mail_from
@subject = "[#{document.project.name}] #{l(:label_document_new)}: #{document.title}"
@body['document'] = document
end
def attachments_add(attachments)
set_language_if_valid(Setting.default_language)
container = attachments.first.container
url = "http://#{Setting.host_name}/"
added_to = ""
case container.class.to_s
when 'Version'
url << "projects/list_files/#{container.project_id}"
added_to = "#{l(:label_version)}: #{container.name}"
when 'Document'
url << "documents/show/#{container.id}"
added_to = "#{l(:label_document)}: #{container.title}"
when 'Issue'
url << "issues/show/#{container.id}"
added_to = "#{container.tracker.name} ##{container.id}: #{container.subject}"
end
@recipients = container.project.users.collect { |u| u.mail if u.mail_notification }.compact
@from = Setting.mail_from
@subject = "[#{container.project.name}] #{l(:label_attachment_new)}"
@body['attachments'] = attachments
@body['url'] = url
@body['added_to'] = added_to
end
def lost_password(token)
set_language_if_valid(token.user.language)
@recipients = token.user.mail
@from = Setting.mail_from
@from = $RDM_MAIL_FROM
@subject = l(:mail_subject_lost_password)
@body['token'] = token
end
def register(token)
set_language_if_valid(token.user.language)
@recipients = token.user.mail
@from = Setting.mail_from
@from = $RDM_MAIL_FROM
@subject = l(:mail_subject_register)
@body['token'] = token
end

View File

@@ -65,6 +65,6 @@ class Project < ActiveRecord::Base
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 children.size > 0
errors.add_to_base("A project with subprojects can't be a subproject") if parent and projects_count > 0
end
end

View File

@@ -69,20 +69,19 @@ class Query < ActiveRecord::Base
def available_filters
return @available_filters if @available_filters
@available_filters = { "status_id" => { :type => :list_status, :order => 1, :values => IssueStatus.find(:all, :order => 'position').collect{|s| [s.name, s.id.to_s] } },
"tracker_id" => { :type => :list, :order => 2, :values => Tracker.find(:all, :order => 'position').collect{|s| [s.name, s.id.to_s] } },
@available_filters = { "status_id" => { :type => :list_status, :order => 1, :values => IssueStatus.find(:all).collect{|s| [s.name, s.id.to_s] } },
"tracker_id" => { :type => :list, :order => 2, :values => Tracker.find(:all).collect{|s| [s.name, s.id.to_s] } },
"priority_id" => { :type => :list, :order => 3, :values => Enumeration.find(:all, :conditions => ['opt=?','IPRI']).collect{|s| [s.name, s.id.to_s] } },
"subject" => { :type => :text, :order => 8 },
"created_on" => { :type => :date_past, :order => 9 },
"updated_on" => { :type => :date_past, :order => 10 },
"start_date" => { :type => :date, :order => 11 },
"due_date" => { :type => :date, :order => 12 } }
"subject" => { :type => :text, :order => 7 },
"created_on" => { :type => :date_past, :order => 8 },
"updated_on" => { :type => :date_past, :order => 9 },
"start_date" => { :type => :date, :order => 10 },
"due_date" => { :type => :date, :order => 11 } }
unless project.nil?
# project specific filters
@available_filters["assigned_to_id"] = { :type => :list_optional, :order => 4, :values => @project.users.collect{|s| [s.name, s.id.to_s] } }
@available_filters["author_id"] = { :type => :list, :order => 5, :values => @project.users.collect{|s| [s.name, s.id.to_s] } }
@available_filters["category_id"] = { :type => :list_optional, :order => 6, :values => @project.issue_categories.collect{|s| [s.name, s.id.to_s] } }
@available_filters["fixed_version_id"] = { :type => :list_optional, :order => 7, :values => @project.versions.collect{|s| [s.name, s.id.to_s] } }
# remove category filter if no category defined
@available_filters.delete "category_id" if @available_filters["category_id"][:values].empty?
end

View File

@@ -20,7 +20,6 @@ class Role < ActiveRecord::Base
has_and_belongs_to_many :permissions
has_many :workflows, :dependent => :delete_all
has_many :members
acts_as_list
validates_presence_of :name
validates_uniqueness_of :name

View File

@@ -1,61 +0,0 @@
# redMine - project management software
# Copyright (C) 2006-2007 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 Setting < ActiveRecord::Base
cattr_accessor :available_settings
@@available_settings = YAML::load(File.open("#{RAILS_ROOT}/config/settings.yml"))
validates_uniqueness_of :name
validates_inclusion_of :name, :in => @@available_settings.keys
validates_numericality_of :value, :only_integer => true, :if => Proc.new { |setting| @@available_settings[setting.name]['format'] == 'int' }
def self.get(name)
name = name.to_s
setting = find_by_name(name)
setting ||= new(:name => name, :value => @@available_settings[name]['default']) if @@available_settings.has_key? name
setting
end
def self.[](name)
get(name).value
end
def self.[]=(name, value)
setting = get(name)
setting.value = (value ? value.to_s : "")
setting.save
setting.value
end
@@available_settings.each do |name, params|
src = <<-END_SRC
def self.#{name}
self[:#{name}]
end
def self.#{name}?
self[:#{name}].to_s == "1"
end
def self.#{name}=(value)
self[:#{name}] = value
end
END_SRC
class_eval src, __FILE__, __LINE__
end
end

View File

@@ -20,7 +20,6 @@ class Tracker < ActiveRecord::Base
has_many :issues
has_many :workflows, :dependent => :delete_all
has_and_belongs_to_many :custom_fields, :class_name => 'IssueCustomField', :join_table => 'custom_fields_trackers', :association_foreign_key => 'custom_field_id'
acts_as_list
validates_presence_of :name
validates_uniqueness_of :name

View File

@@ -1,5 +1,5 @@
# redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
# 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
@@ -49,19 +49,7 @@ class User < ActiveRecord::Base
# update hashed_password if password was set
self.hashed_password = User.hash_password(self.password) if self.password
end
def self.active
with_scope :find => { :conditions => [ "status = ?", STATUS_ACTIVE ] } do
yield
end
end
def self.find_active(*args)
active do
find(*args)
end
end
# Returns the user that matches provided login and password, or nil
def self.try_to_login(login, password)
user = find(:first, :conditions => ["login=?", login])
@@ -81,7 +69,7 @@ class User < ActiveRecord::Base
if attrs
onthefly = new(*attrs)
onthefly.login = login
onthefly.language = Setting.default_language
onthefly.language = $RDM_DEFAULT_LANG
if onthefly.save
user = find(:first, :conditions => ["login=?", login])
logger.info("User '#{user.login}' created on the fly.") if logger

View File

@@ -17,7 +17,7 @@
class UserPreference < ActiveRecord::Base
belongs_to :user
serialize :others
serialize :others, Hash
attr_protected :others

View File

@@ -1,8 +1,8 @@
<center>
<div class="box login">
<h2 class="icon22 icon22-authent"><%=l(:label_please_login)%></h2>
<h2><%= image_tag 'login' %>&nbsp;&nbsp;<%=l(:label_please_login)%></h2>
<% form_tag({:action=> "login"}, :class => "tabular") do %>
<%= start_form_tag({:action=> "login"}, :class => "tabular") %>
<p><label for="login"><%=l(:field_login)%>:</label>
<%= text_field_tag 'login', nil, :size => 25 %></p>
@@ -10,15 +10,9 @@
<%= password_field_tag 'password', nil, :size => 25 %></p>
<p><center><input type="submit" name="login" value="<%=l(:button_login)%> &#187;" class="primary" /></center>
<% end %>
<%= end_form_tag %>
<br>
<% links = []
links << link_to(l(:label_register), :action => 'register') if Setting.self_registration?
links << link_to(l(:label_password_lost), :action => 'lost_password') if Setting.lost_password?
%>
<%= links.join(" | ") %>
</p>
<br><% unless $RDM_SELF_REGISTRATION == false %><%= link_to l(:label_register), :action => 'register' %> |<% end %>
<%= link_to l(:label_password_lost), :action => 'lost_password' %></p>
</div>
</center>

View File

@@ -2,13 +2,13 @@
<div class="box login">
<h2><%=l(:label_password_lost)%></h2>
<% form_tag({:action=> "lost_password"}, :class => "tabular") do %>
<%= start_form_tag({:action=> "lost_password"}, :class => "tabular") %>
<p><label for="mail"><%=l(:field_mail)%> <span class="required">*</span></label>
<%= text_field_tag 'mail', nil, :size => 40 %></p>
<p><center><%= submit_tag l(:button_submit) %></center></p>
<% end %>
<%= end_form_tag %>
</div>
</center>

View File

@@ -6,7 +6,7 @@
<%= error_messages_for 'user' %>
<% form_tag({:token => @token.value}, :class => "tabular") do %>
<%= start_form_tag({:token => @token.value}, :class => "tabular") %>
<p><label for="new_password"><%=l(:field_new_password)%> <span class="required">*</span></label>
<%= password_field_tag 'new_password', nil, :size => 25 %></p>
@@ -15,7 +15,7 @@
<%= password_field_tag 'new_password_confirmation', nil, :size => 25 %></p>
<p><center><%= submit_tag l(:button_save) %></center></p>
<% end %>
<%= end_form_tag %>
</div>
</center>

View File

@@ -1,6 +1,6 @@
<h2><%=l(:label_register)%></h2>
<% form_tag({:action => 'register'}, :class => "tabular") do %>
<%= start_form_tag({:action => 'register'}, :class => "tabular") %>
<%= error_messages_for 'user' %>
<div class="box">
@@ -36,11 +36,4 @@
</div>
<%= submit_tag l(:button_submit) %>
<% end %>
<% content_for :header_tags do %>
<%= javascript_include_tag 'calendar/calendar' %>
<%= javascript_include_tag "calendar/lang/calendar-#{current_language}.js" %>
<%= javascript_include_tag 'calendar/calendar-setup' %>
<%= stylesheet_link_tag 'calendar' %>
<% end %>
<%= end_form_tag %>

View File

@@ -1,45 +1,50 @@
<h2><%=l(:label_administration)%></h2>
<p class="icon22 icon22-projects">
<p>
<%= image_tag "projects" %>
<%= link_to l(:label_project_plural), :controller => 'admin', :action => 'projects' %> |
<%= link_to l(:label_new), :controller => 'projects', :action => 'add' %>
</p>
<p class="icon22 icon22-users">
<p>
<%= image_tag "users" %>
<%= link_to l(:label_user_plural), :controller => 'users' %> |
<%= link_to l(:label_new), :controller => 'users', :action => 'add' %>
</p>
<p class="icon22 icon22-role">
<p>
<%= image_tag "role" %>
<%= link_to l(:label_role_and_permissions), :controller => 'roles' %>
</p>
<p class="icon22 icon22-tracker">
<p>
<%= image_tag "tracker" %>
<%= link_to l(:label_tracker_plural), :controller => 'trackers' %> |
<%= link_to l(:label_custom_field_plural), :controller => 'custom_fields' %>
</p>
<p>
<%= image_tag "workflow" %>
<%= link_to l(:label_issue_status_plural), :controller => 'issue_statuses' %> |
<%= link_to l(:label_workflow), :controller => 'roles', :action => 'workflow' %>
</p>
<p class="icon22 icon22-workflow">
<%= link_to l(:label_custom_field_plural), :controller => 'custom_fields' %>
</p>
<p class="icon22 icon22-options">
<p>
<%= image_tag "options" %>
<%= link_to l(:label_enumerations), :controller => 'enumerations' %>
</p>
<p class="icon22 icon22-notifications">
<p>
<%= image_tag "mailer" %>
<%= link_to l(:field_mail_notification), :controller => 'admin', :action => 'mail_options' %>
</p>
<p class="icon22 icon22-authent">
<p>
<%= image_tag "login" %>
<%= link_to l(:label_authentication), :controller => 'auth_sources' %>
</p>
<p class="icon22 icon22-settings">
<%= link_to l(:label_settings), :controller => 'settings' %>
</p>
<p class="icon22 icon22-info">
<p>
<%= image_tag "help" %>
<%= link_to l(:label_information_plural), :controller => 'admin', :action => 'info' %>
</p>

View File

@@ -1,3 +1,10 @@
<h2><%=l(:label_information_plural)%></h2>
<p><%=l(:field_version)%>: <strong>redMine <%= Redmine::VERSION %></strong></p>
<p><%=l(:field_version)%>: <strong><%= RDM_APP_NAME %> <%= RDM_APP_VERSION %></strong></p>
<%=l(:label_environment)%>:
<ul>
<% Rails::Info.properties.each do |name, value| %>
<li><%= name %>: <%= value %></li>
<% end %>
</ul>

View File

@@ -1,6 +1,6 @@
<h2><%=l(:field_mail_notification)%></h2>
<% form_tag ({:action => 'mail_options'}, :id => 'mail_options_form') do %>
<%= start_form_tag ({}, :id => 'mail_options_form')%>
<div class="box">
<p><%=l(:text_select_mail_notifications)%></p>
@@ -21,4 +21,4 @@
</div>
<%= submit_tag l(:button_save) %>
<% end %>
<%= end_form_tag %>

View File

@@ -1,5 +1,5 @@
<div class="contextual">
<%= link_to l(:label_project_new), {:controller => 'projects', :action => 'add'}, :class => 'icon icon-add' %>
<%= link_to l(:label_project_new), {:controller => 'projects', :action => 'add'}, :class => 'pic picAdd' %>
</div>
<h2><%=l(:label_project_plural)%></h2>
@@ -18,8 +18,8 @@
<tr class="<%= cycle("odd", "even") %>">
<td><%= link_to project.name, :controller => 'projects', :action => 'settings', :id => project %>
<td><%=h project.description %>
<td align="center"><%= image_tag 'true.png' if project.is_public? %>
<td align="center"><%= project.children.size %>
<td align="center"><%= image_tag 'true' if project.is_public? %>
<td align="center"><%= project.projects_count %>
<td align="center"><%= format_date(project.created_on) %>
<td align="center">
<%= button_to l(:button_delete), { :controller => 'projects', :action => 'destroy', :id => project }, :class => "button-small" %>

View File

@@ -1,7 +1,7 @@
<h2><%=l(:label_auth_source)%> (<%= @auth_source.auth_method_name %>)</h2>
<% form_tag({:action => 'update', :id => @auth_source}, :class => "tabular") do %>
<%= start_form_tag({:action => 'update', :id => @auth_source}, :class => "tabular") %>
<%= render :partial => 'form' %>
<%= submit_tag l(:button_save) %>
<% end %>
<%= end_form_tag %>

View File

@@ -1,5 +1,5 @@
<div class="contextual">
<%= link_to l(:label_auth_source_new), {:action => 'new'}, :class => 'icon icon-add' %>
<%= link_to l(:label_auth_source_new), {:action => 'new'}, :class => 'pic picAdd' %>
</div>
<h2><%=l(:label_auth_source_plural)%></h2>

View File

@@ -1,6 +1,6 @@
<h2><%=l(:label_auth_source_new)%> (<%= @auth_source.auth_method_name %>)</h2>
<% form_tag({:action => 'create'}, :class => "tabular") do %>
<%= start_form_tag({:action => 'create'}, :class => "tabular") %>
<%= render :partial => 'form' %>
<%= submit_tag l(:button_create) %>
<% end %>
<%= end_form_tag %>

View File

@@ -1,7 +1,6 @@
<%= error_messages_for 'custom_field' %>
<script type="text/javascript">
//<![CDATA[
<script>
function toggle_custom_field_format() {
format = $("custom_field_field_format");
p_length = $("custom_field_min_length");
@@ -11,47 +10,28 @@ function toggle_custom_field_format() {
case "list":
Element.hide(p_length.parentNode);
Element.hide(p_regexp.parentNode);
Element.show(p_values);
Element.show(p_values.parentNode);
break;
case "int":
case "string":
case "text":
Element.show(p_length.parentNode);
Element.show(p_regexp.parentNode);
Element.hide(p_values);
Element.hide(p_values.parentNode);
break;
case "date":
case "bool":
Element.hide(p_length.parentNode);
Element.hide(p_regexp.parentNode);
Element.hide(p_values);
Element.hide(p_values.parentNode);
break;
default:
Element.show(p_length.parentNode);
Element.show(p_regexp.parentNode);
Element.show(p_values);
Element.show(p_values.parentNode);
break;
}
}
function addValueField() {
var f = $$('p#custom_field_possible_values span');
p = document.getElementById("custom_field_possible_values");
var v = f[0].cloneNode(true);
v.childNodes[0].value = "";
p.appendChild(v);
}
function deleteValueField(e) {
var f = $$('p#custom_field_possible_values span');
if (f.length == 1) {
e.parentNode.childNodes[0].value = "";
} else {
Element.remove(e.parentNode);
}
}
//]]>
</script>
<!--[form:custom_field]-->
@@ -62,12 +42,7 @@ function deleteValueField(e) {
<%= f.text_field :min_length, :size => 5, :no_label => true %> -
<%= f.text_field :max_length, :size => 5, :no_label => true %><br>(<%=l(:text_min_max_length_info)%>)</p>
<p><%= f.text_field :regexp, :size => 50 %><br>(<%=l(:text_regexp_info)%>)</p>
<p id="custom_field_possible_values"><label><%= l(:field_possible_values) %> <%= image_to_function "add.png", "addValueField();return false" %></label>
<% (@custom_field.possible_values.to_a + [""]).each do |value| %>
<span><%= text_field_tag 'custom_field[possible_values][]', value, :size => 30 %> <%= image_to_function "delete.png", "deleteValueField(this);return false" %><br /></span>
<% end %>
</p>
<p><%= f.text_area :possible_values, :rows => 5, :cols => 60 %><br>(<%=l(:text_possible_values_info)%>)</p>
</div>
<%= javascript_tag "toggle_custom_field_format();" %>
<!--[eoform:custom_field]-->

View File

@@ -1,46 +1,38 @@
<h2><%=l(:label_custom_field_plural)%></h2>
<div class="tabs">
<ul>
<li><%= link_to l(:label_issue_plural), {}, :id=> "tab-IssueCustomField", :onclick => "showTab('IssueCustomField'); this.blur(); return false;" %></li>
<li><%= link_to l(:label_project_plural), {}, :id=> "tab-ProjectCustomField", :onclick => "showTab('ProjectCustomField'); this.blur(); return false;" %></li>
<li><%= link_to l(:label_user_plural), {}, :id=> "tab-UserCustomField", :onclick => "showTab('UserCustomField'); this.blur(); return false;" %></li>
</ul>
</div>
<% %w(IssueCustomField ProjectCustomField UserCustomField).each do |type| %>
<div id="tab-content-<%= type %>" class="tab-content">
<table class="list">
<thead><tr>
<th width="30%"><%=l(:field_name)%></th>
<th><%=l(:field_name)%></th>
<th><%=l(:field_type)%></th>
<th><%=l(:field_field_format)%></th>
<th><%=l(:field_is_required)%></th>
<% if type == 'IssueCustomField' %>
<th><%=l(:field_is_required)%></th>
<th><%=l(:field_is_for_all)%></th>
<th><%=l(:label_used_by)%></th>
<% end %>
<th width="10%"></th>
<th><%=l(:label_used_by)%></th>
<th></th>
</tr></thead>
<tbody>
<% for custom_field in (@custom_fields_by_type[type] || []) %>
<% for custom_field in @custom_fields %>
<tr class="<%= cycle("odd", "even") %>">
<td><%= link_to custom_field.name, :action => 'edit', :id => custom_field %></td>
<td><%= link_to custom_field.name, :action => 'edit', :id => custom_field %></td>
<td align="center"><%= l(custom_field.type_name) %></td>
<td align="center"><%= l(CustomField::FIELD_FORMATS[custom_field.field_format][:name]) %></td>
<td align="center"><%= image_tag 'true.png' if custom_field.is_required? %></td>
<% if type == 'IssueCustomField' %>
<td align="center"><%= image_tag 'true.png' if custom_field.is_for_all? %></td>
<td align="center"><%= image_tag 'true' if custom_field.is_required? %></td>
<td align="center"><%= image_tag 'true' if custom_field.is_for_all? %></td>
<td align="center"><%= custom_field.projects.count.to_s + ' ' + lwr(:label_project, custom_field.projects.count) if custom_field.is_a? IssueCustomField and !custom_field.is_for_all? %></td>
<% end %>
<td align="center">
<%= button_to l(:button_delete), { :action => 'destroy', :id => custom_field }, :confirm => l(:text_are_you_sure), :class => "button-small" %>
</td>
</tr>
<% end; reset_cycle %>
</tbody>
</table>
<br />
<%= link_to l(:label_custom_field_new), {:action => 'new', :type => type}, :class => 'icon icon-add' %>
</div>
<% end %>
</tbody>
</table>
<%= javascript_tag "showTab('#{@tab}');" %>
<%= pagination_links_full @custom_field_pages %>
<br />
<%=l(:label_custom_field_new)%>:
<ul>
<li><%= link_to l(:label_issue_plural), :action => 'new', :type => 'IssueCustomField' %></li>
<li><%= link_to l(:label_project_plural), :action => 'new', :type => 'ProjectCustomField' %></li>
<li><%= link_to l(:label_user_plural), :action => 'new', :type => 'UserCustomField' %></li>
</ul>

View File

@@ -1,3 +1,3 @@
<p><%= link_to h(document.title), :controller => 'documents', :action => 'show', :id => document %><br />
<% unless document.description.empty? %><%=h(truncate(document.description, 250)) %><br /><% end %>
<% unless document.description.empty? %><%=h truncate document.description, 250 %><br /><% end %>
<em><%= format_time(document.created_on) %></em></p>

View File

@@ -14,7 +14,7 @@
<!--[eoform:document]-->
</div>
<% if Setting.text_formatting == 'textile' %>
<% unless $RDM_TEXTILE_DISABLED %>
<%= javascript_include_tag 'jstoolbar' %>
<script type="text/javascript">
//<![CDATA[

View File

@@ -1,8 +1,8 @@
<h2><%=l(:label_document)%></h2>
<% form_tag({:action => 'edit', :id => @document}, :class => "tabular") do %>
<%= start_form_tag({:action => 'edit', :id => @document}, :class => "tabular") %>
<%= render :partial => 'form' %>
<%= submit_tag l(:button_save) %>
<% end %>
<%= end_form_tag %>

View File

@@ -1,6 +1,6 @@
<div class="contextual">
<%= link_to_if_authorized l(:button_edit), {:controller => 'documents', :action => 'edit', :id => @document}, :class => 'icon icon-edit' %>
<%= link_to_if_authorized l(:button_delete), {:controller => 'documents', :action => 'destroy', :id => @document}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
<%= link_to_if_authorized l(:button_edit), {:controller => 'documents', :action => 'edit', :id => @document}, :class => 'pic picEdit' %>
<%= link_to_if_authorized l(:button_delete), {:controller => 'documents', :action => 'destroy', :id => @document}, :confirm => l(:text_are_you_sure), :post => true, :class => 'pic picDelete' %>
</div>
<h2><%= @document.title %></h2>
@@ -15,10 +15,10 @@
<% for attachment in @attachments %>
<li>
<div class="contextual">
<%= link_to_if_authorized l(:button_delete), {:controller => 'documents', :action => 'destroy_attachment', :id => @document, :attachment_id => attachment}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
<%= link_to_if_authorized l(:button_delete), {:controller => 'documents', :action => 'destroy_attachment', :id => @document, :attachment_id => attachment}, :confirm => l(:text_are_you_sure), :post => true, :class => 'pic picDelete' %>
</div>
<%= link_to attachment.filename, :action => 'download', :id => @document, :attachment_id => attachment %>
(<%= number_to_human_size attachment.filesize %>)<br />
(<%= human_size attachment.filesize %>)<br />
<em><%= attachment.author.display_name %>, <%= format_date(attachment.created_on) %></em><br />
<%= lwr(:label_download, attachment.downloads) %>
</li>
@@ -28,10 +28,10 @@
<% if authorize_for('documents', 'add_attachment') %>
<% form_tag ({ :controller => 'documents', :action => 'add_attachment', :id => @document }, :multipart => true, :class => "tabular") do %>
<p id="attachments_p"><label for="attachment_file"><%=l(:label_attachment)%>
<%= image_to_function "add.png", "addFileField();return false" %></label>
<%= file_field_tag 'attachments[]', :size => 30 %> <em>(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)</em></p>
<%= start_form_tag ({ :controller => 'documents', :action => 'add_attachment', :id => @document }, :multipart => true, :class => "tabular") %>
<p id="attachments_p"><label for="attachment_file"><%=l(:label_attachment)%>&nbsp;
<%= link_to_function image_tag('add'), "addFileField()" %></label>
<%= file_field_tag 'attachments[]', :size => 30 %> <em>(<%= l(:label_max_size) %>: <%= human_size(Attachment.max_size) %>)</em></p>
<%= submit_tag l(:button_add) %>
<% end %>
<%= end_form_tag %>
<% end %>

View File

@@ -1,10 +1,10 @@
<h2><%=l(:label_enumerations)%></h2>
<% form_tag({:action => 'update', :id => @enumeration}, :class => "tabular") do %>
<%= start_form_tag({:action => 'update', :id => @enumeration}, :class => "tabular") %>
<%= render :partial => 'form' %>
<%= submit_tag l(:button_save) %>
<% end %>
<%= end_form_tag %>
<% form_tag({:action => 'destroy', :id => @enumeration}) do %>
<%= start_form_tag :action => 'destroy', :id => @enumeration %>
<%= submit_tag l(:button_delete) %>
<% end %>
<%= end_form_tag %>

View File

@@ -10,7 +10,7 @@
<li><%= link_to value.name, :action => 'edit', :id => value %></li>
<% end %>
</ul>
<p><%= link_to l(:label_enumeration_new), { :action => 'new', :opt => option }, :class => "icon icon-add" %></p>&nbsp;
<p><%= link_to l(:label_enumeration_new), { :action => 'new', :opt => option }, :class => "pic picAdd" %></p>&nbsp;
<% else %>
<h3><%= link_to l(name), :opt => option %></h3>

View File

@@ -1,6 +1,6 @@
<h2><%= l(@enumeration.option_name) %>: <%=l(:label_enumeration_new)%></h2>
<% form_tag({:action => 'create'}, :class => "tabular") do %>
<%= start_form_tag({:action => 'create'}, :class => "tabular") %>
<%= render :partial => 'form' %>
<%= submit_tag l(:button_create) %>
<% end %>
<%= end_form_tag %>

View File

@@ -1,10 +1,10 @@
xml.instruct!
xml.rss "version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/" do
xml.channel do
xml.title "#{Setting.app_title}: #{l(:label_news_latest)}"
xml.link url_for(:controller => 'welcome', :only_path => false)
xml.title "#{$RDM_HEADER_TITLE}: #{l(:label_news_latest)}"
xml.link url_for(:controller => '', :only_path => false)
xml.pubDate CGI.rfc1123_date(@news.first.created_on)
xml.description l(:label_news_latest)
xml.description "#{$RDM_HEADER_TITLE}: #{l(:label_news_latest)}"
@news.each do |news|
xml.item do
xml.title "#{news.project.name}: #{news.title}"

View File

@@ -1,6 +1,6 @@
<h2><%=l(:label_issue_category)%></h2>
<% form_tag({:action => 'edit', :id => @category}, :class => "tabular") do %>
<%= start_form_tag({:action => 'edit', :id => @category}, :class => "tabular") %>
<%= render :partial => 'form' %>
<%= submit_tag l(:button_save) %>
<% end %>
<%= end_form_tag %>

View File

@@ -1,6 +1,6 @@
<h2><%=l(:label_issue_status)%></h2>
<% form_tag({:action => 'update', :id => @issue_status}, :class => "tabular") do %>
<%= start_form_tag({:action => 'update', :id => @issue_status}, :class => "tabular") %>
<%= render :partial => 'form' %>
<%= submit_tag l(:button_save) %>
<% end %>
<%= end_form_tag %>

View File

@@ -1,5 +1,5 @@
<div class="contextual">
<%= link_to l(:label_issue_status_new), {:action => 'new'}, :class => 'icon icon-add' %>
<%= link_to l(:label_issue_status_new), {:action => 'new'}, :class => 'pic picAdd' %>
</div>
<h2><%=l(:label_issue_status_plural)%></h2>
@@ -9,21 +9,14 @@
<th><%=l(:field_status)%></th>
<th><%=l(:field_is_default)%></th>
<th><%=l(:field_is_closed)%></th>
<th><%=l(:button_sort)%></th>
<th></th>
</tr></thead>
<tbody>
<% for status in @issue_statuses %>
<tr class="<%= cycle("odd", "even") %>">
<td><div class="square" style="background:#<%= status.html_color %>;"></div> <%= link_to status.name, :action => 'edit', :id => status %></td>
<td align="center"><%= image_tag 'true.png' if status.is_default? %></td>
<td align="center"><%= image_tag 'true.png' if status.is_closed? %></td>
<td align="center">
<%= link_to image_tag('2uparrow.png', :alt => l(:label_sort_highest)), {:action => 'move', :id => status, :position => 'highest'}, :method => :post, :title => l(:label_sort_highest) %>
<%= link_to image_tag('1uparrow.png', :alt => l(:label_sort_higher)), {:action => 'move', :id => status, :position => 'higher'}, :method => :post, :title => l(:label_sort_higher) %> -
<%= link_to image_tag('1downarrow.png', :alt => l(:label_sort_lower)), {:action => 'move', :id => status, :position => 'lower'}, :method => :post, :title => l(:label_sort_lower) %>
<%= link_to image_tag('2downarrow.png', :alt => l(:label_sort_lowest)), {:action => 'move', :id => status, :position => 'lowest'}, :method => :post, :title => l(:label_sort_lowest) %>
</td>
<td align="center"><%= image_tag 'true' if status.is_default? %></td>
<td align="center"><%= image_tag 'true' if status.is_closed? %></td>
<td align="center">
<%= button_to l(:button_delete), { :action => 'destroy', :id => status }, :confirm => l(:text_are_you_sure), :class => "button-small" %>
</td>

View File

@@ -1,6 +1,6 @@
<h2><%=l(:label_issue_status_new)%></h2>
<% form_tag({:action => 'create'}, :class => "tabular") do %>
<%= start_form_tag({:action => 'create'}, :class => "tabular") %>
<%= render :partial => 'form' %>
<%= submit_tag l(:button_create) %>
<% end %>
<%= end_form_tag %>

View File

@@ -1,5 +1,5 @@
<% if authorize_for('projects', 'add_issue') %>
<% form_tag({ :controller => 'projects', :action => 'add_issue', :id => @project }, :method => 'get') do %>
<%= start_form_tag({ :controller => 'projects', :action => 'add_issue', :id => @project }, :method => 'get') %>
<%= l(:label_issue_new) %>: <%= select_tag 'tracker_id', ("<option></option>" + options_from_collection_for_select(trackers, 'id', 'name')), :onchange => "if (this.value!='') {this.form.submit();}" %>
<% end %>
<%= end_form_tag %>
<% end %>

View File

@@ -92,7 +92,7 @@
for attachment in issue.attachments
pdf.SetFont('Arial','',8)
pdf.Cell(80,5, attachment.filename)
pdf.Cell(20,5, number_to_human_size(attachment.filesize),0,0,"R")
pdf.Cell(20,5, human_size(attachment.filesize),0,0,"R")
pdf.Cell(20,5, format_date(attachment.created_on),0,0,"R")
pdf.Cell(70,5, attachment.author.name,0,0,"R")
pdf.Ln

View File

@@ -1,6 +0,0 @@
<%= link_to "#{issue.tracker.name} ##{issue.id}", { :controller => 'issues', :action => 'show', :id => issue } %></strong>: <%=h issue.subject %><br />
<br />
<strong><%= l(:field_start_date) %></strong>: <%= format_date(issue.start_date) %><br />
<strong><%= l(:field_due_date) %></strong>: <%= format_date(issue.due_date) %><br />
<strong><%= l(:field_assigned_to) %></strong>: <%= issue.assigned_to ? issue.assigned_to.name : "-" %><br />
<strong><%= l(:field_priority) %></strong>: <%= issue.priority.name %>

View File

@@ -1,7 +1,7 @@
<h2><%=l(:label_issue)%> #<%= @issue.id %>: <%=h @issue.subject %></h2>
<%= error_messages_for 'issue' %>
<% form_tag({:action => 'change_status', :id => @issue}, :class => "tabular") do %>
<%= start_form_tag({:action => 'change_status', :id => @issue}, :class => "tabular") %>
<%= hidden_field_tag 'confirm', 1 %>
<%= hidden_field_tag 'new_status_id', @new_status.id %>
@@ -34,4 +34,4 @@
<%= hidden_field 'issue', 'lock_version' %>
<%= submit_tag l(:button_save) %>
<% end %>
<%= end_form_tag %>

View File

@@ -34,7 +34,7 @@
<%= submit_tag l(:button_save) %>
<% end %>
<% if Setting.text_formatting == 'textile' %>
<% unless $RDM_TEXTILE_DISABLED %>
<%= javascript_include_tag 'jstoolbar' %>
<script type="text/javascript">
//<![CDATA[
@@ -46,11 +46,4 @@ if (document.getElementById) {
}
//]]>
</script>
<% end %>
<% content_for :header_tags do %>
<%= javascript_include_tag 'calendar/calendar' %>
<%= javascript_include_tag "calendar/lang/calendar-#{current_language}.js" %>
<%= javascript_include_tag 'calendar/calendar-setup' %>
<%= stylesheet_link_tag 'calendar' %>
<% end %>

View File

@@ -1,5 +1,4 @@
<% pdf=IfpdfHelper::IFPDF.new
pdf.SetTitle("#{@project.name} - ##{@issue.tracker.name} #{@issue.id}")
pdf.AliasNbPages
pdf.footer_date = format_date(Date.today)
pdf.AddPage

View File

@@ -1,5 +1,5 @@
<div class="contextual">
<%= l(:label_export_to) %><%= link_to 'PDF', {:action => 'export_pdf', :id => @issue}, :class => 'icon icon-pdf' %>
<%= l(:label_export_to) %><%= link_to 'PDF', {:action => 'export_pdf', :id => @issue}, :class => 'pic picPdf' %>
</div>
<h2><%= @issue.tracker.name %> #<%= @issue.id %> - <%=h @issue.subject %></h2>
@@ -7,8 +7,8 @@
<div class="box">
<table width="100%">
<tr>
<td style="width:15%"><b><%=l(:field_status)%> :</b></td><td style="width:35%"><%= @issue.status.name %></td>
<td style="width:15%"><b><%=l(:field_priority)%> :</b></td><td style="width:35%"><%= @issue.priority.name %></td>
<td width="15%"><b><%=l(:field_status)%> :</b></td><td width="35%"><%= @issue.status.name %></td>
<td width="15%"><b><%=l(:field_priority)%> :</b></td><td width="35%"><%= @issue.priority.name %></td>
</tr>
<tr>
<td><b><%=l(:field_assigned_to)%> :</b></td><td><%= @issue.assigned_to ? @issue.assigned_to.name : "-" %></td>
@@ -26,10 +26,6 @@
<td><b><%=l(:field_updated_on)%> :</b></td><td><%= format_date(@issue.updated_on) %></td>
<td><b><%=l(:field_done_ratio)%> :</b></td><td><%= @issue.done_ratio %> %</td>
</tr>
<tr>
<td><b><%=l(:field_fixed_version)%> :</b></td><td><%= @issue.fixed_version ? @issue.fixed_version.name : "-" %></td>
<td></td><td></td>
</tr>
<tr>
<% n = 0
for custom_value in @custom_values %>
@@ -50,19 +46,19 @@ end %>
<br />
<div class="contextual">
<%= link_to_if_authorized l(:button_edit), {:controller => 'issues', :action => 'edit', :id => @issue}, :class => 'icon icon-edit' %>
<%= link_to_if_authorized l(:button_move), {:controller => 'projects', :action => 'move_issues', :id => @project, "issue_ids[]" => @issue.id }, :class => 'icon icon-move' %>
<%= link_to_if_authorized l(:button_delete), {:controller => 'issues', :action => 'destroy', :id => @issue}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
<%= link_to_if_authorized l(:button_edit), {:controller => 'issues', :action => 'edit', :id => @issue}, :class => 'pic picEdit' %>
<%= link_to_if_authorized l(:button_move), {:controller => 'projects', :action => 'move_issues', :id => @project, "issue_ids[]" => @issue.id }, :class => 'pic picMove' %>
<%= link_to_if_authorized l(:button_delete), {:controller => 'issues', :action => 'destroy', :id => @issue}, :confirm => l(:text_are_you_sure), :post => true, :class => 'pic picDelete' %>
</div>
<% if authorize_for('issues', 'change_status') and @status_options and !@status_options.empty? %>
<% form_tag ({:controller => 'issues', :action => 'change_status', :id => @issue}) do %>
<%= start_form_tag ({:controller => 'issues', :action => 'change_status', :id => @issue}) %>
<%=l(:label_change_status)%> :
<select name="new_status_id">
<%= options_from_collection_for_select @status_options, "id", "name" %>
</select>
<%= submit_tag l(:button_change) %>
<% end %>
<%= end_form_tag %>
<% end %>
&nbsp;
</div>
@@ -81,31 +77,31 @@ end %>
<table width="100%">
<% for attachment in @issue.attachments %>
<tr>
<td><%= link_to attachment.filename, { :action => 'download', :id => @issue, :attachment_id => attachment }, :class => 'icon icon-attachment' %> (<%= number_to_human_size(attachment.filesize) %>)</td>
<td><%= link_to attachment.filename, { :action => 'download', :id => @issue, :attachment_id => attachment }, :class => 'icon attachment' %> (<%= human_size(attachment.filesize) %>)</td>
<td><%= format_date(attachment.created_on) %></td>
<td><%= attachment.author.display_name %></td>
<td><div class="contextual"><%= link_to_if_authorized l(:button_delete), {:controller => 'issues', :action => 'destroy_attachment', :id => @issue, :attachment_id => attachment }, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %></div></td>
<td><div class="contextual"><%= link_to_if_authorized l(:button_delete), {:controller => 'issues', :action => 'destroy_attachment', :id => @issue, :attachment_id => attachment }, :confirm => l(:text_are_you_sure), :post => true, :class => 'pic picDelete' %></div></td>
</tr>
<% end %>
</table>
<br />
<% if authorize_for('issues', 'add_attachment') %>
<% form_tag ({ :controller => 'issues', :action => 'add_attachment', :id => @issue }, :multipart => true, :class => "tabular") do %>
<p id="attachments_p"><label><%=l(:label_attachment_new)%>
<%= image_to_function "add.png", "addFileField();return false" %></label>
<%= file_field_tag 'attachments[]', :size => 30 %> <em>(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)</em></p>
<%= start_form_tag ({ :controller => 'issues', :action => 'add_attachment', :id => @issue }, :multipart => true, :class => "tabular") %>
<p id="attachments_p"><label><%=l(:label_attachment_new)%>&nbsp;
<%= link_to_function image_tag('add'), "addFileField()" %></label>
<%= file_field_tag 'attachments[]', :size => 30 %> <em>(<%= l(:label_max_size) %>: <%= human_size(Attachment.max_size) %>)</em></p>
<%= submit_tag l(:button_add) %>
<% end %>
<%= end_form_tag %>
<% end %>
</div>
<% if authorize_for('issues', 'add_note') %>
<div class="box">
<h3><%= l(:label_add_note) %></h3>
<% form_tag ({:controller => 'issues', :action => 'add_note', :id => @issue}, :class => "tabular" ) do %>
<%= start_form_tag ({:controller => 'issues', :action => 'add_note', :id => @issue}, :class => "tabular" ) %>
<p><label for="notes"><%=l(:field_notes)%></label>
<%= text_area_tag 'notes', '', :cols => 60, :rows => 10 %></p>
<%= submit_tag l(:button_add) %>
<% end %>
<%= end_form_tag %>
</div>
<% end %>

View File

@@ -1,21 +1,21 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title><%= Setting.app_title + (@html_title ? ": #{@html_title}" : "") %></title>
<title><%= $RDM_HEADER_TITLE + (@html_title ? ": #{@html_title}" : "") %></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="redMine" />
<meta name="keywords" content="issue,bug,tracker" />
<!--[if IE]>
<style type="text/css">
body {behavior: url(<%= stylesheet_path "csshover.htc" %>);}
</style>
<![endif]-->
<%= stylesheet_link_tag "application" %>
<%= stylesheet_link_tag "print", :media => "print" %>
<%= javascript_include_tag :defaults %>
<%= javascript_include_tag 'menu' %>
<%= javascript_include_tag 'calendar/calendar' %>
<%= javascript_include_tag "calendar/lang/calendar-#{current_language}.js" %>
<%= javascript_include_tag 'calendar/calendar-setup' %>
<%= stylesheet_link_tag 'calendar' %>
<%= stylesheet_link_tag 'jstoolbar' %>
<!-- page specific tags --><%= yield :header_tags %>
<!-- page specific tags -->
<%= yield :header_tags %>
</head>
<body>
@@ -23,8 +23,8 @@
<div id="header">
<div style="float: left;">
<h1><%= Setting.app_title %></h1>
<h2><%= Setting.app_subtitle %></h2>
<h1><%= $RDM_HEADER_TITLE %></h1>
<h2><%= $RDM_HEADER_SUBTITLE %></h2>
</div>
<div style="float: right; padding-right: 1em; padding-top: 0.2em;">
<% if loggedin? %><small><%=l(:label_logged_as)%> <b><%= @logged_in_user.login %></b></small><% end %>
@@ -33,28 +33,28 @@
<div id="navigation">
<ul>
<li><%= link_to l(:label_home), { :controller => 'welcome' }, :class => "icon icon-home" %></li>
<li><%= link_to l(:label_my_page), { :controller => 'my', :action => 'page'}, :class => "icon icon-mypage" %></li>
<li><%= link_to l(:label_project_plural), { :controller => 'projects' }, :class => "icon icon-projects" %></li>
<li class="selected"><%= link_to l(:label_home), { :controller => '' }, :class => "picHome" %></li>
<li><%= link_to l(:label_my_page), { :controller => 'my', :action => 'page'}, :class => "picUserPage" %></li>
<li><%= link_to l(:label_project_plural), { :controller => 'projects' }, :class => "picProject" %></li>
<% unless @project.nil? || @project.id.nil? %>
<li class="submenu"><%= link_to @project.name, { :controller => 'projects', :action => 'show', :id => @project }, :class => "icon icon-projects", :onmouseover => "buttonMouseover(event, 'menuProject');" %></li>
<li class="submenu"><%= link_to @project.name, { :controller => 'projects', :action => 'show', :id => @project }, :class => "picProject", :onmouseover => "buttonMouseover(event, 'menuProject');" %></li>
<% end %>
<% if loggedin? %>
<li><%= link_to l(:label_my_account), { :controller => 'my', :action => 'account' }, :class => "icon icon-user" %></li>
<li><%= link_to l(:label_my_account), { :controller => 'my', :action => 'account' }, :class => "picUser" %></li>
<% end %>
<% if admin_loggedin? %>
<li class="submenu"><%= link_to l(:label_administration), { :controller => 'admin' }, :class => "icon icon-admin", :onmouseover => "buttonMouseover(event, 'menuAdmin');" %></li>
<li class="submenu"><%= link_to l(:label_administration), { :controller => 'admin' }, :class => "picAdmin", :onmouseover => "buttonMouseover(event, 'menuAdmin');" %></li>
<% end %>
<li class="right"><%= link_to l(:label_help), { :controller => 'help', :ctrl => params[:controller], :page => params[:action] }, :onclick => "window.open(this.href); return false;", :class => "icon icon-help" %></li>
<li class="right"><%= link_to l(:label_help), { :controller => 'help', :ctrl => params[:controller], :page => params[:action] }, :target => "new", :class => "picHelp" %></li>
<% if loggedin? %>
<li class="right"><%= link_to l(:label_logout), { :controller => 'account', :action => 'logout' }, :class => "icon icon-user" %></li>
<li class="right"><%= link_to l(:label_logout), { :controller => 'account', :action => 'logout' }, :class => "picUser" %></li>
<% else %>
<li class="right"><%= link_to l(:label_login), { :controller => 'account', :action => 'login' }, :class => "icon icon-user" %></li>
<li class="right"><%= link_to l(:label_login), { :controller => 'account', :action => 'login' }, :class => "picUser" %></li>
<% end %>
</ul>
</div>
@@ -69,7 +69,6 @@
<a class="menuItem" href="/enumerations"><%=l(:label_enumerations)%></a>
<a class="menuItem" href="/admin/mail_options"><%=l(:field_mail_notification)%></a>
<a class="menuItem" href="/auth_sources"><%=l(:label_authentication)%></a>
<a class="menuItem" href="/settings"><%=l(:label_settings)%></a>
<a class="menuItem" href="/admin/info"><%=l(:label_information_plural)%></a>
</div>
<div id="menuTrackers" class="menu">
@@ -84,12 +83,11 @@
<div id="menuProject" class="menu" onmouseover="menuMouseover(event)">
<%= link_to l(:label_calendar), {:controller => 'projects', :action => 'calendar', :id => @project }, :class => "menuItem" %>
<%= link_to l(:label_gantt), {:controller => 'projects', :action => 'gantt', :id => @project }, :class => "menuItem" %>
<%= link_to l(:label_issue_plural), {:controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1 }, :class => "menuItem" %>
<%= link_to l(:label_issue_plural), {:controller => 'projects', :action => 'list_issues', :id => @project }, :class => "menuItem" %>
<%= link_to l(:label_report_plural), {:controller => 'reports', :action => 'issue_report', :id => @project }, :class => "menuItem" %>
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'activity', :id => @project }, :class => "menuItem" %>
<%= link_to l(:label_news_plural), {:controller => 'projects', :action => 'list_news', :id => @project }, :class => "menuItem" %>
<%= link_to l(:label_change_log), {:controller => 'projects', :action => 'changelog', :id => @project }, :class => "menuItem" %>
<%= link_to l(:label_roadmap), {:controller => 'projects', :action => 'roadmap', :id => @project }, :class => "menuItem" %>
<%= link_to l(:label_document_plural), {:controller => 'projects', :action => 'list_documents', :id => @project }, :class => "menuItem" %>
<%= link_to l(:label_member_plural), {:controller => 'projects', :action => 'list_members', :id => @project }, :class => "menuItem" %>
<%= link_to l(:label_attachment_plural), {:controller => 'projects', :action => 'list_files', :id => @project }, :class => "menuItem" %>
@@ -107,12 +105,11 @@
<li><%= link_to l(:label_overview), :controller => 'projects', :action => 'show', :id => @project %></li>
<li><%= link_to l(:label_calendar), :controller => 'projects', :action => 'calendar', :id => @project %></li>
<li><%= link_to l(:label_gantt), :controller => 'projects', :action => 'gantt', :id => @project %></li>
<li><%= link_to l(:label_issue_plural), :controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1 %></li>
<li><%= link_to l(:label_issue_plural), :controller => 'projects', :action => 'list_issues', :id => @project %></li>
<li><%= link_to l(:label_report_plural), :controller => 'reports', :action => 'issue_report', :id => @project %></li>
<li><%= link_to l(:label_activity), :controller => 'projects', :action => 'activity', :id => @project %></li>
<li><%= link_to l(:label_news_plural), :controller => 'projects', :action => 'list_news', :id => @project %></li>
<li><%= link_to l(:label_change_log), :controller => 'projects', :action => 'changelog', :id => @project %></li>
<li><%= link_to l(:label_roadmap), :controller => 'projects', :action => 'roadmap', :id => @project %></li>
<li><%= link_to l(:label_document_plural), :controller => 'projects', :action => 'list_documents', :id => @project %></li>
<li><%= link_to l(:label_member_plural), :controller => 'projects', :action => 'list_members', :id => @project %></li>
<li><%= link_to l(:label_attachment_plural), :controller => 'projects', :action => 'list_files', :id => @project %></li>
@@ -137,7 +134,10 @@
</div>
<div id="footer">
<p><a href="http://redmine.rubyforge.org/">redMine</a> <small><%= Redmine::VERSION %> &copy 2006-2007 Jean-Philippe Lang</small></p>
<p>
<%= auto_link $RDM_FOOTER_SIG %> |
<a href="http://redmine.rubyforge.org/" target="_new"><%= RDM_APP_NAME %></a> <%= RDM_APP_VERSION %>
</p>
</div>
</div>

View File

@@ -4,4 +4,4 @@
<%= issue.description %>
http://<%= Setting.host_name %>/issues/show/<%= issue.id %>
http://<%= $RDM_HOST_NAME %>/issues/show/<%= issue.id %>

View File

@@ -1,6 +0,0 @@
<%= @added_to %>
<%= @attachments.size %> files(s) added.
<% @attachments.each do |attachment | %>
- <%= attachment.filename %><% end %>
<%= @url %>

View File

@@ -1,6 +0,0 @@
<%= @added_to %>
<%= @attachments.size %> files(s) added.
<% @attachments.each do |attachment | %>
- <%= attachment.filename %><% end %>
<%= @url %>

View File

@@ -1,6 +0,0 @@
<%= @added_to %>
<%= @attachments.size %> files(s) added.
<% @attachments.each do |attachment | %>
- <%= attachment.filename %><% end %>
<%= @url %>

View File

@@ -1,6 +0,0 @@
<%= @added_to %>
<%= @attachments.size %> fichier(s) ajouté(s).
<% @attachments.each do |attachment | %>
- <%= attachment.filename %><% end %>
<%= @url %>

View File

@@ -1,4 +0,0 @@
A document has been added to <%= @document.project.name %> (<%= @document.category.name %>):
<%= l(:field_title) %>: <%= @document.title %>
http://<%= Setting.host_name %>/documents/show/<%= @document.id %>

View File

@@ -1,4 +0,0 @@
A document has been added to <%= @document.project.name %> (<%= @document.category.name %>):
<%= l(:field_title) %>: <%= @document.title %>
http://<%= Setting.host_name %>/documents/show/<%= @document.id %>

View File

@@ -1,4 +0,0 @@
A document has been added to <%= @document.project.name %> (<%= @document.category.name %>):
<%= l(:field_title) %>: <%= @document.title %>
http://<%= Setting.host_name %>/documents/show/<%= @document.id %>

View File

@@ -1,4 +0,0 @@
Un document a été ajouté à <%= @document.project.name %> (<%= @document.category.name %>):
<%= l(:field_title) %>: <%= @document.title %>
http://<%= Setting.host_name %>/documents/show/<%= @document.id %>

View File

@@ -1,8 +1,8 @@
La demande #<%= @issue.id %> a été mise à jour.
<%= @journal.user.name %>
<%= @journal.user.name %> - <%= format_date(@journal.created_on) %>
<% for detail in @journal.details %>
<%= show_detail(detail, true) %>
<% end %>
<%= @journal.notes if @journal.notes? %>
<%= journal.notes if journal.notes? %>
----------------------------------------
<%= render :file => "_issue", :use_full_path => true, :locals => { :issue => @issue } %>

View File

@@ -1,3 +1,3 @@
To change your password, use the following link:
http://<%= Setting.host_name %>/account/lost_password?token=<%= @token.value %>
http://<%= $RDM_HOST_NAME %>/account/lost_password?token=<%= @token.value %>

View File

@@ -1,3 +1,3 @@
To change your password, use the following link:
http://<%= Setting.host_name %>/account/lost_password?token=<%= @token.value %>
http://<%= $RDM_HOST_NAME %>/account/lost_password?token=<%= @token.value %>

View File

@@ -1,3 +1,3 @@
To change your password, use the following link:
http://<%= Setting.host_name %>/account/lost_password?token=<%= @token.value %>
http://<%= $RDM_HOST_NAME %>/account/lost_password?token=<%= @token.value %>

View File

@@ -1,3 +1,3 @@
Pour changer votre mot de passe, utilisez le lien suivant:
http://<%= Setting.host_name %>/account/lost_password?token=<%= @token.value %>
http://<%= $RDM_HOST_NAME %>/account/lost_password?token=<%= @token.value %>

View File

@@ -1,3 +1,3 @@
To activate your redMine account, use the following link:
http://<%= Setting.host_name %>/account/register?token=<%= @token.value %>
http://<%= $RDM_HOST_NAME %>/account/register?token=<%= @token.value %>

View File

@@ -1,3 +1,3 @@
To activate your redMine account, use the following link:
http://<%= Setting.host_name %>/account/register?token=<%= @token.value %>
http://<%= $RDM_HOST_NAME %>/account/register?token=<%= @token.value %>

View File

@@ -1,3 +1,3 @@
To activate your redMine account, use the following link:
http://<%= Setting.host_name %>/account/register?token=<%= @token.value %>
http://<%= $RDM_HOST_NAME %>/account/register?token=<%= @token.value %>

View File

@@ -1,3 +1,3 @@
Pour activer votre compte sur redMine, utilisez le lien suivant:
http://<%= Setting.host_name %>/account/register?token=<%= @token.value %>
http://<%= $RDM_HOST_NAME %>/account/register?token=<%= @token.value %>

View File

@@ -1,7 +1,8 @@
<h2><%=l(:label_my_account)%></h2>
<p><%=l(:field_login)%>: <strong><%= @user.login %></strong><br />
<%=l(:field_created_on)%>: <%= format_time(@user.created_on) %></p>
<%=l(:field_created_on)%>: <%= format_time(@user.created_on) %>,
<%=l(:field_updated_on)%>: <%= format_time(@user.updated_on) %></p>
<%= error_messages_for 'user' %>
@@ -29,7 +30,7 @@
<div class="box">
<h3><%=l(:field_password)%></h3>
<% form_tag({:action => 'change_password'}, :class => "tabular") do %>
<%= start_form_tag({:action => 'change_password'}, :class => "tabular") %>
<p><label for="password"><%=l(:field_password)%> <span class="required">*</span></label>
<%= password_field_tag 'password', nil, :size => 25 %></p>
@@ -41,6 +42,6 @@
<%= password_field_tag 'new_password_confirmation', nil, :size => 25 %></p>
<center><%= submit_tag l(:button_save) %></center>
<% end %>
<%= end_form_tag %>
</div>
<% end %>

View File

@@ -29,11 +29,11 @@ while day <= @date_to
@issues.each { |i| day_issues << i if i.start_date == day or i.due_date == day }
day_issues.each do |i| %>
<%= if day == i.start_date and day == i.due_date
image_tag('arrow_bw.png')
image_tag('arrow_bw')
elsif day == i.start_date
image_tag('arrow_from.png')
image_tag('arrow_from')
elsif day == i.due_date
image_tag('arrow_to.png')
image_tag('arrow_to')
end %>
<small><%= link_to "#{i.tracker.name} ##{i.id}", :controller => 'issues', :action => 'show', :id => i %>: <%=h i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)') %></small><br />
<% end %>

View File

@@ -5,8 +5,7 @@
<h2><%=l(:label_my_page)%></h2>
<div id="list-top">
<% @blocks['top'].each do |b|
next unless MyController::BLOCKS.keys.include? b %>
<% @blocks['top'].each do |b| %>
<div class="mypage-box">
<%= render :partial => "my/blocks/#{b}", :locals => { :user => @user } %>
</div>
@@ -14,8 +13,7 @@
</div>
<div id="list-left" class="splitcontentleft">
<% @blocks['left'].each do |b|
next unless MyController::BLOCKS.keys.include? b %>
<% @blocks['left'].each do |b| %>
<div class="mypage-box">
<%= render :partial => "my/blocks/#{b}", :locals => { :user => @user } %>
</div>
@@ -23,8 +21,7 @@
</div>
<div id="list-right" class="splitcontentright">
<% @blocks['right'].each do |b|
next unless MyController::BLOCKS.keys.include? b %>
<% @blocks['right'].each do |b| %>
<div class="mypage-box">
<%= render :partial => "my/blocks/#{b}", :locals => { :user => @user } %>
</div>

View File

@@ -1,5 +1,5 @@
<script language="JavaScript">
//<![CDATA[
function recreateSortables() {
Sortable.destroy('list-top');
Sortable.destroy('list-left');
@@ -31,47 +31,43 @@ function removeBlock(block) {
$(block).parentNode.removeChild($(block));
updateSelect();
}
//]]>
</script>
<div class="contextual">
<span id="indicator" style="display:none"><%= image_tag "loading.gif", :align => "absmiddle" %></span>
<% form_tag({:action => "add_block"}, :id => "block-form") do %>
<%= start_form_tag({:action => "add_block"}, :id => "block-form") %>
<%= select_tag 'block', "<option></option>" + options_for_select(@block_options), :id => "block-select" %>
<%= link_to_remote l(:button_add),
{:url => { :action => "add_block" },
:url => { :action => "add_block" },
:with => "Form.serialize('block-form')",
:update => "list-top",
:position => :top,
:complete => "afterAddBlock();",
:loading => "Element.show('indicator')",
:loaded => "Element.hide('indicator')"
}, :class => 'icon icon-add'
%>
<% end %>
<%= link_to l(:button_save), {:action => 'page_layout_save'}, :class => 'icon icon-save' %>
<%= link_to l(:button_cancel), {:action => 'page'}, :class => 'icon icon-cancel' %>
<%= end_form_tag %> |
<%= link_to l(:button_save), :action => 'page_layout_save' %> |
<%= link_to l(:button_cancel), :action => 'page' %>
</div>
<h2><%=l(:label_my_page)%></h2>
<div id="list-top" class="block-receiver">
<% @blocks['top'].each do |b|
next unless MyController::BLOCKS.keys.include? b %>
<% @blocks['top'].each do |b| %>
<%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %>
<% end if @blocks['top'] %>
</div>
<div id="list-left" class="splitcontentleft block-receiver">
<% @blocks['left'].each do |b|
next unless MyController::BLOCKS.keys.include? b %>
<% @blocks['left'].each do |b| %>
<%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %>
<% end if @blocks['left'] %>
</div>
<div id="list-right" class="splitcontentright block-receiver">
<% @blocks['right'].each do |b|
next unless MyController::BLOCKS.keys.include? b %>
<% @blocks['right'].each do |b| %>
<%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %>
<% end if @blocks['right'] %>
</div>

View File

@@ -5,7 +5,7 @@
<p><%= f.text_area :description, :required => true, :cols => 60, :rows => 15 %></p>
</div>
<% if Setting.text_formatting == 'textile' %>
<% unless $RDM_TEXTILE_DISABLED %>
<%= javascript_include_tag 'jstoolbar' %>
<script type="text/javascript">
//<![CDATA[

View File

@@ -1,6 +1,6 @@
<div class="contextual">
<%= link_to_if_authorized l(:button_edit), {:controller => 'news', :action => 'edit', :id => @news}, :class => 'icon icon-edit' %>
<%= link_to_if_authorized l(:button_delete), {:controller => 'news', :action => 'destroy', :id => @news}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
<%= link_to_if_authorized l(:button_edit), {:controller => 'news', :action => 'edit', :id => @news}, :class => 'pic picEdit' %>
<%= link_to_if_authorized l(:button_delete), {:controller => 'news', :action => 'destroy', :id => @news}, :confirm => l(:text_are_you_sure), :post => true, :class => 'pic picDelete' %>
</div>
<h2><%=h @news.title %></h2>
@@ -12,22 +12,23 @@
<br />
<div id="comments" style="margin-bottom:16px;">
<h3 class="icon22 icon22-comment"><%= l(:label_comment_plural) %></h3>
<h3 class="icon comment"><%= l(:label_comment_plural) %></h3>
<% @news.comments.each do |comment| %>
<% next if comment.new_record? %>
<h4><%= format_time(comment.created_on) %> - <%= comment.author.name %></h4>
<div class="contextual">
<%= link_to_if_authorized l(:button_delete), {:controller => 'news', :action => 'destroy_comment', :id => @news, :comment_id => comment}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
<%= link_to_if_authorized l(:button_delete), {:controller => 'news', :action => 'destroy_comment', :id => @news, :comment_id => comment}, :confirm => l(:text_are_you_sure), :post => true, :class => 'pic picDelete' %>
</div>
<%= simple_format(auto_link(h comment.comment))%>
<% end if @news.comments_count > 0 %>
</div>
<% if authorize_for 'news', 'add_comment' %>
<% form_tag({:action => 'add_comment', :id => @news}) do %>
<h3><%= l(:label_comment_add) %></h3>
<%= start_form_tag :action => 'add_comment', :id => @news %>
<%= error_messages_for 'comment' %>
<p><label for="comment_comment"><%= l(:label_comment_add) %></label><br />
<p><label for="comment_comment"><%= l(:field_comment) %></label><br />
<%= text_area 'comment', 'comment', :cols => 60, :rows => 6 %></p>
<%= submit_tag l(:button_add) %>
<% end %>
<%= end_form_tag %>
<% end %>

View File

@@ -35,10 +35,3 @@
</div>
<%= javascript_tag "Element.hide('repository');" if @project.repository.nil? %>
</div>
<% content_for :header_tags do %>
<%= javascript_include_tag 'calendar/calendar' %>
<%= javascript_include_tag "calendar/lang/calendar-#{current_language}.js" %>
<%= javascript_include_tag 'calendar/calendar-setup' %>
<%= stylesheet_link_tag 'calendar' %>
<% end %>

View File

@@ -2,19 +2,16 @@
<div>
<div class="rightbox">
<% form_tag do %>
<%= start_form_tag %>
<p><%= select_month(@month, :prefix => "month", :discard_type => true) %>
<%= select_year(@year, :prefix => "year", :discard_type => true) %></p>
<p>
<%= check_box_tag 'show_issues', 1, @show_issues %><%= hidden_field_tag 'show_issues', 0, :id => nil %> <%=l(:label_issue_plural)%><br />
<%= check_box_tag 'show_news', 1, @show_news %><%= hidden_field_tag 'show_news', 0, :id => nil %> <%=l(:label_news_plural)%><br />
<%= check_box_tag 'show_files', 1, @show_files %><%= hidden_field_tag 'show_files', 0, :id => nil %> <%=l(:label_attachment_plural)%><br />
<%= check_box_tag 'show_documents', 1, @show_documents %><%= hidden_field_tag 'show_documents', 0, :id => nil %> <%=l(:label_document_plural)%>
</p>
<p class="textcenter"><%= submit_tag l(:button_apply), :class => 'button-small' %></p>
<% end %>
</div>
<%= check_box_tag 'show_issues', 1, @show_issues %><%= hidden_field_tag 'show_issues', 0 %> <%=l(:label_issue_plural)%><br />
<%= check_box_tag 'show_news', 1, @show_news %><%= hidden_field_tag 'show_news', 0 %> <%=l(:label_news_plural)%><br />
<%= check_box_tag 'show_files', 1, @show_files %><%= hidden_field_tag 'show_files', 0 %> <%=l(:label_attachment_plural)%><br />
<%= check_box_tag 'show_documents', 1, @show_documents %><%= hidden_field_tag 'show_documents', 0 %> <%=l(:label_document_plural)%><br />
<p><center><%= submit_tag l(:button_apply), :class => 'button-small' %></center></p>
<%= end_form_tag %>
</div>
<% @events_by_day.keys.sort {|x,y| y <=> x }.each do |day| %>
<h3><%= day_name(day.cwday) %> <%= day.day %></h3>
<ul>

View File

@@ -1,15 +1,15 @@
<h2><%=l(:label_document_new)%></h2>
<% form_tag( { :action => 'add_document', :id => @project }, :class => "tabular", :multipart => true) do %>
<%= start_form_tag( { :action => 'add_document', :id => @project }, :class => "tabular", :multipart => true) %>
<%= render :partial => 'documents/form' %>
<div class="box">
<p id="attachments_p"><label for="attachment_file"><%=l(:label_attachment)%>
<%= image_to_function "add.png", "addFileField();return false" %></label>
<%= file_field_tag 'attachments[]', :size => 30 %> <em>(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)</em></p>
<p id="attachments_p"><label for="attachment_file"><%=l(:label_attachment)%>&nbsp;
<%= link_to_function image_tag('add'), "addFileField()" %></label>
<%= file_field_tag 'attachments[]', :size => 30 %> <em>(<%= l(:label_max_size) %>: <%= human_size(Attachment.max_size) %>)</em></p>
</div>
<%= submit_tag l(:button_create) %>
<% end %>
<%= end_form_tag %>

Some files were not shown because too many files have changed in this diff Show More