Commit e41b7b8aac5b29c0413c3593aa5c5bac5391bbf1

Authored by David RENÉ
1 parent bacee7d0

add a new web_action hkc_create_row. Until now the create or update was managed …

…by update. The behavior of update is to create a row if not exist or update it if exists. But this behavior introduce a bug I didn't notice until now. By calling only update_row function the trigger belonging to create function are never applied. So the core was updated to distinguish the creation or update and then apply the correct trigger.
Showing 2 changed files with 4 additions and 3 deletions   Show diff stats
view/view_table_renderer.anubis
@@ -975,7 +975,7 @@ public define HTML_Partial_Content @@ -975,7 +975,7 @@ public define HTML_Partial_Content
975 (if length(list_entries) > 5 then 975 (if length(list_entries) > 5 then
976 [ 976 [
977 one_line_fields([ 977 one_line_fields([
978 - partial(jquery_button(jQuery_button(button, dialog_id+button_name, button_name, button_label, jQuery_actioner(same, jqscript(jq_form_submit_and_close(dialog_id, form_id, hkc_update_row, [("table_name", table_name), ("sub_dialog", sub_dialog)], after_close_cb)))))), 978 + partial(jquery_button(jQuery_button(button, dialog_id+button_name, button_name, button_label, jQuery_actioner(same, jqscript(jq_form_submit_and_close(dialog_id, form_id, if create then hkc_create_row else hkc_update_row, [("table_name", table_name), ("sub_dialog", sub_dialog)], after_close_cb)))))),
979 partial(jquery_button(jQuery_button(button, dialog_id+"cancel", "cancel", _T("CANCEL"), jQuery_actioner(same, jqscript("$('#"+dialog_id+"').dialog('close')"))))), 979 partial(jquery_button(jQuery_button(button, dialog_id+"cancel", "cancel", _T("CANCEL"), jQuery_actioner(same, jqscript("$('#"+dialog_id+"').dialog('close')"))))),
980 ]), 980 ]),
981 hr 981 hr
@@ -1003,7 +1003,7 @@ public define HTML_Partial_Content @@ -1003,7 +1003,7 @@ public define HTML_Partial_Content
1003 1003
1004 [ hr, 1004 [ hr,
1005 one_line_fields([ 1005 one_line_fields([
1006 - partial(jquery_button(jQuery_button(button, dialog_id+button_name+"_bt", button_name, button_label, jQuery_actioner(same, jqscript(jq_form_submit_and_close(dialog_id, form_id, hkc_update_row, [("table_name", table_name), ("sub_dialog", sub_dialog)], after_close_cb)))))), 1006 + partial(jquery_button(jQuery_button(button, dialog_id+button_name+"_bt", button_name, button_label, jQuery_actioner(same, jqscript(jq_form_submit_and_close(dialog_id, form_id, if create then hkc_create_row else hkc_update_row, [("table_name", table_name), ("sub_dialog", sub_dialog)], after_close_cb)))))),
1007 partial(jquery_button(jQuery_button(button, dialog_id+"cancel_bt", "cancel", _T("CANCEL"), jQuery_actioner(same, jqscript("$('#"+dialog_id+"').dialog('close')"))))), 1007 partial(jquery_button(jQuery_button(button, dialog_id+"cancel_bt", "cancel", _T("CANCEL"), jQuery_actioner(same, jqscript("$('#"+dialog_id+"').dialog('close')"))))),
1008 ]) 1008 ])
1009 ] 1009 ]
@@ -1281,7 +1281,7 @@ public define HTML_Partial_Content @@ -1281,7 +1281,7 @@ public define HTML_Partial_Content
1281 // submit(if create then hkc_save_row else hkc_update_row, failure, button_name, [("table_name", table_name)]), 1281 // submit(if create then hkc_save_row else hkc_update_row, failure, button_name, [("table_name", table_name)]),
1282 // submit(if create then hkc_save_row_and_new else hkc_update_row_and_new, failure, button_name_and_new, [("table_name", table_name)]), 1282 // submit(if create then hkc_save_row_and_new else hkc_update_row_and_new, failure, button_name_and_new, [("table_name", table_name)]),
1283 // submit(hkc_cancel, failure, _T("CANCEL")) 1283 // submit(hkc_cancel, failure, _T("CANCEL"))
1284 - partial(jquery_button(jQuery_button(button, dialog_id+button_name, button_name, button_label, jQuery_actioner(same, jqscript(jq_form_submit_and_close(dialog_id, form_id, hkc_update_row, [("table_name", table_name), ("sub_dialog", sub_dialog)], after_close_cb)))))), 1284 + partial(jquery_button(jQuery_button(button, dialog_id+button_name, button_name, button_label, jQuery_actioner(same, jqscript(jq_form_submit_and_close(dialog_id, form_id, if create then hkc_create_row else hkc_update_row, [("table_name", table_name), ("sub_dialog", sub_dialog)], after_close_cb)))))),
1285 partial(jquery_button(jQuery_button(button, dialog_id+"cancel", "cancel", _T("CANCEL"), jQuery_actioner(same, jqscript("$('#"+dialog_id+"').dialog('close')"))))), 1285 partial(jquery_button(jQuery_button(button, dialog_id+"cancel", "cancel", _T("CANCEL"), jQuery_actioner(same, jqscript("$('#"+dialog_id+"').dialog('close')"))))),
1286 1286
1287 ]) 1287 ])
view/web_action.anubis
@@ -21,6 +21,7 @@ public define WEB_Action_Name hkc_query = controller_action("hk_c" @@ -21,6 +21,7 @@ public define WEB_Action_Name hkc_query = controller_action("hk_c"
21 public define WEB_Action_Name hkc_list_view = controller_action("hk_c", "view_table"). 21 public define WEB_Action_Name hkc_list_view = controller_action("hk_c", "view_table").
22 public define WEB_Action_Name hkc_list_view_name = controller_action("hk_c", "hkc_list_view_name"). 22 public define WEB_Action_Name hkc_list_view_name = controller_action("hk_c", "hkc_list_view_name").
23 public define WEB_Action_Name hkc_list_view_filter = controller_action("hk_c", "hkc_list_view_filter"). 23 public define WEB_Action_Name hkc_list_view_filter = controller_action("hk_c", "hkc_list_view_filter").
  24 +public define WEB_Action_Name hkc_create_row = controller_action("hk_c", "create_row").
24 public define WEB_Action_Name hkc_save_row = controller_action("hk_c", "save_row"). 25 public define WEB_Action_Name hkc_save_row = controller_action("hk_c", "save_row").
25 public define WEB_Action_Name hkc_save_row_and_new = controller_action("hk_c", "save_row_and_new"). 26 public define WEB_Action_Name hkc_save_row_and_new = controller_action("hk_c", "save_row_and_new").
26 public define WEB_Action_Name hkc_update_row = controller_action("hk_c", "update_row"). 27 public define WEB_Action_Name hkc_update_row = controller_action("hk_c", "update_row").