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
f44de699
Commit
f44de699
authored
Dec 02, 2015
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-- made project_lead_id 'forgiving'
parent
6b926883
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
import-im_project.tcl
www/import-im_project.tcl
+18
-3
No files found.
www/import-im_project.tcl
View file @
f44de699
...
...
@@ -318,6 +318,7 @@ foreach csv_line_fields $values_list_of_lists {
if
{
""
==
$company
_id
}
{
set company_id
[
db_string cust
"select company_id from im_companies where lower(company_path) = trim(lower(:customer_name))"
-default
""
]
}
# For compatibility
set company_id
$company
_id
...
...
@@ -326,11 +327,25 @@ foreach csv_line_fields $values_list_of_lists {
if
{
$ns
_write_p
}
{
ns_write
"<li><font color=brown>Warning: Didn't find customer_name='
$customer
_name', using 'internal' customer</font>
\n
"
}
}
set project_lead_id
[
im_id_from_user_name
$project
_manager
]
if
{
""
==
$project
_lead_id &&
""
!=
$project
_manager
}
{
if
{
$ns
_write_p
}
{
ns_write
"<li><font color=brown>Warning: Didn't find project manager '
$project
_manager'.</font>
\n
"
}
# 'forgiving' routine -> project_lead_id might be empty or contain a name or email address.
# Check if empty:
if
{
""
eq
$project
_lead_id
}
{
if
{
$ns
_write_p
}
{
ns_write
"<li><font color=brown>Warning: No project manager found. Will try to create project w/o PM. </font>
\n
"
}
}
else
{
# Check if project_lead_id contains integer
if
{
!
[
string
is digit
$project
_lead_id
]
}
{
set project_lead_id
[
im_id_from_user_name
$project
_lead_id
]
if
{
""
eq
$project
_lead_id
}
{
ns_write
"<li><font color='red'>Warning: Didn't find a
\]
po
\[
user for: '
$project
_lead_id'.</font>
\n
"
}
}
# Check if project_lead_id can be found in DB
if
{
!
[
db_string sql
"select count(*) from parties where party_id = :project_lead_id"
-default 0
]
}
{
ns_write
"<li><font color='red'>Warning: Didn't find a
\]
po
\[
user for: '
$project
_lead_id'.</font>
\n
"
}
}
# ToDo: make import 'forgiving' -> see project_lead_id
set customer_contact_id
[
im_id_from_user_name
$customer
_contact
]
if
{
""
==
$customer
_contact_id &&
""
!=
$customer
_contact
}
{
if
{
$ns
_write_p
}
{
ns_write
"<li><font color=brown>Warning: Didn't find customer contact '
$customer
_contact'.</font>
\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