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
21821c8c
Commit
21821c8c
authored
Jul 02, 2016
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Fixed conf item CSV import
parent
131ebe88
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
import-im_conf_item.tcl
www/import-im_conf_item.tcl
+9
-2
No files found.
www/import-im_conf_item.tcl
View file @
21821c8c
...
...
@@ -215,6 +215,10 @@ foreach csv_line_fields $values_list_of_lists {
}
incr i
}
if
{
$ns
_write_p
}
{
ns_write
"<li>Before conf_item_nr: name=
$conf
_item_name, code=
$conf
_item_code, nr=
$conf
_item_nr</font>
\n
"
}
# -------------------------------------------------------
...
...
@@ -230,10 +234,10 @@ foreach csv_line_fields $values_list_of_lists {
}
# conf_item_nr needs to be there
if
{
""
==
$conf
_item_nr
}
{
if
{
""
eq
$conf
_item_nr
}
{
set conf_item_nr
[
regsub
{[
^a-z0-9_
]}
[
string
trim
[
string
tolower
$conf
_item_name
]]
"_"
]
}
if
{
""
==
$conf
_item_nr
}
{
if
{
""
eq
$conf
_item_nr
}
{
if
{
$ns
_write_p
}
{
ns_write
"<li><font color=red>Error: We have found an empty 'Conf_Item Nr' in line
$cnt.
<br>
Please correct the CSV file. Every conf_item needs to have a unique Conf_Item Nr.</font>
\n
"
...
...
@@ -303,6 +307,9 @@ foreach csv_line_fields $values_list_of_lists {
}
}
if
{
$ns
_write_p
}
{
ns_write
"<li>id=
$conf
_item_id, parent_id=
$conf
_item_parent_id, name='
$conf
_item_name', nr='
$conf
_item_nr'
\n
"
}
# Create a new conf_item if necessary
if
{
""
==
$conf
_item_id
}
{
if
{
$ns
_write_p
}
{
ns_write
"<li>Going to create conf_item: name='
$conf
_item_name', nr='
$conf
_item_nr'
\n
"
}
...
...
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