Improve audit : add the module number
Bank Saldo when viewable by anyone
This commit is contained in:
Dany De Bontridder 2010-11-20 18:14:05 +00:00
parent d044c620e9
commit dbbe9d481a
3 changed files with 36 additions and 7 deletions

View file

@ -65,6 +65,32 @@ class Fiche
return strcmp($o1->strAttribut(ATTR_DEF_NAME),$o2->strAttribut(ATTR_DEF_NAME));
}
/**
*@brief get the available bank_account filtered by the security
*@return array of card
*/
function get_bk_account()
{
$user=new User($this->cn);
$sql_ledger=$user->get_ledger_sql('FIN',3);
$avail=$this->cn->get_array("select jrn_def_id,jrn_def_bank from jrn_def where jrn_def_type='FIN' and $sql_ledger
order by jrn_def_name");
if ( count($avail) == 0 )
return null;
for ($i=0;$i<count($avail);$i++)
{
$t=new Fiche($this->cn,$avail[$i]['jrn_def_bank']);
$t->getAttribut();
$all[$i]=$t;
}
return $all;
}
/*! get_by_qcode($p_qcode)
* \brief Retrieve a card thx his quick_code
* complete the object,, set the id member of the object or set it

View file

@ -158,12 +158,12 @@ class User
}
$sql="insert into audit_connect (ac_user,ac_ip,ac_module,ac_state) values ($1,$2,$3,$4)";
$sql="insert into audit_connect (ac_user,ac_ip,ac_module,ac_url,ac_state) values ($1,$2,$3,$4,$5)";
if ( $res == 0 )
{
if ( $from=='LOGIN')
$cn->exec_sql($sql,array($_SESSION['g_user'],$_SERVER["REMOTE_ADDR"],$from,'FAIL'));
$cn->exec_sql($sql,array($_SESSION['g_user'],$_SERVER["REMOTE_ADDR"],$from,$_SERVER['REQUEST_URI'],'FAIL'));
if ( ! $silent)
{
alert(_('Utilisateur ou mot de passe incorrect'));
@ -175,7 +175,7 @@ class User
else
{
if ( $from=='LOGIN')
$cn->exec_sql($sql,array($_SESSION['g_user'],$_SERVER["REMOTE_ADDR"],$from,'SUCCESS'));
$cn->exec_sql($sql,array($_SESSION['g_user'],$_SERVER["REMOTE_ADDR"],$from,$_SERVER['REQUEST_URI'],'SUCCESS'));
$this->valid=1;
}
@ -487,8 +487,8 @@ class User
if (isset ($audit) && $audit == true)
{
$cn=new Database();
$sql="insert into audit_connect (ac_user,ac_ip,ac_module,ac_state) values ($1,$2,$3,$4)";
$cn->exec_sql($sql,array($_SESSION['g_user'],$_SERVER["REMOTE_ADDR"],$_SERVER['REQUEST_URI'],'FAIL'));
$sql="insert into audit_connect (ac_user,ac_ip,ac_module,ac_url,ac_state) values ($1,$2,$3,$4,$5)";
$cn->exec_sql($sql,array($_SESSION['g_user'],$_SERVER["REMOTE_ADDR"],$p_action_id,$_SERVER['REQUEST_URI'],'FAIL'));
}
return 0;
}

View file

@ -235,8 +235,9 @@ if ( $def==3)
{
require_once ('class_acc_parm_code.php');
echo '<div class="content">';
$fiche=new Fiche_Def($cn);
$array=$fiche->get_by_category(FICHE_TYPE_FIN);
$fiche=new Fiche($cn);
$array=$fiche->get_bk_account();
echo '<div class="content">';
@ -346,6 +347,8 @@ if ($def==4)
echo dossier::hidden();
echo HtmlInput::hidden('sa','r');
$wLedger=$Ledger->select_ledger('FIN',3);
if ($wLedger == null ) exit ('Pas de journal disponible');
$wLedger->javascript="onchange='this.form.submit()';";
echo $wLedger->input();
$operation=$cn->get_array("select jr_id,jr_internal,jr_comment,to_char(jr_date,'DD.MM.YYYY') as fmt_date,jr_montant