Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

? #1

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open

? #1

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
1f62d56
Fixed instance variable dependency and made match view match heading …
Sep 24, 2010
eabe3fa
Updated README
Sep 24, 2010
960f169
Made Custom Fields also match, and made the match work for either key…
Sep 24, 2010
94f1bd5
Oops, forgot to update version number.
Sep 25, 2010
ae86592
Switched to database for intermediate store
Oct 15, 2010
003d917
Updated README
Oct 15, 2010
fe7485d
Added zh: at the top, to fix Rails errors
fahadsadah Oct 2, 2010
b2106a4
Fixed two problems with users:
Mar 30, 2011
bbecb10
Added a new capability to import parent tasks.
Mar 30, 2011
211c568
Added an upload sample sheet and a screenshot of the needed UI.
Apr 2, 2011
28ac528
Fixed importer to work with custom fields as the unique column.
Apr 2, 2011
1ffceca
Added limited ability to import issue relationships (only one relatio…
Apr 3, 2011
82e7a11
Removed png file -- these belong in the wiki.
Apr 3, 2011
cae5207
Added capability to import watchers.
Apr 4, 2011
7fa9ad2
Added ability to auto-add categories and target versions.
Apr 6, 2011
5d48d2d
Added support for sending emails normally.
Apr 12, 2011
9f5dd3a
Finally got around to updating init.rb, and also added
Apr 13, 2011
da02409
Integrated the German localization from https://github.com/punknroll.
Apr 15, 2011
7d70898
Merge branch 'master' of [email protected]:leovitch/redmine_importer
Apr 15, 2011
e5674cd
pt_BR translation
tuler May 2, 2011
1e208a9
pt_BR translation bug
tuler May 2, 2011
73f6d7d
wrong translation filename
tuler May 2, 2011
9d051c1
Merge pull request #1 from tuler/master.
leovitch May 3, 2011
0cc2735
Included note in README to avoid the problem a users had where they r…
May 20, 2011
cfc6b2e
Added mention of pt-BR to README
May 20, 2011
c926fa0
Improved the formatting for the Chinese translation,
Jun 7, 2011
7743d05
Made the error message when a unique field is required
Jun 24, 2011
c7d86fb
Update Chinese translation with new error messages and checkboxes.
Jun 26, 2011
f7982e9
New error messages added to deutch.
Jun 27, 2011
5f65fd9
After a few fails with the following message "Access denied for user.…
Nov 30, 2011
37fc628
Added a fix for an obscure bug case: if you were importing
Jan 4, 2012
e95da47
Merge pull request #9 from patryyyck/patch-1
leovitch Jan 4, 2012
975739b
Fixed error produced when reporting on certain failed issues.
Jan 6, 2012
f1aad35
Merge branch 'master' of github.com:leovitch/redmine_importer
Jan 6, 2012
15b9405
- Added support for Redmine-1.2 custom field types. All types except …
Jan 6, 2012
7b1ba16
Added new test files.
Jan 6, 2012
5906a65
Merge branch 'master' of github.com:leovitch/redmine_importer
Jan 6, 2012
921bbd2
Fixed a bug introduced in the cache implementation.
Jan 7, 2012
6e6f4aa
Fixed a bug where blank parent task fields where sometimes
Jan 7, 2012
8383ed4
Updated README and init.rb to version 1.0.
Jan 7, 2012
c65c222
Incorporated fix for project-specific category and version search
Jan 7, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added capability to import watchers.
  • Loading branch information
Leo Hourvitz committed Apr 4, 2011
commit cae52078e5e32df3ec83e29eeb44577f36d6e0a3
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.~lock*
18 changes: 17 additions & 1 deletion app/controllers/importer_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ImporterController < ApplicationController
ISSUE_ATTRS = [:id, :subject, :assigned_to, :fixed_version,
:author, :description, :category, :priority, :tracker, :status,
:start_date, :due_date, :done_ratio, :estimated_hours,
:parent_issue]
:parent_issue, :watchers ]

def index
end
Expand Down Expand Up @@ -161,6 +161,7 @@ def result
category = IssueCategory.find_by_name(row[attrs_map["category"]])
assigned_to = row[attrs_map["assigned_to"]] != nil ? User.find_by_login(row[attrs_map["assigned_to"]]) : nil
fixed_version = Version.find_by_name(row[attrs_map["fixed_version"]])
watchers = row[attrs_map["watchers"]]
# new issue or find exists one
issue = Issue.new
journal = nil
Expand Down Expand Up @@ -260,6 +261,20 @@ def result
end
h
end

# watchers
if watchers
addable_watcher_users = issue.addable_watcher_users
watchers.split(',').each do |watcher|
watcher_user = User.find_by_login(watcher)
if (!watcher_user) || (issue.watcher_users.include?(watcher_user))
next
end
if addable_watcher_users.include?(watcher_user)
issue.add_watcher(watcher_user)
end
end
end

if (!issue.save)
# 记录错误
Expand All @@ -269,6 +284,7 @@ def result
if unique_field
@issue_by_unique_attr[row[unique_field]] = issue
end

# Issue relations
begin
IssueRelation::TYPES.each_pair do |rtype, rinfo|
Expand Down
4 changes: 2 additions & 2 deletions test/samples/AllStandardFields.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"Subject","Description","Assignee","Target version","Author","Category","Priority","Tracker","Status","Start date","Due date","% done","Estimated time"
"A full task","A lengthily described set of activities.","admin","The Target Version","admin","Default","High","Bug","In Progress",2011-05-01,2011-08-28,25,200
"Subject","Description","Assignee","Target version","Author","Category","Priority","Tracker","Status","Start date","Due date","% done","Estimated time","Watchers"
"A full task","A lengthily described set of activities.","admin","The Target Version","admin","Default","High","Bug","In Progress",05/01/11,08/28/11,25,200,"test1,test2"