Commit 147e5325 authored by Frank Bergmann's avatar Frank Bergmann

-- new import: im_hours

parent 79b6b8db
......@@ -262,6 +262,12 @@ ad_proc -public im_csv_import_object_fields {
} {
Returns a list of database columns for the specified object type.
} {
# Special case: im_hour is not an object
if { "im_hour" == $object_type } {
return "project_id user_id day hours"
}
# Get the list of super-types for object_type, including object_type
# and remove "acs_object" from the list
set super_types [im_object_super_types -object_type $object_type]
......@@ -316,7 +322,6 @@ ad_proc -public im_csv_import_object_fields {
lappend selected_tables $table_name
incr cnt
}
return [lsort $selected_columns]
}
......@@ -331,7 +336,7 @@ ad_proc -public im_csv_import_parsers {
Returns the list of available parsers
} {
switch $object_type {
im_project - im_company - im_conf_item - im_risk - im_timesheet_task - im_ticket {
im_project - im_company - im_conf_item - im_risk - im_timesheet_task - im_ticket - im_hour {
set parsers {
no_change "No Change"
hard_coded "Hard Coded Functionality"
......
......@@ -7,13 +7,13 @@
$(document).ready(function() {
// Initialize
$('#@form_id@').sayt({'days': 180});
$('#@form_id;literal@').sayt({'days': 180});
// if($('#@form_id@').sayt({'checksaveexists': true}) == true)
// if($('#@form_id;literal@').sayt({'checksaveexists': true}) == true)
// { console.log('Form has an existing save cookie.'); } else { console.log('No cookie found'); };
// Do not save the hidden fields
$('#@form_id@').sayt({'exclude':
$('#@form_id;literal@').sayt({'exclude':
[
'[name=return_url]',
'[name=object_type]',
......@@ -33,6 +33,20 @@ $(document).ready(function() {
<form enctype="multipart/form-data" method=POST action="import-@redirect_object_type@.tcl" id="@form_id@">
<%= [export_vars -form {object_type return_url import_filename}] %>
<if @object_type;literal@ eq im_hour>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td><input type="checkbox" name="merge_p" /></td>
<td>If checked, import hours will be added to already existing hours found on target server.</td>
</tr>
<tr>
<td><input type="checkbox" name="test_run_p" checked></td>
<td>Uncheck to perform a real run</td>
</tr>
</table>
</if>
<table>
<tr clas=rowtitle>
<td class=rowtitle>Field Name</td>
......
......@@ -75,6 +75,10 @@ if {"" == $return_url} {
set return_url "/intranet/users/index"
set form_id "intranet-csv-import-import2-users"
}
im_hour {
set return_url "/intranet/index"
set form_id "intranet-csv-import-import2-hours"
}
default {
set return_url "/intranet"
set form_id "intranet-csv-import-import2-other"
......
This diff is collapsed.
......@@ -15,6 +15,7 @@
im_company "Company" \
im_conf_item "Configuration Item (no mapping, requires correct CSV header names)" \
im_project "Project" \
im_hour "Hour" \
im_risk "Risk" \
im_timesheet_task "Timesheet Task" \
person "User" \
......
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