Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
OHR Support
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
97
Issues
97
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
OHR Support
Commits
3a16f3f5
Commit
3a16f3f5
authored
Dec 17, 2011
by
Eric Davis
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into unstable
parents
04eb115d
0d69fa6b
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
64 additions
and
17 deletions
+64
-17
change.rb
app/models/change.rb
+1
-1
issue.rb
app/models/issue.rb
+6
-0
environment.rb
config/environment.rb
+3
-0
10-patches.rb
config/initializers/10-patches.rb
+4
-0
rdm-mailhandler.rb
extra/mail_handler/rdm-mailhandler.rb
+1
-2
version.rb
lib/chili_project/version.rb
+7
-5
git_adapter.rb
lib/redmine/scm/adapters/git_adapter.rb
+3
-3
journal_test.rb
test/unit/journal_test.rb
+25
-0
README
vendor/chiliproject_plugins/README
+1
-0
acts_as_journalized.rb
...or/plugins/acts_as_journalized/lib/acts_as_journalized.rb
+9
-3
options.rb
...ts_as_journalized/lib/redmine/acts/journalized/options.rb
+4
-3
No files found.
app/models/change.rb
View file @
3a16f3f5
...
...
@@ -31,7 +31,7 @@ class Change < ActiveRecord::Base
def
from_path
# TODO: shouldn't access Changeset#to_utf8 directly
self
.
path
=
Changeset
.
to_utf8
(
read_attribute
(
:from_path
),
changeset_repository_encoding
)
self
.
from_
path
=
Changeset
.
to_utf8
(
read_attribute
(
:from_path
),
changeset_repository_encoding
)
end
def
init_path
...
...
app/models/issue.rb
View file @
3a16f3f5
...
...
@@ -405,6 +405,11 @@ class Issue < ActiveRecord::Base
!
due_date
.
nil?
&&
(
due_date
<
Date
.
today
)
&&
!
status
.
is_closed?
end
# Returns true if the issue is due today and not closed
def
due_today?
!
due_date
.
nil?
&&
(
due_date
==
Date
.
today
)
&&
!
status
.
is_closed?
end
# Is the amount of work done less than it should for the due date
def
behind_schedule?
return
false
if
start_date
.
nil?
||
due_date
.
nil?
...
...
@@ -560,6 +565,7 @@ class Issue < ActiveRecord::Base
s
=
"issue status-
#{
status
.
position
}
priority-
#{
priority
.
position
}
"
s
<<
' closed'
if
closed?
s
<<
' overdue'
if
overdue?
s
<<
' due-today'
if
due_today?
s
<<
' child'
if
child?
s
<<
' parent'
unless
leaf?
s
<<
' created-by-me'
if
User
.
current
.
logged?
&&
author_id
==
User
.
current
.
id
...
...
config/environment.rb
View file @
3a16f3f5
...
...
@@ -72,6 +72,9 @@ Rails::Initializer.run do |config|
# It will automatically turn deliveries on
config
.
action_mailer
.
perform_deliveries
=
false
# Insert vendor/chiliproject_plugins at the top of the plugin load paths
config
.
plugin_paths
.
insert
(
0
,
File
.
join
(
Rails
.
root
,
"vendor"
,
"chiliproject_plugins"
))
# Use redmine's custom plugin locater
require
File
.
join
(
RAILS_ROOT
,
"lib/redmine_plugin_locator"
)
config
.
plugin_locators
<<
RedminePluginLocator
...
...
config/initializers/10-patches.rb
View file @
3a16f3f5
...
...
@@ -12,6 +12,10 @@
# See doc/COPYRIGHT.rdoc for more details.
#++
# Patches active_support/core_ext/load_error.rb to support 1.9.3 LoadError message
if
RUBY_VERSION
>=
'1.9.3'
MissingSourceFile
::
REGEXPS
<<
[
/^cannot load such file -- (.+)$/i
,
1
]
end
require
'active_record'
...
...
extra/mail_handler/rdm-mailhandler.rb
View file @
3a16f3f5
#!/usr/bin/env ruby
#-- encoding: UTF-8
#-- copyright
# ChiliProject is a project management system.
...
...
@@ -12,8 +13,6 @@
# See doc/COPYRIGHT.rdoc for more details.
#++
#!/usr/bin/env ruby
# == Synopsis
#
# Reads an email from standard input and forward it to a Redmine server
...
...
lib/chili_project/version.rb
View file @
3a16f3f5
...
...
@@ -38,11 +38,13 @@ module ChiliProject
end
def
self
.
revision
revision
=
`git rev-parse HEAD`
if
revision
.
present?
revision
.
strip
[
0
..
8
]
else
nil
@revision
||=
begin
git
=
Redmine
::
Scm
::
Adapters
::
GitAdapter
git_dir
=
Rails
.
root
.
join
(
'.git'
)
if
File
.
directory?
git_dir
git
.
send
(
:shellout
,
"
#{
git
.
sq_bin
}
--git-dir='
#{
git_dir
}
' rev-parse --short=9 HEAD"
)
{
|
io
|
io
.
read
}.
to_s
.
chomp
end
end
end
...
...
lib/redmine/scm/adapters/git_adapter.rb
View file @
3a16f3f5
...
...
@@ -19,10 +19,10 @@ module Redmine
module
Adapters
class
GitAdapter
<
AbstractAdapter
SCM_GIT_REPORT_LAST_COMMIT
=
true
SCM_GIT_REPORT_LAST_COMMIT
=
true
unless
defined?
(
SCM_GIT_REPORT_LAST_COMMIT
)
# Git executable name
GIT_BIN
=
Redmine
::
Configuration
[
'scm_git_command'
]
||
"git"
GIT_BIN
=
Redmine
::
Configuration
[
'scm_git_command'
]
||
"git"
unless
defined?
(
GIT_BIN
)
# raised if scm command exited with error, e.g. unknown revision.
class
ScmCommandAborted
<
CommandFailed
;
end
...
...
@@ -176,7 +176,7 @@ module Redmine
from_to
<<
"
#{
identifier_from
}
.."
if
identifier_from
from_to
<<
"
#{
identifier_to
}
"
if
identifier_to
cmd_args
<<
from_to
if
!
from_to
.
empty?
cmd_args
<<
"--since=
#{
options
[
:since
].
strftime
(
"%Y-%m-%d %H:%M:%S"
)
}
"
if
options
[
:since
]
cmd_args
<<
"--since=
'
#{
options
[
:since
].
strftime
(
"%Y-%m-%d %H:%M:%S"
)
}
'
"
if
options
[
:since
]
cmd_args
<<
"--"
<<
scm_iconv
(
@path_encoding
,
'UTF-8'
,
path
)
if
path
&&
!
path
.
empty?
scm_cmd
*
cmd_args
do
|
io
|
...
...
test/unit/journal_test.rb
View file @
3a16f3f5
...
...
@@ -115,4 +115,29 @@ class JournalTest < ActiveSupport::TestCase
assert_equal
"Test setting fields on Journal from Issue"
,
@issue
.
last_journal
.
notes
assert_equal
@issue
.
author
,
@issue
.
last_journal
.
user
end
test
"subclasses of journaled models should have journal of parent type"
do
Ticket
=
Class
.
new
(
Issue
)
project
=
Project
.
generate!
ticket
=
Ticket
.
new
do
|
t
|
t
.
project
=
project
t
.
subject
=
"Test initial journal"
t
.
tracker
=
project
.
trackers
.
first
t
.
author
=
User
.
generate!
t
.
description
=
"Some content"
end
begin
oldstdout
=
$stdout
$stdout
=
StringIO
.
new
ticket
.
save!
assert
$stdout
.
string
.
empty?
,
"No errors should be logged to stdout."
ensure
$stdout
=
oldstdout
end
journal
=
ticket
.
journals
.
first
assert_equal
IssueJournal
,
journal
.
class
end
end
vendor/chiliproject_plugins/README
0 → 100644
View file @
3a16f3f5
Install ChiliProject plugins here and they will be automatically loaded.
vendor/plugins/acts_as_journalized/lib/acts_as_journalized.rb
View file @
3a16f3f5
...
...
@@ -32,6 +32,10 @@ module Redmine
end
module
ClassMethods
attr_writer
:journal_class_name
def
journal_class_name
defined?
(
@journal_class_name
)
?
@journal_class_name
:
superclass
.
journal_class_name
end
def
plural_name
self
.
name
.
underscore
.
pluralize
...
...
@@ -55,6 +59,8 @@ module Redmine
def
acts_as_journalized
(
options
=
{},
&
block
)
activity_hash
,
event_hash
,
journal_hash
=
split_option_hashes
(
options
)
self
.
journal_class_name
=
journal_hash
.
delete
(
:class_name
)
||
"
#{
name
.
gsub
(
"::"
,
"_"
)
}
Journal"
acts_as_activity
(
activity_hash
)
return
if
journaled?
...
...
@@ -77,13 +83,13 @@ module Redmine
(
journal_hash
[
:except
]
||=
[])
<<
self
.
primary_key
<<
inheritance_column
<<
:updated_on
<<
:updated_at
<<
:lock_version
<<
:lft
<<
:rgt
prepare_journaled_options
(
journal_hash
)
has_many
:journals
,
journal_hash
.
merge
({
:class_name
=>
journal_class
.
name
,
:foreign_key
=>
"journaled_id"
})
,
&
block
has_many
:journals
,
journal_hash
,
&
block
end
def
journal_class
journal_class_name
=
"
#{
name
.
gsub
(
"::"
,
"_"
)
}
Journal"
if
Object
.
const_defined?
(
journal_class_name
)
Object
.
const_get
(
journal_class_name
)
else
...
...
vendor/plugins/acts_as_journalized/lib/redmine/acts/journalized/options.rb
View file @
3a16f3f5
...
...
@@ -63,11 +63,12 @@ module Redmine::Acts::Journalized
options
.
symbolize_keys!
options
.
reverse_merge!
(
Configuration
.
options
)
options
.
reverse_merge!
(
:class_name
=>
'Journal'
,
:dependent
=>
:delete_all
:class_name
=>
journal_class_name
,
:dependent
=>
:delete_all
,
:foreign_key
=>
"journaled_id"
)
options
.
reverse_merge!
(
:order
=>
"
#{
options
[
:class_name
].
constantize
.
table_name
}
.version ASC"
:order
=>
"
#{
journal_class
.
table_name
}
.version ASC"
)
class_inheritable_accessor
:vestal_journals_options
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment