diff --git a/include/class_fiche.php b/include/class_fiche.php index 7bf9482b7..cc9a6e775 100644 --- a/include/class_fiche.php +++ b/include/class_fiche.php @@ -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;$icn,$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 diff --git a/include/class_user.php b/include/class_user.php index d9082b154..5fdffa001 100644 --- a/include/class_user.php +++ b/include/class_user.php @@ -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; } diff --git a/include/compta_fin.inc.php b/include/compta_fin.inc.php index b51ec1913..923594a2d 100644 --- a/include/compta_fin.inc.php +++ b/include/compta_fin.inc.php @@ -235,8 +235,9 @@ if ( $def==3) { require_once ('class_acc_parm_code.php'); echo '
'; - $fiche=new Fiche_Def($cn); - $array=$fiche->get_by_category(FICHE_TYPE_FIN); + $fiche=new Fiche($cn); + + $array=$fiche->get_bk_account(); echo '
'; @@ -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