Code Cleaning : get-> load, GetWWW ==> get_www

This commit is contained in:
sparkyx 2007-12-21 09:22:03 +00:00
parent d11266d34f
commit 09d65f6537
79 changed files with 222 additions and 222 deletions

View file

@ -117,8 +117,8 @@ return;
}
if ($p_id != -1 ) { // A
// userPref contient la periode par default
$userPref=$User->GetPeriode($cn);
list ($l_date_start,$l_date_end)=GetPeriode($cn,$userPref);
$userPref=$User->get_periode($cn);
list ($l_date_start,$l_date_end)=get_periode($cn,$userPref);
// Periode fermée
if ( PeriodeClosed ($cn,$userPref)=='t' )

View file

@ -36,7 +36,7 @@ $cn=DbConnect($gDossier);
require_once ('class_user.php');
$User=new cl_user(DbConnect());
$User->Check();
if ( $User->CheckAction($cn,BALANCE) == 0)
if ( $User->check_action($cn,BALANCE) == 0)
{
NoAccess();
exit;

View file

@ -40,7 +40,7 @@ $User->Check();
// TODO a specific level of security for the "bilan" ???
// Change must be done here
if ( $User->admin == 0 ) {
if ($User->CheckAction($cn,IMP)
if ($User->check_action($cn,IMP)
==0
)
{

View file

@ -84,7 +84,7 @@ echo '</div>';
$cn=DbConnect($gDossier);
/*! \todo module budget add the security
*$User->AccessRequest($cn,BUDGET);
*$User->can_request($cn,BUDGET);
*/
//-----------------------------------------------------
// p_action == hypo

View file

@ -49,7 +49,7 @@ include_once("central_inc.php");
echo '<div class="u_subtmenu">';
echo ShowMenuAdvanced("central.php?".dossier::get());
echo '</div>';
$User->AccessRequest($cn,CENTRALIZE);
$User->can_request($cn,CENTRALIZE);

View file

@ -109,7 +109,7 @@ echo ShowItem(array(
echo '</div>';
$cn=DbConnect($gDossier);
$User->AccessRequest($cn,SEC_GESTION);
$User->can_request($cn,SEC_GESTION);
echo JS_VIEW_JRN_MODIFY;
echo JS_AJAX_FICHE;
@ -178,7 +178,7 @@ if ( $p_action=='quick_writing') {
// Impression
if ( $p_action == 'impress')
{
if ( $User->CheckAction($cn,IMP) == 0)
if ( $User->check_action($cn,IMP) == 0)
{
NoAccess();
exit;

View file

@ -52,7 +52,7 @@ echo '</div>';
// call impress sub-menu
if ( $action == 'impress' ) {
$User->AccessRequest($cn,IMP) ;
$User->can_request($cn,IMP) ;
require_once('impress.inc.php');
}

View file

@ -64,15 +64,15 @@ if ( isset ($_REQUEST['p_action']))
switch ($_REQUEST['p_action'])
{
case 'ca_pa':
$User->AccessRequest($cn,CA_ACCESS);
$User->can_request($cn,CA_ACCESS);
$def=0;
break;
case 'ca_od':
$User->AccessRequest($cn,CA_ODS);
$User->can_request($cn,CA_ODS);
$def=1;
break;
case 'ca_imp':
$User->AccessRequest($cn,CA_IMPRESSION);
$User->can_request($cn,CA_IMPRESSION);
$def=2;
break;
case 'ca_groupe':

View file

@ -47,7 +47,7 @@ echo '</div>';
echo ShowMenuAdvanced(8);
$User->AccessRequest($cn,EXP_IMP_ECR);
$User->can_request($cn,EXP_IMP_ECR);
echo '<div class="lmenu">';
@ -183,7 +183,7 @@ if ( isset ($_GET['import'])) {
// submit button in the form
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout Poste">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Sauver">';
$r=FormODS($cn,$_POST['p_jrn'],$User->GetPeriode(),$submit,
$r=FormODS($cn,$_POST['p_jrn'],$User->get_periode(),$submit,
$array_ods,false,$idx,$p_saved=false);
echo $r;

View file

@ -42,7 +42,7 @@ include_once ("user_menu.php");
$cn=DbConnect($gDossier);
$User->AccessRequest($cn,EXP_IMP_ECR);
$User->can_request($cn,EXP_IMP_ECR);
if ( !isset ($_GET['p_periode'])) {
echo 'Erreur : aucune periode demandée';

View file

@ -63,8 +63,8 @@ include_once("fiche_inc.php");
$cn=DbConnect($_SESSION['g_dossier']);
// Security check
$read=$User->CheckAction($cn,FICHE_READ);
$write=$User->CheckAction($cn,FICHE_WRITE);
$read=$User->check_action($cn,FICHE_READ);
$write=$User->check_action($cn,FICHE_WRITE);
if ($read+$write == 0 ){
/* Cannot Access */
NoAccess();

View file

@ -39,7 +39,7 @@ require_once ('class_user.php');
$User=new cl_user($rep);
$User->Check();
$User->AccessRequest($cn,FICHE_READ);
$User->can_request($cn,FICHE_READ);
if ( isset ($_POST['fd_id'])) {

View file

@ -41,7 +41,7 @@ $gDossier=dossier::id();
$cn=DbConnect($gDossier);
// TODO add security here
// Get The priv on the selected folder
if ( $User->CheckAction($cn,FICHE_WRITE)== 0) {
if ( $User->check_action($cn,FICHE_WRITE)== 0) {
/* Cannot Access */
echo '<h2 class="error"> Vous ne pouvez pas ajouter de fiche</h2>';
return;

View file

@ -49,7 +49,7 @@ $gDossier=dossier::id();
include_once ("check_priv.php");
$cn=DbConnect($gDossier);
// Get The priv on the selected folder
if ( $User->CheckAction($cn,FICHE_READ) == 0 ){
if ( $User->check_action($cn,FICHE_READ) == 0 ){
/* Cannot Access */
echo '<h2 class="error"> Vous n\' avez pas accès</h2>';
return;

View file

@ -48,7 +48,7 @@ include ("check_priv.php");
$cn=DbConnect($gDossier);
echo ShowMenuAdvanced(6);
// Get The priv on the selected folder
$User->AccessRequest($cn,FORM);
$User->can_request($cn,FORM);

View file

@ -53,7 +53,7 @@ echo '</div>';
echo ShowMenuAdvanced(7);
$User->AccessRequest($cn,IMP_BQE);
$User->can_request($cn,IMP_BQE);
echo JS_AJAX_FICHE;
echo '<div class="lmenu">';
@ -90,7 +90,7 @@ if ( isset ($_GET["action"]) ) {
echo '<DIV class="u_redcontent">';
// TransferCSV($cn,
ConfirmTransfert($cn,$User->GetPeriode());
ConfirmTransfert($cn,$User->get_periode());
echo "</DIV>";
}
}
@ -102,14 +102,14 @@ if ( isset ($_POST['action'])) {
$action=$_POST['action'];
if ($action == "transfer" ) {
echo '<DIV class="u_redcontent">';
TransferCSV($cn, $User->GetPeriode());
TransferCSV($cn, $User->get_periode());
echo "</DIV>";
}
if ($action == "remove" ) {
echo '<DIV class="u_redcontent">';
RemoveCSV($cn);
ConfirmTransfert($cn,$User->GetPeriode());
ConfirmTransfert($cn,$User->get_periode());
echo "</DIV>";
}

View file

@ -47,7 +47,7 @@ echo '</div>';
$cn=DbConnect($gDossier);
$User->AccessRequest($cn,GJRN);
$User->can_request($cn,GJRN);
echo JS_SEARCH_POSTE;

View file

@ -38,7 +38,7 @@ $rep=DbConnect();
require_once ('class_user.php');
$User=new cl_user($rep);
$User->Check();
if ( $User->CheckAction($cn,IMP) == 0 ||
if ( $User->check_action($cn,IMP) == 0 ||
$User->AccessJrn($cn,$_GET['jrn_id']) == false){
/* Cannot Access */
NoAccess();

View file

@ -44,7 +44,7 @@ echo '</div>';
include_once("check_priv.php");
$cn=DbConnect($gDossier);
$User->AccessRequest($cn,GJRN);
$User->can_request($cn,GJRN);
// Javascript
echo JS_SEARCH_POSTE;

View file

@ -55,7 +55,7 @@ $User=new cl_user(DbConnect());
$User->Check();
// Security
if ($User->CheckAction($cn,IMP) == 0 ||
if ($User->check_action($cn,IMP) == 0 ||
$User->AccessJrn($cn,$_GET['jrn_id']) == false){
/* Cannot Access */
NoAccess();

View file

@ -50,7 +50,7 @@ $cn=DbConnect($gDossier);
echo '<div class="u_subtmenu">';
echo ShowMenuAdvanced("jrn_update.php?".dossier::get());
echo '</div>';
$User->AccessRequest($cn,GJRN);
$User->can_request($cn,GJRN);
echo '<div class="lmenu">';

View file

@ -35,7 +35,7 @@ $User=new cl_user($rep);
$User->Check();
html_page_start($User->theme,"onLoad='window.focus();'");
$User->AccessRequest(DbConnect($gDossier),MPCMN);
$User->can_request(DbConnect($gDossier),MPCMN);
include ("user_menu.php");

View file

@ -37,7 +37,7 @@ $User->Check();
// TODO a specific level of security for the "bilan" ???
// Change must be done here
$User->AccessRequest($cn,IMP);
$User->can_request($cn,IMP);
header('Content-type: application/bin');
header('Content-Disposition: attachment;filename="declaration.bin"',FALSE);

View file

@ -52,7 +52,7 @@ include_once ("check_priv.php");
$cn=DbConnect($gDossier);
$User->AccessRequest($cn,PARM);
$User->can_request($cn,PARM);
// First action
$p_action="";

View file

@ -60,7 +60,7 @@ echo '<div class="u_subtmenu">';
echo ShowMenuAdvanced(4);
echo '</div>';
$User->AccessRequest($cn,MPCMN);
$User->can_request($cn,MPCMN);
echo '<div class="lmenu">';

View file

@ -49,7 +49,7 @@ $User=new cl_user($rep);
$User->Check();
$bal=new Acc_Balance($cn);
$User->AccessRequest($cn,BALANCE);
$User->can_request($cn,BALANCE);
echo_debug('print_balance.php',__LINE__,"imp pdf journaux");
foreach ($_POST as $key=>$element) {
@ -81,8 +81,8 @@ if ( sizeof($array) == 0 ) {
exit();
}
$a=GetPeriode($cn,$from_periode);
$b=GetPeriode($cn,$to_periode);
$a=get_periode($cn,$from_periode);
$b=get_periode($cn,$to_periode);
$per_text=" période du ".$a['p_start']." au ".$b['p_end'];
$pdf=new Cezpdf('a4');
$pdf->selectFont('./addon/fonts/Helvetica.afm');

View file

@ -41,7 +41,7 @@ include_once ("class_user.php");
$User=new cl_user($rep);
$User->Check();
// Check Priv
$User->AccessRequest($cn,SECU);
$User->can_request($cn,SECU);
//-----------------------------------------------------
// Get User's info
@ -105,7 +105,7 @@ $Max=pg_NumRows($Res);
for ( $i =0 ; $i < $Max; $i++ ) {
$l_line=pg_fetch_array($Res,$i);
$action['lib']=$l_line['ac_description'];
$right=CheckAction($gDossier,$SecUser->login,$l_line['ac_id']);
$right=check_action($gDossier,$SecUser->login,$l_line['ac_id']);
switch ($right) {
case 0:
$action['priv']="Pas d'accès";

View file

@ -47,7 +47,7 @@ if ( ! isset ($_REQUEST['q'])) {
}
// connect to the database
$cn=DbConnect($gDossier);
if ( $User->CheckAction($cn,FICHE_READ) == 0 ){
if ( $User->check_action($cn,FICHE_READ) == 0 ){
/* Cannot Access */
echo '<h2 class="error"> Vous n\' avez pas accès</h2>';
return;

View file

@ -73,7 +73,7 @@ switch ($p_action) {
echo ShowMenuAdvanced($high);
if ($p_action == "periode" ) {
if ( $User->admin == 0 && CheckAction($gDossier,$_SESSION['g_user'],GESTION_PERIODE) == 0 )
if ( $User->admin == 0 && check_action($gDossier,$_SESSION['g_user'],GESTION_PERIODE) == 0 )
NoAccess();
$p_action=$_REQUEST['p_action'];

View file

@ -57,7 +57,7 @@ echo '</div>';
if ( $User->admin == 0 ) {
// check if user can access
// Acces Grand livre
if ($jrn_type== 'NONE' && CheckAction($gDossier,$_SESSION['g_user'],ENCJRN) == 0 ){
if ($jrn_type== 'NONE' && check_action($gDossier,$_SESSION['g_user'],ENCJRN) == 0 ){
/* Cannot Access */
NoAccess();

View file

@ -42,7 +42,7 @@ include_once ("user_menu.php");
$cn_dossier=DbConnect($gDossier);
if ( $User->CheckAction($cn_dossier,GJRN) == 0 ) {
if ( $User->check_action($cn_dossier,GJRN) == 0 ) {
/* Cannot Access */
NoAccess();
exit -1;
@ -240,7 +240,7 @@ if ( $action == "view" ) {
$l_change="action=change_act&act=".$l_line['ac_id']."&login=".$l2_line['use_login']."&user_id=".$l2_line['use_id'];
if ( $admin ==0 ) {
$right=CheckAction($gDossier,$l2_line['use_login'],$l_line['ac_id']);
$right=check_action($gDossier,$l2_line['use_login'],$l_line['ac_id']);
} else {
$right = 2;
}

View file

@ -441,8 +441,8 @@ function sql_filter_per($p_cn,$p_from,$p_to,$p_form='p_id',$p_field='jr_tech_per
if ( $p_form == 'p_id' )
{
// retrieve the date
$a_start=GetPeriode($p_cn,$p_from);
$a_end=GetPeriode($p_cn,$p_to);
$a_start=get_periode($p_cn,$p_from);
$a_end=get_periode($p_cn,$p_to);
if ( $a_start == null or $a_end == null )
{
echo_debug(__FILE__,__LINE__,'Attention periode '.

View file

@ -21,7 +21,7 @@
/*! \file
* \brief Page who manage the different action (meeting, letter)
*/
$User->AccessRequest($cn,SEC_ACTION);
$User->can_request($cn,SEC_ACTION);
//-----------------------------------------------------
// Action

View file

@ -22,7 +22,7 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
require_once("class_admin.php");
$sub_action=(isset($_REQUEST['sa']))?$_REQUEST['sa']:"";
$User->AccessRequest($cn,ADMIN);
$User->can_request($cn,ADMIN);
/*! \file
* \brief Called from the module "Gestion" to manage the customer

View file

@ -30,7 +30,7 @@ include_once ("ac_common.php");
include_once("preference.php");
include_once ("class_widget.php");
include_once("class_acc_balance.php");
$User->AccessRequest($cn,BALANCE);
$User->can_request($cn,BALANCE);
echo '<div class="u_content">';
@ -78,7 +78,7 @@ echo dossier::hidden();
$w=new widget("select");
$w->table=1;
// filter on the current year
$filter_year=" where p_exercice='".$User->getExercice()."'";
$filter_year=" where p_exercice='".$User->get_exercice()."'";
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end");
$w->label="Depuis";
@ -146,8 +146,8 @@ if ( isset($_POST['view'] ) ) {
$row=$bal->get_row($_POST['from_periode'],
$_POST['to_periode']);
$a=GetPeriode($cn,$_POST['from_periode']);
$b=GetPeriode($cn,$_POST['to_periode']);
$a=get_periode($cn,$_POST['from_periode']);
$b=get_periode($cn,$_POST['to_periode']);
echo "<h2 class=\"info\"> période du ".$a['p_start']." au ".$b['p_end']."</h2>";
echo '<table width="100%">';

View file

@ -94,7 +94,7 @@ if ( $sub_action == "solde" )
echo "<table>";
// Filter the saldo
// on the current year
$filter_year=" and j_tech_per in (select p_id from parm_periode where p_exercice='".$User->getExercice()."')";
$filter_year=" and j_tech_per in (select p_id from parm_periode where p_exercice='".$User->get_exercice()."')";
// for each account
for ( $i = 0; $i < pg_NumRows($ResAccount);$i++) {
@ -154,11 +154,11 @@ if ( $sub_action == "list")
$w=new widget("select");
// filter on the current year
$filter_year=" where p_exercice='".$User->getExercice()."'";
$filter_year=" where p_exercice='".$User->get_exercice()."'";
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end",1);
// User is already set User=new cl_user($cn);
$current=(isset($_GET['p_periode']))?$_GET['p_periode']:$User->GetPeriode();
$current=(isset($_GET['p_periode']))?$_GET['p_periode']:$User->get_periode();
$w->selected=$current;
echo 'Période '.$w->IOValue("p_periode",$periode_start);
@ -184,7 +184,7 @@ if ( $sub_action == "list")
else
{
$filter_per=" and jr_tech_per in (select p_id from parm_periode where p_exercice=".
$User->getExercice().")";
$User->get_exercice().")";
}
// Show list of sell
@ -233,7 +233,7 @@ if ( $sub_action=="use_opd" ) {
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">'.
'<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Enregistrer">';
$form=FormFin($cn,$_GET['p_jrn'],$User->GetPeriode(),$submit,$p_post,false,$p_post['nb_item']);
$form=FormFin($cn,$_GET['p_jrn'],$User->get_periode(),$submit,$p_post,false,$p_post['nb_item']);
echo '<div class="u_content">';
echo $form;
echo '</div>';
@ -258,8 +258,8 @@ if ( isset ($_POST['add_item']) || isset ($_POST['correct']) )
// Submit button in the form
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Enregistrer" ID="SubmitButton">';
$form=FormFin($cn,$p_jrn,$User->GetPeriode(),$submit,$_POST,false, $nb_item);
//$form=FormFin($cn,$p_jrn,$User->GetPeriode(),$submit,$_POST,false, $nb_number);
$form=FormFin($cn,$p_jrn,$User->get_periode(),$submit,$_POST,false, $nb_item);
//$form=FormFin($cn,$p_jrn,$User->get_periode(),$submit,$_POST,false, $nb_number);
echo '<div class="u_content">';
echo $form;
@ -283,7 +283,7 @@ if ( isset($_POST['save']))
$submit='<h2 class="info"> Op&eacute;ration '.$r.' enregistr&eacute;</h2>';
$form=FormFin($cn,$p_jrn,$User->GetPeriode(),$submit,$_POST,true,$nb_number,true);
$form=FormFin($cn,$p_jrn,$User->get_periode(),$submit,$_POST,true,$nb_number,true);
echo '<div class="u_content">';
echo $form;
@ -306,15 +306,15 @@ if ( isset ($_POST['view_invoice']) )
$nb_number=$_POST["nb_item"];
$submit='<INPUT TYPE="SUBMIT" name="save" value="Confirmer">';
$submit.='<INPUT TYPE="SUBMIT" name="correct" value="Corriger">';
if ( form_verify_input ($cn,$p_jrn,$User->GetPeriode(),$_POST,$nb_number) != null ) {
if ( form_verify_input ($cn,$p_jrn,$User->get_periode(),$_POST,$nb_number) != null ) {
// Should use a read only view instead of FormFin
// where we can check
$form=FormFin($cn,$p_jrn,$User->GetPeriode(),$submit,$_POST,true, $nb_number,false);
$form=FormFin($cn,$p_jrn,$User->get_periode(),$submit,$_POST,true, $nb_number,false);
} else {
// if something goes wrong, correct it
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Enregistrer">';
$form=FormFin($cn,$p_jrn,$User->GetPeriode(),$submit,$_POST,false, $nb_number);
$form=FormFin($cn,$p_jrn,$User->get_periode(),$submit,$_POST,false, $nb_number);
}
@ -341,7 +341,7 @@ if ( $p_jrn != -1 )
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Enregistrer" ID="SubmitButton">';
// Show an empty form of invoice
$form=FormFin($cn,$p_jrn,$User->GetPeriode(),$submit,null,false,$jrn->GetDefLine('deb'));
$form=FormFin($cn,$p_jrn,$User->get_periode(),$submit,null,false,$jrn->GetDefLine('deb'));
echo '<div class="u_content">';
echo $form;
echo '<form method="GET">';

View file

@ -45,21 +45,21 @@ $msg="";
if ( isset($_POST['remove'])){
$obj=new Bud_Card($cn);
$obj->load_from_array($_POST);
$obj->get_from_array($_POST);
$msg=$obj->delete();
}
if ( isset($_POST['add'])){
$obj=new Bud_Card($cn);
$obj->load_from_array($_POST);
$obj->get_from_array($_POST);
$msg=$obj->add();
}
if ( isset($_POST['update'])){
$obj=new Bud_Card($cn);
$obj->load_from_array($_POST);
$obj->get_from_array($_POST);
$msg= $obj->update();

View file

@ -29,21 +29,21 @@ require_once ('class_widget.php');
if ( isset($_POST['remove'])){
$obj=new Bud_Hypo($cn);
$obj->load_from_array($_POST);
$obj->get_from_array($_POST);
$obj->delete();
}
if ( isset($_POST['add'])){
$obj=new Bud_Hypo($cn);
$obj->load_from_array($_POST);
$obj->get_from_array($_POST);
$obj->add();
}
if ( isset($_POST['update'])){
$obj=new Bud_Hypo($cn);
$obj->load_from_array($_POST);
$obj->get_from_array($_POST);
$obj->update();
}

View file

@ -47,7 +47,7 @@ if ( isset ($_POST['remove'])) {
// INSERT
if ( isset($_POST['add'])) {
$obj=new Anc_Group($cn);
$obj->load_from_array($_POST);
$obj->get_from_array($_POST);
$obj->insert();
}
$array=$r->myList();

View file

@ -88,11 +88,11 @@ echo '
$w=new widget("select");
$w->name="p_periode";
// filter on the current year
$filter_year=" where p_exercice='".$User->getExercice()."'";
$filter_year=" where p_exercice='".$User->get_exercice()."'";
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end",1);
$User=new cl_user($cn);
$current=(isset($_GET['p_periode']))?$_GET['p_periode']:$User->GetPeriode();
$current=(isset($_GET['p_periode']))?$_GET['p_periode']:$User->get_periode();
$w->selected=$current;
echo 'P&eacute;riode '.$w->IOValue("p_periode",$periode_start).$w->Submit('gl_submit','Valider').'</form>';
@ -110,7 +110,7 @@ if ( isset($_POST['save'])) {
'Op&eacute;ration sauv&eacute;e';
$a=new Anc_Group_Operation($cn);
$a->load_from_array($_POST);
$a->get_from_array($_POST);
$a->save();
echo $a->show();

View file

@ -141,7 +141,7 @@ if ( isset($_REQUEST['sa']))
{
// var_dump($_POST);
$po=new Anc_Account($cn);
$po->load_from_array($_POST);
$po->get_from_array($_POST);
$po->add();
$sa="list";
@ -179,7 +179,7 @@ if ( isset($_REQUEST['sa']))
if ( $sa=="po_update")
{
$po=new Anc_Account($cn);
$po->load_from_array($_POST);
$po->get_from_array($_POST);
$po->update();
$sa="list";
}

View file

@ -134,8 +134,8 @@ function CheckJrn($p_dossier,$p_user,$p_jrn,$p_detail=False)
/*!
* \brief Check if an user is allowed to do an action,
* this function is only used by the user_sec.php,
* otherwise you have to use cl_user->CheckAction
* or $cl_user->AccessRequest
* otherwise you have to use cl_user->check_action
* or $cl_user->can_request
*
* \param p_dossier dossier id
* \param p_login user's login
@ -146,7 +146,7 @@ function CheckJrn($p_dossier,$p_user,$p_jrn,$p_detail=False)
* - 1 priv granted
*
*/
function CheckAction ( $p_dossier,$p_login,$p_action_id)
function check_action ( $p_dossier,$p_login,$p_action_id)
{
if ( CheckIsAdmin ($p_login) ) return 1;
$cn=DbConnect($p_dossier);

View file

@ -982,7 +982,7 @@ function get_propertie()
if ( isDate($date) == null ) {
throw new AcException('Date invalide', 2);
}
list ($l_date_start,$l_date_end)=GetPeriode($this->db,$user->GetPeriode());
list ($l_date_start,$l_date_end)=get_periode($this->db,$user->get_periode());
// Date dans la periode active
if ( cmpDate($date,$l_date_start)<0 ||
@ -991,7 +991,7 @@ function get_propertie()
throw new AcException('Pas dans la periode active',5);
}
// Periode ferm<72>
if ( PeriodeClosed ($this->db,$user->GetPeriode())=='t' )
if ( PeriodeClosed ($this->db,$user->get_periode())=='t' )
{
return new AcException('Periode fermee',6);
}

View file

@ -51,7 +51,7 @@ var $jr_id; /*!< pk of jrn */
$this->qcode="";
$this->user=$_SESSION['g_user'];
$user=new cl_user($this->db);
$this->periode=$user->GetPeriode();
$this->periode=$user->get_periode();
}
/* **************************************************
*\brief Insert into the table Jrn

View file

@ -264,7 +264,7 @@ class Anc_Account
return $r;
}
function load_from_array($p_array)
function get_from_array($p_array)
{
$this->name=(isset ($p_array['po_name']))?$p_array['po_name']:"";
$this->description=(isset ($p_array['po_description']))?$p_array['po_description']:"";

View file

@ -87,7 +87,7 @@ class Anc_Group {
* \brief fill the object thanks an array
* \param array
*/
function load_from_array($p_array) {
function get_from_array($p_array) {
$this->ga_id=$p_array['ga_id'];
$this->ga_description=$p_array['ga_description'];
}
@ -98,7 +98,7 @@ class Anc_Group {
if ( ! empty($array)) {
foreach ($array as $m ) {
$obj= new Anc_Group($this->db);
$obj->load_from_array($m);
$obj->get_from_array($m);
$res[]=clone $obj;
}
}

View file

@ -161,7 +161,7 @@ class Anc_Group_Operation
/*!\brief fill row from $_POST data
*
*/
function load_from_array($p_array) {
function get_from_array($p_array) {
$Plan=new Anc_Plan($this->db);
$aPlan=$Plan->get_list();
@ -217,7 +217,7 @@ class Anc_Group_Operation
if ( isset($_POST['go'])) {
$b=new Anc_Group_Operation($cn);
$b->load_from_array($_POST);
$b->get_from_array($_POST);
exit();
}

View file

@ -159,7 +159,7 @@ class Anc_Operation
if ($p_from=="")
{ $from="";$to="";}
else
list($from,$to)=GetPeriode($this->db,$p_from);
list($from,$to)=get_periode($this->db,$p_from);
$array=$this->get_list($from,$to);

View file

@ -102,7 +102,7 @@ class Bud_Card {
* corresponding property will be null
* \param $p_array array to convert
*/
function load_from_array($p_array) {
function get_from_array($p_array) {
if ( empty($p_array) ) return;
foreach (array ('bh_id','bc_id','bc_code','bc_description','bc_price_unit','bc_unit')
as $key ){
@ -128,7 +128,7 @@ class Bud_Card {
if ( pg_NumRows($res) == 0 ) return null;
$a=pg_fetch_array($res,0);
$this->load_from_array($a);
$this->get_from_array($a);
}
static function get_list($p_cn,$p_bh_id) {
@ -143,7 +143,7 @@ class Bud_Card {
foreach ($get as $row ) {
$obj=new Bud_Card($p_cn);
$obj->load_from_array($row);
$obj->get_from_array($row);
$result[]=clone $obj;
}
return $result;

View file

@ -106,7 +106,7 @@ class Bud_Hypo {
ExecSql($this->db,$sql);
}
function load_from_array($p_array) {
function get_from_array($p_array) {
$this->bh_id=(isset($p_array['bh_id']))?$p_array['bh_id']:0;
$this->bh_saldo=(isset($p_array['bh_saldo']))?$p_array['bh_saldo']:0;
$this->bh_description=(isset($p_array['bh_description']))?$p_array['bh_description']:0;

View file

@ -250,7 +250,7 @@ where
/* Filter on the default year */
$User=new cl_user($this->cn);
$filter_year=" j_tech_per in (select p_id from parm_periode ".
"where p_exercice='".$User->getExercice()."')";
"where p_exercice='".$User->get_exercice()."')";
$a=$post->get_solde_detail($filter_year);
$r.=sprintf('<TD align="right"> %15.2f&euro;</TD>',$a['debit']);

View file

@ -133,7 +133,7 @@ class Supplier extends fiche{
/* Filter on the default year */
$User=new cl_user($this->cn);
$filter_year=" j_tech_per in (select p_id from parm_periode ".
"where p_exercice='".$User->getExercice()."')";
"where p_exercice='".$User->get_exercice()."')";
$a=$post->get_solde_detail($filter_year);
$r.=sprintf('<TD align="right"> %15.2f&euro;</TD>',$a['debit']);
$r.=sprintf('<TD align="right"> %15.2f&euro;</TD>',$a['credit']);

View file

@ -112,7 +112,7 @@ class cl_user {
$this->admin=$_SESSION['use_admin'];
$this->name=$_SESSION['use_name'];
$this->first_name=$_SESSION['use_first_name'];
$this->GetGlobalPref();
$this->load_global_pref();
}
@ -206,7 +206,7 @@ jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,jrn_type_id,jrn_desc,uj_priv,
* \param - $p_user
*
*/
function SetPeriode($p_periode) {
function set_periode($p_periode) {
$sql="update user_local_pref set parameter_value='$p_periode' where user_id='$this->id' and parameter_type='PERIODE'";
$Res=ExecSql($this->db,$sql);
}
@ -220,8 +220,8 @@ function SetPeriode($p_periode) {
*
*/
function GetPeriode() {
$array=$this->GetPreferences();
function get_periode() {
$array=$this->get_preference();
return $array['PERIODE'];
}
/*!
@ -232,7 +232,7 @@ function GetPeriode() {
* \param $p_user
* \return array of (parameter_type => parameter_value)
*/
function GetPreferences ()
function get_preference ()
{
// si preference n'existe pas, les créer
$sql="select parameter_type,parameter_value from user_local_pref where user_id='".$this->id."'";
@ -244,7 +244,7 @@ function GetPreferences ()
$this->id);
$Res=ExecSql($this->db,$sql);
$l_array=$this->GetPreferences();
$l_array=$this->get_preference();
} else {
for ( $i =0;$i < pg_NumRows($Res);$i++) {
$row= pg_fetch_array($Res,0);
@ -264,7 +264,7 @@ function GetPreferences ()
* - 1 priv granted
*
*/
function CheckAction ( $p_cn,$p_action_id)
function check_action ( $p_cn,$p_action_id)
{
if ( $this->admin==1 ) return 1;
@ -285,9 +285,9 @@ function GetPreferences ()
*/
function GetGlobalPref()
function load_global_pref()
{
echo_debug('class_user.php',__LINE__,"function GetGlobalPref");
echo_debug('class_user.php',__LINE__,"function load_global_pref");
$cn=Dbconnect();
// Load everything in an array
$Res=ExecSql ($cn,"select parameter_type,parameter_value from
@ -296,7 +296,7 @@ function GetGlobalPref()
$Max=pg_NumRows($Res);
if ( $Max == 0 ) {
$this->insert_default_global_pref();
$this->GetGlobalPref();
$this->load_global_pref();
return;
}
// Load value into array
@ -312,7 +312,7 @@ function GetGlobalPref()
if ( ! isset ($line[$parameter]) ) {
echo_debug("Missing pref : ".$parameter);
$this->insert_default_global_pref($parameter);
$this->GetGlobalPref();
$this->load_global_pref();
return;
}
$_SESSION[$name]=$line[$parameter];
@ -375,9 +375,9 @@ function update_global_pref($p_type,$p_value="") {
* it is the parm_periode.p_exercice col
* if an error occurs return 0
*/
function getExercice()
function get_exercice()
{
$sql="select p_exercice from parm_periode where p_id=".$this->GetPeriode();
$sql="select p_exercice from parm_periode where p_id=".$this->get_periode();
$Ret=ExecSql($this->db,$sql);
if (pg_NumRows($Ret) == 1)
{
@ -395,9 +395,9 @@ function getExercice()
* \param $p_js = 1 javascript, or 0 just a text
* \return nothing the program exits automatically
*/
function AccessRequest($p_cn,$p_action,$p_js=0)
function can_request($p_cn,$p_action,$p_js=0)
{
if ( $this->CheckAction($p_cn,$p_action)==0 )
if ( $this->check_action($p_cn,$p_action)==0 )
{
if ( $p_js == 1 )
{

View file

@ -24,7 +24,7 @@ $sub_action=(isset($_REQUEST['sa']))?$_REQUEST['sa']:"";
/*! \file
* \brief Called from the module "Gestion" to manage the customer
*/
$User->AccessRequest($cn,CLIENT);
$User->can_request($cn,CLIENT);
?>

View file

@ -65,8 +65,8 @@ if ( $sub_action=="use_opd" ) {
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Enregistrer" ID="SubmitButton">';
$form=FormAchInput($cn,$_GET['p_jrn'],$User->GetPeriode(),$p_post,$submit,false,$p_post['nb_item']);
// $form=FormAchInput($cn,$p_jrn,$User->GetPeriode(),$_POST,$submit,false,$nb_item);
$form=FormAchInput($cn,$_GET['p_jrn'],$User->get_periode(),$p_post,$submit,false,$p_post['nb_item']);
// $form=FormAchInput($cn,$p_jrn,$User->get_periode(),$_POST,$submit,false,$nb_item);
echo '<div class="u_content">';
echo $form;
@ -135,11 +135,11 @@ if ( $sub_action == "list")
$w=new widget("select");
// filter on the current year
$filter_year=" where p_exercice='".$User->getExercice()."'";
$filter_year=" where p_exercice='".$User->get_exercice()."'";
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end",1);
// User is already set User=new cl_user($cn);
$current=(isset($_GET['p_periode']))?$_GET['p_periode']:$User->GetPeriode();
$current=(isset($_GET['p_periode']))?$_GET['p_periode']:$User->get_periode();
$w->selected=$current;
echo 'Période '.$w->IOValue("p_periode",$periode_start);
@ -168,7 +168,7 @@ if ( $sub_action == "list")
else
{
$filter_per=" and jr_tech_per in (select p_id from parm_periode where p_exercice=".
$User->getExercice().")";
$User->get_exercice().")";
}
$sql=SQL_LIST_ALL_INVOICE." $filter_per and jr_def_type='ACH'" ;
@ -226,7 +226,7 @@ if ( isset ($_POST['add_item']) || isset ($_POST["correct"]) )
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Enregistrer" ID="SubmitButton">';
$form=FormAchInput($cn,$p_jrn,$User->GetPeriode(),$_POST,$submit,false,$nb_item);
$form=FormAchInput($cn,$p_jrn,$User->get_periode(),$_POST,$submit,false,$nb_item);
echo '<div class="u_content">';
echo $form;
echo $msg_tva;
@ -245,10 +245,10 @@ if ( isset($_POST['save']))
exit -1;
}
$nb_number=$_POST["nb_item"];
if ( form_verify_input ($cn,$p_jrn,$User->GetPeriode(),$_POST,$nb_number) == true ) {
if ( form_verify_input ($cn,$p_jrn,$User->get_periode(),$_POST,$nb_number) == true ) {
// we save the expense
list ($internal,$c)=RecordSell($cn,$_POST,$User,$p_jrn);
$form=FormAchView($cn,$p_jrn,$User->GetPeriode(),$_POST,"",$_POST['nb_item'],false);
$form=FormAchView($cn,$p_jrn,$User->get_periode(),$_POST,"",$_POST['nb_item'],false);
echo '<div class="u_content">';
echo '<h2 class="info"> Op&eacute;ration '.$internal.' enregistr&eacute;</h2>';
echo $form;
@ -264,7 +264,7 @@ if ( isset($_POST['save']))
if ( $own->MY_ANALYTIC != "nu" )
$submit.='<input type="button" value="verifie CA" onClick="verify_ca(\'ok\');">';
$submit.='<INPUT TYPE="SUBMIT" name="correct" value="Corriger">';
$form=FormAchView($cn,$p_jrn,$User->GetPeriode(),$_POST,$submit,$nb_number,true);
$form=FormAchView($cn,$p_jrn,$User->get_periode(),$_POST,$submit,$nb_number,true);
echo '<div class="u_content">';
echo $form;
echo '<hr>';
@ -285,15 +285,15 @@ if ( isset ($_POST['view_invoice']) )
$nb_number=$_POST["nb_item"];
$submit='<INPUT TYPE="SUBMIT" name="save" value="Confirmer">';
$submit.='<INPUT TYPE="SUBMIT" name="correct" value="Corriger">';
if ( form_verify_input ($cn,$p_jrn,$User->GetPeriode(),$_POST,$nb_number) == true ) {
if ( form_verify_input ($cn,$p_jrn,$User->get_periode(),$_POST,$nb_number) == true ) {
// Should use a read only view instead of FormAch
// where we can check
$form=FormAchView($cn,$p_jrn,$User->GetPeriode(),$_POST,$submit,$nb_number);
$form=FormAchView($cn,$p_jrn,$User->get_periode(),$_POST,$submit,$nb_number);
} else {
// if something goes wrong, correct it
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Enregistrer">';
$form=FormAchInput($cn,$p_jrn,$User->GetPeriode(),$_POST,$submit, false, $nb_number);
$form=FormAchInput($cn,$p_jrn,$User->get_periode(),$_POST,$submit, false, $nb_number);
}
echo '<div class="u_content">';
@ -319,7 +319,7 @@ if ( $p_jrn != -1 )
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Enregistrer" ID="SubmitButton">';
// Show an empty form of invoice
$form=FormAchInput($cn,$p_jrn,$User->GetPeriode(),null,$submit,false,$jrn->getDefLine());
$form=FormAchInput($cn,$p_jrn,$User->get_periode(),null,$submit,false,$jrn->getDefLine());
echo '<div class="u_content">';
echo $form;
echo $msg_tva;

View file

@ -115,12 +115,12 @@ if ( $sub_action == "list")
$w=new widget("select");
// Add filter on the year
$filter_year=" where p_exercice='".$User->getExercice()."'";
$filter_year=" where p_exercice='".$User->get_exercice()."'";
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') ".
" from parm_periode $filter_year order by p_start,p_end",1);
// User is already set User=new cl_user($cn);
$current=(isset($_GET['p_periode']))?$_GET['p_periode']:$User->GetPeriode();
$current=(isset($_GET['p_periode']))?$_GET['p_periode']:$User->get_periode();
$w->selected=$current;
echo 'Période '.$w->IOValue("p_periode",$periode_start);
@ -141,7 +141,7 @@ echo $w->Submit('gl_submit','Rechercher');
// Show list of sell
// Date - date of payment - Customer - amount
if ( $current == -1) {
$cond=" and jr_tech_per in (select p_id from parm_periode where p_exercice='".$User->getExercice()."')";
$cond=" and jr_tech_per in (select p_id from parm_periode where p_exercice='".$User->get_exercice()."')";
} else {
$cond=" and jr_tech_per=".$current;
}
@ -187,7 +187,7 @@ if ( $sub_action=="use_opd" ) {
$op->set_od_id($_REQUEST['pre_def']);
$p_post=$op->compute_array();
echo_debug(__FILE__.':'.__LINE__.'- ','p_post = ',$p_post);
$form=FormVenInput($cn,$_GET['p_jrn'],$User->GetPeriode(),$p_post,false,$p_post['nb_item']);
$form=FormVenInput($cn,$_GET['p_jrn'],$User->get_periode(),$p_post,false,$p_post['nb_item']);
echo '<div class="u_content">';
echo $form;
echo '</div>';
@ -208,7 +208,7 @@ if ( isset ($_POST['add_item']) || isset ($_POST["correct_new_invoice"]) )
$nb_item=$_POST['nb_item'];
if ( isset ($_POST['add_item']))
$nb_item++;
$form=FormVenInput($cn,$p_jrn,$User->GetPeriode(),$_POST,false,$nb_item);
$form=FormVenInput($cn,$p_jrn,$User->get_periode(),$_POST,false,$nb_item);
echo '<div class="u_content">';
echo $form;
echo '</div>';
@ -226,9 +226,9 @@ if ( isset($_POST['record_and_print_invoice']))
$nb_number=$_POST['nb_item'];
// First we save the invoice, the internal code will be used to change the description
// and upload the file
if ( form_verify_input($cn,$p_jrn,$User->GetPeriode(),$_POST,$nb_number)== true) {
if ( form_verify_input($cn,$p_jrn,$User->get_periode(),$_POST,$nb_number)== true) {
list ($internal,$e)=RecordInvoice($cn,$_POST,$User,$p_jrn);
$form=FormVenteView($cn,$p_jrn,$User->GetPeriode(),$_POST,$_POST['nb_item'],'noform','');
$form=FormVenteView($cn,$p_jrn,$User->get_periode(),$_POST,$_POST['nb_item'],'noform','');
echo '<div class="u_content">';
echo '<h2 class="info"> Op&eacute;ration '.$internal.' enregistr&eacute;</h2>';
@ -254,7 +254,7 @@ if ( isset($_POST['record_and_print_invoice']))
} else {
echo("A cause d'erreur la facture ne peut-&egrave;tre valid&eacute; ");
$form=FormVenteView($cn,$_GET['p_jrn'],$User->GetPeriode(),$_POST,$nb_number,"form");
$form=FormVenteView($cn,$_GET['p_jrn'],$User->get_periode(),$_POST,$nb_number,"form");
}
@ -275,14 +275,14 @@ if ( isset ($_POST['view_invoice']) )
exit -1;
}
$nb_number=$_POST["nb_item"];
if ( form_verify_input($cn,$p_jrn,$User->GetPeriode(),$_POST,$nb_number) == true)
if ( form_verify_input($cn,$p_jrn,$User->get_periode(),$_POST,$nb_number) == true)
{
$form=FormVenteView($cn,$p_jrn,$User->GetPeriode(),$_POST,$nb_number);
$form=FormVenteView($cn,$p_jrn,$User->get_periode(),$_POST,$nb_number);
} else {
// Check failed : invalid date or quantity
echo_error("Cannot validate ");
$form=FormVenInput($cn,$p_jrn,$User->GetPeriode(),$_POST,false,$nb_number);
$form=FormVenInput($cn,$p_jrn,$User->get_periode(),$_POST,false,$nb_number);
}
echo '<div class="u_content">';
@ -305,7 +305,7 @@ if ( $p_jrn != -1 )
$jrn=new Acc_Ledger($cn, $p_jrn);
echo_debug('facture.inc.php.php',__LINE__,"Blank form");
// Show an empty form of invoice
$form=FormVenInput($cn,$p_jrn,$User->GetPeriode(),null,false,$jrn->GetDefLine());
$form=FormVenInput($cn,$p_jrn,$User->get_periode(),null,false,$jrn->GetDefLine());
echo '<div class="u_content">';
echo $form;

View file

@ -45,8 +45,8 @@ include_once("fiche_inc.php");
$cn=DbConnect($gDossier);
echo_debug(__FILE__,__LINE__,"Connected");
// Security check
$read=$User->CheckAction($cn,FICHE_READ);
$write=$User->CheckAction($cn,FICHE_WRITE);
$read=$User->check_action($cn,FICHE_READ);
$write=$User->check_action($cn,FICHE_WRITE);
if ($read+$write == 0 ){
/* Cannot Access */
NoAccess();

View file

@ -244,7 +244,7 @@ function ConfirmTransfert($p_cn,$periode){
function TransferCSV($p_cn, $periode){
//on obtient la période courante
$User=new cl_user($p_cn);
$periode = $User->GetPeriode();
$periode = $User->get_periode();
// on trouve les dates frontières de cette période
$sql = "select to_char(p_start,'DD-MM-YYYY') as p_start,to_char(p_end,'DD-MM-YYYY') as p_end".

View file

@ -46,7 +46,7 @@ echo $result;
echo "</DIV>";
$cn=DbConnect($gDossier);
$User->AccessRequest($cn,IMP);
$User->can_request($cn,IMP);
include_once("impress_inc.php");

View file

@ -36,7 +36,7 @@ include_once("postgres.php");
//-----------------------------------------------------
// Form
//-----------------------------------------------------
$filter_year=" where p_exercice='".$User->getExercice()."'";
$filter_year=" where p_exercice='".$User->get_exercice()."'";
$bilan=new Acc_Bilan($cn);
echo '<div class="u_redcontent">';
echo '<FORM ACTION="bilan.php" METHOD="GET">';

View file

@ -60,7 +60,7 @@ if ( isset ($_REQUEST['fd_id'])) {
if ( $fiche_def->HasAttribute(ATTR_DEF_ACCOUNT) == true ) {
echo '<form method="POST" ACTION="?p_action=impress&type=fiche">'.dossier::hidden();
// filter on the current year
$filter_year=" where p_exercice='".$User->getExercice()."'";
$filter_year=" where p_exercice='".$User->get_exercice()."'";
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end");

View file

@ -218,7 +218,7 @@ print $w->IOValue("jrn_id",$ret);
print '</TR>';
print '<TR>';
// filter on the current year
$filter_year=" where p_exercice='".$User->getExercice()."'";
$filter_year=" where p_exercice='".$User->get_exercice()."'";
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end");
$w->label="Depuis";

View file

@ -139,7 +139,7 @@ print '<TR>';
// filter on the current year
$select=new widget("select");
$select->table=1;
$filter_year=" where p_exercice='".$User->getExercice()."'";
$filter_year=" where p_exercice='".$User->get_exercice()."'";
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end");
$select->label="Depuis";
print $select->IOValue('from_periode',$periode_start);

View file

@ -166,7 +166,7 @@ print $w->IOValue("form_id",$ret);
print '</TR>';
print '<TR>';
// filter on the current year
$filter_year=" where p_exercice='".$User->getExercice()."'";
$filter_year=" where p_exercice='".$User->get_exercice()."'";
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end");
$w->label="P&eacute;riode comptable : Depuis";

View file

@ -108,11 +108,11 @@ else
if ( isset ($_POST["sub_periode"] ) )
{
$periode=$_POST["periode"];
$User->SetPeriode($periode);
$User->set_periode($periode);
echo_debug('pref.inc',__LINE__,"Periode returns ".PeriodeClosed($cn,$periode));
}
$l_user_per=$User->GetPeriode();
$l_user_per=$User->get_periode();
// if periode is closed then warns the users
if ( PeriodeClosed($cn,$l_user_per)=='t')
{

View file

@ -112,7 +112,7 @@ function FormPeriode($p_cn,$l_default=0,$p_type=OPEN,$p_suff="")
$ret.="</SELECT>";
return $ret;
}
/*! GetPeriode
/*! get_periode
* \brief Give the start & end date of a periode
*
* \param p_connection
@ -122,7 +122,7 @@ function FormPeriode($p_cn,$l_default=0,$p_type=OPEN,$p_suff="")
*
*
*/
function GetPeriode($p_cn,$p_periode)
function get_periode($p_cn,$p_periode)
{
$sql="select to_char(p_start,'DD.MM.YYYY') as p_start,
to_char(p_end,'DD.MM.YYYY') as p_end

View file

@ -112,8 +112,8 @@ if ( CheckJrn(dossier::id(),$_SESSION['g_user'],$id) != 2 ) {
if ( isset($_GET['show_form']) || isset($_POST['correct_it']) ) {
$array=$_POST;
$default_periode=$User->GetPeriode();
list($date,$devnull)=GetPeriode($cn,$default_periode);
$default_periode=$User->get_periode();
list($date,$devnull)=get_periode($cn,$default_periode);
$array['date']=$date;
show_direct_form($cn,$ledger,$array);
exit();

View file

@ -60,7 +60,7 @@ if ($href=='compta.php')
echo $left_menu;
}
// Get The priv on the selected folder
$User->AccessRequest($cn,STOCK_READ);
$User->can_request($cn,STOCK_READ);
$action= ( isset ($_GET['action']))? $_GET['action']:"";
@ -69,7 +69,7 @@ include_once("stock_inc.php");
// Adjust the stock
if ( isset ($_POST['sub_change']))
{
if ( CheckAction($gDossier,$_SESSION['g_user'],STOCK_WRITE) == 0 )
if ( check_action($gDossier,$_SESSION['g_user'],STOCK_WRITE) == 0 )
{
/* Cannot Access */
NoAccess();
@ -91,7 +91,7 @@ if ( isset ($_POST['sub_change']))
} else
{
// Check if User Can change the stock
if ( CheckAction($gDossier,$_SESSION['g_user'],STOCK_WRITE) == 0 ) {
if ( check_action($gDossier,$_SESSION['g_user'],STOCK_WRITE) == 0 ) {
NoAccess();
exit (-1);
}
@ -133,7 +133,7 @@ echo JS_VIEW_JRN_MODIFY;
// if year is not set then use the year of the user's periode
if ( ! isset ($_GET['year']) ) {
// get defaut periode
$a=$User->GetPeriode();
$a=$User->get_periode();
// get exercice of periode
$year=GetExercice($cn,$a);
} else
@ -144,14 +144,14 @@ if ( ! isset ($_GET['year']) ) {
// View details
if ( $action == 'detail' ) {
// Check if User Can see the stock
if ( CheckAction($gDossier,$_SESSION['g_user'],STOCK_READ) == 0 ) {
if ( check_action($gDossier,$_SESSION['g_user'],STOCK_READ) == 0 ) {
NoAccess();
exit (-1);
}
$sg_code=(isset ($_GET['sg_code'] ))?$_GET['sg_code']:$_POST['sg_code'];
$year=(isset($_GET['year']))?$_GET['year']:$_POST['year'];
$a=ViewDetailStock($cn,$sg_code,$year);
$write=CheckAction($gDossier,$_SESSION['g_user'],STOCK_WRITE);
$write=check_action($gDossier,$_SESSION['g_user'],STOCK_WRITE);
$b="";
@ -186,7 +186,7 @@ for ( $i = 0; $i < pg_NumRows($Res);$i++) {
}
// Check if User Can see the stock
if ( CheckAction($gDossier,$_SESSION['g_user'],STOCK_READ) == 0 ) {
if ( check_action($gDossier,$_SESSION['g_user'],STOCK_READ) == 0 ) {
NoAccess();
exit (-1);
}

View file

@ -27,7 +27,7 @@ $sub_action=(isset($_REQUEST['sa']))?$_REQUEST['sa']:"";
* \brief Called from the module "Gestion" to manage the customer
*/
$User->AccessRequest($cn,SUPPL);
$User->can_request($cn,SUPPL);
?>
<?php

View file

@ -51,7 +51,7 @@ if ( $action=="use_opd" ) {
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Enregistrer" ID="SubmitButton">';
$form=FormAchInput($cn,$_GET['p_jrn'],$User->GetPeriode(),$p_post,$submit,false,$p_post['nb_item']);
$form=FormAchInput($cn,$_GET['p_jrn'],$User->get_periode(),$p_post,$submit,false,$p_post['nb_item']);
echo '<div class="u_redcontent">';
echo $form;
echo '</div>';
@ -72,7 +72,7 @@ if ( $action == 'new' ) {
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Enregistrer" ID="SubmitButton">';
$jrn=new Acc_Ledger($cn, $_GET['p_jrn']);
$r=FormAchInput($cn,$_GET['p_jrn'],$User->GetPeriode(),$_POST,$submit,false,$jrn->getDefLine());
$r=FormAchInput($cn,$_GET['p_jrn'],$User->get_periode(),$_POST,$submit,false,$jrn->getDefLine());
//--------------------
// predef op.
$op=new Pre_operation($cn);
@ -117,7 +117,7 @@ if ( $action == 'new' ) {
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Enregistrer">';
$r=FormAchInput($cn,$_GET['p_jrn'],$User->GetPeriode(),$_POST,$submit,false,
$r=FormAchInput($cn,$_GET['p_jrn'],$User->get_periode(),$_POST,$submit,false,
$nb_number);
echo '<div class="u_redcontent">';
echo $r;
@ -135,7 +135,7 @@ if ( $action == 'new' ) {
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Enregistrer">';
$r=FormAchInput($cn,$_GET['p_jrn'],$User->GetPeriode(),$_POST,$submit,false, $nb_number);
$r=FormAchInput($cn,$_GET['p_jrn'],$User->get_periode(),$_POST,$submit,false, $nb_number);
echo '<div class="u_redcontent">';
echo $r;
echo $msg_tva;
@ -154,15 +154,15 @@ if ( $action == 'new' ) {
if ( $own->MY_ANALYTIC != "nu" )
$submit.='<input type="button" value="verifie CA" onClick="verify_ca(\'ok\');">';
$submit.='<INPUT TYPE="SUBMIT" name="correct" value="Corriger">';
if ( form_verify_input ($cn,$_GET['p_jrn'],$User->GetPeriode(),$_POST,$nb_number) == true ) {
if ( form_verify_input ($cn,$_GET['p_jrn'],$User->get_periode(),$_POST,$nb_number) == true ) {
// Should use a read only view instead of FormAch
// where we can check
$r=FormAchView($cn,$_GET['p_jrn'],$User->GetPeriode(),$_POST,$submit,$nb_number);
$r=FormAchView($cn,$_GET['p_jrn'],$User->get_periode(),$_POST,$submit,$nb_number);
} else {
// if something goes wrong, correct it
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Enregistrer">';
$r=FormAchInput($cn,$_GET['p_jrn'],$User->GetPeriode(),$_POST,$submit, false, $nb_number);
$r=FormAchInput($cn,$_GET['p_jrn'],$User->get_periode(),$_POST,$submit, false, $nb_number);
}
echo '<div class="u_redcontent">';
echo $r;
@ -175,13 +175,13 @@ if ( $action == 'new' ) {
if ( isset($_POST['save'] )) {
// Get number of lines
$nb_number=$_POST["nb_item"];
if (form_verify_input ($cn,$_GET['p_jrn'],$User->GetPeriode(),$_POST,$nb_number)
if (form_verify_input ($cn,$_GET['p_jrn'],$User->get_periode(),$_POST,$nb_number)
== true ) {
list($internal,$comment)=RecordSell($cn,$_POST,$User,$_GET['p_jrn']);
// submit button in the form
$submit='<h2 class="info">Opération '.$internal.' </h2>';
$r=FormAchView($cn,$_GET['p_jrn'],$User->GetPeriode(),$_POST,"",$nb_number,false);
$r=FormAchView($cn,$_GET['p_jrn'],$User->get_periode(),$_POST,"",$nb_number,false);
echo '<div class="u_redcontent">';
echo $submit;
echo $r;
@ -193,7 +193,7 @@ if ( $action == 'new' ) {
$submit.='<INPUT TYPE="SUBMIT" name="correct" value="Corriger">';
$r=FormAchView($cn,$_GET['p_jrn'],$User->GetPeriode(),$_POST,$submit,$nb_number);
$r=FormAchView($cn,$_GET['p_jrn'],$User->get_periode(),$_POST,$submit,$nb_number);
echo '<div class="u_redcontent">';
// echo $submit;
echo $r;
@ -234,11 +234,11 @@ echo $hid->IOValue();
$w=new widget("select");
$w->name="p_periode";
// filter on the current year
$filter_year=" where p_exercice='".$User->getExercice()."'";
$filter_year=" where p_exercice='".$User->get_exercice()."'";
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end",1);
$User=new cl_user($cn);
$current=(isset($_GET['p_periode']))?$_GET['p_periode']:$User->GetPeriode();
$current=(isset($_GET['p_periode']))?$_GET['p_periode']:$User->get_periode();
$w->selected=$current;
echo 'P&eacute;riode '.$w->IOValue("p_periode",$periode_start).$w->Submit('gl_submit','Valider');
@ -276,7 +276,7 @@ echo 'P&eacute;riode '.$w->IOValue("p_periode",$periode_start).$w->Submit('gl_s
echo_debug ("user_action_ach.php");
// Date - date of payment - Customer - amount
if ( $current == -1) {
$cond=" and jr_tech_per in (select p_id from parm_periode where p_exercice='".$User->getExercice()."')";
$cond=" and jr_tech_per in (select p_id from parm_periode where p_exercice='".$User->get_exercice()."')";
} else {
$cond=" and jr_tech_per=".$current;
}

View file

@ -54,7 +54,7 @@ if ( $action=="use_opd" ) {
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">'.
'<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Enregistrer">';
$form=FormFin($cn,$_GET['p_jrn'],$User->GetPeriode(),$submit,$p_post,false,$p_post['nb_item']);
$form=FormFin($cn,$_GET['p_jrn'],$User->get_periode(),$submit,$p_post,false,$p_post['nb_item']);
echo '<div class="u_content">';
echo $form;
echo '</div>';
@ -80,7 +80,7 @@ if ( $action == 'new' ) {
$p_jrn=$_GET['p_jrn'];
$jrn=new Acc_Ledger($cn, $p_jrn);
$r=FormFin($cn,$p_jrn,$User->GetPeriode(),$submit,null,false,$jrn->GetDefLine());
$r=FormFin($cn,$p_jrn,$User->get_periode(),$submit,null,false,$jrn->GetDefLine());
echo '<div class="u_content">';
echo $r;
echo "<div>";
@ -120,7 +120,7 @@ if ( $action == 'new' ) {
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Enregistrer">';
$r=FormFin($cn,$_GET['p_jrn'],$User->GetPeriode(),$submit,$_POST,false, $nb_number);
$r=FormFin($cn,$_GET['p_jrn'],$User->get_periode(),$submit,$_POST,false, $nb_number);
echo '<div class="u_content">';
echo $r;
echo "<div><h4>On-line calculator</h4>".JS_CALC_LINE."</div>";
@ -136,7 +136,7 @@ if ( $action == 'new' ) {
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Enregistrer">';
$r=FormFin($cn,$_GET['p_jrn'],$User->GetPeriode(),$submit,$_POST,false, $nb_number);
$r=FormFin($cn,$_GET['p_jrn'],$User->get_periode(),$submit,$_POST,false, $nb_number);
echo '<div class="u_redcontent">';
echo $r;
echo "<div><h4>On-line calculator</h4>".JS_CALC_LINE."</div>";
@ -148,7 +148,7 @@ if ( $action == 'new' ) {
// View the charge and show a submit button to save it
if ( isset ($_POST['view_invoice']) ) {
$nb_number=$_POST["nb_item"];
$r=form_verify_input($cn,$_GET['p_jrn'],$User->GetPeriode(),$_POST,$nb_number);
$r=form_verify_input($cn,$_GET['p_jrn'],$User->get_periode(),$_POST,$nb_number);
// if something goes wrong correct it
if ( $r == null )
{
@ -156,14 +156,14 @@ if ( $action == 'new' ) {
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Enregistrer">';
$r=FormFin($cn,$_GET['p_jrn'],$User->GetPeriode(),$submit,$_POST,false, $nb_number);
$r=FormFin($cn,$_GET['p_jrn'],$User->get_periode(),$submit,$_POST,false, $nb_number);
}
else
{
$submit='<INPUT TYPE="SUBMIT" name="save" value="Confirmer">';
$submit.='<INPUT TYPE="SUBMIT" name="correct" value="Corriger">';
$r=FormFin($cn,$_GET['p_jrn'],$User->GetPeriode(),$submit,$_POST,true,$nb_number);
$r=FormFin($cn,$_GET['p_jrn'],$User->get_periode(),$submit,$_POST,true,$nb_number);
}
echo '<div class="u_redcontent">';
@ -180,7 +180,7 @@ if ( $action == 'new' ) {
// submit button in the form
$submit='<h2 class="info">Recorded '.$r.'</h2>';
$r.=FormFin($cn,$_GET['p_jrn'],$User->GetPeriode(),$submit,$_POST,true, $nb_number,true);
$r.=FormFin($cn,$_GET['p_jrn'],$User->get_periode(),$submit,$_POST,true, $nb_number,true);
echo '<div class="u_redcontent">';
echo $r;
echo "</div>";
@ -223,11 +223,11 @@ echo $hid->IOValue();
$w=new widget("select");
// filter on the current year
$filter_year=" where p_exercice='".$User->getExercice()."'";
$filter_year=" where p_exercice='".$User->get_exercice()."'";
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end",1);
$User=new cl_user($cn);
$current=(isset($_GET['p_periode']))?$_GET['p_periode']:$User->GetPeriode();
$current=(isset($_GET['p_periode']))?$_GET['p_periode']:$User->get_periode();
$w->selected=$current;
echo 'Période '.$w->IOValue("p_periode",$periode_start).$w->Submit('gl_submit','Valider');
@ -238,7 +238,7 @@ echo 'P
// Show list of sell
echo_debug ("user_action_jrn.php");
if ( $current == -1) {
$cond=" and jr_tech_per in (select p_id from parm_periode where p_exercice='".$User->getExercice()."')";
$cond=" and jr_tech_per in (select p_id from parm_periode where p_exercice='".$User->get_exercice()."')";
} else {
$cond=" and jr_tech_per=".$current;
}

View file

@ -48,17 +48,17 @@ echo $hid->IOValue();
$w=new widget("select");
// filter on the current year
$filter_year=" where p_exercice='".$User->getExercice()."'";
$filter_year=" where p_exercice='".$User->get_exercice()."'";
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end",1);
$current=(isset($_GET['p_periode']))?$_GET['p_periode']:$User->GetPeriode();
$current=(isset($_GET['p_periode']))?$_GET['p_periode']:$User->get_periode();
$w->selected=$current;
echo 'Période '.$w->IOValue("p_periode",$periode_start).$w->Submit('gl_submit','Valider');
?>
</form>
<?php
if ( $current == -1) {
$cond=" and jr_tech_per in (select p_id from parm_periode where p_exercice='".$User->getExercice()."')";
$cond=" and jr_tech_per in (select p_id from parm_periode where p_exercice='".$User->get_exercice()."')";
} else {
$cond=" and jr_tech_per=".$current;
}

View file

@ -55,8 +55,8 @@ if ( $action=="use_opd" ) {
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout poste">'.
'<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Confirmer">';
// $form=FormVenInput($cn,$_GET['p_jrn'],$User->GetPeriode(),$p_post,false,$p_post['nb_item']);
$form=FormODS($cn,$_REQUEST['p_jrn'],$User->GetPeriode(),$submit,$p_post,false,$p_post['nb_item']);
// $form=FormVenInput($cn,$_GET['p_jrn'],$User->get_periode(),$p_post,false,$p_post['nb_item']);
$form=FormODS($cn,$_REQUEST['p_jrn'],$User->get_periode(),$submit,$p_post,false,$p_post['nb_item']);
echo '<div class="u_redcontent">';
echo $form;
@ -81,7 +81,7 @@ if ( $action == 'new' ) {
$jrn=new Acc_Ledger($cn,$_GET['p_jrn']);
$prop=$jrn->get_propertie();
$line=$prop['jrn_deb_max_line'];
$r=FormODS($cn,$_REQUEST['p_jrn'],$User->GetPeriode(),$submit,null,false,$line);
$r=FormODS($cn,$_REQUEST['p_jrn'],$User->get_periode(),$submit,null,false,$line);
echo '<div class="u_redcontent">';
echo $r;
echo "<div>";
@ -120,7 +120,7 @@ if ( $action == 'new' ) {
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout Poste">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Enregistrer">';
$r=FormODS($cn,$_POST['p_jrn'],$User->GetPeriode(),$submit,$_POST,false, $nb_number);
$r=FormODS($cn,$_POST['p_jrn'],$User->get_periode(),$submit,$_POST,false, $nb_number);
echo '<div class="u_redcontent">';
echo $r;
echo "<div><h4>On-line calculator</h4>".JS_CALC_LINE."<div>";
@ -135,7 +135,7 @@ if ( $action == 'new' ) {
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout Poste">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Enregistrer">';
$r=FormODS($cn,$_POST['p_jrn'],$User->GetPeriode(),$submit,$_POST,false, $nb_number);
$r=FormODS($cn,$_POST['p_jrn'],$User->get_periode(),$submit,$_POST,false, $nb_number);
echo '<div class="u_redcontent">';
echo $r;
echo "<div><h4>On-line calculator</h4>".JS_CALC_LINE."<div>";
@ -153,7 +153,7 @@ if ( $action == 'new' ) {
$submit.='<input type="button" value="verifie CA" onClick="verify_ca(\'ok\');">';
$submit.='<INPUT TYPE="SUBMIT" name="correct" value="Corriger">';
$r=FormODS($cn,$_POST['p_jrn'],$User->GetPeriode(),$submit,$_POST,true,$nb_number);
$r=FormODS($cn,$_POST['p_jrn'],$User->get_periode(),$submit,$_POST,true,$nb_number);
// if something goes wrong, correct it
if ( $r == null ) {
@ -161,7 +161,7 @@ if ( $action == 'new' ) {
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout Poste">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Enregistrer">';
$r=FormODS($cn,$_POST['p_jrn'],$User->GetPeriode(),$submit,$_POST,false, $nb_number);
$r=FormODS($cn,$_POST['p_jrn'],$User->get_periode(),$submit,$_POST,false, $nb_number);
}else {
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout Poste">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Enregistrer">';
@ -182,7 +182,7 @@ if ( $action == 'new' ) {
// submit button in the form
$submit='<h2 class="info">Recorded'.$r.'</h2>';
$r.=FormODS($cn,$_POST['p_jrn'],$User->GetPeriode(),$submit,$_POST,true, $nb_number,true);
$r.=FormODS($cn,$_POST['p_jrn'],$User->get_periode(),$submit,$_POST,true, $nb_number,true);
}else {
// CA incorrecte
$submit='<INPUT TYPE="SUBMIT" name="save" value="Confirmer" onClick="return verify_ca(\'error\');">';
@ -190,7 +190,7 @@ if ( $action == 'new' ) {
$submit.='<input type="button" value="verifie CA" onClick="verify_ca(\'ok\');">';
$submit.='<INPUT TYPE="SUBMIT" name="correct" value="Corriger">';
$r=FormODS($cn,$_POST['p_jrn'],$User->GetPeriode(),$submit,$_POST,true,$nb_number);
$r=FormODS($cn,$_POST['p_jrn'],$User->get_periode(),$submit,$_POST,true,$nb_number);
}
echo '<div class="u_redcontent">';
@ -237,11 +237,11 @@ echo $hid->IOValue();
$w=new widget("select");
// filter on the current year
$filter_year=" where p_exercice='".$User->getExercice()."'";
$filter_year=" where p_exercice='".$User->get_exercice()."'";
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end",1);
$User=new cl_user($cn);
$current=(isset($_GET['p_periode']))?$_GET['p_periode']:$User->GetPeriode();
$current=(isset($_GET['p_periode']))?$_GET['p_periode']:$User->get_periode();
$w->selected=$current;
echo 'Période '.$w->IOValue("p_periode",$periode_start).$w->Submit('gl_submit','Valider');
@ -249,7 +249,7 @@ echo 'P
</form>
<?php
if ( $current == -1) {
$cond=" and jr_tech_per in (select p_id from parm_periode where p_exercice='".$User->getExercice()."')";
$cond=" and jr_tech_per in (select p_id from parm_periode where p_exercice='".$User->get_exercice()."')";
} else {
$cond=" and jr_tech_per=".$current;
}

View file

@ -53,7 +53,7 @@ if ( $action=="use_opd" ) {
$p_post=$op->compute_array();
echo_debug(__FILE__.':'.__LINE__.'- ','p_post = ',$p_post);
$form=FormVenInput($cn,$_GET['p_jrn'],$User->GetPeriode(),$p_post,false,$p_post['nb_item']);
$form=FormVenInput($cn,$_GET['p_jrn'],$User->get_periode(),$p_post,false,$p_post['nb_item']);
echo '<div class="u_redcontent">';
echo $form;
echo '</div>';
@ -67,7 +67,7 @@ if ( $action == 'insert_vente' ) {
$nb_number=$_POST["nb_item"];
$nb_number++;
$form=FormVenInput($cn,$_GET['p_jrn'],$User->GetPeriode(),$_POST,false,$nb_number);
$form=FormVenInput($cn,$_GET['p_jrn'],$User->get_periode(),$_POST,false,$nb_number);
echo '<div class="u_redcontent">';
echo $form;
echo '</div>';
@ -77,13 +77,13 @@ if ( $action == 'insert_vente' ) {
// We want to see the encoded invoice
if ( isset ($_POST["view_invoice"])) {
$nb_number=$_POST["nb_item"];
if ( form_verify_input($cn,$_GET['p_jrn'],$User->GetPeriode(),$_POST,$nb_number) == true)
if ( form_verify_input($cn,$_GET['p_jrn'],$User->get_periode(),$_POST,$nb_number) == true)
{
$form=FormVenteView($cn,$_GET['p_jrn'],$User->GetPeriode(),$_POST,$nb_number);
$form=FormVenteView($cn,$_GET['p_jrn'],$User->get_periode(),$_POST,$nb_number);
// Check failed : invalid date or quantity
} else {
echo_debug(__FILE__.':'.__LINE__," Impossible d'accepter le formulaire");
$form=FormVenInput($cn,$_GET['p_jrn'],$User->GetPeriode(),$_POST,false,$nb_number);
$form=FormVenInput($cn,$_GET['p_jrn'],$User->get_periode(),$_POST,false,$nb_number);
}
echo '<div class="u_redcontent">';
echo $form;
@ -97,7 +97,7 @@ if ( $action == 'insert_vente' ) {
$jrn=new Acc_Ledger($cn, $_GET['p_jrn']);
echo_debug('user_action_ven.php',__LINE__,"Blank form");
// Show an empty form of invoice
$form=FormVenInput($cn,$_GET['p_jrn'],$User->GetPeriode(),null,false,$jrn->GetDefLine());
$form=FormVenInput($cn,$_GET['p_jrn'],$User->get_periode(),null,false,$jrn->GetDefLine());
echo '<div class="u_redcontent">';
echo $form;
//--------------------
@ -143,7 +143,7 @@ if (isset ($_POST['correct_new_invoice'])) {
}
$nb=$_POST['nb_item'];
$form=FormVenInput($cn,$_GET['p_jrn'],$User->GetPeriode(),$_POST,false,$nb);
$form=FormVenInput($cn,$_GET['p_jrn'],$User->get_periode(),$_POST,false,$nb);
echo '<div class="u_redcontent">';
echo $form;
echo '</div>';
@ -158,14 +158,14 @@ if ( isset($_POST["record_and_print_invoice"])) {
$nb_number=$_POST["nb_item"];
echo_debug(__FILE__.':'.__LINE__.'- record_and_print_invoice');
if ( form_verify_input($cn,$p_jrn,$User->GetPeriode(),$_POST,$nb_number)== true) {
if ( form_verify_input($cn,$p_jrn,$User->get_periode(),$_POST,$nb_number)== true) {
$comment=RecordInvoice($cn,$_POST,$User,$_GET['p_jrn']);
$form=FormVenteView($cn,$p_jrn,$User->GetPeriode(),$_POST,$nb_number,'noform',$comment);
$form=FormVenteView($cn,$p_jrn,$User->get_periode(),$_POST,$nb_number,'noform',$comment);
} else {
echo("A cause d'erreur la facture ne peut-&egrave;tre valid&eacute; ");
$form=FormVenteView($cn,$_GET['p_jrn'],$User->GetPeriode(),$_POST,$nb_number,"form");
$form=FormVenteView($cn,$_GET['p_jrn'],$User->get_periode(),$_POST,$nb_number,"form");
}
echo '<div class="u_redcontent">';
@ -211,11 +211,11 @@ echo $hid->IOValue();
$w=new widget("select");
// filter on the current year
$filter_year=" where p_exercice='".$User->getExercice()."'";
$filter_year=" where p_exercice='".$User->get_exercice()."'";
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end",1);
// User is already set User=new cl_user($cn);
$current=(isset($_GET['p_periode']))?$_GET['p_periode']:$User->GetPeriode();
$current=(isset($_GET['p_periode']))?$_GET['p_periode']:$User->get_periode();
$w->selected=$current;
echo 'Période '.$w->IOValue("p_periode",$periode_start).$w->Submit('gl_submit','Valider');
@ -251,7 +251,7 @@ echo 'P
// Show list of sell
// Date - date of payment - Customer - amount
if ( $current == -1) {
$cond=" and jr_tech_per in (select p_id from parm_periode where p_exercice='".$User->getExercice()."')";
$cond=" and jr_tech_per in (select p_id from parm_periode where p_exercice='".$User->get_exercice()."')";
} else {
$cond=" and jr_tech_per=".$current;
}

View file

@ -847,7 +847,7 @@ function VerifyOperationDate($p_cn,$p_periode,$p_date) {
return null;
}
// userPref contient la periode par default
list ($l_date_start,$l_date_end)=GetPeriode($p_cn,$p_periode);
list ($l_date_start,$l_date_end)=get_periode($p_cn,$p_periode);
// Date dans la periode active
echo_debug ("date start periode $l_date_start date fin periode $l_date_end date demandée $p_date");

View file

@ -68,7 +68,7 @@ echo_debug('user_form_ach.php',__LINE__,"Enter FormAchInput($p_cn,$p_jrn,$p_peri
extract($p_array);
}
// The date
list ($l_date_start,$l_date_end)=GetPeriode($p_cn,$p_periode);
list ($l_date_start,$l_date_end)=get_periode($p_cn,$p_periode);
// $op_date=( ! isset($e_date) )
// ?substr($l_date_start,2,8):$e_date;
$op_date=( ! isset($e_date) ) ?$l_date_start:$e_date;
@ -473,7 +473,7 @@ function form_verify_input($p_cn,$p_jrn,$p_periode,$p_array,$p_number)
// Verify the userperiode
// p_periode contient la periode par default
list ($l_date_start,$l_date_end)=GetPeriode($p_cn,$p_periode);
list ($l_date_start,$l_date_end)=get_periode($p_cn,$p_periode);
// Date dans la periode active
echo_debug ('user_form_ach',__LINE__,"date start periode $l_date_start date fin periode $l_date_end date demande $e_date");
@ -764,7 +764,7 @@ function RecordSell($p_cn,$p_array,$p_user,$p_jrn)
}
// Get the default period
$periode=$p_user->GetPeriode();
$periode=$p_user->get_periode();
$amount=0.0;
$amount_jrn=0.0;
$sum_tva_nd=0.0;

View file

@ -94,7 +94,7 @@ function form_verify_input($p_cn,$p_jrn,$p_periode,$p_array,$p_number)
// Verify the userperiode
// p_periode contient la periode par default
list ($l_date_start,$l_date_end)=GetPeriode($p_cn,$p_periode);
list ($l_date_start,$l_date_end)=get_periode($p_cn,$p_periode);
// Date dans la periode active
echo_debug ('user_form_fin',__LINE__,"date start periode $l_date_start date fin periode $l_date_end date demande $e_date");
@ -144,7 +144,7 @@ function FormFin($p_cn,$p_jrn,$p_periode,$p_submit,$p_array=null,$pview_only=tru
}
}
// The date
list ($l_date_start,$l_date_end)=GetPeriode($p_cn,$p_periode);
list ($l_date_start,$l_date_end)=get_periode($p_cn,$p_periode);
$flag=(isset($e_date))?1:0;
// $e_date=( ! isset($e_date) ) ? substr($l_date_start,2,8):$e_date;
$e_date=( ! isset($e_date) ) ? $l_date_start:$e_date;
@ -378,7 +378,7 @@ function RecordFin($p_cn,$p_array,$p_user,$p_jrn) {
${"$v"}=$e;
}
// Get the default period
$periode=$p_user->GetPeriode();
$periode=$p_user->get_periode();
// Debit = banque
$poste_bq=GetFicheAttribut($p_cn,$e_bank_account,ATTR_DEF_ACCOUNT);

View file

@ -62,7 +62,7 @@ function FormODS($p_cn,$p_jrn,$p_periode,$p_submit,$p_array=null,$pview_only=tru
$own = new Own($p_cn);
// The date
list ($l_date_start,$l_date_end)=GetPeriode($p_cn,$p_periode);
list ($l_date_start,$l_date_end)=get_periode($p_cn,$p_periode);
$flag=(isset($e_date))?1:0;
// $e_date=( ! isset($e_date) ) ?
// substr($l_date_start,2,8):$e_date;
@ -319,7 +319,7 @@ function RecordODS($p_cn,$p_array,$p_user,$p_jrn)
${"$v"}=$e;
}
// Get the default period
$periode=$p_user->GetPeriode();
$periode=$p_user->get_periode();
$amount=0.0;
// Computing total customer

View file

@ -55,7 +55,7 @@ function FormVenInput($p_cn,$p_jrn,$p_periode,$p_array=null,$pview_only=true,$p_
}
}
// The date
list ($l_date_start,$l_date_end)=GetPeriode($p_cn,$p_periode);
list ($l_date_start,$l_date_end)=get_periode($p_cn,$p_periode);
// $op_date=( ! isset($e_date) )
// ?substr($l_date_start,2,8):$e_date;
$op_date=( ! isset($e_date) ) ?$l_date_start:$e_date;
@ -399,7 +399,7 @@ function form_verify_input($p_cn,$p_jrn,$p_periode,$p_array,$p_number)
// Verify the userperiode
// p_periode contient la periode par default
list ($l_date_start,$l_date_end)=GetPeriode($p_cn,$p_periode);
list ($l_date_start,$l_date_end)=get_periode($p_cn,$p_periode);
// Date dans la periode active
echo_debug ('user_form_ven',__LINE__,"date start periode $l_date_start date fin periode $l_date_end date demande $e_date");
@ -698,7 +698,7 @@ function RecordInvoice($p_cn,$p_array,$p_user,$p_jrn)
}
// Get the default period
$periode=$p_user->GetPeriode();
$periode=$p_user->get_periode();
$amount=0.0;
$own=new own($p_cn);
$group=NextSequence($p_cn,"s_oa_group");