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
|
|
@ -89,7 +89,7 @@ set_language();
|
|||
*/
|
||||
ajax_disconnected($_REQUEST['ctl']);
|
||||
|
||||
$cn=new Database($gDossier);
|
||||
$cn=Dossier::connect();
|
||||
global $g_user;
|
||||
$g_user=new User($cn);
|
||||
$g_user->check(true);
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ mb_internal_encoding("UTF-8");
|
|||
*/
|
||||
ajax_disconnected($div);
|
||||
global $g_user,$cn;
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$g_user=new User($cn);
|
||||
set_language();
|
||||
/* security */
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ $gDossier=dossier::id();
|
|||
*/
|
||||
ajax_disconnected($div);
|
||||
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$g_parameter=new Own($cn);
|
||||
if ( LOGINPUT)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ global $g_user, $cn, $g_parameter;
|
|||
// but to the administration
|
||||
//
|
||||
if ($gDossier<>0) {
|
||||
$cn = new Database($gDossier);
|
||||
$cn =Dossier::connect();
|
||||
$g_parameter=new Own($cn);
|
||||
$g_user = new User($cn);
|
||||
$g_user->check(true);
|
||||
|
|
@ -102,7 +102,7 @@ if ( LOGINPUT)
|
|||
switch ($op)
|
||||
{
|
||||
case 'pcmn_update':
|
||||
require 'ajax/ajax_pcmn_update.php';
|
||||
require NOALYSS_INCLUDE.'/ajax/ajax_pcmn_update.php';
|
||||
return;
|
||||
case "remove_anc":
|
||||
if ($g_user->check_module('ANCODS') == 0)
|
||||
|
|
@ -221,7 +221,7 @@ EOF;
|
|||
require_once NOALYSS_INCLUDE.'/template/document_mod_change.php';
|
||||
break;
|
||||
case 'dsp_tva':
|
||||
$cn = new Database($gDossier);
|
||||
$cn = Dossier::connect();
|
||||
$Res = $cn->exec_sql("select * from tva_rate order by tva_rate desc");
|
||||
$Max = Database::num_row($Res);
|
||||
$r = "";
|
||||
|
|
@ -284,7 +284,7 @@ EOF;
|
|||
EOF;
|
||||
break;
|
||||
case 'label_tva':
|
||||
$cn = new Database($gDossier);
|
||||
$cn =Dossier::connect();
|
||||
if (isNumber($id) == 0)
|
||||
$value = _('tva inconnue');
|
||||
else
|
||||
|
|
@ -568,8 +568,9 @@ EOF;
|
|||
from menu_ref where me_code=$1", array($me_code));
|
||||
if (empty($m))
|
||||
{
|
||||
echo HtmlInput::title_box("Ce plugin n'existe pas ", $ctl);
|
||||
echo "<p>Il y a une erreur, ce plugin n'existe pas";
|
||||
echo HtmlInput::title_box(_("Ce plugin n'existe pas "), $ctl);
|
||||
echo "<p>"._("Il y a une erreur, ce plugin n'existe pas").
|
||||
"</p>";
|
||||
exit;
|
||||
}
|
||||
$me_code = new IText('me_code', $m[0] ['me_code']);
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ ajax_disconnected($ctl);
|
|||
set_language();
|
||||
|
||||
if ( $cont != 0 ) exit();
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
require_once NOALYSS_INCLUDE.'/class/class_user.php';
|
||||
global $g_user;
|
||||
$g_user=new User($cn);
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ ajax_disconnected('add_todo_list');
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
if (isset($_REQUEST['show']))
|
||||
{
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$todo=new Todo_list($cn);
|
||||
$todo->set_parameter('id',$_REQUEST['id']);
|
||||
$todo->load();
|
||||
|
|
@ -78,7 +78,7 @@ if (isset($_REQUEST['show']))
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
if (isset($_REQUEST['del']))
|
||||
{
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$todo=new Todo_list($cn);
|
||||
$todo->set_parameter('id',$_REQUEST['id']);
|
||||
$todo->delete();
|
||||
|
|
@ -92,7 +92,7 @@ $ac=HtmlInput::default_value_get('act', 'save');
|
|||
if ($ac == 'save')
|
||||
{
|
||||
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$todo=new Todo_List($cn);
|
||||
$id=HtmlInput::default_value_get("id", 0);
|
||||
$todo->set_parameter("id",$id);
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ foreach (array('t','c','p','q','n','gDossier') as $a)
|
|||
}
|
||||
|
||||
}
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$User=new User($cn);
|
||||
$User->Check();
|
||||
// Retrieve the rate of vat, it $t == -1 it means no VAT
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ require_once '../include/constant.php';
|
|||
require_once NOALYSS_INCLUDE.'/lib/class_database.php';
|
||||
require_once NOALYSS_INCLUDE.'/class/class_user.php';
|
||||
|
||||
$cn=new Database($_GET['gDossier']);
|
||||
$cn=Dossier::connect();
|
||||
global $g_user;
|
||||
$g_user=new User($cn);
|
||||
$g_user->Check();
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ global $g_user, $cn,$g_parameter;
|
|||
|
||||
|
||||
|
||||
$cn = new Database(Dossier::id());
|
||||
$cn = Dossier::connect();
|
||||
|
||||
/*
|
||||
* check that the database is not empty
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ global $g_user,$cn,$g_parameter;
|
|||
require_once NOALYSS_INCLUDE.'/lib/class_database.php';
|
||||
require_once NOALYSS_INCLUDE.'/class/class_user.php';
|
||||
$gDossier=dossier::id();
|
||||
$cn=new Database($gDossier);
|
||||
$cn=Dossier::connect();
|
||||
mb_internal_encoding("UTF-8");
|
||||
$g_user=new User($cn);
|
||||
$g_user->Check();
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ require_once NOALYSS_INCLUDE.'/class/class_user.php';
|
|||
|
||||
global $g_user,$cn,$g_parameter;
|
||||
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$g_user=new User($cn);
|
||||
$g_user->check();
|
||||
$only_plugin=$g_user->check_dossier(dossier::id());
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ $gDossier=dossier::id();
|
|||
|
||||
require_once('class/class_user.php');
|
||||
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
global $g_user;
|
||||
$g_user=new User($cn);
|
||||
$g_user->check();
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ require_once NOALYSS_INCLUDE.'/class/class_dossier.php';
|
|||
|
||||
$jrn= ( ! isset($_REQUEST['j']))?-1:$_REQUEST['j'];
|
||||
$filter_card="";
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
$d=$_REQUEST['e'];
|
||||
$filter_card='';
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ global $g_user;
|
|||
if ( basename($_GET['ajax']) == 'ajax_history.php' )
|
||||
{
|
||||
$href=dossier::get();
|
||||
$cn=new Database(dossier::id());
|
||||
$cn=Dossier::connect();
|
||||
/* current year */
|
||||
$g_user=new User($cn);
|
||||
$exercice=$g_user->get_exercice();
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ $gDossier=dossier::id();
|
|||
require_once NOALYSS_INCLUDE.'/lib/class_database.php';
|
||||
/* Admin. Dossier */
|
||||
|
||||
$cn=new Database($gDossier);
|
||||
$cn=Dossier::connect();
|
||||
include_once NOALYSS_INCLUDE.'/class/class_user.php';
|
||||
|
||||
global $g_user;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ require_once NOALYSS_INCLUDE.'/lib/ac_common.php';
|
|||
require_once NOALYSS_INCLUDE.'/class/class_document.php';
|
||||
require_once NOALYSS_INCLUDE.'/class/class_dossier.php';
|
||||
$gDossier = dossier::id();
|
||||
$cn = new Database($gDossier);
|
||||
$cn = Dossier::connect();
|
||||
$action = (isset($_REQUEST['a'])) ? $_REQUEST['a'] : 'sh';
|
||||
|
||||
require_once NOALYSS_INCLUDE.'/class/class_user.php';
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ require_once NOALYSS_INCLUDE.'/lib/ac_common.php';
|
|||
require_once NOALYSS_INCLUDE.'/class/class_dossier.php';
|
||||
|
||||
$gDossier=dossier::id();
|
||||
$cn=new Database($gDossier);
|
||||
$cn=Dossier::connect();
|
||||
|
||||
|
||||
require_once NOALYSS_INCLUDE.'/class/class_user.php';
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ set_language();
|
|||
|
||||
$jr_grpt_id=$_GET['jr_grpt_id'];
|
||||
|
||||
$cn=new Database($gDossier);
|
||||
$cn=Dossier::connect();
|
||||
|
||||
|
||||
require_once NOALYSS_INCLUDE.'/class/class_user.php';
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ if ($gDossier==-1)
|
|||
}
|
||||
$gDossierLogInput=$gDossier;
|
||||
global $cn, $g_user, $g_succeed, $g_failed;
|
||||
$cn=new Database($_GET['gDossier']);
|
||||
$cn=Dossier::id();
|
||||
|
||||
$g_parameter=new Own($cn);
|
||||
$g_user=new User($cn);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue