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
96f48f4a
Commit
96f48f4a
authored
Mar 28, 2017
by
infrax
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Added percentage parser and applied to various
percentage ranged variables
parent
9c8e94b7
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
174 additions
and
155 deletions
+174
-155
intranet-csv-import-parser-procs.tcl
tcl/intranet-csv-import-parser-procs.tcl
+22
-4
intranet-csv-import-procs.tcl
tcl/intranet-csv-import-procs.tcl
+152
-151
No files found.
tcl/intranet-csv-import-parser-procs.tcl
View file @
96f48f4a
...
...
@@ -145,25 +145,29 @@ ad_proc -public im_csv_import_parser_project_nr {
ad_proc -public im_csv_import_parser_project_name
{
{
-parser_args
""
}
{
-parent_id
""
}
arg
}
{
Returns a project_id from project_name
}
{
if
{[
regexp
{
'
}
$arg
match
]}
{
set err
"Found a Project N
r
with single quote"
set err
"Found a Project N
ame
with single quote"
im_security_alert -location
"im_csv_import_parser_project_name"
-message
$err
-value
$arg
return
[
list
$arg
$err
]
}
set parent_sql
"p.parent_id is null"
if
{
""
ne
$parent
_id
}
{
set parent_sql
"p.parent_id = :parent_id"
}
set sql
"
select min(p.project_id)
from im_projects p
where
p.parent_id is nul
l and
p.project_name = '
$arg
'
where
$parent
_sq
l and
lower(trim(p.project_name)) = lower(trim('
$arg
'))
"
set project_id
[
db_string project_id_from_name
$sql
-default
""
]
set err
""
if
{
""
==
$project
_id
}
{
set err
"Didn't find project with project_name='
$arg
'"
}
if
{
""
==
$project
_id
}
{
set err
"Didn't find project with project_name='
$arg
'
and parent_id=#
$parent
_id
"
}
return
[
list
$project
_id
$err
]
}
...
...
@@ -265,6 +269,20 @@ ad_proc -public im_csv_import_parser_date_american {
}
ad_proc -public im_csv_import_parser_percentage
{
{
-parser_args
""
}
arg
}
{
Parses a percentage number.
Basically just ignores a trailing % char after a number.
}
{
if
{[
regexp
{
^
(
.+
)
%$
}
$arg
match number
]}
{
set arg
$number
}
return
[
im_csv_import_parser_number -parser_args
$parser
_args
$arg
]
}
ad_proc -public im_csv_import_parser_number
{
{
-parser_args
""
}
arg
...
...
tcl/intranet-csv-import-procs.tcl
View file @
96f48f4a
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