Defect #2660 » documents.diff
| app/views/issues/show.rhtml | ||
|---|---|---|
|
<td style="width:15%" class="start-date"><b><%=l(:field_start_date)%>:</b></td><td style="width:35%"><%= format_date(@issue.start_date) %></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="priority"><b><%=l(:field_priority)%>:</b></td><td class="priority priority-<%= @issue.priority.name %>"><%= @issue.priority.name %></td>
|
||
|
<td class="priority"><b><%=l(:field_priority)%>:</b></td><td class="priority"><%= @issue.priority.name %></td>
|
||
|
<td class="due-date"><b><%=l(:field_due_date)%>:</b></td><td class="due-date"><%= format_date(@issue.due_date) %></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
-
|
||
| app/controllers/issues_controller.rb | ||
|---|---|---|
|
if (@time_entry.hours.nil? || @time_entry.valid?) && @issue.save
|
||
|
# Log spend time
|
||
|
if current_role.allowed_to?(:log_time)
|
||
|
if User.current.allowed_to?(:log_time, @project)
|
||
|
@time_entry.save
|
||
|
end
|
||
|
if !journal.new_record?
|
||
|
-
|
||
| app/views/mailer/layout.text.html.rhtml | ||
|---|---|---|
|
font-size: 0.8em;
|
||
|
color:#484848;
|
||
|
}
|
||
|
h1 {
|
||
|
font-family: "Trebuchet MS", Verdana, sans-serif;
|
||
|
font-size: 1.2em;
|
||
|
margin: 0px;
|
||
|
}
|
||
|
a, a:link, a:visited {
|
||
|
color: #2A5685;
|
||
|
}
|
||
|
a:hover, a:active {
|
||
|
color: #c61a1a;
|
||
|
}
|
||
|
h1, h2, h3 { font-family: "Trebuchet MS", Verdana, sans-serif; margin: 0px; }
|
||
|
h1 { font-size: 1.2em; }
|
||
|
h2, h3 { font-size: 1.1em; }
|
||
|
a, a:link, a:visited { color: #2A5685;}
|
||
|
a:hover, a:active { color: #c61a1a; }
|
||
|
a.wiki-anchor { display: none; }
|
||
|
hr {
|
||
|
width: 100%;
|
||
|
height: 1px;
|
||
|
-
|
||
| db/migrate/20090214190337_add_watchers_user_id_type_index.rb | ||
|---|---|---|
|
class AddWatchersUserIdTypeIndex < ActiveRecord::Migration
|
||
|
def self.up
|
||
|
add_index :watchers, [:user_id, :watchable_type], :name => :watchers_user_id_type
|
||
|
end
|
||
|
def self.down
|
||
|
remove_index :watchers, :name => :watchers_user_id_type
|
||
|
end
|
||
|
end
|
||
|
-
|
||
| app/views/issues/show.rhtml | ||
|---|---|---|
|
<table width="100%">
|
||
|
<tr>
|
||
|
<td style="width:15%" class="status"><b><%=l(:field_status)%>:</b></td><td style="width:35%" class="status status-<%= @issue.status.name %>"><%= @issue.status.name %></td>
|
||
|
<td style="width:15%" class="status"><b><%=l(:field_status)%>:</b></td><td style="width:35%" class="status"><%= @issue.status.name %></td>
|
||
|
<td style="width:15%" class="start-date"><b><%=l(:field_start_date)%>:</b></td><td style="width:35%"><%= format_date(@issue.start_date) %></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
-
|
||
| doc/CHANGELOG | ||
|---|---|---|
|
== Redmine changelog
|
||
|
Redmine - project management software
|
||
|
Copyright (C) 2006-2008 Jean-Philippe Lang
|
||
|
Copyright (C) 2006-2009 Jean-Philippe Lang
|
||
|
http://www.redmine.org/
|
||
|
== v0.8.1
|
||
|
== 2009-02-15 v0.8.1
|
||
|
* Select watchers on new issue form
|
||
|
* Issue description is no longer a required field
|
||
|
* Files module: ability to add files without version
|
||
|
* Jump to the current tab when using the project quick-jump combo
|
||
|
* Display a warning if some attachments were not saved
|
||
|
* Import custom fields values from emails on issue creation
|
||
|
* Show view/annotate/download links on entry and annotate views
|
||
|
* Admin Info Screen: Display if plugin assets directory is writable
|
||
|
* Adds a 'Create and continue' button on the new issue form
|
||
|
* IMAP: add options to move received emails
|
||
|
* Do not show Category field when categories are not defined
|
||
|
* Lower the project identifier limit to a minimum of two characters
|
||
|
* Add "closed" html class to closed entries in issue list
|
||
|
* Fixed: broken redirect URL on login failure
|
||
|
* Fixed: Deleted files are shown when using Darcs
|
||
|
* Fixed: Darcs adapter works on Win32 only
|
||
|
* Fixed: syntax highlight doesn't appear in new ticket preview
|
||
|
* Fixed: email notification for changes I make still occurs when running Repository.fetch_changesets
|
||
|
* Fixed: no error is raised when entering invalid hours on the issue update form
|
||
|
* Fixed: Details time log report CSV export doesn't honour date format from settings
|
||
|
* Fixed: invalid css classes on issue details
|
||
|
* Fixed: Trac importer creates duplicate custom values
|
||
|
* Fixed: inline attached image should not match partial filename
|
||
|
== 2008-12-30 v0.8.0
|
||
|
-
|
||
| app/controllers/documents_controller.rb | ||
|---|---|---|
|
end
|
||
|
|
||
|
def edit
|
||
|
@categories = Enumeration::get_values('DCAT')
|
||
|
@categories = Enumeration.document_categories
|
||
|
if request.post? and @document.update_attributes(params[:document])
|
||
|
flash[:notice] = l(:notice_successful_update)
|
||
|
redirect_to :action => 'show', :id => @document
|
||
| app/controllers/enumerations_controller.rb | ||
|---|---|---|
|
redirect_to :action => 'index'
|
||
|
end
|
||
|
end
|
||
|
@enumerations = Enumeration.get_values(@enumeration.opt) - [@enumeration]
|
||
|
@enumerations = Enumeration.values(@enumeration.opt) - [@enumeration]
|
||
|
#rescue
|
||
|
# flash[:error] = 'Unable to delete enumeration'
|
||
|
# redirect_to :action => 'index'
|
||
| app/controllers/issues_controller.rb | ||
|---|---|---|
|
@journals.reverse! if User.current.wants_comments_in_reverse_order?
|
||
|
@allowed_statuses = @issue.new_statuses_allowed_to(User.current)
|
||
|
@edit_allowed = User.current.allowed_to?(:edit_issues, @project)
|
||
|
@priorities = Enumeration::get_values('IPRI')
|
||
|
@priorities = Enumeration.priorities
|
||
|
@time_entry = TimeEntry.new
|
||
|
respond_to do |format|
|
||
|
format.html { render :template => 'issues/show.rhtml' }
|
||
| ... | ... | |
|
return
|
||
|
end
|
||
|
end
|
||
|
@priorities = Enumeration::get_values('IPRI')
|
||
|
@priorities = Enumeration.priorities
|
||
|
render :layout => !request.xhr?
|
||
|
end
|
||
|
|
||
| ... | ... | |
|
|
||
|
def edit
|
||
|
@allowed_statuses = @issue.new_statuses_allowed_to(User.current)
|
||
|
@priorities = Enumeration::get_values('IPRI')
|
||
|
@priorities = Enumeration.priorities
|
||
|
@edit_allowed = User.current.allowed_to?(:edit_issues, @project)
|
||
|
@time_entry = TimeEntry.new
|
||
|
|
||
| ... | ... | |
|
@assignables << @issue.assigned_to if @issue && @issue.assigned_to && !@assignables.include?(@issue.assigned_to)
|
||
|
end
|
||
|
|
||
|
@priorities = Enumeration.get_values('IPRI').reverse
|
||
|
@priorities = Enumeration.priorities.reverse
|
||
|
@statuses = IssueStatus.find(:all, :order => 'position')
|
||
|
@back = request.env['HTTP_REFERER']
|
||
|
|
||
| app/controllers/reports_controller.rb | ||
|---|---|---|
|
render :template => "reports/issue_report_details"
|
||
|
when "priority"
|
||
|
@field = "priority_id"
|
||
|
@rows = Enumeration::get_values('IPRI')
|
||
|
@rows = Enumeration.priorities
|
||
|
@data = issues_by_priority
|
||
|
@report_title = l(:field_priority)
|
||
|
render :template => "reports/issue_report_details"
|
||
| ... | ... | |
|
else
|
||
|
@trackers = @project.trackers
|
||
|
@versions = @project.versions.sort
|
||
|
@priorities = Enumeration::get_values('IPRI')
|
||
|
@priorities = Enumeration.priorities
|
||
|
@categories = @project.issue_categories
|
||
|
@assignees = @project.members.collect { |m| m.user }
|
||
|
@authors = @project.members.collect { |m| m.user }
|
||
| app/helpers/timelog_helper.rb | ||
|---|---|---|
|
end
|
||
|
|
||
|
def activity_collection_for_select_options
|
||
|
activities = Enumeration::get_values('ACTI')
|
||
|
activities = Enumeration.activities
|
||
|
collection = []
|
||
|
collection << [ "--- #{l(:actionview_instancetag_blank_option)} ---", '' ] unless activities.detect(&:is_default)
|
||
|
activities.each { |a| collection << [a.name, a.id] }
|
||
| app/models/document.rb | ||
|---|---|---|
|
|
||
|
def after_initialize
|
||
|
if new_record?
|
||
|
self.category ||= Enumeration.default('DCAT')
|
||
|
self.category ||= Enumeration.document_categories.default
|
||
|
end
|
||
|
end
|
||
|
end
|
||
| app/models/enumeration.rb | ||
|---|---|---|
|
# Single table inheritance would be an option
|
||
|
OPTIONS = {
|
||
|
"IPRI" => {:label => :enumeration_issue_priorities, :model => Issue, :foreign_key => :priority_id},
|
||
|
"DCAT" => {:label => :enumeration_doc_categories, :model => Document, :foreign_key => :category_id},
|
||
|
"ACTI" => {:label => :enumeration_activities, :model => TimeEntry, :foreign_key => :activity_id}
|
||
|
"IPRI" => {:label => :enumeration_issue_priorities, :model => Issue, :foreign_key => :priority_id, :scope => :priorities},
|
||
|
"DCAT" => {:label => :enumeration_doc_categories, :model => Document, :foreign_key => :category_id, :scope => :document_categories},
|
||
|
"ACTI" => {:label => :enumeration_activities, :model => TimeEntry, :foreign_key => :activity_id, :scope => :activities}
|
||
|
}.freeze
|
||
|
|
||
|
def self.get_values(option)
|
||
|
find(:all, :conditions => {:opt => option}, :order => 'position')
|
||
|
# Creates a named scope for each type of value. The scope has a +default+ method
|
||
|
# that returns the default value, or nil if no value is set as default.
|
||
|
# Example:
|
||
|
# Enumeration.priorities
|
||
|
# Enumeration.priorities.default
|
||
|
OPTIONS.each do |k, v|
|
||
|
next unless v[:scope]
|
||
|
named_scope v[:scope], :conditions => { :opt => k }, :order => 'position' do
|
||
|
def default
|
||
|
find(:first, :conditions => { :is_default => true })
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def self.default(option)
|
||
|
find(:first, :conditions => {:opt => option, :is_default => true}, :order => 'position')
|
||
|
named_scope :values, lambda {|opt| { :conditions => { :opt => opt }, :order => 'position' } } do
|
||
|
def default
|
||
|
find(:first, :conditions => { :is_default => true })
|
||
|
end
|
||
|
end
|
||
|
def option_name
|
||
| app/models/issue.rb | ||
|---|---|---|
|
if new_record?
|
||
|
# set default values for new records only
|
||
|
self.status ||= IssueStatus.default
|
||
|
self.priority ||= Enumeration.default('IPRI')
|
||
|
self.priority ||= Enumeration.priorities.default
|
||
|
end
|
||
|
end
|
||
|
|
||
| app/models/time_entry.rb | ||
|---|---|---|
|
def after_initialize
|
||
|
if new_record? && self.activity.nil?
|
||
|
if default_activity = Enumeration.default('ACTI')
|
||
|
if default_activity = Enumeration.activities.default
|
||
|
self.activity_id = default_activity.id
|
||
|
end
|
||
|
end
|
||
| app/views/documents/_form.rhtml | ||
|---|---|---|
|
<div class="box">
|
||
|
<!--[form:document]-->
|
||
|
<p><label for="document_category_id"><%=l(:field_category)%></label>
|
||
|
<%= select('document', 'category_id', Enumeration.get_values('DCAT').collect {|c| [c.name, c.id]}) %></p>
|
||
|
<%= select('document', 'category_id', Enumeration.document_categories.collect {|c| [c.name, c.id]}) %></p>
|
||
|
<p><label for="document_title"><%=l(:field_title)%> <span class="required">*</span></label>
|
||
|
<%= text_field 'document', 'title', :size => 60 %></p>
|
||
| app/views/enumerations/list.rhtml | ||
|---|---|---|
|
<% Enumeration::OPTIONS.each do |option, params| %>
|
||
|
<h3><%= l(params[:label]) %></h3>
|
||
|
<% enumerations = Enumeration.get_values(option) %>
|
||
|
<% enumerations = Enumeration.values(option) %>
|
||
|
<% if enumerations.any? %>
|
||
|
<table class="list">
|
||
|
<% enumerations.each do |enumeration| %>
|
||
| app/views/issues/bulk_edit.rhtml | ||
|---|---|---|
|
<%= select_tag('status_id', "<option value=\"\">#{l(:label_no_change_option)}</option>" + options_from_collection_for_select(@available_statuses, :id, :name)) %></label>
|
||
|
<% end %>
|
||
|
<label><%= l(:field_priority) %>:
|
||
|
<%= select_tag('priority_id', "<option value=\"\">#{l(:label_no_change_option)}</option>" + options_from_collection_for_select(Enumeration.get_values('IPRI'), :id, :name)) %></label>
|
||
|
<%= select_tag('priority_id', "<option value=\"\">#{l(:label_no_change_option)}</option>" + options_from_collection_for_select(Enumeration.priorities, :id, :name)) %></label>
|
||
|
<label><%= l(:field_category) %>:
|
||
|
<%= select_tag('category_id', content_tag('option', l(:label_no_change_option), :value => '') +
|
||
|
content_tag('option', l(:label_none), :value => 'none') +
|
||
| lib/tasks/migrate_from_mantis.rake | ||
|---|---|---|
|
90 => closed_status # closed
|
||
|
}
|
||
|
|
||
|
priorities = Enumeration.get_values('IPRI')
|
||
|
priorities = Enumeration.priorities
|
||
|
DEFAULT_PRIORITY = priorities[2]
|
||
|
PRIORITY_MAPPING = {10 => priorities[1], # none
|
||
|
20 => priorities[1], # low
|
||
| lib/tasks/migrate_from_trac.rake | ||
|---|---|---|
|
'closed' => closed_status
|
||
|
}
|
||
|
priorities = Enumeration.get_values('IPRI')
|
||
|
priorities = Enumeration.priorities
|
||
|
DEFAULT_PRIORITY = priorities[0]
|
||
|
PRIORITY_MAPPING = {'lowest' => priorities[0],
|
||
|
'low' => priorities[0],
|
||
| test/functional/issues_controller_test.rb | ||
|---|---|---|
|
:id => 1,
|
||
|
:issue => { :status_id => 2, :assigned_to_id => 3 },
|
||
|
:notes => 'Assigned to dlopper',
|
||
|
:time_entry => { :hours => '', :comments => '', :activity_id => Enumeration.get_values('ACTI').first }
|
||
|
:time_entry => { :hours => '', :comments => '', :activity_id => Enumeration.activities.first }
|
||
|
end
|
||
|
assert_redirected_to :action => 'show', :id => '1'
|
||
|
issue.reload
|
||
| ... | ... | |
|
post :edit,
|
||
|
:id => 1,
|
||
|
:notes => '2.5 hours added',
|
||
|
:time_entry => { :hours => '2.5', :comments => '', :activity_id => Enumeration.get_values('ACTI').first }
|
||
|
:time_entry => { :hours => '2.5', :comments => '', :activity_id => Enumeration.activities.first }
|
||
|
end
|
||
|
assert_redirected_to :action => 'show', :id => '1'
|
||
|
|
||
| test/unit/enumeration_test.rb | ||
|---|---|---|
|
end
|
||
|
|
||
|
def test_default
|
||
|
e = Enumeration.default('IPRI')
|
||
|
e = Enumeration.priorities.default
|
||
|
assert e.is_a?(Enumeration)
|
||
|
assert e.is_default?
|
||
|
assert_equal 'Normal', e.name
|
||
| ... | ... | |
|
def test_create
|
||
|
e = Enumeration.new(:opt => 'IPRI', :name => 'Very urgent', :is_default => false)
|
||
|
assert e.save
|
||
|
assert_equal 'Normal', Enumeration.default('IPRI').name
|
||
|
assert_equal 'Normal', Enumeration.priorities.default.name
|
||
|
end
|
||
|
|
||
|
def test_create_as_default
|
||
|
e = Enumeration.new(:opt => 'IPRI', :name => 'Very urgent', :is_default => true)
|
||
|
assert e.save
|
||
|
assert_equal e, Enumeration.default('IPRI')
|
||
|
assert_equal e, Enumeration.priorities.default
|
||
|
end
|
||
|
|
||
|
def test_update_default
|
||
|
e = Enumeration.default('IPRI')
|
||
|
e = Enumeration.priorities.default
|
||
|
e.update_attributes(:name => 'Changed', :is_default => true)
|
||
|
assert_equal e, Enumeration.default('IPRI')
|
||
|
assert_equal e, Enumeration.priorities.default
|
||
|
end
|
||
|
|
||
|
def test_update_default_to_non_default
|
||
|
e = Enumeration.default('IPRI')
|
||
|
e = Enumeration.priorities.default
|
||
|
e.update_attributes(:name => 'Changed', :is_default => false)
|
||
|
assert_nil Enumeration.default('IPRI')
|
||
|
assert_nil Enumeration.priorities.default
|
||
|
end
|
||
|
|
||
|
def test_change_default
|
||
|
e = Enumeration.find_by_name('Urgent')
|
||
|
e.update_attributes(:name => 'Urgent', :is_default => true)
|
||
|
assert_equal e, Enumeration.default('IPRI')
|
||
|
assert_equal e, Enumeration.priorities.default
|
||
|
end
|
||
|
|
||
|
def test_destroy_with_reassign
|
||
| test/unit/issue_test.rb | ||
|---|---|---|
|
:time_entries
|
||
|
def test_create
|
||
|
issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 3, :status_id => 1, :priority => Enumeration.get_values('IPRI').first, :subject => 'test_create', :description => 'IssueTest#test_create', :estimated_hours => '1:30')
|
||
|
issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 3, :status_id => 1, :priority => Enumeration.priorities.first, :subject => 'test_create', :description => 'IssueTest#test_create', :estimated_hours => '1:30')
|
||
|
assert issue.save
|
||
|
issue.reload
|
||
|
assert_equal 1.5, issue.estimated_hours
|
||
|
end
|
||
|
|
||
|
def test_create_minimal
|
||
|
issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 3, :status_id => 1, :priority => Enumeration.get_values('IPRI').first, :subject => 'test_create')
|
||
|
issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 3, :status_id => 1, :priority => Enumeration.priorities.first, :subject => 'test_create')
|
||
|
assert issue.save
|
||
|
assert issue.description.nil?
|
||
|
end
|
||
| ... | ... | |
|
end
|
||
|
|
||
|
def test_category_based_assignment
|
||
|
issue = Issue.create(:project_id => 1, :tracker_id => 1, :author_id => 3, :status_id => 1, :priority => Enumeration.get_values('IPRI').first, :subject => 'Assignment test', :description => 'Assignment test', :category_id => 1)
|
||
|
issue = Issue.create(:project_id => 1, :tracker_id => 1, :author_id => 3, :status_id => 1, :priority => Enumeration.priorities.first, :subject => 'Assignment test', :description => 'Assignment test', :category_id => 1)
|
||
|
assert_equal IssueCategory.find(1).assigned_to, issue.assigned_to
|
||
|
end
|
||
|
|
||
| ... | ... | |
|
|
||
|
def test_should_close_duplicates
|
||
|
# Create 3 issues
|
||
|
issue1 = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :priority => Enumeration.get_values('IPRI').first, :subject => 'Duplicates test', :description => 'Duplicates test')
|
||
|
issue1 = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :priority => Enumeration.priorities.first, :subject => 'Duplicates test', :description => 'Duplicates test')
|
||
|
assert issue1.save
|
||
|
issue2 = issue1.clone
|
||
|
assert issue2.save
|
||
| ... | ... | |
|
|
||
|
def test_should_not_close_duplicated_issue
|
||
|
# Create 3 issues
|
||
|
issue1 = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :priority => Enumeration.get_values('IPRI').first, :subject => 'Duplicates test', :description => 'Duplicates test')
|
||
|
issue1 = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :priority => Enumeration.priorities.first, :subject => 'Duplicates test', :description => 'Duplicates test')
|
||
|
assert issue1.save
|
||
|
issue2 = issue1.clone
|
||
|
assert issue2.save
|
||
|
-
|
||
| app/models/project.rb | ||
|---|---|---|
|
end
|
||
|
|
||
|
def enabled_module_names=(module_names)
|
||
|
enabled_modules.clear
|
||
|
module_names = [] unless module_names && module_names.is_a?(Array)
|
||
|
module_names.each do |name|
|
||
|
enabled_modules << EnabledModule.new(:name => name.to_s)
|
||
|
if module_names && module_names.is_a?(Array)
|
||
|
module_names = module_names.collect(&:to_s)
|
||
|
# remove disabled modules
|
||
|
enabled_modules.each {|mod| mod.destroy unless module_names.include?(mod.name)}
|
||
|
# add new modules
|
||
|
module_names.each {|name| enabled_modules << EnabledModule.new(:name => name)}
|
||
|
else
|
||
|
enabled_modules.clear
|
||
|
end
|
||
|
end
|
||
|
|
||
| test/unit/project_test.rb | ||
|---|---|---|
|
require File.dirname(__FILE__) + '/../test_helper'
|
||
|
|
||
|
class ProjectTest < Test::Unit::TestCase
|
||
|
fixtures :projects, :issues, :issue_statuses, :journals, :journal_details, :users, :members, :roles, :projects_trackers, :trackers, :boards
|
||
|
fixtures :projects, :enabled_modules,
|
||
|
:issues, :issue_statuses, :journals, :journal_details,
|
||
|
:users, :members, :roles, :projects_trackers, :trackers, :boards
|
||
|
|
||
|
def setup
|
||
|
@ecookbook = Project.find(1)
|
||
| ... | ... | |
|
Project.delete_all
|
||
|
assert_nil Project.next_identifier
|
||
|
end
|
||
|
|
||
|
def test_enabled_module_names_should_not_recreate_enabled_modules
|
||
|
project = Project.find(1)
|
||
|
# Remove one module
|
||
|
modules = project.enabled_modules.slice(0..-2)
|
||
|
assert modules.any?
|
||
|
assert_difference 'EnabledModule.count', -1 do
|
||
|
project.enabled_module_names = modules.collect(&:name)
|
||
|
end
|
||
|
project.reload
|
||
|
# Ids should be preserved
|
||
|
assert_equal project.enabled_module_ids.sort, modules.collect(&:id).sort
|
||
|
end
|
||
|
end
|
||
|
-
|
||
| app/models/enabled_module.rb | ||
|---|---|---|
|
# redMine - project management software
|
||
|
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2009 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
|
||
| ... | ... | |
|
|
||
|
validates_presence_of :name
|
||
|
validates_uniqueness_of :name, :scope => :project_id
|
||
|
|
||
|
after_create :module_enabled
|
||
|
|
||
|
private
|
||
|
|
||
|
# after_create callback used to do things when a module is enabled
|
||
|
def module_enabled
|
||
|
case name
|
||
|
when 'wiki'
|
||
|
# Create a wiki with a default start page
|
||
|
if project && project.wiki.nil?
|
||
|
Wiki.create(:project => project, :start_page => 'Wiki')
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
| test/unit/enabled_module_test.rb | ||
|---|---|---|
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2009 Jean-Philippe Lang
|
||
|
#
|
||
|
# This program is free software; you can redistribute it and/or
|
||
|
# modify it under the terms of the GNU General Public License
|
||
|
# as published by the Free Software Foundation; either version 2
|
||
|
# of the License, or (at your option) any later version.
|
||
|
#
|
||
|
# This program is distributed in the hope that it will be useful,
|
||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
# GNU General Public License for more details.
|
||
|
#
|
||
|
# You should have received a copy of the GNU General Public License
|
||
|
# along with this program; if not, write to the Free Software
|
||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||
|
require File.dirname(__FILE__) + '/../test_helper'
|
||
|
class EnabledModuleTest < Test::Unit::TestCase
|
||
|
fixtures :projects, :wikis
|
||
|
|
||
|
def test_enabling_wiki_should_create_a_wiki
|
||
|
CustomField.delete_all
|
||
|
project = Project.create!(:name => 'Project with wiki', :identifier => 'wikiproject')
|
||
|
assert_nil project.wiki
|
||
|
project.enabled_module_names = ['wiki']
|
||
|
project.reload
|
||
|
assert_not_nil project.wiki
|
||
|
assert_equal 'Wiki', project.wiki.start_page
|
||
|
end
|
||
|
|
||
|
def test_reenabling_wiki_should_not_create_another_wiki
|
||
|
project = Project.find(1)
|
||
|
assert_not_nil project.wiki
|
||
|
project.enabled_module_names = []
|
||
|
project.reload
|
||
|
assert_no_difference 'Wiki.count' do
|
||
|
project.enabled_module_names = ['wiki']
|
||
|
end
|
||
|
assert_not_nil project.wiki
|
||
|
end
|
||
|
end
|
||
|
-
|
||
| app/views/custom_fields/_form.rhtml | ||
|---|---|---|
|
<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><%= f.select :field_format, custom_field_formats_for_select, {}, :onchange => "toggle_custom_field_format();",
|
||
|
:disabled => !@custom_field.new_record? %></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>
|
||
|
-
|
||
| app/models/user.rb | ||
|---|---|---|
|
end
|
||
|
|
||
|
def identity_url=(url)
|
||
|
begin
|
||
|
self.write_attribute(:identity_url, OpenIdAuthentication.normalize_identifier(url))
|
||
|
rescue InvalidOpenId
|
||
|
# Invlaid url, don't save
|
||
|
if url.blank?
|
||
|
write_attribute(:identity_url, '')
|
||
|
else
|
||
|
begin
|
||
|
write_attribute(:identity_url, OpenIdAuthentication.normalize_identifier(url))
|
||
|
rescue OpenIdAuthentication::InvalidOpenId
|
||
|
# Invlaid url, don't save
|
||
|
end
|
||
|
end
|
||
|
self.read_attribute(:identity_url)
|
||
|
end
|
||
| test/unit/user_test.rb | ||
|---|---|---|
|
u = User.new( :identity_url => 'example.com' )
|
||
|
assert_equal normalized_open_id_url, u.identity_url
|
||
|
end
|
||
|
|
||
|
def test_setting_blank_identity_url
|
||
|
u = User.new( :identity_url => 'example.com' )
|
||
|
u.identity_url = ''
|
||
|
assert u.identity_url.blank?
|
||
|
end
|
||
|
|
||
|
def test_setting_invalid_identity_url
|
||
|
u = User.new( :identity_url => 'this is not an openid url' )
|
||
|
assert u.identity_url.blank?
|
||
|
end
|
||
|
|
||
|
else
|
||
|
puts "Skipping openid tests."
|
||
|
-
|
||
| extra/svn/reposman.rb | ||
|---|---|---|
|
# allow user to browse the repository within
|
||
|
# Redmine even for private project. If you want to share repositories
|
||
|
# through Redmine.pm, you need to use the apache owner.
|
||
|
# -g, --group=GROUP group of the repository. (default: root)
|
||
|
# --scm=SCM the kind of SCM repository you want to create (and register) in
|
||
|
# Redmine (default: Subversion). reposman is able to create Git
|
||
|
# and Subversion repositories. For all other kind (Bazaar,
|
||
| ... | ... | |
|
require 'find'
|
||
|
require 'etc'
|
||
|
Version = "1.2"
|
||
|
Version = "1.3"
|
||
|
SUPPORTED_SCM = %w( Subversion Darcs Mercurial Bazaar Git Filesystem )
|
||
|
opts = GetoptLong.new(
|
||
|
['--svn-dir', '-s', GetoptLong::REQUIRED_ARGUMENT],
|
||
|
['--redmine-host', '-r', GetoptLong::REQUIRED_ARGUMENT],
|
||
|
['--owner', '-o', GetoptLong::REQUIRED_ARGUMENT],
|
||
|
['--group', '-g', GetoptLong::REQUIRED_ARGUMENT],
|
||
|
['--url', '-u', GetoptLong::REQUIRED_ARGUMENT],
|
||
|
['--command' , '-c', GetoptLong::REQUIRED_ARGUMENT],
|
||
|
['--scm', GetoptLong::REQUIRED_ARGUMENT],
|
||
| ... | ... | |
|
$redmine_host = ''
|
||
|
$repos_base = ''
|
||
|
$svn_owner = 'root'
|
||
|
$svn_group = 'root'
|
||
|
$use_groupid = true
|
||
|
$svn_url = false
|
||
|
$test = false
|
||
| ... | ... | |
|
when '--svn-dir'; $repos_base = arg.dup
|
||
|
when '--redmine-host'; $redmine_host = arg.dup
|
||
|
when '--owner'; $svn_owner = arg.dup; $use_groupid = false;
|
||
|
when '--group'; $svn_group = arg.dup; $use_groupid = false;
|
||
|
when '--url'; $svn_url = arg.dup
|
||
|
when '--scm'; $scm = arg.dup.capitalize; log("Invalid SCM: #{$scm}", :exit => true) unless SUPPORTED_SCM.include?($scm)
|
||
|
when '--command'; $command = arg.dup
|
||
| ... | ... | |
|
if RUBY_PLATFORM =~ /mswin/
|
||
|
yield if block_given?
|
||
|
else
|
||
|
uid, gid = Etc.getpwnam($svn_owner).uid, ($use_groupid ? Etc.getgrnam(project.identifier).gid : 0)
|
||
|
uid, gid = Etc.getpwnam($svn_owner).uid, ($use_groupid ? Etc.getgrnam(project.identifier).gid : Etc.getgrnam($svn_group).gid)
|
||
|
right = project.is_public ? 0775 : 0770
|
||
|
yield if block_given?
|
||
|
Find.find(repos_path) do |f|
|
||
|
-
|
||
| lang/ru.yml | ||
|---|---|---|
|
text_user_wrote: '%s написал(а):'
|
||
|
text_wiki_destroy_confirmation: Вы уверены, что хотите удалить данную Wiki и все ее содержимое?
|
||
|
text_workflow_edit: Выберите роль и трекер для редактирования последовательности состояний
|
||
|
text_plugin_assets_writable: Каталог для плагинов доступен по записи
|
||
|
warning_attachments_not_saved: "%d файл(ов) невозможно сохранить."
|
||
|
button_create_and_continue: Создать и продолжить
|
||
|
text_custom_field_possible_values_info: 'По одному значению в каждой строке'
|
||
|
label_display: Отображение
|
||
|
field_editable: Редактируемый
|
||
|
setting_repository_log_display_limit: Maximum number of revisions displayed on file log
|
||
|
setting_repository_log_display_limit: Максимальное количество отображаемых ревизий в журнале файлов
|
||
|
field_identity_url: OpenID URL
|
||
|
setting_openid: Allow OpenID login and registration
|
||
|
label_login_with_open_id_option: or login with OpenID
|
||
|
field_watcher: Watcher
|
||
|
setting_openid: Разрешать вход и регистрацию под логином OpenID
|
||
|
label_login_with_open_id_option: или войти с помощью OpenID
|
||
|
field_watcher: Наблюдатель
|
||
| lang/zh-tw.yml | ||
|---|---|---|
|
field_admin: 管理者
|
||
|
field_last_login_on: 最近連線日期
|
||
|
field_language: 語系
|
||
|
field_identity_url: OpenID 網址
|
||
|
field_effective_date: 日期
|
||
|
field_password: 目前密碼
|
||
|
field_new_password: 新密碼
|
||
| ... | ... | |
|
field_comments_sorting: 註解排序
|
||
|
field_parent_title: 父頁面
|
||
|
field_editable: 可編輯
|
||
|
field_watcher: 觀察者
|
||
|
setting_app_title: 標題
|
||
|
setting_app_subtitle: 副標題
|
||
| ... | ... | |
|
setting_gravatar_enabled: 啟用 Gravatar 全球認證大頭像
|
||
|
setting_diff_max_lines_displayed: 差異顯示行數之最大值
|
||
|
setting_repository_log_display_limit: 版次顯示數目之最大值
|
||
|
setting_openid: 允許使用 OpenID 登入與註冊
|
||
|
permission_edit_project: 編輯專案
|
||
|
permission_select_project_modules: 選擇專案模組
|
||
| ... | ... | |
|
label_information_plural: 資訊
|
||
|
label_please_login: 請先登入
|
||
|
label_register: 註冊
|
||
|
label_login_with_open_id_option: 或使用 OpenID 登入
|
||
|
label_password_lost: 遺失密碼
|
||
|
label_home: 網站首頁
|
||
|
label_my_page: 帳戶首頁
|
||
| ... | ... | |
|
enumeration_issue_priorities: 項目優先權
|
||
|
enumeration_doc_categories: 文件分類
|
||
|
enumeration_activities: 活動 (時間追蹤)
|
||
|
field_identity_url: OpenID URL
|
||
|
setting_openid: Allow OpenID login and registration
|
||
|
label_login_with_open_id_option: or login with OpenID
|
||
|
field_watcher: Watcher
|
||
| lang/zh.yml | ||
|---|---|---|
|
field_admin: 管理员
|
||
|
field_last_login_on: 最后登录
|
||
|
field_language: 语言
|
||
|
field_identity_url: OpenID URL
|
||
|
field_effective_date: 日期
|
||
|
field_password: 密码
|
||
|
field_new_password: 新密码
|
||
| ... | ... | |
|
field_comments_sorting: 显示注释
|
||
|
field_parent_title: 上级页面
|
||
|
field_editable: 可编辑
|
||
|
field_watcher: 跟踪者
|
||
|
setting_app_title: 应用程序标题
|
||
|
setting_app_subtitle: 应用程序子标题
|
||
| ... | ... | |
|
setting_gravatar_enabled: 使用Gravatar用户头像
|
||
|
setting_diff_max_lines_displayed: 查看差别页面上显示的最大行数
|
||
|
setting_repository_log_display_limit: 在文件变更记录页面上显示的最大修订版本数量
|
||
|
setting_openid: 允许使用OpenID登录和注册
|
||
|
permission_edit_project: 编辑项目
|
||
|
permission_select_project_modules: 选择项目模块
|
||
| ... | ... | |
|
label_information_plural: 信息
|
||
|
label_please_login: 请登录
|
||
|
label_register: 注册
|
||
|
label_login_with_open_id_option: 或使用OpenID登录
|
||
|
label_password_lost: 忘记密码
|
||
|
label_home: 主页
|
||
|
label_my_page: 我的工作台
|
||
| ... | ... | |
|
label_search_titles_only: 仅在标题中搜索
|
||
|
label_user_mail_option_all: "收取我的项目的所有通知"
|
||
|
label_user_mail_option_selected: "收取选中项目的所有通知..."
|
||
|
label_user_mail_option_none: "只收取我跟踪或参与的项目的通知"
|
||
|
label_user_mail_option_none: "只收取我跟踪或参与的事情的通知"
|
||
|
label_user_mail_no_self_notified: "不要发送对我自己提交的修改的通知"
|
||
|
label_registration_activation_by_email: 通过邮件认证激活帐号
|
||
|
label_registration_manual_activation: 手动激活帐号
|
||
| ... | ... | |
|
enumeration_issue_priorities: 问题优先级
|
||
|
enumeration_doc_categories: 文档类别
|
||
|
enumeration_activities: 活动(时间跟踪)
|
||
|
field_identity_url: OpenID URL
|
||
|
setting_openid: Allow OpenID login and registration
|
||
|
label_login_with_open_id_option: or login with OpenID
|
||
|
field_watcher: Watcher
|
||
|
-
|
||
| lang/hu.yml | ||
|---|---|---|
|
field_editable: Szerkeszthető
|
||
|
setting_repository_log_display_limit: Maximum hány revízió jelenjen meg a fájl logban
|
||
|
field_identity_url: OpenID URL
|
||
|
setting_openid: Allow OpenID login and registration
|
||
|
label_login_with_open_id_option: or login with OpenID
|
||
|
field_watcher: Watcher
|
||
|
setting_openid: OpenID bejelentkezés és regisztráció engedélyezése
|
||
|
label_login_with_open_id_option: vagy bejelentkezés OpenID használatával
|
||
|
field_watcher: Megfigyelő
|
||
| lang/pl.yml | ||
|---|---|---|
|
activerecord_error_not_a_date: nie jest prawidłową datą
|
||
|
activerecord_error_not_a_number: nie jest numerem
|
||
|
activerecord_error_not_same_project: nie należy do tego samego projektu
|
||
|
activerecord_error_taken: jest już wybrane
|
||
|
activerecord_error_taken: jest już zajęte
|
||
|
activerecord_error_too_long: jest za długie
|
||
|
activerecord_error_too_short: jest za krótkie
|
||
|
activerecord_error_wrong_length: ma złą długość
|
||
| ... | ... | |
|
setting_plain_text_mail: tylko tekst (bez HTML)
|
||
|
setting_protocol: Protokoł
|
||
|
setting_repositories_encodings: Kodowanie repozytoriów
|
||
|
setting_self_registration: Własna rejestracja umożliwiona
|
||
|
setting_self_registration: Samodzielna rejestracja użtytkowników
|
||
|
setting_sequential_project_identifiers: Generuj sekwencyjne identyfikatory projektów
|
||
|
setting_sys_api_enabled: Włączenie WS do zarządzania repozytorium
|
||
|
setting_text_formatting: Formatowanie tekstu
|
||
| ... | ... | |
|
text_diff_truncated: '... Ten plik różnic został przycięty ponieważ jest zbyt długi.'
|
||
|
setting_diff_max_lines_displayed: Maksymalna liczba linii różnicy do pokazania
|
||
|
text_plugin_assets_writable: Zapisywalny katalog zasobów wtyczek
|
||
|
warning_attachments_not_saved: "%d file(s) could not be saved."
|
||
|
field_editable: Editable
|
||
|
label_display: Display
|
||
|
button_create_and_continue: Create and continue
|
||
|
text_custom_field_possible_values_info: 'One line for each value'
|
||
|
setting_repository_log_display_limit: Maximum number of revisions displayed on file log
|
||
|
field_identity_url: OpenID URL
|
||
|
setting_openid: Allow OpenID login and registration
|
||
|
label_login_with_open_id_option: or login with OpenID
|
||
|
field_watcher: Watcher
|
||
|
warning_attachments_not_saved: "%d załącznik(ów) nie zostało zapisanych."
|
||
|
field_editable: Edytowalne
|
||
|
label_display: Wygląd
|
||
|
button_create_and_continue: Stwórz i dodaj kolejne
|
||
|
text_custom_field_possible_values_info: 'Każda wartość w osobnej linii'
|
||
|
setting_repository_log_display_limit: Maksymalna liczba rewizji wyświetlanych w logu pliku
|
||
|
field_identity_url: Identyfikator OpenID (URL)
|
||
|
setting_openid: Logowanie i rejestracja przy użyciu OpenID
|
||
|
label_login_with_open_id_option: albo użyj OpenID
|
||
|
field_watcher: Obserwator
|
||
| lang/pt-br.yml | ||
|---|---|---|
|
permission_edit_own_messages: Editar próprias mensagens
|
||
|
permission_delete_own_messages: Excluir próprias mensagens
|
||
|
label_user_activity: "Atividade de %s"
|
||
|
label_updated_time_by: Atualizado por %s à %s
|
||
|
label_updated_time_by: Atualizado por %s há %s
|
||
|
text_diff_truncated: '... Este diff foi truncado porque excede o tamanho máximo que pode ser exibido.'
|
||
|
setting_diff_max_lines_displayed: Número máximo de linhas exibidas no diff
|
||
|
text_plugin_assets_writable: Diretório de plugins gravável
|
||
| lang/sv.yml | ||
|---|---|---|
|
notice_can_t_change_password: Detta konto använder en extern autentiseringskälla. Det går inte att byta lösenord.
|
||
|
notice_account_lost_email_sent: Ett mail med instruktioner om hur man väljer ett nytt lösenord har skickats till dig.
|
||
|
notice_account_activated: Ditt konto har blivit aktiverat. Du kan nu logga in.
|
||
|
notice_successful_create: Skapandet lyckades.
|
||
|
notice_successful_create: Skapades korrekt.
|
||
|
notice_successful_update: Uppdatering lyckades.
|
||
|
notice_successful_delete: Borttagning lyckades.
|
||
|
notice_successful_connection: Uppkoppling lyckades.
|
||
| ... | ... | |
|
notice_unable_delete_version: Denna version var inte möjlig att ta bort.
|
||
|
error_can_t_load_default_data: "Standardkonfiguration gick inte att läsa in: %s"
|
||
|
error_scm_not_found: "Inlägg och/eller revision finns inte i detta repository."
|
||
|
error_scm_command_failed: "Ett fel inträffade vid försök att nå repositoryt: %s"
|
||
|
error_scm_not_found: "Inlägg och/eller revision finns inte i detta versionsarkiv."
|
||
|
error_scm_command_failed: "Ett fel inträffade vid försök att nå versionsarkivet: %s"
|
||
|
error_scm_annotate: "Inlägget existerar inte eller kan inte kommenteras."
|
||
|
error_issue_not_found_in_project: 'Ärendet hittades inte eller så tillhör det inte detta projekt'
|
||
| ... | ... | |
|
field_admin: Administratör
|
||
|
field_last_login_on: Senaste inloggning
|
||
|
field_language: Språk
|
||
|
field_identity_url: OpenID URL
|
||
|
field_effective_date: Datum
|
||
|
field_password: Lösenord
|
||
|
field_new_password: Nytt lösenord
|
||
| ... | ... | |
|
field_comments_sorting: Visa kommentarer
|
||
|
field_parent_title: Föräldersida
|
||
|
field_editable: Redigerbar
|
||
|
field_watcher: Bevakare
|
||
|
setting_app_title: Applikationsrubrik
|
||
|
setting_app_subtitle: Applikationsunderrubrik
|
||
| ... | ... | |
|
setting_self_registration: Självregistrering
|
||
|
setting_attachment_max_size: Maxstorlek på bilaga
|
||
|
setting_issues_export_limit: Exportgräns för ärenden
|
||
|
setting_mail_from: Mailavsändare
|
||
|
setting_mail_from: Avsändare
|
||
|
setting_bcc_recipients: Hemlig kopia (bcc) till mottagare
|
||
|
setting_plain_text_mail: Oformaterad text i mail (ingen HTML)
|
||
|
setting_host_name: Värddatornamn
|
||
| ... | ... | |
|
setting_feeds_limit: Innehållsgräns för Feed
|
||
|
setting_default_projects_public: Nya projekt är publika som standard
|
||
|
setting_autofetch_changesets: Automatisk hämtning av commits
|
||
|
setting_sys_api_enabled: Aktivera WS för repository-hantering
|
||
|
setting_sys_api_enabled: Aktivera WS för versionsarkivhantering
|
||
|
setting_commit_ref_keywords: Referens-nyckelord
|
||
|
setting_commit_fix_keywords: Fix-nyckelord
|
||
|
setting_autologin: Automatisk inloggning
|
||
| ... | ... | |
|
setting_time_format: Tidsformat
|
||
|
setting_cross_project_issue_relations: Tillåt ärenderelationer mellan projekt
|
||
|
setting_issue_list_default_columns: Standardkolumner i ärendelistan
|
||
|
setting_repositories_encodings: Teckenuppsättningar för repositoriy
|
||
|
setting_repositories_encodings: Teckenuppsättningar för versionsarkiv
|
||
|
setting_commit_logs_encoding: Teckenuppsättning för commit-meddelanden
|
||
|
setting_emails_footer: Mailsignatur
|
||
|
setting_emails_footer: Signatur
|
||
|
setting_protocol: Protokoll
|
||
|
setting_per_page_options: Alternativ, objekt per sida
|
||
|
setting_user_format: Visningsformat för användare
|
||
| ... | ... | |
|
setting_gravatar_enabled: Använd Gravatar-avatarer
|
||
|
setting_diff_max_lines_displayed: Maximalt antal synliga rader i diff
|
||
|
setting_repository_log_display_limit: Maximalt antal revisioner i filloggen
|
||
|
setting_openid: Tillåt inloggning och registrering med OpenID
|
||
|
permission_edit_project: Ändra projekt
|
||
|
permission_select_project_modules: Välja projektmoduler
|
||
| ... | ... | |
|
permission_edit_issues: Ändra ärende
|
||
|
permission_manage_issue_relations: Hantera ärenderelationer
|
||
|
permission_add_issue_notes: Lägga till notering
|
||
|
permission_edit_issue_notes: Ändra noteringar
|
||
|
permission_edit_own_issue_notes: Ändra egna noteringar
|
||
|
permission_edit_issue_notes: Ändra ärendenoteringar
|
||
|
permission_edit_own_issue_notes: Ändra egna ärendenoteringar
|
||
|
permission_move_issues: Flytta ärenden
|
||
|
permission_delete_issues: Ta bort ärenden
|
||
|
permission_manage_public_queries: Hantera publika frågor
|
||
| ... | ... | |
|
permission_add_issue_watchers: Lägga till bevakare
|
||
|
permission_log_time: Logga spenderad tid
|
||
|
permission_view_time_entries: Visa spenderad tid
|
||
|
permission_edit_time_entries: Ändra tidloggar
|
||
|
permission_edit_own_time_entries: Ändra egna tidloggar
|
||
|
permission_edit_time_entries: Ändra tidloggningar
|
||
|
permission_edit_own_time_entries: Ändra egna tidloggningar
|
||
|
permission_manage_news: Hantera nyheter
|
||
|
permission_comment_news: Kommentera nyheter
|
||
|
permission_manage_documents: Hantera dokument
|
||
| ... | ... | |
|
permission_edit_wiki_pages: Ändra wikisidor
|
||
|
permission_delete_wiki_pages_attachments: Ta bort bilagor
|
||
|
permission_protect_wiki_pages: Skydda wikisidor
|
||
|
permission_manage_repository: Hantera repository
|
||
|
permission_browse_repository: Bläddra i repository
|
||
|
permission_manage_repository: Hantera versionsarkiv
|
||
|
permission_browse_repository: Bläddra i versionsarkiv
|
||
|
permission_view_changesets: Visa changesets
|
||
|
permission_commit_access: Commit-tillgång
|
||
|
permission_commit_access: Commit-åtkomst
|
||
|
permission_manage_boards: Hantera forum
|
||
|
permission_view_messages: Visa meddelanden
|
||
|
permission_add_messages: Lägg till meddelanden
|
||
| ... | ... | |
|
project_module_documents: Dokument
|
||
|
project_module_files: Filer
|
||
|
project_module_wiki: Wiki
|
||
|
project_module_repository: Repository
|
||
|
project_module_repository: Versionsarkiv
|
||
|
project_module_boards: Forum
|
||
|
label_user: Användare
|
||
| ... | ... | |
|
label_tracker_new: Ny ärendetyp
|
||
|
label_workflow: Arbetsflöde
|
||
|
label_issue_status: Ärendestatus
|
||
|
label_issue_status_plural: Ärendestatusar
|
||
|
label_issue_status_plural: Ärendestatus
|
||
|
label_issue_status_new: Ny status
|
||
|
label_issue_category: Ärendekategori
|
||
|
label_issue_category_plural: Ärendekategorier
|
||
| ... | ... | |
|
label_custom_field: Användardefinerat fält
|
||
|
label_custom_field_plural: Användardefinerade fält
|
||
|
label_custom_field_new: Nytt användardefinerat fält
|
||
|
label_enumerations: Enumerationer
|
||
|
label_enumerations: Uppräkningar
|
||
|
label_enumeration_new: Nytt värde
|
||
|
label_information: Information
|
||
|
label_information_plural: Information
|
||
|
label_please_login: Var god logga in
|
||
|
label_register: Registrera
|
||
|
label_login_with_open_id_option: eller logga in med OpenID
|
||
|
label_password_lost: Glömt lösenord
|
||
|
label_home: Hem
|
||
|
label_my_page: Min sida
|
||
| ... | ... | |
|
label_total: Total
|
||
|
label_permissions: Behörigheter
|
||
|
label_current_status: Nuvarande status
|
||
|
label_new_statuses_allowed: Nya statusar tillåtna
|
||
|
label_new_statuses_allowed: Nya tillåtna statusvärden
|
||
|
label_all: alla
|
||
|
label_none: ingen
|
||
|
label_nobody: ingen
|
||
| ... | ... | |
|
label_contains: innehåller
|
||
|
label_not_contains: innehåller inte
|
||
|
label_day_plural: dagar
|
||
|
label_repository: Repository
|
||
|
label_repository_plural: Repositorys
|
||
|
label_repository: Versionsarkiv
|
||
|
label_repository_plural: Versionsarkiv
|
||
|
label_browse: Bläddra
|
||
|
label_modification: %d ändring
|
||
|
label_modification_plural: %d ändringar
|
||
| ... | ... | |
|
label_user_mail_option_all: "För alla händelser i mina projekt"
|
||
|
label_user_mail_option_selected: "För alla händelser i markerade projekt..."
|
||
|
label_user_mail_option_none: "Endast för saker jag bevakar eller är involverad i"
|
||
|
label_user_mail_no_self_notified: "Jag vill inte bli notifierad om ändringar som jag har gjort"
|
||
|
label_user_mail_no_self_notified: "Jag vill inte bli underrättad om ändringar som jag har gjort"
|
||
|
label_registration_activation_by_email: kontoaktivering med mail
|
||
|
label_registration_manual_activation: manuell kontoaktivering
|
||
|
label_registration_automatic_activation: automatisk kontoaktivering
|
||
| ... | ... | |
|
text_issue_category_destroy_question: Några ärenden (%d) är tilldelade till denna kategori. Vad vill du göra ?
|
||
|
text_issue_category_destroy_assignments: Ta bort kategoritilldelningar
|
||
|
text_issue_category_reassign_to: Återtilldela ärenden till denna kategori
|
||
|
text_user_mail_option: "För omarkerade projekt kommer du bara få notifieringar om saker du bevakar eller är inblandad i (T.ex. ärenden du skapat eller tilldelats)."
|
||
|
text_no_configuration_data: "Roller, ärendetyper, ärendestatusar och arbetsflöden har inte konfigurerats ännu.\nDet rekommenderas att läsa in standardkonfigurationen. Du kommer att kunna göra ändringar efter att den blivit inläst."
|
||
|
text_user_mail_option: "För omarkerade projekt kommer du bara bli underrättad om saker du bevakar eller är inblandad i (T.ex. ärenden du skapat eller tilldelats)."
|
||
|
text_no_configuration_data: "Roller, ärendetyper, ärendestatus och arbetsflöden har inte konfigurerats ännu.\nDet rekommenderas att läsa in standardkonfigurationen. Du kommer att kunna göra ändringar efter att den blivit inläst."
|
||
|
text_load_default_configuration: Läs in standardkonfiguration
|
||
|
text_status_changed_by_changeset: Tilldelad i changeset %s.
|
||
|
text_issues_destroy_confirmation: 'Är du säker på att du vill radera markerade ärende(n) ?'
|
||
|
text_select_project_modules: 'Välj vilka moduler som ska vara aktiva för projektet:'
|
||
|
text_default_administrator_account_changed: Standardadministratörens konto ändrat
|
||
|
text_file_repository_writable: Foldern för bifogade filer är skrivbar
|
||
|
text_plugin_assets_writable: Foldern för plug-ins är skrivbar
|
||
|
text_file_repository_writable: Arkivet för bifogade filer är skrivbar
|
||
|
text_plugin_assets_writable: Arkivet för plug-ins är skrivbar
|
||
|
text_rmagick_available: RMagick tillgängligt (valfritt)
|
||
|
text_destroy_time_entries_question: %.02f timmar har rapporterats på ärendena du är på väg att ta bort. Vad vill du göra ?
|
||
|
text_destroy_time_entries: Ta bort rapporterade timmar
|
||
| ... | ... | |
|
text_user_wrote: '%s skrev:'
|
||
|
text_enumeration_destroy_question: '%d objekt är tilldelade till detta värde.'
|
||
|
text_enumeration_category_reassign_to: 'Återtilldela till detta värde:'
|
||
|
text_email_delivery_not_configured: "Mailfunktionen har inte konfigurerats, och notifieringar är inaktiverade.\nKonfigurera din SMTP-server i config/email.yml och starta om applikationen för att aktivera dem."
|
||
|
text_repository_usernames_mapping: "Välj eller uppdatera den Redmine-användare som är mappad till varje användarnamn i repository-loggen.\nAnvändare med samma användarnamn eller emailadress i både Redmine och repositoryt mappas automatiskt."
|
||
|
text_email_delivery_not_configured: "Mailfunktionen har inte konfigurerats, och notifieringar via mail kan därför inte skickas.\nKonfigurera din SMTP-server i config/email.yml och starta om applikationen för att aktivera dem."
|
||
|
text_repository_usernames_mapping: "Välj eller uppdatera den Redmine-användare som är mappad till varje användarnamn i versionarkivloggen.\nAnvändare med samma användarnamn eller emailadress i både Redmine och versionsarkivet mappas automatiskt."
|
||
|
text_diff_truncated: '... Denna diff har förminskats eftersom den överskrider den maximala storlek som kan visas.'
|
||
|
text_custom_field_possible_values_info: 'En rad för varje värde'
|
||
| ... | ... | |
|
enumeration_issue_priorities: Ärendeprioriteter
|
||
|
enumeration_doc_categories: Dokumentkategorier
|
||
|
enumeration_activities: Aktiviteter (tidsuppföljning)
|
||
|
field_identity_url: OpenID URL
|
||
|
setting_openid: Allow OpenID login and registration
|
||
|
label_login_with_open_id_option: or login with OpenID
|
||
|
field_watcher: Watcher
|
||
|
-
|
||
| app/models/project.rb | ||
|---|---|---|
|
validates_length_of :homepage, :maximum => 255
|
||
|
validates_length_of :identifier, :in => 2..20
|
||
|
validates_format_of :identifier, :with => /^[a-z0-9\-]*$/
|
||
|
|
||
|
validates_each :identifier do |record, attr, value|
|
||
|
record.errors.add attr, 'Identifiers cannot be named Documents' if value.downcase.strip == 'documents'
|
||
|
end
|
||
|
|
||
|
before_destroy :delete_all_members
|
||
|
named_scope :has_module, lambda { |mod| { :conditions => ["#{Project.table_name}.id IN (SELECT em.project_id FROM #{EnabledModule.table_name} em WHERE em.name=?)", mod.to_s] } }
|
||
| test/unit/project_test.rb | ||
|---|---|---|
|
assert_equal "activerecord_error_blank", @ecookbook.errors.on(:name)
|
||
|
end
|
||
|
|
||
|
def test_validate_documents_identifier
|
||
|
project = Project.new(:name => "documents", :identifier => "documents")
|
||
|
assert !project.save
|
||
|
assert_equal 2, project.errors.count
|
||
|
project = Project.new(:name => "documents", :identifier => " dOcuMents ")
|
||
|
assert !project.save
|
||
|
assert_equal 3, project.errors.count
|
||
|
end
|
||
|
|
||
|
def test_archive
|
||
|
user = @ecookbook.members.first.user
|
||
|
@ecookbook.archive
|
||