Compare commits
1 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,149 +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 IssuesController < ApplicationController
|
||||
layout 'base', :except => :export_pdf
|
||||
before_filter :find_project, :authorize
|
||||
|
||||
helper :custom_fields
|
||||
include CustomFieldsHelper
|
||||
helper :ifpdf
|
||||
include IfpdfHelper
|
||||
|
||||
def show
|
||||
@status_options = @issue.status.workflows.find(:all, :order => 'position', :include => :new_status, :conditions => ["role_id=? and tracker_id=?", self.logged_in_user.role_for_project(@project.id), @issue.tracker.id]).collect{ |w| w.new_status } if self.logged_in_user
|
||||
@custom_values = @issue.custom_values.find(:all, :include => :custom_field)
|
||||
@journals_count = @issue.journals.count
|
||||
@journals = @issue.journals.find(:all, :include => [:user, :details], :limit => 15, :order => "journals.created_on desc")
|
||||
end
|
||||
|
||||
def history
|
||||
@journals = @issue.journals.find(:all, :include => [:user, :details], :order => "journals.created_on desc")
|
||||
@journals_count = @journals.length
|
||||
end
|
||||
|
||||
def export_pdf
|
||||
@custom_values = @issue.custom_values.find(:all, :include => :custom_field)
|
||||
@options_for_rfpdf ||= {}
|
||||
@options_for_rfpdf[:file_name] = "#{@project.name}_#{@issue.long_id}.pdf"
|
||||
end
|
||||
|
||||
def edit
|
||||
@priorities = Enumeration::get_values('IPRI')
|
||||
if request.get?
|
||||
@custom_values = @project.custom_fields_for_issues(@issue.tracker).collect { |x| @issue.custom_values.find_by_custom_field_id(x.id) || CustomValue.new(:custom_field => x, :customized => @issue) }
|
||||
else
|
||||
begin
|
||||
@issue.init_journal(self.logged_in_user)
|
||||
# Retrieve custom fields and values
|
||||
@custom_values = @project.custom_fields_for_issues(@issue.tracker).collect { |x| CustomValue.new(:custom_field => x, :customized => @issue, :value => params["custom_fields"][x.id.to_s]) }
|
||||
@issue.custom_values = @custom_values
|
||||
@issue.attributes = params[:issue]
|
||||
if @issue.save
|
||||
flash[:notice] = l(:notice_successful_update)
|
||||
redirect_to :action => 'show', :id => @issue
|
||||
end
|
||||
rescue ActiveRecord::StaleObjectError
|
||||
# Optimistic locking exception
|
||||
flash[:notice] = l(:notice_locking_conflict)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def add_note
|
||||
unless params[:notes].empty?
|
||||
journal = @issue.init_journal(self.logged_in_user, params[:notes])
|
||||
#@history = @issue.histories.build(params[:history])
|
||||
#@history.author_id = self.logged_in_user.id if self.logged_in_user
|
||||
#@history.status = @issue.status
|
||||
if @issue.save
|
||||
flash[:notice] = l(:notice_successful_update)
|
||||
Mailer.deliver_issue_edit(journal) if Permission.find_by_controller_and_action(params[:controller], params[:action]).mail_enabled?
|
||||
redirect_to :action => 'show', :id => @issue
|
||||
return
|
||||
end
|
||||
end
|
||||
show
|
||||
render :action => 'show'
|
||||
end
|
||||
|
||||
def change_status
|
||||
#@history = @issue.histories.build(params[:history])
|
||||
@status_options = @issue.status.workflows.find(:all, :order => 'position', :include => :new_status, :conditions => ["role_id=? and tracker_id=?", self.logged_in_user.role_for_project(@project.id), @issue.tracker.id]).collect{ |w| w.new_status } if self.logged_in_user
|
||||
@new_status = IssueStatus.find(params[:new_status_id])
|
||||
if params[:confirm]
|
||||
begin
|
||||
#@history.author_id = self.logged_in_user.id if self.logged_in_user
|
||||
#@issue.status = @history.status
|
||||
#@issue.fixed_version_id = (params[:issue][:fixed_version_id])
|
||||
#@issue.assigned_to_id = (params[:issue][:assigned_to_id])
|
||||
#@issue.done_ratio = (params[:issue][:done_ratio])
|
||||
#@issue.lock_version = (params[:issue][:lock_version])
|
||||
journal = @issue.init_journal(self.logged_in_user, params[:notes])
|
||||
@issue.status = @new_status
|
||||
if @issue.update_attributes(params[:issue])
|
||||
flash[:notice] = l(:notice_successful_update)
|
||||
Mailer.deliver_issue_edit(journal) if Permission.find_by_controller_and_action(params[:controller], params[:action]).mail_enabled?
|
||||
redirect_to :action => 'show', :id => @issue
|
||||
end
|
||||
rescue ActiveRecord::StaleObjectError
|
||||
# Optimistic locking exception
|
||||
flash[:notice] = l(:notice_locking_conflict)
|
||||
end
|
||||
end
|
||||
@assignable_to = @project.members.find(:all, :include => :user).collect{ |m| m.user }
|
||||
end
|
||||
|
||||
def destroy
|
||||
@issue.destroy
|
||||
redirect_to :controller => 'projects', :action => 'list_issues', :id => @project
|
||||
end
|
||||
|
||||
def add_attachment
|
||||
# Save the attachments
|
||||
@attachments = []
|
||||
params[:attachments].each { |file|
|
||||
next unless file.size > 0
|
||||
a = Attachment.create(:container => @issue, :file => file, :author => logged_in_user)
|
||||
@attachments << a unless a.new_record?
|
||||
} if params[:attachments] and params[:attachments].is_a? Array
|
||||
Mailer.deliver_attachments_add(@attachments) if !@attachments.empty? and Permission.find_by_controller_and_action(params[:controller], params[:action]).mail_enabled?
|
||||
redirect_to :action => 'show', :id => @issue
|
||||
end
|
||||
|
||||
def destroy_attachment
|
||||
@issue.attachments.find(params[:attachment_id]).destroy
|
||||
redirect_to :action => 'show', :id => @issue
|
||||
end
|
||||
|
||||
# Send the file in stream mode
|
||||
def download
|
||||
@attachment = @issue.attachments.find(params[:attachment_id])
|
||||
send_file @attachment.diskfile, :filename => @attachment.filename
|
||||
rescue
|
||||
render_404
|
||||
end
|
||||
|
||||
private
|
||||
def find_project
|
||||
@issue = Issue.find(params[:id], :include => [:project, :tracker, :status, :author, :priority, :category])
|
||||
@project = @issue.project
|
||||
@html_title = "#{@project.name} - #{@issue.tracker.name} ##{@issue.id}"
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
render_404
|
||||
end
|
||||
end
|
||||
@@ -1,135 +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 = { 'issuesassignedtome' => :label_assigned_to_me_issues,
|
||||
'issuesreportedbyme' => :label_reported_issues,
|
||||
'news' => :label_news_latest,
|
||||
'calendar' => :label_calendar,
|
||||
'documents' => :label_document_plural
|
||||
}.freeze
|
||||
|
||||
DEFAULT_LAYOUT = { 'left' => ['issuesassignedtome'],
|
||||
'right' => ['issuesreportedbyme']
|
||||
}.freeze
|
||||
|
||||
verify :xhr => true,
|
||||
:session => :page_layout,
|
||||
:only => [:add_block, :remove_block, :order_blocks]
|
||||
|
||||
def index
|
||||
page
|
||||
render :action => 'page'
|
||||
end
|
||||
|
||||
# Show user's page
|
||||
def page
|
||||
@user = self.logged_in_user
|
||||
@blocks = @user.pref[:my_page_layout] || DEFAULT_LAYOUT
|
||||
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 and @user.pref.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] || DEFAULT_LAYOUT.dup
|
||||
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,60 +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 NewsController < ApplicationController
|
||||
layout 'base'
|
||||
before_filter :find_project, :authorize
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def edit
|
||||
if request.post? and @news.update_attributes(params[:news])
|
||||
flash[:notice] = l(:notice_successful_update)
|
||||
redirect_to :action => 'show', :id => @news
|
||||
end
|
||||
end
|
||||
|
||||
def add_comment
|
||||
@comment = Comment.new(params[:comment])
|
||||
@comment.author = logged_in_user
|
||||
if @news.comments << @comment
|
||||
flash[:notice] = l(:label_comment_added)
|
||||
redirect_to :action => 'show', :id => @news
|
||||
else
|
||||
render :action => 'show'
|
||||
end
|
||||
end
|
||||
|
||||
def destroy_comment
|
||||
@news.comments.find(params[:comment_id]).destroy
|
||||
redirect_to :action => 'show', :id => @news
|
||||
end
|
||||
|
||||
def destroy
|
||||
@news.destroy
|
||||
redirect_to :controller => 'projects', :action => 'list_news', :id => @project
|
||||
end
|
||||
|
||||
private
|
||||
def find_project
|
||||
@news = News.find(params[:id])
|
||||
@project = @news.project
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
render_404
|
||||
end
|
||||
end
|
||||
@@ -1,578 +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.
|
||||
|
||||
require 'csv'
|
||||
|
||||
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(:all, :conditions => ["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.size > 0
|
||||
@news = @project.news.find(:all, :limit => 5, :include => [ :author, :project ], :order => "news.created_on DESC")
|
||||
@trackers = Tracker.find(:all, :order => 'position')
|
||||
@open_issues_by_tracker = Issue.count(:group => :tracker, :joins => "INNER JOIN issue_statuses ON issue_statuses.id = issues.status_id", :conditions => ["project_id=? and issue_statuses.is_closed=?", @project.id, false])
|
||||
@total_issues_by_tracker = Issue.count(:group => :tracker, :conditions => ["project_id=?", @project.id])
|
||||
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, :order => 'position')
|
||||
@users = User.find_active(:all) - @project.users
|
||||
@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', :tab => 'categories', :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', :tab => 'versions', :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', :tab => 'members', :id => @project
|
||||
else
|
||||
settings
|
||||
render :action => 'settings'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Show members list of @project
|
||||
def list_members
|
||||
@members = @project.members.find(:all)
|
||||
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)
|
||||
Mailer.deliver_document_add(@document) if Permission.find_by_controller_and_action(params[:controller], params[:action]).mail_enabled?
|
||||
redirect_to :action => 'list_documents', :id => @project
|
||||
end
|
||||
end
|
||||
|
||||
# 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, :priority ],
|
||||
:conditions => @query.statement,
|
||||
:limit => @issue_pages.items_per_page,
|
||||
:offset => @issue_pages.current.offset
|
||||
end
|
||||
@trackers = Tracker.find :all, :order => 'position'
|
||||
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, :priority, {:custom_values => :custom_field} ],
|
||||
:conditions => @query.statement,
|
||||
:limit => Setting.issues_export_limit
|
||||
|
||||
ic = Iconv.new('ISO-8859-1', 'UTF-8')
|
||||
export = StringIO.new
|
||||
CSV::Writer.generate(export, l(:general_csv_separator)) do |csv|
|
||||
# csv header fields
|
||||
headers = [ "#", l(:field_status),
|
||||
l(:field_tracker),
|
||||
l(:field_priority),
|
||||
l(:field_subject),
|
||||
l(:field_author),
|
||||
l(:field_start_date),
|
||||
l(:field_due_date),
|
||||
l(:field_done_ratio),
|
||||
l(:field_created_on),
|
||||
l(:field_updated_on)
|
||||
]
|
||||
for custom_field in @project.all_custom_fields
|
||||
headers << custom_field.name
|
||||
end
|
||||
csv << headers.collect {|c| ic.iconv(c) }
|
||||
# csv lines
|
||||
@issues.each do |issue|
|
||||
fields = [issue.id, issue.status.name,
|
||||
issue.tracker.name,
|
||||
issue.priority.name,
|
||||
issue.subject,
|
||||
issue.author.display_name,
|
||||
issue.start_date ? l_date(issue.start_date) : nil,
|
||||
issue.due_date ? l_date(issue.due_date) : nil,
|
||||
issue.done_ratio,
|
||||
l_datetime(issue.created_on),
|
||||
l_datetime(issue.updated_on)
|
||||
]
|
||||
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, :priority ],
|
||||
:conditions => @query.statement,
|
||||
:limit => Setting.issues_export_limit
|
||||
|
||||
@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
|
||||
@attachments = []
|
||||
params[:attachments].each { |file|
|
||||
next unless file.size > 0
|
||||
a = Attachment.create(:container => @version, :file => file, :author => logged_in_user)
|
||||
@attachments << a unless a.new_record?
|
||||
} if params[:attachments] and params[:attachments].is_a? Array
|
||||
Mailer.deliver_attachments_add(@attachments) if !@attachments.empty? and Permission.find_by_controller_and_action(params[:controller], params[:action]).mail_enabled?
|
||||
redirect_to :controller => 'projects', :action => 'list_files', :id => @project
|
||||
end
|
||||
@versions = @project.versions
|
||||
end
|
||||
|
||||
def list_files
|
||||
@versions = @project.versions
|
||||
end
|
||||
|
||||
# Show changelog for @project
|
||||
def changelog
|
||||
@trackers = Tracker.find(:all, :conditions => ["is_in_chlog=?", true], :order => 'position')
|
||||
if request.get?
|
||||
@selected_tracker_ids = @trackers.collect {|t| t.id.to_s }
|
||||
else
|
||||
@selected_tracker_ids = params[:tracker_ids].collect { |id| id.to_i.to_s } if params[:tracker_ids] and params[:tracker_ids].is_a? Array
|
||||
end
|
||||
@selected_tracker_ids ||= []
|
||||
@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 roadmap
|
||||
@trackers = Tracker.find(:all, :conditions => ["is_in_roadmap=?", true], :order => 'position')
|
||||
if request.get?
|
||||
@selected_tracker_ids = @trackers.collect {|t| t.id.to_s }
|
||||
else
|
||||
@selected_tracker_ids = params[:tracker_ids].collect { |id| id.to_i.to_s } if params[:tracker_ids] and params[:tracker_ids].is_a? Array
|
||||
end
|
||||
@selected_tracker_ids ||= []
|
||||
@versions = @project.versions.find(:all,
|
||||
:conditions => [ "versions.effective_date>?", Date.today],
|
||||
:order => "versions.effective_date ASC"
|
||||
)
|
||||
end
|
||||
|
||||
def activity
|
||||
if params[:year] and params[:year].to_i > 1900
|
||||
@year = params[:year].to_i
|
||||
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, :status, :assigned_to, :priority], :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", :include => [:tracker, :status, :assigned_to, :priority], :conditions => ["(((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?) or (start_date<? and due_date>?)) and start_date is not null and due_date is not null)", @date_from, @date_to, @date_from, @date_to, @date_from, @date_to])
|
||||
|
||||
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])
|
||||
session[:query] = @query
|
||||
else
|
||||
if params[:set_filter] or !session[:query] or session[:query].project_id != @project.id
|
||||
# Give it a name, required to be valid
|
||||
@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, :order => 'position')
|
||||
|
||||
case params[:detail]
|
||||
when "tracker"
|
||||
@field = "tracker_id"
|
||||
@rows = Tracker.find :all, :order => 'position'
|
||||
@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, :order => 'position')
|
||||
@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,33 +0,0 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class SettingsController < ApplicationController
|
||||
layout 'base'
|
||||
before_filter :require_admin
|
||||
|
||||
def index
|
||||
edit
|
||||
render :action => 'edit'
|
||||
end
|
||||
|
||||
def edit
|
||||
if request.post? and params[:settings] and params[:settings].is_a? Hash
|
||||
params[:settings].each { |name, value| Setting[name] = value }
|
||||
redirect_to :action => 'edit' and return
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -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 FeedsHelper
|
||||
end
|
||||
@@ -1,53 +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 initialize
|
||||
super
|
||||
SetCreator("redMine #{Redmine::VERSION}")
|
||||
end
|
||||
|
||||
def Cell(w,h=0,txt='',border=0,ln=0,align='',fill=0,link='')
|
||||
@ic ||= Iconv.new('ISO-8859-1', 'UTF-8')
|
||||
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 detail.old_value
|
||||
old_value = content_tag("strike", old_value) if detail.old_value and (!detail.value or detail.value.empty?)
|
||||
value = content_tag("i", h(value)) if value
|
||||
end
|
||||
|
||||
if detail.value and !detail.value.to_s.empty?
|
||||
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,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,19 +0,0 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
module SettingsHelper
|
||||
end
|
||||
@@ -1,60 +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 CustomField < ActiveRecord::Base
|
||||
has_many :custom_values, :dependent => :delete_all
|
||||
serialize :possible_values
|
||||
|
||||
FIELD_FORMATS = { "string" => { :name => :label_string, :order => 1 },
|
||||
"text" => { :name => :label_text, :order => 2 },
|
||||
"int" => { :name => :label_integer, :order => 3 },
|
||||
"list" => { :name => :label_list, :order => 4 },
|
||||
"date" => { :name => :label_date, :order => 5 },
|
||||
"bool" => { :name => :label_boolean, :order => 6 }
|
||||
}.freeze
|
||||
|
||||
validates_presence_of :name, :field_format
|
||||
validates_uniqueness_of :name
|
||||
validates_format_of :name, :with => /^[\w\s\'\-]*$/i
|
||||
validates_inclusion_of :field_format, :in => FIELD_FORMATS.keys
|
||||
|
||||
def initialize(attributes = nil)
|
||||
super
|
||||
self.possible_values ||= []
|
||||
end
|
||||
|
||||
def before_validation
|
||||
# remove empty values
|
||||
self.possible_values = self.possible_values.collect{|v| v unless v.empty?}.compact
|
||||
end
|
||||
|
||||
def validate
|
||||
if self.field_format == "list"
|
||||
errors.add(:possible_values, :activerecord_error_blank) if self.possible_values.nil? || self.possible_values.empty?
|
||||
errors.add(:possible_values, :activerecord_error_invalid) unless self.possible_values.is_a? Array
|
||||
end
|
||||
end
|
||||
|
||||
# to move in project_custom_field
|
||||
def self.for_all
|
||||
find(:all, :conditions => ["is_for_all=?", true])
|
||||
end
|
||||
|
||||
def type_name
|
||||
nil
|
||||
end
|
||||
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,88 +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 Mailer < ActionMailer::Base
|
||||
helper IssuesHelper
|
||||
|
||||
def issue_add(issue)
|
||||
set_language_if_valid(Setting.default_language)
|
||||
# Sends to all project members
|
||||
@recipients = issue.project.members.collect { |m| m.user.mail if m.user.mail_notification }.compact
|
||||
@from = Setting.mail_from
|
||||
@subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}"
|
||||
@body['issue'] = issue
|
||||
end
|
||||
|
||||
def issue_edit(journal)
|
||||
set_language_if_valid(Setting.default_language)
|
||||
# Sends to all project members
|
||||
issue = journal.journalized
|
||||
@recipients = issue.project.members.collect { |m| m.user.mail if m.user.mail_notification }.compact
|
||||
@from = Setting.mail_from
|
||||
@subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}"
|
||||
@body['issue'] = issue
|
||||
@body['journal']= journal
|
||||
end
|
||||
|
||||
def document_add(document)
|
||||
set_language_if_valid(Setting.default_language)
|
||||
@recipients = document.project.users.collect { |u| u.mail if u.mail_notification }.compact
|
||||
@from = Setting.mail_from
|
||||
@subject = "[#{document.project.name}] #{l(:label_document_new)}: #{document.title}"
|
||||
@body['document'] = document
|
||||
end
|
||||
|
||||
def attachments_add(attachments)
|
||||
set_language_if_valid(Setting.default_language)
|
||||
container = attachments.first.container
|
||||
url = "http://#{Setting.host_name}/"
|
||||
added_to = ""
|
||||
case container.class.to_s
|
||||
when 'Version'
|
||||
url << "projects/list_files/#{container.project_id}"
|
||||
added_to = "#{l(:label_version)}: #{container.name}"
|
||||
when 'Document'
|
||||
url << "documents/show/#{container.id}"
|
||||
added_to = "#{l(:label_document)}: #{container.title}"
|
||||
when 'Issue'
|
||||
url << "issues/show/#{container.id}"
|
||||
added_to = "#{container.tracker.name} ##{container.id}: #{container.subject}"
|
||||
end
|
||||
@recipients = container.project.users.collect { |u| u.mail if u.mail_notification }.compact
|
||||
@from = Setting.mail_from
|
||||
@subject = "[#{container.project.name}] #{l(:label_attachment_new)}"
|
||||
@body['attachments'] = attachments
|
||||
@body['url'] = url
|
||||
@body['added_to'] = added_to
|
||||
end
|
||||
|
||||
def lost_password(token)
|
||||
set_language_if_valid(token.user.language)
|
||||
@recipients = token.user.mail
|
||||
@from = Setting.mail_from
|
||||
@subject = l(:mail_subject_lost_password)
|
||||
@body['token'] = token
|
||||
end
|
||||
|
||||
def register(token)
|
||||
set_language_if_valid(token.user.language)
|
||||
@recipients = token.user.mail
|
||||
@from = Setting.mail_from
|
||||
@subject = l(:mail_subject_register)
|
||||
@body['token'] = token
|
||||
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 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, :order => 'position').collect{|s| [s.name, s.id.to_s] } },
|
||||
"tracker_id" => { :type => :list, :order => 2, :values => Tracker.find(:all, :order => 'position').collect{|s| [s.name, s.id.to_s] } },
|
||||
"priority_id" => { :type => :list, :order => 3, :values => Enumeration.find(:all, :conditions => ['opt=?','IPRI']).collect{|s| [s.name, s.id.to_s] } },
|
||||
"subject" => { :type => :text, :order => 8 },
|
||||
"created_on" => { :type => :date_past, :order => 9 },
|
||||
"updated_on" => { :type => :date_past, :order => 10 },
|
||||
"start_date" => { :type => :date, :order => 11 },
|
||||
"due_date" => { :type => :date, :order => 12 } }
|
||||
unless project.nil?
|
||||
# project specific filters
|
||||
@available_filters["assigned_to_id"] = { :type => :list_optional, :order => 4, :values => @project.users.collect{|s| [s.name, s.id.to_s] } }
|
||||
@available_filters["author_id"] = { :type => :list, :order => 5, :values => @project.users.collect{|s| [s.name, s.id.to_s] } }
|
||||
@available_filters["category_id"] = { :type => :list_optional, :order => 6, :values => @project.issue_categories.collect{|s| [s.name, s.id.to_s] } }
|
||||
@available_filters["fixed_version_id"] = { :type => :list_optional, :order => 7, :values => @project.versions.collect{|s| [s.name, s.id.to_s] } }
|
||||
# remove category filter if no category defined
|
||||
@available_filters.delete "category_id" if @available_filters["category_id"][:values].empty?
|
||||
end
|
||||
@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,61 +0,0 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class Setting < ActiveRecord::Base
|
||||
|
||||
cattr_accessor :available_settings
|
||||
@@available_settings = YAML::load(File.open("#{RAILS_ROOT}/config/settings.yml"))
|
||||
|
||||
validates_uniqueness_of :name
|
||||
validates_inclusion_of :name, :in => @@available_settings.keys
|
||||
validates_numericality_of :value, :only_integer => true, :if => Proc.new { |setting| @@available_settings[setting.name]['format'] == 'int' }
|
||||
|
||||
def self.get(name)
|
||||
name = name.to_s
|
||||
setting = find_by_name(name)
|
||||
setting ||= new(:name => name, :value => @@available_settings[name]['default']) if @@available_settings.has_key? name
|
||||
setting
|
||||
end
|
||||
|
||||
def self.[](name)
|
||||
get(name).value
|
||||
end
|
||||
|
||||
def self.[]=(name, value)
|
||||
setting = get(name)
|
||||
setting.value = (value ? value.to_s : "")
|
||||
setting.save
|
||||
setting.value
|
||||
end
|
||||
|
||||
@@available_settings.each do |name, params|
|
||||
src = <<-END_SRC
|
||||
def self.#{name}
|
||||
self[:#{name}]
|
||||
end
|
||||
|
||||
def self.#{name}?
|
||||
self[:#{name}].to_s == "1"
|
||||
end
|
||||
|
||||
def self.#{name}=(value)
|
||||
self[:#{name}] = value
|
||||
end
|
||||
END_SRC
|
||||
class_eval src, __FILE__, __LINE__
|
||||
end
|
||||
end
|
||||
@@ -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,24 +0,0 @@
|
||||
<center>
|
||||
<div class="box login">
|
||||
<h2 class="icon22 icon22-authent"><%=l(:label_please_login)%></h2>
|
||||
|
||||
<% form_tag({:action=> "login"}, :class => "tabular") do %>
|
||||
<p><label for="login"><%=l(:field_login)%>:</label>
|
||||
<%= text_field_tag 'login', nil, :size => 25 %></p>
|
||||
|
||||
<p><label for="password"><%=l(:field_password)%>:</label>
|
||||
<%= password_field_tag 'password', nil, :size => 25 %></p>
|
||||
|
||||
<p><center><input type="submit" name="login" value="<%=l(:button_login)%> »" class="primary" /></center>
|
||||
<% end %>
|
||||
|
||||
<br>
|
||||
<% links = []
|
||||
links << link_to(l(:label_register), :action => 'register') if Setting.self_registration?
|
||||
links << link_to(l(:label_password_lost), :action => 'lost_password') if Setting.lost_password?
|
||||
%>
|
||||
<%= links.join(" | ") %>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</center>
|
||||
@@ -1,3 +0,0 @@
|
||||
<h2><%=l(:label_information_plural)%></h2>
|
||||
|
||||
<p><%=l(:field_version)%>: <strong>redMine <%= Redmine::VERSION %></strong></p>
|
||||
@@ -1,28 +0,0 @@
|
||||
<div class="contextual">
|
||||
<%= link_to l(:label_auth_source_new), {:action => 'new'}, :class => 'icon icon-add' %>
|
||||
</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,95 +0,0 @@
|
||||
<%= error_messages_for 'custom_field' %>
|
||||
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
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);
|
||||
break;
|
||||
case "int":
|
||||
case "string":
|
||||
case "text":
|
||||
Element.show(p_length.parentNode);
|
||||
Element.show(p_regexp.parentNode);
|
||||
Element.hide(p_values);
|
||||
break;
|
||||
case "date":
|
||||
case "bool":
|
||||
Element.hide(p_length.parentNode);
|
||||
Element.hide(p_regexp.parentNode);
|
||||
Element.hide(p_values);
|
||||
break;
|
||||
default:
|
||||
Element.show(p_length.parentNode);
|
||||
Element.show(p_regexp.parentNode);
|
||||
Element.show(p_values);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function addValueField() {
|
||||
var f = $$('p#custom_field_possible_values span');
|
||||
p = document.getElementById("custom_field_possible_values");
|
||||
var v = f[0].cloneNode(true);
|
||||
v.childNodes[0].value = "";
|
||||
p.appendChild(v);
|
||||
}
|
||||
|
||||
function deleteValueField(e) {
|
||||
var f = $$('p#custom_field_possible_values span');
|
||||
if (f.length == 1) {
|
||||
e.parentNode.childNodes[0].value = "";
|
||||
} else {
|
||||
Element.remove(e.parentNode);
|
||||
}
|
||||
}
|
||||
|
||||
//]]>
|
||||
</script>
|
||||
|
||||
<!--[form:custom_field]-->
|
||||
<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 id="custom_field_possible_values"><label><%= l(:field_possible_values) %> <%= image_to_function "add.png", "addValueField();return false" %></label>
|
||||
<% (@custom_field.possible_values.to_a + [""]).each do |value| %>
|
||||
<span><%= text_field_tag 'custom_field[possible_values][]', value, :size => 30 %> <%= image_to_function "delete.png", "deleteValueField(this);return false" %><br /></span>
|
||||
<% end %>
|
||||
|
||||
</p>
|
||||
</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,46 +0,0 @@
|
||||
<h2><%=l(:label_custom_field_plural)%></h2>
|
||||
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li><%= link_to l(:label_issue_plural), {}, :id=> "tab-IssueCustomField", :onclick => "showTab('IssueCustomField'); this.blur(); return false;" %></li>
|
||||
<li><%= link_to l(:label_project_plural), {}, :id=> "tab-ProjectCustomField", :onclick => "showTab('ProjectCustomField'); this.blur(); return false;" %></li>
|
||||
<li><%= link_to l(:label_user_plural), {}, :id=> "tab-UserCustomField", :onclick => "showTab('UserCustomField'); this.blur(); return false;" %></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<% %w(IssueCustomField ProjectCustomField UserCustomField).each do |type| %>
|
||||
<div id="tab-content-<%= type %>" class="tab-content">
|
||||
<table class="list">
|
||||
<thead><tr>
|
||||
<th width="30%"><%=l(:field_name)%></th>
|
||||
<th><%=l(:field_field_format)%></th>
|
||||
<th><%=l(:field_is_required)%></th>
|
||||
<% if type == 'IssueCustomField' %>
|
||||
<th><%=l(:field_is_for_all)%></th>
|
||||
<th><%=l(:label_used_by)%></th>
|
||||
<% end %>
|
||||
<th width="10%"></th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<% for custom_field in (@custom_fields_by_type[type] || []) %>
|
||||
<tr class="<%= cycle("odd", "even") %>">
|
||||
<td><%= link_to custom_field.name, :action => 'edit', :id => custom_field %></td>
|
||||
<td align="center"><%= l(CustomField::FIELD_FORMATS[custom_field.field_format][:name]) %></td>
|
||||
<td align="center"><%= image_tag 'true.png' if custom_field.is_required? %></td>
|
||||
<% if type == 'IssueCustomField' %>
|
||||
<td align="center"><%= image_tag 'true.png' if custom_field.is_for_all? %></td>
|
||||
<td align="center"><%= custom_field.projects.count.to_s + ' ' + lwr(:label_project, custom_field.projects.count) if custom_field.is_a? IssueCustomField and !custom_field.is_for_all? %></td>
|
||||
<% end %>
|
||||
<td align="center">
|
||||
<%= button_to l(:button_delete), { :action => 'destroy', :id => custom_field }, :confirm => l(:text_are_you_sure), :class => "button-small" %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end; reset_cycle %>
|
||||
</tbody>
|
||||
</table>
|
||||
<br />
|
||||
<%= link_to l(:label_custom_field_new), {:action => 'new', :type => type}, :class => 'icon icon-add' %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= javascript_tag "showTab('#{@tab}');" %>
|
||||
@@ -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 => 'icon icon-edit' %>
|
||||
<%= link_to_if_authorized l(:button_delete), {:controller => 'documents', :action => 'destroy', :id => @document}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
|
||||
</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), :method => :post, :class => 'icon icon-del' %>
|
||||
</div>
|
||||
<%= link_to attachment.filename, :action => 'download', :id => @document, :attachment_id => attachment %>
|
||||
(<%= number_to_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') %>
|
||||
<% form_tag ({ :controller => 'documents', :action => 'add_attachment', :id => @document }, :multipart => true, :class => "tabular") do %>
|
||||
<p id="attachments_p"><label for="attachment_file"><%=l(:label_attachment)%>
|
||||
<%= image_to_function "add.png", "addFileField();return false" %></label>
|
||||
<%= file_field_tag 'attachments[]', :size => 30 %> <em>(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)</em></p>
|
||||
<%= submit_tag l(:button_add) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -1,10 +0,0 @@
|
||||
<h2><%=l(:label_enumerations)%></h2>
|
||||
|
||||
<% form_tag({:action => 'update', :id => @enumeration}, :class => "tabular") do %>
|
||||
<%= render :partial => 'form' %>
|
||||
<%= submit_tag l(:button_save) %>
|
||||
<% end %>
|
||||
|
||||
<% form_tag({:action => 'destroy', :id => @enumeration}) do %>
|
||||
<%= submit_tag l(:button_delete) %>
|
||||
<% end %>
|
||||
@@ -1,6 +0,0 @@
|
||||
<h2><%= l(@enumeration.option_name) %>: <%=l(:label_enumeration_new)%></h2>
|
||||
|
||||
<% form_tag({:action => 'create'}, :class => "tabular") do %>
|
||||
<%= render :partial => 'form' %>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<% 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 "#{Setting.app_title}: #{l(:label_news_latest)}"
|
||||
xml.link url_for(:controller => 'welcome', :only_path => false)
|
||||
xml.pubDate CGI.rfc1123_date(@news.first.created_on)
|
||||
xml.description 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,35 +0,0 @@
|
||||
<div class="contextual">
|
||||
<%= link_to l(:label_issue_status_new), {:action => 'new'}, :class => 'icon icon-add' %>
|
||||
</div>
|
||||
|
||||
<h2><%=l(:label_issue_status_plural)%></h2>
|
||||
|
||||
<table class="list">
|
||||
<thead><tr>
|
||||
<th><%=l(:field_status)%></th>
|
||||
<th><%=l(:field_is_default)%></th>
|
||||
<th><%=l(:field_is_closed)%></th>
|
||||
<th><%=l(:button_sort)%></th>
|
||||
<th></th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<% for status in @issue_statuses %>
|
||||
<tr class="<%= cycle("odd", "even") %>">
|
||||
<td><div class="square" style="background:#<%= status.html_color %>;"></div> <%= link_to status.name, :action => 'edit', :id => status %></td>
|
||||
<td align="center"><%= image_tag 'true.png' if status.is_default? %></td>
|
||||
<td align="center"><%= image_tag 'true.png' if status.is_closed? %></td>
|
||||
<td align="center">
|
||||
<%= link_to image_tag('2uparrow.png', :alt => l(:label_sort_highest)), {:action => 'move', :id => status, :position => 'highest'}, :method => :post, :title => l(:label_sort_highest) %>
|
||||
<%= link_to image_tag('1uparrow.png', :alt => l(:label_sort_higher)), {:action => 'move', :id => status, :position => 'higher'}, :method => :post, :title => l(:label_sort_higher) %> -
|
||||
<%= link_to image_tag('1downarrow.png', :alt => l(:label_sort_lower)), {:action => 'move', :id => status, :position => 'lower'}, :method => :post, :title => l(:label_sort_lower) %>
|
||||
<%= link_to image_tag('2downarrow.png', :alt => l(:label_sort_lowest)), {:action => 'move', :id => status, :position => 'lowest'}, :method => :post, :title => l(:label_sort_lowest) %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= button_to l(:button_delete), { :action => 'destroy', :id => status }, :confirm => l(:text_are_you_sure), :class => "button-small" %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= pagination_links_full @issue_status_pages %>
|
||||
@@ -1,5 +0,0 @@
|
||||
<% if authorize_for('projects', 'add_issue') %>
|
||||
<% form_tag({ :controller => 'projects', :action => 'add_issue', :id => @project }, :method => 'get') do %>
|
||||
<%= l(:label_issue_new) %>: <%= select_tag 'tracker_id', ("<option></option>" + options_from_collection_for_select(trackers, 'id', 'name')), :onchange => "if (this.value!='') {this.form.submit();}" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -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, number_to_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,6 +0,0 @@
|
||||
<%= link_to "#{issue.tracker.name} ##{issue.id}", { :controller => 'issues', :action => 'show', :id => issue } %></strong>: <%=h issue.subject %><br />
|
||||
<br />
|
||||
<strong><%= l(:field_start_date) %></strong>: <%= format_date(issue.start_date) %><br />
|
||||
<strong><%= l(:field_due_date) %></strong>: <%= format_date(issue.due_date) %><br />
|
||||
<strong><%= l(:field_assigned_to) %></strong>: <%= issue.assigned_to ? issue.assigned_to.name : "-" %><br />
|
||||
<strong><%= l(:field_priority) %></strong>: <%= issue.priority.name %>
|
||||
@@ -1,56 +0,0 @@
|
||||
<h2><%= @issue.tracker.name %> #<%= @issue.id %> - <%=h @issue.subject %></h2>
|
||||
|
||||
<% labelled_tabular_form_for :issue, @issue, :url => {:action => 'edit'} do |f| %>
|
||||
<%= error_messages_for 'issue' %>
|
||||
<div class="box">
|
||||
<!--[form:issue]-->
|
||||
<div class="splitcontentleft">
|
||||
<p><label><%=l(:field_status)%></label> <%= @issue.status.name %></p>
|
||||
<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]}) %></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, @issue.description.length / 50].max, 100].min, :required => true %></p>
|
||||
|
||||
<% for @custom_value in @custom_values %>
|
||||
<p><%= custom_field_tag_with_label @custom_value %></p>
|
||||
<% end %>
|
||||
|
||||
<p><%= f.select :fixed_version_id, (@project.versions.collect {|v| [v.name, v.id]}), { :include_blank => true } %>
|
||||
</select></p>
|
||||
</div>
|
||||
<!--[eoform:issue]-->
|
||||
</div>
|
||||
<%= f.hidden_field :lock_version %>
|
||||
<%= submit_tag l(:button_save) %>
|
||||
<% end %>
|
||||
|
||||
<% if Setting.text_formatting == 'textile' %>
|
||||
<%= 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 %>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'calendar/calendar' %>
|
||||
<%= javascript_include_tag "calendar/lang/calendar-#{current_language}.js" %>
|
||||
<%= javascript_include_tag 'calendar/calendar-setup' %>
|
||||
<%= stylesheet_link_tag 'calendar' %>
|
||||
<% end %>
|
||||
@@ -1,10 +0,0 @@
|
||||
<% pdf=IfpdfHelper::IFPDF.new
|
||||
pdf.SetTitle("#{@project.name} - ##{@issue.tracker.name} #{@issue.id}")
|
||||
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,111 +0,0 @@
|
||||
<div class="contextual">
|
||||
<%= l(:label_export_to) %><%= link_to 'PDF', {:action => 'export_pdf', :id => @issue}, :class => 'icon icon-pdf' %>
|
||||
</div>
|
||||
|
||||
<h2><%= @issue.tracker.name %> #<%= @issue.id %> - <%=h @issue.subject %></h2>
|
||||
|
||||
<div class="box">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="width:15%"><b><%=l(:field_status)%> :</b></td><td style="width:35%"><%= @issue.status.name %></td>
|
||||
<td style="width:15%"><b><%=l(:field_priority)%> :</b></td><td style="width:35%"><%= @issue.priority.name %></td>
|
||||
</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>
|
||||
<td><b><%=l(:field_fixed_version)%> :</b></td><td><%= @issue.fixed_version ? @issue.fixed_version.name : "-" %></td>
|
||||
<td></td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<% n = 0
|
||||
for custom_value in @custom_values %>
|
||||
<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 => 'icon icon-edit' %>
|
||||
<%= link_to_if_authorized l(:button_move), {:controller => 'projects', :action => 'move_issues', :id => @project, "issue_ids[]" => @issue.id }, :class => 'icon icon-move' %>
|
||||
<%= link_to_if_authorized l(:button_delete), {:controller => 'issues', :action => 'destroy', :id => @issue}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
|
||||
</div>
|
||||
|
||||
<% if authorize_for('issues', 'change_status') and @status_options and !@status_options.empty? %>
|
||||
<% form_tag ({:controller => 'issues', :action => 'change_status', :id => @issue}) do %>
|
||||
<%=l(:label_change_status)%> :
|
||||
<select name="new_status_id">
|
||||
<%= options_from_collection_for_select @status_options, "id", "name" %>
|
||||
</select>
|
||||
<%= submit_tag l(:button_change) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
</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 icon-attachment' %> (<%= number_to_human_size(attachment.filesize) %>)</td>
|
||||
<td><%= format_date(attachment.created_on) %></td>
|
||||
<td><%= attachment.author.display_name %></td>
|
||||
<td><div class="contextual"><%= link_to_if_authorized l(:button_delete), {:controller => 'issues', :action => 'destroy_attachment', :id => @issue, :attachment_id => attachment }, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %></div></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
<br />
|
||||
<% if authorize_for('issues', 'add_attachment') %>
|
||||
<% form_tag ({ :controller => 'issues', :action => 'add_attachment', :id => @issue }, :multipart => true, :class => "tabular") do %>
|
||||
<p id="attachments_p"><label><%=l(:label_attachment_new)%>
|
||||
<%= image_to_function "add.png", "addFileField();return false" %></label>
|
||||
<%= file_field_tag 'attachments[]', :size => 30 %> <em>(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)</em></p>
|
||||
<%= submit_tag l(:button_add) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% if authorize_for('issues', 'add_note') %>
|
||||
<div class="box">
|
||||
<h3><%= l(:label_add_note) %></h3>
|
||||
<% form_tag ({:controller => 'issues', :action => 'add_note', :id => @issue}, :class => "tabular" ) do %>
|
||||
<p><label for="notes"><%=l(:field_notes)%></label>
|
||||
<%= text_area_tag 'notes', '', :cols => 60, :rows => 10 %></p>
|
||||
<%= submit_tag l(:button_add) %>
|
||||
<% end %>
|
||||
</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><%= Setting.app_title + (@html_title ? ": #{@html_title}" : "") %></title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<meta name="description" content="redMine" />
|
||||
<meta name="keywords" content="issue,bug,tracker" />
|
||||
<!--[if IE]>
|
||||
<style type="text/css">
|
||||
body {behavior: url(<%= stylesheet_path "csshover.htc" %>);}
|
||||
</style>
|
||||
<![endif]-->
|
||||
<%= stylesheet_link_tag "application" %>
|
||||
<%= stylesheet_link_tag "print", :media => "print" %>
|
||||
<%= javascript_include_tag :defaults %>
|
||||
<%= javascript_include_tag 'menu' %>
|
||||
<%= stylesheet_link_tag 'jstoolbar' %>
|
||||
<!-- page specific tags --><%= yield :header_tags %>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="container" >
|
||||
|
||||
<div id="header">
|
||||
<div style="float: left;">
|
||||
<h1><%= Setting.app_title %></h1>
|
||||
<h2><%= Setting.app_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><%= link_to l(:label_home), { :controller => 'welcome' }, :class => "icon icon-home" %></li>
|
||||
<li><%= link_to l(:label_my_page), { :controller => 'my', :action => 'page'}, :class => "icon icon-mypage" %></li>
|
||||
<li><%= link_to l(:label_project_plural), { :controller => 'projects' }, :class => "icon icon-projects" %></li>
|
||||
|
||||
<% unless @project.nil? || @project.id.nil? %>
|
||||
<li class="submenu"><%= link_to @project.name, { :controller => 'projects', :action => 'show', :id => @project }, :class => "icon icon-projects", :onmouseover => "buttonMouseover(event, 'menuProject');" %></li>
|
||||
<% end %>
|
||||
|
||||
<% if loggedin? %>
|
||||
<li><%= link_to l(:label_my_account), { :controller => 'my', :action => 'account' }, :class => "icon icon-user" %></li>
|
||||
<% end %>
|
||||
|
||||
<% if admin_loggedin? %>
|
||||
<li class="submenu"><%= link_to l(:label_administration), { :controller => 'admin' }, :class => "icon icon-admin", :onmouseover => "buttonMouseover(event, 'menuAdmin');" %></li>
|
||||
<% end %>
|
||||
|
||||
<li class="right"><%= link_to l(:label_help), { :controller => 'help', :ctrl => params[:controller], :page => params[:action] }, :onclick => "window.open(this.href); return false;", :class => "icon icon-help" %></li>
|
||||
|
||||
<% if loggedin? %>
|
||||
<li class="right"><%= link_to l(:label_logout), { :controller => 'account', :action => 'logout' }, :class => "icon icon-user" %></li>
|
||||
<% else %>
|
||||
<li class="right"><%= link_to l(:label_login), { :controller => 'account', :action => 'login' }, :class => "icon icon-user" %></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="/settings"><%=l(:label_settings)%></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, :set_filter => 1 }, :class => "menuItem" %>
|
||||
<%= link_to l(:label_report_plural), {:controller => 'reports', :action => 'issue_report', :id => @project }, :class => "menuItem" %>
|
||||
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'activity', :id => @project }, :class => "menuItem" %>
|
||||
<%= link_to l(:label_news_plural), {:controller => 'projects', :action => 'list_news', :id => @project }, :class => "menuItem" %>
|
||||
<%= link_to l(:label_change_log), {:controller => 'projects', :action => 'changelog', :id => @project }, :class => "menuItem" %>
|
||||
<%= link_to l(:label_roadmap), {:controller => 'projects', :action => 'roadmap', :id => @project }, :class => "menuItem" %>
|
||||
<%= link_to l(:label_document_plural), {:controller => 'projects', :action => 'list_documents', :id => @project }, :class => "menuItem" %>
|
||||
<%= link_to l(:label_member_plural), {:controller => 'projects', :action => 'list_members', :id => @project }, :class => "menuItem" %>
|
||||
<%= link_to l(:label_attachment_plural), {:controller => 'projects', :action => 'list_files', :id => @project }, :class => "menuItem" %>
|
||||
<%= 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, :set_filter => 1 %></li>
|
||||
<li><%= link_to l(:label_report_plural), :controller => 'reports', :action => 'issue_report', :id => @project %></li>
|
||||
<li><%= link_to l(:label_activity), :controller => 'projects', :action => 'activity', :id => @project %></li>
|
||||
<li><%= link_to l(:label_news_plural), :controller => 'projects', :action => 'list_news', :id => @project %></li>
|
||||
<li><%= link_to l(:label_change_log), :controller => 'projects', :action => 'changelog', :id => @project %></li>
|
||||
<li><%= link_to l(:label_roadmap), :controller => 'projects', :action => 'roadmap', :id => @project %></li>
|
||||
<li><%= link_to l(:label_document_plural), :controller => 'projects', :action => 'list_documents', :id => @project %></li>
|
||||
<li><%= link_to l(:label_member_plural), :controller => 'projects', :action => 'list_members', :id => @project %></li>
|
||||
<li><%= link_to l(:label_attachment_plural), :controller => 'projects', :action => 'list_files', :id => @project %></li>
|
||||
<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><a href="http://redmine.rubyforge.org/">redMine</a> <small><%= Redmine::VERSION %> © 2006-2007 Jean-Philippe Lang</small></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,6 +0,0 @@
|
||||
<%= @added_to %>
|
||||
<%= @attachments.size %> files(s) added.
|
||||
<% @attachments.each do |attachment | %>
|
||||
- <%= attachment.filename %><% end %>
|
||||
|
||||
<%= @url %>
|
||||
@@ -1,6 +0,0 @@
|
||||
<%= @added_to %>
|
||||
<%= @attachments.size %> files(s) added.
|
||||
<% @attachments.each do |attachment | %>
|
||||
- <%= attachment.filename %><% end %>
|
||||
|
||||
<%= @url %>
|
||||
@@ -1,6 +0,0 @@
|
||||
<%= @added_to %>
|
||||
<%= @attachments.size %> files(s) added.
|
||||
<% @attachments.each do |attachment | %>
|
||||
- <%= attachment.filename %><% end %>
|
||||
|
||||
<%= @url %>
|
||||
@@ -1,6 +0,0 @@
|
||||
<%= @added_to %>
|
||||
<%= @attachments.size %> fichier(s) ajouté(s).
|
||||
<% @attachments.each do |attachment | %>
|
||||
- <%= attachment.filename %><% end %>
|
||||
|
||||
<%= @url %>
|
||||
@@ -1,4 +0,0 @@
|
||||
A document has been added to <%= @document.project.name %> (<%= @document.category.name %>):
|
||||
<%= l(:field_title) %>: <%= @document.title %>
|
||||
|
||||
http://<%= Setting.host_name %>/documents/show/<%= @document.id %>
|
||||
@@ -1,4 +0,0 @@
|
||||
A document has been added to <%= @document.project.name %> (<%= @document.category.name %>):
|
||||
<%= l(:field_title) %>: <%= @document.title %>
|
||||
|
||||
http://<%= Setting.host_name %>/documents/show/<%= @document.id %>
|
||||
@@ -1,4 +0,0 @@
|
||||
A document has been added to <%= @document.project.name %> (<%= @document.category.name %>):
|
||||
<%= l(:field_title) %>: <%= @document.title %>
|
||||
|
||||
http://<%= Setting.host_name %>/documents/show/<%= @document.id %>
|
||||
@@ -1,4 +0,0 @@
|
||||
Un document a été ajouté à <%= @document.project.name %> (<%= @document.category.name %>):
|
||||
<%= l(:field_title) %>: <%= @document.title %>
|
||||
|
||||
http://<%= Setting.host_name %>/documents/show/<%= @document.id %>
|
||||
@@ -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 %>
|
||||
<% 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://<%= Setting.host_name %>/account/lost_password?token=<%= @token.value %>
|
||||
@@ -1,3 +0,0 @@
|
||||
To change your password, use the following link:
|
||||
|
||||
http://<%= Setting.host_name %>/account/lost_password?token=<%= @token.value %>
|
||||
@@ -1,3 +0,0 @@
|
||||
To change your password, use the following link:
|
||||
|
||||
http://<%= Setting.host_name %>/account/lost_password?token=<%= @token.value %>
|
||||
@@ -1,3 +0,0 @@
|
||||
Pour changer votre mot de passe, utilisez le lien suivant:
|
||||
|
||||
http://<%= Setting.host_name %>/account/lost_password?token=<%= @token.value %>
|
||||
@@ -1,3 +0,0 @@
|
||||
To activate your redMine account, use the following link:
|
||||
|
||||
http://<%= Setting.host_name %>/account/register?token=<%= @token.value %>
|
||||
@@ -1,3 +0,0 @@
|
||||
To activate your redMine account, use the following link:
|
||||
|
||||
http://<%= Setting.host_name %>/account/register?token=<%= @token.value %>
|
||||
@@ -1,3 +0,0 @@
|
||||
To activate your redMine account, use the following link:
|
||||
|
||||
http://<%= Setting.host_name %>/account/register?token=<%= @token.value %>
|
||||
@@ -1,3 +0,0 @@
|
||||
Pour activer votre compte sur redMine, utilisez le lien suivant:
|
||||
|
||||
http://<%= Setting.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,46 +0,0 @@
|
||||
<h2><%=l(:label_my_account)%></h2>
|
||||
|
||||
<p><%=l(:field_login)%>: <strong><%= @user.login %></strong><br />
|
||||
<%=l(:field_created_on)%>: <%= format_time(@user.created_on) %></p>
|
||||
|
||||
<%= error_messages_for 'user' %>
|
||||
|
||||
<div class="box">
|
||||
<h3><%=l(:label_information_plural)%></h3>
|
||||
|
||||
<% labelled_tabular_form_for :user, @user, :url => { :action => "account" } do |f| %>
|
||||
|
||||
<p><%= f.text_field :firstname, :required => true %></p>
|
||||
<p><%= f.text_field :lastname, :required => true %></p>
|
||||
<p><%= f.text_field :mail, :required => true, :size => 40 %></p>
|
||||
<p><%= f.select :language, lang_options_for_select %></p>
|
||||
<p><%= f.check_box :mail_notification %></p>
|
||||
|
||||
<% fields_for :pref, @user.pref, :builder => TabularFormBuilder, :lang => current_language do |pref_fields| %>
|
||||
<p><%= pref_fields.check_box :hide_mail %></p>
|
||||
<% end %>
|
||||
|
||||
<center><%= submit_tag l(:button_save) %></center>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
||||
<% unless @user.auth_source_id %>
|
||||
<div class="box">
|
||||
<h3><%=l(:field_password)%></h3>
|
||||
|
||||
<% form_tag({:action => 'change_password'}, :class => "tabular") do %>
|
||||
|
||||
<p><label for="password"><%=l(:field_password)%> <span class="required">*</span></label>
|
||||
<%= password_field_tag 'password', nil, :size => 25 %></p>
|
||||
|
||||
<p><label for="new_password"><%=l(:field_new_password)%> <span class="required">*</span></label>
|
||||
<%= password_field_tag 'new_password', nil, :size => 25 %></p>
|
||||
|
||||
<p><label for="new_password_confirmation"><%=l(:field_password_confirmation)%> <span class="required">*</span></label>
|
||||
<%= password_field_tag 'new_password_confirmation', nil, :size => 25 %></p>
|
||||
|
||||
<center><%= submit_tag l(:button_save) %></center>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -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.png')
|
||||
elsif day == i.start_date
|
||||
image_tag('arrow_from.png')
|
||||
elsif day == i.due_date
|
||||
image_tag('arrow_to.png')
|
||||
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,33 +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|
|
||||
next unless MyController::BLOCKS.keys.include? 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|
|
||||
next unless MyController::BLOCKS.keys.include? 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|
|
||||
next unless MyController::BLOCKS.keys.include? b %>
|
||||
<div class="mypage-box">
|
||||
<%= render :partial => "my/blocks/#{b}", :locals => { :user => @user } %>
|
||||
</div>
|
||||
<% end if @blocks['right'] %>
|
||||
</div>
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
<script language="JavaScript">
|
||||
//<![CDATA[
|
||||
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>
|
||||
<% form_tag({:action => "add_block"}, :id => "block-form") do %>
|
||||
<%= 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')"
|
||||
}, :class => 'icon icon-add'
|
||||
%>
|
||||
<% end %>
|
||||
<%= link_to l(:button_save), {:action => 'page_layout_save'}, :class => 'icon icon-save' %>
|
||||
<%= link_to l(:button_cancel), {:action => 'page'}, :class => 'icon icon-cancel' %>
|
||||
</div>
|
||||
|
||||
<h2><%=l(:label_my_page)%></h2>
|
||||
|
||||
<div id="list-top" class="block-receiver">
|
||||
<% @blocks['top'].each do |b|
|
||||
next unless MyController::BLOCKS.keys.include? b %>
|
||||
<%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %>
|
||||
<% end if @blocks['top'] %>
|
||||
</div>
|
||||
|
||||
<div id="list-left" class="splitcontentleft block-receiver">
|
||||
<% @blocks['left'].each do |b|
|
||||
next unless MyController::BLOCKS.keys.include? b %>
|
||||
<%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %>
|
||||
<% end if @blocks['left'] %>
|
||||
</div>
|
||||
|
||||
<div id="list-right" class="splitcontentright block-receiver">
|
||||
<% @blocks['right'].each do |b|
|
||||
next unless MyController::BLOCKS.keys.include? b %>
|
||||
<%= 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>
|
||||
|
||||
<% if Setting.text_formatting == 'textile' %>
|
||||
<%= 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,33 +0,0 @@
|
||||
<div class="contextual">
|
||||
<%= link_to_if_authorized l(:button_edit), {:controller => 'news', :action => 'edit', :id => @news}, :class => 'icon icon-edit' %>
|
||||
<%= link_to_if_authorized l(:button_delete), {:controller => 'news', :action => 'destroy', :id => @news}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
|
||||
</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="icon22 icon22-comment"><%= l(:label_comment_plural) %></h3>
|
||||
<% @news.comments.each do |comment| %>
|
||||
<% next if comment.new_record? %>
|
||||
<h4><%= format_time(comment.created_on) %> - <%= comment.author.name %></h4>
|
||||
<div class="contextual">
|
||||
<%= link_to_if_authorized l(:button_delete), {:controller => 'news', :action => 'destroy_comment', :id => @news, :comment_id => comment}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
|
||||
</div>
|
||||
<%= simple_format(auto_link(h comment.comment))%>
|
||||
<% end if @news.comments_count > 0 %>
|
||||
</div>
|
||||
|
||||
<% if authorize_for 'news', 'add_comment' %>
|
||||
<% form_tag({:action => 'add_comment', :id => @news}) do %>
|
||||
<%= error_messages_for 'comment' %>
|
||||
<p><label for="comment_comment"><%= l(:label_comment_add) %></label><br />
|
||||
<%= text_area 'comment', 'comment', :cols => 60, :rows => 6 %></p>
|
||||
<%= submit_tag l(:button_add) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -1,44 +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>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'calendar/calendar' %>
|
||||
<%= javascript_include_tag "calendar/lang/calendar-#{current_language}.js" %>
|
||||
<%= javascript_include_tag 'calendar/calendar-setup' %>
|
||||
<%= stylesheet_link_tag 'calendar' %>
|
||||
<% end %>
|
||||
@@ -1,59 +0,0 @@
|
||||
<h2><%=l(:label_activity)%>: <%= "#{month_name(@month).downcase} #{@year}" %></h2>
|
||||
|
||||
<div>
|
||||
<div class="rightbox">
|
||||
<% form_tag do %>
|
||||
<p><%= select_month(@month, :prefix => "month", :discard_type => true) %>
|
||||
<%= select_year(@year, :prefix => "year", :discard_type => true) %></p>
|
||||
<p>
|
||||
<%= check_box_tag 'show_issues', 1, @show_issues %><%= hidden_field_tag 'show_issues', 0, :id => nil %> <%=l(:label_issue_plural)%><br />
|
||||
<%= check_box_tag 'show_news', 1, @show_news %><%= hidden_field_tag 'show_news', 0, :id => nil %> <%=l(:label_news_plural)%><br />
|
||||
<%= check_box_tag 'show_files', 1, @show_files %><%= hidden_field_tag 'show_files', 0, :id => nil %> <%=l(:label_attachment_plural)%><br />
|
||||
<%= check_box_tag 'show_documents', 1, @show_documents %><%= hidden_field_tag 'show_documents', 0, :id => nil %> <%=l(:label_document_plural)%>
|
||||
</p>
|
||||
<p class="textcenter"><%= submit_tag l(:button_apply), :class => 'button-small' %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% @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>
|
||||
|
||||
<% form_tag( { :action => 'add_document', :id => @project }, :class => "tabular", :multipart => true) do %>
|
||||
<%= render :partial => 'documents/form' %>
|
||||
|
||||
<div class="box">
|
||||
<p id="attachments_p"><label for="attachment_file"><%=l(:label_attachment)%>
|
||||
<%= image_to_function "add.png", "addFileField();return false" %></label>
|
||||
<%= file_field_tag 'attachments[]', :size => 30 %> <em>(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)</em></p>
|
||||
</div>
|
||||
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
<h2><%=l(:label_attachment_new)%></h2>
|
||||
|
||||
<%= error_messages_for 'attachment' %>
|
||||
<div class="box">
|
||||
<% form_tag({ :action => 'add_file', :id => @project }, :multipart => true, :class => "tabular") do %>
|
||||
|
||||
<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)%>
|
||||
<%= image_to_function "add.png", "addFileField();return false" %></label>
|
||||
<%= file_field_tag 'attachments[]', :size => 30 %> <em>(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)</em></p>
|
||||
</div>
|
||||
<%= submit_tag l(:button_add) %>
|
||||
<% end %>
|
||||
@@ -1,57 +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)%>
|
||||
<%= image_to_function "add.png", "addFileField();return false" %></label>
|
||||
<%= file_field_tag 'attachments[]', :size => 30 %> <em>(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)</em></p>
|
||||
|
||||
</div>
|
||||
<!--[eoform:issue]-->
|
||||
</div>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<% end %>
|
||||
|
||||
<% if Setting.text_formatting == 'textile' %>
|
||||
<%= 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 %>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'calendar/calendar' %>
|
||||
<%= javascript_include_tag "calendar/lang/calendar-#{current_language}.js" %>
|
||||
<%= javascript_include_tag 'calendar/calendar-setup' %>
|
||||
<%= stylesheet_link_tag 'calendar' %>
|
||||
<% end %>
|
||||
@@ -1,6 +0,0 @@
|
||||
<h2><%= l(:label_query_new) %></h2>
|
||||
|
||||
<% form_tag({:action => 'add_query', :id => @project}) do %>
|
||||
<%= render :partial => 'queries/form', :locals => {:query => @query} %>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<% end %>
|
||||
@@ -1,74 +0,0 @@
|
||||
<h2><%= l(:label_calendar) %></h2>
|
||||
|
||||
<% form_tag({:action => 'calendar', :id => @project}) do %>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td align="left" style="width:150px">
|
||||
<%= 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">
|
||||
<%= select_month(@month, :prefix => "month", :discard_type => true) %>
|
||||
<%= select_year(@year, :prefix => "year", :discard_type => true) %>
|
||||
<%= submit_tag l(:button_submit), :class => "button-small" %>
|
||||
</td>
|
||||
<td align="right" style="width:150px">
|
||||
<%= 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>
|
||||
<% end %>
|
||||
<br />
|
||||
|
||||
<table class="list with-cells">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<% 1.upto(7) do |d| %>
|
||||
<th style="width:14%"><%= day_name(d) %></th>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr style="height:100px">
|
||||
<% day = @date_from
|
||||
while day <= @date_to
|
||||
if day.cwday == 1 %>
|
||||
<th><%= day.cweek %></th>
|
||||
<% end %>
|
||||
<td valign="top" class="<%= day.month==@month ? "even" : "odd" %>" style="width:14%; <%= Date.today == day ? 'background:#FDFED0;' : '' %>">
|
||||
<p class="textright"><%= 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| %>
|
||||
<div class="tooltip">
|
||||
<%= if day == i.start_date and day == i.due_date
|
||||
image_tag('arrow_bw.png')
|
||||
elsif day == i.start_date
|
||||
image_tag('arrow_from.png')
|
||||
elsif day == i.due_date
|
||||
image_tag('arrow_to.png')
|
||||
end %>
|
||||
<small><%= link_to "#{i.tracker.name} ##{i.id}", { :controller => 'issues', :action => 'show', :id => i } %>: <%=h i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)') %></small>
|
||||
<span class="tip">
|
||||
<%= render :partial => "issues/tooltip", :locals => { :issue => i }%>
|
||||
</span>
|
||||
</div>
|
||||
<% end %>
|
||||
</td>
|
||||
<%= '</tr><tr style="height:100px">' if day.cwday >= 7 and day!=@date_to %>
|
||||
<%
|
||||
day = day + 1
|
||||
end %>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= image_tag 'arrow_from.png' %> <%= l(:text_tip_task_begin_day) %><br />
|
||||
<%= image_tag 'arrow_to.png' %> <%= l(:text_tip_task_end_day) %><br />
|
||||
<%= image_tag 'arrow_bw.png' %> <%= l(:text_tip_task_begin_end_day) %><br />
|
||||
@@ -1,30 +0,0 @@
|
||||
<h2><%=l(:label_change_log)%></h2>
|
||||
|
||||
<div>
|
||||
|
||||
<div class="rightbox" style="width:140px;">
|
||||
<% form_tag do %>
|
||||
<p><strong><%=l(:label_tracker_plural)%></strong></p>
|
||||
<% @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 %>
|
||||
</div>
|
||||
|
||||
<% if @fixed_issues.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %>
|
||||
|
||||
<% ver_id = nil
|
||||
@fixed_issues.each do |issue| %>
|
||||
<% unless ver_id == issue.fixed_version_id %>
|
||||
<% if ver_id %></ul><% end %>
|
||||
<h3 class="icon22 icon22-package"><%= 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,49 +0,0 @@
|
||||
<% pdf=IfpdfHelper::IFPDF.new
|
||||
pdf.SetTitle("#{@project.name} - #{l(:label_issue_plural)}")
|
||||
pdf.AliasNbPages
|
||||
pdf.footer_date = format_date(Date.today)
|
||||
pdf.AddPage("L")
|
||||
row_height = 7
|
||||
|
||||
#
|
||||
# title
|
||||
#
|
||||
pdf.SetFont('Arial','B',11)
|
||||
pdf.Cell(190,10, "#{@project.name} - #{l(:label_issue_plural)}")
|
||||
pdf.Ln
|
||||
|
||||
#
|
||||
# headers
|
||||
#
|
||||
pdf.SetFont('Arial','B',10)
|
||||
pdf.SetFillColor(230, 230, 230)
|
||||
pdf.Cell(15, row_height, "#", 0, 0, 'L', 1)
|
||||
pdf.Cell(30, row_height, l(:field_tracker), 0, 0, 'L', 1)
|
||||
pdf.Cell(30, row_height, l(:field_status), 0, 0, 'L', 1)
|
||||
pdf.Cell(30, row_height, l(:field_priority), 0, 0, 'L', 1)
|
||||
pdf.Cell(40, row_height, l(:field_author), 0, 0, 'L', 1)
|
||||
pdf.Cell(25, row_height, l(:field_updated_on), 0, 0, 'L', 1)
|
||||
pdf.Cell(0, row_height, l(:field_subject), 0, 0, 'L', 1)
|
||||
pdf.Line(10, pdf.GetY, 287, pdf.GetY)
|
||||
pdf.Ln
|
||||
pdf.Line(10, pdf.GetY, 287, pdf.GetY)
|
||||
pdf.SetY(pdf.GetY() + 1)
|
||||
|
||||
#
|
||||
# rows
|
||||
#
|
||||
pdf.SetFont('Arial','',9)
|
||||
pdf.SetFillColor(255, 255, 255)
|
||||
@issues.each do |issue|
|
||||
pdf.Cell(15, row_height, issue.id.to_s, 0, 0, 'L', 1)
|
||||
pdf.Cell(30, row_height, issue.tracker.name, 0, 0, 'L', 1)
|
||||
pdf.Cell(30, row_height, issue.status.name, 0, 0, 'L', 1)
|
||||
pdf.Cell(30, row_height, issue.priority.name, 0, 0, 'L', 1)
|
||||
pdf.Cell(40, row_height, issue.author.name, 0, 0, 'L', 1)
|
||||
pdf.Cell(25, row_height, format_date(issue.updated_on), 0, 0, 'L', 1)
|
||||
pdf.MultiCell(0, row_height, issue.subject)
|
||||
pdf.Line(10, pdf.GetY, 287, pdf.GetY)
|
||||
pdf.SetY(pdf.GetY() + 1)
|
||||
end
|
||||
%>
|
||||
<%= pdf.Output %>
|
||||
@@ -1,169 +0,0 @@
|
||||
<%
|
||||
pdf=IfpdfHelper::IFPDF.new
|
||||
pdf.SetTitle("#{@project.name} - #{l(:label_gantt)}")
|
||||
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,215 +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 => 'icon icon-pdf' %>
|
||||
</div>
|
||||
|
||||
<h2><%= l(:label_gantt) %></h2>
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td align="left">
|
||||
<% form_tag do %>
|
||||
<p>
|
||||
<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" %>
|
||||
</p>
|
||||
<% end %>
|
||||
</td>
|
||||
<td align="right">
|
||||
<%= if @zoom < 4
|
||||
link_to image_tag('zoom_in.png'), {:zoom => (@zoom+1), :year => @year_from, :month => @month_from, :months => @months}
|
||||
else
|
||||
image_tag 'zoom_in_g.png'
|
||||
end %>
|
||||
<%= if @zoom > 1
|
||||
link_to image_tag('zoom_out.png'), :zoom => (@zoom-1), :year => @year_from, :month => @month_from, :months => @months
|
||||
else
|
||||
image_tag 'zoom_out_g.png'
|
||||
end %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
|
||||
<% 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)+150, 206].max
|
||||
t_height = g_height + headers_heigth
|
||||
%>
|
||||
|
||||
<table width="100%" style="border:0; border-collapse: collapse;">
|
||||
<tr>
|
||||
<td style="width:260px;">
|
||||
|
||||
<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="gantt_hdr"></div>
|
||||
<div style="right:-2px;width:<%= subject_width %>px;height:<%= t_height %>px;border-left: 1px solid #c0c0c0;overflow:hidden;" class="gantt_hdr"></div>
|
||||
<%
|
||||
#
|
||||
# Tasks subjects
|
||||
#
|
||||
top = headers_heigth + 8
|
||||
@issues.each do |i| %>
|
||||
<div style="position: absolute;line-height:1.2em;height:16px;top:<%= top %>px;left:4px;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;overflow:auto;">
|
||||
<div style="width:<%= g_width-1 %>px;height:<%= headers_heigth %>px;background: #eee;" class="gantt_hdr"> </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="gantt_hdr">
|
||||
<%= 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="gantt_hdr"> </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="gantt_hdr">
|
||||
<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="gantt_hdr">
|
||||
<%= 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 + 10
|
||||
@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 - 2 # total width of the issue (- 2 for left and right borders)
|
||||
d_width = ((i_done_date - i_start_date)*zoom).floor - 2 # done width
|
||||
l_width = i_late_date ? ((i_late_date - i_start_date+1)*zoom).floor - 2 : 0 # delay width
|
||||
%>
|
||||
<div style="top:<%= top %>px;left:<%= i_left %>px;width:<%= i_width %>px;" class="task task_todo"> </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>
|
||||
<% # === tooltip === %>
|
||||
<div class="tooltip" style="position: absolute;top:<%= top %>px;left:<%= i_left %>px;width:<%= i_width %>px;height:12px;">
|
||||
<span class="tip">
|
||||
<%= render :partial => "issues/tooltip", :locals => { :issue => i }%>
|
||||
</span></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 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 => 'icon icon-add' %>
|
||||
</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,84 +0,0 @@
|
||||
<% if @query.new_record? %>
|
||||
<div class="contextual">
|
||||
<%= render :partial => 'issues/add_shortcut', :locals => {:trackers => @trackers } %>
|
||||
</div>
|
||||
<h2><%=l(:label_issue_plural)%></h2>
|
||||
|
||||
<% form_tag({:action => 'list_issues'}, :id => 'query_form') do %>
|
||||
<%= render :partial => 'queries/filters', :locals => {:query => @query} %>
|
||||
<% end %>
|
||||
<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 => 'icon icon-edit' %>
|
||||
|
||||
<%= link_to l(:button_clear), {:controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1}, :class => 'icon icon-del' %>
|
||||
<% 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 => 'icon icon-save' %>
|
||||
<% 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 => 'icon icon-edit' %>
|
||||
<%= link_to l(:button_delete), {:controller => 'queries', :action => 'destroy', :id => @query}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
|
||||
<% 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 %>
|
||||
|
||||
<% form_tag({:controller => 'projects', :action => 'move_issues', :id => @project}, :id => 'issues_form' ) do %>
|
||||
<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)) %>
|
||||
<%= sort_header_tag('issues.priority_id', :caption => l(:field_priority)) %>
|
||||
<th><%=l(:field_subject)%></th>
|
||||
<%= sort_header_tag('users.lastname', :caption => l(:field_author)) %>
|
||||
<%= sort_header_tag('issues.updated_on', :caption => l(:field_updated_on)) %>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<% for issue in @issues %>
|
||||
<tr class="<%= cycle("odd", "even") %>">
|
||||
<th style="width:15px;"><%= check_box_tag "issue_ids[]", issue.id, false, :id => "issue_#{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 align="center"><%= issue.priority.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.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 icon-csv' %>,
|
||||
<%= link_to 'PDF', {:action => 'export_issues_pdf', :id => @project}, :class => 'icon icon-pdf' %>
|
||||
</div>
|
||||
<p><%= submit_tag l(:button_move), :class => "button-small" %>
|
||||
|
||||
<%= pagination_links_full @issue_pages %>
|
||||
[ <%= @issue_pages.current.first_item %> - <%= @issue_pages.current.last_item %> / <%= @issue_count %> ]
|
||||
</p>
|
||||
<% end %>
|
||||
<% 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 => 'icon icon-add' %>
|
||||
</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>
|
||||
|
||||
|
||||
<% form_tag({:action => 'move_issues', :id => @project}, :class => "tabular") do %>
|
||||
|
||||
<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 %>
|
||||
@@ -1,28 +0,0 @@
|
||||
<h2><%=l(:label_roadmap)%></h2>
|
||||
|
||||
<div>
|
||||
|
||||
<div class="rightbox" style="width:140px;">
|
||||
<% form_tag do %>
|
||||
<p><strong><%=l(:label_tracker_plural)%></strong></p>
|
||||
<% @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 %>
|
||||
</div>
|
||||
|
||||
<% if @versions.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %>
|
||||
|
||||
<% @versions.each do |version| %>
|
||||
<h3 class="icon22 icon22-package"><%= version.name %></h3>
|
||||
<p><%= format_date(version.effective_date) %><br />
|
||||
<%=h version.description %></p>
|
||||
<ul>
|
||||
<% version.fixed_issues.find(:all, :conditions => ["issues.tracker_id in (#{@selected_tracker_ids.join(',')})"]).each do |issue| %>
|
||||
<li><%= link_to "#{issue.tracker.name} #{issue.id}", :controller => 'issues', :action => 'show', :id => issue %>: <%=h issue.subject %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -1,115 +0,0 @@
|
||||
<h2><%=l(:label_settings)%></h2>
|
||||
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li><%= link_to l(:label_information_plural), {}, :id=> "tab-info", :onclick => "showTab('info'); this.blur(); return false;" %></li>
|
||||
<li><%= link_to l(:label_member_plural), {}, :id=> "tab-members", :onclick => "showTab('members'); this.blur(); return false;" %></li>
|
||||
<li><%= link_to l(:label_version_plural), {}, :id=> "tab-versions", :onclick => "showTab('versions'); this.blur(); return false;" %></li>
|
||||
<li><%= link_to l(:label_issue_category_plural), {}, :id=> "tab-categories", :onclick => "showTab('categories'); this.blur(); return false;" %></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="tab-content-info" class="tab-content">
|
||||
<% 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 %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div id="tab-content-members" class="tab-content" style="display:none;">
|
||||
<%= error_messages_for 'member' %>
|
||||
<table class="list">
|
||||
<thead><th><%= l(:label_user) %></th><th><%= l(:label_role) %></th><th></th></thead>
|
||||
<tbody>
|
||||
<% @project.members.find(:all, :include => [:role, :user]).sort{|x,y| x.role.position <=> y.role.position}.each do |member| %>
|
||||
<% unless member.new_record? %>
|
||||
<tr class="<%= cycle 'odd', 'even' %>">
|
||||
<td><%= member.user.display_name %></td>
|
||||
<td align="center">
|
||||
<% if authorize_for('members', 'edit') %>
|
||||
<% form_tag({:controller => 'members', :action => 'edit', :id => member}) do %>
|
||||
<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 %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= link_to_if_authorized l(:button_delete), {:controller => 'members', :action => 'destroy', :id => member}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
<% end; reset_cycle %>
|
||||
</table>
|
||||
<% if authorize_for('projects', 'add_member') %>
|
||||
<label><%=l(:label_member_new)%></label><br/>
|
||||
<% form_tag({:controller => 'projects', :action => 'add_member', :tab => 'members', :id => @project}) do %>
|
||||
<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 %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div id="tab-content-versions" class="tab-content" style="display:none;">
|
||||
<table class="list">
|
||||
<thead><th><%= l(:label_version) %></th><th><%= l(:field_effective_date) %></th><th><%= l(:field_description) %></th><th></th><th></th></thead>
|
||||
<tbody>
|
||||
<% for version in @project.versions %>
|
||||
<tr class="<%= cycle 'odd', 'even' %>">
|
||||
<td><%=h version.name %></td>
|
||||
<td align="center"><%= format_date(version.effective_date) %></td>
|
||||
<td><%=h version.description %></td>
|
||||
<td align="center"><%= link_to_if_authorized l(:button_edit), { :controller => 'versions', :action => 'edit', :id => version }, :class => 'icon icon-edit' %></td>
|
||||
<td align="center"><%= link_to_if_authorized l(:button_delete), {:controller => 'versions', :action => 'destroy', :id => version}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %></td>
|
||||
</td>
|
||||
</tr>
|
||||
<% end; reset_cycle %>
|
||||
</tbody>
|
||||
</table>
|
||||
<%= link_to_if_authorized l(:label_version_new), :controller => 'projects', :action => 'add_version', :id => @project %>
|
||||
</div>
|
||||
|
||||
<div id="tab-content-categories" class="tab-content" style="display:none;">
|
||||
<table class="list">
|
||||
<thead><th><%= l(:label_issue_category) %></th><th></th></thead>
|
||||
<tbody>
|
||||
<% for @category in @project.issue_categories %>
|
||||
<% unless @category.new_record? %>
|
||||
<tr class="<%= cycle 'odd', 'even' %>">
|
||||
<td>
|
||||
<% form_tag({:controller => 'issue_categories', :action => 'edit', :id => @category}) do %>
|
||||
<%= text_field 'category', 'name', :size => 25 %>
|
||||
<% if authorize_for('issue_categories', 'edit') %>
|
||||
<%= submit_tag l(:button_save), :class => "button-small" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= link_to_if_authorized l(:button_delete), {:controller => 'issue_categories', :action => 'destroy', :id => @category}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% if authorize_for('projects', 'add_issue_category') %>
|
||||
<% form_tag({:action => 'add_issue_category', :tab => 'categories', :id => @project}) do %>
|
||||
<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 %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= tab = params[:tab] ? h(params[:tab]) : 'info'
|
||||
javascript_tag "showTab('#{tab}');" %>
|
||||
@@ -1,55 +0,0 @@
|
||||
<h2><%=l(:label_overview)%></h2>
|
||||
|
||||
<div class="splitcontentleft">
|
||||
<%= simple_format(auto_link(h(@project.description))) %>
|
||||
<ul>
|
||||
<% unless @project.homepage.empty? %><li><%=l(:field_homepage)%>: <%= auto_link @project.homepage %></li><% end %>
|
||||
<li><%=l(:field_created_on)%>: <%= format_date(@project.created_on) %></li>
|
||||
<% for custom_value in @custom_values %>
|
||||
<% if !custom_value.value.empty? %>
|
||||
<li><%= custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<div class="box">
|
||||
<div class="contextual">
|
||||
<%= render :partial => 'issues/add_shortcut', :locals => {:trackers => @trackers } %>
|
||||
</div>
|
||||
<h3 class="icon22 icon22-tracker"><%=l(:label_tracker_plural)%></h3>
|
||||
<ul>
|
||||
<% for tracker in @trackers %>
|
||||
<li><%= link_to tracker.name, :controller => 'projects', :action => 'list_issues', :id => @project,
|
||||
:set_filter => 1,
|
||||
"tracker_id" => tracker.id %>:
|
||||
<%= @open_issues_by_tracker[tracker] || 0 %> <%= lwr(:label_open_issues, @open_issues_by_tracker[tracker] || 0) %>
|
||||
<%= l(:label_on) %> <%= @total_issues_by_tracker[tracker] || 0 %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<p class="textcenter"><small><%= link_to l(:label_issue_view_all), :controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1 %></small></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="splitcontentright">
|
||||
<div class="box">
|
||||
<h3 class="icon22 icon22-users"><%=l(:label_member_plural)%></h3>
|
||||
<% for member in @members %>
|
||||
<%= link_to_user member.user %> (<%= member.role.name %>)<br />
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% if @subprojects %>
|
||||
<div class="box">
|
||||
<h3 class="icon22 icon22-projects"><%=l(:label_subproject_plural)%></h3>
|
||||
<% for subproject in @subprojects %>
|
||||
<%= link_to subproject.name, :action => 'show', :id => subproject %><br />
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="box">
|
||||
<h3><%=l(:label_news_latest)%></h3>
|
||||
<%= render :partial => 'news/news', :collection => @news %>
|
||||
<p class="textcenter"><small><%= link_to l(:label_news_view_all), :controller => 'projects', :action => 'list_news', :id => @project %></small></p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,100 +0,0 @@
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
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("div_values_" + field);
|
||||
}
|
||||
}
|
||||
|
||||
function toggle_operator(field) {
|
||||
operator = $("operators_" + field);
|
||||
switch (operator.value) {
|
||||
case "!*":
|
||||
case "*":
|
||||
case "t":
|
||||
case "o":
|
||||
case "c":
|
||||
Element.hide("div_values_" + field);
|
||||
break;
|
||||
default:
|
||||
Element.show("div_values_" + 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%">
|
||||
<tr>
|
||||
<td>
|
||||
<table style="padding:0;">
|
||||
<% 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" style="width:200px;">
|
||||
<%= 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" style="width:150px;">
|
||||
<%= select_tag "operators[#{field}]", options_for_select(operators_for_select(options[:type]), query.operator_for(field)), :id => "operators_#{field}", :onchange => "toggle_operator('#{field}');", :class => "select-small", :style => "vertical-align: top;" %>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<div id="div_values_<%= 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.png'), "toggle_multi_select('#{field}');" %>
|
||||
<% when :date, :date_past %>
|
||||
<%= text_field_tag "values[#{field}][]", query.values_for(field), :id => "values_#{field}", :size => 3, :class => "select-small" %> <%= l(:label_day_plural) %>
|
||||
<% when :text %>
|
||||
<%= text_field_tag "values[#{field}][]", query.values_for(field), :id => "values_#{field}", :size => 30, :class => "select-small" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<script type="text/javascript">toggle_filter('<%= field %>');</script>
|
||||
</td>
|
||||
</tr>
|
||||
<% 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>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user