From 0fd81ba1cc1c77918aab14121bc2387c4a5fdee8 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sat, 22 Jul 2017 20:13:49 +0200 Subject: [PATCH] Add test for Manage_Table_SQL --- scenario/ajax_manage_table_sql.php | 61 ++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 scenario/ajax_manage_table_sql.php diff --git a/scenario/ajax_manage_table_sql.php b/scenario/ajax_manage_table_sql.php new file mode 100644 index 000000000..8ae6e27ca --- /dev/null +++ b/scenario/ajax_manage_table_sql.php @@ -0,0 +1,61 @@ + + +if (!defined('ALLOWED')) + die('Appel direct ne sont pas permis'); +if ( ! defined ("AJAX_TEST ")) { + echo "Can not be called directly but via AJAX"; + return; +} +/** + * @file + * @brief Test the ajax call from test_manage_table_sql.php + */ +$http=new HttpInput(); +try { +$table=$http->get('table'); +$action=$http->get('action'); +$p_id=$http->get('p_id', "numeric"); +$ctl_id=$http->get('ctl'); +} catch(Exception $e) { + + echo $e->getMessage(); +} +require_once NOALYSS_INCLUDE."/lib/manage_table_sql.class.php"; +require_once NOALYSS_INCLUDE."/database/acc_plan_sql.class.php"; + +$obj=new Acc_Plan_SQL($cn, $p_id); +$manage_table=new Manage_Table_SQL($obj); +$manage_table->add_json_param("TestAjaxFile", + NOALYSS_HOME."/../scenario/ajax_manage_table_sql.php"); + +if ($action=="input") +{ + $manage_table->set_object_name($ctl_id); + $manage_table->set_col_label('pcm_val', "Poste"); + $manage_table->set_col_label('parent_accounting', "Dépend"); + $manage_table->set_col_label('pcm_lib', "Libellé"); + $manage_table->set_col_label('pcm_type', + "Type de menu".HtmlInput::infobulle(33)); + header('Content-type: text/xml; charset=UTF-8'); + echo $manage_table->ajax_input()->saveXML(); + return; +} \ No newline at end of file