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->request('table'); $action=$http->request('action'); $p_id=$http->request('p_id', "number"); $ctl_id=$http->request('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"; if ($action=="input") { $obj=new Acc_Plan_SQL($cn); $obj->set_limit_fiche_qcode(5); $obj->set_pk_value($p_id); $obj->load(); $manage_table=new Manage_Table_SQL($obj); $manage_table->add_json_param("TestAjaxFile", NOALYSS_HOME."/../scenario/ajax_manage_table_sql.php"); $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".Icon_Action::infobulle(33)); header('Content-type: text/xml; charset=UTF-8'); echo $manage_table->ajax_input()->saveXML(); return; } elseif ($action=="save") { $obj=new Acc_Plan_SQL($cn); $obj->set_limit_fiche_qcode(5); $obj->set_pk_value($p_id); $obj->load(); $manage_table=new Manage_Table_SQL($obj); $manage_table->set_object_name($ctl_id); $manage_table->add_json_param("TestAjaxFile", NOALYSS_HOME."/../scenario/ajax_manage_table_sql.php"); header('Content-type: text/xml; charset=UTF-8'); echo $manage_table->ajax_save()->saveXML(); return; }