Fix : PHP compatibility with count
Fix : Dossier::set_current Code cleaning ,
This commit is contained in:
parent
da6ad03718
commit
52cc9a9799
5 changed files with 17 additions and 9 deletions
|
|
@ -1388,12 +1388,13 @@ class Acc_Ledger extends jrn_def_sql
|
|||
/**
|
||||
* @brief get the first ledger
|
||||
* @param type
|
||||
* @return the j_id
|
||||
* @return the j_id or null if no user available
|
||||
*/
|
||||
public function get_first($p_type, $p_access=3)
|
||||
{
|
||||
global $g_user;
|
||||
$all=$g_user->get_ledger($p_type, $p_access);
|
||||
if (empty ($all)) return NULL;
|
||||
return $all[0];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1198,7 +1198,8 @@ class Acc_Ledger_Search
|
|||
echo HtmlInput::title_box(_("Journaux"), $p_div."jrn_search");
|
||||
echo '<div style="padding:5px">';
|
||||
echo '<form method="GET" id="'.$p_div.'search_frm" onsubmit="return hide_ledger_choice(\''.$p_div.'search_frm\')">';
|
||||
echo HtmlInput::hidden('nb_jrn', count($p_array));
|
||||
$nb_array=(empty($p_array))?0:count($p_array);
|
||||
echo HtmlInput::hidden('nb_jrn', $nb_array);
|
||||
echo _('Filtre ').HtmlInput::filter_table($p_div.'tb_jrn', '0,1,2', 2);
|
||||
echo HtmlInput::anchor_action(_('Inverser sel'),' toggle_checkbox(\''."{$p_div}search_frm".'\')','sel_'.$p_div,"nav");
|
||||
echo "-";
|
||||
|
|
@ -1222,7 +1223,7 @@ class Acc_Ledger_Search
|
|||
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
for ($e=0;$e<count($p_array);$e++)
|
||||
for ($e=0;$e<$nb_array;$e++)
|
||||
{
|
||||
$row=$p_array[$e];
|
||||
// if ( $row['jrn_enable']==0) continue;
|
||||
|
|
|
|||
|
|
@ -418,7 +418,7 @@ class Dossier
|
|||
*/
|
||||
static function set_current($p_dossier) {
|
||||
|
||||
put_global(["gDossier"=>$p_dossier]);
|
||||
put_global([ [ "key"=>"gDossier","value"=>$p_dossier]]);
|
||||
self::check();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -134,11 +134,17 @@ $Ledger = new Acc_Ledger_Fin($cn, 0);
|
|||
if (!isset($_REQUEST['p_jrn']))
|
||||
{
|
||||
$a = $Ledger->get_first('fin');
|
||||
$Ledger->id = $a['jrn_def_id'];
|
||||
if ( isset($a['jrn_def_id'])) {
|
||||
$Ledger->id = $a['jrn_def_id'];
|
||||
} else {
|
||||
$Ledger->id=0;
|
||||
}
|
||||
}
|
||||
else
|
||||
$Ledger->id = $_REQUEST['p_jrn'];
|
||||
$jrn_priv = $g_user->get_ledger_access($Ledger->id);
|
||||
{
|
||||
$Ledger->id =$http->request("p_jrn","number",0);
|
||||
}
|
||||
$jrn_priv = ($Ledger->id == 0)?"X":$g_user->get_ledger_access($Ledger->id);
|
||||
if (isset($_GET["p_jrn"]) && $jrn_priv == "X")
|
||||
{
|
||||
NoAccess();
|
||||
|
|
|
|||
|
|
@ -62,9 +62,9 @@ $filter_year=" j_tech_per in (select p_id from parm_periode where p_exercice='
|
|||
$idx=0;
|
||||
bcscale(2);
|
||||
$tot_extrait=0; $tot_diff=0; $tot_operation=0;
|
||||
|
||||
$nb_array=(empty($array))?0:count($array);
|
||||
// for each account
|
||||
for ($i=0; $i<count($array); $i++)
|
||||
for ($i=0; $i<$nb_array; $i++)
|
||||
{
|
||||
if ($array[$i]->id==0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue