PRERELEASE 10A

This commit is contained in:
sparkyx 2025-11-22 15:40:35 +01:00
commit 83efa90a33
1141 changed files with 40635 additions and 85178 deletions

View file

@ -0,0 +1,71 @@
<?php
//@description: export export_histo_csv.php
$_GET=array (
'gDossier' => '25',
'ledger_type' => 'ALL',
'tag_option' => '0',
'act' => 'CSV:histo',
'viewsearch' => 'Export vers CSV',
'qcode' => '',
);
$_POST=array (
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
ob_start();
include NOALYSS_INCLUDE."/export/export_histo_csv.php";
$result=ob_get_contents();
ob_end_clean();
html_page_start();
if (trim($result) != '') {
echo p('result ok','class="alert-success"');
} else {
echo p('result failed','class="notice"');
}
echo h1('Tous les journaux');
\Noalyss_Csv::csv2table($result);
echo h1('Achat 01.01.2019 - 31.12.2019');
$_GET=array (
'date_paid_start' => '',
'date_paid_end' => '',
'date_start' => '01.01.2019',
'date_end' => '31.12.2019',
'desc' => '',
'amount_min' => '0',
'amount_max' => '0',
'operation_filter' => 'all',
'accounting' => '',
'gDossier' => '25',
'ledger_type' => 'ACH',
'search_optag_option' => '0',
'p_currency_code' => '-1',
'tva_id_search' => '',
'tag_option' => '0',
'act' => 'CSV:histo',
'viewsearch' => 'Export vers CSV',
'qcode' => '',
);
$_POST=array (
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
ob_start();
include NOALYSS_INCLUDE."/export/export_histo_csv.php";
$result=ob_get_contents();
ob_end_clean();
html_page_start();
if (trim($result) != '') {
echo p('result ok','class="alert-success"');
} else {
echo p('result failed','class="notice"');
}
\Noalyss_Csv::csv2table($result);

View file

@ -19,14 +19,14 @@
*/
// Copyright (2018) Author Dany De Bontridder <dany@alchimerys.be>
//@description:History : show different history : detail, list, ...
/**
* @file
* @brief Test of ledger_history
* @brief Test of ledger_history show html
*/
require_once NOALYSS_INCLUDE."/class/acc_ledger_history.class.php";
html_page_start();
$ledger=[1,2,3,4];
echo Dossier::hidden();
global $cn, $g_user, $g_succeed, $g_failed;
@ -35,13 +35,18 @@ $cn=Dossier::connect();
$ledger_history=Acc_Ledger_History::factory($cn, $ledger, $min, $max, "E","all");
echo h1("Detailled Accounting");
echo h2(_("export detail html all ledgers result = Detailled Accounting from Acc_Ledger_History_Generic"));
echo '<a href="#n1">Detailled Accounting</a>';
$ledger_history->export_detail_html();
echo h2(_("Set mode to D etailled all_ledgers result = Detailled Accounting from Acc_Ledger_History_Generic" ));
echo h2(_("Set mode to D etailled all_ledgers result = Detailled Accounting from Acc_Ledger_History_Generic" )
,'id="n1"');
echo '<a href="#n2">Sale Listing</a>';
$ledger_history->set_m_mode("D");
$ledger_history->export_html();
echo h1(_("Only VEN from Acc_Ledger_History_Sale"));
echo h1(_("Only VEN from Acc_Ledger_History_Sale"),' id="n2"');
echo '<a href="#n3">Sale Detailed</a>';
$ledger_history=Acc_Ledger_History::factory($cn, [2], $min , $max , "L","all");
$ledger_history->export_detail_html();
@ -49,46 +54,55 @@ echo h2(_("Only VEN one line"));
$ledger_history->set_a_ledger([2]);
$ledger_history->set_m_mode("L");
$ledger_history->export_html();
echo h2(_("Only VEN Detailled"));
echo h2(_("Only VEN Detailled"),'id="n3"');
echo '<a href="#n4">Sale Extended</a>';
$ledger_history->set_a_ledger([2]);
$ledger_history->set_m_mode("D");
$ledger_history->export_html();
echo h2(_("Only VEN Extended"));
echo h2(_("Only VEN Extended"),'id="n4"');
echo '<a href="#n5">Sale + Purchase</a>';
$ledger_history->set_a_ledger([2]);
$ledger_history->set_m_mode("E");
$ledger_history->export_html();
echo h2("VEN + ACH");
echo h2("VEN + ACH",'id="n5"');
echo '<a href="#n6">Purchase Detailed</a>';
$ledger_history=Acc_Ledger_History::factory($cn, [3,2], $min, $max , "L","all");
$ledger_history->export_oneline_html();
echo h1("ACH from Acc_Ledger_History_Purchase");
echo h2("Detailled accouting");
echo h2("Detailled accouting",'id="n6"');
echo '<a href="#n7">Purchase listing</a>';
$ledger_history=new Acc_Ledger_History_Purchase($cn,[3],$max,$min,"A","all");
$ledger_history->export_html();
echo h2("Ach one line");
echo h2("Ach one line",'id="n7"');
echo '<a href="#n8">Purchase Detailed</a>';
$ledger_history->set_m_mode("L");
$ledger_history->export_html();
echo h2("Ach Detail");
echo h2("Ach Detail" ,'id="n8"');
echo '<a href="#n9">Purchase Extended</a>';
$ledger_history->set_m_mode("D");
$ledger_history->export_html();
echo h2("Ach Extended");
echo h2("Ach Extended" ,'id="n9"');
echo '<a href="#n10">Financial</a>';
$ledger_history->set_m_mode("E");
$ledger_history->export_html();
echo h1("FIN from Acc_Ledger_History_Financial");
echo h2("Detailled accouting");
echo h2("Detailled accouting",'id="n10"');
echo '<a href="#n11">Financial one line</a>';
$ledger_history=new Acc_Ledger_History_Financial($cn,[11,16],$min,$max,"A","all");
$ledger_history->export_html();
echo h2("FIN one line");
echo h2("FIN one line" ,'id="n11"');
echo '<a href="#n12">Financial Detailed</a>';
$ledger_history->set_m_mode("L");
$ledger_history->export_html();
echo h2(">FIN Detail");
echo h2(">FIN Detail", 'id="n12"');
echo '<a href="#n13">Financial extended</a>';
$ledger_history->set_m_mode("D");
$ledger_history->export_html();
echo h2("FIN Extended");
echo h2("FIN Extended", 'id="n13"');
$ledger_history->set_m_mode("E");
$ledger_history->export_html();

View file

@ -0,0 +1,27 @@
<?php
/*
* This file is part of NOALYSS.
*
* NOALYSS is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* NOALYSS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with NOALYSS; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Copyright Author Dany De Bontridder danydb@aevalys.eu 20/12/24
/*!
* \file
* \brief Calls Acc_Operation::testme
*/
//@description:Acc_Operation calls the Acc_Operation::testme function
Acc_Operation::test_me();

View file

@ -1,5 +1,5 @@
<?php
//@description:ACH Appel menu Achat
//@description:ACH new purchase
$_GET=array (
'gDossier' => '42',
'ac' => 'COMPTA/MENUACH/ACH',
@ -9,4 +9,8 @@ $_POST=array (
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
html_page_start();
include 'compta_ach.inc.php';

View file

@ -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';

View file

@ -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;

View file

@ -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;

View file

@ -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';

View file

@ -1,5 +1,5 @@
<?php
//@description:ACHISTO
//@description:ACHISTO History Purchase
$_GET=array (
'gDossier' => '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';

View file

@ -1,5 +1,5 @@
<?php
//@description:ODHISTO
//@description:ODHISTO : history Misc. Operation
$_GET=array (
'gDossier' => '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';

View file

@ -18,11 +18,16 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Copyright (2018) Author Dany De Bontridder <dany@alchimerys.be>
//@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);
?>
<h1 class="">create a database </h1>
Create dossier1 with sql/mod1/schema.sql , data.sql and constraint.sql
<?php
/**
* @file
* @brief
@ -30,9 +35,14 @@ $_REQUEST=array_merge($_GET,$_POST);
*/
$cn=new Database();
$cn->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);
?>

View file

@ -1,9 +1,10 @@
<?php
//@description: Test the class Fiche
//@description: Test the class Document_Type
/*
* This file is part of NOALYSS.
*
* PhpCompta is free software; you can redistribute it and/or modify
* NOALYSS is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
@ -14,34 +15,29 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PhpCompta; if not, write to the Free Software
* along with NOALYSS; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Copyright Author Dany De Bontridder danydb@aevalys.eu 4/11/24
/*!
* \file
* \brief
*/
// Copyright (2016) Author Dany De Bontridder <dany@alchimerys.be>
/**
* @file
* @brief
* @param type $name Descriptionara
* @brief Test , experiment the class Fiche
* @see Fiche
*/
require_once NOALYSS_INCLUDE."/class/acc_account_ledger.class.php";
$_GET=array (
$_GET=array (
);
$_POST=array (
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
$acc_count=$cn->get_array("select count(*),j_poste".
" from jrnx ".
"group by j_poste order by count(*) desc");
$a=new Acc_Account_Ledger($cn,$acc_count[0]['j_poste']);
echo h1("Acc_Account_Ledger->get_row");
$result=$a->get_row($min,$max);
var_dump($result);
echo h1("Acc_Account_Ledger->get_row_date");
$result=$a->get_row_date('01.01.200','01.01.2099');
var_dump($result);
if (!defined('ALLOWED')) {
die ("not allowed");
}
Document_Type::test_me();

View file

@ -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',

View file

@ -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' => '',

View file

@ -73,11 +73,16 @@ $core=$package_repository->make_object("core", "");
$core->download();
//download fake plugin
echo h1("Plugin : download and install ");
$plugin=$package_repository->make_object("plugin","COPRO");
$plugin->download();
echo h2("Install in noalyss/include/ext/copro-fake");
$plugin->install();
try {
echo h1("Plugin : download and install ");
$plugin=$package_repository->make_object("plugin","COPRO");
$plugin->download();
echo h2("Install in noalyss/include/ext/copro-fake");
$plugin->install();
} catch (\Exception $e) {
echo $e->getMessage();
}
echo h1("Available template");

View file

@ -0,0 +1,53 @@
<?php
//@description: Check that Acc_Operation and his children has implemented properly the _toString function
/*
* This file is part of NOALYSS.
*
* NOALYSS is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* NOALYSS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with NOALYSS; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Copyright Author Dany De Bontridder danydb@aevalys.eu 22/10/23
/**
* @file
* @brief answer to an inplace object
*/
echo h1(_("Vente"));
$obj=new Acc_Sold($cn,911);
$obj->get();
print '<pre>';
print $obj;
print '</pre>';
echo h1(_("Opération diverse"));
$obj=new Acc_Misc($cn,316);
$obj->get();
print '<pre>';
print $obj;
print '</pre>';
echo h1(_("Financier"));
$obj=new Acc_Fin($cn,142);
$obj->get();
print '<pre>';
print $obj;
print '</pre>';
echo h1(_("Achat"));
$obj=new Acc_Purchase($cn,141);
$obj->get();
print '<pre>';
print $obj;
print '</pre>';

View file

@ -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();
?>
@ -84,12 +63,15 @@ $http=new HttpInput();
$input_switch->readOnly=TRUE;
echo $input_switch->input();
?>
<h2>InputCheckBox (Check Box)</h2>
<h2>EXPERIMENTAL InputCheckBox (Check Box)</h2>
<?php
require_once NOALYSS_INCLUDE.'/lib/input_checkbox.class.php';
?>
<ul>
<?php
for ($i = 0 ; $i < 10 ; $i ++) :
for ($i = 0 ; $i < 10 ; $i++ ) :
echo '<li>';
$check[$i]=new InputCheckBox("check[]",1,"checkid".$i);
$check[$i]->classrange="improvechkbox";
@ -154,8 +136,8 @@ $http=new HttpInput();
for (var i = 0;i < aFile.length;i++) {
if ( aFile[i].getAttribute("type")==="file" ) {
console.debug("file"+aFile[i].files[0].size);
info.innerHTML+="file : "+aFile[i].files[0].name+":"+aFile[i].files[0].size+" bytes <br>";
console.debug("file"aFile[i].files[0].size);
info.innerHTML="file : "aFile[i].files[0].name":"aFile[i].files[0].size" bytes <br>";
}
@ -164,7 +146,7 @@ $http=new HttpInput();
document.getElementById("file_to_upload").addEventListener("change",function() {
if ( this.files[0] ) {
console.debug("file"+this.files[0].size);
console.debug("file"this.files[0].size);
}
});
</script>
@ -203,8 +185,7 @@ $http=new HttpInput();
<?php
$itext->maxlength=15;
$itext->style=' class="input_text" ';
echo $itext->input();
echo $itext->input();
echo $itext->display();
?>
<pre>
@ -241,7 +222,7 @@ $http=new HttpInput();
<?php
$itext->style=' class="input_text" ';
$itext->pattern="[0-9]+";
$itext->pattern="[0-9]";
$itext->maxlength="4";
$itext->placeholder="9999";
$itext->title="code";
@ -250,7 +231,7 @@ $http=new HttpInput();
echo HtmlInput::submit("valider","valider");
?>
<pre>
$itext->pattern="[0-9]+";
$itext->pattern="[0-9]";
<?= htmlspecialchars($itext->input());?>
<?= htmlspecialchars($itext->display());?>
</pre>
@ -344,5 +325,4 @@ display is
echo $select->display();
?>
?>

View file

@ -0,0 +1,67 @@
<?php
/*
* This file is part of NOALYSS.
*
* PhpCompta is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* PhpCompta is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PhpCompta; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Copyright (2002-2021) Author Dany De Bontridder <danydb@noalyss.eu>
if (!defined('ALLOWED'))
die('Appel direct ne sont pas permis');
/**
* @file
* @brief test Database Core
*/
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$cn=Dossier::connect();
echo h2(" Status IDLE");
echo $cn->status();
echo h2(" Status start "); //echo PGSQL_TRANSACTION_INTRANS;
echo $cn->start();
echo $cn->status ();
echo "<br>";
$cn->get_value("select count(*) from jrnx");
echo "<br>";
echo $cn->status ();
echo "<br>";
echo h2(" Status after rollback ");
echo $cn->commit();
echo "<br>";
echo $cn->status ();
echo h1("Upload");
echo h2("One file");
if ( isset($_POST['submit_one'])) {
var_dump($_FILES);
// $cn->start();
if ( $cn->upload("validate_one") != false){
echo "success : loaded ".var_export($_FILES['validate_one'],true);
}
// $cn->commit();
}else{
echo <<<FORM
<FORM METHOD="POST" enctype="multipart/form-data">
<input type="FILE" name="validate_one">
<input type="SUBMIT" name="submit_one">
</FORM>
FORM;
}

View file

@ -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');

View file

@ -117,4 +117,7 @@ include_once NOALYSS_INCLUDE."/lib/icon_action.class.php";
<div id="example_div" style="display:none">
Ceci est caché
</div>
</div>
</p>
<p>
<?=\Icon_Action::refresh(uniqid(),'alert("1")')?>
</p>

View file

@ -0,0 +1,35 @@
<?php
/*
* Copyright (C) 2021 Dany De Bontridder <dany@alchimerys.be>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
//@description:Test input SELECT ISELET for special chars
$select=new ISelect("select");
$select->value=array(
[ 'label'=>'Label "eco" > "aco" ', "value"=>'>'],
[ 'label'=>'Label "eco" > "aco" ', "value"=>'"'],
[ 'label'=>'<script>alert()</script>', "value"=>'<'],
[ 'label'=>'Label "eco" > "aco" ', "value"=>'>']
);
echo '<p>';
echo $select->input();
echo '</p>';

View file

@ -0,0 +1,85 @@
<?php
/*
* This file is part of NOALYSS.
*
* NOALYSS is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* NOALYSS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with NOALYSS; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Copyright Author Dany De Bontridder danydb@aevalys.eu 19/11/22
//@description:Test the textarea , especially the Enrich function
/*!
* \file
* \brief Test the textarea , especially the Enrich function
*/
$http=new HttpInput();
echo '<div class="nicEdit-main">';
echo $http->post("enrich","raw","");
echo $http->post("enrich2","text","");
echo $http->post("enrich3","raw","");
print_r($_POST);
echo '</div>';
?>
<h1>Format Area</h1>
<form method="post">
<?php
$itext=new \ITextarea("enrich");
$itext->value= $http->post("enrich","raw","");
$itext->set_enrichText("full");
echo $itext->input();
?>
<hr>
<h1>Minimum Area</h1>
<?php
$itext=new \ITextarea("enrich2");
$itext->value= $http->post("enrich2","raw","");
$itext->set_enrichText("minimal");
echo $itext->input();
?>
<p>
<h1>No Toolbar</h1>
<?php
$itext=new \ITextarea("enrich3");
$itext->value= $http->post("enrich3","raw","");
$itext->heigh=130;
$itext->set_enrichText("no-toolbar");
echo $itext->input();
?>
<p>
<h1>Plain Area</h1>
<?php
$itext=new \ITextarea("enrich4");
$itext->value= strip_tags($http->post("enrich2","raw",""));
$itext->set_enrichText("plain");
echo $itext->input();
?>
<p>
<input type="submit" value="Valider">
</p>
</form>

View file

@ -1,4 +1,4 @@
<?php
<?php
/*
* Copyright (C) 2018 Dany De Bontridder <dany@alchimerys.be>

View file

@ -1,5 +1,5 @@
<?php
//@description: Test record_log function for recording exception AC_COMMON.PHP
/*
* This file is part of NOALYSS.
*
@ -16,27 +16,33 @@
* You should have received a copy of the GNU General Public License
* along with NOALYSS; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Copyright Author Dany De Bontridder danydb@aevalys.eu 21/02/25
/*!
* \file
* \brief testing functions from ac_common
*/
// Copyright Author Dany De Bontridder dany@alchimerys.be
//@description: Developpement for ANC
require_once NOALYSS_INCLUDE . "/class/anc_operation.class.php";
$anc = new Anc_Operation($cn);
$a_jrnxId = $cn->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);
function y()
{
try {
throw new Exception ("FUNCTION Y",1000);
} catch (\Exception $e) {
throw new Exception($e);
}
}
function x()
{
try {
y();
}catch(Exception $e) {
throw new Exception("from X",2000,$e);
}
}
try {
x();
} catch (\Exception $e) {
record_log($e);
}

View file

@ -3,69 +3,7 @@
<script src="prototype.js"></script>
<style>
/* The container <div> - needed to position the dropdown content */
.select_box{
position: relative;
display: inline-block;
}
/* Dropdown Content (Hidden by Default) */
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
/* Links inside the dropdown */
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
/* Change color of dropdown links on hover */
.dropdown-content a:hover {background-color: #f1f1f1}
/* Show the dropdown menu on hover */
.dropdown:hover .dropdown-content {
display: block;
}
.select_box {
border:solid 0.5px darkblue;
background:white;
width:455px;
max-width:250px;
padding:3px;
margin:0px;
display:none;
position:absolute;
z-index:10;
}
div.select_box ul {
list-style:none;
padding:2px;
margin:1px;
width:100%;
top:10px;
}
div.select_box ul li {
padding-top:2px;
padding-bottom:2px;
margin:2px;
}
div.select_box a {
text-decoration:none;
color : darkblue;
}
div.select_box a:hover,div.select_box ul li:hover {
background-color : blue;
color:lightgrey;
}
</style>
</head>

View file

@ -0,0 +1,45 @@
<?php
/*
* This file is part of NOALYSS.
*
* PhpCompta is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* PhpCompta is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PhpCompta; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Copyright (2002-2020) Author Dany De Bontridder <danydb@noalyss.eu>
if (!defined('ALLOWED'))
die('Appel direct ne sont pas permis');
/**
* @file
* @brief test the select_dialog class
* @see Select_Dialog
*/
require_once NOALYSS_INCLUDE."/lib/select_dialog.class.php";
$selbox=new Select_Dialog("action_add_action2", _("Ajout action"));
$aDocumentType=$cn->get_array("select dt_id,dt_value from document_type order by 2");
$nbDocumentType=count($aDocumentType);
$dossier_id=Dossier::id();
for ($i=0; $i<$nbDocumentType; $i++)
{
$selbox->add_url($aDocumentType[$i]['dt_value'],
"do.php?".http_build_query([
"gDossier"=>$dossier_id,
"sa"=>"update",
"add_action_here"=>"yes",
"action_type"=>$aDocumentType[$i]["dt_id"]]));
}
echo $selbox->input();

View file

@ -36,14 +36,17 @@
<h1> smoke prompt</h1>
<pre>
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"});
}
</pre>
<script>
@ -60,3 +63,16 @@ smoke.prompt('Confirmez-vous',func_callback_prompt,{title:"Titre"});
</script>
<button onclick="smoke_prompt()">smoke_prompt</button>
<h1> smoke signal </h1>
<button onclick="signal()">Signal de 0.5 sec </button>
<script>
function signal() { smoke.signal('Sauvé',function(e){},{duration:500}); }
</script>
<pre>
function signal() { smoke.signal('Sauvé',function(e){},{duration:500}); }
</pre>

View file

@ -0,0 +1,153 @@
<?php
//@description: test Table_Data_SQL and Data_SQL for virtual columns
/*
* This file is part of NOALYSS.
*
* NOALYSS is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* NOALYSS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with NOALYSS; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Copyright Author Dany De Bontridder danydb@aevalys.eu 22/10/23
/**
* @file
* @brief Test Table_Data_SQL
*/
if (!defined('ALLOWED'))
die('Appel direct ne sont pas permis');
class FakeData2_SQL extends \Table_Data_SQL {
function __construct(Database $p_cn, $p_id = -1) {
$this->table = "public.jrn";
$this->primary_key = "jr_id";
/*
* List of columns
*/
$this->name = array(
"jr_id" => "jr_id"
, "jr_def_id" => "jr_def_id"
, "jr_montant" => "jr_montant"
, "jr_comment" => "jr_comment"
, "jr_date" => "jr_date"
, "jr_grpt_id" => "jr_grpt_id"
, "jr_internal" => "jr_internal"
, "jr_tech_date" => "jr_tech_date"
, "jr_tech_per" => "jr_tech_per"
, "jrn_ech" => "jrn_ech"
, "jr_ech" => "jr_ech"
, "jr_rapt" => "jr_rapt"
, "jr_valid" => "jr_valid"
, "jr_opid" => "jr_opid"
, "jr_c_opid" => "jr_c_opid"
, "jr_pj" => "jr_pj"
, "jr_pj_name" => "jr_pj_name"
, "jr_pj_type" => "jr_pj_type"
, "jr_pj_number" => "jr_pj_number"
, "jr_mt" => "jr_mt"
, "jr_date_paid" => "jr_date_paid"
, "jr_optype" => "jr_optype"
, "currency_id" => "currency_id"
, "currency_rate" => "currency_rate"
, "currency_rate_ref" => "currency_rate_ref"
);
/*
* Type of columns
*/
$this->type = array(
"jr_id" => "numeric"
, "jr_def_id" => "numeric"
, "jr_montant" => "numeric"
, "jr_comment" => "text"
, "jr_date" => "date"
, "jr_grpt_id" => "numeric"
, "jr_internal" => "text"
, "jr_tech_date" => "date"
, "jr_tech_per" => "numeric"
, "jrn_ech" => "date"
, "jr_ech" => "date"
, "jr_rapt" => "text"
, "jr_valid" => "boolean"
, "jr_opid" => "numeric"
, "jr_c_opid" => "numeric"
, "jr_pj" => "oid"
, "jr_pj_name" => "text"
, "jr_pj_type" => "text"
, "jr_pj_number" => "text"
, "jr_mt" => "text"
, "jr_date_paid" => "date"
, "jr_optype" => "text"
, "currency_id" => "numeric"
, "currency_rate" => "numeric"
, "currency_rate_ref" => "numeric"
);
$this->default = array("jr_id" => "auto");
$this->date_format = "DD.MM.YYYY";
parent::__construct($p_cn, $p_id);
}
}
global $g_connection;
$g_connection=$cn;
echo h1("Ajout une colonne virtuelle ");
$jrn=new FakeData2_SQL($g_connection,911);
$jrn->set_virtual_col("str_date", " to_char(jr_tech_date,'DD/MM/YY HH24:MI')");
$jrn->load();
echo '<pre>'.'$jrn->set_virtual_col("str_date", " to_char(jr_tech_date,\'DD/MM/YY HH24:MI\')");'.'</pre>';
echo p( 'jrn->str_date '.$jrn->str_date);
echo p( '$jrn->get("str_date") '.$jrn->get("str_date"));
echo p( '$jrn->getp("str_date")'.$jrn->getp("str_date"));
echo h1("to_array");
echo '<pre>';
var_dump($jrn->to_array());
echo '</pre>';
$a_result=$jrn->to_array();
echo h1("to_row ");
$a_result['str_date']=" CHANGED ";
$jrn->to_row($a_result);
if ( $jrn->str_date != ' CHANGED ' ) {
echo_warning("erreur changement non pris en compte");}
else {
echo p('Changement Ok');
}
$jrn->update();
$jrn->load();
if ( $jrn->str_date != '05/01/22 00:00' ) {
echo_warning("erreur changement non pris en compte");
var_dump($jrn);
}
else {
echo p('Ok : update and load');
}
$jrn->to_row(['str_date'=>"Autre date"]);
var_dump($jrn);
echo h1("Donnée inexistante ");
$jrn=new FakeData2_SQL($g_connection,22911);
print $jrn;
echo h1("collect objects");
$jrn_collect = new FakeData2_SQL($g_connection);
$jrn_collect->set_virtual_col("str_date", " to_char(jr_tech_date,'DD/MM/YY HH24:MI')");
$a_jrn = $jrn_collect->collect_objects(" where jr_montant > 0 order by jr_montant desc ");
$nb_jrn = count($a_jrn);
for ($i = 0 ;$i < 20 && $i < $nb_jrn ; $i++ ) {
echo p($a_jrn[$i]->jr_tech_date." = ".$a_jrn[$i]->str_date);
}

View file

@ -0,0 +1,111 @@
<?php
//@description:Test des <b>dialog box avec different elements </b>comme autocomplete , IDate, SelectBox pour règler problème de positionnement quand on défile (scroll) les éléments
/*
* Copyright (C) 2021 Dany De Bontridder <dany@alchimerys.be>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
?>
<script>
var i=0;
function add_datalist_element() {
i++;
console.debug("compteur "+i) ;
var element=document.getElementById("datalist-exemple");
console.debug(element);
var option=document.createElement("option");
option.value="toto "+i;
console.debug(option);
element.appendChild(option);
}
</script>
<div class="inner_box" id="demo_box">
<?=HtmlInput::title_box("Innerbox example", "demo_box","hide");?>
<div>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<input list="datalist-exemple" id="dte" name="dte"/>
<datalist id="datalist-exemple">
<option value="chocolate">
<option value="Mars">
<option value="Vénus">
<option value="Accepter">
<option value="Forcer">
<option value="Voiture">
</datalist>
<button onclick="add_datalist_element()">Ajout element datalist</button>
<h1>Select Box</h1>
<?php
require_once NOALYSS_INCLUDE.'/lib/select_box.class.php';
$a=new Select_Box(uniqid("test"),"position in-absolute click me !");
$a->set_position("in-absolute");
$a->add_url("List (link)","?id=5&".Dossier::get());
$a->add_javascript("Hello (Javascript)","alert('hello')");
$a->add_value("Value = 10 (set value)",10);
$a->add_value("Value = 1 (set value)",1);
$a->add_value("Value = 15 (set value)",15);
echo $a->input();
?>
<h2>Select Box</h2>
<div>
<p>include 'select-box-test.php';</p>
<?php
include 'select-box-test.php';
?>
<?php
include_once 'HtmlInput.test.php';
?>
</div>
</div>
<?=HtmlInput::button_hide("demo_box");?>
</div>
<button onclick="$('demo_box').show()" >Affiche boite</button>
<div class="content">
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et commodo pharetra, est eros bibendum elit, nec luctus magna felis sollicitudin mauris. Integer in mauris eu nibh euismod gravida. Duis ac tellus et risus vulputate vehicula. Donec lobortis risus a elit. Etiam tempor. Ut ullamcorper, ligula eu tempor congue, eros est euismod turpis, id tincidunt sapien risus a quam. Maecenas fermentum consequat mi. Donec fermentum. Pellentesque malesuada nulla a mi. Duis sapien sem, aliquet nec, commodo eget, consequat quis, neque. Aliquam faucibus, elit ut dictum aliquet, felis nisl adipiscing sapien, sed malesuada diam lacus eget erat. Cras mollis scelerisque nunc. Nullam arcu. Aliquam consequat. Curabitur augue lorem, dapibus quis, laoreet et, pretium ac, nisi. Aenean magna nisl, mollis quis, molestie eu, feugiat in, orci. In hac habitasse platea dictumst.
</p>
<p>
Fusce convallis, mauris imperdiet gravida bibendum, nisl turpis suscipit mauris, sed placerat ipsum urna sed risus. In convallis tellus a mauris. Curabitur non elit ut libero tristique sodales. Mauris a lacus. Donec mattis semper leo. In hac habitasse platea dictumst. Vivamus facilisis diam at odio. Mauris dictum, nisi eget consequat elementum, lacus ligula molestie metus, non feugiat orci magna ac sem. Donec turpis. Donec vitae metus. Morbi tristique neque eu mauris. Quisque gravida ipsum non sapien. Proin turpis lacus, scelerisque vitae, elementum at, lobortis ac, quam. Aliquam dictum eleifend risus. In hac habitasse platea dictumst. Etiam sit amet diam. Suspendisse odio. Suspendisse nunc. In semper bibendum libero.
</p>
<p>
Proin nonummy, lacus eget pulvinar lacinia, pede felis dignissim leo, vitae tristique magna lacus sit amet eros. Nullam ornare. Praesent odio ligula, dapibus sed, tincidunt eget, dictum ac, nibh. Nam quis lacus. Nunc eleifend molestie velit. Morbi lobortis quam eu velit. Donec euismod vestibulum massa. Donec non lectus. Aliquam commodo lacus sit amet nulla. Cras dignissim elit et augue. Nullam non diam. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. In hac habitasse platea dictumst. Aenean vestibulum. Sed lobortis elit quis lectus. Nunc sed lacus at augue bibendum dapibus.
</p>
<p>
Aliquam vehicula sem ut pede. Cras purus lectus, egestas eu, vehicula at, imperdiet sed, nibh. Morbi consectetuer luctus felis. Donec vitae nisi. Aliquam tincidunt feugiat elit. Duis sed elit ut turpis ullamcorper feugiat. Praesent pretium, mauris sed fermentum hendrerit, nulla lorem iaculis magna, pulvinar scelerisque urna tellus a justo. Suspendisse pulvinar massa in metus. Duis quis quam. Proin justo. Curabitur ac sapien. Nam erat. Praesent ut quam.
</p>
<p>
Vivamus commodo, augue et laoreet euismod, sem sapien tempor dolor, ac egestas sem ligula quis lacus. Donec vestibulum tortor ac lacus. Sed posuere vestibulum nisl. Curabitur eleifend fermentum justo. Nullam imperdiet. Integer sit amet mauris imperdiet risus sollicitudin rutrum. Ut vitae turpis. Nulla facilisi. Quisque tortor velit, scelerisque et, facilisis vel, tempor sed, urna. Vivamus nulla elit, vestibulum eget, semper et, scelerisque eget, lacus. Pellentesque viverra purus. Quisque elit. Donec ut dolor.
</p>
<p>
Duis volutpat elit et erat. In at nulla at nisl condimentum aliquet. Quisque elementum pharetra lacus. Nunc gravida arcu eget nunc. Nulla iaculis egestas magna. Aliquam erat volutpat. Sed pellentesque orci. Etiam lacus lorem, iaculis sit amet, pharetra quis, imperdiet sit amet, lectus. Integer quis elit ac mi aliquam pretium. Nullam mauris orci, porttitor eget, sollicitudin non, vulputate id, risus. Donec varius enim nec sem. Nam aliquam lacinia enim. Quisque eget lorem eu purus dignissim ultricies. Fusce porttitor hendrerit ante. Mauris urna diam, cursus id, mattis eget, tempus sit amet, risus. Curabitur eu felis. Sed eu mi. Nullam lectus mauris, luctus a, mattis ac, tempus non, leo. Cras mi nulla, rhoncus id, laoreet ut, ultricies id, odio.
</p>
<p>
Donec imperdiet. Vestibulum auctor tortor at orci. Integer semper, nisi eget suscipit eleifend, erat nisl hendrerit justo, eget vestibulum lorem justo ac leo. Integer sem velit, pharetra in, fringilla eu, fermentum id, felis. Vestibulum sed felis. In elit. Praesent et pede vel ante dapibus condimentum. Donec magna. Quisque id risus. Mauris vulputate pellentesque leo. Duis vulputate, ligula at venenatis tincidunt, orci nunc interdum leo, ac egestas elit sem ut lacus. Etiam non diam quis arcu egestas commodo. Curabitur nec massa ac massa gravida condimentum. Aenean id libero. Pellentesque vitae tellus. Fusce lectus est, accumsan ac, bibendum sed, porta eget, augue. Etiam faucibus. Quisque tempus purus eu ante.
</p>
</div>
<button onclick="$('demo_box').show()" >Affiche boite</button>

View file

@ -0,0 +1,33 @@
<?php
//@description:st montre choix des catégories de fiches
$_GET=array (
'gDossier' => '42',
'ctl' => 'select_card_div',
'op' => 'card',
'op2'=>'st',
'fil' => '-1',
'ledger' => '2',
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
ob_start();
include NOALYSS_HOME.'/ajax_misc.php';
$output=ob_get_clean();
echo '<HR>';
$xml=simplexml_load_string($output);
print "ctl {$xml->ctl}";
echo '<hr>';
print "code ";
print '<div style="width:60%;margin-left:20%">';
print_r($xml->code);
echo '</div>';
echo '<code>';
echo htmlentities($xml->code);
echo '</code>';
echo '<hr>';
print "fiche_cat ";
print_r($xml->fiche_cat);
echo '<hr>';

View file

@ -3,7 +3,7 @@
$_GET=array (
'op' => 'ledger',
'act' => 'de',
'jr_id' => '2856',
'jr_id' => '137',
'div' => 'det2',
);
$_POST=array (
@ -11,4 +11,9 @@ $_POST=array (
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
ob_start();
include 'ajax_misc.php';
$output=ob_get_contents();
ob_clean();
echo unescape_xml($output);
echo htmlentities($output);

View file

@ -1,9 +1,9 @@
<?php
//@description:de Detail operation
//@description:FIN Detail operation
$_GET=array (
'op' => '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);
ob_start();
include 'ajax_misc.php';
$output=ob_get_contents();
ob_clean();
echo unescape_xml($output);
echo htmlentities($output);

View file

@ -3,12 +3,16 @@
$_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);
ob_start();
include 'ajax_misc.php';
$output=ob_get_contents();
ob_clean();
echo unescape_xml($output);
echo htmlentities($output);

View file

@ -3,7 +3,7 @@
$_GET=array (
'op'=>"ledger",
'act' => 'de',
'jr_id' => '2826',
'jr_id' => '316',
'div' => 'det2',
);
$_POST=array (
@ -11,4 +11,9 @@ $_POST=array (
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
ob_start();
include 'ajax_misc.php';
$output=ob_get_contents();
ob_clean();
echo unescape_xml($output);
echo htmlentities($output);

View file

@ -0,0 +1,41 @@
<?php
/**
* @brief test ajax_display_letter.php , display detail of a lettering operation
*/
//@description: test ajax_display_letter.php
$_GET=array (
'gDossier' => '25',
'j_id' => '343',
'obj_type' => 'card',
'search_start' => '01.01.2019',
'search_end' => '31.12.2019',
'op' => 'dl',
);
$_POST=array (
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
echo h1('Raw');
include 'ajax_misc.php';
echo h1('Détail');
ob_start();
include 'ajax_misc.php';
$var=ob_get_contents();
ob_end_clean();
$xml=simplexml_load_string($var);
foreach ($xml as $key=>$value) {
echo ("key is $key<br>");
echo '<textarea class="w-100" rows="10">';
print_r( $value);
echo '</textarea>';
echo '<hr>';
print_r( $value);
echo '<hr>';
}

View file

@ -1,34 +0,0 @@
<?php
//@description:ACH Encodage d'une vente
$_GET=array (
'gDossier' => '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';

View file

@ -1,16 +0,0 @@
<?php
//@description:st montre choix des catégories de fiches
$_GET=array (
'gDossier' => '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';

View file

@ -1,37 +0,0 @@
<?php
//@description:save
$_GET=array (
);
$_POST=array (
'whatdiv' => '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';

View file

@ -1,64 +0,0 @@
<?php
/*
* This file is part of NOALYSS.
*
* PhpCompta is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* NOALYSS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PhpCompta; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Copyright (2016) Author Dany De Bontridder <dany@alchimerys.be>
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();
}

View file

@ -1,79 +0,0 @@
<?php
/*
* This file is part of NOALYSS.
*
* PhpCompta is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* NOALYSS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PhpCompta; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Copyright (2016) Author Dany De Bontridder <dany@alchimerys.be>
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;
}

View file

@ -1,19 +0,0 @@
<?php
//@description:C0PCMN Ajout d'un poste comptable
$_GET=array (
'gDossier' => '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';

View file

@ -0,0 +1,43 @@
<?php
//@description: Test the class Document_Type
/*
* This file is part of NOALYSS.
*
* NOALYSS is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* NOALYSS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with NOALYSS; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Copyright Author Dany De Bontridder danydb@aevalys.eu 4/11/24
/*!
* \file
* \brief
*/
/**
* @file
* @brief Test , experiment the class Fiche
* @see Fiche
*/
$_GET=array (
);
$_POST=array (
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
if (!defined('ALLOWED')) {
die ("not allowed");
}
Document_Type::test_me();

View file

@ -1,35 +0,0 @@
<?php
//@description:ODS Confirmation OD
$_GET=array (
'gDossier' => '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';

View file

@ -1,44 +0,0 @@
<?php
//@description:ODS Enregistrement
$_GET=array (
'gDossier' => '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';

View file

@ -37,6 +37,23 @@ 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
}
Les répertoires :
----------------
HTML : vérification pour les fichiers inclus
LIB : concerne les libraries
XML : réponse de script ajax, réponse souvent en XML
LOCAL : vos propres scripts, pour vos développements, ne seront pas dans GIT
-----------------------
ENGLISH
@ -55,5 +72,18 @@ 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,
}
FOLDERS
----------------
HTML : test the files to include
LIB : concerns libraries
XML : ajax script response often XML or JSON
LOCAL : Your own scripts for developping , not included in GIT

View file

@ -1,43 +0,0 @@
<?php
//@description:VEN Encodage d'une vente
$_GET=array (
'gDossier' => '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';

View file

@ -1,40 +0,0 @@
<?php
//@description:VEN Enregistrement de la vente
$_GET=array (
'gDossier' => '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';