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
0b9d7e5a
Commit
0b9d7e5a
authored
Mar 13, 2015
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- CSV Import:
Now supporting (basic!) import of Conf Items
parent
bc995038
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
4 deletions
+42
-4
intranet-csv-import-procs.tcl
tcl/intranet-csv-import-procs.tcl
+36
-1
import-2.tcl
www/import-2.tcl
+3
-1
index.adp
www/index.adp
+3
-2
No files found.
tcl/intranet-csv-import-procs.tcl
View file @
0b9d7e5a
...
...
@@ -269,7 +269,7 @@ ad_proc -public im_csv_import_parsers {
Returns the list of available parsers
}
{
switch
$object
_type
{
im_project - im_company - im_risk - im_timesheet_task - im_ticket
{
im_project - im_company - im_
conf_item - im_
risk - im_timesheet_task - im_ticket
{
set parsers
{
no_change
"No Change"
hard_coded
"Hard Coded Functionality"
...
...
@@ -553,6 +553,41 @@ ad_proc -public im_csv_import_convert_project_parent_nrs {
ad_proc -public im_csv_import_convert_conf_item_parent_nrs
{
{
-parent_id
""
}
parent_nrs
}
{
Returns
{
parent_id err
}
}
{
ns_log Notice
"im_csv_import_convert_conf_item_parent_nrs -parent_id
$parent
_id
$parent
_nrs"
# Recursion end - just return the parent.
if
{
""
==
$parent
_nrs
}
{
return
[
list
$parent
_id
""
]
}
# Lookup the first parent_nr below the current parent_id
set parent_nr
[
lindex
$parent
_nrs 0
]
set parent_nrs
[
lrange
$parent
_nrs 1 end
]
set parent_sql
"=
$parent
_id"
if
{
""
==
$parent
_id
}
{
set parent_sql
"is null"
}
set parent_id
[
db_string pid
"
select conf_item_id
from im_conf_items
where conf_item_parent_id
$parent
_sql and
lower(conf_item_nr) = lower(:parent_nr)
"
]
if
{
""
==
$parent
_id
}
{
return
[
list
""
"Didn't find conf_item with conf_item_nr='
$conf
_item_nr' and parent_id='
$parent
_id'"
]
}
return
[
im_csv_import_convert_conf_item_parent_nrs -parent_id
$parent
_id
$parent
_nrs
]
}
# ---------------------------------------------------------------------
#
# ---------------------------------------------------------------------
...
...
www/import-2.tcl
View file @
0b9d7e5a
...
...
@@ -41,8 +41,10 @@ if { $max_n_bytes && ([file size $tmp_filename] > $max_n_bytes) } {
# Choose depending on the object type...
if
{
""
==
$return
_url
}
{
switch
$object
_type
{
im_project
{
set return_url
"/intranet/projects/index"
}
im_company
{
set return_url
"/intranet/companies/index"
}
im_conf_item
{
set return_url
"/intranet-helpdesk/index"
}
im_project
{
set return_url
"/intranet/projects/index"
}
person
{
set return_url
"/intranet/users/index"
}
default
{
set return_url
"/intranet"
}
}
}
...
...
www/index.adp
View file @
0b9d7e5a
...
...
@@ -12,11 +12,12 @@
<td>
#intranet-csv-import.Object_Type#
</td>
<td>
<
%=
[
im_select
object_type
[
list
\
im_project
"
Project
"
\
person
"
User
"
\
im_company
"
Company
"
\
im_conf_item
"
Configuration
Item
"
\
im_project
"
Project
"
\
im_risk
"
Risk
"
\
im_timesheet_task
"
Timesheet
Task
"
\
person
"
User
"
\
]
$
object_type
]
%
>
</td>
...
...
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