diff --git a/html/test.php b/html/test.php index e5eeb9adc..cb3de23e0 100644 --- a/html/test.php +++ b/html/test.php @@ -31,16 +31,11 @@ include_once("../include/constant.php"); include_once("lib/ac_common.php"); -require_once('class/database.class.php'); -require_once ('class/dossier.class.php'); -require_once('lib/html_input.class.php'); -require_once('lib/icon_action.class.php'); -require_once ('lib/function_javascript.php'); -require_once 'class/noalyss_user.class.php'; -require_once NOALYSS_INCLUDE.'/lib/http_input.class.php'; + + html_page_start(); global $http; - +define ('TEST_UNIT',1); $http=new HttpInput(); @@ -67,8 +62,8 @@ define('ALLOWED', 1); load_all_script(); // To enable assert , set "zend.assertions" in the php.ini file ini_set("assert.active",1); -assert_options(ASSERT_ACTIVE, 1); -assert_options(ASSERT_WARNING, 1); +// assert_options(ASSERT_ACTIVE, 1); +// assert_options(ASSERT_WARNING, 1); //removed in PHP8 assert_options(ASSERT_QUIET_EVAL, 1); function my_assert_handler($file, $line, $code) { @@ -77,7 +72,6 @@ function my_assert_handler($file, $line, $code) Line '$line'
Code '$code'

"; } -assert_options(ASSERT_CALLBACK, 'my_assert_handler'); /******************************************************************************************************************/ /* Utilities /******************************************************************************************************************/ @@ -97,34 +91,43 @@ function get_card_with_activity() { } /* - * Loading of all scenario + * Loading of all scenario HTML + XML */ -$scan=scandir('../scenario/'); -$maxscan=count($scan); -$cnt_scenario=0;$scenario=array(); +function retrieve_files($directory) :array +{ + $scan=scandir($directory); + $maxscan=count($scan); + $cnt_scenario=0;$scenario=array(); -for ($e_scan=0; $e_scan<$maxscan; $e_scan++) - { - if (is_file('../scenario/'.$scan[$e_scan])&&strpos($scan[$e_scan], '.php')==true) + for ($e_scan=0; $e_scan<$maxscan; $e_scan++) { - $description=""; - $a_description=file('../scenario/'.$scan[$e_scan]); - $max_description=count($a_description); - for ($w=0; $w<$max_description; $w++) + if (is_file("{$directory}/".$scan[$e_scan])&&strpos($scan[$e_scan], '.php')==true) { - if (strpos($a_description[$w], '@description:')==true) + $description=""; + $a_description=file("{$directory}/".$scan[$e_scan]); + $max_description=count($a_description); + for ($w=0; $w<$max_description; $w++) { - $description=$a_description[$w]; - $description=noalyss_str_replace('//@description:', '', $description); + if (strpos($a_description[$w], '@description:')==true) + { + $description=$a_description[$w]; + $description=noalyss_str_replace('//@description:', '', $description); + } } + $scenario[$cnt_scenario]['file']="{$directory}/".$scan[$e_scan]; + $scenario[$cnt_scenario]['desc']=$description; + $cnt_scenario++; + + } - $scenario[$cnt_scenario]['file']=$scan[$e_scan]; - $scenario[$cnt_scenario]['desc']=$description; - $cnt_scenario++; - - } - } + return $scenario; +} + +$html_files=retrieve_files(NOALYSS_BASE.'/scenario/HTML'); +$xml_files=retrieve_files(NOALYSS_BASE.'/scenario/XML'); +$lib_files=retrieve_files(NOALYSS_BASE.'/scenario/LIB'); + $script=$http->request('script', "string",''); $min=$cn->get_value("select p_id from parm_periode order by p_start asc limit 1"); $max=$cn->get_value("select p_id from parm_periode order by p_start desc limit 1"); @@ -137,7 +140,8 @@ if ($script=="") * cherche pour fichier a include, s'il y en a alors les affiche * avec une description */ - + + echo h1('HTML'); echo ''; $get='test.php?'.http_build_query(array('script'=>"all", 'gDossier'=>$gDossierLogInput, 'description'=>"Tous les scripts")); @@ -149,23 +153,70 @@ if ($script=="") echo ''; echo ''; echo ''; - - for ($e=0; $e<$cnt_scenario; $e++) + $nb_html=count($html_files); + for ($e=0; $e<$nb_html; $e++) { - $get='test.php?'.http_build_query(array('script'=>$scenario[$e]['file'], 'gDossier'=>$gDossierLogInput, 'description'=>$scenario[$e]['desc'])); + $get='test.php?'.http_build_query(array('script'=>$html_files[$e]['file'], 'gDossier'=>$gDossierLogInput, 'description'=>$html_files[$e]['desc'])); echo ''; echo ''; echo ''; - echo ''; + echo ''; echo ''; - + + } + echo '
Tous les scripts
'; echo $e; echo ''; echo ''; - echo $scenario[$e]['file']; + echo basename($html_files[$e]['file']); echo ''; echo ''.$scenario[$e]['desc'].''.$html_files[$e]['desc'].'
'; + + echo h1('XML'); + echo ''; + + $nb_xml=count($xml_files); + for ($e=0; $e<$nb_xml; $e++) + { + + $get='test.php?'.http_build_query(array('script'=>$xml_files[$e]['file'], 'gDossier'=>$gDossierLogInput, 'description'=>$xml_files[$e]['desc'])); + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + + } + echo '
'; + echo $e; + echo ''; + echo ''; + echo basename($xml_files[$e]['file']); + echo ''; + echo ''.$xml_files[$e]['desc'].'
'; + + + echo h1('Libraries'); + echo ''; + + $nb_lib=count($lib_files); + for ($e=0; $e<$nb_lib; $e++) + { + + $get='test.php?'.http_build_query(array('script'=>$lib_files[$e]['file'], 'gDossier'=>$gDossierLogInput, 'description'=>$lib_files[$e]['desc'])); + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + } echo '
'; + echo $e; + echo ''; + echo ''; + echo basename($lib_files[$e]['file']); + echo ''; + echo ''.$lib_files[$e]['desc'].'
'; } @@ -207,11 +258,10 @@ else { $start_mem=memory_get_usage(); $start_time=microtime(true); - $script=noalyss_str_replace('../', '', $script); $description=$http->get("description","string", "aucune description"); echo '

'.$script."

"; echo '

description = '.$description.'

'; - include '../scenario/'.$script; + include $script; $end_mem=memory_get_usage(); $end_time=microtime(true); diff --git a/include/ajax/ajax_card.php b/include/ajax/ajax_card.php index ab74ca0f5..466ab6aae 100644 --- a/include/ajax/ajax_card.php +++ b/include/ajax/ajax_card.php @@ -343,7 +343,7 @@ case 'st': } $xml=escape_xml($html); - header('Content-type: text/xml; charset=UTF-8'); +if (!defined("TEST_UNIT")) header('Content-type: text/xml; charset=UTF-8'); echo << diff --git a/include/ajax/ajax_ledger.php b/include/ajax/ajax_ledger.php index 5cfe228aa..60e2cff5d 100644 --- a/include/ajax/ajax_ledger.php +++ b/include/ajax/ajax_ledger.php @@ -94,8 +94,6 @@ if ($ledger == "") { $html = escape_xml($html); if (!headers_sent()) { header('Content-type: text/xml; charset=UTF-8'); - } else { - echo "HTML" . unescape_xml($html); } echo << @@ -543,10 +541,9 @@ switch ($action) { $html = escape_xml($html); if (!headers_sent()) { header('Content-type: text/xml; charset=UTF-8'); -} else { - echo "HTML" . unescape_xml($html); } + echo << diff --git a/include/lib/pdf_core.class.php b/include/lib/pdf_core.class.php index 9111751ea..47fffea84 100644 --- a/include/lib/pdf_core.class.php +++ b/include/lib/pdf_core.class.php @@ -65,7 +65,7 @@ class PDF_Core extends TFPDF private $cells=array(); - + protected $bigger; public function __construct ( $orientation = 'P', $unit = 'mm', $format = 'A4') { $this->bigger=0; diff --git a/scenario/Fiche-TestMe.php b/scenario/HTML/Fiche-TestMe.php similarity index 100% rename from scenario/Fiche-TestMe.php rename to scenario/HTML/Fiche-TestMe.php diff --git a/scenario/FicheTest.php b/scenario/HTML/FicheTest.php similarity index 100% rename from scenario/FicheTest.php rename to scenario/HTML/FicheTest.php diff --git a/scenario/acc_ledger_historyTest.php b/scenario/HTML/acc_ledger_historyTest.php similarity index 100% rename from scenario/acc_ledger_historyTest.php rename to scenario/HTML/acc_ledger_historyTest.php diff --git a/scenario/ach-call-menu.php b/scenario/HTML/ach-call-menu.php similarity index 87% rename from scenario/ach-call-menu.php rename to scenario/HTML/ach-call-menu.php index ffe08ceff..1cc60908c 100644 --- a/scenario/ach-call-menu.php +++ b/scenario/HTML/ach-call-menu.php @@ -1,5 +1,5 @@ '42', 'ac' => 'COMPTA/MENUACH/ACH', diff --git a/scenario/ach-confirm.php b/scenario/HTML/ach-confirm.php similarity index 86% rename from scenario/ach-confirm.php rename to scenario/HTML/ach-confirm.php index 063b75537..4dc45b48a 100644 --- a/scenario/ach-confirm.php +++ b/scenario/HTML/ach-confirm.php @@ -6,7 +6,7 @@ $_GET=array ( ); $_POST=array ( 'gDossier' => '42', - 'e_client' => 'IMMOB', + 'e_client' => 'FOURNI1', 'nb_item' => '1', 'p_jrn' => '3', 'e_comm' => 'Loyer', @@ -15,7 +15,7 @@ $_POST=array ( 'jrn_type' => 'ACH', 'e_pj' => 'ACH1', 'e_pj_suggest' => 'ACH1', - 'mt' => '1415995238.7737', + 'mt' => '141599523a8.7737', 'e_mp' => '0', 'e_march0' => 'LOYER', 'e_march0_price' => '2560', @@ -28,8 +28,12 @@ $_POST=array ( 'opd_name' => 'Paiement loyer', 'od_description' => 'Paiement du loyer', 'record' => 'Enregistrement', + 'p_currency_rate'=>1 , + 'p_currency_code'=>'0' ); $_POST['gDossier']=$gDossierLogInput; $_GET['gDossier']=$gDossierLogInput; $_REQUEST=array_merge($_GET,$_POST); + +html_page_start(); include 'compta_ach.inc.php'; diff --git a/scenario/ach-template-confirm.php b/scenario/HTML/ach-template-confirm.php similarity index 95% rename from scenario/ach-template-confirm.php rename to scenario/HTML/ach-template-confirm.php index a26270d99..77fe4d21f 100644 --- a/scenario/ach-template-confirm.php +++ b/scenario/HTML/ach-template-confirm.php @@ -10,13 +10,13 @@ $_POST=array ( 'gDossier' => '42', 'nb_item' => '10', 'p_jrn' => '3', - 'e_date' => '01.02.2016', + 'e_date' => '01.02.2017', 'e_ech' => '', - 'e_client' => 'DIV', + 'e_client' => 'FOURNI1', 'e_pj' => 'ACH2', 'e_pj_suggest' => 'ACH2', 'e_comm' => 'Paiement loyer', - 'e_march0' => 'FID15', + 'e_march0' => 'LOYER', 'e_march0_label' => 'TEST', 'e_march0_price' => '2560.0000', 'e_quant0' => '1.0000', @@ -102,6 +102,8 @@ $_POST=array ( 'sa' => 'p', 'e_mp' => '0', 'view_invoice' => 'Enregistrer', + 'p_currency_rate'=>1 , + 'p_currency_code'=>'0' ); $_POST['gDossier']=$gDossierLogInput; $_GET['gDossier']=$gDossierLogInput; diff --git a/scenario/ach-template-record.php b/scenario/HTML/ach-template-record.php similarity index 96% rename from scenario/ach-template-record.php rename to scenario/HTML/ach-template-record.php index d801c3b00..6f965e36f 100644 --- a/scenario/ach-template-record.php +++ b/scenario/HTML/ach-template-record.php @@ -12,7 +12,7 @@ $_POST=array ( 'p_jrn' => '3', 'e_date' => '01.01.2017', 'e_ech' => '', - 'e_client' => 'IMMOB', + 'e_client' => 'FOURNI1', 'e_pj' => 'ACH2', 'e_pj_suggest' => 'ACH2', 'e_comm' => 'Paiement loyer', @@ -99,6 +99,8 @@ $_POST=array ( 'jrn_type' => 'ACH', 'e_mp' => '0', 'view_invoice' => 'Enregistrer', + 'p_currency_rate'=>1 , + 'p_currency_code'=>'0' ); $_POST['gDossier']=$gDossierLogInput; $_GET['gDossier']=$gDossierLogInput; diff --git a/scenario/ach-template.php b/scenario/HTML/ach-template.php similarity index 94% rename from scenario/ach-template.php rename to scenario/HTML/ach-template.php index 41d4c3c5a..9ff80d610 100644 --- a/scenario/ach-template.php +++ b/scenario/HTML/ach-template.php @@ -11,4 +11,5 @@ $_POST=array ( $_POST['gDossier']=$gDossierLogInput; $_GET['gDossier']=$gDossierLogInput; $_REQUEST=array_merge($_GET,$_POST); + html_page_start(); include 'compta_ach.inc.php'; diff --git a/scenario/achisto.php b/scenario/HTML/achisto.php similarity index 80% rename from scenario/achisto.php rename to scenario/HTML/achisto.php index 0bf739713..3ed5c6924 100644 --- a/scenario/achisto.php +++ b/scenario/HTML/achisto.php @@ -1,5 +1,5 @@ '42', 'ac' => 'COMPTA/MENUACH/ACHISTO', @@ -9,4 +9,5 @@ $_POST=array ( $_POST['gDossier']=$gDossierLogInput; $_GET['gDossier']=$gDossierLogInput; $_REQUEST=array_merge($_GET,$_POST); +html_page_start(); include 'history_operation.inc.php'; diff --git a/scenario/adhisto.php b/scenario/HTML/adhisto.php similarity index 79% rename from scenario/adhisto.php rename to scenario/HTML/adhisto.php index 4c84df0da..3f5fb94ae 100644 --- a/scenario/adhisto.php +++ b/scenario/HTML/adhisto.php @@ -1,5 +1,5 @@ '42', 'ac' => 'COMPTA/MENUODS/ODHISTO', @@ -10,4 +10,5 @@ $_POST=array ( $_POST['gDossier']=$gDossierLogInput; $_GET['gDossier']=$gDossierLogInput; $_REQUEST=array_merge($_GET,$_POST); +html_page_start(); include 'history_operation.inc.php'; diff --git a/scenario/card-list-bank.php b/scenario/HTML/card-list-bank.php similarity index 100% rename from scenario/card-list-bank.php rename to scenario/HTML/card-list-bank.php diff --git a/scenario/card-list-customer.php b/scenario/HTML/card-list-customer.php similarity index 100% rename from scenario/card-list-customer.php rename to scenario/HTML/card-list-customer.php diff --git a/scenario/cfgpcmn.php b/scenario/HTML/cfgpcmn.php similarity index 100% rename from scenario/cfgpcmn.php rename to scenario/HTML/cfgpcmn.php diff --git a/scenario/company.php b/scenario/HTML/company.php similarity index 100% rename from scenario/company.php rename to scenario/HTML/company.php diff --git a/scenario/create-database.php b/scenario/HTML/create-database.php similarity index 84% rename from scenario/create-database.php rename to scenario/HTML/create-database.php index 02d2307af..771c85b33 100644 --- a/scenario/create-database.php +++ b/scenario/HTML/create-database.php @@ -18,11 +18,16 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ // Copyright (2018) Author Dany De Bontridder +//@description:create a database (domaine).dossier1 , check the SQL for creating MOD1 and MOD2 $_POST['gDossier']=$gDossierLogInput; $_GET['gDossier']=$gDossierLogInput; $_REQUEST=array_merge($_GET,$_POST); +?> +

create a database

+Create dossier1 with sql/mod1/schema.sql , data.sql and constraint.sql +exec_sql("create database ".domaine."dossier1 encoding='utf8'"); $cn=new Database(1, 'dos'); $cn->execute_script(NOALYSS_INCLUDE.'/sql/mod1/schema.sql'); $cn->execute_script(NOALYSS_INCLUDE.'/sql/mod1/data.sql'); $cn->execute_script(NOALYSS_INCLUDE.'/sql/mod1/constraint.sql'); + +echo Dossier::name(1); + +?> diff --git a/scenario/fin-confirm.php b/scenario/HTML/fin-confirm.php similarity index 95% rename from scenario/fin-confirm.php rename to scenario/HTML/fin-confirm.php index 5abb0c940..9d3922364 100644 --- a/scenario/fin-confirm.php +++ b/scenario/HTML/fin-confirm.php @@ -13,10 +13,10 @@ $_POST=array ( 'first_sold' => '0', 'e_pj' => 'FIN1', 'e_pj_suggest' => 'FIN1', - 'e_date' => '02.01.2014', + 'e_date' => '02.01.2017', 'mt' => '1415995351.0398', 'sa' => 'n', - 'e_other0' => 'IMMOB ', + 'e_other0' => 'FOURNI ', 'e_other0_comment' => '', 'e_other0_amount' => '2560', 'e_concerned0' => '2', diff --git a/scenario/fin-paiement.php b/scenario/HTML/fin-paiement.php similarity index 100% rename from scenario/fin-paiement.php rename to scenario/HTML/fin-paiement.php diff --git a/scenario/fin-record.php b/scenario/HTML/fin-record.php similarity index 90% rename from scenario/fin-record.php rename to scenario/HTML/fin-record.php index f41c47f36..3648f7ca9 100644 --- a/scenario/fin-record.php +++ b/scenario/HTML/fin-record.php @@ -10,17 +10,17 @@ $_POST=array ( 'gDossier' => '42', 'nb_item' => '5', 'chdate' => '1', - 'e_date' => '02.01.2014', + 'e_date' => '02.01.2017', 'p_jrn' => '1', 'e_pj' => 'FIN1', 'e_pj_suggest' => 'FIN1', 'first_sold' => '0', 'last_sold' => '', 'dateop0' => '', - 'e_other0' => 'IMMOB ', - 'e_other_name0' => 'Immo Bureau', + 'e_other0' => 'FOURNI', + 'e_other_name0' => '', 'e_other0_comment' => '', - 'e_other0_amount' => '2560', + 'e_other0_amount' => '2560.12', 'e_concerned0' => '2', 'dateop1' => '', 'e_other1' => '', diff --git a/scenario/fisto.php b/scenario/HTML/fisto.php similarity index 100% rename from scenario/fisto.php rename to scenario/HTML/fisto.php diff --git a/scenario/fsaldo.php b/scenario/HTML/fsaldo.php similarity index 100% rename from scenario/fsaldo.php rename to scenario/HTML/fsaldo.php diff --git a/scenario/historic-card.php b/scenario/HTML/historic-card.php similarity index 100% rename from scenario/historic-card.php rename to scenario/HTML/historic-card.php diff --git a/scenario/ivatnumber.test.php b/scenario/HTML/ivatnumber.test.php similarity index 100% rename from scenario/ivatnumber.test.php rename to scenario/HTML/ivatnumber.test.php diff --git a/scenario/menu-cfgled.php b/scenario/HTML/menu-cfgled.php similarity index 100% rename from scenario/menu-cfgled.php rename to scenario/HTML/menu-cfgled.php diff --git a/scenario/menu-cfgpcmn.php b/scenario/HTML/menu-cfgpcmn.php similarity index 100% rename from scenario/menu-cfgpcmn.php rename to scenario/HTML/menu-cfgpcmn.php diff --git a/scenario/menu-compta-ach.php b/scenario/HTML/menu-compta-ach.php similarity index 100% rename from scenario/menu-compta-ach.php rename to scenario/HTML/menu-compta-ach.php diff --git a/scenario/menufin.php b/scenario/HTML/menufin.php similarity index 100% rename from scenario/menufin.php rename to scenario/HTML/menufin.php diff --git a/scenario/ods-new.php b/scenario/HTML/ods-new.php similarity index 100% rename from scenario/ods-new.php rename to scenario/HTML/ods-new.php diff --git a/scenario/package_repository.test.php b/scenario/HTML/package_repository.test.php similarity index 100% rename from scenario/package_repository.test.php rename to scenario/HTML/package_repository.test.php diff --git a/scenario/pdf_operation.php b/scenario/HTML/pdf_operation.php similarity index 100% rename from scenario/pdf_operation.php rename to scenario/HTML/pdf_operation.php diff --git a/scenario/test_acc_plan_mtable.php b/scenario/HTML/test_acc_plan_mtable.php similarity index 100% rename from scenario/test_acc_plan_mtable.php rename to scenario/HTML/test_acc_plan_mtable.php diff --git a/scenario/test_currency_mtable.php b/scenario/HTML/test_currency_mtable.php similarity index 100% rename from scenario/test_currency_mtable.php rename to scenario/HTML/test_currency_mtable.php diff --git a/scenario/test_postgres_json_array.php b/scenario/HTML/test_postgres_json_array.php similarity index 100% rename from scenario/test_postgres_json_array.php rename to scenario/HTML/test_postgres_json_array.php diff --git a/scenario/tva_parameter.php b/scenario/HTML/tva_parameter.php similarity index 100% rename from scenario/tva_parameter.php rename to scenario/HTML/tva_parameter.php diff --git a/scenario/vehisto b/scenario/HTML/vehisto similarity index 100% rename from scenario/vehisto rename to scenario/HTML/vehisto diff --git a/scenario/ven-call-menu.php b/scenario/HTML/ven-call-menu.php similarity index 100% rename from scenario/ven-call-menu.php rename to scenario/HTML/ven-call-menu.php diff --git a/scenario/HtmlInput.test.php b/scenario/LIB/HtmlInput.test.php similarity index 79% rename from scenario/HtmlInput.test.php rename to scenario/LIB/HtmlInput.test.php index 0a0c1e02f..bc8425cac 100644 --- a/scenario/HtmlInput.test.php +++ b/scenario/LIB/HtmlInput.test.php @@ -27,27 +27,6 @@ * @brief Test the HtmlInput object it means the Inum, IText , ... */ -require_once NOALYSS_INCLUDE.'/lib/html_input.class.php'; -require_once NOALYSS_INCLUDE.'/lib/iaction.class.php'; -require_once NOALYSS_INCLUDE.'/lib/ibutton.class.php'; -require_once NOALYSS_INCLUDE.'/lib/icard.class.php'; -require_once NOALYSS_INCLUDE.'/lib/icheckbox.class.php'; -require_once NOALYSS_INCLUDE.'/lib/iconcerned.class.php'; -require_once NOALYSS_INCLUDE.'/lib/idate.class.php'; -require_once NOALYSS_INCLUDE.'/lib/ifile.class.php'; -require_once NOALYSS_INCLUDE.'/lib/ihidden.class.php'; -require_once NOALYSS_INCLUDE.'/lib/inum.class.php'; -require_once NOALYSS_INCLUDE.'/lib/iperiod.class.php'; -require_once NOALYSS_INCLUDE.'/lib/iposte.class.php'; -require_once NOALYSS_INCLUDE.'/lib/iradio.class.php'; -require_once NOALYSS_INCLUDE.'/lib/irelated_action.class.php'; -require_once NOALYSS_INCLUDE.'/lib/iselect.class.php'; -require_once NOALYSS_INCLUDE.'/lib/ispan.class.php'; -require_once NOALYSS_INCLUDE.'/lib/itext.class.php'; -require_once NOALYSS_INCLUDE.'/lib/itextarea.class.php'; -require_once NOALYSS_INCLUDE.'/lib/itva_popup.class.php'; -require_once NOALYSS_INCLUDE.'/lib/input_switch.class.php'; -require_once NOALYSS_INCLUDE.'/lib/input_checkbox.class.php'; $http=new HttpInput(); ?> diff --git a/scenario/html_tab.test.php b/scenario/LIB/html_tab.test.php similarity index 95% rename from scenario/html_tab.test.php rename to scenario/LIB/html_tab.test.php index f629ef7ba..b2ab6dbbb 100644 --- a/scenario/html_tab.test.php +++ b/scenario/LIB/html_tab.test.php @@ -26,8 +26,7 @@ if (!defined('ALLOWED')) * @file * @brief Test of Html_Tab and Output_Html_Tab */ -require_once NOALYSS_INCLUDE.'/lib/html_tab.class.php'; -require_once NOALYSS_INCLUDE.'/lib/output_html_tab.class.php'; + $tab = new Html_Tab('tab1',_("Titre 1")); $tab->set_mode('link'); diff --git a/scenario/icon_actionTest.php b/scenario/LIB/icon_actionTest.php similarity index 100% rename from scenario/icon_actionTest.php rename to scenario/LIB/icon_actionTest.php diff --git a/scenario/inplace_edit.test.php b/scenario/LIB/inplace_edit.test.php similarity index 100% rename from scenario/inplace_edit.test.php rename to scenario/LIB/inplace_edit.test.php diff --git a/scenario/progress-bar.test.php b/scenario/LIB/progress-bar.test.php similarity index 99% rename from scenario/progress-bar.test.php rename to scenario/LIB/progress-bar.test.php index f7fdb68e6..7bef62a8c 100644 --- a/scenario/progress-bar.test.php +++ b/scenario/LIB/progress-bar.test.php @@ -1,4 +1,4 @@ - diff --git a/scenario/select-box-test.php b/scenario/LIB/select-box-test.php similarity index 100% rename from scenario/select-box-test.php rename to scenario/LIB/select-box-test.php diff --git a/scenario/smoke.php b/scenario/LIB/smoke.php similarity index 73% rename from scenario/smoke.php rename to scenario/LIB/smoke.php index fa7e2e7f4..75c772b7b 100644 --- a/scenario/smoke.php +++ b/scenario/LIB/smoke.php @@ -36,14 +36,17 @@

smoke prompt

-	function func_callback_prompt(ev)
+
+    	function func_callback_prompt(ev)
 	{
 		if (ev) { alert ("accepted  "+ev);}
 		console.debug(ev);
 		return true;
 	}
-	
-smoke.prompt('Confirmez-vous',func_callback_prompt,{title:"Titre"});
+	function smoke_prompt()
+	{
+		smoke.prompt('Donnez un élement',func_callback_prompt,{title:"Titre"});
+	}
 
+

smoke signal

+ + + +
+
+        function signal() { smoke.signal('Sauvé',function(e){},{duration:500}); }
+
+
+
diff --git a/scenario/test_manage_table_sql.php b/scenario/LIB/test_manage_table_sql.php similarity index 100% rename from scenario/test_manage_table_sql.php rename to scenario/LIB/test_manage_table_sql.php diff --git a/scenario/XML/ajax-add-card-category.php b/scenario/XML/ajax-add-card-category.php new file mode 100644 index 000000000..0d3a9ecea --- /dev/null +++ b/scenario/XML/ajax-add-card-category.php @@ -0,0 +1,34 @@ + '42', + 'ctl' => 'select_card_div', + 'op' => 'card', + 'op2'=>'st', + 'fil' => '-1', + 'ledger' => '2', +); +$_POST['gDossier']=$gDossierLogInput; +$_GET['gDossier']=$gDossierLogInput; + $_REQUEST=array_merge($_GET,$_POST); + define ('TEST_UNIT',1); +ob_start(); + include NOALYSS_HOME.'/ajax_misc.php'; +$output=ob_get_clean(); +echo '
'; +$xml=simplexml_load_string($output); +print "ctl {$xml->ctl}"; +echo '
'; +print "code "; +print '
'; +print_r($xml->code); +echo '
'; +echo ''; +echo htmlentities($xml->code); +echo ''; + +echo '
'; +print "fiche_cat "; +print_r($xml->fiche_cat); +echo '
'; + diff --git a/scenario/ajax-detail-operation1.php b/scenario/XML/ajax-detail-operation1.php similarity index 64% rename from scenario/ajax-detail-operation1.php rename to scenario/XML/ajax-detail-operation1.php index 8874afe42..fe86b7932 100644 --- a/scenario/ajax-detail-operation1.php +++ b/scenario/XML/ajax-detail-operation1.php @@ -3,7 +3,7 @@ $_GET=array ( 'op' => 'ledger', 'act' => 'de', - 'jr_id' => '2856', + 'jr_id' => '137', 'div' => 'det2', ); $_POST=array ( @@ -11,4 +11,10 @@ $_POST=array ( $_POST['gDossier']=$gDossierLogInput; $_GET['gDossier']=$gDossierLogInput; $_REQUEST=array_merge($_GET,$_POST); +define ('TEST_UNIT',1); +ob_start(); include 'ajax_misc.php'; +$output=ob_get_contents(); +ob_clean(); +echo unescape_xml($output); + echo htmlentities($output); diff --git a/scenario/ajax-detail-operation2.php b/scenario/XML/ajax-detail-operation2.php similarity index 56% rename from scenario/ajax-detail-operation2.php rename to scenario/XML/ajax-detail-operation2.php index 1ef2ce551..3e5d80df1 100644 --- a/scenario/ajax-detail-operation2.php +++ b/scenario/XML/ajax-detail-operation2.php @@ -1,9 +1,9 @@ 'ledger', 'act' => 'de', - 'jr_id' => '2870', + 'jr_id' => '147', 'div' => 'det2', ); $_POST=array ( @@ -11,4 +11,10 @@ $_POST=array ( $_POST['gDossier']=$gDossierLogInput; $_GET['gDossier']=$gDossierLogInput; $_REQUEST=array_merge($_GET,$_POST); +define ('TEST_UNIT',1); +ob_start(); include 'ajax_misc.php'; +$output=ob_get_contents(); +ob_clean(); +echo unescape_xml($output); +echo htmlentities($output); diff --git a/scenario/ajax-detail-operation3.php b/scenario/XML/ajax-detail-operation3.php similarity index 60% rename from scenario/ajax-detail-operation3.php rename to scenario/XML/ajax-detail-operation3.php index a14539381..25521f044 100644 --- a/scenario/ajax-detail-operation3.php +++ b/scenario/XML/ajax-detail-operation3.php @@ -3,12 +3,17 @@ $_GET=array ( 'op' => 'ledger', 'act' => 'de', - 'jr_id' => '3532', + 'jr_id' => '213', 'div' => 'det2', ); $_POST=array ( ); $_POST['gDossier']=$gDossierLogInput; $_GET['gDossier']=$gDossierLogInput; - $_REQUEST=array_merge($_GET,$_POST); +define ('TEST_UNIT',1); +ob_start(); include 'ajax_misc.php'; +$output=ob_get_contents(); +ob_clean(); +echo unescape_xml($output); +echo htmlentities($output); diff --git a/scenario/ajax-detail-operation4.php b/scenario/XML/ajax-detail-operation4.php similarity index 63% rename from scenario/ajax-detail-operation4.php rename to scenario/XML/ajax-detail-operation4.php index 92f1ca8f3..5e07c7266 100644 --- a/scenario/ajax-detail-operation4.php +++ b/scenario/XML/ajax-detail-operation4.php @@ -3,7 +3,7 @@ $_GET=array ( 'op'=>"ledger", 'act' => 'de', - 'jr_id' => '2826', + 'jr_id' => '316', 'div' => 'det2', ); $_POST=array ( @@ -11,4 +11,10 @@ $_POST=array ( $_POST['gDossier']=$gDossierLogInput; $_GET['gDossier']=$gDossierLogInput; $_REQUEST=array_merge($_GET,$_POST); +define ('TEST_UNIT',1); +ob_start(); include 'ajax_misc.php'; +$output=ob_get_contents(); +ob_clean(); +echo unescape_xml($output); +echo htmlentities($output); diff --git a/scenario/ach-new.php b/scenario/ach-new.php deleted file mode 100644 index 48501bb35..000000000 --- a/scenario/ach-new.php +++ /dev/null @@ -1,34 +0,0 @@ - '42', - 'ac' => 'COMPTA/MENUACH/ACH', -); -$_POST=array ( - 'gDossier' => '42', - 'nb_item' => '1', - 'p_jrn' => '3', - 'e_date' => '01.03.2016', - 'e_ech' => '', - 'e_client' => 'IMMOB', - 'e_pj' => 'ACH1', - 'e_pj_suggest' => 'ACH1', - 'e_comm' => 'Loyer', - 'e_march0' => 'LOYER', - 'e_march0_price' => '2560', - 'e_quant0' => '1', - 'htva_march0' => '2560', - 'e_march0_tva_id' => '4', - 'e_march0_tva_amount' => '0', - 'tva_march0' => '0', - 'tvac_march0' => '2560', - 'jrn_type' => 'ACH', - 'p_action' => 'ach', - 'sa' => 'p', - 'e_mp' => '0', - 'view_invoice' => 'Enregistrer', -); -$_POST['gDossier']=$gDossierLogInput; -$_GET['gDossier']=$gDossierLogInput; - $_REQUEST=array_merge($_GET,$_POST); -include 'compta_ach.inc.php'; diff --git a/scenario/ajax-add-card-category.php b/scenario/ajax-add-card-category.php deleted file mode 100644 index 10aeab903..000000000 --- a/scenario/ajax-add-card-category.php +++ /dev/null @@ -1,16 +0,0 @@ - '42', - 'ctl' => 'select_card_div', - 'op' => 'card', - 'op2'=>'st', - 'fil' => '-1', - 'ledger' => '2', -); -$_POST=array ( -); -$_POST['gDossier']=$gDossierLogInput; -$_GET['gDossier']=$gDossierLogInput; - $_REQUEST=array_merge($_GET,$_POST); -include NOALYSS_HOME.'/ajax_misc.php'; diff --git a/scenario/ajax-save-operation.php b/scenario/ajax-save-operation.php deleted file mode 100644 index 80fdd7365..000000000 --- a/scenario/ajax-save-operation.php +++ /dev/null @@ -1,37 +0,0 @@ - 'det2', - 'jr_id' => '2856', - 'gDossier' => '27', - 'p_date' => '05.12.2013', - 'p_ech' => '', - 'p_date_paid' => '', - 'npj' => 'ACH607', - 'lib' => 'Consommable, ptit matériel', - 'jrn_note' => '', - 'j_id' => - array ( - 0 => '7629', - 1 => '7630', - ), - 'BON_COMMANDE' => '', - 'OTHER' => '', - 'raptdet2' => '', - 'related' => '327,231,330', - 'Fermer' => 'Fermer', - 'save' => 'Sauver', - 'Effacer' => 'Effacer', - 'bextdet2' => 'Extourner', - 'rapt' => '', - 'div' => 'det2', - 'act' => 'save', - 'op'=>'ledger', - 'jr_optype'=>'NOR' -); -$_POST['gDossier']=$gDossierLogInput; -$_GET['gDossier']=$gDossierLogInput; - $_REQUEST=array_merge($_GET,$_POST); -include 'ajax_misc.php'; diff --git a/scenario/ajax_acc_plan_mtable.php b/scenario/ajax_acc_plan_mtable.php deleted file mode 100644 index c782969ca..000000000 --- a/scenario/ajax_acc_plan_mtable.php +++ /dev/null @@ -1,64 +0,0 @@ - - -if (!defined('ALLOWED')) - die('Appel direct ne sont pas permis'); -if ( ! defined ("AJAX_TEST")) { - echo "Can not be called directly but via ajax_test.php"; - 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."/class/acc_plan_mtable.class.php"; - -$obj=new Acc_Plan_SQL($cn); -$obj->set_limit_fiche_qcode(5); -$obj->set_pk_value($p_id); -$obj->load(); -$manage_table=new Acc_Plan_MTable($obj); -$manage_table->add_json_param("TestAjaxFile", - NOALYSS_HOME."/../scenario/ajax_acc_plan_mtable.php"); -$manage_table->set_object_name($ctl_id); -$manage_table->set_callback("ajax_test.php"); -if ($action=="input") -{ - header('Content-type: text/xml; charset=UTF-8'); - echo $manage_table->ajax_input()->saveXML(); - return; -} -elseif ($action == "save") -{ - $xml=$manage_table->ajax_save(); - header('Content-type: text/xml; charset=UTF-8'); - echo $xml->saveXML(); -} \ No newline at end of file diff --git a/scenario/ajax_manage_table_sql.php b/scenario/ajax_manage_table_sql.php deleted file mode 100644 index d7401060b..000000000 --- a/scenario/ajax_manage_table_sql.php +++ /dev/null @@ -1,79 +0,0 @@ - - -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; -} \ No newline at end of file diff --git a/scenario/cfgpcm-ajout-poste.php b/scenario/cfgpcm-ajout-poste.php deleted file mode 100644 index a85711b3a..000000000 --- a/scenario/cfgpcm-ajout-poste.php +++ /dev/null @@ -1,19 +0,0 @@ - '42', - 'ac' => 'PARAM/C0PCMN', -); -$_POST=array ( - 'p_action' => 'pcmn', - 'gDossier' => '42', - 'p_val' => '4519', - 'p_lib' => 'Compte TVA', - 'p_parent' => '451', - 'p_type' => 'ACT', - 'Ajout' => 'Ajout', -); -$_POST['gDossier']=$gDossierLogInput; -$_GET['gDossier']=$gDossierLogInput; - $_REQUEST=array_merge($_GET,$_POST); -include 'param_pcmn.inc.php'; diff --git a/scenario/comptabilite_analytique.php b/scenario/comptabilite_analytique.php deleted file mode 100644 index 508a814a6..000000000 --- a/scenario/comptabilite_analytique.php +++ /dev/null @@ -1,42 +0,0 @@ -get_array( - "select j_id from jrnx join jrn on (jr_grpt_id=j_grpt) - where - jr_id=$1 - ", array(48)); -$nb = count($a_jrnxId); - -for ($i = 0; $i<$nb; $i++) { -// First row - $a = $anc->get_by_jid($a_jrnxId[$i]['j_id']); - if (! empty($a) ) { - $complete=$anc->to_request($a, 1); - var_dump($complete); - } -} diff --git a/scenario/ods-confirm.php b/scenario/ods-confirm.php deleted file mode 100644 index 0868b2879..000000000 --- a/scenario/ods-confirm.php +++ /dev/null @@ -1,35 +0,0 @@ - '42', - 'ac' => 'COMPTA/MENUODS/ODS', -); -$_POST=array ( - 'ac' => 'COMPTA/MENUODS/ODS', - 'e_date' => '14.11.2014', - 'desc' => 'TVA', - 'period' => '102', - 'e_pj' => 'ODS1', - 'e_pj_suggest' => 'ODS1', - 'mt' => '1415996970.8822', - 'e_comm' => 'TVA', - 'jrn_type' => 'ODS', - 'p_jrn' => '4', - 'nb_item' => '5', - 'jrn_concerned' => '', - 'gDossier' => '42', - 'poste0' => '4519', - 'ld0' => 'Compte TVA', - 'amount0' => '250', - 'poste1' => '6700', - 'ld1' => 'Paiement TVA', - 'amount1' => '250', - 'ck1' => '', - 'opd_name' => 'Paiement TVA', - 'od_description' => '', - 'save' => 'Confirmer', -); -$_POST['gDossier']=$gDossierLogInput; -$_GET['gDossier']=$gDossierLogInput; - $_REQUEST=array_merge($_GET,$_POST); -include 'compta_ods.inc.php'; diff --git a/scenario/ods-record.php b/scenario/ods-record.php deleted file mode 100644 index efb976484..000000000 --- a/scenario/ods-record.php +++ /dev/null @@ -1,44 +0,0 @@ - '42', - 'ac' => 'COMPTA/MENUODS/ODS', -); -$_POST=array ( - 'gDossier' => '42', - 'ac' => 'COMPTA/MENUODS/ODS', - 'p_jrn' => '4', - 'e_date' => '14.11.2016', - 'e_pj' => 'ODS1', - 'e_pj_suggest' => 'ODS1', - 'desc' => 'TVA', - 'nb_item' => '5', - 'jrn_type' => 'ODS', - 'qc_0' => '', - 'poste0' => '4519', - 'ld0' => 'Compte TVA', - 'amount0' => '250', - 'qc_1' => '', - 'poste1' => '6700', - 'ld1' => 'Paiement TVA', - 'amount1' => '250', - 'ck1' => '', - 'qc_2' => '', - 'poste2' => '', - 'ld2' => '', - 'amount2' => '', - 'qc_3' => '', - 'poste3' => '', - 'ld3' => '', - 'amount3' => '', - 'qc_4' => '', - 'poste4' => '', - 'ld4' => '', - 'amount4' => '', - 'jrn_concerned' => '', - 'summary' => 'Sauvez', -); -$_POST['gDossier']=$gDossierLogInput; -$_GET['gDossier']=$gDossierLogInput; - $_REQUEST=array_merge($_GET,$_POST); -include 'compta_ods.inc.php'; diff --git a/scenario/readme.txt b/scenario/readme.txt index 71fd91f97..1301e66ec 100644 --- a/scenario/readme.txt +++ b/scenario/readme.txt @@ -37,7 +37,16 @@ L'objectif étant de pouvoir tester et de rejouer facilement les actions que vou Il est aussi possible de faire vos tests unitaire ici , autrement qu'avec PHPUNIT (voir répertiore php-unit) +Vous pouver l'utiliser pour les sorties ajax, mises au point de librarie, scénario , cela permet de tester les +fichiers à include (.inc.php) , les exports , les réponses ajax et appeler les fonctions test_me dans les classes +(static function test_me() ). +Dans votre code, vous pouvez ajouter des portions de code ainsi + + if (defined ('TEST_UNIT')) { + // exécuté uniquement si appelé pour les tests unitaires + + } ----------------------- ENGLISH ----------------------- @@ -55,5 +64,11 @@ You point you browser noalyss/html/test.php an you click on the link with the and you can rerun the file , it works also for ajax. -It is useful to test ajax answer , unit test or testing a class +It is useful to test ajax answer , unit test or testing a class (with static function test_me() ) +In your code, you can do + + if (defined ('TEST_UNIT')) { + // executed only if calling script is test.php, + + } \ No newline at end of file diff --git a/scenario/ven-new.php b/scenario/ven-new.php deleted file mode 100644 index d86305fa8..000000000 --- a/scenario/ven-new.php +++ /dev/null @@ -1,43 +0,0 @@ - '42', - 'ac' => 'COMPTA/VENMENU/VEN', -); -$_POST=array ( - 'ledger_type' => 'VEN', - 'ac' => 'COMPTA/VENMENU/VEN', - 'sa' => 'p', - 'gDossier' => '42', - 'nb_item' => '2', - 'p_jrn' => '2', - 'e_date' => '14.11.2016', - 'e_ech' => '', - 'e_client' => 'CLIENT1 ', - 'e_pj' => 'VEN1', - 'e_pj_suggest' => 'VEN1', - 'e_comm' => 'Première vente', - 'e_march0' => 'DEPLAC', - 'e_march0_price' => '120', - 'e_quant0' => '1', - 'htva_march0' => '120', - 'e_march0_tva_id' => '1', - 'e_march0_tva_amount' => '25.2', - 'tva_march0' => '25.2', - 'tvac_march0' => '145.2', - 'e_march1' => '', - 'e_march1_price' => '', - 'e_quant1' => '1', - 'htva_march1' => '0', - 'e_march1_tva_id' => '', - 'e_march1_tva_amount' => '', - 'tva_march1' => '0', - 'tvac_march1' => '0', - 'jrn_type' => 'VEN', - 'e_mp' => '0', - 'view_invoice' => 'Enregistrer', -); -$_POST['gDossier']=$gDossierLogInput; -$_GET['gDossier']=$gDossierLogInput; - $_REQUEST=array_merge($_GET,$_POST); -include 'compta_ven.inc.php'; diff --git a/scenario/ven-record.php b/scenario/ven-record.php deleted file mode 100644 index 5c119ee4b..000000000 --- a/scenario/ven-record.php +++ /dev/null @@ -1,40 +0,0 @@ - '42', - 'ac' => 'COMPTA/VENMENU/VEN', -); -$_POST=array ( - 'gDossier' => '42', - 'bon_comm' => '', - 'other_info' => '', - 'e_client' => 'CLIENT1 ', - 'nb_item' => '2', - 'p_jrn' => '2', - 'mt' => '1415995185.7619', - 'e_comm' => 'Première vente', - 'e_date' => '14.11.2016', - 'e_ech' => '', - 'e_pj' => 'VEN1', - 'e_pj_suggest' => 'VEN1', - 'e_mp' => '0', - 'jrn_type' => 'VEN', - 'e_march0' => 'DEPLAC', - 'e_march0_price' => '120', - 'e_march0_tva_id' => '1', - 'e_march0_tva_amount' => '25.2', - 'e_quant0' => '1', - 'e_march1' => '', - 'e_march1_price' => '', - 'e_march1_tva_id' => '', - 'e_march1_tva_amount' => '', - 'e_quant1' => '1', - 'ac' => 'COMPTA/VENMENU/VEN', - 'opd_name' => '', - 'od_description' => '', - 'record' => 'Enregistrement', -); -$_POST['gDossier']=$gDossierLogInput; -$_GET['gDossier']=$gDossierLogInput; - $_REQUEST=array_merge($_GET,$_POST); -include 'compta_ven.inc.php';