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

- Gustaf changes

parent b948789f
...@@ -205,7 +205,7 @@ ad_proc -public im_csv_import_object_fields { ...@@ -205,7 +205,7 @@ ad_proc -public im_csv_import_object_fields {
set super_types [im_object_super_types -object_type $object_type] set super_types [im_object_super_types -object_type $object_type]
set s [list] set s [list]
foreach t $super_types { foreach t $super_types {
if {$t == "acs_object"} { continue } if {$t eq "acs_object"} { continue }
lappend s $t lappend s $t
} }
set super_types $s set super_types $s
...@@ -377,7 +377,7 @@ ad_proc -public im_csv_import_guess_parser { ...@@ -377,7 +377,7 @@ ad_proc -public im_csv_import_guess_parser {
set super_types [im_object_super_types -object_type $object_type] set super_types [im_object_super_types -object_type $object_type]
set s [list] set s [list]
foreach t $super_types { foreach t $super_types {
if {$t == "acs_object"} { continue } if {$t eq "acs_object"} { continue }
lappend s $t lappend s $t
} }
set super_types $s set super_types $s
......
<master> <master>
<property name="title">@page_title@</property> <property name="doc(title)">@page_title;literal@</property>
<property name="context">@context_bar@</property> <property name="context">@context_bar;literal@</property>
<property name="main_navbar_label">@main_navbar_label@</property> <property name="main_navbar_label">@main_navbar_label;literal@</property>
<form enctype="multipart/form-data" method=POST action="import-@redirect_object_type@.tcl"> <form enctype="multipart/form-data" method=POST action="import-@redirect_object_type@.tcl">
<%= [export_vars -form {object_type return_url import_filename}] %> <%= [export_vars -form {object_type return_url import_filename}] %>
...@@ -39,12 +39,12 @@ ...@@ -39,12 +39,12 @@
<!-- <!--
<tr> <tr>
<td>Save Mapping as:</td> <td>Save Mapping as:</td>
<td><input type=text name=mapping_name></td> <td><input type="text" name="mapping_name"></td>
</tr> </tr>
--> -->
<tr> <tr>
<td></td> <td></td>
<td><input type=submit value="<%= [lang::message::lookup "" intranet-csv-import.Import_CSV "Import CSV"] %>"></td> <td><input type="submit" value="<%= [lang::message::lookup "" intranet-csv-import.Import_CSV "Import CSV"] %>"></td>
</tr> </tr>
</table> </table>
......
...@@ -15,7 +15,7 @@ ad_page_contract { ...@@ -15,7 +15,7 @@ ad_page_contract {
# Default & Security # Default & Security
# --------------------------------------------------------------------- # ---------------------------------------------------------------------
set current_user_id [ad_maybe_redirect_for_registration] set current_user_id [auth::require_login]
set page_title [lang::message::lookup "" intranet-cvs-import.Upload_Objects "Upload Objects"] set page_title [lang::message::lookup "" intranet-cvs-import.Upload_Objects "Upload Objects"]
set context_bar [im_context_bar "" $page_title] set context_bar [im_context_bar "" $page_title]
set admin_p [im_is_user_site_wide_or_intranet_admin $current_user_id] set admin_p [im_is_user_site_wide_or_intranet_admin $current_user_id]
...@@ -50,14 +50,14 @@ if {"" == $return_url} { ...@@ -50,14 +50,14 @@ if {"" == $return_url} {
} }
# strip off the C:\directories... crud and just get the file name # strip off the C:\directories... crud and just get the file name
if ![regexp {([^//\\]+)$} $upload_file match filename] { if {![regexp {([^//\\]+)$} $upload_file match filename]} {
# couldn't find a match # couldn't find a match
set filename $upload_file set filename $upload_file
} }
if {[regexp {\.\.} $filename]} { if {[regexp {\.\.} $filename]} {
set error "Filename contains forbidden characters" set error "Filename contains forbidden characters"
ad_returnredirect "/error.tcl?[export_vars -url {error}]" ad_returnredirect [export_vars -base /error.tcl {error}]
} }
if {![file readable $tmp_filename]} { if {![file readable $tmp_filename]} {
......
...@@ -24,7 +24,7 @@ ad_page_contract { ...@@ -24,7 +24,7 @@ ad_page_contract {
# Default & Security # Default & Security
# --------------------------------------------------------------------- # ---------------------------------------------------------------------
set current_user_id [ad_maybe_redirect_for_registration] set current_user_id [auth::require_login]
set page_title [lang::message::lookup "" intranet-cvs-import.Upload_Objects "Upload Objects"] set page_title [lang::message::lookup "" intranet-cvs-import.Upload_Objects "Upload Objects"]
set context_bar [im_context_bar "" $page_title] set context_bar [im_context_bar "" $page_title]
......
...@@ -25,7 +25,7 @@ ad_page_contract { ...@@ -25,7 +25,7 @@ ad_page_contract {
# Default & Security # Default & Security
# --------------------------------------------------------------------- # ---------------------------------------------------------------------
set current_user_id [ad_maybe_redirect_for_registration] set current_user_id [auth::require_login]
set page_title [lang::message::lookup "" intranet-cvs-import.Upload_Objects "Upload Objects"] set page_title [lang::message::lookup "" intranet-cvs-import.Upload_Objects "Upload Objects"]
set context_bar [im_context_bar "" $page_title] set context_bar [im_context_bar "" $page_title]
set admin_p [im_is_user_site_wide_or_intranet_admin $current_user_id] set admin_p [im_is_user_site_wide_or_intranet_admin $current_user_id]
...@@ -168,7 +168,7 @@ foreach csv_line_fields $values_list_of_lists { ...@@ -168,7 +168,7 @@ foreach csv_line_fields $values_list_of_lists {
set var_value [string trim [lindex $csv_line_fields $j]] set var_value [string trim [lindex $csv_line_fields $j]]
set var_value [string map -nocase {"\"" "'" "\[" "(" "\{" "(" "\}" ")" "\]" ")"} $var_value] set var_value [string map -nocase {"\"" "'" "\[" "(" "\{" "(" "\}" ")" "\]" ")"} $var_value]
if {[string equal "NULL" $var_value]} { set var_value ""} if {"NULL" eq $var_value} { set var_value ""}
# replace unicode characters by non-accented characters # replace unicode characters by non-accented characters
# Watch out! Does not work with Latin-1 characters # Watch out! Does not work with Latin-1 characters
......
...@@ -27,7 +27,7 @@ ad_page_contract { ...@@ -27,7 +27,7 @@ ad_page_contract {
# Default & Security # Default & Security
# --------------------------------------------------------------------- # ---------------------------------------------------------------------
set current_user_id [ad_maybe_redirect_for_registration] set current_user_id [auth::require_login]
set page_title [lang::message::lookup "" intranet-cvs-import.Upload_Objects "Upload Objects"] set page_title [lang::message::lookup "" intranet-cvs-import.Upload_Objects "Upload Objects"]
set context_bar [im_context_bar "" $page_title] set context_bar [im_context_bar "" $page_title]
set admin_p [im_is_user_site_wide_or_intranet_admin $current_user_id] set admin_p [im_is_user_site_wide_or_intranet_admin $current_user_id]
...@@ -193,7 +193,7 @@ foreach csv_line_fields $values_list_of_lists { ...@@ -193,7 +193,7 @@ foreach csv_line_fields $values_list_of_lists {
set var_value [string trim [lindex $csv_line_fields $j]] set var_value [string trim [lindex $csv_line_fields $j]]
set var_value [string map -nocase {"\"" "'" "\[" "(" "\{" "(" "\}" ")" "\]" ")"} $var_value] set var_value [string map -nocase {"\"" "'" "\[" "(" "\{" "(" "\}" ")" "\]" ")"} $var_value]
if {[string equal "NULL" $var_value]} { set var_value ""} if {"NULL" eq $var_value} { set var_value ""}
# replace unicode characters by non-accented characters # replace unicode characters by non-accented characters
# Watch out! Does not work with Latin-1 characters # Watch out! Does not work with Latin-1 characters
......
...@@ -25,7 +25,7 @@ ad_page_contract { ...@@ -25,7 +25,7 @@ ad_page_contract {
# Default & Security # Default & Security
# --------------------------------------------------------------------- # ---------------------------------------------------------------------
set current_user_id [ad_maybe_redirect_for_registration] set current_user_id [auth::require_login]
set page_title [lang::message::lookup "" intranet-cvs-import.Upload_Objects "Upload Objects"] set page_title [lang::message::lookup "" intranet-cvs-import.Upload_Objects "Upload Objects"]
set context_bar [im_context_bar "" $page_title] set context_bar [im_context_bar "" $page_title]
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<master> <master>
<property name="title">@page_title@</property> <property name="doc(title)">@page_title;literal@</property>
<property name="context">@context_bar@</property> <property name="context">@context_bar;literal@</property>
<property name="main_navbar_label">@main_navbar_label@</property> <property name="main_navbar_label">@main_navbar_label;literal@</property>
<form enctype="multipart/form-data" method=POST action="import-2.tcl"> <form enctype="multipart/form-data" method=POST action="import-2.tcl">
<%= [export_vars -form {return_url main_navbar_label}] %> <%= [export_vars -form {return_url main_navbar_label}] %>
<table border=0> <table border="0">
<tr> <tr>
<td>#intranet-csv-import.Object_Type#</td> <td>#intranet-csv-import.Object_Type#</td>
<td> <td>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<tr> <tr>
<td><%= [lang::message::lookup "" intranet-csv-import.Filename] %></td> <td><%= [lang::message::lookup "" intranet-csv-import.Filename] %></td>
<td> <td>
<input type=file name=upload_file size=30> <input type="file" name="upload_file" size="30">
<%= [im_gif help "Use the &quot;Browse...&quot; button to locate your file, then click &quot;Open&quot;."] %> <%= [im_gif help "Use the &quot;Browse...&quot; button to locate your file, then click &quot;Open&quot;."] %>
</td> </td>
</tr> </tr>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<tr> <tr>
<td></td> <td></td>
<td> <td>
<input type=submit> <input type="submit">
</td> </td>
</tr> </tr>
......
...@@ -22,7 +22,7 @@ ad_page_contract { ...@@ -22,7 +22,7 @@ ad_page_contract {
{ object_type "" } { object_type "" }
} }
set user_id [ad_maybe_redirect_for_registration] set user_id [auth::require_login]
set page_title [lang::message::lookup "" intranet-csv-import.Upload_file "Upload File"] set page_title [lang::message::lookup "" intranet-csv-import.Upload_file "Upload File"]
set context_bar [im_context_bar "" $page_title] set context_bar [im_context_bar "" $page_title]
set main_navbar_label [im_csv_import_label_from_object_type -object_type $object_type] set main_navbar_label [im_csv_import_label_from_object_type -object_type $object_type]
......
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