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
3fd42c59
Commit
3fd42c59
authored
Feb 21, 2013
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- CSV Import for Risks:
Now importing default report output
parent
2b076656
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
10 deletions
+40
-10
intranet-csv-import-procs.tcl
tcl/intranet-csv-import-procs.tcl
+37
-9
index.adp
www/index.adp
+3
-1
No files found.
tcl/intranet-csv-import-procs.tcl
View file @
3fd42c59
...
...
@@ -310,6 +310,25 @@ ad_proc -public im_csv_import_guess_parser {
<li>the field name to map to
</ul>
}
{
# --------------------------------------------------------
# Check for static mapping
set field_name_lower
[
string
tolower
$field
_name
]
set static_mapping_lol
{}
catch
{
set static_mapping_lol
[
im_csv_import_guess_$object_type
]
}
ns_log Notice
"im_csv_import_guess_parser: static_mapping=
$static
_mapping_lol"
foreach tuple
$static
_mapping_lol
{
set attribute_name
[
lindex
$tuple
0
]
set pretty_name
[
lindex
$tuple
1
]
set parser
[
lindex
$tuple
2
]
set parser_args
[
lindex
$tuple
3
]
if
{
$field
_name_lower ==
[
string
tolower
$pretty
_name
]}
{
ns_log Notice
"im_csv_import_guess_map: found statically encoded match with field_name=
$field
_name"
return
[
list
$parser
$parser
_args
$attribute
_name
]
}
}
# --------------------------------------------------------
# Hard Coded Mappings
...
...
@@ -453,13 +472,17 @@ ad_proc -public im_csv_import_guess_map {
return
[
lindex
$dynfield
_attribute_names
$idx
]
}
# set static_mapping_lol {
}
catch
{
}
set static_mapping_lol
[
im_csv_import_guess_map_$object_type
]
# Check for static mapping
set static_mapping_lol
{}
catch
{
set static_mapping_lol
[
im_csv_import_guess_$object_type
]
}
ns_log Notice
"im_csv_import_guess_map: static_mapping=
$static
_mapping_lol"
foreach tuple
$static
_mapping_lol
{
set attribute_name
[
lindex
$tuple
0
]
set pretty_name
[
lindex
$tuple
1
]
set parser
[
lindex
$tuple
2
]
set parser_args
[
lindex
$tuple
3
]
if
{
$field
_name_lower ==
[
string
tolower
$pretty
_name
]}
{
ns_log Notice
"im_csv_import_guess_map: found statically encoded match with field_name=
$field
_name"
return
$attribute
_name
...
...
@@ -473,15 +496,20 @@ ad_proc -public im_csv_import_guess_map {
return
""
}
ad_proc -public im_csv_import_guess_map_im_risk
{
}
{}
{
# ---------------------------------------------------------------------
# Default mapping for built-in
]
po
[
reports
# ---------------------------------------------------------------------
ad_proc -public im_csv_import_guess_im_risk
{
}
{}
{
set mapping
{
{
risk_name
"Risk Name"
no_change
""
}
{
risk_project_id
"Project"
p
arse
r
""
}
{
risk_status_id
"Status"
category
_parser
"Intranet Risk Status"
}
{
risk_type_id
"Type"
category
_parser
"Intranet Risk Type"
}
{
risk_project_id
"Project"
p
roject_n
r
""
}
{
risk_status_id
"Status"
category
"Intranet Risk Status"
}
{
risk_type_id
"Type"
category
"Intranet Risk Type"
}
{
risk_description
"Description"
no_change
""
}
{
risk_impact
"Impact"
parser
""
}
{
risk_probability_percent
"Probability"
parser
""
}
{
risk_impact
"Impact"
number_european
""
}
{
risk_probability_percent
"Probability"
number_european
""
}
}
return
$mapping
}
...
...
www/index.adp
View file @
3fd42c59
...
...
@@ -12,12 +12,14 @@
<td>
#intranet-csv-import.Object_Type#
</td>
<td>
<
%=
[
im_select
object_type
[
list
\
im_company
"
Company
"
\
im_project
"
Project
"
\
im_risk
"
Risk
"
\
im_timesheet_task
"
Timesheet
Task
"
\
person
"
User
"
\
]
$
object_type
]
%
>
<!-- im_company "Company" \ -->
</td>
</tr>
...
...
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