summaryrefslogtreecommitdiffstats
path: root/app/models/time_entry_import.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2020-02-19 14:52:02 +0000
committerGo MAEDA <maeda@farend.jp>2020-02-19 14:52:02 +0000
commitefbfc7616151c79ed26039103b0915e3a1978491 (patch)
treedd6df84053e383faa553c4cedf0453eb58df32e4 /app/models/time_entry_import.rb
parent4d341f0f143c0327c85ac67da0b984c453cee144 (diff)
downloadredmine-efbfc7616151c79ed26039103b0915e3a1978491.tar.gz
redmine-efbfc7616151c79ed26039103b0915e3a1978491.zip
Auto select fields mapping in import based on the internal field name (ex: estimared_hours, fixed_version, spent_on) or field label (Estimated hours, Version, Date) (#22913).
* mappings are case insensitive * a field is auto mapped only if there is no mapping setting present for that field * "Current user" default value for User field when the user has permission to log time for other users is override by the auto mapped column Patch by Haihan Ji, Yuichi HARADA, and Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@19524 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/time_entry_import.rb')
-rw-r--r--app/models/time_entry_import.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/models/time_entry_import.rb b/app/models/time_entry_import.rb
index fa33b60c5..ca3bd04dc 100644
--- a/app/models/time_entry_import.rb
+++ b/app/models/time_entry_import.rb
@@ -18,6 +18,15 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class TimeEntryImport < Import
+ AUTO_MAPPABLE_FIELDS = {
+ 'activity' => 'field_activity',
+ 'user' => 'field_user',
+ 'issue_id' => 'field_issue',
+ 'spent_on' => 'field_spent_on',
+ 'hours' => 'field_hours',
+ 'comments' => 'field_comments'
+ }
+
def self.menu_item
:time_entries
end