diff --git a/controller/hk_rows_import.anubis b/controller/hk_rows_import.anubis index 3ce8a7c..b033838 100644 --- a/controller/hk_rows_import.anubis +++ b/controller/hk_rows_import.anubis @@ -116,7 +116,7 @@ define (Int, List(List(String))) //TODO report that error in importation report println("error ["+e+"]\n"); (offset, so_far), ok(_offset, all_values) then - println("extracted line : \""+join("\", ", all_values)+"\""); + println("extracted line : \""+join("\", \"", all_values)+"\""); //if line_data is (line, all_values) then extract_lines(cvs_line_reader, max_count - 1, columns, _offset, [all_values . so_far]) @@ -174,7 +174,7 @@ define Result(String, One) if sqlite3_step(insert_data_stmt) is { error(err) then - //println(db_error(err, "Error executing insert data statement")); + println(db_error(err, "Error executing insert data statement")); forget(sqlite3_reset(insert_data_stmt)); if err.code = 19 & update then @@ -293,10 +293,11 @@ define CSV_Import_Status with offset = (Int)0, with key = if column_key = "" then "id" else column_key, - with filter_columns = map_select((String s) |-> if s = "" then failure else success(s), columns), - sql_columns = join(", ", filter_columns), + with filter_columns_esc = map_select((String s) |-> if s = "" then failure else success("\""+s+"\""), columns), + with filter_columns = map_select((String s) |-> if s = "" then failure else success(s), columns), + sql_columns = join(", ", filter_columns_esc), sql_values = join(", ", map((String s) |-> ":"+s, filter_columns)), - with sql_update_values = join(", ", map((String s) |-> s+"=:"+s, filter_columns)), + with sql_update_values = join(", ", map((String s) |-> "\""+s+"\" = :"+s, filter_columns)), if sqlite3_prepare(db, "INSERT INTO "+table_name+" ("+sql_columns+") VALUES ("+sql_values+");") is { @@ -305,7 +306,7 @@ define CSV_Import_Status csv_db_error, ok(insert_data_stmt) then // with update_query = "UPDATE "+table_name+" SET " + sql_update_values + " WHERE changes()=0 AND "+key+"=:"+key+";", - with update_query = "UPDATE "+table_name+" SET " + sql_update_values + " WHERE "+key+"=:"+key+";", + with update_query = "UPDATE "+table_name+" SET " + sql_update_values + " WHERE \""+key+"\" = :"+key+";", println(" update query : "+update_query); if sqlite3_prepare(db, update_query) is { diff --git a/view/view_rows_import.anubis b/view/view_rows_import.anubis index 80825d7..3214184 100644 --- a/view/view_rows_import.anubis +++ b/view/view_rows_import.anubis @@ -202,7 +202,7 @@ public define HTML_Partial_Content row([], [cell(image(icn16_mime_unknown)), cell(text(_T("SOURCE_FILE_TO_IMPORT"))), cell(text(uploaded_file))]), row([], [cell(empty), cell(text(_T("DELIMITER"))), cell(selector_c([], no_label, html_Id("import_delimiter"), wan("csv_sep"), 1, csv_delimiter_combo(_T), init(separator)),)]), row([], [cell(empty), cell(text(_T("FILE_ENCODING"))), cell(text("choose encoding"))]), - row([], [cell(empty), cell(text(_T("REMOVE_CSV_HEADER"))), cell(check_box([], no_label, html_Id(""), wan("hk_remove_csv_header"), wav("1"), true))]), + row([], [cell(empty), cell(text(_T("REMOVE_CSV_HEADER"))), cell(check_box([], no_label, html_Id(""), wan("hk_remove_csv_header"), true))]), row([], [cell(empty), cell(text(_T("IMPORT_TYPE"))), cell(selector_c([], no_label, html_Id("import_type"), wan("import_type"), 1, csv_import_type_combo(_T), init(separator)),)]), // row([], [cell(empty), cell(text(_T("OPT_OUT"))), cell(check_box([], no_label, html_Id(""), wan("import_opt_out"), wav("1"), false))])] //end of row diff --git a/view/view_table_renderer.anubis b/view/view_table_renderer.anubis index f9e14d0..0bcc241 100644 --- a/view/view_table_renderer.anubis +++ b/view/view_table_renderer.anubis @@ -643,7 +643,7 @@ public define List(CXM_Form_Field) ], if new_entry = false then - [ checkbox_hide_show([], label(_T("CLICK_TO_CHANGE_PASSWORD")), wan(c_name+"_pwd_change"), wav("on"), false, //not checked at first + [ checkbox_hide_show([], label(_T("CLICK_TO_CHANGE_PASSWORD")), wan(c_name+"_pwd_change"), false, //not checked at first password_entries), hidden(html_Id(""), wan(c_name+"_pwd_change_option"), wav("true")) ] @@ -704,7 +704,7 @@ public define List(CXM_Form_Field) ], boolean(s_name, c_name, value, help) then - [checkboxr([],label(_T(s_name), no_help), html_Id(""), wan(c_name), wav("true"),value, mandatory), help_line(help, _T)], + [checkboxr([],label(_T(s_name), no_help), html_Id(""), wan(c_name), value, mandatory), help_line(help, _T)], integer(s_name, c_name, value, help) then [input(label(_T(s_name), no_help), wan(c_name), init(abs_to_decimal(value)), small, mandatory), help_line(help, _T)], float(s_name, c_name, value, help) then @@ -854,7 +854,7 @@ public define List(CXM_Form_Field) ], if new_entry = false then - [ checkbox_hide_show([], label(_T("CLICK_TO_CHANGE_PASSWORD")), wan(c_name+"_pwd_change"), wav("on"), false, //not checked at first + [ checkbox_hide_show([], label(_T("CLICK_TO_CHANGE_PASSWORD")), wan(c_name+"_pwd_change"), false, //not checked at first password_entries), hidden(html_Id(""), wan(c_name+"_pwd_change_option"), wav("true")) ] @@ -914,7 +914,7 @@ public define List(CXM_Form_Field) text_area([],no_label, html_Id(id), wan(c_name), init(not_null_String(value)), narrow, (Int)5, mandatory), help_line(help, _T)], boolean(s_name, c_name, value, help) then - [checkboxr([],no_label, html_Id(""), wan(c_name), wav("true"),value, mandatory), help_line(help, _T)], + [checkboxr([],no_label, html_Id(""), wan(c_name), value, mandatory), help_line(help, _T)], integer(s_name, c_name, value, help) then [input(no_label, wan(c_name), init(abs_to_decimal(value)), small, mandatory), help_line(help, _T)], float(s_name, c_name, value, help) then -- libgit2 0.21.4