Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f01d4ae46 |
@@ -1,25 +0,0 @@
|
|||||||
# redMine - project management software
|
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class FeedsController < ApplicationController
|
|
||||||
session :off
|
|
||||||
|
|
||||||
def news
|
|
||||||
@news = News.find :all, :order => 'news.created_on DESC', :limit => 10, :include => [ :author, :project ]
|
|
||||||
@headers["Content-Type"] = "application/rss+xml"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,131 +0,0 @@
|
|||||||
# redMine - project management software
|
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class MyController < ApplicationController
|
|
||||||
layout 'base'
|
|
||||||
before_filter :require_login
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
verify :xhr => true,
|
|
||||||
:session => :page_layout,
|
|
||||||
:only => [:add_block, :remove_block, :order_blocks]
|
|
||||||
|
|
||||||
def index
|
|
||||||
page
|
|
||||||
render :action => 'page'
|
|
||||||
end
|
|
||||||
|
|
||||||
# Show user's page
|
|
||||||
def page
|
|
||||||
@user = self.logged_in_user
|
|
||||||
@blocks = @user.pref[:my_page_layout] || { 'left' => ['issues_assigned_to_me'], 'right' => ['issues_reported_by_me'] }
|
|
||||||
end
|
|
||||||
|
|
||||||
# Edit user's account
|
|
||||||
def account
|
|
||||||
@user = self.logged_in_user
|
|
||||||
@pref = @user.pref
|
|
||||||
@user.attributes = params[:user]
|
|
||||||
@user.pref.attributes = params[:pref]
|
|
||||||
if request.post? and @user.save
|
|
||||||
set_localization
|
|
||||||
flash.now[:notice] = l(:notice_account_updated)
|
|
||||||
self.logged_in_user.reload
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Change user's password
|
|
||||||
def change_password
|
|
||||||
@user = self.logged_in_user
|
|
||||||
flash[:notice] = l(:notice_can_t_change_password) and redirect_to :action => 'account' and return if @user.auth_source_id
|
|
||||||
if @user.check_password?(params[:password])
|
|
||||||
@user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation]
|
|
||||||
if @user.save
|
|
||||||
flash[:notice] = l(:notice_account_password_updated)
|
|
||||||
else
|
|
||||||
render :action => 'account'
|
|
||||||
return
|
|
||||||
end
|
|
||||||
else
|
|
||||||
flash[:notice] = l(:notice_account_wrong_password)
|
|
||||||
end
|
|
||||||
redirect_to :action => 'account'
|
|
||||||
end
|
|
||||||
|
|
||||||
# User's page layout configuration
|
|
||||||
def page_layout
|
|
||||||
@user = self.logged_in_user
|
|
||||||
@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 = []
|
|
||||||
BLOCKS.each {|k, v| @block_options << [l(v), k]}
|
|
||||||
end
|
|
||||||
|
|
||||||
# Add a block to user's page
|
|
||||||
# The block is added on top of the page
|
|
||||||
# params[:block] : id of the block to add
|
|
||||||
def add_block
|
|
||||||
@user = self.logged_in_user
|
|
||||||
block = params[:block]
|
|
||||||
# remove if already present in a group
|
|
||||||
%w(top left right).each {|f| (session[:page_layout][f] ||= []).delete block }
|
|
||||||
# add it on top
|
|
||||||
session[:page_layout]['top'].unshift block
|
|
||||||
render :partial => "block", :locals => {:user => @user, :block_name => block}
|
|
||||||
end
|
|
||||||
|
|
||||||
# Remove a block to user's page
|
|
||||||
# params[:block] : id of the block to remove
|
|
||||||
def remove_block
|
|
||||||
block = params[:block]
|
|
||||||
# remove block in all groups
|
|
||||||
%w(top left right).each {|f| (session[:page_layout][f] ||= []).delete block }
|
|
||||||
render :nothing => true
|
|
||||||
end
|
|
||||||
|
|
||||||
# Change blocks order on user's page
|
|
||||||
# params[:group] : group to order (top, left or right)
|
|
||||||
# params[:list-(top|left|right)] : array of block ids of the group
|
|
||||||
def order_blocks
|
|
||||||
group = params[:group]
|
|
||||||
group_items = params["list-#{group}"]
|
|
||||||
if group_items and group_items.is_a? Array
|
|
||||||
# remove group blocks if they are presents in other groups
|
|
||||||
%w(top left right).each {|f|
|
|
||||||
session[:page_layout][f] = (session[:page_layout][f] || []) - group_items
|
|
||||||
}
|
|
||||||
session[:page_layout][group] = group_items
|
|
||||||
end
|
|
||||||
render :nothing => true
|
|
||||||
end
|
|
||||||
|
|
||||||
# Save user's page layout
|
|
||||||
def page_layout_save
|
|
||||||
@user = self.logged_in_user
|
|
||||||
@user.pref[:my_page_layout] = session[:page_layout] if session[:page_layout]
|
|
||||||
@user.pref.save
|
|
||||||
session[:page_layout] = nil
|
|
||||||
redirect_to :action => 'page'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,532 +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 ProjectsController < ApplicationController
|
|
||||||
layout 'base'
|
|
||||||
before_filter :find_project, :authorize, :except => [ :index, :list, :add ]
|
|
||||||
before_filter :require_admin, :only => [ :add, :destroy ]
|
|
||||||
|
|
||||||
helper :sort
|
|
||||||
include SortHelper
|
|
||||||
helper :custom_fields
|
|
||||||
include CustomFieldsHelper
|
|
||||||
helper :ifpdf
|
|
||||||
include IfpdfHelper
|
|
||||||
helper IssuesHelper
|
|
||||||
helper :queries
|
|
||||||
include QueriesHelper
|
|
||||||
|
|
||||||
def index
|
|
||||||
list
|
|
||||||
render :action => 'list' unless request.xhr?
|
|
||||||
end
|
|
||||||
|
|
||||||
# Lists public projects
|
|
||||||
def list
|
|
||||||
sort_init 'name', 'asc'
|
|
||||||
sort_update
|
|
||||||
@project_count = Project.count(["is_public=?", true])
|
|
||||||
@project_pages = Paginator.new self, @project_count,
|
|
||||||
15,
|
|
||||||
params['page']
|
|
||||||
@projects = Project.find :all, :order => sort_clause,
|
|
||||||
:conditions => ["is_public=?", true],
|
|
||||||
:limit => @project_pages.items_per_page,
|
|
||||||
:offset => @project_pages.current.offset
|
|
||||||
|
|
||||||
render :action => "list", :layout => false if request.xhr?
|
|
||||||
end
|
|
||||||
|
|
||||||
# Add a new project
|
|
||||||
def add
|
|
||||||
@custom_fields = IssueCustomField.find(:all)
|
|
||||||
@root_projects = Project.find(:all, :conditions => "parent_id is null")
|
|
||||||
@project = Project.new(params[:project])
|
|
||||||
if request.get?
|
|
||||||
@custom_values = ProjectCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @project) }
|
|
||||||
else
|
|
||||||
@project.custom_fields = CustomField.find(params[:custom_field_ids]) if params[:custom_field_ids]
|
|
||||||
@custom_values = ProjectCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @project, :value => params["custom_fields"][x.id.to_s]) }
|
|
||||||
@project.custom_values = @custom_values
|
|
||||||
if params[:repository_enabled] && params[:repository_enabled] == "1"
|
|
||||||
@project.repository = Repository.new
|
|
||||||
@project.repository.attributes = params[:repository]
|
|
||||||
end
|
|
||||||
if @project.save
|
|
||||||
flash[:notice] = l(:notice_successful_create)
|
|
||||||
redirect_to :controller => 'admin', :action => 'projects'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Show @project
|
|
||||||
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_count > 0
|
|
||||||
@news = @project.news.find(:all, :limit => 5, :include => [ :author, :project ], :order => "news.created_on DESC")
|
|
||||||
@trackers = Tracker.find(:all)
|
|
||||||
end
|
|
||||||
|
|
||||||
def settings
|
|
||||||
@root_projects = Project::find(:all, :conditions => ["parent_id is null and id <> ?", @project.id])
|
|
||||||
@custom_fields = IssueCustomField.find(:all)
|
|
||||||
@issue_category ||= IssueCategory.new
|
|
||||||
@member ||= @project.members.new
|
|
||||||
@roles = Role.find(:all)
|
|
||||||
@users = User.find(:all) - @project.members.find(:all, :include => :user).collect{|m| m.user }
|
|
||||||
@custom_values ||= ProjectCustomField.find(:all).collect { |x| @project.custom_values.find_by_custom_field_id(x.id) || CustomValue.new(:custom_field => x) }
|
|
||||||
end
|
|
||||||
|
|
||||||
# Edit @project
|
|
||||||
def edit
|
|
||||||
if request.post?
|
|
||||||
@project.custom_fields = IssueCustomField.find(params[:custom_field_ids]) if params[:custom_field_ids]
|
|
||||||
if params[:custom_fields]
|
|
||||||
@custom_values = ProjectCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @project, :value => params["custom_fields"][x.id.to_s]) }
|
|
||||||
@project.custom_values = @custom_values
|
|
||||||
end
|
|
||||||
if params[:repository_enabled]
|
|
||||||
case params[:repository_enabled]
|
|
||||||
when "0"
|
|
||||||
@project.repository = nil
|
|
||||||
when "1"
|
|
||||||
@project.repository ||= Repository.new
|
|
||||||
@project.repository.attributes = params[:repository]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@project.attributes = params[:project]
|
|
||||||
if @project.save
|
|
||||||
flash[:notice] = l(:notice_successful_update)
|
|
||||||
redirect_to :action => 'settings', :id => @project
|
|
||||||
else
|
|
||||||
settings
|
|
||||||
render :action => 'settings'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Delete @project
|
|
||||||
def destroy
|
|
||||||
if request.post? and params[:confirm]
|
|
||||||
@project.destroy
|
|
||||||
redirect_to :controller => 'admin', :action => 'projects'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Add a new issue category to @project
|
|
||||||
def add_issue_category
|
|
||||||
if request.post?
|
|
||||||
@issue_category = @project.issue_categories.build(params[:issue_category])
|
|
||||||
if @issue_category.save
|
|
||||||
flash[:notice] = l(:notice_successful_create)
|
|
||||||
redirect_to :action => 'settings', :id => @project
|
|
||||||
else
|
|
||||||
settings
|
|
||||||
render :action => 'settings'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Add a new version to @project
|
|
||||||
def add_version
|
|
||||||
@version = @project.versions.build(params[:version])
|
|
||||||
if request.post? and @version.save
|
|
||||||
flash[:notice] = l(:notice_successful_create)
|
|
||||||
redirect_to :action => 'settings', :id => @project
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Add a new member to @project
|
|
||||||
def add_member
|
|
||||||
@member = @project.members.build(params[:member])
|
|
||||||
if request.post?
|
|
||||||
if @member.save
|
|
||||||
flash[:notice] = l(:notice_successful_create)
|
|
||||||
redirect_to :action => 'settings', :id => @project
|
|
||||||
else
|
|
||||||
settings
|
|
||||||
render :action => 'settings'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Show members list of @project
|
|
||||||
def list_members
|
|
||||||
@members = @project.members
|
|
||||||
end
|
|
||||||
|
|
||||||
# Add a new document to @project
|
|
||||||
def add_document
|
|
||||||
@categories = Enumeration::get_values('DCAT')
|
|
||||||
@document = @project.documents.build(params[:document])
|
|
||||||
if request.post? and @document.save
|
|
||||||
# Save the attachments
|
|
||||||
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
|
|
||||||
flash[:notice] = l(:notice_successful_create)
|
|
||||||
redirect_to :action => 'list_documents', :id => @project
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Show documents list of @project
|
|
||||||
def list_documents
|
|
||||||
@documents = @project.documents.find :all, :include => :category
|
|
||||||
end
|
|
||||||
|
|
||||||
# Add a new issue to @project
|
|
||||||
def add_issue
|
|
||||||
@tracker = Tracker.find(params[:tracker_id])
|
|
||||||
@priorities = Enumeration::get_values('IPRI')
|
|
||||||
@issue = Issue.new(:project => @project, :tracker => @tracker)
|
|
||||||
if request.get?
|
|
||||||
@issue.start_date = Date.today
|
|
||||||
@custom_values = @project.custom_fields_for_issues(@tracker).collect { |x| CustomValue.new(:custom_field => x, :customized => @issue) }
|
|
||||||
else
|
|
||||||
@issue.attributes = params[:issue]
|
|
||||||
@issue.author_id = self.logged_in_user.id if self.logged_in_user
|
|
||||||
# Multiple file upload
|
|
||||||
@attachments = []
|
|
||||||
params[:attachments].each { |a|
|
|
||||||
@attachments << Attachment.new(:container => @issue, :file => a, :author => logged_in_user) unless a.size == 0
|
|
||||||
} if params[:attachments] and params[:attachments].is_a? Array
|
|
||||||
@custom_values = @project.custom_fields_for_issues(@tracker).collect { |x| CustomValue.new(:custom_field => x, :customized => @issue, :value => params["custom_fields"][x.id.to_s]) }
|
|
||||||
@issue.custom_values = @custom_values
|
|
||||||
if @issue.save
|
|
||||||
@attachments.each(&:save)
|
|
||||||
flash[:notice] = l(:notice_successful_create)
|
|
||||||
Mailer.deliver_issue_add(@issue) if Permission.find_by_controller_and_action(params[:controller], params[:action]).mail_enabled?
|
|
||||||
redirect_to :action => 'list_issues', :id => @project
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Show filtered/sorted issues list of @project
|
|
||||||
def list_issues
|
|
||||||
sort_init 'issues.id', 'desc'
|
|
||||||
sort_update
|
|
||||||
|
|
||||||
retrieve_query
|
|
||||||
|
|
||||||
@results_per_page_options = [ 15, 25, 50, 100 ]
|
|
||||||
if params[:per_page] and @results_per_page_options.include? params[:per_page].to_i
|
|
||||||
@results_per_page = params[:per_page].to_i
|
|
||||||
session[:results_per_page] = @results_per_page
|
|
||||||
else
|
|
||||||
@results_per_page = session[:results_per_page] || 25
|
|
||||||
end
|
|
||||||
|
|
||||||
if @query.valid?
|
|
||||||
@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 ],
|
|
||||||
:conditions => @query.statement,
|
|
||||||
:limit => @issue_pages.items_per_page,
|
|
||||||
:offset => @issue_pages.current.offset
|
|
||||||
end
|
|
||||||
@trackers = Tracker.find :all
|
|
||||||
render :layout => false if request.xhr?
|
|
||||||
end
|
|
||||||
|
|
||||||
# Export filtered/sorted issues list to CSV
|
|
||||||
def export_issues_csv
|
|
||||||
sort_init 'issues.id', 'desc'
|
|
||||||
sort_update
|
|
||||||
|
|
||||||
retrieve_query
|
|
||||||
render :action => 'list_issues' and return unless @query.valid?
|
|
||||||
|
|
||||||
@issues = Issue.find :all, :order => sort_clause,
|
|
||||||
: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_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.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
|
|
||||||
csv << fields.collect {|c| ic.iconv(c.to_s) }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
export.rewind
|
|
||||||
send_data(export.read, :type => 'text/csv; header=present', :filename => 'export.csv')
|
|
||||||
end
|
|
||||||
|
|
||||||
# Export filtered/sorted issues to PDF
|
|
||||||
def export_issues_pdf
|
|
||||||
sort_init 'issues.id', 'desc'
|
|
||||||
sort_update
|
|
||||||
|
|
||||||
retrieve_query
|
|
||||||
render :action => 'list_issues' and return unless @query.valid?
|
|
||||||
|
|
||||||
@issues = Issue.find :all, :order => sort_clause,
|
|
||||||
:include => [ :author, :status, :tracker, :project, :custom_values ],
|
|
||||||
:conditions => @query.statement
|
|
||||||
|
|
||||||
@options_for_rfpdf ||= {}
|
|
||||||
@options_for_rfpdf[:file_name] = "export.pdf"
|
|
||||||
render :layout => false
|
|
||||||
end
|
|
||||||
|
|
||||||
def move_issues
|
|
||||||
@issues = @project.issues.find(params[:issue_ids]) if params[:issue_ids]
|
|
||||||
redirect_to :action => 'list_issues', :id => @project and return unless @issues
|
|
||||||
@projects = []
|
|
||||||
# find projects to which the user is allowed to move the issue
|
|
||||||
@logged_in_user.memberships.each {|m| @projects << m.project if Permission.allowed_to_role("projects/move_issues", m.role_id)}
|
|
||||||
# issue can be moved to any tracker
|
|
||||||
@trackers = Tracker.find(:all)
|
|
||||||
if request.post? and params[:new_project_id] and params[:new_tracker_id]
|
|
||||||
new_project = Project.find(params[:new_project_id])
|
|
||||||
new_tracker = Tracker.find(params[:new_tracker_id])
|
|
||||||
@issues.each { |i|
|
|
||||||
# project dependent properties
|
|
||||||
unless i.project_id == new_project.id
|
|
||||||
i.category = nil
|
|
||||||
i.fixed_version = nil
|
|
||||||
end
|
|
||||||
# move the issue
|
|
||||||
i.project = new_project
|
|
||||||
i.tracker = new_tracker
|
|
||||||
i.save
|
|
||||||
}
|
|
||||||
flash[:notice] = l(:notice_successful_update)
|
|
||||||
redirect_to :action => 'list_issues', :id => @project
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def add_query
|
|
||||||
@query = Query.new(params[:query])
|
|
||||||
@query.project = @project
|
|
||||||
@query.user = logged_in_user
|
|
||||||
|
|
||||||
params[:fields].each do |field|
|
|
||||||
@query.add_filter(field, params[:operators][field], params[:values][field])
|
|
||||||
end if params[:fields]
|
|
||||||
|
|
||||||
if request.post? and @query.save
|
|
||||||
flash[:notice] = l(:notice_successful_create)
|
|
||||||
redirect_to :controller => 'reports', :action => 'issue_report', :id => @project
|
|
||||||
end
|
|
||||||
render :layout => false if request.xhr?
|
|
||||||
end
|
|
||||||
|
|
||||||
# Add a news to @project
|
|
||||||
def add_news
|
|
||||||
@news = News.new(:project => @project)
|
|
||||||
if request.post?
|
|
||||||
@news.attributes = params[:news]
|
|
||||||
@news.author_id = self.logged_in_user.id if self.logged_in_user
|
|
||||||
if @news.save
|
|
||||||
flash[:notice] = l(:notice_successful_create)
|
|
||||||
redirect_to :action => 'list_news', :id => @project
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Show news list of @project
|
|
||||||
def list_news
|
|
||||||
@news_pages, @news = paginate :news, :per_page => 10, :conditions => ["project_id=?", @project.id], :include => :author, :order => "news.created_on DESC"
|
|
||||||
render :action => "list_news", :layout => false if request.xhr?
|
|
||||||
end
|
|
||||||
|
|
||||||
def add_file
|
|
||||||
if request.post?
|
|
||||||
@version = @project.versions.find_by_id(params[:version_id])
|
|
||||||
# Save the attachments
|
|
||||||
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
|
|
||||||
redirect_to :controller => 'projects', :action => 'list_files', :id => @project
|
|
||||||
end
|
|
||||||
@versions = @project.versions
|
|
||||||
end
|
|
||||||
|
|
||||||
def list_files
|
|
||||||
@versions = @project.versions
|
|
||||||
end
|
|
||||||
|
|
||||||
# Show changelog for @project
|
|
||||||
def changelog
|
|
||||||
@trackers = Tracker.find(:all, :conditions => ["is_in_chlog=?", true])
|
|
||||||
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 ||= []
|
|
||||||
@fixed_issues = @project.issues.find(:all,
|
|
||||||
:include => [ :fixed_version, :status, :tracker ],
|
|
||||||
:conditions => [ "issue_statuses.is_closed=? and issues.tracker_id in (#{@selected_tracker_ids.join(',')}) and issues.fixed_version_id is not null", true],
|
|
||||||
:order => "versions.effective_date DESC, issues.id DESC"
|
|
||||||
) unless @selected_tracker_ids.empty?
|
|
||||||
@fixed_issues ||= []
|
|
||||||
end
|
|
||||||
|
|
||||||
def activity
|
|
||||||
if params[:year] and params[:year].to_i > 1900
|
|
||||||
@year = params[:year].to_i
|
|
||||||
if params[:month] and params[:month].to_i > 0 and params[:month].to_i < 13
|
|
||||||
@month = params[:month].to_i
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@year ||= Date.today.year
|
|
||||||
@month ||= Date.today.month
|
|
||||||
|
|
||||||
@date_from = Date.civil(@year, @month, 1)
|
|
||||||
@date_to = (@date_from >> 1)-1
|
|
||||||
|
|
||||||
@events_by_day = {}
|
|
||||||
|
|
||||||
unless params[:show_issues] == "0"
|
|
||||||
@project.issues.find(:all, :include => [:author, :status], :conditions => ["issues.created_on>=? and issues.created_on<=?", @date_from, @date_to] ).each { |i|
|
|
||||||
@events_by_day[i.created_on.to_date] ||= []
|
|
||||||
@events_by_day[i.created_on.to_date] << i
|
|
||||||
}
|
|
||||||
@show_issues = 1
|
|
||||||
end
|
|
||||||
|
|
||||||
unless params[:show_news] == "0"
|
|
||||||
@project.news.find(:all, :conditions => ["news.created_on>=? and news.created_on<=?", @date_from, @date_to], :include => :author ).each { |i|
|
|
||||||
@events_by_day[i.created_on.to_date] ||= []
|
|
||||||
@events_by_day[i.created_on.to_date] << i
|
|
||||||
}
|
|
||||||
@show_news = 1
|
|
||||||
end
|
|
||||||
|
|
||||||
unless params[:show_files] == "0"
|
|
||||||
Attachment.find(:all, :select => "attachments.*", :joins => "LEFT JOIN versions ON versions.id = attachments.container_id", :conditions => ["attachments.container_type='Version' and versions.project_id=? and attachments.created_on>=? and attachments.created_on<=?", @project.id, @date_from, @date_to], :include => :author ).each { |i|
|
|
||||||
@events_by_day[i.created_on.to_date] ||= []
|
|
||||||
@events_by_day[i.created_on.to_date] << i
|
|
||||||
}
|
|
||||||
@show_files = 1
|
|
||||||
end
|
|
||||||
|
|
||||||
unless params[:show_documents] == "0"
|
|
||||||
@project.documents.find(:all, :conditions => ["documents.created_on>=? and documents.created_on<=?", @date_from, @date_to] ).each { |i|
|
|
||||||
@events_by_day[i.created_on.to_date] ||= []
|
|
||||||
@events_by_day[i.created_on.to_date] << i
|
|
||||||
}
|
|
||||||
Attachment.find(:all, :select => "attachments.*", :joins => "LEFT JOIN documents ON documents.id = attachments.container_id", :conditions => ["attachments.container_type='Document' and documents.project_id=? and attachments.created_on>=? and attachments.created_on<=?", @project.id, @date_from, @date_to], :include => :author ).each { |i|
|
|
||||||
@events_by_day[i.created_on.to_date] ||= []
|
|
||||||
@events_by_day[i.created_on.to_date] << i
|
|
||||||
}
|
|
||||||
@show_documents = 1
|
|
||||||
end
|
|
||||||
|
|
||||||
render :layout => false if request.xhr?
|
|
||||||
end
|
|
||||||
|
|
||||||
def calendar
|
|
||||||
if params[:year] and params[:year].to_i > 1900
|
|
||||||
@year = params[:year].to_i
|
|
||||||
if params[:month] and params[:month].to_i > 0 and params[:month].to_i < 13
|
|
||||||
@month = params[:month].to_i
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@year ||= Date.today.year
|
|
||||||
@month ||= Date.today.month
|
|
||||||
|
|
||||||
@date_from = Date.civil(@year, @month, 1)
|
|
||||||
@date_to = (@date_from >> 1)-1
|
|
||||||
# start on monday
|
|
||||||
@date_from = @date_from - (@date_from.cwday-1)
|
|
||||||
# finish on sunday
|
|
||||||
@date_to = @date_to + (7-@date_to.cwday)
|
|
||||||
|
|
||||||
@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
|
|
||||||
|
|
||||||
def gantt
|
|
||||||
if params[:year] and params[:year].to_i >0
|
|
||||||
@year_from = params[:year].to_i
|
|
||||||
if params[:month] and params[:month].to_i >=1 and params[:month].to_i <= 12
|
|
||||||
@month_from = params[:month].to_i
|
|
||||||
else
|
|
||||||
@month_from = 1
|
|
||||||
end
|
|
||||||
else
|
|
||||||
@month_from ||= (Date.today << 1).month
|
|
||||||
@year_from ||= (Date.today << 1).year
|
|
||||||
end
|
|
||||||
|
|
||||||
@zoom = (params[:zoom].to_i > 0 and params[:zoom].to_i < 5) ? params[:zoom].to_i : 2
|
|
||||||
@months = (params[:months].to_i > 0 and params[:months].to_i < 25) ? params[:months].to_i : 6
|
|
||||||
|
|
||||||
@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", :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 ||= {}
|
|
||||||
@options_for_rfpdf[:file_name] = "gantt.pdf"
|
|
||||||
render :template => "projects/gantt.rfpdf", :layout => false
|
|
||||||
else
|
|
||||||
render :template => "projects/gantt.rhtml"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
# Find project of id params[:id]
|
|
||||||
# if not found, redirect to project list
|
|
||||||
# Used as a before_filter
|
|
||||||
def find_project
|
|
||||||
@project = Project.find(params[:id])
|
|
||||||
@html_title = @project.name
|
|
||||||
rescue ActiveRecord::RecordNotFound
|
|
||||||
render_404
|
|
||||||
end
|
|
||||||
|
|
||||||
# Retrieve query from session or build a new query
|
|
||||||
def retrieve_query
|
|
||||||
if params[:query_id]
|
|
||||||
@query = @project.queries.find(params[:query_id])
|
|
||||||
else
|
|
||||||
if params[:set_filter] or !session[:query] or session[:query].project_id != @project.id
|
|
||||||
# Give it a name, required to be valid
|
|
||||||
@query = Query.new(:name => "_")
|
|
||||||
@query.project = @project
|
|
||||||
if params[:fields] and params[:fields].is_a? Array
|
|
||||||
params[:fields].each do |field|
|
|
||||||
@query.add_filter(field, params[:operators][field], params[:values][field])
|
|
||||||
end
|
|
||||||
else
|
|
||||||
@query.available_filters.keys.each do |field|
|
|
||||||
@query.add_short_filter(field, params[field]) if params[field]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
session[:query] = @query
|
|
||||||
else
|
|
||||||
@query = session[:query]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
# redMine - project management software
|
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class QueriesController < ApplicationController
|
|
||||||
layout 'base'
|
|
||||||
before_filter :require_login, :find_query
|
|
||||||
|
|
||||||
def edit
|
|
||||||
if request.post?
|
|
||||||
@query.filters = {}
|
|
||||||
params[:fields].each do |field|
|
|
||||||
@query.add_filter(field, params[:operators][field], params[:values][field])
|
|
||||||
end if params[:fields]
|
|
||||||
@query.attributes = params[:query]
|
|
||||||
|
|
||||||
if @query.save
|
|
||||||
flash[:notice] = l(:notice_successful_update)
|
|
||||||
redirect_to :controller => 'projects', :action => 'list_issues', :id => @project, :query_id => @query
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def destroy
|
|
||||||
@query.destroy if request.post?
|
|
||||||
redirect_to :controller => 'reports', :action => 'issue_report', :id => @project
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
def find_query
|
|
||||||
@query = Query.find(params[:id])
|
|
||||||
@project = @query.project
|
|
||||||
# check if user is allowed to manage queries (same permission as add_query)
|
|
||||||
authorize('projects', 'add_query')
|
|
||||||
rescue ActiveRecord::RecordNotFound
|
|
||||||
render_404
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,167 +0,0 @@
|
|||||||
# redMine - project management software
|
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class ReportsController < ApplicationController
|
|
||||||
layout 'base'
|
|
||||||
before_filter :find_project, :authorize
|
|
||||||
|
|
||||||
def issue_report
|
|
||||||
@statuses = IssueStatus.find :all
|
|
||||||
|
|
||||||
case params[:detail]
|
|
||||||
when "tracker"
|
|
||||||
@field = "tracker_id"
|
|
||||||
@rows = Tracker.find :all
|
|
||||||
@data = issues_by_tracker
|
|
||||||
@report_title = l(:field_tracker)
|
|
||||||
render :template => "reports/issue_report_details"
|
|
||||||
when "priority"
|
|
||||||
@field = "priority_id"
|
|
||||||
@rows = Enumeration::get_values('IPRI')
|
|
||||||
@data = issues_by_priority
|
|
||||||
@report_title = l(:field_priority)
|
|
||||||
render :template => "reports/issue_report_details"
|
|
||||||
when "category"
|
|
||||||
@field = "category_id"
|
|
||||||
@rows = @project.issue_categories
|
|
||||||
@data = issues_by_category
|
|
||||||
@report_title = l(:field_category)
|
|
||||||
render :template => "reports/issue_report_details"
|
|
||||||
when "author"
|
|
||||||
@field = "author_id"
|
|
||||||
@rows = @project.members.collect { |m| m.user }
|
|
||||||
@data = issues_by_author
|
|
||||||
@report_title = l(:field_author)
|
|
||||||
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)
|
|
||||||
@priorities = Enumeration::get_values('IPRI')
|
|
||||||
@categories = @project.issue_categories
|
|
||||||
@authors = @project.members.collect { |m| m.user }
|
|
||||||
issues_by_tracker
|
|
||||||
issues_by_priority
|
|
||||||
issues_by_category
|
|
||||||
issues_by_author
|
|
||||||
render :template => "reports/issue_report"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def delays
|
|
||||||
@trackers = Tracker.find(:all)
|
|
||||||
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 ||= []
|
|
||||||
@raw =
|
|
||||||
ActiveRecord::Base.connection.select_all("SELECT datediff( a.created_on, b.created_on ) as delay, count(a.id) as total
|
|
||||||
FROM issue_histories a, issue_histories b, issues i
|
|
||||||
WHERE a.status_id =5
|
|
||||||
AND a.issue_id = b.issue_id
|
|
||||||
AND a.issue_id = i.id
|
|
||||||
AND i.tracker_id in (#{@selected_tracker_ids.join(',')})
|
|
||||||
AND b.id = (
|
|
||||||
SELECT min( c.id )
|
|
||||||
FROM issue_histories c
|
|
||||||
WHERE b.issue_id = c.issue_id )
|
|
||||||
GROUP BY delay") unless @selected_tracker_ids.empty?
|
|
||||||
@raw ||=[]
|
|
||||||
|
|
||||||
@x_from = 0
|
|
||||||
@x_to = 0
|
|
||||||
@y_from = 0
|
|
||||||
@y_to = 0
|
|
||||||
@sum_total = 0
|
|
||||||
@sum_delay = 0
|
|
||||||
@raw.each do |r|
|
|
||||||
@x_to = [r['delay'].to_i, @x_to].max
|
|
||||||
@y_to = [r['total'].to_i, @y_to].max
|
|
||||||
@sum_total = @sum_total + r['total'].to_i
|
|
||||||
@sum_delay = @sum_delay + r['total'].to_i * r['delay'].to_i
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
# Find project of id params[:id]
|
|
||||||
def find_project
|
|
||||||
@project = Project.find(params[:id])
|
|
||||||
rescue ActiveRecord::RecordNotFound
|
|
||||||
render_404
|
|
||||||
end
|
|
||||||
|
|
||||||
def issues_by_tracker
|
|
||||||
@issues_by_tracker ||=
|
|
||||||
ActiveRecord::Base.connection.select_all("select s.id as status_id,
|
|
||||||
s.is_closed as closed,
|
|
||||||
t.id as tracker_id,
|
|
||||||
count(i.id) as total
|
|
||||||
from
|
|
||||||
issues i, issue_statuses s, trackers t
|
|
||||||
where
|
|
||||||
i.status_id=s.id
|
|
||||||
and i.tracker_id=t.id
|
|
||||||
and i.project_id=#{@project.id}
|
|
||||||
group by s.id, s.is_closed, t.id")
|
|
||||||
end
|
|
||||||
|
|
||||||
def issues_by_priority
|
|
||||||
@issues_by_priority ||=
|
|
||||||
ActiveRecord::Base.connection.select_all("select s.id as status_id,
|
|
||||||
s.is_closed as closed,
|
|
||||||
p.id as priority_id,
|
|
||||||
count(i.id) as total
|
|
||||||
from
|
|
||||||
issues i, issue_statuses s, enumerations p
|
|
||||||
where
|
|
||||||
i.status_id=s.id
|
|
||||||
and i.priority_id=p.id
|
|
||||||
and i.project_id=#{@project.id}
|
|
||||||
group by s.id, s.is_closed, p.id")
|
|
||||||
end
|
|
||||||
|
|
||||||
def issues_by_category
|
|
||||||
@issues_by_category ||=
|
|
||||||
ActiveRecord::Base.connection.select_all("select s.id as status_id,
|
|
||||||
s.is_closed as closed,
|
|
||||||
c.id as category_id,
|
|
||||||
count(i.id) as total
|
|
||||||
from
|
|
||||||
issues i, issue_statuses s, issue_categories c
|
|
||||||
where
|
|
||||||
i.status_id=s.id
|
|
||||||
and i.category_id=c.id
|
|
||||||
and i.project_id=#{@project.id}
|
|
||||||
group by s.id, s.is_closed, c.id")
|
|
||||||
end
|
|
||||||
|
|
||||||
def issues_by_author
|
|
||||||
@issues_by_author ||=
|
|
||||||
ActiveRecord::Base.connection.select_all("select s.id as status_id,
|
|
||||||
s.is_closed as closed,
|
|
||||||
a.id as author_id,
|
|
||||||
count(i.id) as total
|
|
||||||
from
|
|
||||||
issues i, issue_statuses s, users a
|
|
||||||
where
|
|
||||||
i.status_id=s.id
|
|
||||||
and i.author_id=a.id
|
|
||||||
and i.project_id=#{@project.id}
|
|
||||||
group by s.id, s.is_closed, a.id")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
# redMine - project management software
|
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class RepositoriesController < ApplicationController
|
|
||||||
layout 'base'
|
|
||||||
before_filter :find_project, :authorize
|
|
||||||
|
|
||||||
def show
|
|
||||||
@entries = @repository.scm.entries('')
|
|
||||||
show_error and return unless @entries
|
|
||||||
@latest_revision = @entries.revisions.latest
|
|
||||||
end
|
|
||||||
|
|
||||||
def browse
|
|
||||||
@entries = @repository.scm.entries(@path, @rev)
|
|
||||||
show_error and return unless @entries
|
|
||||||
end
|
|
||||||
|
|
||||||
def revisions
|
|
||||||
@entry = @repository.scm.entry(@path, @rev)
|
|
||||||
@revisions = @repository.scm.revisions(@path, @rev)
|
|
||||||
show_error and return unless @entry && @revisions
|
|
||||||
end
|
|
||||||
|
|
||||||
def entry
|
|
||||||
if 'raw' == params[:format]
|
|
||||||
content = @repository.scm.cat(@path, @rev)
|
|
||||||
show_error and return unless content
|
|
||||||
send_data content, :filename => @path.split('/').last
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def revision
|
|
||||||
@revisions = @repository.scm.revisions '', @rev, @rev, :with_paths => true
|
|
||||||
show_error and return unless @revisions
|
|
||||||
@revision = @revisions.first
|
|
||||||
end
|
|
||||||
|
|
||||||
def diff
|
|
||||||
@rev_to = params[:rev_to] || (@rev-1)
|
|
||||||
@diff = @repository.scm.diff(params[:path], @rev, @rev_to)
|
|
||||||
show_error and return unless @diff
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
def find_project
|
|
||||||
@project = Project.find(params[:id])
|
|
||||||
@repository = @project.repository
|
|
||||||
@path = params[:path].squeeze('/').gsub(/^\//, '') if params[:path]
|
|
||||||
@path ||= ''
|
|
||||||
@rev = params[:rev].to_i if params[:rev] and params[:rev].to_i > 0
|
|
||||||
rescue ActiveRecord::RecordNotFound
|
|
||||||
render_404
|
|
||||||
end
|
|
||||||
|
|
||||||
def show_error
|
|
||||||
flash.now[:notice] = l(:notice_scm_error)
|
|
||||||
render :nothing => true, :layout => true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
# redMine - project management software
|
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
require 'iconv'
|
|
||||||
|
|
||||||
module IfpdfHelper
|
|
||||||
|
|
||||||
class IFPDF < FPDF
|
|
||||||
|
|
||||||
attr_accessor :footer_date
|
|
||||||
|
|
||||||
def Cell(w,h=0,txt='',border=0,ln=0,align='',fill=0,link='')
|
|
||||||
@ic ||= Iconv.new('ISO-8859-1', 'UTF-8')
|
|
||||||
txt = begin
|
|
||||||
@ic.iconv(txt)
|
|
||||||
rescue
|
|
||||||
txt
|
|
||||||
end
|
|
||||||
super w,h,txt,border,ln,align,fill,link
|
|
||||||
end
|
|
||||||
|
|
||||||
def Footer
|
|
||||||
SetFont('Helvetica', 'I', 8)
|
|
||||||
SetY(-15)
|
|
||||||
SetX(15)
|
|
||||||
Cell(0, 5, @footer_date, 0, 0, 'L')
|
|
||||||
SetY(-15)
|
|
||||||
SetX(-30)
|
|
||||||
Cell(0, 5, PageNo().to_s + '/{nb}', 0, 0, 'C')
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
# redMine - project management software
|
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module IssuesHelper
|
|
||||||
|
|
||||||
def show_detail(detail, no_html=false)
|
|
||||||
case detail.property
|
|
||||||
when 'attr'
|
|
||||||
label = l(("field_" + detail.prop_key.to_s.gsub(/\_id$/, "")).to_sym)
|
|
||||||
case detail.prop_key
|
|
||||||
when 'due_date', 'start_date'
|
|
||||||
value = format_date(detail.value.to_date) if detail.value
|
|
||||||
old_value = format_date(detail.old_value.to_date) if detail.old_value
|
|
||||||
when 'status_id'
|
|
||||||
s = IssueStatus.find_by_id(detail.value) and value = s.name if detail.value
|
|
||||||
s = IssueStatus.find_by_id(detail.old_value) and old_value = s.name if detail.old_value
|
|
||||||
when 'assigned_to_id'
|
|
||||||
u = User.find_by_id(detail.value) and value = u.name if detail.value
|
|
||||||
u = User.find_by_id(detail.old_value) and old_value = u.name if detail.old_value
|
|
||||||
when 'priority_id'
|
|
||||||
e = Enumeration.find_by_id(detail.value) and value = e.name if detail.value
|
|
||||||
e = Enumeration.find_by_id(detail.old_value) and old_value = e.name if detail.old_value
|
|
||||||
when 'category_id'
|
|
||||||
c = IssueCategory.find_by_id(detail.value) and value = c.name if detail.value
|
|
||||||
c = IssueCategory.find_by_id(detail.old_value) and old_value = c.name if detail.old_value
|
|
||||||
when 'fixed_version_id'
|
|
||||||
v = Version.find_by_id(detail.value) and value = v.name if detail.value
|
|
||||||
v = Version.find_by_id(detail.old_value) and old_value = v.name if detail.old_value
|
|
||||||
end
|
|
||||||
when 'cf'
|
|
||||||
custom_field = CustomField.find_by_id(detail.prop_key)
|
|
||||||
if custom_field
|
|
||||||
label = custom_field.name
|
|
||||||
value = format_value(detail.value, custom_field.field_format) if detail.value
|
|
||||||
old_value = format_value(detail.old_value, custom_field.field_format) if detail.old_value
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
label ||= detail.prop_key
|
|
||||||
value ||= detail.value
|
|
||||||
old_value ||= detail.old_value
|
|
||||||
|
|
||||||
unless no_html
|
|
||||||
label = content_tag('strong', label)
|
|
||||||
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 value
|
|
||||||
if old_value
|
|
||||||
label + " " + l(:text_journal_changed, old_value, value)
|
|
||||||
else
|
|
||||||
label + " " + l(:text_journal_set_to, value)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
label + " " + l(:text_journal_deleted) + " (#{old_value})"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
# redMine - project management software
|
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module MyHelper
|
|
||||||
end
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
module QueriesHelper
|
|
||||||
|
|
||||||
def operators_for_select(filter_type)
|
|
||||||
Query.operators_by_filter_type[filter_type].collect {|o| [l(Query.operators[o]), o]}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
# redMine - project management software
|
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module RepositoriesHelper
|
|
||||||
end
|
|
||||||
@@ -1,102 +0,0 @@
|
|||||||
# redMine - project management software
|
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class Issue < ActiveRecord::Base
|
|
||||||
|
|
||||||
belongs_to :project
|
|
||||||
belongs_to :tracker
|
|
||||||
belongs_to :status, :class_name => 'IssueStatus', :foreign_key => 'status_id'
|
|
||||||
belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
|
|
||||||
belongs_to :assigned_to, :class_name => 'User', :foreign_key => 'assigned_to_id'
|
|
||||||
belongs_to :fixed_version, :class_name => 'Version', :foreign_key => 'fixed_version_id'
|
|
||||||
belongs_to :priority, :class_name => 'Enumeration', :foreign_key => 'priority_id'
|
|
||||||
belongs_to :category, :class_name => 'IssueCategory', :foreign_key => 'category_id'
|
|
||||||
|
|
||||||
has_many :journals, :as => :journalized, :dependent => :destroy
|
|
||||||
has_many :attachments, :as => :container, :dependent => :destroy
|
|
||||||
|
|
||||||
has_many :custom_values, :dependent => :delete_all, :as => :customized
|
|
||||||
has_many :custom_fields, :through => :custom_values
|
|
||||||
|
|
||||||
validates_presence_of :subject, :description, :priority, :tracker, :author, :status
|
|
||||||
validates_inclusion_of :done_ratio, :in => 0..100
|
|
||||||
validates_associated :custom_values, :on => :update
|
|
||||||
|
|
||||||
# set default status for new issues
|
|
||||||
def before_validation
|
|
||||||
self.status = IssueStatus.default if new_record?
|
|
||||||
end
|
|
||||||
|
|
||||||
def validate
|
|
||||||
if self.due_date.nil? && @attributes['due_date'] && !@attributes['due_date'].empty?
|
|
||||||
errors.add :due_date, :activerecord_error_not_a_date
|
|
||||||
end
|
|
||||||
|
|
||||||
if self.due_date and self.start_date and self.due_date < self.start_date
|
|
||||||
errors.add :due_date, :activerecord_error_greater_than_start_date
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
#def before_create
|
|
||||||
# build_history
|
|
||||||
#end
|
|
||||||
|
|
||||||
def before_save
|
|
||||||
if @current_journal
|
|
||||||
# attributes changes
|
|
||||||
(Issue.column_names - %w(id description)).each {|c|
|
|
||||||
@current_journal.details << JournalDetail.new(:property => 'attr',
|
|
||||||
:prop_key => c,
|
|
||||||
:old_value => @issue_before_change.send(c),
|
|
||||||
:value => send(c)) unless send(c)==@issue_before_change.send(c)
|
|
||||||
}
|
|
||||||
# custom fields changes
|
|
||||||
custom_values.each {|c|
|
|
||||||
@current_journal.details << JournalDetail.new(:property => 'cf',
|
|
||||||
:prop_key => c.custom_field_id,
|
|
||||||
:old_value => @custom_values_before_change[c.custom_field_id],
|
|
||||||
:value => c.value) unless @custom_values_before_change[c.custom_field_id]==c.value
|
|
||||||
}
|
|
||||||
@current_journal.save unless @current_journal.details.empty? and @current_journal.notes.empty?
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def long_id
|
|
||||||
"%05d" % self.id
|
|
||||||
end
|
|
||||||
|
|
||||||
def custom_value_for(custom_field)
|
|
||||||
self.custom_values.each {|v| return v if v.custom_field_id == custom_field.id }
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
|
|
||||||
def init_journal(user, notes = "")
|
|
||||||
@current_journal ||= Journal.new(:journalized => self, :user => user, :notes => notes)
|
|
||||||
@issue_before_change = self.clone
|
|
||||||
@custom_values_before_change = {}
|
|
||||||
self.custom_values.each {|c| @custom_values_before_change.store c.custom_field_id, c.value }
|
|
||||||
@current_journal
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
# Creates an history for the issue
|
|
||||||
#def build_history
|
|
||||||
# @history = self.histories.build
|
|
||||||
# @history.status = self.status
|
|
||||||
# @history.author = self.author
|
|
||||||
#end
|
|
||||||
end
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
# redMine - project management software
|
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class Journal < ActiveRecord::Base
|
|
||||||
belongs_to :journalized, :polymorphic => true
|
|
||||||
belongs_to :user
|
|
||||||
has_many :details, :class_name => "JournalDetail", :dependent => :delete_all
|
|
||||||
end
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# redMine - project management software
|
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class JournalDetail < ActiveRecord::Base
|
|
||||||
belongs_to :journal
|
|
||||||
end
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
# redMine - project management software
|
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class News < ActiveRecord::Base
|
|
||||||
belongs_to :project
|
|
||||||
belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
|
|
||||||
has_many :comments, :as => :commented, :dependent => :delete_all, :order => "created_on"
|
|
||||||
|
|
||||||
validates_presence_of :title, :description
|
|
||||||
|
|
||||||
# returns latest news for projects visible by user
|
|
||||||
def self.latest(user=nil, count=5)
|
|
||||||
find(:all, :limit => count, :conditions => Project.visible_by(user), :include => [ :author, :project ], :order => "news.created_on DESC")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,166 +0,0 @@
|
|||||||
# redMine - project management software
|
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class Query < ActiveRecord::Base
|
|
||||||
belongs_to :project
|
|
||||||
belongs_to :user
|
|
||||||
serialize :filters
|
|
||||||
|
|
||||||
attr_protected :project, :user
|
|
||||||
|
|
||||||
validates_presence_of :name, :on => :save
|
|
||||||
|
|
||||||
@@operators = { "=" => :label_equals,
|
|
||||||
"!" => :label_not_equals,
|
|
||||||
"o" => :label_open_issues,
|
|
||||||
"c" => :label_closed_issues,
|
|
||||||
"!*" => :label_none,
|
|
||||||
"*" => :label_all,
|
|
||||||
"<t+" => :label_in_less_than,
|
|
||||||
">t+" => :label_in_more_than,
|
|
||||||
"t+" => :label_in,
|
|
||||||
"t" => :label_today,
|
|
||||||
">t-" => :label_less_than_ago,
|
|
||||||
"<t-" => :label_more_than_ago,
|
|
||||||
"t-" => :label_ago,
|
|
||||||
"~" => :label_contains,
|
|
||||||
"!~" => :label_not_contains }
|
|
||||||
|
|
||||||
cattr_reader :operators
|
|
||||||
|
|
||||||
@@operators_by_filter_type = { :list => [ "=", "!" ],
|
|
||||||
:list_status => [ "o", "=", "!", "c", "*" ],
|
|
||||||
:list_optional => [ "=", "!", "!*", "*" ],
|
|
||||||
:date => [ "<t+", ">t+", "t+", "t", ">t-", "<t-", "t-" ],
|
|
||||||
:date_past => [ ">t-", "<t-", "t-", "t" ],
|
|
||||||
:text => [ "~", "!~" ] }
|
|
||||||
|
|
||||||
cattr_reader :operators_by_filter_type
|
|
||||||
|
|
||||||
def initialize(attributes = nil)
|
|
||||||
super attributes
|
|
||||||
self.filters ||= { 'status_id' => {:operator => "o", :values => [""]} }
|
|
||||||
self.is_public = true
|
|
||||||
end
|
|
||||||
|
|
||||||
def validate
|
|
||||||
filters.each_key do |field|
|
|
||||||
errors.add field.gsub(/\_id$/, ""), :activerecord_error_blank unless
|
|
||||||
# filter requires one or more values
|
|
||||||
(values_for(field) and !values_for(field).first.empty?) or
|
|
||||||
# filter doesn't require any value
|
|
||||||
["o", "c", "!*", "*", "t"].include? operator_for(field)
|
|
||||||
end if filters
|
|
||||||
end
|
|
||||||
|
|
||||||
def available_filters
|
|
||||||
return @available_filters if @available_filters
|
|
||||||
@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 => 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] } }
|
|
||||||
# remove category filter if no category defined
|
|
||||||
@available_filters.delete "category_id" if @available_filters["category_id"][:values].empty?
|
|
||||||
end
|
|
||||||
@available_filters
|
|
||||||
end
|
|
||||||
|
|
||||||
def add_filter(field, operator, values)
|
|
||||||
# values must be an array
|
|
||||||
return unless values and values.is_a? Array # and !values.first.empty?
|
|
||||||
# check if field is defined as an available filter
|
|
||||||
if available_filters.has_key? field
|
|
||||||
filter_options = available_filters[field]
|
|
||||||
# check if operator is allowed for that filter
|
|
||||||
#if @@operators_by_filter_type[filter_options[:type]].include? operator
|
|
||||||
# allowed_values = values & ([""] + (filter_options[:values] || []).collect {|val| val[1]})
|
|
||||||
# filters[field] = {:operator => operator, :values => allowed_values } if (allowed_values.first and !allowed_values.first.empty?) or ["o", "c", "!*", "*", "t"].include? operator
|
|
||||||
#end
|
|
||||||
filters[field] = {:operator => operator, :values => values }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def add_short_filter(field, expression)
|
|
||||||
return unless expression
|
|
||||||
parms = expression.scan(/^(o|c|\!|\*)?(.*)$/).first
|
|
||||||
add_filter field, (parms[0] || "="), [parms[1] || ""]
|
|
||||||
end
|
|
||||||
|
|
||||||
def has_filter?(field)
|
|
||||||
filters and filters[field]
|
|
||||||
end
|
|
||||||
|
|
||||||
def operator_for(field)
|
|
||||||
has_filter?(field) ? filters[field][:operator] : nil
|
|
||||||
end
|
|
||||||
|
|
||||||
def values_for(field)
|
|
||||||
has_filter?(field) ? filters[field][:values] : nil
|
|
||||||
end
|
|
||||||
|
|
||||||
def statement
|
|
||||||
sql = "1=1"
|
|
||||||
sql << " AND issues.project_id=%d" % project.id if project
|
|
||||||
filters.each_key do |field|
|
|
||||||
v = values_for field
|
|
||||||
next unless v and !v.empty?
|
|
||||||
sql = sql + " AND " unless sql.empty?
|
|
||||||
case operator_for field
|
|
||||||
when "="
|
|
||||||
sql = sql + "issues.#{field} IN (" + v.each(&:to_i).join(",") + ")"
|
|
||||||
when "!"
|
|
||||||
sql = sql + "issues.#{field} NOT IN (" + v.each(&:to_i).join(",") + ")"
|
|
||||||
when "!*"
|
|
||||||
sql = sql + "issues.#{field} IS NULL"
|
|
||||||
when "*"
|
|
||||||
sql = sql + "issues.#{field} IS NOT NULL"
|
|
||||||
when "o"
|
|
||||||
sql = sql + "issue_statuses.is_closed=#{connection.quoted_false}" if field == "status_id"
|
|
||||||
when "c"
|
|
||||||
sql = sql + "issue_statuses.is_closed=#{connection.quoted_true}" if field == "status_id"
|
|
||||||
when ">t-"
|
|
||||||
sql = sql + "issues.#{field} >= '%s'" % connection.quoted_date(Date.today - v.first.to_i)
|
|
||||||
when "<t-"
|
|
||||||
sql = sql + "issues.#{field} <= '" + (Date.today - v.first.to_i).strftime("%Y-%m-%d") + "'"
|
|
||||||
when "t-"
|
|
||||||
sql = sql + "issues.#{field} = '" + (Date.today - v.first.to_i).strftime("%Y-%m-%d") + "'"
|
|
||||||
when ">t+"
|
|
||||||
sql = sql + "issues.#{field} >= '" + (Date.today + v.first.to_i).strftime("%Y-%m-%d") + "'"
|
|
||||||
when "<t+"
|
|
||||||
sql = sql + "issues.#{field} <= '" + (Date.today + v.first.to_i).strftime("%Y-%m-%d") + "'"
|
|
||||||
when "t+"
|
|
||||||
sql = sql + "issues.#{field} = '" + (Date.today + v.first.to_i).strftime("%Y-%m-%d") + "'"
|
|
||||||
when "t"
|
|
||||||
sql = sql + "issues.#{field} = '%s'" % connection.quoted_date(Date.today)
|
|
||||||
when "~"
|
|
||||||
sql = sql + "issues.#{field} LIKE '%#{connection.quote_string(v.first)}%'"
|
|
||||||
when "!~"
|
|
||||||
sql = sql + "issues.#{field} NOT LIKE '%#{connection.quote_string(v.first)}%'"
|
|
||||||
end
|
|
||||||
end if filters and valid?
|
|
||||||
sql
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
# redMine - project management software
|
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class Repository < ActiveRecord::Base
|
|
||||||
belongs_to :project
|
|
||||||
validates_presence_of :url
|
|
||||||
validates_format_of :url, :with => /^(http|https|svn|file):\/\/.+/i
|
|
||||||
|
|
||||||
@scm = nil
|
|
||||||
|
|
||||||
def scm
|
|
||||||
@scm ||= SvnRepos::Base.new url
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,214 +0,0 @@
|
|||||||
# redMine - project management software
|
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
require 'rexml/document'
|
|
||||||
|
|
||||||
module SvnRepos
|
|
||||||
|
|
||||||
class CommandFailed < StandardError #:nodoc:
|
|
||||||
end
|
|
||||||
|
|
||||||
class Base
|
|
||||||
@url = nil
|
|
||||||
@login = nil
|
|
||||||
@password = nil
|
|
||||||
|
|
||||||
def initialize(url, login=nil, password=nil)
|
|
||||||
@url = url
|
|
||||||
@login = login if login && !login.empty?
|
|
||||||
@password = (password || "") if @login
|
|
||||||
end
|
|
||||||
|
|
||||||
# Returns the entry identified by path and revision identifier
|
|
||||||
# or nil if entry doesn't exist in the repository
|
|
||||||
def entry(path=nil, identifier=nil)
|
|
||||||
e = entries(path, identifier)
|
|
||||||
e ? e.first : nil
|
|
||||||
end
|
|
||||||
|
|
||||||
# Returns an Entries collection
|
|
||||||
# or nil if the given path doesn't exist in the repository
|
|
||||||
def entries(path=nil, identifier=nil)
|
|
||||||
path ||= ''
|
|
||||||
identifier = 'HEAD' unless identifier and identifier > 0
|
|
||||||
entries = Entries.new
|
|
||||||
cmd = "svn list --xml #{target(path)}@#{identifier}"
|
|
||||||
shellout(cmd) do |io|
|
|
||||||
begin
|
|
||||||
doc = REXML::Document.new(io)
|
|
||||||
doc.elements.each("lists/list/entry") do |entry|
|
|
||||||
entries << Entry.new({:name => entry.elements['name'].text,
|
|
||||||
:path => ((path.empty? ? "" : "#{path}/") + entry.elements['name'].text),
|
|
||||||
:kind => entry.attributes['kind'],
|
|
||||||
:size => (entry.elements['size'] and entry.elements['size'].text).to_i,
|
|
||||||
:lastrev => Revision.new({
|
|
||||||
:identifier => entry.elements['commit'].attributes['revision'],
|
|
||||||
:time => Time.parse(entry.elements['commit'].elements['date'].text),
|
|
||||||
:author => (entry.elements['commit'].elements['author'] ? entry.elements['commit'].elements['author'].text : "anonymous")
|
|
||||||
})
|
|
||||||
})
|
|
||||||
end
|
|
||||||
rescue
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return nil if $? && $?.exitstatus != 0
|
|
||||||
entries.sort_by_name
|
|
||||||
rescue Errno::ENOENT => e
|
|
||||||
raise CommandFailed
|
|
||||||
end
|
|
||||||
|
|
||||||
def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={})
|
|
||||||
path ||= ''
|
|
||||||
identifier_from = 'HEAD' unless identifier_from and identifier_from.to_i > 0
|
|
||||||
identifier_to = 1 unless identifier_to and identifier_to.to_i > 0
|
|
||||||
revisions = Revisions.new
|
|
||||||
cmd = "svn log --xml -r #{identifier_from}:#{identifier_to} "
|
|
||||||
cmd << "--verbose " if options[:with_paths]
|
|
||||||
cmd << target(path)
|
|
||||||
shellout(cmd) do |io|
|
|
||||||
begin
|
|
||||||
doc = REXML::Document.new(io)
|
|
||||||
doc.elements.each("log/logentry") do |logentry|
|
|
||||||
paths = []
|
|
||||||
logentry.elements.each("paths/path") do |path|
|
|
||||||
paths << {:action => path.attributes['action'],
|
|
||||||
:path => path.text
|
|
||||||
}
|
|
||||||
end
|
|
||||||
paths.sort! { |x,y| x[:path] <=> y[:path] }
|
|
||||||
|
|
||||||
revisions << Revision.new({:identifier => logentry.attributes['revision'],
|
|
||||||
:author => (logentry.elements['author'] ? logentry.elements['author'].text : "anonymous"),
|
|
||||||
:time => Time.parse(logentry.elements['date'].text),
|
|
||||||
:message => logentry.elements['msg'].text,
|
|
||||||
:paths => paths
|
|
||||||
})
|
|
||||||
end
|
|
||||||
rescue
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return nil if $? && $?.exitstatus != 0
|
|
||||||
revisions
|
|
||||||
rescue Errno::ENOENT => e
|
|
||||||
raise CommandFailed
|
|
||||||
end
|
|
||||||
|
|
||||||
def diff(path, identifier_from, identifier_to=nil)
|
|
||||||
path ||= ''
|
|
||||||
if identifier_to and identifier_to.to_i > 0
|
|
||||||
identifier_to = identifier_to.to_i
|
|
||||||
else
|
|
||||||
identifier_to = identifier_from.to_i - 1
|
|
||||||
end
|
|
||||||
cmd = "svn diff -r "
|
|
||||||
cmd << "#{identifier_to}:"
|
|
||||||
cmd << "#{identifier_from}"
|
|
||||||
cmd << "#{target(path)}@#{identifier_from}"
|
|
||||||
diff = []
|
|
||||||
shellout(cmd) do |io|
|
|
||||||
io.each_line do |line|
|
|
||||||
diff << line
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return nil if $? && $?.exitstatus != 0
|
|
||||||
diff
|
|
||||||
rescue Errno::ENOENT => e
|
|
||||||
raise CommandFailed
|
|
||||||
end
|
|
||||||
|
|
||||||
def cat(path, identifier=nil)
|
|
||||||
identifier = (identifier and identifier.to_i > 0) ? identifier.to_i : "HEAD"
|
|
||||||
cmd = "svn cat #{target(path)}@#{identifier}"
|
|
||||||
cat = nil
|
|
||||||
shellout(cmd) do |io|
|
|
||||||
cat = io.read
|
|
||||||
end
|
|
||||||
return nil if $? && $?.exitstatus != 0
|
|
||||||
cat
|
|
||||||
rescue Errno::ENOENT => e
|
|
||||||
raise CommandFailed
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
def target(path)
|
|
||||||
" \"" << "#{@url}/#{path}".gsub(/["'?<>\*]/, '') << "\""
|
|
||||||
end
|
|
||||||
|
|
||||||
def logger
|
|
||||||
RAILS_DEFAULT_LOGGER
|
|
||||||
end
|
|
||||||
|
|
||||||
def shellout(cmd, &block)
|
|
||||||
logger.debug "Shelling out: #{cmd}" if logger && logger.debug?
|
|
||||||
IO.popen(cmd) do |io|
|
|
||||||
block.call(io) if block_given?
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
class Entries < Array
|
|
||||||
def sort_by_name
|
|
||||||
sort {|x,y|
|
|
||||||
if x.kind == y.kind
|
|
||||||
x.name <=> y.name
|
|
||||||
else
|
|
||||||
x.kind <=> y.kind
|
|
||||||
end
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
def revisions
|
|
||||||
revisions ||= Revisions.new(collect{|entry| entry.lastrev})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
class Entry
|
|
||||||
attr_accessor :name, :path, :kind, :size, :lastrev
|
|
||||||
def initialize(attributes={})
|
|
||||||
self.name = attributes[:name] if attributes[:name]
|
|
||||||
self.path = attributes[:path] if attributes[:path]
|
|
||||||
self.kind = attributes[:kind] if attributes[:kind]
|
|
||||||
self.size = attributes[:size].to_i if attributes[:size]
|
|
||||||
self.lastrev = attributes[:lastrev]
|
|
||||||
end
|
|
||||||
|
|
||||||
def is_file?
|
|
||||||
'file' == self.kind
|
|
||||||
end
|
|
||||||
|
|
||||||
def is_dir?
|
|
||||||
'dir' == self.kind
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
class Revisions < Array
|
|
||||||
def latest
|
|
||||||
sort {|x,y| x.time <=> y.time}.last
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
class Revision
|
|
||||||
attr_accessor :identifier, :author, :time, :message, :paths
|
|
||||||
def initialize(attributes={})
|
|
||||||
self.identifier = attributes[:identifier]
|
|
||||||
self.author = attributes[:author]
|
|
||||||
self.time = attributes[:time]
|
|
||||||
self.message = attributes[:message] || ""
|
|
||||||
self.paths = attributes[:paths]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
# redMine - project management software
|
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class UserPreference < ActiveRecord::Base
|
|
||||||
belongs_to :user
|
|
||||||
serialize :others, Hash
|
|
||||||
|
|
||||||
attr_protected :others
|
|
||||||
|
|
||||||
def initialize(attributes = nil)
|
|
||||||
super
|
|
||||||
self.others ||= {}
|
|
||||||
end
|
|
||||||
|
|
||||||
def [](attr_name)
|
|
||||||
if attribute_present? attr_name
|
|
||||||
super
|
|
||||||
else
|
|
||||||
others[attr_name]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def []=(attr_name, value)
|
|
||||||
if attribute_present? attr_name
|
|
||||||
super
|
|
||||||
else
|
|
||||||
others.store attr_name, value
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
<div class="contextual">
|
|
||||||
<%= link_to l(:label_auth_source_new), {:action => 'new'}, :class => 'pic picAdd' %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h2><%=l(:label_auth_source_plural)%></h2>
|
|
||||||
|
|
||||||
<table class="list">
|
|
||||||
<thead><tr>
|
|
||||||
<th><%=l(:field_name)%></th>
|
|
||||||
<th><%=l(:field_type)%></th>
|
|
||||||
<th><%=l(:field_host)%></th>
|
|
||||||
<th></th>
|
|
||||||
<th></th>
|
|
||||||
</tr></thead>
|
|
||||||
<tbody>
|
|
||||||
<% for source in @auth_sources %>
|
|
||||||
<tr class="<%= cycle("odd", "even") %>">
|
|
||||||
<td><%= link_to source.name, :action => 'edit', :id => source%></td>
|
|
||||||
<td align="center"><%= source.auth_method_name %></td>
|
|
||||||
<td align="center"><%= source.host %></td>
|
|
||||||
<td align="center"><%= link_to l(:button_test), :action => 'test_connection', :id => source %></td>
|
|
||||||
<td align="center"><%= button_to l(:button_delete), { :action => 'destroy', :id => source }, :confirm => l(:text_are_you_sure), :class => "button-small" %></td>
|
|
||||||
</tr>
|
|
||||||
<% end %>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<%= pagination_links_full @auth_source_pages %>
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
<h2>404</h2>
|
|
||||||
|
|
||||||
<p><%= l(:notice_file_not_found) %></p>
|
|
||||||
<p><a href="javascript:history.back()">Back</a></p>
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
<%= error_messages_for 'custom_field' %>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
function toggle_custom_field_format() {
|
|
||||||
format = $("custom_field_field_format");
|
|
||||||
p_length = $("custom_field_min_length");
|
|
||||||
p_regexp = $("custom_field_regexp");
|
|
||||||
p_values = $("custom_field_possible_values");
|
|
||||||
switch (format.value) {
|
|
||||||
case "list":
|
|
||||||
Element.hide(p_length.parentNode);
|
|
||||||
Element.hide(p_regexp.parentNode);
|
|
||||||
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.parentNode);
|
|
||||||
break;
|
|
||||||
case "date":
|
|
||||||
case "bool":
|
|
||||||
Element.hide(p_length.parentNode);
|
|
||||||
Element.hide(p_regexp.parentNode);
|
|
||||||
Element.hide(p_values.parentNode);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Element.show(p_length.parentNode);
|
|
||||||
Element.show(p_regexp.parentNode);
|
|
||||||
Element.show(p_values.parentNode);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<!--[form:custom_field]-->
|
|
||||||
<div class="box">
|
|
||||||
<p><%= f.text_field :name, :required => true %></p>
|
|
||||||
<p><%= f.select :field_format, custom_field_formats_for_select, {}, :onchange => "toggle_custom_field_format();" %></p>
|
|
||||||
<p><label for="custom_field_min_length"><%=l(:label_min_max_length)%></label>
|
|
||||||
<%= 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><%= 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]-->
|
|
||||||
|
|
||||||
<div class="box">
|
|
||||||
<% case @custom_field.type.to_s
|
|
||||||
when "IssueCustomField" %>
|
|
||||||
|
|
||||||
<fieldset><legend><%=l(:label_tracker_plural)%></legend>
|
|
||||||
<% for tracker in @trackers %>
|
|
||||||
<%= check_box_tag "tracker_ids[]", tracker.id, (@custom_field.trackers.include? tracker) %> <%= tracker.name %>
|
|
||||||
<% end %>
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<p><%= f.check_box :is_required %></p>
|
|
||||||
<p><%= f.check_box :is_for_all %></p>
|
|
||||||
|
|
||||||
<% when "UserCustomField" %>
|
|
||||||
<p><%= f.check_box :is_required %></p>
|
|
||||||
|
|
||||||
<% when "ProjectCustomField" %>
|
|
||||||
<p><%= f.check_box :is_required %></p>
|
|
||||||
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<h2><%=l(:label_custom_field)%> (<%=l(@custom_field.type_name)%>)</h2>
|
|
||||||
|
|
||||||
<% labelled_tabular_form_for :custom_field, @custom_field, :url => { :action => "edit", :id => @custom_field } do |f| %>
|
|
||||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
|
||||||
<%= submit_tag l(:button_save) %>
|
|
||||||
<% end %>
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
<h2><%=l(:label_custom_field_new)%> (<%=l(@custom_field.type_name)%>)</h2>
|
|
||||||
|
|
||||||
<% labelled_tabular_form_for :custom_field, @custom_field, :url => { :action => "new" } do |f| %>
|
|
||||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
|
||||||
<%= hidden_field_tag 'type', @custom_field.type %>
|
|
||||||
<%= submit_tag l(:button_save) %>
|
|
||||||
<% end %>
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
<p><%= link_to h(document.title), :controller => 'documents', :action => 'show', :id => document %><br />
|
|
||||||
<% unless document.description.empty? %><%=h truncate document.description, 250 %><br /><% end %>
|
|
||||||
<em><%= format_time(document.created_on) %></em></p>
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
<div class="contextual">
|
|
||||||
<%= 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>
|
|
||||||
|
|
||||||
<p><em><%= @document.category.name %><br />
|
|
||||||
<%= format_date @document.created_on %></em></p>
|
|
||||||
<%= textilizable @document.description %>
|
|
||||||
<br />
|
|
||||||
|
|
||||||
<h3><%= l(:label_attachment_plural) %></h3>
|
|
||||||
<ul class="documents">
|
|
||||||
<% 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), :post => true, :class => 'pic picDelete' %>
|
|
||||||
</div>
|
|
||||||
<%= link_to attachment.filename, :action => 'download', :id => @document, :attachment_id => attachment %>
|
|
||||||
(<%= human_size attachment.filesize %>)<br />
|
|
||||||
<em><%= attachment.author.display_name %>, <%= format_date(attachment.created_on) %></em><br />
|
|
||||||
<%= lwr(:label_download, attachment.downloads) %>
|
|
||||||
</li>
|
|
||||||
<% end %>
|
|
||||||
</ul>
|
|
||||||
<br />
|
|
||||||
|
|
||||||
|
|
||||||
<% if authorize_for('documents', 'add_attachment') %>
|
|
||||||
<%= 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)%>
|
|
||||||
<%= 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_form_tag %>
|
|
||||||
<% end %>
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
xml.instruct!
|
|
||||||
xml.rss "version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/" do
|
|
||||||
xml.channel do
|
|
||||||
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 "#{$RDM_HEADER_TITLE}: #{l(:label_news_latest)}"
|
|
||||||
@news.each do |news|
|
|
||||||
xml.item do
|
|
||||||
xml.title "#{news.project.name}: #{news.title}"
|
|
||||||
news_url = url_for(:controller => 'news' , :action => 'show', :id => news, :only_path => false)
|
|
||||||
xml.link news_url
|
|
||||||
xml.description h(news.summary)
|
|
||||||
xml.pubDate CGI.rfc1123_date(news.created_on)
|
|
||||||
xml.guid news_url
|
|
||||||
xml.author h(news.author.name)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
<% if authorize_for('projects', 'add_issue') %>
|
|
||||||
<%= 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_form_tag %>
|
|
||||||
<% end %>
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
<% for journal in journals %>
|
|
||||||
<h4><%= format_time(journal.created_on) %> - <%= journal.user.name %></h4>
|
|
||||||
<ul>
|
|
||||||
<% for detail in journal.details %>
|
|
||||||
<li><%= show_detail(detail) %></li>
|
|
||||||
<% end %>
|
|
||||||
</ul>
|
|
||||||
<% if journal.notes? %>
|
|
||||||
<%= simple_format auto_link h(journal.notes) %>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
<% pdf.SetFont('Arial','B',11)
|
|
||||||
pdf.Cell(190,10, "#{issue.project.name} - #{issue.tracker.name} # #{issue.long_id} - #{issue.subject}")
|
|
||||||
pdf.Ln
|
|
||||||
|
|
||||||
y0 = pdf.GetY
|
|
||||||
|
|
||||||
pdf.SetFont('Arial','B',9)
|
|
||||||
pdf.Cell(35,5, l(:field_status) + ":","LT")
|
|
||||||
pdf.SetFont('Arial','',9)
|
|
||||||
pdf.Cell(60,5, issue.status.name,"RT")
|
|
||||||
pdf.SetFont('Arial','B',9)
|
|
||||||
pdf.Cell(35,5, l(:field_priority) + ":","LT")
|
|
||||||
pdf.SetFont('Arial','',9)
|
|
||||||
pdf.Cell(60,5, issue.priority.name,"RT")
|
|
||||||
pdf.Ln
|
|
||||||
|
|
||||||
pdf.SetFont('Arial','B',9)
|
|
||||||
pdf.Cell(35,5, l(:field_author) + ":","L")
|
|
||||||
pdf.SetFont('Arial','',9)
|
|
||||||
pdf.Cell(60,5, issue.author.name,"R")
|
|
||||||
pdf.SetFont('Arial','B',9)
|
|
||||||
pdf.Cell(35,5, l(:field_category) + ":","L")
|
|
||||||
pdf.SetFont('Arial','',9)
|
|
||||||
pdf.Cell(60,5, (issue.category ? issue.category.name : "-"),"R")
|
|
||||||
pdf.Ln
|
|
||||||
|
|
||||||
pdf.SetFont('Arial','B',9)
|
|
||||||
pdf.Cell(35,5, l(:field_created_on) + ":","L")
|
|
||||||
pdf.SetFont('Arial','',9)
|
|
||||||
pdf.Cell(60,5, format_date(issue.created_on),"R")
|
|
||||||
pdf.SetFont('Arial','B',9)
|
|
||||||
pdf.Cell(35,5, l(:field_assigned_to) + ":","L")
|
|
||||||
pdf.SetFont('Arial','',9)
|
|
||||||
pdf.Cell(60,5, (issue.assigned_to ? issue.assigned_to.name : "-"),"R")
|
|
||||||
pdf.Ln
|
|
||||||
|
|
||||||
pdf.SetFont('Arial','B',9)
|
|
||||||
pdf.Cell(35,5, l(:field_updated_on) + ":","LB")
|
|
||||||
pdf.SetFont('Arial','',9)
|
|
||||||
pdf.Cell(60,5, format_date(issue.updated_on),"RB")
|
|
||||||
pdf.SetFont('Arial','B',9)
|
|
||||||
pdf.Cell(35,5, l(:field_due_date) + ":","LB")
|
|
||||||
pdf.SetFont('Arial','',9)
|
|
||||||
pdf.Cell(60,5, format_date(issue.due_date),"RB")
|
|
||||||
pdf.Ln
|
|
||||||
|
|
||||||
for custom_value in issue.custom_values
|
|
||||||
pdf.SetFont('Arial','B',9)
|
|
||||||
pdf.Cell(35,5, custom_value.custom_field.name + ":","L")
|
|
||||||
pdf.SetFont('Arial','',9)
|
|
||||||
pdf.MultiCell(155,5, (show_value custom_value),"R")
|
|
||||||
end
|
|
||||||
|
|
||||||
pdf.SetFont('Arial','B',9)
|
|
||||||
pdf.Cell(35,5, l(:field_subject) + ":","LTB")
|
|
||||||
pdf.SetFont('Arial','',9)
|
|
||||||
pdf.Cell(155,5, issue.subject,"RTB")
|
|
||||||
pdf.Ln
|
|
||||||
|
|
||||||
pdf.SetFont('Arial','B',9)
|
|
||||||
pdf.Cell(35,5, l(:field_description) + ":")
|
|
||||||
pdf.SetFont('Arial','',9)
|
|
||||||
pdf.MultiCell(155,5, issue.description,"BR")
|
|
||||||
|
|
||||||
pdf.Line(pdf.GetX, y0, pdf.GetX, pdf.GetY)
|
|
||||||
pdf.Line(pdf.GetX, pdf.GetY, 170, pdf.GetY)
|
|
||||||
|
|
||||||
pdf.Ln
|
|
||||||
|
|
||||||
pdf.SetFont('Arial','B',9)
|
|
||||||
pdf.Cell(190,5, l(:label_history), "B")
|
|
||||||
pdf.Ln
|
|
||||||
for journal in issue.journals.find(:all, :include => :user, :order => "journals.created_on desc")
|
|
||||||
pdf.SetFont('Arial','B',8)
|
|
||||||
pdf.Cell(190,5, format_time(journal.created_on) + " - " + journal.user.name)
|
|
||||||
pdf.Ln
|
|
||||||
pdf.SetFont('Arial','I',8)
|
|
||||||
for detail in journal.details
|
|
||||||
pdf.Cell(190,5, "- " + show_detail(detail, true))
|
|
||||||
pdf.Ln
|
|
||||||
end
|
|
||||||
if journal.notes?
|
|
||||||
pdf.SetFont('Arial','',8)
|
|
||||||
pdf.MultiCell(190,5, journal.notes)
|
|
||||||
end
|
|
||||||
pdf.Ln
|
|
||||||
end
|
|
||||||
|
|
||||||
pdf.SetFont('Arial','B',9)
|
|
||||||
pdf.Cell(190,5, l(:label_attachment_plural), "B")
|
|
||||||
pdf.Ln
|
|
||||||
for attachment in issue.attachments
|
|
||||||
pdf.SetFont('Arial','',8)
|
|
||||||
pdf.Cell(80,5, attachment.filename)
|
|
||||||
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
|
|
||||||
end
|
|
||||||
%>
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<% pdf=IfpdfHelper::IFPDF.new
|
|
||||||
pdf.AliasNbPages
|
|
||||||
pdf.footer_date = format_date(Date.today)
|
|
||||||
pdf.AddPage
|
|
||||||
|
|
||||||
render :partial => 'issues/pdf', :locals => { :pdf => pdf, :issue => @issue }
|
|
||||||
%>
|
|
||||||
|
|
||||||
<%= pdf.Output %>
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<h3><%=l(:label_history)%></h3>
|
|
||||||
<div id="history">
|
|
||||||
<%= render :partial => 'history', :locals => { :journals => @journals } %>
|
|
||||||
</div>
|
|
||||||
<br />
|
|
||||||
<p><%= link_to l(:button_back), :action => 'show', :id => @issue %></p>
|
|
||||||
@@ -1,107 +0,0 @@
|
|||||||
<div class="contextual">
|
|
||||||
<%= 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>
|
|
||||||
|
|
||||||
<div class="box">
|
|
||||||
<table width="100%">
|
|
||||||
<tr>
|
|
||||||
<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>
|
|
||||||
<td><b><%=l(:field_category)%> :</b></td><td><%=h @issue.category ? @issue.category.name : "-" %></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><b><%=l(:field_author)%> :</b></td><td><%= link_to_user @issue.author %></td>
|
|
||||||
<td><b><%=l(:field_start_date)%> :</b></td><td><%= format_date(@issue.start_date) %></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><b><%=l(:field_created_on)%> :</b></td><td><%= format_date(@issue.created_on) %></td>
|
|
||||||
<td><b><%=l(:field_due_date)%> :</b></td><td><%= format_date(@issue.due_date) %></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<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>
|
|
||||||
<% n = 0
|
|
||||||
for custom_value in @custom_values %>
|
|
||||||
<td><b><%= custom_value.custom_field.name %> :</b></td><td><%=h show_value custom_value %></td>
|
|
||||||
<% n = n + 1
|
|
||||||
if (n > 1)
|
|
||||||
n = 0 %>
|
|
||||||
</tr><tr>
|
|
||||||
<%end
|
|
||||||
end %>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<hr />
|
|
||||||
<br />
|
|
||||||
|
|
||||||
<b><%=l(:field_description)%> :</b><br /><br />
|
|
||||||
<%= textilizable @issue.description %>
|
|
||||||
<br />
|
|
||||||
|
|
||||||
<div class="contextual">
|
|
||||||
<%= 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? %>
|
|
||||||
<%= 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_form_tag %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="history" class="box">
|
|
||||||
<h3><%=l(:label_history)%>
|
|
||||||
<% if @journals_count > @journals.length %>(<%= l(:label_last_changes, @journals.length) %>)<% end %></h3>
|
|
||||||
<%= render :partial => 'history', :locals => { :journals => @journals } %>
|
|
||||||
<% if @journals_count > @journals.length %>
|
|
||||||
<p><center><small>[ <%= link_to l(:label_change_view_all), :action => 'history', :id => @issue %> ]</small></center></p>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="box">
|
|
||||||
<h3><%=l(:label_attachment_plural)%></h3>
|
|
||||||
<table width="100%">
|
|
||||||
<% for attachment in @issue.attachments %>
|
|
||||||
<tr>
|
|
||||||
<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), :post => true, :class => 'pic picDelete' %></div></td>
|
|
||||||
</tr>
|
|
||||||
<% end %>
|
|
||||||
</table>
|
|
||||||
<br />
|
|
||||||
<% if authorize_for('issues', 'add_attachment') %>
|
|
||||||
<%= start_form_tag ({ :controller => 'issues', :action => 'add_attachment', :id => @issue }, :multipart => true, :class => "tabular") %>
|
|
||||||
<p id="attachments_p"><label><%=l(:label_attachment_new)%>
|
|
||||||
<%= 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_form_tag %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% if authorize_for('issues', 'add_note') %>
|
|
||||||
<div class="box">
|
|
||||||
<h3><%= l(:label_add_note) %></h3>
|
|
||||||
<%= 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_form_tag %>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
@@ -1,145 +0,0 @@
|
|||||||
<!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><%= $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" />
|
|
||||||
<%= 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 %>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<div id="container" >
|
|
||||||
|
|
||||||
<div id="header">
|
|
||||||
<div style="float: left;">
|
|
||||||
<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 %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="navigation">
|
|
||||||
<ul>
|
|
||||||
<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 => "picProject", :onmouseover => "buttonMouseover(event, 'menuProject');" %></li>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if loggedin? %>
|
|
||||||
<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 => "picAdmin", :onmouseover => "buttonMouseover(event, 'menuAdmin');" %></li>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<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 => "picUser" %></li>
|
|
||||||
<% else %>
|
|
||||||
<li class="right"><%= link_to l(:label_login), { :controller => 'account', :action => 'login' }, :class => "picUser" %></li>
|
|
||||||
<% end %>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% if admin_loggedin? %>
|
|
||||||
<div id="menuAdmin" class="menu" onmouseover="menuMouseover(event)">
|
|
||||||
<a class="menuItem" href="/admin/projects" onmouseover="menuItemMouseover(event,'menuProjects');"><span class="menuItemText"><%=l(:label_project_plural)%></span><span class="menuItemArrow">▶</span></a>
|
|
||||||
<a class="menuItem" href="/users" onmouseover="menuItemMouseover(event,'menuUsers');"><span class="menuItemText"><%=l(:label_user_plural)%></span><span class="menuItemArrow">▶</span></a>
|
|
||||||
<a class="menuItem" href="/roles"><%=l(:label_role_and_permissions)%></a>
|
|
||||||
<a class="menuItem" href="/trackers" onmouseover="menuItemMouseover(event,'menuTrackers');"><span class="menuItemText"><%=l(:label_tracker_plural)%></span><span class="menuItemArrow">▶</span></a>
|
|
||||||
<a class="menuItem" href="/custom_fields"><%=l(:label_custom_field_plural)%></a>
|
|
||||||
<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="/admin/info"><%=l(:label_information_plural)%></a>
|
|
||||||
</div>
|
|
||||||
<div id="menuTrackers" class="menu">
|
|
||||||
<a class="menuItem" href="/issue_statuses"><%=l(:label_issue_status_plural)%></a>
|
|
||||||
<a class="menuItem" href="/roles/workflow"><%=l(:label_workflow)%></a>
|
|
||||||
</div>
|
|
||||||
<div id="menuProjects" class="menu"><a class="menuItem" href="/projects/add"><%=l(:label_new)%></a></div>
|
|
||||||
<div id="menuUsers" class="menu"><a class="menuItem" href="/users/add"><%=l(:label_new)%></a></div>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% unless @project.nil? || @project.id.nil? %>
|
|
||||||
<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 }, :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_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" %>
|
|
||||||
<%= link_to l(:label_repository), {:controller => 'repositories', :action => 'show', :id => @project}, :class => "menuItem" if @project.repository and !@project.repository.new_record? %>
|
|
||||||
<%= link_to_if_authorized l(:label_settings), {:controller => 'projects', :action => 'settings', :id => @project }, :class => "menuItem" %>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="subcontent">
|
|
||||||
|
|
||||||
<% unless @project.nil? || @project.id.nil? %>
|
|
||||||
<h2><%= @project.name %></h2>
|
|
||||||
<ul class="menublock">
|
|
||||||
<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 %></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_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>
|
|
||||||
<li><%= link_to l(:label_repository), :controller => 'repositories', :action => 'show', :id => @project if @project.repository and !@project.repository.new_record? %></li>
|
|
||||||
<li><%= link_to_if_authorized l(:label_settings), :controller => 'projects', :action => 'settings', :id => @project %></li>
|
|
||||||
</ul>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if loggedin? and @logged_in_user.memberships.length > 0 %>
|
|
||||||
<h2><%=l(:label_my_projects) %></h2>
|
|
||||||
<ul class="menublock">
|
|
||||||
<% for membership in @logged_in_user.memberships %>
|
|
||||||
<li><%= link_to membership.project.name, :controller => 'projects', :action => 'show', :id => membership.project %></li>
|
|
||||||
<% end %>
|
|
||||||
</ul>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="content">
|
|
||||||
<% if flash[:notice] %><p style="color: green"><%= flash[:notice] %></p><% end %>
|
|
||||||
<%= @content_for_layout %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="footer">
|
|
||||||
<p>
|
|
||||||
<%= auto_link $RDM_FOOTER_SIG %> |
|
|
||||||
<a href="http://redmine.rubyforge.org/" target="_new"><%= RDM_APP_NAME %></a> <%= RDM_APP_VERSION %>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
Issue #<%= @issue.id %> has been reported.
|
|
||||||
----------------------------------------
|
|
||||||
<%= render :file => "_issue", :use_full_path => true, :locals => { :issue => @issue } %>
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
Issue #<%= @issue.id %> has been reported.
|
|
||||||
----------------------------------------
|
|
||||||
<%= render :file => "_issue", :use_full_path => true, :locals => { :issue => @issue } %>
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
Issue #<%= @issue.id %> has been updated.
|
|
||||||
<%= @journal.user.name %>
|
|
||||||
<% for detail in @journal.details %>
|
|
||||||
<%= show_detail(detail, true) %>
|
|
||||||
<% end %>
|
|
||||||
<%= @journal.notes if @journal.notes? %>
|
|
||||||
----------------------------------------
|
|
||||||
<%= render :file => "_issue", :use_full_path => true, :locals => { :issue => @issue } %>
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
Issue #<%= @issue.id %> has been updated.
|
|
||||||
<%= @journal.user.name %>
|
|
||||||
<% for detail in @journal.details %>
|
|
||||||
<%= show_detail(detail, true) %>
|
|
||||||
<% end %>
|
|
||||||
<%= @journal.notes if @journal.notes? %>
|
|
||||||
----------------------------------------
|
|
||||||
<%= render :file => "_issue", :use_full_path => true, :locals => { :issue => @issue } %>
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
Issue #<%= @issue.id %> has been updated.
|
|
||||||
<%= @journal.user.name %>
|
|
||||||
<% for detail in @journal.details %>
|
|
||||||
<%= show_detail(detail, true) %>
|
|
||||||
<% end %>
|
|
||||||
<%= @journal.notes if @journal.notes? %>
|
|
||||||
----------------------------------------
|
|
||||||
<%= render :file => "_issue", :use_full_path => true, :locals => { :issue => @issue } %>
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
La demande #<%= @issue.id %> a été mise à jour.
|
|
||||||
<%= @journal.user.name %> - <%= format_date(@journal.created_on) %>
|
|
||||||
<% for detail in @journal.details %>
|
|
||||||
<%= show_detail(detail, true) %>
|
|
||||||
<% end %>
|
|
||||||
<%= journal.notes if journal.notes? %>
|
|
||||||
----------------------------------------
|
|
||||||
<%= render :file => "_issue", :use_full_path => true, :locals => { :issue => @issue } %>
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
To change your password, use the following link:
|
|
||||||
|
|
||||||
http://<%= $RDM_HOST_NAME %>/account/lost_password?token=<%= @token.value %>
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
To change your password, use the following link:
|
|
||||||
|
|
||||||
http://<%= $RDM_HOST_NAME %>/account/lost_password?token=<%= @token.value %>
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
To activate your redMine account, use the following link:
|
|
||||||
|
|
||||||
http://<%= $RDM_HOST_NAME %>/account/register?token=<%= @token.value %>
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
To activate your redMine account, use the following link:
|
|
||||||
|
|
||||||
http://<%= $RDM_HOST_NAME %>/account/register?token=<%= @token.value %>
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
<div id="block_<%= block_name %>" class="mypage-box">
|
|
||||||
|
|
||||||
<div style="float:right;margin-right:16px;z-index:500;">
|
|
||||||
<%= link_to_remote "", {
|
|
||||||
:url => { :action => "remove_block", :block => block_name },
|
|
||||||
:complete => "removeBlock('block_#{block_name}')",
|
|
||||||
:loading => "Element.show('indicator')",
|
|
||||||
:loaded => "Element.hide('indicator')" },
|
|
||||||
:class => "close-icon"
|
|
||||||
%>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="handle">
|
|
||||||
<%= render :partial => "my/blocks/#{block_name}", :locals => { :user => user } %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
<h3><%= l(:label_calendar) %></h3>
|
|
||||||
|
|
||||||
<%
|
|
||||||
@date_from = Date.today - (Date.today.cwday-1)
|
|
||||||
@date_to = Date.today + (7-Date.today.cwday)
|
|
||||||
@issues = Issue.find :all,
|
|
||||||
:conditions => ["issues.project_id in (#{@user.projects.collect{|m| m.id}.join(',')}) AND ((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?))", @date_from, @date_to, @date_from, @date_to],
|
|
||||||
:include => [:project, :tracker] unless @user.projects.empty?
|
|
||||||
@issues ||= []
|
|
||||||
%>
|
|
||||||
|
|
||||||
<table class="list with-cells">
|
|
||||||
<thead><tr>
|
|
||||||
<th></th>
|
|
||||||
<% 1.upto(7) do |d| %>
|
|
||||||
<th align="center" width="14%"><%= day_name(d) %></th>
|
|
||||||
<% end %>
|
|
||||||
</tr></thead>
|
|
||||||
<tbdoy>
|
|
||||||
<tr height="100">
|
|
||||||
<% day = @date_from
|
|
||||||
while day <= @date_to
|
|
||||||
if day.cwday == 1 %>
|
|
||||||
<th valign="middle"><%= day.cweek %></th>
|
|
||||||
<% end %>
|
|
||||||
<td valign="top" width="14%" class="<%= day.month==@month ? "even" : "odd" %>">
|
|
||||||
<p align="right"><%= day==Date.today ? "<b>#{day.day}</b>" : day.day %></p>
|
|
||||||
<% day_issues = []
|
|
||||||
@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')
|
|
||||||
elsif day == i.start_date
|
|
||||||
image_tag('arrow_from')
|
|
||||||
elsif day == i.due_date
|
|
||||||
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 %>
|
|
||||||
</td>
|
|
||||||
<%= '</tr><tr height="100">' if day.cwday >= 7 and day!=@date_to %>
|
|
||||||
<%
|
|
||||||
day = day + 1
|
|
||||||
end %>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<h3><%=l(:label_document_plural)%></h3>
|
|
||||||
|
|
||||||
<%= render(:partial => 'documents/document',
|
|
||||||
:collection => Document.find(:all,
|
|
||||||
:limit => 10,
|
|
||||||
:order => 'documents.created_on DESC',
|
|
||||||
:conditions => "documents.project_id in (#{@user.projects.collect{|m| m.id}.join(',')})",
|
|
||||||
:include => [:project])) unless @user.projects.empty? %>
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
<h3><%=l(:label_assigned_to_me_issues)%></h3>
|
|
||||||
<% assigned_issues = Issue.find(:all,
|
|
||||||
:conditions => ["assigned_to_id=?", user.id],
|
|
||||||
:limit => 10,
|
|
||||||
:include => [ :status, :project, :tracker ],
|
|
||||||
:order => 'issues.updated_on DESC') %>
|
|
||||||
<%= render :partial => 'issues/list_simple', :locals => { :issues => assigned_issues } %>
|
|
||||||
<% if assigned_issues.length > 0 %>
|
|
||||||
<p><%=lwr(:label_last_updates, assigned_issues.length)%></p>
|
|
||||||
<% end %>
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
<h3><%=l(:label_reported_issues)%></h3>
|
|
||||||
<% reported_issues = Issue.find(:all,
|
|
||||||
:conditions => ["author_id=?", user.id],
|
|
||||||
:limit => 10,
|
|
||||||
:include => [ :status, :project, :tracker ],
|
|
||||||
:order => 'issues.updated_on DESC') %>
|
|
||||||
<%= render :partial => 'issues/list_simple', :locals => { :issues => reported_issues } %>
|
|
||||||
<% if reported_issues.length > 0 %>
|
|
||||||
<p><%=lwr(:label_last_updates, reported_issues.length)%></p>
|
|
||||||
<% end %>
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<h3><%=l(:label_news_latest)%></h3>
|
|
||||||
|
|
||||||
<%= render (:partial => 'news/news',
|
|
||||||
:collection => News.find(:all,
|
|
||||||
:limit => 10,
|
|
||||||
:order => 'news.created_on DESC',
|
|
||||||
:conditions => "news.project_id in (#{@user.projects.collect{|m| m.id}.join(',')})",
|
|
||||||
:include => [:project, :author])) unless @user.projects.empty? %>
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
<div class="contextual">
|
|
||||||
<%= link_to l(:label_personalize_page), :action => 'page_layout' %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h2><%=l(:label_my_page)%></h2>
|
|
||||||
|
|
||||||
<div id="list-top">
|
|
||||||
<% @blocks['top'].each do |b| %>
|
|
||||||
<div class="mypage-box">
|
|
||||||
<%= render :partial => "my/blocks/#{b}", :locals => { :user => @user } %>
|
|
||||||
</div>
|
|
||||||
<% end if @blocks['top'] %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="list-left" class="splitcontentleft">
|
|
||||||
<% @blocks['left'].each do |b| %>
|
|
||||||
<div class="mypage-box">
|
|
||||||
<%= render :partial => "my/blocks/#{b}", :locals => { :user => @user } %>
|
|
||||||
</div>
|
|
||||||
<% end if @blocks['left'] %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="list-right" class="splitcontentright">
|
|
||||||
<% @blocks['right'].each do |b| %>
|
|
||||||
<div class="mypage-box">
|
|
||||||
<%= render :partial => "my/blocks/#{b}", :locals => { :user => @user } %>
|
|
||||||
</div>
|
|
||||||
<% end if @blocks['right'] %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@@ -1,113 +0,0 @@
|
|||||||
<script language="JavaScript">
|
|
||||||
|
|
||||||
function recreateSortables() {
|
|
||||||
Sortable.destroy('list-top');
|
|
||||||
Sortable.destroy('list-left');
|
|
||||||
Sortable.destroy('list-right');
|
|
||||||
|
|
||||||
Sortable.create("list-top", {constraint:false, containment:['list-top','list-left','list-right'], dropOnEmpty:true, handle:'handle', onUpdate:function(){new Ajax.Request('/my/order_blocks?group=top', {asynchronous:true, evalScripts:true, onComplete:function(request){new Effect.Highlight("list-top",{});}, onLoaded:function(request){Element.hide('indicator')}, onLoading:function(request){Element.show('indicator')}, parameters:Sortable.serialize("list-top")})}, only:'mypage-box', tag:'div'})
|
|
||||||
Sortable.create("list-left", {constraint:false, containment:['list-top','list-left','list-right'], dropOnEmpty:true, handle:'handle', onUpdate:function(){new Ajax.Request('/my/order_blocks?group=left', {asynchronous:true, evalScripts:true, onComplete:function(request){new Effect.Highlight("list-left",{});}, onLoaded:function(request){Element.hide('indicator')}, onLoading:function(request){Element.show('indicator')}, parameters:Sortable.serialize("list-left")})}, only:'mypage-box', tag:'div'})
|
|
||||||
Sortable.create("list-right", {constraint:false, containment:['list-top','list-left','list-right'], dropOnEmpty:true, handle:'handle', onUpdate:function(){new Ajax.Request('/my/order_blocks?group=right', {asynchronous:true, evalScripts:true, onComplete:function(request){new Effect.Highlight("list-right",{});}, onLoaded:function(request){Element.hide('indicator')}, onLoading:function(request){Element.show('indicator')}, parameters:Sortable.serialize("list-right")})}, only:'mypage-box', tag:'div'})
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateSelect() {
|
|
||||||
s = $('block-select')
|
|
||||||
for (var i = 0; i < s.options.length; i++) {
|
|
||||||
if ($('block_' + s.options[i].value)) {
|
|
||||||
s.options[i].disabled = true;
|
|
||||||
} else {
|
|
||||||
s.options[i].disabled = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
s.options[0].selected = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function afterAddBlock() {
|
|
||||||
recreateSortables();
|
|
||||||
updateSelect();
|
|
||||||
}
|
|
||||||
|
|
||||||
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>
|
|
||||||
<%= 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" },
|
|
||||||
:with => "Form.serialize('block-form')",
|
|
||||||
:update => "list-top",
|
|
||||||
:position => :top,
|
|
||||||
:complete => "afterAddBlock();",
|
|
||||||
:loading => "Element.show('indicator')",
|
|
||||||
:loaded => "Element.hide('indicator')"
|
|
||||||
%>
|
|
||||||
<%= 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| %>
|
|
||||||
<%= 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| %>
|
|
||||||
<%= 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| %>
|
|
||||||
<%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %>
|
|
||||||
<% end if @blocks['right'] %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<%= sortable_element 'list-top',
|
|
||||||
:tag => 'div',
|
|
||||||
:only => 'mypage-box',
|
|
||||||
:handle => "handle",
|
|
||||||
:dropOnEmpty => true,
|
|
||||||
:containment => ['list-top', 'list-left', 'list-right'],
|
|
||||||
:constraint => false,
|
|
||||||
:complete => visual_effect(:highlight, 'list-top'),
|
|
||||||
:url => { :action => "order_blocks", :group => "top" },
|
|
||||||
:loading => "Element.show('indicator')",
|
|
||||||
:loaded => "Element.hide('indicator')"
|
|
||||||
%>
|
|
||||||
|
|
||||||
|
|
||||||
<%= sortable_element 'list-left',
|
|
||||||
:tag => 'div',
|
|
||||||
:only => 'mypage-box',
|
|
||||||
:handle => "handle",
|
|
||||||
:dropOnEmpty => true,
|
|
||||||
:containment => ['list-top', 'list-left', 'list-right'],
|
|
||||||
:constraint => false,
|
|
||||||
:complete => visual_effect(:highlight, 'list-left'),
|
|
||||||
:url => { :action => "order_blocks", :group => "left" },
|
|
||||||
:loading => "Element.show('indicator')",
|
|
||||||
:loaded => "Element.hide('indicator')" %>
|
|
||||||
|
|
||||||
<%= sortable_element 'list-right',
|
|
||||||
:tag => 'div',
|
|
||||||
:only => 'mypage-box',
|
|
||||||
:handle => "handle",
|
|
||||||
:dropOnEmpty => true,
|
|
||||||
:containment => ['list-top', 'list-left', 'list-right'],
|
|
||||||
:constraint => false,
|
|
||||||
:complete => visual_effect(:highlight, 'list-right'),
|
|
||||||
:url => { :action => "order_blocks", :group => "right" },
|
|
||||||
:loading => "Element.show('indicator')",
|
|
||||||
:loaded => "Element.hide('indicator')" %>
|
|
||||||
|
|
||||||
<%= javascript_tag "updateSelect()" %>
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
<%= error_messages_for 'news' %>
|
|
||||||
<div class="box">
|
|
||||||
<p><%= f.text_field :title, :required => true, :size => 60 %></p>
|
|
||||||
<p><%= f.text_area :summary, :cols => 60, :rows => 2 %></p>
|
|
||||||
<p><%= f.text_area :description, :required => true, :cols => 60, :rows => 15 %></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% unless $RDM_TEXTILE_DISABLED %>
|
|
||||||
<%= javascript_include_tag 'jstoolbar' %>
|
|
||||||
<script type="text/javascript">
|
|
||||||
//<![CDATA[
|
|
||||||
if (document.getElementById) {
|
|
||||||
if (document.getElementById('news_description')) {
|
|
||||||
var commentTb = new jsToolBar(document.getElementById('news_description'));
|
|
||||||
commentTb.draw();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//]]>
|
|
||||||
</script>
|
|
||||||
<% end %>
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
<p><%= link_to h(news.title), :controller => 'news', :action => 'show', :id => news %><br />
|
|
||||||
<% unless news.summary.empty? %><%=h news.summary %><br /><% end %>
|
|
||||||
<em><%= news.author.name %>, <%= format_time(news.created_on) %></em><br />
|
|
||||||
<%= news.comments_count %> <%= lwr(:label_comment, news.comments_count).downcase %><br /></p>
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
<div class="contextual">
|
|
||||||
<%= 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>
|
|
||||||
|
|
||||||
<p><em><% unless @news.summary.empty? %><%=h @news.summary %><br /><% end %>
|
|
||||||
<%= @news.author.display_name %>, <%= format_time(@news.created_on) %></em></p>
|
|
||||||
<br />
|
|
||||||
<%= textilizable auto_link @news.description %>
|
|
||||||
<br />
|
|
||||||
|
|
||||||
<div id="comments" style="margin-bottom:16px;">
|
|
||||||
<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), :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' %>
|
|
||||||
<h3><%= l(:label_comment_add) %></h3>
|
|
||||||
<%= start_form_tag :action => 'add_comment', :id => @news %>
|
|
||||||
<%= error_messages_for 'comment' %>
|
|
||||||
<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_form_tag %>
|
|
||||||
<% end %>
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
<%= error_messages_for 'project' %>
|
|
||||||
|
|
||||||
<div class="box">
|
|
||||||
<!--[form:project]-->
|
|
||||||
<p><%= f.text_field :name, :required => true %></p>
|
|
||||||
|
|
||||||
<% if admin_loggedin? and !@root_projects.empty? %>
|
|
||||||
<p><%= f.select :parent_id, (@root_projects.collect {|p| [p.name, p.id]}), { :include_blank => true } %></p>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<p><%= f.text_area :description, :required => true, :cols => 60, :rows => 3 %></p>
|
|
||||||
<p><%= f.text_field :homepage, :size => 40 %></p>
|
|
||||||
<p><%= f.check_box :is_public %></p>
|
|
||||||
|
|
||||||
<% for @custom_value in @custom_values %>
|
|
||||||
<p><%= custom_field_tag_with_label @custom_value %></p>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% unless @custom_fields.empty? %>
|
|
||||||
<p><label><%=l(:label_custom_field_plural)%></label>
|
|
||||||
<% for custom_field in @custom_fields %>
|
|
||||||
<%= check_box_tag "custom_field_ids[]", custom_field.id, ((@project.custom_fields.include? custom_field) or custom_field.is_for_all?), (custom_field.is_for_all? ? {:disabled => "disabled"} : {}) %>
|
|
||||||
<%= custom_field.name %>
|
|
||||||
<% end %></p>
|
|
||||||
<% end %>
|
|
||||||
<!--[eoform:project]-->
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="box"><h3><%= check_box_tag "repository_enabled", 1, !@project.repository.nil?, :onclick => "Element.toggle('repository');" %> <%= l(:label_repository) %></h3>
|
|
||||||
<%= hidden_field_tag "repository_enabled", 0 %>
|
|
||||||
<div id="repository">
|
|
||||||
<% fields_for :repository, @project.repository, { :builder => TabularFormBuilder, :lang => current_language} do |repository| %>
|
|
||||||
<p><%= repository.text_field :url, :size => 60, :required => true %><br />(http://, https://, svn://, file:///)</p>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
<%= javascript_tag "Element.hide('repository');" if @project.repository.nil? %>
|
|
||||||
</div>
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
<h2><%=l(:label_activity)%>: <%= "#{month_name(@month).downcase} #{@year}" %></h2>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<div class="rightbox">
|
|
||||||
<%= start_form_tag %>
|
|
||||||
<p><%= select_month(@month, :prefix => "month", :discard_type => true) %>
|
|
||||||
<%= select_year(@year, :prefix => "year", :discard_type => true) %></p>
|
|
||||||
<%= 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>
|
|
||||||
<% @events_by_day[day].sort {|x,y| y.created_on <=> x.created_on }.each do |e| %>
|
|
||||||
<li><p>
|
|
||||||
<% if e.is_a? Issue %>
|
|
||||||
<%= e.created_on.strftime("%H:%M") %> <%= link_to "#{e.tracker.name} ##{e.id}", :controller => 'issues', :action => 'show', :id => e %> (<%= e.status.name %>): <%=h e.subject %><br />
|
|
||||||
<i><%= e.author.name %></i>
|
|
||||||
<% elsif e.is_a? News %>
|
|
||||||
<%= e.created_on.strftime("%H:%M") %> <%=l(:label_news)%>: <%= link_to h(e.title), :controller => 'news', :action => 'show', :id => e %><br />
|
|
||||||
<% unless e.summary.empty? %><%=h e.summary %><br /><% end %>
|
|
||||||
<i><%= e.author.name %></i>
|
|
||||||
<% elsif (e.is_a? Attachment) and (e.container.is_a? Version) %>
|
|
||||||
<%= e.created_on.strftime("%H:%M") %> <%=l(:label_attachment)%> (<%=h e.container.name %>): <%= link_to e.filename, :controller => 'projects', :action => 'list_files', :id => @project %><br />
|
|
||||||
<i><%= e.author.name %></i>
|
|
||||||
<% elsif (e.is_a? Attachment) and (e.container.is_a? Document) %>
|
|
||||||
<%= e.created_on.strftime("%H:%M") %> <%=l(:label_attachment)%>: <%= e.filename %> (<%= link_to h(e.container.title), :controller => 'documents', :action => 'show', :id => e.container %>)<br />
|
|
||||||
<i><%= e.author.name %></i>
|
|
||||||
<% elsif e.is_a? Document %>
|
|
||||||
<%= e.created_on.strftime("%H:%M") %> <%=l(:label_document)%>: <%= link_to h(e.title), :controller => 'documents', :action => 'show', :id => e %><br />
|
|
||||||
<% end %>
|
|
||||||
</p></li>
|
|
||||||
|
|
||||||
<% end %>
|
|
||||||
</ul>
|
|
||||||
<% end %>
|
|
||||||
<% if @events_by_day.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %>
|
|
||||||
|
|
||||||
<div style="float:left;">
|
|
||||||
<%= link_to_remote ('« ' + (@month==1 ? "#{month_name(12)} #{@year-1}" : "#{month_name(@month-1)}")),
|
|
||||||
{:update => "content", :url => { :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1) }},
|
|
||||||
{:href => url_for(:action => 'activity', :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1))}
|
|
||||||
%>
|
|
||||||
</div>
|
|
||||||
<div style="float:right;">
|
|
||||||
<%= link_to_remote ((@month==12 ? "#{month_name(1)} #{@year+1}" : "#{month_name(@month+1)}") + ' »'),
|
|
||||||
{:update => "content", :url => { :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1) }},
|
|
||||||
{:href => url_for(:action => 'activity', :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1))}
|
|
||||||
%>
|
|
||||||
</div>
|
|
||||||
<br />
|
|
||||||
</div>
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
<h2><%=l(:label_document_new)%></h2>
|
|
||||||
|
|
||||||
<%= 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)%>
|
|
||||||
<%= 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_form_tag %>
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
<h2><%=l(:label_attachment_new)%></h2>
|
|
||||||
|
|
||||||
<%= error_messages_for 'attachment' %>
|
|
||||||
<div class="box">
|
|
||||||
<%= start_form_tag ({ :action => 'add_file', :id => @project }, :multipart => true, :class => "tabular") %>
|
|
||||||
|
|
||||||
<p><label for="version_id"><%=l(:field_version)%> <span class="required">*</span></label>
|
|
||||||
<%= select_tag "version_id", options_from_collection_for_select(@versions, "id", "name") %></p>
|
|
||||||
|
|
||||||
<p id="attachments_p"><label for="attachment_file"><%=l(:label_attachment)%>
|
|
||||||
<%= 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_add) %>
|
|
||||||
<%= end_form_tag %>
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
<h2><%=l(:label_issue_new)%>: <%= @tracker.name %></h2>
|
|
||||||
|
|
||||||
<% labelled_tabular_form_for :issue, @issue, :url => {:action => 'add_issue'}, :html => {:multipart => true} do |f| %>
|
|
||||||
<%= error_messages_for 'issue' %>
|
|
||||||
<div class="box">
|
|
||||||
<!--[form:issue]-->
|
|
||||||
<%= hidden_field_tag 'tracker_id', @tracker.id %>
|
|
||||||
|
|
||||||
<div class="splitcontentleft">
|
|
||||||
<p><%= f.select :priority_id, (@priorities.collect {|p| [p.name, p.id]}), :required => true %></p>
|
|
||||||
<p><%= f.select :assigned_to_id, (@issue.project.members.collect {|m| [m.name, m.user_id]}), :include_blank => true %></p>
|
|
||||||
<p><%= f.select :category_id, (@project.issue_categories.collect {|c| [c.name, c.id]}), :include_blank => true %></p>
|
|
||||||
</div>
|
|
||||||
<div class="splitcontentright">
|
|
||||||
<p><%= f.text_field :start_date, :size => 10 %><%= calendar_for('issue_start_date') %></p>
|
|
||||||
<p><%= f.text_field :due_date, :size => 10 %><%= calendar_for('issue_due_date') %></p>
|
|
||||||
<p><%= f.select :done_ratio, ((0..10).to_a.collect {|r| ["#{r*10} %", r*10] }) %></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="clear">
|
|
||||||
<p><%= f.text_field :subject, :size => 80, :required => true %></p>
|
|
||||||
<p><%= f.text_area :description, :cols => 60, :rows => 10, :required => true %></p>
|
|
||||||
|
|
||||||
<% for @custom_value in @custom_values %>
|
|
||||||
<p><%= custom_field_tag_with_label @custom_value %></p>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<p id="attachments_p"><label for="attachment_file"><%=l(:label_attachment)%>
|
|
||||||
<%= 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>
|
|
||||||
<!--[eoform:issue]-->
|
|
||||||
</div>
|
|
||||||
<%= submit_tag l(:button_create) %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% unless $RDM_TEXTILE_DISABLED %>
|
|
||||||
<%= javascript_include_tag 'jstoolbar' %>
|
|
||||||
<script type="text/javascript">
|
|
||||||
//<![CDATA[
|
|
||||||
if (document.getElementById) {
|
|
||||||
if (document.getElementById('issue_description')) {
|
|
||||||
var commentTb = new jsToolBar(document.getElementById('issue_description'));
|
|
||||||
commentTb.draw();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//]]>
|
|
||||||
</script>
|
|
||||||
<% end %>
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<h2><%= l(:label_query_new) %></h2>
|
|
||||||
|
|
||||||
<%= start_form_tag :action => 'add_query', :id => @project %>
|
|
||||||
<%= render :partial => 'queries/form', :locals => {:query => @query} %>
|
|
||||||
<%= submit_tag l(:button_create) %>
|
|
||||||
<%= end_form_tag %>
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
<h2><%= l(:label_calendar) %></h2>
|
|
||||||
|
|
||||||
<table width="100%">
|
|
||||||
<tr>
|
|
||||||
<td align="left" width="150">
|
|
||||||
<%= link_to_remote ('« ' + (@month==1 ? "#{month_name(12)} #{@year-1}" : "#{month_name(@month-1)}")),
|
|
||||||
{:update => "content", :url => { :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1) }},
|
|
||||||
{:href => url_for(:action => 'calendar', :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1))}
|
|
||||||
%>
|
|
||||||
</td>
|
|
||||||
<td align="center">
|
|
||||||
<%= start_form_tag :action => 'calendar', :id => @project %>
|
|
||||||
<%= select_month(@month, :prefix => "month", :discard_type => true) %>
|
|
||||||
<%= select_year(@year, :prefix => "year", :discard_type => true) %>
|
|
||||||
<%= submit_tag l(:button_submit), :class => "button-small" %>
|
|
||||||
<%= end_form_tag %>
|
|
||||||
</td>
|
|
||||||
<td align="right" width="150">
|
|
||||||
<%= link_to_remote ((@month==12 ? "#{month_name(1)} #{@year+1}" : "#{month_name(@month+1)}") + ' »'),
|
|
||||||
{:update => "content", :url => { :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1) }},
|
|
||||||
{:href => url_for(:action => 'calendar', :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1))}
|
|
||||||
%>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<br />
|
|
||||||
|
|
||||||
<table class="list with-cells">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th></th>
|
|
||||||
<% 1.upto(7) do |d| %>
|
|
||||||
<th width="14%"><%= day_name(d) %></th>
|
|
||||||
<% end %>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr height="100">
|
|
||||||
<% day = @date_from
|
|
||||||
while day <= @date_to
|
|
||||||
if day.cwday == 1 %>
|
|
||||||
<th><%= day.cweek %></th>
|
|
||||||
<% end %>
|
|
||||||
<td valign="top" width="14%" class="<%= day.month==@month ? "even" : "odd" %>">
|
|
||||||
<p align="right"><%= day==Date.today ? "<b>#{day.day}</b>" : day.day %></p>
|
|
||||||
<% day_issues = []
|
|
||||||
@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')
|
|
||||||
elsif day == i.start_date
|
|
||||||
image_tag('arrow_from')
|
|
||||||
elsif day == i.due_date
|
|
||||||
image_tag('arrow_to')
|
|
||||||
end %>
|
|
||||||
<small><%= link_to "#{i.tracker.name} ##{i.id}", { :controller => 'issues', :action => 'show', :id => i }, :title => "#{i.subject}" %>: <%=h i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)') %></small><br />
|
|
||||||
<% end %>
|
|
||||||
</td>
|
|
||||||
<%= '</tr><tr height="100">' if day.cwday >= 7 and day!=@date_to %>
|
|
||||||
<%
|
|
||||||
day = day + 1
|
|
||||||
end %>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<%= image_tag 'arrow_from' %> <%= l(:text_tip_task_begin_day) %><br />
|
|
||||||
<%= image_tag 'arrow_to' %> <%= l(:text_tip_task_end_day) %><br />
|
|
||||||
<%= image_tag 'arrow_bw' %> <%= l(:text_tip_task_begin_end_day) %><br />
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
<h2><%=l(:label_change_log)%></h2>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
|
|
||||||
<div class="rightbox" style="width:140px;">
|
|
||||||
<%= start_form_tag %>
|
|
||||||
<strong><%=l(:label_tracker_plural)%></strong><br />
|
|
||||||
<% @trackers.each do |tracker| %>
|
|
||||||
<%= check_box_tag "tracker_ids[]", tracker.id, (@selected_tracker_ids.include? tracker.id.to_s) %>
|
|
||||||
<%= tracker.name %><br />
|
|
||||||
<% end %>
|
|
||||||
<p><center><%= submit_tag l(:button_apply), :class => 'button-small' %></center></p>
|
|
||||||
<%= end_form_tag %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% ver_id = nil
|
|
||||||
@fixed_issues.each do |issue| %>
|
|
||||||
<% unless ver_id == issue.fixed_version_id %>
|
|
||||||
<% if ver_id %></ul><% end %>
|
|
||||||
<h3><%= issue.fixed_version.name %></h3>
|
|
||||||
<p><%= format_date(issue.fixed_version.effective_date) %><br />
|
|
||||||
<%=h issue.fixed_version.description %></p>
|
|
||||||
<ul>
|
|
||||||
<% ver_id = issue.fixed_version_id
|
|
||||||
end %>
|
|
||||||
<li><%= link_to "#{issue.tracker.name} #{issue.id}", :controller => 'issues', :action => 'show', :id => issue %>: <%=h issue.subject %></li>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
<% pdf=IfpdfHelper::IFPDF.new
|
|
||||||
pdf.AliasNbPages
|
|
||||||
pdf.footer_date = format_date(Date.today)
|
|
||||||
@issues.each {|i|
|
|
||||||
pdf.AddPage
|
|
||||||
render :partial => 'issues/pdf', :locals => { :pdf => pdf, :issue => i }
|
|
||||||
}
|
|
||||||
%>
|
|
||||||
|
|
||||||
<%= pdf.Output %>
|
|
||||||
@@ -1,168 +0,0 @@
|
|||||||
<%
|
|
||||||
pdf=IfpdfHelper::IFPDF.new
|
|
||||||
pdf.AliasNbPages
|
|
||||||
pdf.footer_date = format_date(Date.today)
|
|
||||||
pdf.AddPage("L")
|
|
||||||
pdf.SetFont('Arial','B',12)
|
|
||||||
pdf.SetX(15)
|
|
||||||
pdf.Cell(70, 20, @project.name)
|
|
||||||
pdf.Ln
|
|
||||||
pdf.SetFont('Arial','B',9)
|
|
||||||
|
|
||||||
subject_width = 70
|
|
||||||
header_heigth = 5
|
|
||||||
|
|
||||||
headers_heigth = header_heigth
|
|
||||||
show_weeks = false
|
|
||||||
show_days = false
|
|
||||||
|
|
||||||
if @months < 7
|
|
||||||
show_weeks = true
|
|
||||||
headers_heigth = 2*header_heigth
|
|
||||||
if @months < 3
|
|
||||||
show_days = true
|
|
||||||
headers_heigth = 3*header_heigth
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
g_width = 210
|
|
||||||
zoom = (g_width) / (@date_to - @date_from + 1)
|
|
||||||
g_height = 120
|
|
||||||
t_height = g_height + headers_heigth
|
|
||||||
|
|
||||||
y_start = pdf.GetY
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# Months headers
|
|
||||||
#
|
|
||||||
month_f = @date_from
|
|
||||||
left = subject_width
|
|
||||||
height = header_heigth
|
|
||||||
@months.times do
|
|
||||||
width = ((month_f >> 1) - month_f) * zoom
|
|
||||||
pdf.SetY(y_start)
|
|
||||||
pdf.SetX(left)
|
|
||||||
pdf.Cell(width, height, "#{month_f.year}-#{month_f.month}", "LTR", 0, "C")
|
|
||||||
left = left + width
|
|
||||||
month_f = month_f >> 1
|
|
||||||
end
|
|
||||||
|
|
||||||
#
|
|
||||||
# Weeks headers
|
|
||||||
#
|
|
||||||
if show_weeks
|
|
||||||
left = subject_width
|
|
||||||
height = header_heigth
|
|
||||||
if @date_from.cwday == 1
|
|
||||||
# @date_from is monday
|
|
||||||
week_f = @date_from
|
|
||||||
else
|
|
||||||
# find next monday after @date_from
|
|
||||||
week_f = @date_from + (7 - @date_from.cwday + 1)
|
|
||||||
width = (7 - @date_from.cwday + 1) * zoom-1
|
|
||||||
pdf.SetY(y_start + header_heigth)
|
|
||||||
pdf.SetX(left)
|
|
||||||
pdf.Cell(width + 1, height, "", "LTR")
|
|
||||||
left = left + width+1
|
|
||||||
end
|
|
||||||
while week_f <= @date_to
|
|
||||||
width = (week_f + 6 <= @date_to) ? 7 * zoom : (@date_to - week_f + 1) * zoom
|
|
||||||
pdf.SetY(y_start + header_heigth)
|
|
||||||
pdf.SetX(left)
|
|
||||||
pdf.Cell(width, height, (width >= 5 ? week_f.cweek.to_s : ""), "LTR", 0, "C")
|
|
||||||
left = left + width
|
|
||||||
week_f = week_f+7
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
#
|
|
||||||
# Days headers
|
|
||||||
#
|
|
||||||
if show_days
|
|
||||||
left = subject_width
|
|
||||||
height = header_heigth
|
|
||||||
wday = @date_from.cwday
|
|
||||||
pdf.SetFont('Arial','B',7)
|
|
||||||
(@date_to - @date_from + 1).to_i.times do
|
|
||||||
width = zoom
|
|
||||||
pdf.SetY(y_start + 2 * header_heigth)
|
|
||||||
pdf.SetX(left)
|
|
||||||
pdf.Cell(width, height, day_name(wday)[0,1], "LTR", 0, "C")
|
|
||||||
left = left + width
|
|
||||||
wday = wday + 1
|
|
||||||
wday = 1 if wday > 7
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
pdf.SetY(y_start)
|
|
||||||
pdf.SetX(15)
|
|
||||||
pdf.Cell(subject_width+g_width-15, headers_heigth, "", 1)
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# Tasks
|
|
||||||
#
|
|
||||||
top = headers_heigth + y_start
|
|
||||||
pdf.SetFont('Arial','B',7)
|
|
||||||
@issues.each do |i|
|
|
||||||
pdf.SetY(top)
|
|
||||||
pdf.SetX(15)
|
|
||||||
pdf.Cell(subject_width-15, 5, "#{i.tracker.name} #{i.id}: #{i.subject}".sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)'), "LR")
|
|
||||||
|
|
||||||
pdf.SetY(top)
|
|
||||||
pdf.SetX(subject_width)
|
|
||||||
pdf.Cell(g_width, 5, "", "LR")
|
|
||||||
|
|
||||||
i_start_date = (i.start_date >= @date_from ? i.start_date : @date_from )
|
|
||||||
i_end_date = (i.due_date <= @date_to ? i.due_date : @date_to )
|
|
||||||
|
|
||||||
i_done_date = i.start_date + ((i.due_date - i.start_date+1)*i.done_ratio/100).floor
|
|
||||||
i_done_date = (i_done_date <= @date_from ? @date_from : i_done_date )
|
|
||||||
i_done_date = (i_done_date >= @date_to ? @date_to : i_done_date )
|
|
||||||
|
|
||||||
i_late_date = [i_end_date, Date.today].min if i_start_date < Date.today
|
|
||||||
|
|
||||||
i_left = ((i_start_date - @date_from)*zoom)
|
|
||||||
i_width = ((i_end_date - i_start_date + 1)*zoom)
|
|
||||||
d_width = ((i_done_date - i_start_date)*zoom)
|
|
||||||
l_width = ((i_late_date - i_start_date+1)*zoom) if i_late_date
|
|
||||||
l_width ||= 0
|
|
||||||
|
|
||||||
pdf.SetY(top+1.5)
|
|
||||||
pdf.SetX(subject_width + i_left)
|
|
||||||
pdf.SetFillColor(200,200,200)
|
|
||||||
pdf.Cell(i_width, 2, "", 0, 0, "", 1)
|
|
||||||
|
|
||||||
if l_width > 0
|
|
||||||
pdf.SetY(top+1.5)
|
|
||||||
pdf.SetX(subject_width + i_left)
|
|
||||||
pdf.SetFillColor(255,100,100)
|
|
||||||
pdf.Cell(l_width, 2, "", 0, 0, "", 1)
|
|
||||||
end
|
|
||||||
if d_width > 0
|
|
||||||
pdf.SetY(top+1.5)
|
|
||||||
pdf.SetX(subject_width + i_left)
|
|
||||||
pdf.SetFillColor(100,100,255)
|
|
||||||
pdf.Cell(d_width, 2, "", 0, 0, "", 1)
|
|
||||||
end
|
|
||||||
|
|
||||||
pdf.SetY(top+1.5)
|
|
||||||
pdf.SetX(subject_width + i_left + i_width)
|
|
||||||
pdf.Cell(30, 2, "#{i.status.name} #{i.done_ratio}%")
|
|
||||||
|
|
||||||
top = top + 5
|
|
||||||
pdf.SetDrawColor(200, 200, 200)
|
|
||||||
pdf.Line(15, top, subject_width+g_width, top)
|
|
||||||
if pdf.GetY() > 180
|
|
||||||
pdf.AddPage("L")
|
|
||||||
top = 20
|
|
||||||
pdf.Line(15, top, subject_width+g_width, top)
|
|
||||||
end
|
|
||||||
pdf.SetDrawColor(0, 0, 0)
|
|
||||||
end
|
|
||||||
|
|
||||||
pdf.Line(15, top, subject_width+g_width, top)
|
|
||||||
|
|
||||||
%>
|
|
||||||
<%= pdf.Output %>
|
|
||||||
@@ -1,242 +0,0 @@
|
|||||||
<div class="contextual">
|
|
||||||
<%= l(:label_export_to) %>
|
|
||||||
<%= link_to 'PDF', {:zoom => @zoom, :year => @year_from, :month => @month_from, :months => @months, :output => 'pdf'}, :class => 'pic picPdf' %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h2><%= l(:label_gantt) %></h2>
|
|
||||||
|
|
||||||
<table width="100%">
|
|
||||||
<tr>
|
|
||||||
<td align="left">
|
|
||||||
<%= start_form_tag %>
|
|
||||||
<input type="text" name="months" size="2" value="<%= @months %>">
|
|
||||||
<%= l(:label_months_from) %>
|
|
||||||
<%= select_month(@month_from, :prefix => "month", :discard_type => true) %>
|
|
||||||
<%= select_year(@year_from, :prefix => "year", :discard_type => true) %>
|
|
||||||
<%= hidden_field_tag 'zoom', @zoom %>
|
|
||||||
<%= submit_tag l(:button_submit), :class => "button-small" %>
|
|
||||||
<%= end_form_tag %>
|
|
||||||
</td>
|
|
||||||
<td align="right">
|
|
||||||
<%= if @zoom < 4
|
|
||||||
link_to image_tag('zoom_in'), {:zoom => (@zoom+1), :year => @year_from, :month => @month_from, :months => @months}
|
|
||||||
else
|
|
||||||
image_tag 'zoom_in_g'
|
|
||||||
end %>
|
|
||||||
<%= if @zoom > 1
|
|
||||||
link_to image_tag('zoom_out'), :zoom => (@zoom-1), :year => @year_from, :month => @month_from, :months => @months
|
|
||||||
else
|
|
||||||
image_tag 'zoom_out_g'
|
|
||||||
end %>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<br />
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.m_bg {
|
|
||||||
position:absolute;
|
|
||||||
top:0;
|
|
||||||
height:16px;
|
|
||||||
border-top: 1px solid #c0c0c0;
|
|
||||||
border-bottom: 1px solid #c0c0c0;
|
|
||||||
border-right: 1px solid #c0c0c0;
|
|
||||||
text-align: center;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.task {
|
|
||||||
position: absolute;
|
|
||||||
height:8px;
|
|
||||||
font-size:0.8em;
|
|
||||||
color:#888;
|
|
||||||
background:#aaa;
|
|
||||||
padding:0;
|
|
||||||
margin:0;
|
|
||||||
line-height:0.8em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.task_late {
|
|
||||||
background:#f66;
|
|
||||||
}
|
|
||||||
|
|
||||||
.task_done {
|
|
||||||
background:#66f;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<% zoom = 1
|
|
||||||
@zoom.times { zoom = zoom * 2 }
|
|
||||||
|
|
||||||
subject_width = 260
|
|
||||||
header_heigth = 18
|
|
||||||
|
|
||||||
headers_heigth = header_heigth
|
|
||||||
show_weeks = false
|
|
||||||
show_days = false
|
|
||||||
|
|
||||||
if @zoom >1
|
|
||||||
show_weeks = true
|
|
||||||
headers_heigth = 2*header_heigth
|
|
||||||
if @zoom > 2
|
|
||||||
show_days = true
|
|
||||||
headers_heigth = 3*header_heigth
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
g_width = (@date_to - @date_from + 1)*zoom
|
|
||||||
g_height = [(20 * @issues.length + 6), 206].max
|
|
||||||
t_height = g_height + headers_heigth
|
|
||||||
%>
|
|
||||||
|
|
||||||
<table width="100%" border=0 cellspacing=0 cellpading=0>
|
|
||||||
<tr>
|
|
||||||
<td width=260>
|
|
||||||
|
|
||||||
<div style="position:relative;height:<%= t_height + 24 %>px;width:<%= subject_width + 1 %>px;">
|
|
||||||
<div style="right:-2px;width:<%= subject_width %>px;height:<%= headers_heigth %>px;background: #eee;" class="m_bg"></div>
|
|
||||||
<div style="right:-2px;width:<%= subject_width %>px;height:<%= t_height %>px;border-left: 1px solid #c0c0c0;" class="m_bg"></div>
|
|
||||||
<%
|
|
||||||
#
|
|
||||||
# Tasks subjects
|
|
||||||
#
|
|
||||||
top = headers_heigth + 8
|
|
||||||
@issues.each do |i| %>
|
|
||||||
<div style="position: absolute;line-height:1em;height:16px;top:<%= top %>px;left:4px;width:<%= subject_width - 5 %>px;overflow:hidden;">
|
|
||||||
<small><%= link_to "#{i.tracker.name} ##{i.id}", { :controller => 'issues', :action => 'show', :id => i }, :title => "#{i.subject}" %>:
|
|
||||||
<%=h i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)') %></small>
|
|
||||||
</div>
|
|
||||||
<% top = top + 20
|
|
||||||
end %>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
|
|
||||||
<div style="position:relative;height:<%= t_height + 24 %>px;width:<%= subject_width %>;overflow:auto;">
|
|
||||||
<div style="width:<%= g_width-1 %>px;height:<%= headers_heigth %>px;background: #eee;" class="m_bg"> </div>
|
|
||||||
<%
|
|
||||||
#
|
|
||||||
# Months headers
|
|
||||||
#
|
|
||||||
month_f = @date_from
|
|
||||||
left = 0
|
|
||||||
height = (show_weeks ? header_heigth : header_heigth + g_height)
|
|
||||||
@months.times do
|
|
||||||
width = ((month_f >> 1) - month_f) * zoom - 1
|
|
||||||
%>
|
|
||||||
<div style="left:<%= left %>px;width:<%= width %>px;height:<%= height %>px;" class="m_bg">
|
|
||||||
<%= link_to "#{month_f.year}-#{month_f.month}", { :year => month_f.year, :month => month_f.month, :zoom => @zoom, :months => @months }, :title => "#{month_name(month_f.month)} #{month_f.year}"%>
|
|
||||||
</div>
|
|
||||||
<%
|
|
||||||
left = left + width + 1
|
|
||||||
month_f = month_f >> 1
|
|
||||||
end %>
|
|
||||||
|
|
||||||
<%
|
|
||||||
#
|
|
||||||
# Weeks headers
|
|
||||||
#
|
|
||||||
if show_weeks
|
|
||||||
left = 0
|
|
||||||
height = (show_days ? header_heigth-1 : header_heigth-1 + g_height)
|
|
||||||
if @date_from.cwday == 1
|
|
||||||
# @date_from is monday
|
|
||||||
week_f = @date_from
|
|
||||||
else
|
|
||||||
# find next monday after @date_from
|
|
||||||
week_f = @date_from + (7 - @date_from.cwday + 1)
|
|
||||||
width = (7 - @date_from.cwday + 1) * zoom-1
|
|
||||||
%>
|
|
||||||
<div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="m_bg"> </div>
|
|
||||||
<%
|
|
||||||
left = left + width+1
|
|
||||||
end %>
|
|
||||||
<%
|
|
||||||
while week_f <= @date_to
|
|
||||||
width = (week_f + 6 <= @date_to) ? 7 * zoom -1 : (@date_to - week_f + 1) * zoom-1
|
|
||||||
%>
|
|
||||||
<div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="m_bg">
|
|
||||||
<small><%= week_f.cweek if width >= 16 %></small>
|
|
||||||
</div>
|
|
||||||
<%
|
|
||||||
left = left + width+1
|
|
||||||
week_f = week_f+7
|
|
||||||
end
|
|
||||||
end %>
|
|
||||||
|
|
||||||
<%
|
|
||||||
#
|
|
||||||
# Days headers
|
|
||||||
#
|
|
||||||
if show_days
|
|
||||||
left = 0
|
|
||||||
height = g_height + header_heigth - 1
|
|
||||||
wday = @date_from.cwday
|
|
||||||
(@date_to - @date_from + 1).to_i.times do
|
|
||||||
width = zoom - 1
|
|
||||||
%>
|
|
||||||
<div style="left:<%= left %>px;top:37px;width:<%= width %>px;height:<%= height %>px;font-size:0.7em;<%= "background:#f1f1f1;" if wday > 5 %>" class="m_bg">
|
|
||||||
<%= day_name(wday)[0,1] %>
|
|
||||||
</div>
|
|
||||||
<%
|
|
||||||
left = left + width+1
|
|
||||||
wday = wday + 1
|
|
||||||
wday = 1 if wday > 7
|
|
||||||
end
|
|
||||||
end %>
|
|
||||||
|
|
||||||
<%
|
|
||||||
#
|
|
||||||
# Today red line
|
|
||||||
#
|
|
||||||
if Date.today >= @date_from and Date.today <= @date_to %>
|
|
||||||
<div style="position: absolute;height:<%= g_height %>px;top:<%= headers_heigth + 1 %>px;left:<%= ((Date.today-@date_from+1)*zoom).floor()-1 %>px;width:10px;border-left: 1px dashed red;"> </div>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<%
|
|
||||||
#
|
|
||||||
# Tasks
|
|
||||||
#
|
|
||||||
top = headers_heigth + 12
|
|
||||||
@issues.each do |i| %>
|
|
||||||
<%
|
|
||||||
i_start_date = (i.start_date >= @date_from ? i.start_date : @date_from )
|
|
||||||
i_end_date = (i.due_date <= @date_to ? i.due_date : @date_to )
|
|
||||||
|
|
||||||
i_done_date = i.start_date + ((i.due_date - i.start_date+1)*i.done_ratio/100).floor
|
|
||||||
i_done_date = (i_done_date <= @date_from ? @date_from : i_done_date )
|
|
||||||
i_done_date = (i_done_date >= @date_to ? @date_to : i_done_date )
|
|
||||||
|
|
||||||
i_late_date = [i_end_date, Date.today].min if i_start_date < Date.today
|
|
||||||
|
|
||||||
i_left = ((i_start_date - @date_from)*zoom).floor
|
|
||||||
i_width = ((i_end_date - i_start_date + 1)*zoom).floor
|
|
||||||
d_width = ((i_done_date - i_start_date)*zoom).floor
|
|
||||||
l_width = ((i_late_date - i_start_date+1)*zoom).floor if i_late_date
|
|
||||||
l_width ||= 0
|
|
||||||
%>
|
|
||||||
<div style="top:<%= top %>px;left:<%= i_left %>px;width:<%= i_width %>px;" class="task"> </div>
|
|
||||||
<% if l_width > 0 %>
|
|
||||||
<div style="top:<%= top %>px;left:<%= i_left %>px;width:<%= l_width %>px;" class="task task_late"> </div>
|
|
||||||
<% end %>
|
|
||||||
<% if d_width > 0 %>
|
|
||||||
<div style="top:<%= top %>px;left:<%= i_left %>px;width:<%= d_width %>px;" class="task task_done"> </div>
|
|
||||||
<% end %>
|
|
||||||
<div style="top:<%= top %>px;left:<%= i_left + i_width + 5 %>px;background:#fff;" class="task">
|
|
||||||
<%= i.status.name %>
|
|
||||||
<%= (i.done_ratio).to_i %>%
|
|
||||||
</div>
|
|
||||||
<% top = top + 20
|
|
||||||
end %>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<table width="100%">
|
|
||||||
<tr>
|
|
||||||
<td align="left"><%= link_to ('« ' + l(:label_previous)), :year => (@date_from << @months).year, :month => (@date_from << @months).month, :zoom => @zoom, :months => @months %></td>
|
|
||||||
<td>
|
|
||||||
<td align="right"><%= link_to (l(:label_next) + ' »'), :year => (@date_from >> @months).year, :month => (@date_from >> @months).month, :zoom => @zoom, :months => @months %></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
<div class="contextual">
|
|
||||||
<%= link_to_if_authorized l(:label_document_new), {:controller => 'projects', :action => 'add_document', :id => @project}, :class => 'pic picAdd' %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h2><%=l(:label_document_plural)%></h2>
|
|
||||||
|
|
||||||
<% if @documents.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %>
|
|
||||||
|
|
||||||
<% documents = @documents.group_by {|d| d.category } %>
|
|
||||||
<% documents.each do |category, docs| %>
|
|
||||||
<h3><%= category.name %></h3>
|
|
||||||
<%= render :partial => 'documents/document', :collection => docs %>
|
|
||||||
<% end %>
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
<% if @query.new_record? %>
|
|
||||||
<div class="contextual">
|
|
||||||
<%= render :partial => 'issues/add_shortcut', :locals => {:trackers => @trackers } %>
|
|
||||||
</div>
|
|
||||||
<h2><%=l(:label_issue_plural)%></h2>
|
|
||||||
|
|
||||||
<%= start_form_tag({:action => 'list_issues'}, :id => 'query_form') %>
|
|
||||||
<%= render :partial => 'queries/filters', :locals => {:query => @query} %>
|
|
||||||
<%= end_form_tag %>
|
|
||||||
<div class="contextual">
|
|
||||||
<%= link_to_remote l(:button_apply),
|
|
||||||
{ :url => { :controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1 },
|
|
||||||
:update => "content",
|
|
||||||
:with => "Form.serialize('query_form')"
|
|
||||||
}, :class => 'pic picCheck' %>
|
|
||||||
|
|
||||||
<%= link_to l(:button_clear), {:controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1}, :class => 'pic picDelete' %>
|
|
||||||
<% if authorize_for('projects', 'add_query') %>
|
|
||||||
|
|
||||||
<%= link_to_remote l(:button_save),
|
|
||||||
{ :url => { :controller => 'projects', :action => "add_query", :id => @project },
|
|
||||||
:method => 'get',
|
|
||||||
:update => "content",
|
|
||||||
:with => "Form.serialize('query_form')"
|
|
||||||
}, :class => 'pic picEdit' %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
<br />
|
|
||||||
<% else %>
|
|
||||||
<div class="contextual">
|
|
||||||
<%= render :partial => 'issues/add_shortcut', :locals => {:trackers => @trackers } %>
|
|
||||||
<% if authorize_for('projects', 'add_query') %>
|
|
||||||
<%= link_to l(:button_edit), {:controller => 'queries', :action => 'edit', :id => @query}, :class => 'pic picEdit' %>
|
|
||||||
<%= link_to l(:button_delete), {:controller => 'queries', :action => 'destroy', :id => @query}, :confirm => l(:text_are_you_sure), :post => true, :class => 'pic picDelete' %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
<h2><%= @query.name %></h2>
|
|
||||||
<% end %>
|
|
||||||
<%= error_messages_for 'query' %>
|
|
||||||
<% if @query.valid? %>
|
|
||||||
<% if @issues.empty? %>
|
|
||||||
<p><i><%= l(:label_no_data) %></i></p>
|
|
||||||
<% else %>
|
|
||||||
|
|
||||||
<%= start_form_tag({:controller => 'projects', :action => 'move_issues', :id => @project}, :id => 'issues_form' ) %>
|
|
||||||
<table class="list">
|
|
||||||
<thead><tr>
|
|
||||||
<th></th>
|
|
||||||
<%= sort_header_tag('issues.id', :caption => '#') %>
|
|
||||||
<%= sort_header_tag('issues.tracker_id', :caption => l(:field_tracker)) %>
|
|
||||||
<%= sort_header_tag('issue_statuses.name', :caption => l(:field_status)) %>
|
|
||||||
<th><%=l(:field_subject)%></th>
|
|
||||||
<%= sort_header_tag('users.lastname', :caption => l(:field_author)) %>
|
|
||||||
<%= sort_header_tag('issues.created_on', :caption => l(:field_created_on)) %>
|
|
||||||
<%= sort_header_tag('issues.updated_on', :caption => l(:field_updated_on)) %>
|
|
||||||
</tr></thead>
|
|
||||||
<tbody>
|
|
||||||
<% for issue in @issues %>
|
|
||||||
<tr class="<%= cycle("odd", "even") %>">
|
|
||||||
<th width="15"><%= check_box_tag "issue_ids[]", issue.id %></th>
|
|
||||||
<td align="center"><%= link_to issue.id, :controller => 'issues', :action => 'show', :id => issue %></td>
|
|
||||||
<td align="center"><%= issue.tracker.name %></td>
|
|
||||||
<td><div class="square" style="background:#<%= issue.status.html_color %>;"></div> <%= issue.status.name %></td>
|
|
||||||
<td><%= link_to h(issue.subject), :controller => 'issues', :action => 'show', :id => issue %></td>
|
|
||||||
<td align="center"><%= issue.author.display_name %></td>
|
|
||||||
<td align="center"><%= format_time(issue.created_on) %></td>
|
|
||||||
<td align="center"><%= format_time(issue.updated_on) %></td>
|
|
||||||
</tr>
|
|
||||||
<% end %>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<div class="contextual">
|
|
||||||
<%= l(:label_export_to) %>
|
|
||||||
<%= link_to 'CSV', {:action => 'export_issues_csv', :id => @project}, :class => 'icon file' %>,
|
|
||||||
<%= link_to 'PDF', {:action => 'export_issues_pdf', :id => @project}, :class => 'pic picPdf' %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<%= submit_tag l(:button_move), :class => "button-small" %>
|
|
||||||
<%= end_form_tag %>
|
|
||||||
|
|
||||||
<%= pagination_links_full @issue_pages %>
|
|
||||||
[ <%= @issue_pages.current.first_item %> - <%= @issue_pages.current.last_item %> / <%= @issue_count %> ]
|
|
||||||
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<div class="contextual">
|
|
||||||
<%= link_to_if_authorized l(:label_news_new), {:controller => 'projects', :action => 'add_news', :id => @project}, :class => 'pic picAdd' %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h2><%=l(:label_news_plural)%></h2>
|
|
||||||
|
|
||||||
<% if @news.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %>
|
|
||||||
<%= render :partial => 'news/news', :collection => @news %>
|
|
||||||
<%= pagination_links_full @news_pages %>
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
<h2><%=l(:button_move)%></h2>
|
|
||||||
|
|
||||||
|
|
||||||
<%= start_form_tag({:action => 'move_issues', :id => @project}, :class => "tabular") %>
|
|
||||||
|
|
||||||
<div class="box">
|
|
||||||
<p><label><%= l(:label_issue_plural) %>:</label>
|
|
||||||
<% for issue in @issues %>
|
|
||||||
<b><%= link_to issue.long_id, :controller => 'issues', :action => 'show', :id => issue %></b> - <%=h issue.subject %>
|
|
||||||
<%= hidden_field_tag "issue_ids[]", issue.id %><br />
|
|
||||||
<% end %>
|
|
||||||
<i>(<%= @issues.length%> <%= lwr(:label_issue, @issues.length)%>)</i></p>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--[form:issue]-->
|
|
||||||
<p><label for="new_project_id"><%=l(:field_project)%></label>
|
|
||||||
<%= select_tag "new_project_id", options_from_collection_for_select(@projects, "id", "name", @project.id) %></p>
|
|
||||||
|
|
||||||
<p><label for="new_tracker_id"><%=l(:field_tracker)%></label>
|
|
||||||
<%= select_tag "new_tracker_id", options_from_collection_for_select(@trackers, "id", "name") %></p>
|
|
||||||
</div>
|
|
||||||
<%= submit_tag l(:button_move) %>
|
|
||||||
<%= end_form_tag %>
|
|
||||||
@@ -1,105 +0,0 @@
|
|||||||
<h2><%=l(:label_settings)%></h2>
|
|
||||||
|
|
||||||
<% if authorize_for('projects', 'edit') %>
|
|
||||||
<% labelled_tabular_form_for :project, @project, :url => { :action => "edit", :id => @project } do |f| %>
|
|
||||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
|
||||||
<%= submit_tag l(:button_save) %>
|
|
||||||
<% end %>
|
|
||||||
<br />
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<div class="box">
|
|
||||||
<h3><%=l(:label_member_plural)%></h3>
|
|
||||||
<%= error_messages_for 'member' %>
|
|
||||||
<table>
|
|
||||||
<% for member in @project.members.find(:all, :include => :user) %>
|
|
||||||
<% unless member.new_record? %>
|
|
||||||
<tr>
|
|
||||||
<td><%= member.user.display_name %></td>
|
|
||||||
<td>
|
|
||||||
<% if authorize_for('members', 'edit') %>
|
|
||||||
<%= start_form_tag :controller => 'members', :action => 'edit', :id => member %>
|
|
||||||
<select name="member[role_id]">
|
|
||||||
<%= options_from_collection_for_select @roles, "id", "name", member.role_id %>
|
|
||||||
</select>
|
|
||||||
<%= submit_tag l(:button_change), :class => "button-small" %>
|
|
||||||
<%= end_form_tag %>
|
|
||||||
<% end %>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<%= link_to_if_authorized l(:button_delete), {:controller => 'members', :action => 'destroy', :id => member}, :confirm => l(:text_are_you_sure), :post => true, :class => 'pic picDelete' %>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
</table>
|
|
||||||
<% if authorize_for('projects', 'add_member') %>
|
|
||||||
<hr />
|
|
||||||
<label><%=l(:label_member_new)%></label><br/>
|
|
||||||
<%= start_form_tag :controller => 'projects', :action => 'add_member', :id => @project %>
|
|
||||||
<select name="member[user_id]">
|
|
||||||
<%= options_from_collection_for_select @users, "id", "display_name", @member.user_id %>
|
|
||||||
</select>
|
|
||||||
<select name="member[role_id]">
|
|
||||||
<%= options_from_collection_for_select @roles, "id", "name", @member.role_id %>
|
|
||||||
</select>
|
|
||||||
<%= submit_tag l(:button_add) %>
|
|
||||||
<%= end_form_tag %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="box">
|
|
||||||
<h3><%=l(:label_version_plural)%></h3>
|
|
||||||
<table>
|
|
||||||
<% for version in @project.versions %>
|
|
||||||
<tr>
|
|
||||||
<td width="100"><strong><%=h version.name %></strong></td>
|
|
||||||
<td width="100"><%= format_date(version.effective_date) %></td>
|
|
||||||
<td><%=h version.description %></td>
|
|
||||||
<td>
|
|
||||||
<%= link_to_if_authorized l(:button_edit), { :controller => 'versions', :action => 'edit', :id => version }, :class => 'pic picEdit' %>
|
|
||||||
<%= link_to_if_authorized l(:button_delete), {:controller => 'versions', :action => 'destroy', :id => version}, :confirm => l(:text_are_you_sure), :post => true, :class => 'pic picDelete' %>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<% end %>
|
|
||||||
</table>
|
|
||||||
<% if authorize_for('projects', 'add_version') %>
|
|
||||||
<hr />
|
|
||||||
<%= link_to l(:label_version_new), :controller => 'projects', :action => 'add_version', :id => @project %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="box">
|
|
||||||
<h3><%=l(:label_issue_category_plural)%></h3>
|
|
||||||
<table>
|
|
||||||
<% for @category in @project.issue_categories %>
|
|
||||||
<% unless @category.new_record? %>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<%= start_form_tag :controller => 'issue_categories', :action => 'edit', :id => @category %>
|
|
||||||
<%= text_field 'category', 'name', :size => 25 %>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<% if authorize_for('issue_categories', 'edit') %>
|
|
||||||
<%= submit_tag l(:button_save), :class => "button-small" %>
|
|
||||||
<%= end_form_tag %>
|
|
||||||
<% end %>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<%= link_to_if_authorized l(:button_delete), {:controller => 'issue_categories', :action => 'destroy', :id => @category}, :confirm => l(:text_are_you_sure), :post => true, :class => 'pic picDelete' %>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
</table>
|
|
||||||
<% if authorize_for('projects', 'add_issue_category') %>
|
|
||||||
<hr />
|
|
||||||
<%= start_form_tag :action => 'add_issue_category', :id => @project %>
|
|
||||||
<label for="issue_category_name"><%=l(:label_issue_category_new)%></label><br/>
|
|
||||||
<%= error_messages_for 'issue_category' %>
|
|
||||||
<%= text_field 'issue_category', 'name', :size => 25 %>
|
|
||||||
<%= submit_tag l(:button_create) %>
|
|
||||||
<%= end_form_tag %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
<script>
|
|
||||||
|
|
||||||
function add_filter() {
|
|
||||||
select = $('add_filter_select');
|
|
||||||
field = select.value
|
|
||||||
Element.show('tr_' + field);
|
|
||||||
check_box = $('cb_' + field);
|
|
||||||
check_box.checked = true;
|
|
||||||
toggle_filter(field);
|
|
||||||
select.selectedIndex = 0;
|
|
||||||
|
|
||||||
for (i=0; i<select.options.length; i++) {
|
|
||||||
if (select.options[i].value == field) {
|
|
||||||
select.options[i].disabled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggle_filter(field) {
|
|
||||||
check_box = $('cb_' + field);
|
|
||||||
|
|
||||||
if (check_box.checked) {
|
|
||||||
Element.show("operators[" + field + "]");
|
|
||||||
toggle_operator(field);
|
|
||||||
} else {
|
|
||||||
Element.hide("operators[" + field + "]");
|
|
||||||
Element.hide("values_div[" + field + "]");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggle_operator(field) {
|
|
||||||
operator = $("operators[" + field + "]");
|
|
||||||
switch (operator.value) {
|
|
||||||
case "!*":
|
|
||||||
case "*":
|
|
||||||
case "t":
|
|
||||||
case "o":
|
|
||||||
case "c":
|
|
||||||
Element.hide("values_div[" + field + "]");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Element.show("values_div[" + field + "]");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggle_multi_select(field) {
|
|
||||||
select = $('values[' + field + '][]');
|
|
||||||
if (select.multiple == true) {
|
|
||||||
select.multiple = false;
|
|
||||||
} else {
|
|
||||||
select.multiple = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<fieldset style="margin:0;"><legend><%= l(:label_filter_plural) %></legend>
|
|
||||||
<table width="100%" cellpadding=0 cellspacing=0>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<table>
|
|
||||||
<% query.available_filters.sort{|a,b| a[1][:order]<=>b[1][:order]}.each do |filter| %>
|
|
||||||
<% field = filter[0]
|
|
||||||
options = filter[1] %>
|
|
||||||
<tr <%= 'style="display:none;"' unless query.has_filter?(field) %> id="tr_<%= field %>">
|
|
||||||
<td valign="top" width="200">
|
|
||||||
<%= check_box_tag 'fields[]', field, query.has_filter?(field), :onclick => "toggle_filter('#{field}');", :id => "cb_#{field}" %>
|
|
||||||
<label for="cb_<%= field %>"><%= l(("field_"+field.to_s.gsub(/\_id$/, "")).to_sym) %></label>
|
|
||||||
</td>
|
|
||||||
<td valign="top" width="150">
|
|
||||||
<%= select_tag "operators[#{field}]", options_for_select(operators_for_select(options[:type]), query.operator_for(field)), :onchange => "toggle_operator('#{field}');", :class => "select-small", :style => "vertical-align: top;" %>
|
|
||||||
</td>
|
|
||||||
<td valign="top">
|
|
||||||
<div id="values_div[<%= field %>]">
|
|
||||||
<% case options[:type]
|
|
||||||
when :list, :list_optional, :list_status %>
|
|
||||||
<select <%= "multiple=true" if query.values_for(field) and query.values_for(field).length > 1 %>" name="values[<%= field %>][]" id="values[<%= field %>][]" class="select-small" style="vertical-align: top;">
|
|
||||||
<%= options_for_select options[:values], query.values_for(field) %>
|
|
||||||
</select>
|
|
||||||
<%= link_to_function image_tag('expand'), "toggle_multi_select('#{field}');" %>
|
|
||||||
<% when :date, :date_past %>
|
|
||||||
<%= text_field_tag "values[#{field}][]", query.values_for(field), :size => 3, :class => "select-small" %> <%= l(:label_day_plural) %>
|
|
||||||
<% when :text %>
|
|
||||||
<%= text_field_tag "values[#{field}][]", query.values_for(field), :size => 30, :class => "select-small" %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<script>toggle_filter('<%= field %>');</script>
|
|
||||||
<% end %>
|
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
<td align="right" valign="top">
|
|
||||||
<%= l(:label_filter_add) %>:
|
|
||||||
<%= select_tag 'add_filter_select', options_for_select([["",""]] + query.available_filters.sort{|a,b| a[1][:order]<=>b[1][:order]}.collect{|field| [l(("field_"+field[0].to_s.gsub(/\_id$/, "")).to_sym), field[0]] unless query.has_filter?(field[0])}.compact), :onchange => "add_filter();", :class => "select-small" %>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</fieldset>
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
<%= error_messages_for 'query' %>
|
|
||||||
|
|
||||||
<!--[form:query]-->
|
|
||||||
<div class="box">
|
|
||||||
<div class="tabular">
|
|
||||||
<p><label for="query_name"><%=l(:field_name)%></label>
|
|
||||||
<%= text_field 'query', 'name', :size => 80 %></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<%= render :partial => 'queries/filters', :locals => {:query => query}%>
|
|
||||||
</div>
|
|
||||||
<!--[eoform:query]-->
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<h2><%= l(:label_query) %></h2>
|
|
||||||
|
|
||||||
<%= start_form_tag :action => 'edit', :id => @query %>
|
|
||||||
<%= render :partial => 'form', :locals => {:query => @query} %>
|
|
||||||
<%= submit_tag l(:button_save) %>
|
|
||||||
<%= end_form_tag %>
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
<% if @statuses.empty? or rows.empty? %>
|
|
||||||
<p><i><%=l(:label_no_data)%></i></p>
|
|
||||||
<% else %>
|
|
||||||
<table class="list">
|
|
||||||
<thead><tr>
|
|
||||||
<th width="25%"></th>
|
|
||||||
<th align="center" width="25%"><%=l(:label_open_issues_plural)%></th>
|
|
||||||
<th align="center" width="25%"><%=l(:label_closed_issues_plural)%></th>
|
|
||||||
<th align="center" width="25%"><%=l(:label_total)%></th>
|
|
||||||
</tr></thead>
|
|
||||||
<tbody>
|
|
||||||
<% for row in rows %>
|
|
||||||
<tr class="<%= cycle("odd", "even") %>">
|
|
||||||
<td><%= link_to row.name, :controller => 'projects', :action => 'list_issues', :id => @project,
|
|
||||||
:set_filter => 1,
|
|
||||||
"#{field_name}" => row.id %></td>
|
|
||||||
<td align="center"><%= link_to (aggregate data, { field_name => row.id, "closed" => 0 }),
|
|
||||||
:controller => 'projects', :action => 'list_issues', :id => @project,
|
|
||||||
:set_filter => 1,
|
|
||||||
"#{field_name}" => row.id,
|
|
||||||
"status_id" => "o" %></td>
|
|
||||||
<td align="center"><%= link_to (aggregate data, { field_name => row.id, "closed" => 1 }),
|
|
||||||
:controller => 'projects', :action => 'list_issues', :id => @project,
|
|
||||||
:set_filter => 1,
|
|
||||||
"#{field_name}" => row.id,
|
|
||||||
"status_id" => "c" %></td>
|
|
||||||
<td align="center"><%= link_to (aggregate data, { field_name => row.id }),
|
|
||||||
:controller => 'projects', :action => 'list_issues', :id => @project,
|
|
||||||
:set_filter => 1,
|
|
||||||
"#{field_name}" => row.id,
|
|
||||||
"status_id" => "*" %></td>
|
|
||||||
</tr>
|
|
||||||
<% end %>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<% end
|
|
||||||
reset_cycle %>
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
<h2><%=l(:label_report_plural)%></h2>
|
|
||||||
|
|
||||||
<h3><%= l(:label_query_plural) %></h3>
|
|
||||||
<div class="contextual">
|
|
||||||
<%= link_to_if_authorized l(:label_query_new), {:controller => 'projects', :action => 'add_query', :id => @project}, :class => 'pic picAdd' %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% if @queries.empty? %><p><i><%=l(:label_no_data)%></i></p><% end %>
|
|
||||||
<ul>
|
|
||||||
<% @queries.each do |query| %>
|
|
||||||
<li><%= link_to query.name, :controller => 'projects', :action => 'list_issues', :id => @project, :query_id => query %></li>
|
|
||||||
<% end %>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="splitcontentleft">
|
|
||||||
<h3><%=l(:field_tracker)%> <%= link_to image_tag('details'), :detail => 'tracker' %></h3>
|
|
||||||
<%= render :partial => 'simple', :locals => { :data => @issues_by_tracker, :field_name => "tracker_id", :rows => @trackers } %>
|
|
||||||
<br />
|
|
||||||
<h3><%=l(:field_author)%> <%= link_to image_tag('details'), :detail => 'author' %></h3>
|
|
||||||
<%= render :partial => 'simple', :locals => { :data => @issues_by_author, :field_name => "author_id", :rows => @authors } %>
|
|
||||||
<br />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="splitcontentright">
|
|
||||||
<h3><%=l(:field_priority)%> <%= link_to image_tag('details'), :detail => 'priority' %></h3>
|
|
||||||
<%= render :partial => 'simple', :locals => { :data => @issues_by_priority, :field_name => "priority_id", :rows => @priorities } %>
|
|
||||||
<br />
|
|
||||||
<h3><%=l(:field_category)%> <%= link_to image_tag('details'), :detail => 'category' %></h3>
|
|
||||||
<%= render :partial => 'simple', :locals => { :data => @issues_by_category, :field_name => "category_id", :rows => @categories } %>
|
|
||||||
<br />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
<h2><%=l(:label_report_plural)%></h2>
|
|
||||||
|
|
||||||
<h3><%=@report_title%></h3>
|
|
||||||
<%= render :partial => 'details', :locals => { :data => @data, :field_name => @field, :rows => @rows } %>
|
|
||||||
<br />
|
|
||||||
<%= link_to l(:button_back), :action => 'issue_report' %>
|
|
||||||
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
<table class="list">
|
|
||||||
<thead><tr>
|
|
||||||
<th><%= l(:field_name) %></th>
|
|
||||||
<th><%= l(:field_filesize) %></th>
|
|
||||||
<th><%= l(:label_revision) %></th>
|
|
||||||
<th><%= l(:field_author) %></th>
|
|
||||||
<th><%= l(:label_date) %></th>
|
|
||||||
</tr></thead>
|
|
||||||
<tbody>
|
|
||||||
<% total_size = 0
|
|
||||||
@entries.each do |entry| %>
|
|
||||||
<tr class="<%= cycle 'odd', 'even' %>">
|
|
||||||
<td><%= link_to h(entry.name), { :action => (entry.is_dir? ? 'browse' : 'revisions'), :id => @project, :path => entry.path, :rev => @rev }, :class => "icon " + (entry.is_dir? ? 'folder' : 'file') %></td>
|
|
||||||
<td align="right"><%= human_size(entry.size) unless entry.is_dir? %></td>
|
|
||||||
<td align="right"><%= link_to entry.lastrev.identifier, :action => 'revision', :id => @project, :rev => entry.lastrev.identifier %></td>
|
|
||||||
<td align="center"><em><%=h entry.lastrev.author %></em></td>
|
|
||||||
<td align="center"><%= format_time(entry.lastrev.time) %></td>
|
|
||||||
</tr>
|
|
||||||
<% total_size += entry.size
|
|
||||||
end %>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<p align="right"><em><%= l(:label_total) %>: <%= human_size(total_size) %></em></p>
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
<%= link_to 'root', :action => 'browse', :id => @project, :path => '', :rev => @rev %>
|
|
||||||
<%
|
|
||||||
dirs = path.split('/')
|
|
||||||
if 'file' == kind
|
|
||||||
filename = dirs.pop
|
|
||||||
end
|
|
||||||
link_path = ''
|
|
||||||
dirs.each do |dir|
|
|
||||||
link_path << '/' unless link_path.empty?
|
|
||||||
link_path << "#{dir}"
|
|
||||||
%>
|
|
||||||
/ <%= link_to h(dir), :action => 'browse', :id => @project, :path => link_path, :rev => @rev %>
|
|
||||||
<% end %>
|
|
||||||
<% if filename %>
|
|
||||||
/ <%= link_to h(filename), :action => 'revisions', :id => @project, :path => "#{link_path}/#{filename}", :rev => @rev %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<%= "@ #{revision}" if revision %>
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
<%= stylesheet_link_tag "scm" %>
|
|
||||||
|
|
||||||
<div class="contextual">
|
|
||||||
<%= start_form_tag %>
|
|
||||||
<%= l(:label_revision) %>: <%= text_field_tag 'rev', @rev, :size => 5 %>
|
|
||||||
<%= submit_tag 'OK' %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h2><%= render :partial => 'navigation', :locals => { :path => @path, :kind => 'dir', :revision => @rev } %></h2>
|
|
||||||
|
|
||||||
<%= render :partial => 'dir_list' %>
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
<h2><%= render :partial => 'navigation', :locals => { :path => @path, :kind => 'file', :revision => @rev } %></h2>
|
|
||||||
|
|
||||||
<%= stylesheet_link_tag "scm" %>
|
|
||||||
|
|
||||||
<table class="list">
|
|
||||||
<thead><tr><th>@<%= @rev %></th><th>@<%= @rev_to %></th><th></th></tr></thead>
|
|
||||||
<tbody>
|
|
||||||
<% parsing = false
|
|
||||||
line_num_l = 0
|
|
||||||
line_num_r = 0 %>
|
|
||||||
<% @diff.each do |line| %>
|
|
||||||
<%
|
|
||||||
if line =~ /^@@ (\+|\-)(\d+),\d+ (\+|\-)(\d+),\d+ @@/
|
|
||||||
line_num_l = $2.to_i
|
|
||||||
line_num_r = $4.to_i
|
|
||||||
if parsing %>
|
|
||||||
<tr class="spacing"><td colspan="3"> </td></tr>
|
|
||||||
<% end
|
|
||||||
parsing = true
|
|
||||||
next
|
|
||||||
end
|
|
||||||
next unless parsing
|
|
||||||
%>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<% case line[0, 1]
|
|
||||||
when " " %>
|
|
||||||
<th class="line-num"><%= line_num_l %></th>
|
|
||||||
<th class="line-num"><%= line_num_r %></th>
|
|
||||||
<td class="line-code">
|
|
||||||
<% line_num_l = line_num_l + 1
|
|
||||||
line_num_r = line_num_r + 1
|
|
||||||
|
|
||||||
when "-" %>
|
|
||||||
<th class="line-num"></th>
|
|
||||||
<th class="line-num"><%= line_num_r %></th>
|
|
||||||
<td class="line-code" style="background: #fdd;">
|
|
||||||
<% line_num_r = line_num_r + 1
|
|
||||||
|
|
||||||
when "+" %>
|
|
||||||
<th class="line-num"><%= line_num_l %></th>
|
|
||||||
<th class="line-num"></th>
|
|
||||||
<td class="line-code" style="background: #dfd;">
|
|
||||||
<% line_num_l = line_num_l + 1
|
|
||||||
|
|
||||||
else
|
|
||||||
next
|
|
||||||
end %>
|
|
||||||
|
|
||||||
<%= h(line[1..-1]).gsub(/\s/, " ") %></td></tr>
|
|
||||||
|
|
||||||
<% end %>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
<%= stylesheet_link_tag "scm" %>
|
|
||||||
|
|
||||||
<div class="contextual">
|
|
||||||
<%= start_form_tag %>
|
|
||||||
<%= l(:label_revision) %>: <%= text_field_tag 'rev', @rev, :size => 5 %>
|
|
||||||
<%= submit_tag 'OK' %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h2><%= l(:label_revision) %> <%= @revision.identifier %></h2>
|
|
||||||
|
|
||||||
<p><em><%= @revision.author %>, <%= format_time(@revision.time) %></em></p>
|
|
||||||
<%= textilizable @revision.message %>
|
|
||||||
|
|
||||||
<div style="float:right;">
|
|
||||||
<div class="square action_A"></div> <div style="float:left;"><%= l(:label_added) %> </div>
|
|
||||||
<div class="square action_M"></div> <div style="float:left;"><%= l(:label_modified) %> </div>
|
|
||||||
<div class="square action_D"></div> <div style="float:left;"><%= l(:label_deleted) %> </div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h3><%= l(:label_attachment_plural) %></h3>
|
|
||||||
<table class="list">
|
|
||||||
<tbody>
|
|
||||||
<% @revision.paths.each do |path| %>
|
|
||||||
<tr class="<%= cycle 'odd', 'even' %>">
|
|
||||||
<td><div class="square action_<%= path[:action] %>"></div> <%= path[:path] %></td>
|
|
||||||
<td>
|
|
||||||
<% if path[:action] == "M" %>
|
|
||||||
<%= link_to 'View diff', :action => 'diff', :id => @project, :path => path[:path].gsub(/^\//, ''), :rev => @revision.identifier %>
|
|
||||||
<% end %>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<% end %>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<p><%= lwr(:label_modification, @revision.paths.length) %></p>
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
<%= stylesheet_link_tag "scm" %>
|
|
||||||
|
|
||||||
<div class="contextual">
|
|
||||||
<%= start_form_tag %>
|
|
||||||
<%= l(:label_revision) %>: <%= text_field_tag 'rev', @rev, :size => 5 %>
|
|
||||||
<%= submit_tag 'OK' %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h2><%= render :partial => 'navigation', :locals => { :path => @path, :kind => @entry.kind, :revision => @rev } %></h2>
|
|
||||||
|
|
||||||
<% if @entry.is_file? %>
|
|
||||||
<h3><%=h @entry.name %></h3>
|
|
||||||
<p><%= link_to 'Download', {:action => 'entry', :id => @project, :path => @path, :rev => @rev, :format => 'raw' }, :class => "icon file" %> (<%= human_size @entry.size %>)</p>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<h3>Revisions</h3>
|
|
||||||
|
|
||||||
<table class="list">
|
|
||||||
<thead><tr>
|
|
||||||
<th>#</th>
|
|
||||||
<th><%= l(:field_author) %></th>
|
|
||||||
<th><%= l(:label_date) %></th>
|
|
||||||
<th><%= l(:field_description) %></th>
|
|
||||||
<th></th>
|
|
||||||
</tr></thead>
|
|
||||||
<tbody>
|
|
||||||
<% @revisions.each do |revision| %>
|
|
||||||
<tr class="<%= cycle 'odd', 'even' %>">
|
|
||||||
<th align="center"><%= link_to revision.identifier, :action => 'revision', :id => @project, :rev => revision.identifier %></th>
|
|
||||||
<td align="center"><em><%=h revision.author %></em></td>
|
|
||||||
<td align="center"><%= format_time(revision.time) %></td>
|
|
||||||
<td width="70%"><%= textilizable(revision.message) %></td>
|
|
||||||
<td align="center"><%= link_to 'Diff', :action => 'diff', :id => @project, :path => @path, :rev => revision.identifier if @entry.is_file? && revision != @revisions.last %></td>
|
|
||||||
</tr>
|
|
||||||
<% end %>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<p><%= lwr(:label_modification, @revisions.length) %></p>
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
<%= stylesheet_link_tag "scm" %>
|
|
||||||
|
|
||||||
<h2><%= l(:label_repository) %></h2>
|
|
||||||
|
|
||||||
<h3><%= l(:label_revision_plural) %></h3>
|
|
||||||
<% if @latest_revision %>
|
|
||||||
<p><%= l(:label_latest_revision) %>:
|
|
||||||
<%= link_to @latest_revision.identifier, :action => 'revision', :id => @project, :rev => @latest_revision.identifier %><br />
|
|
||||||
<em><%= @latest_revision.author %>, <%= format_time(@latest_revision.time) %></em></p>
|
|
||||||
<% end %>
|
|
||||||
<p><%= link_to l(:label_view_revisions), :action => 'revisions', :id => @project %></p>
|
|
||||||
|
|
||||||
|
|
||||||
<h3><%= l(:label_browse) %></h3>
|
|
||||||
<%= render :partial => 'dir_list' %>
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
<div class="box" style="margin-top: 16px;">
|
|
||||||
<h3><%= l(:label_project_plural) %></h3>
|
|
||||||
|
|
||||||
<% @user.memberships.each do |membership| %>
|
|
||||||
<%= start_form_tag({ :action => 'edit_membership', :id => @user, :membership_id => membership }, :class => "tabular") %>
|
|
||||||
<p style="margin:0;padding-top:0;">
|
|
||||||
<label><%= membership.project.name %></label>
|
|
||||||
<select name="membership[role_id]">
|
|
||||||
<%= options_from_collection_for_select @roles, "id", "name", membership.role_id %>
|
|
||||||
</select>
|
|
||||||
<%= submit_tag l(:button_change), :class => "button-small" %>
|
|
||||||
<%= link_to l(:button_delete), {:action => 'destroy_membership', :id => @user, :membership_id => membership }, :confirm => l(:text_are_you_sure), :post => true, :class => 'pic picDelete' %>
|
|
||||||
</p>
|
|
||||||
<%= end_form_tag %>
|
|
||||||
<% end %>
|
|
||||||
<hr />
|
|
||||||
<p>
|
|
||||||
<label><%=l(:label_project_new)%></label><br/>
|
|
||||||
<%= start_form_tag({ :action => 'edit_membership', :id => @user }) %>
|
|
||||||
<select name="membership[project_id]">
|
|
||||||
<%= options_from_collection_for_select @projects, "id", "name", @membership.project_id %>
|
|
||||||
</select>
|
|
||||||
<select name="membership[role_id]">
|
|
||||||
<%= options_from_collection_for_select @roles, "id", "name", @membership.role_id %>
|
|
||||||
</select>
|
|
||||||
<%= submit_tag l(:button_add) %>
|
|
||||||
<%= end_form_tag %>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
<h2><%= $RDM_WELCOME_TITLE || l(:label_home) %></h2>
|
|
||||||
|
|
||||||
<div class="splitcontentleft">
|
|
||||||
<% if $RDM_WELCOME_TEXT %><p><%= $RDM_WELCOME_TEXT %></p><br /><% end %>
|
|
||||||
<div class="box">
|
|
||||||
<h3><%=l(:label_news_latest)%></h3>
|
|
||||||
<%= render :partial => 'news/news', :collection => @news %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="splitcontentright">
|
|
||||||
<div class="box">
|
|
||||||
<h3><%=l(:label_project_latest)%></h3>
|
|
||||||
<ul>
|
|
||||||
<% for project in @projects %>
|
|
||||||
<li>
|
|
||||||
<%= link_to project.name, :controller => 'projects', :action => 'show', :id => project %> (<%= format_time(project.created_on) %>)<br />
|
|
||||||
<%=h project.description %>
|
|
||||||
</li>
|
|
||||||
<% end %>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% content_for :header_tags do %>
|
|
||||||
<%= auto_discovery_link_tag(:rss, {:controller => 'feeds' , :action => 'news' }) %>
|
|
||||||
<% end %>
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
class IssueMove < ActiveRecord::Migration
|
|
||||||
def self.up
|
|
||||||
Permission.create :controller => "projects", :action => "move_issues", :description => "button_move", :sort => 1061, :mail_option => 0, :mail_enabled => 0
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.down
|
|
||||||
Permission.find(:first, :conditions => ["controller=? and action=?", 'projects', 'move_issues']).destroy
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
class IssueAddNote < ActiveRecord::Migration
|
|
||||||
def self.up
|
|
||||||
Permission.create :controller => "issues", :action => "add_note", :description => "label_add_note", :sort => 1057, :mail_option => 1, :mail_enabled => 0
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.down
|
|
||||||
Permission.find(:first, :conditions => ["controller=? and action=?", 'issues', 'add_note']).destroy
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
class ExportPdf < ActiveRecord::Migration
|
|
||||||
def self.up
|
|
||||||
Permission.create :controller => "projects", :action => "export_issues_pdf", :description => "label_export_pdf", :sort => 1002, :is_public => true, :mail_option => 0, :mail_enabled => 0
|
|
||||||
Permission.create :controller => "issues", :action => "export_pdf", :description => "label_export_pdf", :sort => 1015, :is_public => true, :mail_option => 0, :mail_enabled => 0
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.down
|
|
||||||
Permission.find(:first, :conditions => ["controller=? and action=?", 'projects', 'export_issues_pdf']).destroy
|
|
||||||
Permission.find(:first, :conditions => ["controller=? and action=?", 'issues', 'export_pdf']).destroy
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
class IssueStartDate < ActiveRecord::Migration
|
|
||||||
def self.up
|
|
||||||
add_column :issues, :start_date, :date
|
|
||||||
add_column :issues, :done_ratio, :integer, :default => 0, :null => false
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.down
|
|
||||||
remove_column :issues, :start_date
|
|
||||||
remove_column :issues, :done_ratio
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
class CalendarAndActivity < ActiveRecord::Migration
|
|
||||||
def self.up
|
|
||||||
Permission.create :controller => "projects", :action => "activity", :description => "label_activity", :sort => 160, :is_public => true, :mail_option => 0, :mail_enabled => 0
|
|
||||||
Permission.create :controller => "projects", :action => "calendar", :description => "label_calendar", :sort => 165, :is_public => true, :mail_option => 0, :mail_enabled => 0
|
|
||||||
Permission.create :controller => "projects", :action => "gantt", :description => "label_gantt", :sort => 166, :is_public => true, :mail_option => 0, :mail_enabled => 0
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.down
|
|
||||||
Permission.find(:first, :conditions => ["controller=? and action=?", 'projects', 'activity']).destroy
|
|
||||||
Permission.find(:first, :conditions => ["controller=? and action=?", 'projects', 'calendar']).destroy
|
|
||||||
Permission.find(:first, :conditions => ["controller=? and action=?", 'projects', 'gantt']).destroy
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
class CreateJournals < ActiveRecord::Migration
|
|
||||||
|
|
||||||
# model removed, but needed for data migration
|
|
||||||
class IssueHistory < ActiveRecord::Base; belongs_to :issue; end
|
|
||||||
|
|
||||||
def self.up
|
|
||||||
create_table :journals, :force => true do |t|
|
|
||||||
t.column "journalized_id", :integer, :default => 0, :null => false
|
|
||||||
t.column "journalized_type", :string, :limit => 30, :default => "", :null => false
|
|
||||||
t.column "user_id", :integer, :default => 0, :null => false
|
|
||||||
t.column "notes", :text
|
|
||||||
t.column "created_on", :datetime, :null => false
|
|
||||||
end
|
|
||||||
create_table :journal_details, :force => true do |t|
|
|
||||||
t.column "journal_id", :integer, :default => 0, :null => false
|
|
||||||
t.column "property", :string, :limit => 30, :default => "", :null => false
|
|
||||||
t.column "prop_key", :string, :limit => 30, :default => "", :null => false
|
|
||||||
t.column "old_value", :string
|
|
||||||
t.column "value", :string
|
|
||||||
end
|
|
||||||
|
|
||||||
# indexes
|
|
||||||
add_index "journals", ["journalized_id", "journalized_type"], :name => "journals_journalized_id"
|
|
||||||
add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id"
|
|
||||||
|
|
||||||
Permission.create :controller => "issues", :action => "history", :description => "label_history", :sort => 1006, :is_public => true, :mail_option => 0, :mail_enabled => 0
|
|
||||||
|
|
||||||
# data migration
|
|
||||||
IssueHistory.find(:all, :include => :issue).each {|h|
|
|
||||||
j = Journal.new(:journalized => h.issue, :user_id => h.author_id, :notes => h.notes, :created_on => h.created_on)
|
|
||||||
j.details << JournalDetail.new(:property => 'attr', :prop_key => 'status_id', :value => h.status_id)
|
|
||||||
j.save
|
|
||||||
}
|
|
||||||
|
|
||||||
drop_table :issue_histories
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.down
|
|
||||||
drop_table :journal_details
|
|
||||||
drop_table :journals
|
|
||||||
|
|
||||||
create_table "issue_histories", :force => true do |t|
|
|
||||||
t.column "issue_id", :integer, :default => 0, :null => false
|
|
||||||
t.column "status_id", :integer, :default => 0, :null => false
|
|
||||||
t.column "author_id", :integer, :default => 0, :null => false
|
|
||||||
t.column "notes", :text, :default => ""
|
|
||||||
t.column "created_on", :timestamp
|
|
||||||
end
|
|
||||||
|
|
||||||
add_index "issue_histories", ["issue_id"], :name => "issue_histories_issue_id"
|
|
||||||
|
|
||||||
Permission.find(:first, :conditions => ["controller=? and action=?", 'issues', 'history']).destroy
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
class CreateUserPreferences < ActiveRecord::Migration
|
|
||||||
def self.up
|
|
||||||
create_table :user_preferences do |t|
|
|
||||||
t.column "user_id", :integer, :default => 0, :null => false
|
|
||||||
t.column "others", :text
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.down
|
|
||||||
drop_table :user_preferences
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
class AddHideMailPref < ActiveRecord::Migration
|
|
||||||
def self.up
|
|
||||||
add_column :user_preferences, :hide_mail, :boolean, :default => false
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.down
|
|
||||||
remove_column :user_preferences, :hide_mail
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
class CreateComments < ActiveRecord::Migration
|
|
||||||
def self.up
|
|
||||||
create_table :comments do |t|
|
|
||||||
t.column :commented_type, :string, :limit => 30, :default => "", :null => false
|
|
||||||
t.column :commented_id, :integer, :default => 0, :null => false
|
|
||||||
t.column :author_id, :integer, :default => 0, :null => false
|
|
||||||
t.column :comment, :text, :default => "", :null => false
|
|
||||||
t.column :created_on, :datetime, :null => false
|
|
||||||
t.column :updated_on, :datetime, :null => false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.down
|
|
||||||
drop_table :comments
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
class AddNewsCommentsCount < ActiveRecord::Migration
|
|
||||||
def self.up
|
|
||||||
add_column :news, :comments_count, :integer, :default => 0, :null => false
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.down
|
|
||||||
remove_column :news, :comments_count
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
class AddCommentsPermissions < ActiveRecord::Migration
|
|
||||||
def self.up
|
|
||||||
Permission.create :controller => "news", :action => "add_comment", :description => "label_comment_add", :sort => 1130, :is_public => false, :mail_option => 0, :mail_enabled => 0
|
|
||||||
Permission.create :controller => "news", :action => "destroy_comment", :description => "label_comment_delete", :sort => 1133, :is_public => false, :mail_option => 0, :mail_enabled => 0
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.down
|
|
||||||
Permission.find(:first, :conditions => ["controller=? and action=?", 'news', 'add_comment']).destroy
|
|
||||||
Permission.find(:first, :conditions => ["controller=? and action=?", 'news', 'destroy_comment']).destroy
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
class CreateQueries < ActiveRecord::Migration
|
|
||||||
def self.up
|
|
||||||
create_table :queries, :force => true do |t|
|
|
||||||
t.column "project_id", :integer
|
|
||||||
t.column "name", :string, :default => "", :null => false
|
|
||||||
t.column "filters", :text
|
|
||||||
t.column "user_id", :integer, :default => 0, :null => false
|
|
||||||
t.column "is_public", :boolean, :default => false, :null => false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.down
|
|
||||||
drop_table :queries
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
class AddQueriesPermissions < ActiveRecord::Migration
|
|
||||||
def self.up
|
|
||||||
Permission.create :controller => "projects", :action => "add_query", :description => "button_create", :sort => 600, :is_public => false, :mail_option => 0, :mail_enabled => 0
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.down
|
|
||||||
Permission.find(:first, :conditions => ["controller=? and action=?", 'projects', 'add_query']).destroy
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
class CreateRepositories < ActiveRecord::Migration
|
|
||||||
def self.up
|
|
||||||
create_table :repositories, :force => true do |t|
|
|
||||||
t.column "project_id", :integer, :default => 0, :null => false
|
|
||||||
t.column "url", :string, :default => "", :null => false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.down
|
|
||||||
drop_table :repositories
|
|
||||||
end
|
|
||||||
end
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user