ini_set('disable_functions', 'exit,die,header');
//@description:Test the class manage_table_sql and javascript
$_GET=array (
);
$_POST=array (
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
require_once NOALYSS_INCLUDE."/database/acc_plan_sql.class.php";
require_once NOALYSS_INCLUDE."/lib/manage_table_sql.class.php";
$jrn=new Acc_Plan_SQL($cn);
$manage_table=new Manage_Table_SQL($jrn);
$manage_table->set_callback("ajax_test.php");
echo $manage_table->get_json();
echo " Function add_json_param : add param TestAjaxFile";
$manage_table->add_json_param("TestAjaxFile",NOALYSS_HOME."/../scenario/ajax_manage_table_sql.php");
echo "
";
$r =json_decode($manage_table->get_json(),TRUE);
if ( isset($r['TestAjaxFile']) && $r['TestAjaxFile'] == NOALYSS_HOME."/../scenario/ajax_manage_table_sql.php") { echo "$g_succeed ok
";} else {echo "$g_failed not ok";}
echo "
";
$manage_table->create_js_script();
// Test the column header
$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));
$manage_table->set_sort_column("pcm_lib");
// Change visible property
function test_visible_update(Manage_Table_SQL $p_manage_table,$p_property,$p_visible,$p_update) {
global $g_failed,$g_succeed;
// test visibility
$p_manage_table->set_property_visible($p_property, $p_visible);
echo "$p_property VISIBLE ($p_visible)" .$p_manage_table->get_property_visible($p_property);
if ( $p_manage_table->get_property_visible($p_property) == $p_visible) echo "$g_succeed OK"; else echo " $g_failed FAIL";echo "
";
// test update
echo "$p_property UPDATE ($p_update)" .$p_manage_table->get_property_updatable($p_property);
$p_manage_table->set_property_updatable($p_property, $p_update);
if ( $p_manage_table->get_property_updatable($p_property) == $p_update) echo "$g_succeed OK"; else echo "$g_failed FAIL";echo "
";
}
test_visible_update($manage_table, "pcm_type", FALSE, FALSE);
test_visible_update($manage_table, "pcm_type", FALSE, TRUE);
test_visible_update($manage_table, "pcm_type", TRUE, FALSE);
test_visible_update($manage_table, "pcm_type", TRUE, TRUE);
test_visible_update($manage_table, "parent_accounting", FALSE, FALSE);
test_visible_update($manage_table, "parent_accounting", FALSE, TRUE);
test_visible_update($manage_table, "parent_accounting", TRUE, FALSE);
test_visible_update($manage_table, "parent_accounting", TRUE, TRUE);
echo "