Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-csv-import
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-csv-import
Commits
8f491470
Commit
8f491470
authored
Apr 26, 2017
by
infrax
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Infrax extensions for work
parent
2a68d009
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
intranet-csv-import-procs.tcl
tcl/intranet-csv-import-procs.tcl
+17
-6
No files found.
tcl/intranet-csv-import-procs.tcl
View file @
8f491470
...
...
@@ -247,12 +247,14 @@ ad_proc -public im_csv_import_guess_im_project { } {} {
{
company_id
"Customer Name"
company_name
""
}
{
start_date
"Start Date"
date
""
}
{
end_date
"End Date"
date
""
}
{
project_name
"Name"
no_change
""
}
{
percent_completed
"Percent Completed"
percentage
""
}
{
project_lead_id
"Project Manager"
user_name
""
}
{
project_budget
"Budget"
number
""
}
{
project_budget_hours
"Budget Hours"
number
""
}
{
sort_order
"Sort Order"
number
""
}
{
note
"Note"
no_change
""
}
{
note
"Notes"
no_change
""
}
{
description
"Description"
no_change
""
}
}
return
$mapping
...
...
@@ -272,15 +274,21 @@ ad_proc -public im_csv_import_guess_im_timesheet_task { } {} {
{
gantt_project_id
"Gantt Project Id"
number
""
}
{
invoice_id
"Invoice Id"
number
""
}
{
material_id
"Material"
material
""
}
{
project_name
"Name"
no_change
""
}
{
note
"Note"
no_change
""
}
{
note
"Notes"
no_change
""
}
{
parent_id
"Parent Nrs"
project_parent_nrs
""
}
{
parent_nrs
"Parent Nrs"
project_parent_nrs
""
}
{
percent_completed
"Percent Completed"
percentage
""
}
{
percent_completed
"% Completed"
percentage
""
}
{
percent_completed
"% Complete"
percentage
""
}
{
planned_units
"Planned Units"
number
""
}
{
planned_units
"Work"
number
""
}
{
priority
"Priority"
number
""
}
{
project_budget
"Budget"
number
""
}
{
project_budget_hours
"Budget Hours"
number
""
}
{
project_lead_id
"Project Manager"
user_name
""
}
{
project_lead_id
"Assignee"
user_name
""
}
{
project_name
"Project Name"
no_change
""
}
{
project_nr
"Project Nr."
no_change
""
}
{
project_status_id
"Project Status"
category
"Intranet Project Status"
}
...
...
@@ -559,6 +567,7 @@ ad_proc -public im_csv_import_guess_map {
set pretty_name
[
lindex
$tuple
1
]
set parser
[
lindex
$tuple
2
]
set parser_args
[
lindex
$tuple
3
]
if
{
$field
_name_lower eq
[
csv_norm
$pretty
_name
]}
{
ns_log Notice
"im_csv_import_guess_map: found statically encoded match with field_name=
$field
_name"
return
$attribute
_name
...
...
@@ -594,12 +603,14 @@ ad_proc -public im_csv_import_guess_map {
}
# Check for a pretty_name of a DynField
set dynfield_pretty_names
[
util_memoize
[
list
db_list otype_dynfields
"select pretty_name from (
$dynfield
_sql) t"
]]
ns_log Notice
"im_csv_import_guess_map: pretty_names=
$dynfield
_pretty_names"
foreach field
$dynfield
_pretty_names
{
if
{
$field
_name_lower eq
[
csv_norm
$field
]}
{
ns_log Notice
"im_csv_import_guess_map: found pretty_name match with field_name=
$field
_name"
return
$field
_name_lower
set dynfield_pretty_name_tuples
[
util_memoize
[
list
db_list_of_lists otype_dynfields
"select attribute_name, pretty_name from (
$dynfield
_sql) t"
]]
ns_log Notice
"im_csv_import_guess_map: pretty_names=
$dynfield
_pretty_name_tuples"
foreach field_tuple
$dynfield
_pretty_name_tuples
{
set attribute_name
[
lindex
$field
_tuple 0
]
set pretty_name
[
lindex
$field
_tuple 1
]
if
{
$field
_name_lower eq
[
csv_norm
$pretty
_name
]}
{
ns_log Notice
"im_csv_import_guess_map: found pretty_name match with field_name=
$pretty
_name ->
$attribute
_name"
return
$attribute
_name
}
}
...
...
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