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
2b076656
Commit
2b076656
authored
Feb 21, 2013
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Risk Import:
Now working in general
parent
f532697d
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
165 additions
and
332 deletions
+165
-332
intranet-csv-import-procs.tcl
tcl/intranet-csv-import-procs.tcl
+61
-0
import-im_risk.tcl
www/import-im_risk.tcl
+104
-332
No files found.
tcl/intranet-csv-import-procs.tcl
View file @
2b076656
...
...
@@ -33,6 +33,39 @@ ad_proc -public im_id_from_user_name { name } {
return
$user
_id
}
ad_proc -public im_csv_import_parser_no_change
{
{
-parser_args
""
}
arg
}
{
Dummy parser without transformation
}
{
return
[
list
$arg
""
]
}
ad_proc -public im_csv_import_parser_project_nr
{
{
-parser_args
""
}
arg
}
{
Returns a project_id from project_nr
}
{
if
{[
regexp
{
'
}
$arg
match
]}
{
set err
"Found a Project Nr with single quote"
im_security_alert -location
"im_csv_import_parser_project_nr"
-message
$err
-value
$arg
return
[
list
$arg
$err
]
}
set sql
"
select min(p.project_id)
from im_projects p
where p.project_nr = '
$arg
'
"
set project_id
[
db_string project_id_from_nr
$sql
-default
""
]
set err
""
if
{
""
==
$project
_id
}
{
set err
"Didn't find project with project_nr='
$arg
'"
}
return
[
list
$project
_id
$err
]
}
ad_proc -public im_csv_import_parser_date_european
{
{
-parser_args
""
}
arg
...
...
@@ -62,6 +95,30 @@ ad_proc -public im_csv_import_parser_date_american {
return
[
list
""
"Error parsing American date format '
$arg
': expected 'dd.mm.yyyy'"
]
}
ad_proc -public im_csv_import_parser_number_european
{
{
-parser_args
""
}
arg
}
{
Parses a European number format like '20.000,00' as twenty thousand
}
{
set result
[
string
map -nocase
{
"."
""
}
$arg
]
set result
[
string
map -nocase
{
","
"."
}
$result
]
return
[
list
$result
""
]
}
ad_proc -public im_csv_import_parser_number_american
{
{
-parser_args
""
}
arg
}
{
Parses a European number format like '20.000,00' as twenty thousand
}
{
set result
[
string
map -nocase
{
","
""
}
$result
]
return
[
list
$result
""
]
}
ad_proc -public im_csv_import_parser_category
{
{
-parser_args
""
}
arg
...
...
@@ -217,9 +274,13 @@ ad_proc -public im_csv_import_parsers {
no_change
"No Change"
hard_coded
"Hard Coded Functionality"
date_european
"European Date Parser (DD.MM.YYYY)"
number_european
"European Number Parser (20.000,00)"
date_american
"American Date Parser (MM/DD/YYYY)"
number_american
"American Number Parser (20,000.00)"
category
"Category Parser"
cost_center
"Cost Center Parser"
project_nr
"Project from Project Nr"
project_name
"Project from Project Name"
}
}
default
{
...
...
www/import-im_risk.tcl
View file @
2b076656
This diff is collapsed.
Click to expand it.
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