Commit 8a803576 authored by Frank Bergmann's avatar Frank Bergmann

- Added CSV import for Budget Items

parent 94e23af7
......@@ -479,7 +479,7 @@ ad_proc -public im_csv_import_parser_conf_item_parent_nrs {
{-parser_args "" }
arg
} {
Returns a project_id from a list of project_nr's
Returns a conf_item_id from a list of conf_item Nrs.
} {
set arg [string tolower [string trim $arg]]
set parent_id ""
......@@ -517,3 +517,48 @@ ad_proc -public im_csv_import_parser_conf_item_parent_nrs {
}
return [list $parent_id ""]
}
ad_proc -public im_csv_import_parser_budget_item_parent_nrs {
{-parser_args "" }
arg
} {
Returns a budget_item_id from a list of parent budget item numbers
} {
set arg [string tolower [string trim $arg]]
set parent_id ""
# Shortcut: Accept the name of a budget_item if it's found
set budget_item_ids [db_list budget_item_ids "select budget_item_id from im_budget_items where lower(budget_item_nr) = :arg"]
if {"" ne $budget_item_ids} {
if {1 eq [llength $budget_item_ids]} {
return [list [lindex $budget_item_ids 0] ""]
} else {
return [list "" "Found multiple budget_items with name '$arg': Please use a space separated list of budget_item_nrs."]
}
}
if {"" eq $budget_item_ids} {
set budget_item_ids [db_list budget_item_ids "select budget_item_id from im_budget_items where lower(budget_item_name) = :arg"]
if {"" ne $budget_item_ids} {
if {1 eq [llength $budget_item_ids]} {
return [list [lindex $budget_item_ids 0] ""]
} else {
return [list "" "Found multiple budget_items with name '$arg': Please use a space separated list of budget_item_nrs."]
}
}
}
# Loop through the list of parent_nrs
foreach parent_nr $arg {
set parent_sql "budget_item_parent_id = $parent_id"
if {"" eq $parent_id} { set parent_sql "budget_item_parent_id is null" }
set project_id [db_string pid "select budget_item_id from im_budget_items where $parent_sql and lower(budget_item_nr) = :parent_nr" -default ""]
if {"" eq $project_id} {
return [list "" "Didn't find budget_item with budget_item_nr='$parent_nr' and parent_id='$parent_id'"]
}
set parent_id $project_id
}
return [list $parent_id ""]
}
......@@ -346,6 +346,32 @@ ad_proc -public im_csv_import_guess_im_conf_item { } {} {
return $mapping
}
ad_proc -public im_csv_import_guess_im_budget_item { } {} {
set mapping {
{budget_item_parent_id "Parent Budget Item Nr" budget_item_parent_nrs ""}
{budget_item_parent_id "Budget Item Parent Nrs" budget_item_parent_nrs ""}
{budget_item_name "Budget Item Name" no_change ""}
{budget_item_nr "Budget Item Nr" no_change ""}
{budget_item_code "Budget Item Code" no_change ""}
{budget_item_object_id "Budget Item Project" project_parent_nrs ""}
{budget_item_object_id "Budget Item Object" project_parent_nrs ""}
{budget_item_status_id "Budget Item Status" category "Intranet Budget Item Status"}
{budget_item_type_id "Budget Item Type" category "Intranet Budget Item Type"}
{budget_item_owner_id "Budget Item Owner" user_name ""}
{budget_item_owner_id "Budget Item Owner Email" user_name ""}
{budget_item_max_value "Value" number ""}
{budget_item_max_value "Maximum Amount" number ""}
{budget_item_alarm_value "Alarm Value" number ""}
{match_cost_type_id "Cost Type" category "Intranet Cost Type"}
{match_expense_type_id "Expense Type" category "Intranet Expense Type"}
{match_task_id "Project Phase" project_parent_nrs ""}
{match_material_type_id "Material Type" category "Intranet Material Type"}
{description "Description" no_change ""}
{note "Note" no_change ""}
}
return $mapping
}
ad_proc -public im_csv_import_guess_im_hour { } {} {
set mapping {
{project_id "Project Nr Path " project_parent_nrs ""}
......@@ -395,9 +421,10 @@ ad_proc -public im_csv_import_parsers {
Returns the list of available parsers
} {
switch $object_type {
im_project - im_company - im_conf_item - im_cost - im_invoice - im_risk - im_timesheet_task - im_ticket - im_hour - person - im_expense_bundle - im_expense - rels {
im_project - im_company - im_budget_item - im_conf_item - im_cost - im_invoice - im_risk - im_timesheet_task - im_ticket - im_hour - person - im_expense_bundle - im_expense - rels {
set parsers {
no_change "No Change"
budget_item_parent_nrs "Budget Item Parent Nrs"
boolean "Boolean"
category "Category ID from Category Name"
company_name "Company ID from Company Name or Company Path"
......
Budget Item Parent Nrs;Budget Item Nr;Budget Item Name;Budget Item Project;Budget Item Owner;Budget Item Status;Budget Item Type;Maximum Amount;Description;Note
;WBS.031/17;Extended Systems Monitoring;Car Configurator;Ben Bigboss;Approved;Default;400.000 ;Build an extended version of current system's monitoring;
WBS.031/17;WBS.031/17.A;Provider Hardware;Car Configurator;Ben Bigboss;Approved;Default;100.000 ;;
WBS.031/17;WBS.031/17.B;Installation Hardware;Car Configurator;Ben Bigboss;Approved;Default;20.000 ;;
WBS.031/17;WBS.031/17.C;Software Licenses;Car Configurator;Ben Bigboss;Approved;Default;50.000 ;;
WBS.031/17;WBS.031/17.D;Software Installation;Car Configurator;Ben Bigboss;Approved;Default;10.000 ;;
WBS.031/17;WBS.052/17.A;Extend Fiber Network;Car Configurator;Ben Bigboss;Approved;Default;60.000 ;;Need to clarify existing network
WBS.031/17;WBS.052/17.B;Additional Sensors;Car Configurator;Ben Bigboss;Approved;Default;30.000 ;;
WBS.031/17;WBS.052/17.C;Database & OS Licenses;Car Configurator;Ben Bigboss;Approved;Default;15.000 ;;
WBS.031/17;WBS.052/17.D;Integration with legacy systems;Car Configurator;Ben Bigboss;Approved;Default;80.000 ;;
WBS.031/17;WBS.052/17.E;Optional Add-On Monitors;Car Configurator;Ben Bigboss;Requested;Default;20.000 ;Optional. Supervisory board will decide;
# /packages/intranet-csv-import/www/import-im_budget_item.tcl
#
ad_page_contract {
Starts the analysis process for the file imported
@author frank.bergmann@project-open.com
@param mapping_name: Should we store the current mapping in the DB for future use?
@param column: Name of the CSV column
@param map: Name of the ]po[ object attribute
@param parser: Converter for CSV data type -> ]po[ data type
} {
{ return_url "" }
{ upload_file "" }
{ import_filename "" }
{ mapping_name "" }
{ ns_write_p 1 }
column:array
map:array
parser:array
parser_args:array
}
# ---------------------------------------------------------------------
# Default & Security
# ---------------------------------------------------------------------
set current_user_id [auth::require_login]
set page_title [lang::message::lookup "" intranet-cvs-import.Upload_Objects "Upload Objects"]
set context_bar [im_context_bar "" $page_title]
set admin_p [im_is_user_site_wide_or_intranet_admin $current_user_id]
if {!$admin_p} {
ad_return_complaint 1 "Only administrators have the right to import objects"
ad_script_abort
}
# ---------------------------------------------------------------------
# Check and open the file
# ---------------------------------------------------------------------
if {![file readable $import_filename]} {
ad_return_complaint 1 "Unable to read the file '$import_filename'. <br>
Please check the file permissions or contact your system administrator.\n"
ad_script_abort
}
set encoding "utf-8"
if {[catch {
set fl [open $import_filename]
fconfigure $fl -encoding $encoding
set lines_content [read $fl]
close $fl
} err]} {
ad_return_complaint 1 "Unable to open file $import_filename:<br><pre>\n$err</pre>"
ad_script_abort
}
# Extract the header line from the file
set lines [split $lines_content "\n"]
set separator [im_csv_guess_separator $lines]
set lines_len [llength $lines]
set header [lindex $lines 0]
set header_fields [im_csv_split $header $separator]
set header_len [llength $header_fields]
set values_list_of_lists [im_csv_get_values $lines_content $separator]
# ------------------------------------------------------------
# Get DynFields
# Determine the list of actually available fields.
set mapped_vars [list "''"]
foreach k [array names map] {
lappend mapped_vars "'$map($k)'"
}
set dynfield_sql "
select distinct
aa.attribute_name,
aa.object_type,
aa.table_name,
w.parameters,
w.widget as tcl_widget,
substring(w.parameters from 'category_type \"(.*)\"') as category_type
from im_dynfield_widgets w,
im_dynfield_attributes a,
acs_attributes aa
where a.widget_name = w.widget_name and
a.acs_attribute_id = aa.attribute_id and
aa.object_type in ('im_budget_item') and
(also_hard_coded_p is null OR also_hard_coded_p = 'f') and
-- Only overwrite DynFields specified in the mapping
aa.attribute_name in ([join $mapped_vars ","])
"
set attribute_names [db_list attribute_names "
select distinct
attribute_name
from ($dynfield_sql) t
order by attribute_name
"]
# ------------------------------------------------------------
# Render Result Header
if {$ns_write_p} {
ad_return_top_of_page "
[im_header]
[im_navbar]
"
}
# ------------------------------------------------------------
set cnt 1
foreach csv_line_fields $values_list_of_lists {
incr cnt
if {$ns_write_p} { ns_write "</ul><hr><ul>\n" }
if {$ns_write_p} { ns_write "<li>Starting to parse line $cnt\n" }
# Preset values, defined by CSV sheet:
set budget_item_name ""
set budget_item_nr ""
set budget_item_parent_nrs ""
set budget_item_parent_id ""
set budget_item_status ""
set budget_item_status_id ""
set budget_item_type ""
set budget_item_type_id ""
set budget_item_owner_id ""
set budget_item_object_id ""
set budget_item_max_value ""
set budget_item_alarm_value ""
set description ""
set note ""
set sort_order ""
set ip_address ""
foreach attribute_name $attribute_names {
set $attribute_name ""
}
# -------------------------------------------------------
# Extract variables from the CSV file
#
set var_name_list [list]
for {set j 0} {$j < $header_len} {incr j} {
set var_name [string trim [lindex $header_fields $j]]
if {"" == $var_name} {
# No variable name - probably an empty column
continue
}
set var_name [string tolower $var_name]
set var_name [string map -nocase {" " "_" "\"" "" "'" "" "/" "_" "-" "_" "\[" "(" "\{" "(" "\}" ")" "\]" ")"} $var_name]
lappend var_name_list $var_name
ns_log notice "upload-companies-2: varname([lindex $header_fields $j]) = $var_name"
set var_value [string trim [lindex $csv_line_fields $j]]
set var_value [string map -nocase {"\"" "'" "\[" "(" "\{" "(" "\}" ")" "\]" ")"} $var_value]
if {"NULL" eq $var_value} { set var_value ""}
# replace unicode characters by non-accented characters
# Watch out! Does not work with Latin-1 characters
set var_name [im_mangle_unicode_accents $var_name]
set cmd "set $var_name \"$var_value\""
ns_log Notice "import-im_budget_item: cmd=$cmd"
set result [eval $cmd]
}
# -------------------------------------------------------
# Transform the variables
set i 0
foreach varname $var_name_list {
set p $parser($i)
set p_args $parser_args($i)
set target_varname $map($i)
ns_log Notice "import-im_budget_item: Parser: $varname -> $target_varname"
switch $p {
no_change { }
default {
set proc_name "im_csv_import_parser_$p"
if {[catch {
set val [set $varname]
if {"" != $val} {
set result [$proc_name -parser_args $p_args $val]
set res [lindex $result 0]
set err [lindex $result 1]
ns_log Notice "import-im_budget_item: Parser: '$p -args $p_args $val' -> $target_varname=$res, err=$err"
if {"" != $err} {
if {$ns_write_p} {
ns_write "<li><font color=brown>Warning: Error parsing field='$target_varname' using parser '$p':<pre>$err</pre></font>\n"
}
}
set $target_varname $res
}
} err_msg]} {
if {$ns_write_p} {
ns_write "<li><font color=brown>Warning: Error parsing field='$target_varname' using parser '$p':<pre>$err_msg</pre></font>"
}
}
}
}
incr i
}
if {$ns_write_p} { ns_write "<li>Before budget_item_nr: name=$budget_item_name, nr=$budget_item_nr</font>\n" }
# -------------------------------------------------------
# Specific field transformations
# budget_item_name needs to be there
if {"" == $budget_item_name} {
if {$ns_write_p} {
ns_write "<li><font color=red>Error: We have found an empty 'Budget_Item Name' in line $cnt.<br>
Please correct the CSV file. Every budget_items needs to have a unique Budget_Item Name.</font>\n"
}
continue
}
# budget_item_nr needs to be there
if {"" eq $budget_item_nr} {
set budget_item_nr [regsub {[^a-z0-9_]} [string trim [string tolower $budget_item_name]] "_"]
}
if {"" eq $budget_item_nr} {
if {$ns_write_p} {
ns_write "<li><font color=red>Error: We have found an empty 'Budget_Item Nr' in line $cnt.<br>
Please correct the CSV file. Every budget_item needs to have a unique Budget_Item Nr.</font>\n"
}
continue
}
# Status is a required field
set budget_item_status_id [im_id_from_category $budget_item_status "Intranet Budget Item Status"]
if {"" == $budget_item_status_id} {
if {$ns_write_p} { ns_write "<li><font color=brown>Warning: Didn't find budget_item status '$budget_item_status', using default status 'Open'</font>\n" }
set budget_item_status_id [im_budget_item_status_active]
}
# Type is a required field
set budget_item_type_id [im_id_from_category [list $budget_item_type] "Intranet Budget Item Type"]
if {"" == $budget_item_type_id} {
if {$ns_write_p} { ns_write "<li><font color=brown>Warning: Didn't find budget_item type '$budget_item_type', using default type 'Other'</font>\n" }
set budget_item_type_id [im_budget_item_type_software]
}
# -------------------------------------------------------
# Check if the budget_item already exists
set budget_item_parent_id_sql "= $budget_item_parent_id"
if {"" == $budget_item_parent_id} {
set budget_item_parent_id_sql "is null"
}
# Check if we find the same budget item by name with it's parent.
set budget_item_id_name [db_string budget_item_id "
select budget_item_id
from im_budget_items
where budget_item_parent_id $budget_item_parent_id_sql and
lower(trim(budget_item_name)) = lower(trim(:budget_item_name))
" -default ""]
set budget_item_id_nr [db_string budget_item_id "
select budget_item_id
from im_budget_items
where budget_item_parent_id $budget_item_parent_id_sql and
lower(trim(budget_item_nr)) = lower(trim(:budget_item_nr))
" -default ""]
set budget_item_id ""
if {"" eq $budget_item_id} { set budget_item_id $budget_item_id_name }
if {"" eq $budget_item_id} { set budget_item_id $budget_item_id_nr }
set error_p 0
if {$budget_item_id_name ne "" && $budget_item_id_name ne $budget_item_id} { set error_p 1 }
if {$budget_item_id_nr ne "" && $budget_item_id_nr ne $budget_item_id} { set error_p 1 }
if {$error_p} {
if {$ns_write_p} {
ns_write "<li><font color=red>Warning: We have found two different budget_items, one with
'Budget_Item Nr'=$budget_item_nr and a second one with 'Budget_Item Name'='$budget_item_name'.<br>
Please change one of the two budget_items to avoid this ambiguity.
</font>\n"
}
}
if {$ns_write_p} { ns_write "<li>id=$budget_item_id, parent_id=$budget_item_parent_id, name='$budget_item_name', nr='$budget_item_nr'\n" }
# Create a new budget_item if necessary
if {"" == $budget_item_id} {
if {$ns_write_p} { ns_write "<li>Going to create budget_item: name='$budget_item_name', nr='$budget_item_nr'\n" }
set var_hash(budget_item_name) $budget_item_name
set var_hash(budget_item_nr) $budget_item_nr
set var_hash(budget_item_parent_id) $budget_item_parent_id
set var_hash(budget_item_type_id) $budget_item_type_id
set var_hash(budget_item_status_id) $budget_item_status_id
if {[catch {
set budget_item_id [im_budget_item::new -var_hash [array get var_hash]]
} err_msg]} {
if {$ns_write_p} { ns_write "<li><font color=red>Error: Creating new budget_item:<br><pre>[ad_print_stack_trace]</pre></font>\n" }
continue
}
} else {
if {$ns_write_p} { ns_write "<li>Budget_Item already exists: name='$budget_item_name', nr='$budget_item_nr', id='$budget_item_id'\n" }
}
if {$ns_write_p} { ns_write "<li>Going to update the budget_item.\n" }
if {[catch {
db_dml update_budget_item "
update im_budget_items set
budget_item_name = :budget_item_name,
budget_item_nr = :budget_item_nr,
budget_item_parent_id = :budget_item_parent_id,
budget_item_status_id = :budget_item_status_id,
budget_item_type_id = :budget_item_type_id,
budget_item_owner_id = :budget_item_owner_id,
budget_item_object_id = :budget_item_object_id,
budget_item_max_value = :budget_item_max_value,
budget_item_alarm_value = :budget_item_alarm_value,
note = :note,
description = :description
where
budget_item_id = :budget_item_id
"
} err_msg]} {
if {$ns_write_p} { ns_write "<li><font color=red>Error: Error updating budget_item:<br><pre>$err_msg</pre></font>" }
continue
}
# Add the budget_item lead to the list of budget_item members
if {"" != $budget_item_owner_id} {
set role_id [im_biz_object_role_full_member]
im_biz_object_add_role $budget_item_owner_id $budget_item_id $role_id
}
# -------------------------------------------------------
# Import DynFields
set budget_item_dynfield_updates {}
set task_dynfield_updates {}
array unset attributes_hash
array set attributes_hash {}
db_foreach store_dynfiels $dynfield_sql {
ns_log Notice "import-im_budget_item: name=$attribute_name, otype=$object_type, table=$table_name"
# Avoid storing attributes multipe times into the same table.
# Sub-types can have the same attribute defined as the main type, so duplicate
# DynField attributes are OK.
set key "$attribute_name-$table_name"
if {[info exists attributes_hash($key)]} {
ns_log Notice "import-im_budget_item: name=$attribute_name already exists."
continue
}
set attributes_hash($key) $table_name
switch $table_name {
im_budget_items {
lappend budget_item_dynfield_updates "$attribute_name = :$attribute_name"
}
default {
ad_return_complaint 1 "<b>Dynfield Budgetiguration Error</b>:<br>
Attribute='$attribute_name' in table='$table_name' is not in im_budget_items."
}
}
}
if {$ns_write_p} { ns_write "<li>Going to update im_budget_item DynFields.\n" }
if {"" != $budget_item_dynfield_updates} {
set budget_item_update_sql "
update im_budget_items set
[join $budget_item_dynfield_updates ",\n\t\t"]
where budget_item_id = :budget_item_id
"
if {[catch {
db_dml budget_item_dynfield_update $budget_item_update_sql
} err_msg]} {
if {$ns_write_p} { ns_write "<li><font color=brown>Warning: Error updating im_budget_item dynfields:<br><pre>$err_msg</pre></font>" }
}
}
if {$ns_write_p} { ns_write "<li>Going to write audit log.\n" }
im_audit -object_id $budget_item_id
}
if {$ns_write_p} {
ns_write "</ul>\n"
ns_write "<p>\n"
ns_write "<A HREF=$return_url>Return to Budget_Item Page</A>\n"
}
# ------------------------------------------------------------
# Render Report Footer
if {$ns_write_p} {
ns_write [im_footer]
}
......@@ -11,19 +11,20 @@
<td>#intranet-csv-import.Object_Type#</td>
<td>
<%= [im_select object_type [list \
person "Person" \
im_budget_item "Budget Item" \
im_company "Company" \
im_conf_item "Configuration Item" \
im_expense "Expense" \
im_expense_bundle "Expense Bundle" \
im_invoice "Financial Document" \
im_timesheet_task "Gantt Task" \
im_membership "Membership" \
person "Person" \
im_project "Project" \
rels "Relationship: Projects/Tasks - Members " \
im_risk "Risk" \
im_hour "Timesheet Hour" \
im_ticket "Ticket" \
im_expense "Expense" \
im_expense_bundle "Expense Bundle" \
rels "Relationship: Projects/Tasks<->Members " \
] $object_type] %>
</td>
</tr>
......@@ -52,14 +53,20 @@
<th><nobr>Example<br/>Export SQL</nobr></th>
<th align="left">Comments</th>
</tr>
<tr>
<td><%= [im_gif [db_string gif "select object_type_gif from acs_object_types where object_type = 'person'"]] %></td>
<td>Person</td>
<td align=center><a href="examples/person.csv"><%= [im_gif csv-doc] %></a></td>
<td align=center><a href="/intranet-reporting/view?report_id=<%=$report_id_export_persons%>"><%= [im_gif database_table] %></a></td>
<td><!--Alternatively you can use the old facilities for <a href="<%= [export_vars -base "/intranet/users/upload-contacts" {return_url}] %>">importing users from MS-Outlook exports</a>.--></td>
<td><%= [im_gif [db_string gif "select object_type_gif from acs_object_types where object_type = 'im_budget_item'"]] %></td>
<td>Budget Item</td>
<td align=center><a href="examples/im_budget_item.csv"><%= [im_gif csv-doc] %></a></td>
<td align="center"></td>
<td>
Please note that this import requires exact naming of column headers.<br>
Budget Item <a href="/intranet-dynfield/object-type?object_type=im_budget_item">DynFields</a> are also recognized by their "pretty name" or "column name".</p>
</td>
</tr>
<tr>
<td><%= [im_gif [db_string gif "select object_type_gif from acs_object_types where object_type = 'im_company'"]] %></td>
<td>Company</td>
......@@ -69,6 +76,36 @@
</td>
</tr>
<tr>
<td><%= [im_gif [db_string gif "select object_type_gif from acs_object_types where object_type = 'im_conf_item'"]] %></td>
<td>Conf Item</td>
<td align=center><a href="examples/im_conf_item.csv"><%= [im_gif csv-doc] %></a></td>
<td align="center"></td>
<td>
Please note that this import requires exact naming of column headers.<br>
Conf Item <a href="/intranet-dynfield/object-type?object_type=im_conf_item">DynFields</a> are also recognized by their "pretty name" or "column name".</p>
</td>
</tr>
<tr>
<td><%= [im_gif money] %></td>
<td>Expense Items</td>
<td align=center><a href="examples/im_expense.csv"><%= [im_gif csv-doc] %></a></td>
<td align=center><a href="/intranet-reporting/view?report_id=<%=$report_id_export_expense_items%>"><%= [im_gif database_table] %></a></td>
<td>
Expense <a href="/intranet-dynfield/object-type?object_type=im_expense">DynFields</a> are also recognized by their "pretty name" or "column name".
</td>
</tr>
<tr>
<td><%= [im_gif box] %></td>
<td>Expense Bundles</td>
<td align=center><a href="examples/im_expense_bundle.csv"><%= [im_gif csv-doc] %></a></td>
<td align=center><a href="/intranet-reporting/view?report_id=<%=$report_id_export_expense_bundles%>"><%= [im_gif database_table] %></a></td>
<td></td>
</tr>
<tr>
<td><%= [im_gif [db_string gif "select object_type_gif from acs_object_types where object_type = 'im_invoice'"]] %></td>
<td>Financial Documents (Invoices, Purchase Orders, etc.)</td>
......@@ -93,16 +130,6 @@
</tr>
-->
<tr>
<td><%= [im_gif [db_string gif "select object_type_gif from acs_object_types where object_type = 'im_project'"]] %></td>
<td>Project</td>
<td align=center><a href="examples/im_project.csv"><%= [im_gif csv-doc] %></a></td>
<td align=center><a href="/intranet-reporting/view?report_id=<%=$report_id_export_projects%>"><%= [im_gif database_table] %></a></td>
<td>
Project <a href="/intranet-dynfield/object-type?object_type=im_project">DynFields</a> are also recognized by their "pretty name" or "column name".</p>
</td>
</tr>
<tr>
<td><%= [im_gif [db_string gif "select object_type_gif from acs_object_types where object_type = 'im_gantt_task'" -default ""]] %></td>
<td>Gantt Task</td>
......@@ -111,41 +138,32 @@
<td>Allows to import Timesheet Tasks separately from projects/sub-projects.</td>
</tr>
<tr>
<td><%= [im_gif hourglass] %></td>
<td>Timesheet Hour</td>
<td align=center><a href="examples/im_hour.csv"><%= [im_gif csv-doc] %></a></td>
<td align=center><a href="/intranet-reporting/view?report_id=<%=$report_id_export_hours%>"><%= [im_gif database_table] %></a></td>
<td>DynFields for hours are not supported.</td>
<td><%= [im_gif [db_string gif "select object_type_gif from acs_object_types where object_type = 'person'"]] %></td>
<td>Person</td>
<td align=center><a href="examples/person.csv"><%= [im_gif csv-doc] %></a></td>
<td align=center><a href="/intranet-reporting/view?report_id=<%=$report_id_export_persons%>"><%= [im_gif database_table] %></a></td>
<td><!--Alternatively you can use the old facilities for <a href="<%= [export_vars -base "/intranet/users/upload-contacts" {return_url}] %>">importing users from MS-Outlook exports</a>.--></td>
</tr>
<tr>
<td><%= [im_gif money] %></td>
<td>Expense Items</td>
<td align=center><a href="examples/im_expense.csv"><%= [im_gif csv-doc] %></a></td>
<td align=center><a href="/intranet-reporting/view?report_id=<%=$report_id_export_expense_items%>"><%= [im_gif database_table] %></a></td>
<td><%= [im_gif [db_string gif "select object_type_gif from acs_object_types where object_type = 'im_project'"]] %></td>
<td>Project</td>
<td align=center><a href="examples/im_project.csv"><%= [im_gif csv-doc] %></a></td>
<td align=center><a href="/intranet-reporting/view?report_id=<%=$report_id_export_projects%>"><%= [im_gif database_table] %></a></td>
<td>
Expense <a href="/intranet-dynfield/object-type?object_type=im_expense">DynFields</a> are also recognized by their "pretty name" or "column name".
Project <a href="/intranet-dynfield/object-type?object_type=im_project">DynFields</a> are also recognized by their "pretty name" or "column name".</p>
</td>
</tr>
<tr>
<td><%= [im_gif box] %></td>
<td>Expense Bundles</td>
<td align=center><a href="examples/im_expense_bundle.csv"><%= [im_gif csv-doc] %></a></td>
<td align=center><a href="/intranet-reporting/view?report_id=<%=$report_id_export_expense_bundles%>"><%= [im_gif database_table] %></a></td>
<td></td>
</tr>
<tr>
<td><%= [im_gif [db_string gif "select object_type_gif from acs_object_types where object_type = 'im_conf_item'"]] %></td>
<td>Conf Item</td>
<td align=center><a href="examples/im_conf_item.csv"><%= [im_gif csv-doc] %></a></td>
<td align="center"></td>
<td>
Please note that this import requires exact naming of column headers.<br>
Conf Item <a href="/intranet-dynfield/object-type?object_type=im_conf_item">DynFields</a> are also recognized by their "pretty name" or "column name".</p>
</td>
<td><%=[im_gif brick_link]%></td>
<td>Relationships</td>
<td align=center><a href="examples/im_relation.csv"><%= [im_gif csv-doc] %></a></td>
<td align=center><a href="/intranet-reporting/view?report_id=<%=$report_id_export_project_task_relationships%>"><%= [im_gif database_table] %></a></td>
<td>Import relationships between projects/tasks and persons.</td>
</tr>
<tr>
......@@ -157,21 +175,11 @@
</tr>
<tr>
<td><%=[im_gif brick_link]%></td>
<td>Relationships</td>
<td align=center><a href="examples/im_relation.csv"><%= [im_gif csv-doc] %></a></td>
<td align=center><a href="/intranet-reporting/view?report_id=<%=$report_id_export_project_task_relationships%>"><%= [im_gif database_table] %></a></td>
<td>Import relationships between projects/tasks and persons.</td>
</tr>
<tr>
<td><%= [im_gif [db_string gif "select object_type_gif from acs_object_types where object_type = 'im_user_absence'"]] %></td>
<td>Absence</td>
<td align=center></td>
<td align=center></td>
<td>
Absence import is under active development at the moment.<br>Please <a href="http://www.project-open.com/en/contact">contact us</a> for the current status or updates.
</td>
<td><%= [im_gif hourglass] %></td>
<td>Timesheet Hour</td>
<td align=center><a href="examples/im_hour.csv"><%= [im_gif csv-doc] %></a></td>
<td align=center><a href="/intranet-reporting/view?report_id=<%=$report_id_export_hours%>"><%= [im_gif database_table] %></a></td>
<td>DynFields for hours are not supported.</td>
</tr>
<tr>
......@@ -184,6 +192,16 @@
</td>
</tr>
<tr>
<td><%= [im_gif [db_string gif "select object_type_gif from acs_object_types where object_type = 'im_user_absence'"]] %></td>
<td>User Absence</td>
<td align=center></td>
<td align=center></td>
<td>
Absence import is under active development at the moment.<br>Please <a href="http://www.project-open.com/en/contact">contact us</a> for the current status or updates.
</td>
</tr>
<!--
<tr>
<td><%= [im_gif [db_string gif "select object_type_gif from acs_object_types where object_type = 'im_cost'"]] %></td>
......
......@@ -32,6 +32,7 @@ set main_navbar_label [im_csv_import_label_from_object_type -object_type $object
db_1row get_report_ids "
select
(select report_id from im_reports where report_name = 'Export Absences') as report_id_export_absemces,
(select report_id from im_reports where report_name = 'Export Budget Items') as report_id_export_budget_items,
(select report_id from im_reports where report_name = 'Export Companies') as report_id_export_companies,
(select report_id from im_reports where report_name = 'Export Conf Items') as report_id_export_conf_items,
(select report_id from im_reports where report_name = 'Export Expense Bundles') as report_id_export_expense_bundles,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment