From 8a8aaf618de388cff0f74cf3cce1872ed5b66e19 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Feb 2016 02:22:10 +0100 Subject: [PATCH] Fix: select to add box was lost --- htdocs/core/class/html.formother.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index c89844a91db..474c07f4b0a 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -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.= ""; } - return array('selectboxlist'=>$nbboxactivated?$selectboxlist:'', 'boxactivated'=>$boxactivated, 'boxlist'=>$boxlist); + return array('selectboxlist'=>count($boxactivated)?$selectboxlist:'', 'boxactivated'=>$boxactivated, 'boxlist'=>$boxlist); }