Commit cd48d68ef74535b1bc6761e9bb33b3517364aff6
1 parent
049aee2e
still working on refactoring
Showing
14 changed files
with
98 additions
and
62 deletions
Show diff stats
calexium_lib @ 891e24cfc2e
densaku_lib @ aaa50241ac1
hayamiki_generator.aproj
| ... | ... | @@ -155,15 +155,7 @@ |
| 155 | 155 | <Compile Include="hayamiki_lib\model\types\hk_text_choices.anubis" /> |
| 156 | 156 | <Compile Include="hayamiki_lib\model\types\hk_text_field_attr.anubis" /> |
| 157 | 157 | <Compile Include="hayamiki_lib\types\hayamiki.anubis" /> |
| 158 | - <Compile Include="hayamiki_lib\types\model\app.anubis" /> | |
| 159 | - <Compile Include="hayamiki_lib\types\model\columns.anubis" /> | |
| 160 | - <Compile Include="hayamiki_lib\types\model\database.anubis" /> | |
| 161 | - <Compile Include="hayamiki_lib\types\model\display.anubis" /> | |
| 162 | - <Compile Include="hayamiki_lib\types\model\fields.anubis" /> | |
| 163 | - <Compile Include="hayamiki_lib\types\model\help.anubis" /> | |
| 164 | - <Compile Include="hayamiki_lib\types\model\icons.anubis" /> | |
| 165 | - <Compile Include="hayamiki_lib\types\model\model.anubis" /> | |
| 166 | - <Compile Include="hayamiki_lib\types\model\tables.anubis" /> | |
| 158 | + <Compile Include="hayamiki_lib\view\jqgrid.anubis" /> | |
| 167 | 159 | <Compile Include="hayamiki_lib\view\view_apps_renderer.anubis" /> |
| 168 | 160 | <Compile Include="hayamiki_lib\view\view_table_manager.anubis" /> |
| 169 | 161 | <Compile Include="hayamiki_lib\view\view_table_manager_types.anubis" /> |
| ... | ... | @@ -725,9 +717,8 @@ |
| 725 | 717 | <Folder Include="hayamiki_lib\model" /> |
| 726 | 718 | <Folder Include="hayamiki_lib\model\types" /> |
| 727 | 719 | <Folder Include="hayamiki_lib\types" /> |
| 728 | - <Folder Include="hayamiki_lib\types\model" /> | |
| 729 | - <Folder Include="hayamiki_lib\types\view" /> | |
| 730 | 720 | <Folder Include="hayamiki_lib\view" /> |
| 721 | + <Folder Include="hayamiki_lib\view\types" /> | |
| 731 | 722 | <Folder Include="library" /> |
| 732 | 723 | <Folder Include="library\a2a" /> |
| 733 | 724 | <Folder Include="library\a2a\C" /> | ... | ... |
hayamiki_lib @ 23eeeae8417
src/check.anubis
| ... | ... | @@ -10,7 +10,7 @@ read hayamiki_lib/types/hayamiki.anubis |
| 10 | 10 | read system/string.anubis |
| 11 | 11 | read tools/list.anubis |
| 12 | 12 | read tools/basis.anubis |
| 13 | -transmit hayamiki_lib/model/types/hk_edit_view.anubis | |
| 13 | +transmit hayamiki_lib/view/types/hk_edit_view.anubis | |
| 14 | 14 | |
| 15 | 15 | public define Maybe(List(String)) |
| 16 | 16 | get_all_apps_name |
| ... | ... | @@ -120,13 +120,14 @@ define Maybe(HK_Edit_View) |
| 120 | 120 | if _edit_view is |
| 121 | 121 | { |
| 122 | 122 | edit_view_all then success(edit_view_all), |
| 123 | - edit_view(v, c, fk_views) then | |
| 123 | + edit_view_list_form(v, c, fk_views) then | |
| 124 | 124 | with mb_fk_views = map_escape((HK_FK_View _fk_view) |-> resolve_HK_FK_View_foreign(apps_name, app_name, _fk_view), fk_views), |
| 125 | 125 | if mb_fk_views is |
| 126 | 126 | { |
| 127 | 127 | failure then failure, |
| 128 | - success(n_fk_views) then success(edit_view(v, c, n_fk_views)) | |
| 128 | + success(n_fk_views) then success(edit_view_list_form(v, c, n_fk_views)) | |
| 129 | 129 | } |
| 130 | + edit_view_table_form(v, t) then success(edit_view_table_form(v, t)) | |
| 130 | 131 | } |
| 131 | 132 | . |
| 132 | 133 | ... | ... |
src/generation/SQL_get_all.anubis
| ... | ... | @@ -114,9 +114,12 @@ public define Maybe(One) |
| 114 | 114 | " get_all_"+name+"_by_clause_to_json\n"+ |
| 115 | 115 | " (\n"+ |
| 116 | 116 | " SQLite3DataBase db,\n"+ |
| 117 | -" String clause\n"+ | |
| 117 | +" HK_Referer referer,\n"+ | |
| 118 | +" String filter\n"+ | |
| 118 | 119 | " )=\n"+ |
| 119 | -" if get_all_"+name+"_by_clause(db, clause) is\n"+ | |
| 120 | +" with clause = referer_to_sql_clause(referer, \""+name+"\", "+name+"_columns),\n\n"+ | |
| 121 | +" //with _and_ = if length(clause) > 0 & length(filter) > 0 then \" AND \" else \"\",\n"+ | |
| 122 | +" if get_all_"+name+"_by_clause(db, clause+filter) is\n"+ | |
| 120 | 123 | " {\n"+ |
| 121 | 124 | " failure then json_member(\"rows\", json_array([])),\n"+ |
| 122 | 125 | " success(cursor) then json_member(\"rows\", json_array(_get_all_"+name+"_to_json(db, cursor, [])))\n"+ | ... | ... |
src/generation/columns.anubis
| ... | ... | @@ -45,11 +45,12 @@ public define Maybe(List(HK_Model_Column)) |
| 45 | 45 | |
| 46 | 46 | define List(String) |
| 47 | 47 | /* return the list of all columns name |
| 48 | + * | |
| 48 | 49 | */ |
| 49 | 50 | _to_List_String |
| 50 | 51 | ( |
| 51 | 52 | List(HK_Model_Column) columns, |
| 52 | - Bool with_pk, | |
| 53 | + Bool with_pk, //if set, add the primary key named "id" | |
| 53 | 54 | List(String) so_far |
| 54 | 55 | )= |
| 55 | 56 | if columns is |
| ... | ... | @@ -207,7 +208,7 @@ public define String |
| 207 | 208 | public define Maybe(String) |
| 208 | 209 | /** Here we generate the VT_Edit entry according to the model |
| 209 | 210 | */ |
| 210 | - get_VT_edit_entry | |
| 211 | + get_HK_Form_Entry | |
| 211 | 212 | ( |
| 212 | 213 | HK_Model_Column col, |
| 213 | 214 | String type_name |
| ... | ... | @@ -237,7 +238,7 @@ public define Maybe(String) |
| 237 | 238 | auto_now then success("information(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+".datetime, 18, "+to_Anubis_source(help)+")"), |
| 238 | 239 | auto_now_add then success("information(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+".datetime, 18, "+to_Anubis_source(help)+")") |
| 239 | 240 | }, |
| 240 | - foreign_key(app,foreign_table) then success("foreign_text(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+", vt_edit_selector(get_selector_"+foreign_table+"), "+to_Anubis_source(help)+")"), | |
| 241 | + foreign_key(app,foreign_table) then success("foreign_text(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+", hk_form_selector(get_selector_"+foreign_table+"), "+to_Anubis_source(help)+")"), | |
| 241 | 242 | |
| 242 | 243 | |
| 243 | 244 | integer_field(choices) then |
| ... | ... | @@ -248,7 +249,7 @@ public define Maybe(String) |
| 248 | 249 | int_choices(choices_list) then |
| 249 | 250 | //if choice list is NOT empty we construct the possible choices selector |
| 250 | 251 | if length(choices_list) > 0 then |
| 251 | - success("choices_int(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+", vt_edit_selector(get_choices_selector_"+to_lower(type_name)+"_"+name+"), "+to_Anubis_source(help)+")") | |
| 252 | + success("choices_int(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+", hk_form_selector(get_choices_selector_"+to_lower(type_name)+"_"+name+"), "+to_Anubis_source(help)+")") | |
| 252 | 253 | else |
| 253 | 254 | success("integer(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+", "+to_Anubis_source(help)+")"), |
| 254 | 255 | } |
| ... | ... | @@ -262,7 +263,7 @@ public define Maybe(String) |
| 262 | 263 | text_choices(choices_list) then |
| 263 | 264 | //if choice list is NOT empty we construct the possible choices selector |
| 264 | 265 | if length(choices_list) > 0 then |
| 265 | - success("choices_text(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+", vt_edit_selector(get_choices_selector_"+to_lower(type_name)+"_"+name+"), "+to_Anubis_source(help)+")") | |
| 266 | + success("choices_text(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+", hk_form_selector(get_choices_selector_"+to_lower(type_name)+"_"+name+"), "+to_Anubis_source(help)+")") | |
| 266 | 267 | else |
| 267 | 268 | success("text(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+", "+to_Anubis_source(help)+")") |
| 268 | 269 | } |
| ... | ... | @@ -283,7 +284,7 @@ public define String |
| 283 | 284 | { |
| 284 | 285 | [] then indent+" "+join(",\n"+indent+" ", reverse(so_far)), |
| 285 | 286 | [h . t] then |
| 286 | - if get_VT_edit_entry(h, type_name) is | |
| 287 | + if get_HK_Form_Entry(h, type_name) is | |
| 287 | 288 | { |
| 288 | 289 | failure then edit_entries(t, type_name, indent, so_far) |
| 289 | 290 | success(result) then edit_entries(t, type_name, indent, [result . so_far]) | ... | ... |
src/generation/fields.anubis
src/generation/files.anubis
| ... | ... | @@ -61,6 +61,7 @@ define Maybe(One) |
| 61 | 61 | if generate_densaku_type(table, dest_dir, use_densaku) is { failure then failure, success(_) then |
| 62 | 62 | if generate_type(strm, table, use_densaku) is { failure then failure, success(_) then |
| 63 | 63 | if generate_get_default(strm, table) is { failure then failure, success(_) then |
| 64 | + if generate_columns_list(strm, table) is { failure then failure, success(_) then | |
| 64 | 65 | if generate_extract_web_arg_to_type(strm, table) is { failure then failure, success(_) then |
| 65 | 66 | if generate_extract_web_arg_to_update_field(strm, table) is { failure then failure, success(_) then |
| 66 | 67 | if generate_extract_db_cursor_to_mb_type(strm, table) is { failure then failure, success(_) then |
| ... | ... | @@ -77,7 +78,7 @@ define Maybe(One) |
| 77 | 78 | if generate_choices_selector(strm, table) is { failure then failure, success(_) then |
| 78 | 79 | if generate_VT_all_view(strm, table) is { failure then failure, success(_) then |
| 79 | 80 | if generate_VT_all_edit(strm, table) is { failure then failure, success(_) then |
| 80 | - success(unique)}}}}}}}}}}}}}}}}}}}} | |
| 81 | + success(unique)}}}}}}}}}}}}}}}}}}}}} | |
| 81 | 82 | }. |
| 82 | 83 | |
| 83 | 84 | define One | ... | ... |
src/generation/header.anubis
| ... | ... | @@ -62,9 +62,10 @@ read data_base/sqlite.anubis |
| 62 | 62 | read data_base/db_tools.anubis |
| 63 | 63 | read calexium_lib/database/db_utils.anubis |
| 64 | 64 | read calexium_lib/database/db_types.anubis |
| 65 | -read hayamiki_lib/view/view_table_types.anubis | |
| 65 | +read hayamiki_lib/view/types/hk_form.anubis | |
| 66 | +read hayamiki_lib/view/types/hk_view.anubis | |
| 66 | 67 | read hayamiki_lib/types/hayamiki.anubis |
| 67 | - | |
| 68 | +read hayamiki_lib/controller/hk_sql_utils.anubis | |
| 68 | 69 | read system/logger.anubis |
| 69 | 70 | read system/datetime.anubis |
| 70 | 71 | read system/convert.anubis |
| ... | ... | @@ -72,7 +73,6 @@ read system/string.anubis |
| 72 | 73 | |
| 73 | 74 | read calexium_lib/net_services_protocols/logger_service.anubis |
| 74 | 75 | read app/app_loggers.anubis |
| 75 | - | |
| 76 | 76 | ") is failure then failure else |
| 77 | 77 | foreign_table_header(stream, columns) |
| 78 | 78 | . | ... | ... |
src/generation/types.anubis
| ... | ... | @@ -75,6 +75,7 @@ define List(String) |
| 75 | 75 | since h is hk_column(name, col_type, _, _), |
| 76 | 76 | _generate_get_default(t, [ to_Anubis_default(col_type) . so_far]) |
| 77 | 77 | }. |
| 78 | + | |
| 78 | 79 | public define Maybe(One) |
| 79 | 80 | generate_get_default |
| 80 | 81 | ( |
| ... | ... | @@ -89,13 +90,32 @@ public define Maybe(One) |
| 89 | 90 | if write_string(stream, |
| 90 | 91 | "\n\ndefine "+type_name+"\n get_default_"+name+" =\n "+name+"("+ //head of the definition |
| 91 | 92 | join(", ",_generate_get_default(columns, []))+ //all components of the type |
| 92 | - ").\n") is //end of the function | |
| 93 | + ").\n\n") is //end of the function | |
| 93 | 94 | { |
| 94 | 95 | failure then println("can't write get_default "+type_name); failure, |
| 95 | 96 | success(_) then success(unique) |
| 96 | 97 | }. |
| 97 | 98 | |
| 98 | 99 | |
| 100 | +public define Maybe(One) | |
| 101 | + generate_columns_list | |
| 102 | + ( | |
| 103 | + Stream stream, | |
| 104 | + HK_Table table | |
| 105 | + )= | |
| 106 | + since table is hk_table(name, short_name, model, _), | |
| 107 | + since model is hk_model(columns, show_string), | |
| 108 | + with type_name = to_upper(name, 1), //make the first character to upper case to able to be a Anubis Type. | |
| 109 | + | |
| 110 | + //generate the type of the table that contain all components | |
| 111 | + if write_string(stream, | |
| 112 | + "\n\ndefine List(String)\n "+name+"_columns =\n ["+ //head of the definition | |
| 113 | + join(",\n ",enclose("\"", to_List_String(columns, false)))+ //all columns name wihtout id | |
| 114 | + " ].\n\n") is //end of the list | |
| 115 | + { | |
| 116 | + failure then println("can't write generate_columns_list "+type_name); failure, | |
| 117 | + success(_) then success(unique) | |
| 118 | + }. | |
| 99 | 119 | |
| 100 | 120 | |
| 101 | 121 | |
| ... | ... | @@ -351,9 +371,12 @@ public define Maybe(One) |
| 351 | 371 | " get_selector_"+name+"\n"+ |
| 352 | 372 | " (\n"+ |
| 353 | 373 | " SQLite3DataBase db,\n"+ |
| 354 | - " String clause\n"+ | |
| 374 | + " HK_Referer referer,\n"+ | |
| 375 | + " String filter\n"+ | |
| 355 | 376 | " )=\n"+ |
| 356 | - " _get_selector_"+name+"(db, get_all_"+name+"_by_clause_to_list_type(db, clause), [])." | |
| 377 | + " with clause = referer_to_sql_clause(referer, \""+name+"\", "+name+"_columns),\n\n"+ | |
| 378 | + " with _and_ = if length(clause) > 0 & length(filter) > 0 then \" AND \" else \"\",\n"+ | |
| 379 | + " _get_selector_"+name+"(db, get_all_"+name+"_by_clause_to_list_type(db, clause+_and_+filter), [])." | |
| 357 | 380 | ) is //end of the function |
| 358 | 381 | { |
| 359 | 382 | failure then println("can't write generate_show_string "+type_name); failure, | ... | ... |
src/generation/vt_edit.anubis
| ... | ... | @@ -15,7 +15,7 @@ read columns.anubis |
| 15 | 15 | read html.anubis |
| 16 | 16 | |
| 17 | 17 | define String |
| 18 | - edit_tab_entries | |
| 18 | + hk_form_tab_entries | |
| 19 | 19 | ( |
| 20 | 20 | List(HK_FK_View) fk_views, |
| 21 | 21 | String indent |
| ... | ... | @@ -24,7 +24,7 @@ define String |
| 24 | 24 | map((HK_FK_View fk_view) |
| 25 | 25 | |-> |
| 26 | 26 | since fk_view is fk_view(app_name, fk_table_name, fk_col), |
| 27 | - indent+" hk_v_edit_tab(\""+fk_table_name+"\", \""+fk_col+"\", \"default\")" | |
| 27 | + indent+" hk_form_tab(\""+fk_table_name+"\", \""+fk_col+"\", \"default\")" | |
| 28 | 28 | , |
| 29 | 29 | fk_views) |
| 30 | 30 | ) |
| ... | ... | @@ -47,45 +47,48 @@ public define Maybe(One) |
| 47 | 47 | with type_name = to_upper(table_name, 1), //make the first character to upper case and be an Anubis Type. |
| 48 | 48 | with view_name = if edit_view is |
| 49 | 49 | { |
| 50 | - edit_view_all then "default", | |
| 51 | - edit_view(v_name, _, _) then v_name | |
| 50 | + edit_view_all then "default", | |
| 51 | + edit_view_list_form(v_name, _, _) then v_name, | |
| 52 | + edit_view_table_form(v_name, _) then v_name | |
| 52 | 53 | }, |
| 53 | 54 | with current_edit_view = if edit_view is |
| 54 | 55 | { |
| 55 | 56 | edit_view_all then columns, |
| 56 | - edit_view(v_name, cols, _) then | |
| 57 | + edit_view_list_form(v_name, cols, _) then | |
| 57 | 58 | if get_HK_Model_Column_list_from_name_list(columns, cols) is |
| 58 | 59 | { |
| 59 | 60 | failure then println("generate_VT_edit: can't get all specified columns for table \""+table_name+"\" view name \""+v_name+"\" cols["+join(", ",cols)+"]");[], |
| 60 | 61 | success(got_columns) then got_columns, |
| 61 | 62 | } |
| 63 | + edit_view_table_form(_,_) then todo "handle case 'edit_view_table_form'" | |
| 62 | 64 | }, |
| 63 | 65 | with current_fk_views = if edit_view is |
| 64 | 66 | { |
| 65 | - edit_view_all then [], | |
| 66 | - edit_view(_, _, lfk) then lfk | |
| 67 | + edit_view_all then [], | |
| 68 | + edit_view_list_form(_, _, lfk) then lfk, | |
| 69 | + edit_view_table_form(_,_) then [] | |
| 67 | 70 | }, |
| 68 | 71 | |
| 69 | 72 | //generate the type of the table that contain all components |
| 70 | 73 | if write_string(stream, |
| 71 | 74 | "\n\n"+ |
| 72 | 75 | //SQL query |
| 73 | - "define VT_edit\n"+ | |
| 76 | + "define HK_Form\n"+ | |
| 74 | 77 | " _get_editable_"+table_name+"_"+view_name+"\n"+ |
| 75 | 78 | " (\n"+ |
| 76 | 79 | " "+type_name+" "+table_name+",\n"+ |
| 77 | 80 | " SQLite3DataBase db\n"+ |
| 78 | 81 | " )=\n"+ |
| 79 | - " with edit_entries = (List(VT_edit_entry))\n"+ | |
| 82 | + " with edit_entries = (List(HK_Form_Entry))\n"+ | |
| 80 | 83 | " [\n"+ |
| 81 | 84 | " hidden(\"id\", to_String("+table_name+".id)),\n"+ |
| 82 | 85 | edit_entries(current_edit_view, table_name, " ", [])+"\n"+ |
| 83 | 86 | " ],\n"+ |
| 84 | - " with fk_view_entries = (List(HK_V_Edit_Tab))\n"+ | |
| 87 | + " with fk_view_entries = (List(HK_Form_Tab))\n"+ | |
| 85 | 88 | " [\n"+ |
| 86 | - edit_tab_entries(current_fk_views, " ")+"\n"+ | |
| 89 | + hk_form_tab_entries(current_fk_views, " ")+"\n"+ | |
| 87 | 90 | " ],\n"+ |
| 88 | - " vt_edit(\""+table_name+"\", \""+view_name+"\", edit_entries, fk_view_entries).\n\n" | |
| 91 | + " hk_form_in_list(\""+table_name+"\", \""+view_name+"\", edit_entries, fk_view_entries).\n\n" | |
| 89 | 92 | ) is //end of the function |
| 90 | 93 | { |
| 91 | 94 | failure then println("can't write generate_VT_view "+type_name); failure, |
| ... | ... | @@ -122,7 +125,10 @@ public define Maybe(One) |
| 122 | 125 | if view is |
| 123 | 126 | { |
| 124 | 127 | edit_view_all then true, //list_view_all is default view |
| 125 | - edit_view(view_name, _, _) then | |
| 128 | + edit_view_list_form(view_name, _, _) then | |
| 129 | + //if not we search for view named 'default' | |
| 130 | + if view_name = "default" then true else false | |
| 131 | + edit_view_table_form(view_name, _) then | |
| 126 | 132 | //if not we search for view named 'default' |
| 127 | 133 | if view_name = "default" then true else false |
| 128 | 134 | }, |
| ... | ... | @@ -149,8 +155,9 @@ public define String |
| 149 | 155 | [view . t] then |
| 150 | 156 | with view_name = if view is |
| 151 | 157 | { |
| 152 | - edit_view_all then "default", | |
| 153 | - edit_view(view_name, _, _) then view_name | |
| 158 | + edit_view_all then "default", | |
| 159 | + edit_view_list_form(view_name, _, _) then view_name | |
| 160 | + edit_view_table_form(view_name, _) then view_name | |
| 154 | 161 | }, |
| 155 | 162 | _generate_get_editable_if_else( table_name, t, |
| 156 | 163 | so_far + |
| ... | ... | @@ -172,11 +179,11 @@ public define Maybe(One) |
| 172 | 179 | )= |
| 173 | 180 | since table is hk_table(table_name, short_name, model, display), |
| 174 | 181 | if write_string(stream, |
| 175 | - "public define VT_edit\n"+ | |
| 182 | + "public define HK_Form\n"+ | |
| 176 | 183 | " get_editable_"+table_name+"\n"+ |
| 177 | 184 | " (\n"+ |
| 178 | 185 | " SQLite3DataBase db,\n"+ |
| 179 | - " VT_action action,\n"+ | |
| 186 | + " HK_Form_action action,\n"+ | |
| 180 | 187 | " String editor_view\n"+ |
| 181 | 188 | " )=\n"+ |
| 182 | 189 | " with "+table_name+" = if action is\n"+ | ... | ... |
src/generation/vt_view.anubis
| ... | ... | @@ -48,7 +48,7 @@ define String |
| 48 | 48 | date_field(attrs) then "date(\""+to_upper(name)+"\", \""+name+"\", "+to_Anubis_source(help)+")", |
| 49 | 49 | time_field(attrs) then "time(\""+to_upper(name)+"\", \""+name+"\", "+to_Anubis_source(help)+")", |
| 50 | 50 | datetime_field(attrs) then "datetime(\""+to_upper(name)+"\", \""+name+"\", "+to_Anubis_source(help)+")", |
| 51 | - foreign_key(app,foreign_table) then "foreign_text(\""+to_upper(name)+"\", \""+name+"\", vt_edit_selector(get_selector_"+foreign_table+"), "+to_Anubis_source(help)+")", | |
| 51 | + foreign_key(app,foreign_table) then "foreign_text(\""+to_upper(name)+"\", \""+name+"\", hk_form_selector(get_selector_"+foreign_table+"), "+to_Anubis_source(help)+")", | |
| 52 | 52 | integer_field(choices) then |
| 53 | 53 | if choices is |
| 54 | 54 | { |
| ... | ... | @@ -56,7 +56,7 @@ define String |
| 56 | 56 | int_choices(choices_list) then |
| 57 | 57 | //if choice list is NOT empty we construct the possible choices selector |
| 58 | 58 | if length(choices_list) > 0 then |
| 59 | - "choices_int(\""+to_upper(name)+"\", \""+name+"\", vt_edit_selector(get_choices_selector_"+to_lower(type_name)+"_"+name+"), "+to_Anubis_source(help)+")" | |
| 59 | + "choices_int(\""+to_upper(name)+"\", \""+name+"\", hk_form_selector(get_choices_selector_"+to_lower(type_name)+"_"+name+"), "+to_Anubis_source(help)+")" | |
| 60 | 60 | else |
| 61 | 61 | "integer(\""+to_upper(name)+"\", \""+name+"\", "+to_Anubis_source(help)+")", |
| 62 | 62 | } |
| ... | ... | @@ -70,7 +70,7 @@ define String |
| 70 | 70 | text_choices(choices_list) then |
| 71 | 71 | //if choice list is NOT empty we construct the possible choices selector |
| 72 | 72 | if length(choices_list) > 0 then |
| 73 | - "choices_text(\""+to_upper(name)+"\", \""+name+"\", vt_edit_selector(get_choices_selector_"+to_lower(type_name)+"_"+name+"), "+to_Anubis_source(help)+")" | |
| 73 | + "choices_text(\""+to_upper(name)+"\", \""+name+"\", hk_form_selector(get_choices_selector_"+to_lower(type_name)+"_"+name+"), "+to_Anubis_source(help)+")" | |
| 74 | 74 | else |
| 75 | 75 | "text(\""+to_upper(name)+"\", \""+name+"\", "+to_Anubis_source(help)+")" |
| 76 | 76 | } | ... | ... |
src/model.3.0.0.anubis
| ... | ... | @@ -103,7 +103,7 @@ public define HK_Table production_mass_storage_table = |
| 103 | 103 | list_view("current",["model_id", "serial", "status", "date_created"]) |
| 104 | 104 | ], |
| 105 | 105 | //list_edit |
| 106 | - [ edit_view("default", ["purchase_id", "model_id", "serial", "status", "comments"])] | |
| 106 | + [ edit_view_list_form("default", ["purchase_id", "model_id", "serial", "status", "comments"])] | |
| 107 | 107 | ) |
| 108 | 108 | ). |
| 109 | 109 | |
| ... | ... | @@ -367,7 +367,7 @@ public define HK_Table production_products_table = |
| 367 | 367 | list_view("default", ["production_id", "date", "serial", "motherboard_id", "app_id", "status"]) |
| 368 | 368 | ], |
| 369 | 369 | //list_edit |
| 370 | - [ edit_view("default", [ "production_id", "produced", "date", "serial", "security_code", "motherboard_id", "storage_id", "memory_id", "power_supply_id", "wifi", "mac", | |
| 370 | + [ edit_view_list_form("default", [ "production_id", "produced", "date", "serial", "security_code", "motherboard_id", "storage_id", "memory_id", "power_supply_id", "wifi", "mac", | |
| 371 | 371 | "app_id", "os_version", "published", "publish_date", "status", "date_created", "last_modified", "comments"])] |
| 372 | 372 | ) |
| 373 | 373 | ). |
| ... | ... | @@ -401,7 +401,7 @@ public define HK_Table production_production_table = |
| 401 | 401 | list_view("default", ["date", "type_ref_id", "sticker_tpl_id", "product_ref_id", "site_id", "product_count", "produced_count"]) |
| 402 | 402 | ], |
| 403 | 403 | //list_edit |
| 404 | - [ edit_view("default", [ "date", "assembler_id", "type_ref_id", "product_ref_id", "site_id", "serial_prefix_id", "sticker_tpl_id", "starting_index", "product_count", "produced_count", "completed", | |
| 404 | + [ edit_view_list_form("default", [ "date", "assembler_id", "type_ref_id", "product_ref_id", "site_id", "serial_prefix_id", "sticker_tpl_id", "starting_index", "product_count", "produced_count", "completed", | |
| 405 | 405 | "active", "date_created", "last_modified", "comments"])] |
| 406 | 406 | ) |
| 407 | 407 | ). |
| ... | ... | @@ -493,7 +493,7 @@ public define HK_Table production_type_number_table = |
| 493 | 493 | list_view("default", ["type_ref", "description"]) |
| 494 | 494 | ], |
| 495 | 495 | //list_edit |
| 496 | - [ edit_view("default", ["type_ref", "description", "comments"])] | |
| 496 | + [ edit_view_list_form("default", ["type_ref", "description", "comments"])] | |
| 497 | 497 | ) |
| 498 | 498 | ). |
| 499 | 499 | |
| ... | ... | @@ -528,7 +528,7 @@ public define HK_Table production_supplier_table = |
| 528 | 528 | list_view("default", ["company", "phone", "mobile", "email"]) |
| 529 | 529 | ], |
| 530 | 530 | //list_edit |
| 531 | - [ edit_view("default", ["company", "contact_id", "address1", "address2", "zipcode", "city", "country", "email", "url", "phone", "fax", "mobile", | |
| 531 | + [ edit_view_list_form("default", ["company", "contact_id", "address1", "address2", "zipcode", "city", "country", "email", "url", "phone", "fax", "mobile", | |
| 532 | 532 | "siret", "tva_number", "date_created", "last_modified", "comments"])] |
| 533 | 533 | ) |
| 534 | 534 | ). |
| ... | ... | @@ -553,7 +553,7 @@ public define HK_Table department_table = |
| 553 | 553 | list_view("default", ["name"]) |
| 554 | 554 | ], |
| 555 | 555 | //list_edit |
| 556 | - [ edit_view("default", ["name", "description", "comments"])] | |
| 556 | + [ edit_view_list_form("default", ["name", "description", "comments"])] | |
| 557 | 557 | ) |
| 558 | 558 | ). |
| 559 | 559 | |
| ... | ... | @@ -576,7 +576,16 @@ public define HK_Table role_table = |
| 576 | 576 | list_view("default", ["role_name"]) |
| 577 | 577 | ], |
| 578 | 578 | //list_edit |
| 579 | - [ edit_view("default", ["role_name", "description", "comments"])] | |
| 579 | + [ edit_view_list_form("default", ["role_name", "description", "comments"]), | |
| 580 | + edit_view_table_form("table", | |
| 581 | + table([ | |
| 582 | + line([label("role_name"), column("role_name")]), | |
| 583 | + line([empty, column("description")]), | |
| 584 | + line([label("comments"), column("comments")]), | |
| 585 | + line([label("date_created"),column("date_created"),label("last_modified"),column("last_modified")]) | |
| 586 | + ]) | |
| 587 | + ) | |
| 588 | + ] | |
| 580 | 589 | ) |
| 581 | 590 | ). |
| 582 | 591 | |
| ... | ... | @@ -606,7 +615,7 @@ public define HK_Table staff_table = |
| 606 | 615 | |
| 607 | 616 | ], |
| 608 | 617 | //list_edit |
| 609 | - [ edit_view("default", ["contact_id", "department_id", "role_id", "email", "incoming_date", "outgoing_date", "still_present", "date_created", "last_modified", "comments"])] | |
| 618 | + [ edit_view_list_form("default", ["contact_id", "department_id", "role_id", "email", "incoming_date", "outgoing_date", "still_present", "date_created", "last_modified", "comments"])] | |
| 610 | 619 | ) |
| 611 | 620 | ). |
| 612 | 621 | |
| ... | ... | @@ -643,7 +652,7 @@ public define HK_Table address_book_contact_table = |
| 643 | 652 | list_view("details", ["first_name", "last_name", "company", "url", "role", "phone", "mobile", "email", "address1", "address2", "zipcode", "city", "country"]) |
| 644 | 653 | ], |
| 645 | 654 | //list_edit |
| 646 | - [ edit_view("default", ["first_name", "last_name", "company", "role", "address1", "address2", "zipcode", "city", "country", "email", "url", "phone", "fax", "mobile", "comments"])] | |
| 655 | + [ edit_view_list_form("default", ["first_name", "last_name", "company", "role", "address1", "address2", "zipcode", "city", "country", "email", "url", "phone", "fax", "mobile", "comments"])] | |
| 647 | 656 | ) |
| 648 | 657 | ). |
| 649 | 658 | ... | ... |