Use Dossier::connect (singleton) instead of new Databass(dossier_id)
This commit is contained in:
parent
19e6e8ca6d
commit
8fc56e3ef4
87 changed files with 105 additions and 149 deletions
|
|
@ -205,7 +205,6 @@ class Acc_Account
|
|||
/*!\brief for developper only during test */
|
||||
static function test_me()
|
||||
{
|
||||
$cn=new Database(dossier::id());
|
||||
|
||||
}
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -648,7 +648,7 @@ class Acc_Account_Ledger
|
|||
}
|
||||
static function test_me()
|
||||
{
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$a=new Acc_Account_Ledger($cn,550);
|
||||
echo ' Journal 4 '.$a->belong_ledger(4);
|
||||
return $a->belong_ledger(4);;
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@ class Acc_Balance
|
|||
{
|
||||
require 'class/class_user.php';
|
||||
global $g_user;
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$g_user=new User($cn);
|
||||
$a=new Acc_Balance($cn);
|
||||
$a->get_row(163, 175, 1);
|
||||
|
|
|
|||
|
|
@ -696,7 +696,7 @@ class Acc_Bilan
|
|||
if ( isset($_GET['result']))
|
||||
{
|
||||
ob_start();
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$a=new Acc_Bilan($cn);
|
||||
$a->get_request_get();
|
||||
|
||||
|
|
@ -714,7 +714,7 @@ class Acc_Bilan
|
|||
}
|
||||
else
|
||||
{
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$a=new Acc_Bilan($cn);
|
||||
$a->get_request_get();
|
||||
|
||||
|
|
|
|||
|
|
@ -3245,7 +3245,7 @@ class Acc_Ledger extends jrn_def_sql
|
|||
{
|
||||
echo Acc_Reconciliation::$javascript;
|
||||
html_page_start();
|
||||
$cn = new Database(dossier::id());
|
||||
$cn = Dossier::connect();
|
||||
$_SESSION['g_user'] = 'phpcompta';
|
||||
$_SESSION['g_pass'] = 'phpcompta';
|
||||
|
||||
|
|
@ -3334,7 +3334,7 @@ class Acc_Ledger extends jrn_def_sql
|
|||
if ($pCase == 'search')
|
||||
{
|
||||
html_page_start();
|
||||
$cn = new Database(dossier::id());
|
||||
$cn = Dossier::connect();
|
||||
$ledger = new Acc_Ledger($cn, 0);
|
||||
$_SESSION['g_user'] = 'phpcompta';
|
||||
$_SESSION['g_pass'] = 'phpcompta';
|
||||
|
|
@ -3346,7 +3346,7 @@ class Acc_Ledger extends jrn_def_sql
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
if ($pCase == 'reverse')
|
||||
{
|
||||
$cn = new Database(dossier::id());
|
||||
$cn = Dossier::connect();
|
||||
$jr_internal = 'OD-01-272';
|
||||
try
|
||||
{
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ class Acc_Ledger_Info
|
|||
static function test_me()
|
||||
{
|
||||
echo "Dossier = ".Dossier::id();
|
||||
$cn=new Database(Dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$a=new Acc_Ledger_Info($cn);
|
||||
$a->jr_id=3;
|
||||
$a->id_type='BON_COMMANDE';
|
||||
|
|
|
|||
|
|
@ -1365,7 +1365,7 @@ EOF;
|
|||
*/
|
||||
|
||||
static function test_me($p_string = '') {
|
||||
$cn = new Database(dossier::id());
|
||||
$cn = Dossier::connect();
|
||||
$a = new Acc_Ledger_Sold($cn, 2);
|
||||
echo $a->input();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -578,7 +578,7 @@ class Acc_Operation
|
|||
$_SESSION['g_user']='phpcompta';
|
||||
$_SESSION['g_pass']='dany';
|
||||
global $g_user;
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$g_user=new User($cn);
|
||||
$a=new Acc_Operation($cn);
|
||||
$a->jr_id=1444;
|
||||
|
|
|
|||
|
|
@ -524,7 +524,7 @@ j1.j_poste as poste
|
|||
|
||||
static function test_me()
|
||||
{
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$rap=new Acc_Reconciliation($cn);
|
||||
var_dump($rap->get_reconciled_amount('',false));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -422,7 +422,7 @@ class Acc_Report
|
|||
}
|
||||
static function test_me()
|
||||
{
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$a=new Acc_Report($cn);
|
||||
print_r($a->get_list());
|
||||
$array=array("text0"=>"test1",
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class Acc_Report_Row
|
|||
}
|
||||
static function test_me()
|
||||
{
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$a=new Acc_Report_Row();
|
||||
$array=array("text0"=>"test1",
|
||||
"form0"=>"7%",
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ class Acc_Tva
|
|||
*/
|
||||
static function test_me()
|
||||
{
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$a=new Acc_Tva($cn);
|
||||
echo $a->get_info();
|
||||
$a->set_parameter("id",1);
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ class Anc_Account
|
|||
}
|
||||
static function test_me()
|
||||
{
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$pa_id=$cn->get_value("select max(pa_id) from plan_analytique");
|
||||
$o=new Anc_Account($cn);
|
||||
echo "<h1>Poste_Analytique</h1>";
|
||||
|
|
|
|||
|
|
@ -557,7 +557,7 @@ class Anc_Balance_Double extends Anc_Print
|
|||
*/
|
||||
static function test_me()
|
||||
{
|
||||
$a=new Database(dossier::id());
|
||||
$a=Dossier::connect();
|
||||
|
||||
$bal=new Anc_Balance_Double($a);
|
||||
$bal->get_request();
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ class Anc_Balance_Simple extends Anc_Print
|
|||
static function test_me ()
|
||||
{
|
||||
// call the page with ?gDossier=14
|
||||
$a=new Database(dossier::id());
|
||||
$a=Dossier::connect();
|
||||
|
||||
$bal=new Anc_Balance_Simple($a);
|
||||
$bal->get_request();
|
||||
|
|
|
|||
|
|
@ -239,7 +239,7 @@ order by ga_description,po_name";
|
|||
static function test_me()
|
||||
{
|
||||
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
print_r($cn);
|
||||
$o=new Anc_Group($cn);
|
||||
$r=$o->myList();
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ class Anc_Group_Operation
|
|||
static function test_me()
|
||||
{
|
||||
$dossier=dossier::id();
|
||||
$cn=new Database($dossier);
|
||||
$cn=Dossier::connect();
|
||||
|
||||
if ( isset($_POST['go']))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -939,7 +939,7 @@ class Anc_Operation
|
|||
*/
|
||||
function test_me()
|
||||
{
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$anco=new Anc_Operation($cn);
|
||||
$j_id=200;
|
||||
$anco->j_id=$j_id;
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ class Anc_Plan
|
|||
}
|
||||
static function test_me()
|
||||
{
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
echo "<h1>Plan analytique : test</h1>";
|
||||
echo "clean";
|
||||
$cn->exec_sql("delete from plan_analytique");
|
||||
|
|
|
|||
|
|
@ -442,7 +442,7 @@ class Anticipation
|
|||
*/
|
||||
static function test_me()
|
||||
{
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$test=new Anticipation($cn);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class Calendar
|
|||
global $g_user;
|
||||
$profile=$g_user->get_profile();
|
||||
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$sql="select ag_id,to_char(ag_remind_date,'DD')::integer as ag_timestamp_day,ag_title,ag_hour,
|
||||
coalesce(name,'interne') as str_name
|
||||
".
|
||||
|
|
@ -113,7 +113,7 @@ class Calendar
|
|||
*/
|
||||
function fill_from_todo(&$p_array,$p_style)
|
||||
{
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
if ($p_style=="short")
|
||||
{
|
||||
$sql="select count(*) as nb,to_char(tl_date,'DD')::integer as tl_date_day ".
|
||||
|
|
@ -172,7 +172,7 @@ class Calendar
|
|||
$this->fill_from_action($cell,$p_type);
|
||||
$this->fill_from_todo($cell,$p_type);
|
||||
$wMonth=new ISelect('per');
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$wMonth->value=$cn->make_array("select p_id,to_char(p_start,'MM/YYYY') from parm_periode where p_exercice = '$exercice_user' order by p_start");
|
||||
$wMonth->selected=$this->default_periode;
|
||||
$wMonth->javascript="onchange=change_month(this)";
|
||||
|
|
@ -201,7 +201,7 @@ class Calendar
|
|||
*/
|
||||
function set_month_year()
|
||||
{
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$array=$cn->get_array("select to_char(p_start,'MM') as month, to_char(p_start,'YYYY') as year ".
|
||||
" from parm_periode where p_id=$1",array($this->default_periode));
|
||||
$this->month=(int)$array[0]['month'];
|
||||
|
|
@ -218,7 +218,7 @@ class Calendar
|
|||
function get_preference()
|
||||
{
|
||||
global $g_user;
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$today=date('d.m.Y');
|
||||
$p_id=$cn->get_value("
|
||||
select p_id from parm_periode
|
||||
|
|
@ -262,7 +262,7 @@ class Calendar
|
|||
$this->fill_from_action($cell,"long");
|
||||
$this->fill_from_todo($cell,"long");
|
||||
$wMonth=new ISelect('per_div');
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$wMonth->value=$cn->make_array("select p_id,to_char(p_start,'MM/YYYY') from parm_periode where p_exercice = '$exercice_user' order by p_start");
|
||||
$wMonth->selected=$this->default_periode;
|
||||
$wMonth->javascript=sprintf("onchange=calendar_zoom({gDossier:%d,invalue:'%s',outvalue:'%s',distype:'%s',notitle:%d})",
|
||||
|
|
@ -292,7 +292,7 @@ class Calendar
|
|||
function zoom_list($notitle)
|
||||
{
|
||||
global $g_user;
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$profile=$g_user->get_profile();
|
||||
|
||||
// Get the event from now and before 30 before
|
||||
|
|
|
|||
|
|
@ -1959,7 +1959,7 @@ class Fiche
|
|||
}
|
||||
static function test_me()
|
||||
{
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$a=new Fiche($cn);
|
||||
$select_cat=new ISelect('fd_id');
|
||||
$select_cat->value=$cn->make_array('select fd_id,fd_label from fiche_def where frd_id='.
|
||||
|
|
|
|||
|
|
@ -567,7 +567,7 @@ class Periode
|
|||
}
|
||||
static function test_me()
|
||||
{
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$obj=new Periode($cn);
|
||||
$obj->set_jrn(1);
|
||||
$obj->display_form_periode();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue