Skip to content
Snippets Groups Projects
Commit 8a8aaf61 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: select to add box was lost

parent 3828fe70
No related branches found
No related tags found
No related merge requests found
......@@ -977,15 +977,19 @@ class FormOther
$confuserzone='MAIN_BOXES_'.$areacode;
// $boxactivated will be array of boxes enabled into global setup
// $boxidactivatedforuser will be array of boxes choosed by user
$selectboxlist=$boxlist='';
$boxactivated=InfoBox::listBoxes($db,'activated',$areacode,(empty($user->conf->$confuserzone)?null:$user)); // Search boxes of common+user (or common only if user has no specific setup)
//var_dump($boxactivated);
$boxidactivatedforuser=array();
foreach($boxactivated as $box)
{
if (empty($user->conf->$confuserzone) || $box->fk_user == $user->id) $boxidactivatedforuser[$box->id]=$box->id; // We keep only boxes to show for user
}
$arrayboxtoactivatelabel=array();
if (! empty($user->conf->$confuserzone))
{
......@@ -1174,7 +1178,7 @@ class FormOther
$boxlist.= "</table>";
}
return array('selectboxlist'=>$nbboxactivated?$selectboxlist:'', 'boxactivated'=>$boxactivated, 'boxlist'=>$boxlist);
return array('selectboxlist'=>count($boxactivated)?$selectboxlist:'', 'boxactivated'=>$boxactivated, 'boxlist'=>$boxlist);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment