mirror of
https://github.com/meineerde/redmine.git
synced 2026-03-14 13:08:14 +00:00
r18452@gaspard (orig r1723): jplang | 2008-08-07 21:59:02 +0200
Slight change to engines to let plugins override views. r18456@gaspard (orig r1727): jplang | 2008-08-10 17:22:54 +0200 Moves @layout 'base'@ to ApplicationController. r18457@gaspard (orig r1728): jplang | 2008-08-10 23:35:03 +0200 Quote ids for attachment association since Trac's attachment.id is varchar (#1759). r18458@gaspard (orig r1729): jplang | 2008-08-11 00:18:23 +0200 Adds links to forum messages using message#id syntax (#1756). r18459@gaspard (orig r1730): jplang | 2008-08-11 20:09:54 +0200 Allow same name for custom fields on different object types. r18460@gaspard (orig r1731): jplang | 2008-08-11 20:24:39 +0200 Fixes custom fields display order at several places (#1768). r18461@gaspard (orig r1732): edavis10 | 2008-08-11 22:49:52 +0200 Added doc/README_FOR_APP so RDoc can be built. (#1769) r18462@gaspard (orig r1733): jplang | 2008-08-11 22:55:17 +0200 Adds 'Edit' link on account/show for admin users. r18463@gaspard (orig r1734): jplang | 2008-08-11 23:02:36 +0200 Adds Lock/Unlock/Activate link on user edit screen. r18464@gaspard (orig r1735): jplang | 2008-08-11 23:10:24 +0200 Adds user count in status drop down on admin user list. r18472@gaspard (orig r1743): edavis10 | 2008-08-13 05:54:54 +0200 Added missing documentation for setting up the Darcs test repository. r18473@gaspard (orig r1744): edavis10 | 2008-08-13 06:20:16 +0200 Added rake tasks to generate rcov code coverage reports. rake -T test:coverage to see them all r18474@gaspard (orig r1745): edavis10 | 2008-08-13 06:20:23 +0200 Extracted rcov options and removed gems from the rcov report. r18476@gaspard (orig r1747): jplang | 2008-08-15 20:44:46 +0200 No warning about rcov each time a rake task is ran. r18477@gaspard (orig r1748): edavis10 | 2008-08-20 06:26:46 +0200 Javascripts are now cached into a single file for downloads in production mode. Thanks to Philippe Lafoucrière for the patch. (#1186) r18478@gaspard (orig r1749): edavis10 | 2008-08-20 07:09:13 +0200 Hiding the View Differences button when a wiki page's history only has one version. Patch contributed by Chaoqun Zou (#1743) r18479@gaspard (orig r1750): edavis10 | 2008-08-20 08:14:44 +0200 Messages on a Board can now be sorted by the number of replies. #1761 r18480@gaspard (orig r1751): edavis10 | 2008-08-20 08:21:06 +0200 Added the "Status:" keyword to the MailHandler for setting and changing an Issue status via email. #1669 git-svn-id: http://redmine.rubyforge.org/svn/branches/work@1752 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
ef26e2e0ba
commit
ab83ed5d8e
@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class AccountController < ApplicationController
|
||||
layout 'base'
|
||||
helper :custom_fields
|
||||
include CustomFieldsHelper
|
||||
|
||||
@ -26,7 +25,7 @@ class AccountController < ApplicationController
|
||||
# Show user's account
|
||||
def show
|
||||
@user = User.find_active(params[:id])
|
||||
@custom_values = @user.custom_values.find(:all, :include => :custom_field)
|
||||
@custom_values = @user.custom_values
|
||||
|
||||
# show only public projects and private projects that the logged in user is also a member of
|
||||
@memberships = @user.memberships.select do |membership|
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class AdminController < ApplicationController
|
||||
layout 'base'
|
||||
before_filter :require_admin
|
||||
|
||||
helper :sort
|
||||
|
||||
@ -18,6 +18,8 @@
|
||||
require 'uri'
|
||||
|
||||
class ApplicationController < ActionController::Base
|
||||
layout 'base'
|
||||
|
||||
before_filter :user_setup, :check_if_login_required, :set_localization
|
||||
filter_parameter_logging :password
|
||||
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class AttachmentsController < ApplicationController
|
||||
layout 'base'
|
||||
before_filter :find_project
|
||||
|
||||
def show
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class AuthSourcesController < ApplicationController
|
||||
layout 'base'
|
||||
before_filter :require_admin
|
||||
|
||||
def index
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class BoardsController < ApplicationController
|
||||
layout 'base'
|
||||
before_filter :find_project, :authorize
|
||||
|
||||
helper :messages
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class CustomFieldsController < ApplicationController
|
||||
layout 'base'
|
||||
before_filter :require_admin
|
||||
|
||||
def index
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class DocumentsController < ApplicationController
|
||||
layout 'base'
|
||||
before_filter :find_project, :only => [:index, :new]
|
||||
before_filter :find_document, :except => [:index, :new]
|
||||
before_filter :authorize
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class EnumerationsController < ApplicationController
|
||||
layout 'base'
|
||||
before_filter :require_admin
|
||||
|
||||
def index
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class IssueCategoriesController < ApplicationController
|
||||
layout 'base'
|
||||
menu_item :settings
|
||||
before_filter :find_project, :authorize
|
||||
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class IssueRelationsController < ApplicationController
|
||||
layout 'base'
|
||||
before_filter :find_project, :authorize
|
||||
|
||||
def new
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class IssueStatusesController < ApplicationController
|
||||
layout 'base'
|
||||
before_filter :require_admin
|
||||
|
||||
verify :method => :post, :only => [ :destroy, :create, :update, :move ],
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class IssuesController < ApplicationController
|
||||
layout 'base'
|
||||
menu_item :new_issue, :only => :new
|
||||
|
||||
before_filter :find_issue, :only => [:show, :edit, :reply, :destroy_attachment]
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class JournalsController < ApplicationController
|
||||
layout 'base'
|
||||
before_filter :find_journal
|
||||
|
||||
def edit
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class MembersController < ApplicationController
|
||||
layout 'base'
|
||||
before_filter :find_member, :except => :new
|
||||
before_filter :find_project, :only => :new
|
||||
before_filter :authorize
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class MessagesController < ApplicationController
|
||||
layout 'base'
|
||||
menu_item :boards
|
||||
before_filter :find_board, :only => [:new, :preview]
|
||||
before_filter :find_message, :except => [:new, :preview]
|
||||
|
||||
@ -16,11 +16,10 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class MyController < ApplicationController
|
||||
helper :issues
|
||||
|
||||
layout 'base'
|
||||
before_filter :require_login
|
||||
|
||||
helper :issues
|
||||
|
||||
BLOCKS = { 'issuesassignedtome' => :label_assigned_to_me_issues,
|
||||
'issuesreportedbyme' => :label_reported_issues,
|
||||
'issueswatched' => :label_watched_issues,
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class NewsController < ApplicationController
|
||||
layout 'base'
|
||||
before_filter :find_news, :except => [:new, :index, :preview]
|
||||
before_filter :find_project, :only => [:new, :preview]
|
||||
before_filter :authorize, :except => [:index, :preview]
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class ProjectsController < ApplicationController
|
||||
layout 'base'
|
||||
menu_item :overview
|
||||
menu_item :activity, :only => :activity
|
||||
menu_item :roadmap, :only => :roadmap
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class QueriesController < ApplicationController
|
||||
layout 'base'
|
||||
menu_item :issues
|
||||
before_filter :find_query, :except => :new
|
||||
before_filter :find_optional_project, :only => :new
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class ReportsController < ApplicationController
|
||||
layout 'base'
|
||||
menu_item :issues
|
||||
before_filter :find_project, :authorize
|
||||
|
||||
|
||||
@ -23,7 +23,6 @@ class ChangesetNotFound < Exception; end
|
||||
class InvalidRevisionParam < Exception; end
|
||||
|
||||
class RepositoriesController < ApplicationController
|
||||
layout 'base'
|
||||
menu_item :repository
|
||||
before_filter :find_repository, :except => :edit
|
||||
before_filter :find_project, :only => :edit
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class RolesController < ApplicationController
|
||||
layout 'base'
|
||||
before_filter :require_admin
|
||||
|
||||
verify :method => :post, :only => [ :destroy, :move ],
|
||||
|
||||
@ -16,8 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class SearchController < ApplicationController
|
||||
layout 'base'
|
||||
|
||||
before_filter :find_optional_project
|
||||
|
||||
helper :messages
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class SettingsController < ApplicationController
|
||||
layout 'base'
|
||||
before_filter :require_admin
|
||||
|
||||
def index
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class TimelogController < ApplicationController
|
||||
layout 'base'
|
||||
menu_item :issues
|
||||
before_filter :find_project, :authorize
|
||||
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class TrackersController < ApplicationController
|
||||
layout 'base'
|
||||
before_filter :require_admin
|
||||
|
||||
def index
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class UsersController < ApplicationController
|
||||
layout 'base'
|
||||
before_filter :require_admin
|
||||
|
||||
helper :sort
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class VersionsController < ApplicationController
|
||||
layout 'base'
|
||||
menu_item :roadmap
|
||||
before_filter :find_project, :authorize
|
||||
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class WatchersController < ApplicationController
|
||||
layout 'base'
|
||||
before_filter :find_project
|
||||
before_filter :require_login, :check_project_privacy, :only => [:watch, :unwatch]
|
||||
before_filter :authorize, :only => :new
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class WelcomeController < ApplicationController
|
||||
layout 'base'
|
||||
|
||||
def index
|
||||
@news = News.latest User.current
|
||||
|
||||
@ -18,7 +18,6 @@
|
||||
require 'diff'
|
||||
|
||||
class WikiController < ApplicationController
|
||||
layout 'base'
|
||||
before_filter :find_wiki, :authorize
|
||||
|
||||
verify :method => :post, :only => [:destroy, :destroy_attachment, :protect], :redirect_to => { :action => :index }
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class WikisController < ApplicationController
|
||||
layout 'base'
|
||||
menu_item :settings
|
||||
before_filter :find_project, :authorize
|
||||
|
||||
|
||||
@ -319,7 +319,9 @@ module ApplicationHelper
|
||||
# source:some/file#L120 -> Link to line 120 of the file
|
||||
# source:some/file@52#L120 -> Link to line 120 of the file's revision 52
|
||||
# export:some/file -> Force the download of the file
|
||||
text = text.gsub(%r{([\s\(,\-\>]|^)(!)?(attachment|document|version|commit|source|export)?((#|r)(\d+)|(:)([^"\s<>][^\s<>]*?|"[^"]+?"))(?=(?=[[:punct:]]\W)|\s|<|$)}) do |m|
|
||||
# Forum messages:
|
||||
# message#1218 -> Link to message with id 1218
|
||||
text = text.gsub(%r{([\s\(,\-\>]|^)(!)?(attachment|document|version|commit|source|export|message)?((#|r)(\d+)|(:)([^"\s<>][^\s<>]*?|"[^"]+?"))(?=(?=[[:punct:]]\W)|\s|<|$)}) do |m|
|
||||
leading, esc, prefix, sep, oid = $1, $2, $3, $5 || $7, $6 || $8
|
||||
link = nil
|
||||
if esc.nil?
|
||||
@ -349,6 +351,16 @@ module ApplicationHelper
|
||||
link = link_to h(version.name), {:only_path => only_path, :controller => 'versions', :action => 'show', :id => version},
|
||||
:class => 'version'
|
||||
end
|
||||
when 'message'
|
||||
if message = Message.find_by_id(oid, :include => [:parent, {:board => :project}], :conditions => Project.visible_by(User.current))
|
||||
link = link_to h(truncate(message.subject, 60)), {:only_path => only_path,
|
||||
:controller => 'messages',
|
||||
:action => 'show',
|
||||
:board_id => message.board,
|
||||
:id => message.root,
|
||||
:anchor => (message.parent ? "message-#{message.id}" : nil)},
|
||||
:class => 'message'
|
||||
end
|
||||
end
|
||||
elsif sep == ':'
|
||||
# removes the double quotes if any
|
||||
|
||||
@ -16,11 +16,12 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
module UsersHelper
|
||||
def status_options_for_select(selected)
|
||||
def users_status_options_for_select(selected)
|
||||
user_count_by_status = User.count(:group => 'status').to_hash
|
||||
options_for_select([[l(:label_all), ''],
|
||||
[l(:status_active), 1],
|
||||
[l(:status_registered), 2],
|
||||
[l(:status_locked), 3]], selected)
|
||||
["#{l(:status_active)} (#{user_count_by_status[1].to_i})", 1],
|
||||
["#{l(:status_registered)} (#{user_count_by_status[2].to_i})", 2],
|
||||
["#{l(:status_locked)} (#{user_count_by_status[3].to_i})", 3]], selected)
|
||||
end
|
||||
|
||||
# Options for the new membership projects combo-box
|
||||
|
||||
@ -30,7 +30,7 @@ class CustomField < ActiveRecord::Base
|
||||
}.freeze
|
||||
|
||||
validates_presence_of :name, :field_format
|
||||
validates_uniqueness_of :name
|
||||
validates_uniqueness_of :name, :scope => :type
|
||||
validates_length_of :name, :maximum => 30
|
||||
validates_format_of :name, :with => /^[\w\s\'\-]*$/i
|
||||
validates_inclusion_of :field_format, :in => FIELD_FORMATS.keys
|
||||
@ -66,7 +66,7 @@ class CustomField < ActiveRecord::Base
|
||||
|
||||
# to move in project_custom_field
|
||||
def self.for_all
|
||||
find(:all, :conditions => ["is_for_all=?", true])
|
||||
find(:all, :conditions => ["is_for_all=?", true], :order => 'position')
|
||||
end
|
||||
|
||||
def type_name
|
||||
|
||||
@ -31,6 +31,8 @@ class MailHandler < ActionMailer::Base
|
||||
@@handler_options[:allow_override] ||= []
|
||||
# Project needs to be overridable if not specified
|
||||
@@handler_options[:allow_override] << 'project' unless @@handler_options[:issue].has_key?(:project)
|
||||
# Status needs to be overridable if not specified
|
||||
@@handler_options[:allow_override] << 'status' unless @@handler_options[:issue].has_key?(:status)
|
||||
super email
|
||||
end
|
||||
|
||||
@ -76,10 +78,11 @@ class MailHandler < ActionMailer::Base
|
||||
tracker = (get_keyword(:tracker) && project.trackers.find_by_name(get_keyword(:tracker))) || project.trackers.find(:first)
|
||||
category = (get_keyword(:category) && project.issue_categories.find_by_name(get_keyword(:category)))
|
||||
priority = (get_keyword(:priority) && Enumeration.find_by_opt_and_name('IPRI', get_keyword(:priority)))
|
||||
status = (get_keyword(:status) && IssueStatus.find_by_name(get_keyword(:status))) || IssueStatus.default
|
||||
|
||||
# check permission
|
||||
raise UnauthorizedAction unless user.allowed_to?(:add_issues, project)
|
||||
issue = Issue.new(:author => user, :project => project, :tracker => tracker, :category => category, :priority => priority)
|
||||
issue = Issue.new(:author => user, :project => project, :tracker => tracker, :category => category, :priority => priority, :status => status)
|
||||
issue.subject = email.subject.chomp
|
||||
issue.description = email.plain_text_body.chomp
|
||||
issue.save!
|
||||
@ -100,13 +103,18 @@ class MailHandler < ActionMailer::Base
|
||||
|
||||
# Adds a note to an existing issue
|
||||
def receive_issue_update(issue_id)
|
||||
status = (get_keyword(:status) && IssueStatus.find_by_name(get_keyword(:status)))
|
||||
|
||||
issue = Issue.find_by_id(issue_id)
|
||||
return unless issue
|
||||
# check permission
|
||||
raise UnauthorizedAction unless user.allowed_to?(:add_issue_notes, issue.project) || user.allowed_to?(:edit_issues, issue.project)
|
||||
raise UnauthorizedAction unless status.nil? || user.allowed_to?(:edit_issues, issue.project)
|
||||
|
||||
# add the note
|
||||
journal = issue.init_journal(user, email.plain_text_body.chomp)
|
||||
add_attachments(issue)
|
||||
issue.status = status unless status.nil?
|
||||
issue.save!
|
||||
logger.info "MailHandler: issue ##{issue.id} updated by #{user}" if logger && logger.info
|
||||
Mailer.deliver_issue_edit(journal) if Setting.notified_events.include?('issue_updated')
|
||||
|
||||
@ -198,7 +198,7 @@ class Project < ActiveRecord::Base
|
||||
# Returns an array of all custom fields enabled for project issues
|
||||
# (explictly associated custom fields and custom fields enabled for all projects)
|
||||
def all_issue_custom_fields
|
||||
@all_issue_custom_fields ||= (IssueCustomField.for_all + issue_custom_fields).uniq
|
||||
@all_issue_custom_fields ||= (IssueCustomField.for_all + issue_custom_fields).uniq.sort
|
||||
end
|
||||
|
||||
def project
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
<div class="contextual">
|
||||
<%= link_to(l(:button_edit), {:controller => 'users', :action => 'edit', :id => @user}, :class => 'icon icon-edit') if User.current.admin? %>
|
||||
</div>
|
||||
|
||||
<h2><%=h @user.name %></h2>
|
||||
|
||||
<p>
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
<th><%= l(:field_subject) %></th>
|
||||
<th><%= l(:field_author) %></th>
|
||||
<%= sort_header_tag("#{Message.table_name}.created_on", :caption => l(:field_created_on)) %>
|
||||
<th><%= l(:label_reply_plural) %></th>
|
||||
<%= sort_header_tag("#{Message.table_name}.replies_count", :caption => l(:label_reply_plural)) %>
|
||||
<%= sort_header_tag("#{Message.table_name}.updated_on", :caption => l(:label_message_last)) %>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
</div>
|
||||
|
||||
<div style="clear:both;"> </div>
|
||||
<%= render :partial => 'form_custom_fields', :locals => {:values => @custom_values} %>
|
||||
<%= render :partial => 'form_custom_fields' %>
|
||||
|
||||
<% if @issue.new_record? %>
|
||||
<p><label><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form' %></p>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<div class="splitcontentleft">
|
||||
<% i = 1 %>
|
||||
<% i = 0 %>
|
||||
<% split_on = @issue.custom_field_values.size / 2 %>
|
||||
<% @issue.custom_field_values.each do |value| %>
|
||||
<p><%= custom_field_tag_with_label :issue, value %></p>
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
<meta name="description" content="<%= Redmine::Info.app_name %>" />
|
||||
<meta name="keywords" content="issue,bug,tracker" />
|
||||
<%= stylesheet_link_tag 'application', :media => 'all' %>
|
||||
<%= javascript_include_tag :defaults %>
|
||||
<%= javascript_include_tag :defaults, :cache => true %>
|
||||
<%= stylesheet_link_tag 'jstoolbar' %>
|
||||
<!--[if IE]>
|
||||
<style type="text/css">
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
<div class="contextual">
|
||||
<%= change_status_link(@user) %>
|
||||
</div>
|
||||
|
||||
<h2><%=l(:label_user)%>: <%=h @user.login %></h2>
|
||||
|
||||
<% selected_tab = params[:tab] ? params[:tab].to_s : user_settings_tabs.first[:name] %>
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<% form_tag({}, :method => :get) do %>
|
||||
<fieldset><legend><%= l(:label_filter_plural) %></legend>
|
||||
<label><%= l(:field_status) %> :</label>
|
||||
<%= select_tag 'status', status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %>
|
||||
<%= select_tag 'status', users_status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
|
||||
@ -30,6 +30,6 @@
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<%= submit_tag l(:label_view_diff), :class => 'small' %>
|
||||
<%= submit_tag l(:label_view_diff), :class => 'small' if show_diff %>
|
||||
<span class="pagination"><%= pagination_links_full @version_pages, @version_count, :page_param => :p %></span>
|
||||
<% end %>
|
||||
|
||||
5
hooks/doc/README_FOR_APP
Normal file
5
hooks/doc/README_FOR_APP
Normal file
@ -0,0 +1,5 @@
|
||||
= Redmine
|
||||
|
||||
Redmine is a flexible project management web application written using Ruby on Rails framework.
|
||||
|
||||
More details can be found at http://www.redmine.org
|
||||
@ -24,6 +24,10 @@ Git
|
||||
---
|
||||
gunzip < test/fixtures/repositories/git_repository.tar.gz | tar -xv -C tmp/test
|
||||
|
||||
Darcs
|
||||
-----
|
||||
gunzip < test/fixtures/repositories/darcs_repository.tar.gz | tar -xv -C tmp/test
|
||||
|
||||
FileSystem
|
||||
----------
|
||||
gunzip < test/fixtures/repositories/filesystem_repository.tar.gz | tar -xv -C tmp/test
|
||||
|
||||
@ -149,7 +149,10 @@ namespace :redmine do
|
||||
|
||||
# ticket changes: only migrate status changes and comments
|
||||
has_many :changes, :class_name => "TracTicketChange", :foreign_key => :ticket
|
||||
has_many :attachments, :class_name => "TracAttachment", :foreign_key => :id, :conditions => "#{TracMigrate::TracAttachment.table_name}.type = 'ticket'"
|
||||
has_many :attachments, :class_name => "TracAttachment",
|
||||
:finder_sql => "SELECT DISTINCT attachment.* FROM #{TracMigrate::TracAttachment.table_name}" +
|
||||
" WHERE #{TracMigrate::TracAttachment.table_name}.type = 'ticket'" +
|
||||
' AND #{TracMigrate::TracAttachment.table_name}.id = \'#{id}\''
|
||||
has_many :customs, :class_name => "TracTicketCustom", :foreign_key => :ticket
|
||||
|
||||
def ticket_type
|
||||
@ -186,7 +189,10 @@ namespace :redmine do
|
||||
set_table_name :wiki
|
||||
set_primary_key :name
|
||||
|
||||
has_many :attachments, :class_name => "TracAttachment", :foreign_key => :id, :conditions => "#{TracMigrate::TracAttachment.table_name}.type = 'wiki'"
|
||||
has_many :attachments, :class_name => "TracAttachment",
|
||||
:finder_sql => "SELECT DISTINCT attachment.* FROM #{TracMigrate::TracAttachment.table_name}" +
|
||||
" WHERE #{TracMigrate::TracAttachment.table_name}.type = 'wiki'" +
|
||||
' AND #{TracMigrate::TracAttachment.table_name}.id = \'#{id}\''
|
||||
|
||||
def self.columns
|
||||
# Hides readonly Trac field to prevent clash with AR readonly? method (Rails 2.0)
|
||||
|
||||
46
hooks/lib/tasks/testing.rake
Normal file
46
hooks/lib/tasks/testing.rake
Normal file
@ -0,0 +1,46 @@
|
||||
### From http://svn.geekdaily.org/public/rails/plugins/generally_useful/tasks/coverage_via_rcov.rake
|
||||
|
||||
### Inspired by http://blog.labratz.net/articles/2006/12/2/a-rake-task-for-rcov
|
||||
begin
|
||||
require 'rcov/rcovtask'
|
||||
|
||||
rcov_options = "--rails --aggregate test/coverage.data --exclude '/gems/'"
|
||||
|
||||
namespace :test do
|
||||
desc "Aggregate code coverage for all tests"
|
||||
Rcov::RcovTask.new('coverage') do |t|
|
||||
t.libs << 'test'
|
||||
t.test_files = FileList['test/{unit,integration,functional}/*_test.rb']
|
||||
t.verbose = true
|
||||
t.rcov_opts << rcov_options
|
||||
end
|
||||
|
||||
namespace :coverage do
|
||||
desc "Delete coverage test data"
|
||||
task :clean do
|
||||
rm_f "test/coverage.data"
|
||||
rm_rf "test/coverage"
|
||||
end
|
||||
|
||||
desc "Aggregate code coverage for all tests with HTML output"
|
||||
Rcov::RcovTask.new('html') do |t|
|
||||
t.libs << 'test'
|
||||
t.test_files = FileList['test/{unit,integration,functional}/*_test.rb']
|
||||
t.output_dir = "test/coverage"
|
||||
t.verbose = true
|
||||
t.rcov_opts << rcov_options
|
||||
end
|
||||
|
||||
desc "Open the HTML coverage report"
|
||||
task :show_results do
|
||||
system "open test/coverage/index.html"
|
||||
end
|
||||
|
||||
task :full => "test:coverage:clean"
|
||||
task :full => "test:coverage:html"
|
||||
task :full => "test:coverage:show_results"
|
||||
end
|
||||
end
|
||||
rescue LoadError
|
||||
# rcov not available
|
||||
end
|
||||
@ -38,4 +38,5 @@ massa. Sed sodales, ante fermentum ultricies sollicitudin, massa leo
|
||||
pulvinar dui, a gravida orci mi eget odio. Nunc a lacus.
|
||||
|
||||
Project: onlinestore
|
||||
Status: Resolved
|
||||
|
||||
|
||||
75
hooks/test/fixtures/mail_handler/ticket_reply_with_status.eml
vendored
Normal file
75
hooks/test/fixtures/mail_handler/ticket_reply_with_status.eml
vendored
Normal file
@ -0,0 +1,75 @@
|
||||
Return-Path: <jsmith@somenet.foo>
|
||||
Received: from osiris ([127.0.0.1])
|
||||
by OSIRIS
|
||||
with hMailServer ; Sat, 21 Jun 2008 18:41:39 +0200
|
||||
Message-ID: <006a01c8d3bd$ad9baec0$0a00a8c0@osiris>
|
||||
From: "John Smith" <jsmith@somenet.foo>
|
||||
To: <redmine@somenet.foo>
|
||||
References: <485d0ad366c88_d7014663a025f@osiris.tmail>
|
||||
Subject: Re: [Cookbook - Feature #2] (New) Add ingredients categories
|
||||
Date: Sat, 21 Jun 2008 18:41:39 +0200
|
||||
MIME-Version: 1.0
|
||||
Content-Type: multipart/alternative;
|
||||
boundary="----=_NextPart_000_0067_01C8D3CE.711F9CC0"
|
||||
X-Priority: 3
|
||||
X-MSMail-Priority: Normal
|
||||
X-Mailer: Microsoft Outlook Express 6.00.2900.2869
|
||||
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
|
||||
|
||||
This is a multi-part message in MIME format.
|
||||
|
||||
------=_NextPart_000_0067_01C8D3CE.711F9CC0
|
||||
Content-Type: text/plain;
|
||||
charset="utf-8"
|
||||
Content-Transfer-Encoding: quoted-printable
|
||||
|
||||
This is reply
|
||||
|
||||
Status: Resolved
|
||||
------=_NextPart_000_0067_01C8D3CE.711F9CC0
|
||||
Content-Type: text/html;
|
||||
charset="utf-8"
|
||||
Content-Transfer-Encoding: quoted-printable
|
||||
|
||||
=EF=BB=BF<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML><HEAD>
|
||||
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dutf-8">
|
||||
<STYLE>BODY {
|
||||
FONT-SIZE: 0.8em; COLOR: #484848; FONT-FAMILY: Verdana, sans-serif
|
||||
}
|
||||
BODY H1 {
|
||||
FONT-SIZE: 1.2em; MARGIN: 0px; FONT-FAMILY: "Trebuchet MS", Verdana, =
|
||||
sans-serif
|
||||
}
|
||||
A {
|
||||
COLOR: #2a5685
|
||||
}
|
||||
A:link {
|
||||
COLOR: #2a5685
|
||||
}
|
||||
A:visited {
|
||||
COLOR: #2a5685
|
||||
}
|
||||
A:hover {
|
||||
COLOR: #c61a1a
|
||||
}
|
||||
A:active {
|
||||
COLOR: #c61a1a
|
||||
}
|
||||
HR {
|
||||
BORDER-RIGHT: 0px; BORDER-TOP: 0px; BACKGROUND: #ccc; BORDER-LEFT: 0px; =
|
||||
WIDTH: 100%; BORDER-BOTTOM: 0px; HEIGHT: 1px
|
||||
}
|
||||
.footer {
|
||||
FONT-SIZE: 0.8em; FONT-STYLE: italic
|
||||
}
|
||||
</STYLE>
|
||||
|
||||
<META content=3D"MSHTML 6.00.2900.2883" name=3DGENERATOR></HEAD>
|
||||
<BODY bgColor=3D#ffffff>
|
||||
<DIV><SPAN class=3Dfooter><FONT face=3DArial color=3D#000000 =
|
||||
size=3D2>This is=20
|
||||
reply Status: Resolved</FONT></DIV></SPAN></BODY></HTML>
|
||||
|
||||
------=_NextPart_000_0067_01C8D3CE.711F9CC0--
|
||||
|
||||
@ -212,7 +212,7 @@ class IssuesControllerTest < Test::Unit::TestCase
|
||||
assert_equal 2, issue.author_id
|
||||
assert_equal 3, issue.tracker_id
|
||||
assert_nil issue.estimated_hours
|
||||
v = issue.custom_values.find_by_custom_field_id(2)
|
||||
v = issue.custom_values.find(:first, :conditions => {:custom_field_id => 2})
|
||||
assert_not_nil v
|
||||
assert_equal 'Value for field 2', v.value
|
||||
end
|
||||
|
||||
@ -109,8 +109,18 @@ class WikiControllerTest < Test::Unit::TestCase
|
||||
assert_template 'history'
|
||||
assert_not_nil assigns(:versions)
|
||||
assert_equal 3, assigns(:versions).size
|
||||
assert_select "input[type=submit][name=commit]"
|
||||
end
|
||||
|
||||
|
||||
def test_history_with_one_version
|
||||
get :history, :id => 1, :page => 'Another_page'
|
||||
assert_response :success
|
||||
assert_template 'history'
|
||||
assert_not_nil assigns(:versions)
|
||||
assert_equal 1, assigns(:versions).size
|
||||
assert_select "input[type=submit][name=commit]", false
|
||||
end
|
||||
|
||||
def test_diff
|
||||
get :diff, :id => 1, :page => 'CookBook_documentation', :version => 2, :version_from => 1
|
||||
assert_response :success
|
||||
|
||||
@ -20,7 +20,11 @@ require File.dirname(__FILE__) + '/../../test_helper'
|
||||
class ApplicationHelperTest < HelperTestCase
|
||||
include ApplicationHelper
|
||||
include ActionView::Helpers::TextHelper
|
||||
fixtures :projects, :repositories, :changesets, :trackers, :issue_statuses, :issues, :documents, :versions, :wikis, :wiki_pages, :wiki_contents, :roles, :enabled_modules
|
||||
fixtures :projects, :roles, :enabled_modules,
|
||||
:repositories, :changesets,
|
||||
:trackers, :issue_statuses, :issues, :versions, :documents,
|
||||
:wikis, :wiki_pages, :wiki_contents,
|
||||
:boards, :messages
|
||||
|
||||
def setup
|
||||
super
|
||||
@ -83,6 +87,8 @@ class ApplicationHelperTest < HelperTestCase
|
||||
version_link = link_to('1.0', {:controller => 'versions', :action => 'show', :id => 2},
|
||||
:class => 'version')
|
||||
|
||||
message_url = {:controller => 'messages', :action => 'show', :board_id => 1, :id => 4}
|
||||
|
||||
source_url = {:controller => 'repositories', :action => 'entry', :id => 'ecookbook', :path => ['some', 'file']}
|
||||
source_url_with_ext = {:controller => 'repositories', :action => 'entry', :id => 'ecookbook', :path => ['some', 'file.ext']}
|
||||
|
||||
@ -111,6 +117,9 @@ class ApplicationHelperTest < HelperTestCase
|
||||
'source:/some/file.ext#L110' => link_to('source:/some/file.ext#L110', source_url_with_ext.merge(:anchor => 'L110'), :class => 'source'),
|
||||
'source:/some/file@52#L110' => link_to('source:/some/file@52#L110', source_url.merge(:rev => 52, :anchor => 'L110'), :class => 'source'),
|
||||
'export:/some/file' => link_to('export:/some/file', source_url.merge(:format => 'raw'), :class => 'source download'),
|
||||
# message
|
||||
'message#4' => link_to('Post 2', message_url, :class => 'message'),
|
||||
'message#5' => link_to('RE: post 2', message_url.merge(:anchor => 'message-5'), :class => 'message'),
|
||||
# escaping
|
||||
'!#3.' => '#3.',
|
||||
'!r1' => 'r1',
|
||||
|
||||
@ -45,6 +45,16 @@ class MailHandlerTest < Test::Unit::TestCase
|
||||
assert_equal Project.find(2), issue.project
|
||||
assert issue.description.include?('Lorem ipsum dolor sit amet, consectetuer adipiscing elit.')
|
||||
end
|
||||
|
||||
def test_add_issue_with_status
|
||||
# This email contains: 'Project: onlinestore' and 'Status: Resolved'
|
||||
issue = submit_email('ticket_on_given_project.eml')
|
||||
assert issue.is_a?(Issue)
|
||||
assert !issue.new_record?
|
||||
issue.reload
|
||||
assert_equal Project.find(2), issue.project
|
||||
assert_equal IssueStatus.find_by_name("Resolved"), issue.status
|
||||
end
|
||||
|
||||
def test_add_issue_with_attributes_override
|
||||
issue = submit_email('ticket_with_attributes.eml', :allow_override => 'tracker,category,priority')
|
||||
@ -95,7 +105,18 @@ class MailHandlerTest < Test::Unit::TestCase
|
||||
assert journal.is_a?(Journal)
|
||||
assert_equal User.find_by_login('jsmith'), journal.user
|
||||
assert_equal Issue.find(2), journal.journalized
|
||||
assert_equal 'This is reply', journal.notes
|
||||
assert_match /This is reply/, journal.notes
|
||||
end
|
||||
|
||||
def test_add_issue_note_with_status_change
|
||||
# This email contains: 'Status: Resolved'
|
||||
journal = submit_email('ticket_reply_with_status.eml')
|
||||
assert journal.is_a?(Journal)
|
||||
issue = Issue.find(journal.issue.id)
|
||||
assert_equal User.find_by_login('jsmith'), journal.user
|
||||
assert_equal Issue.find(2), journal.journalized
|
||||
assert_match /This is reply/, journal.notes
|
||||
assert_equal IssueStatus.find_by_name("Resolved"), issue.status
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@ -27,7 +27,10 @@ module Redmine
|
||||
return if self.included_modules.include?(Redmine::Acts::Customizable::InstanceMethods)
|
||||
cattr_accessor :customizable_options
|
||||
self.customizable_options = options
|
||||
has_many :custom_values, :dependent => :delete_all, :as => :customized
|
||||
has_many :custom_values, :as => :customized,
|
||||
:include => :custom_field,
|
||||
:order => "#{CustomField.table_name}.position",
|
||||
:dependent => :delete_all
|
||||
before_validation_on_create { |customized| customized.custom_field_values }
|
||||
# Trigger validation only if custom values were changed
|
||||
validates_associated :custom_values, :on => :update, :if => Proc.new { |customized| customized.custom_field_values_changed? }
|
||||
|
||||
@ -88,7 +88,7 @@ module Engines
|
||||
def add_plugin_view_paths
|
||||
view_path = File.join(directory, 'app', 'views')
|
||||
if File.exist?(view_path)
|
||||
ActionController::Base.view_paths.insert(1, view_path) # push it just underneath the app
|
||||
ActionController::Base.prepend_view_path(view_path) # push it just underneath the app
|
||||
ActionView::TemplateFinder.process_view_paths(view_path)
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user