Passed
Push — master ( 65bdac...4e88da )
by Alxarafe
32:38
created
Base/FormOther.php 1 patch
Indentation   +146 added lines, -146 removed lines patch added patch discarded remove patch
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
     // private $db;
42 42
 
43 43
     /**
44
-	 * @var string Error code (or message)
45
-	 */
46
-	public $error;
44
+     * @var string Error code (or message)
45
+     */
46
+    public $error;
47 47
 
48 48
 
49 49
     /**
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $sql = "SELECT rowid, label";
75 75
         $sql.= " FROM ".MAIN_DB_PREFIX."export_model";
76 76
         $sql.= " WHERE type = '".$type."'";
77
-		if (!empty($fk_user)) $sql.=" AND fk_user=".$fk_user;
77
+        if (!empty($fk_user)) $sql.=" AND fk_user=".$fk_user;
78 78
         $sql.= " ORDER BY rowid";
79 79
         $result = $this->db->query($sql);
80 80
         if ($result)
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
         $sql.= " WHERE e.active = 1 AND e.fk_pays = c.rowid";
181 181
         $sql.= " ORDER BY country, e.organization ASC, e.code ASC";
182 182
 
183
-    	dol_syslog(get_class($this).'::select_ecotaxes', LOG_DEBUG);
183
+        dol_syslog(get_class($this).'::select_ecotaxes', LOG_DEBUG);
184 184
         $resql=$this->db->query($sql);
185 185
         if ($resql)
186 186
         {
@@ -231,50 +231,50 @@  discard block
 block discarded – undo
231 231
     function select_revenue_stamp($selected='', $htmlname='revenuestamp', $country_code='')
232 232
     {
233 233
         // phpcs:enable
234
-    	global $langs;
235
-
236
-    	$out='';
237
-
238
-    	$sql = "SELECT r.taux, r.revenuestamp_type";
239
-    	$sql.= " FROM ".MAIN_DB_PREFIX."c_revenuestamp as r,".MAIN_DB_PREFIX."c_country as c";
240
-    	$sql.= " WHERE r.active = 1 AND r.fk_pays = c.rowid";
241
-    	$sql.= " AND c.code = '".$country_code."'";
242
-
243
-    	dol_syslog(get_class($this).'::select_revenue_stamp', LOG_DEBUG);
244
-    	$resql=$this->db->query($sql);
245
-    	if ($resql)
246
-    	{
247
-    		$out.='<select class="flat" name="'.$htmlname.'">';
248
-    		$num = $this->db->num_rows($resql);
249
-    		$i = 0;
250
-    		$out.='<option value="0">&nbsp;</option>'."\n";
251
-    		if ($num)
252
-    		{
253
-    			while ($i < $num)
254
-    			{
255
-    				$obj = $this->db->fetch_object($resql);
256
-    				if (($selected && $selected == $obj->taux) || $num == 1)
257
-    				{
258
-    					$out.='<option value="'.$obj->taux.($obj->revenuestamp_type == 'percent' ? '%' : '').'"'.($obj->revenuestamp_type == 'percent' ? ' data-type="percent"' : '').' selected>';
259
-    				}
260
-    				else
261
-    				{
262
-    					$out.='<option value="'.$obj->taux.($obj->revenuestamp_type == 'percent' ? '%' : '').'"'.($obj->revenuestamp_type == 'percent' ? ' data-type="percent"' : '').'>';
263
-    					//print '<option onmouseover="showtip(\''.$obj->libelle.'\')" onMouseout="hidetip()" value="'.$obj->rowid.'">';
264
-    				}
265
-    				$out.=$obj->taux.($obj->revenuestamp_type == 'percent' ? '%' : '');
266
-    				$out.='</option>';
267
-    				$i++;
268
-    			}
269
-    		}
270
-    		$out.='</select>';
271
-    		return $out;
272
-    	}
273
-    	else
274
-    	{
275
-    		dol_print_error($this->db);
276
-    		return '';
277
-    	}
234
+        global $langs;
235
+
236
+        $out='';
237
+
238
+        $sql = "SELECT r.taux, r.revenuestamp_type";
239
+        $sql.= " FROM ".MAIN_DB_PREFIX."c_revenuestamp as r,".MAIN_DB_PREFIX."c_country as c";
240
+        $sql.= " WHERE r.active = 1 AND r.fk_pays = c.rowid";
241
+        $sql.= " AND c.code = '".$country_code."'";
242
+
243
+        dol_syslog(get_class($this).'::select_revenue_stamp', LOG_DEBUG);
244
+        $resql=$this->db->query($sql);
245
+        if ($resql)
246
+        {
247
+            $out.='<select class="flat" name="'.$htmlname.'">';
248
+            $num = $this->db->num_rows($resql);
249
+            $i = 0;
250
+            $out.='<option value="0">&nbsp;</option>'."\n";
251
+            if ($num)
252
+            {
253
+                while ($i < $num)
254
+                {
255
+                    $obj = $this->db->fetch_object($resql);
256
+                    if (($selected && $selected == $obj->taux) || $num == 1)
257
+                    {
258
+                        $out.='<option value="'.$obj->taux.($obj->revenuestamp_type == 'percent' ? '%' : '').'"'.($obj->revenuestamp_type == 'percent' ? ' data-type="percent"' : '').' selected>';
259
+                    }
260
+                    else
261
+                    {
262
+                        $out.='<option value="'.$obj->taux.($obj->revenuestamp_type == 'percent' ? '%' : '').'"'.($obj->revenuestamp_type == 'percent' ? ' data-type="percent"' : '').'>';
263
+                        //print '<option onmouseover="showtip(\''.$obj->libelle.'\')" onMouseout="hidetip()" value="'.$obj->rowid.'">';
264
+                    }
265
+                    $out.=$obj->taux.($obj->revenuestamp_type == 'percent' ? '%' : '');
266
+                    $out.='</option>';
267
+                    $i++;
268
+                }
269
+            }
270
+            $out.='</select>';
271
+            return $out;
272
+        }
273
+        else
274
+        {
275
+            dol_print_error($this->db);
276
+            return '';
277
+        }
278 278
     }
279 279
 
280 280
 
@@ -369,8 +369,8 @@  discard block
 block discarded – undo
369 369
         }
370 370
         if ($nocateg)
371 371
         {
372
-        	$langs->load("categories");
373
-        	$moreforfilter.='<option value="-2"'.($selected == -2 ? ' selected':'').'>- '.$langs->trans("NotCategorized").' -</option>';
372
+            $langs->load("categories");
373
+            $moreforfilter.='<option value="-2"'.($selected == -2 ? ' selected':'').'>- '.$langs->trans("NotCategorized").' -</option>';
374 374
         }
375 375
         $moreforfilter.='</select>';
376 376
 
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
             $comboenhancement = ajax_combobox($htmlname);
406 406
             if ($comboenhancement)
407 407
             {
408
-            	$out.=$comboenhancement;
408
+                $out.=$comboenhancement;
409 409
             }
410 410
         }
411 411
         // Select each sales and print them in a select input
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
             $sql_usr.= " WHERE u2.entity IN (0,".$conf->entity.")";
428 428
             $sql_usr.= " AND u2.rowid = sc.fk_user AND sc.fk_soc=".$user->societe_id;
429 429
         }
430
-	    $sql_usr.= " ORDER BY statut DESC, lastname ASC";  // Do not use 'ORDER BY u.statut' here, not compatible with the UNION.
430
+        $sql_usr.= " ORDER BY statut DESC, lastname ASC";  // Do not use 'ORDER BY u.statut' here, not compatible with the UNION.
431 431
         //print $sql_usr;exit;
432 432
 
433 433
         $resql_usr = $this->db->query($sql_usr);
@@ -451,18 +451,18 @@  discard block
 block discarded – undo
451 451
                 }
452 452
                 if ($showstatus >= 0)
453 453
                 {
454
-					if ($obj_usr->statut == 1 && $showstatus == 1)
455
-					{
456
-						$out.=($moreinfo?' - ':' (').$langs->trans('Enabled');
457
-	                	$moreinfo++;
458
-					}
459
-					if ($obj_usr->statut == 0)
460
-					{
461
-						$out.=($moreinfo?' - ':' (').$langs->trans('Disabled');
462
-                		$moreinfo++;
463
-					}
464
-				}
465
-				$out.=($moreinfo?')':'');
454
+                    if ($obj_usr->statut == 1 && $showstatus == 1)
455
+                    {
456
+                        $out.=($moreinfo?' - ':' (').$langs->trans('Enabled');
457
+                        $moreinfo++;
458
+                    }
459
+                    if ($obj_usr->statut == 0)
460
+                    {
461
+                        $out.=($moreinfo?' - ':' (').$langs->trans('Disabled');
462
+                        $moreinfo++;
463
+                    }
464
+                }
465
+                $out.=($moreinfo?')':'');
466 466
                 $out.='</option>';
467 467
             }
468 468
             $this->db->free($resql_usr);
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
      * 	@param	int		$mode					0=Return list of tasks and their projects, 1=Return projects and tasks if exists
488 488
      *  @param  int		$useempty       		0=Allow empty values
489 489
      *  @param	int		$disablechildoftaskid	1=Disable task that are child of the provided task id
490
-	 *  @param	string	$filteronprojstatus		Filter on project status ('-1'=no filter, '0,1'=Draft+Validated status)
490
+     *  @param	string	$filteronprojstatus		Filter on project status ('-1'=no filter, '0,1'=Draft+Validated status)
491 491
      *  @param	string	$morecss				More css
492 492
      *  @return	void
493 493
      */
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
         $tasksarray=$task->getTasksArray($modetask?$user:0, $modeproject?$user:0, $projectid, 0, $mode, '', $filteronprojstatus);
503 503
         if ($tasksarray)
504 504
         {
505
-        	print '<select class="flat'.($morecss?' '.$morecss:'').'" name="'.$htmlname.'" id="'.$htmlname.'">';
505
+            print '<select class="flat'.($morecss?' '.$morecss:'').'" name="'.$htmlname.'" id="'.$htmlname.'">';
506 506
             if ($useempty) print '<option value="0">&nbsp;</option>';
507 507
             $j=0;
508 508
             $level=0;
@@ -538,11 +538,11 @@  discard block
 block discarded – undo
538 538
         $numlines=count($lines);
539 539
         for ($i = 0 ; $i < $numlines ; $i++)
540 540
         {
541
-        	if ($lines[$i]->fk_parent == $parent)
541
+            if ($lines[$i]->fk_parent == $parent)
542 542
             {
543 543
                 $var = !$var;
544 544
 
545
-				//var_dump($selectedproject."--".$selectedtask."--".$lines[$i]->fk_project."_".$lines[$i]->id);		// $lines[$i]->id may be empty if project has no lines
545
+                //var_dump($selectedproject."--".$selectedtask."--".$lines[$i]->fk_project."_".$lines[$i]->id);		// $lines[$i]->id may be empty if project has no lines
546 546
 
547 547
                 // Break on a new project
548 548
                 if ($parent == 0)	// We are on a task at first level
@@ -575,13 +575,13 @@  discard block
 block discarded – undo
575 575
                 // Print task
576 576
                 if (isset($lines[$i]->id))		// We use isset because $lines[$i]->id may be null if project has no task and are on root project (tasks may be caught by a left join). We enter here only if '0' or >0
577 577
                 {
578
-                	// Check if we must disable entry
579
-                	$disabled=0;
580
-                	if ($disablechildoftaskid && (($lines[$i]->id == $disablechildoftaskid || $lines[$i]->fk_parent == $disablechildoftaskid)))
581
-                	{
582
-               			$disabled++;
583
-               			if ($lines[$i]->fk_parent == $disablechildoftaskid) $newdisablechildoftaskid=$lines[$i]->id;	// If task is child of a disabled parent, we will propagate id to disable next child too
584
-                	}
578
+                    // Check if we must disable entry
579
+                    $disabled=0;
580
+                    if ($disablechildoftaskid && (($lines[$i]->id == $disablechildoftaskid || $lines[$i]->fk_parent == $disablechildoftaskid)))
581
+                    {
582
+                            $disabled++;
583
+                            if ($lines[$i]->fk_parent == $disablechildoftaskid) $newdisablechildoftaskid=$lines[$i]->id;	// If task is child of a disabled parent, we will propagate id to disable next child too
584
+                    }
585 585
 
586 586
                     print '<option value="'.$lines[$i]->fk_project.'_'.$lines[$i]->id.'"';
587 587
                     if (($lines[$i]->id == $selectedtask) || ($lines[$i]->fk_project.'_'.$lines[$i]->id == $selectedtask)) print ' selected';
@@ -624,14 +624,14 @@  discard block
 block discarded – undo
624 624
      */
625 625
     static function showColor($color, $textifnotdefined='')
626 626
     {
627
-    	$textcolor='FFF';
628
-    	include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
629
-    	if(colorIsLight($color)) $textcolor='000';
627
+        $textcolor='FFF';
628
+        include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
629
+        if(colorIsLight($color)) $textcolor='000';
630 630
 
631
-    	$color = colorArrayToHex(colorStringToArray($color,array()),'');
631
+        $color = colorArrayToHex(colorStringToArray($color,array()),'');
632 632
 
633
-		if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; color: #'.$textcolor.'; background-color: #'.$color.'" value="'.$color.'">';
634
-		else print $textifnotdefined;
633
+        if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; color: #'.$textcolor.'; background-color: #'.$color.'" value="'.$color.'">';
634
+        else print $textifnotdefined;
635 635
     }
636 636
 
637 637
     // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
@@ -650,7 +650,7 @@  discard block
 block discarded – undo
650 650
     function select_color($set_color='', $prefix='f_color', $form_name='', $showcolorbox=1, $arrayofcolors='')
651 651
     {
652 652
         // phpcs:enable
653
-    	print $this->selectColor($set_color, $prefix, $form_name, $showcolorbox, $arrayofcolors);
653
+        print $this->selectColor($set_color, $prefix, $form_name, $showcolorbox, $arrayofcolors);
654 654
     }
655 655
 
656 656
     /**
@@ -667,10 +667,10 @@  discard block
 block discarded – undo
667 667
      */
668 668
     static function selectColor($set_color='', $prefix='f_color', $form_name='', $showcolorbox=1, $arrayofcolors='', $morecss='')
669 669
     {
670
-	    // Deprecation warning
671
-	    if ($form_name) {
672
-		    dol_syslog(__METHOD__ . ": form_name parameter is deprecated", LOG_WARNING);
673
-	    }
670
+        // Deprecation warning
671
+        if ($form_name) {
672
+            dol_syslog(__METHOD__ . ": form_name parameter is deprecated", LOG_WARNING);
673
+        }
674 674
 
675 675
         global $langs,$conf;
676 676
 
@@ -681,9 +681,9 @@  discard block
 block discarded – undo
681 681
             $langs->load("other");
682 682
             if (empty($conf->dol_use_jmobile))
683 683
             {
684
-	            $out.= '<link rel="stylesheet" media="screen" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/jpicker/css/jPicker-1.1.6.css" />';
685
-	            $out.= '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jpicker/jpicker-1.1.6.js"></script>';
686
-	            $out.= '<script type="text/javascript">
684
+                $out.= '<link rel="stylesheet" media="screen" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/jpicker/css/jPicker-1.1.6.css" />';
685
+                $out.= '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jpicker/jpicker-1.1.6.js"></script>';
686
+                $out.= '<script type="text/javascript">
687 687
 	             jQuery(document).ready(function(){
688 688
 	                $(\'#colorpicker'.$prefix.'\').jPicker( {
689 689
 	                window: {
@@ -727,9 +727,9 @@  discard block
 block discarded – undo
727 727
         {
728 728
             if (empty($conf->dol_use_jmobile))
729 729
             {
730
-	        	$out.= '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/colorpicker/jquery.colorpicker.css" type="text/css" media="screen" />';
731
-	            $out.= '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/colorpicker/jquery.colorpicker.js" type="text/javascript"></script>';
732
-	            $out.= '<script type="text/javascript">
730
+                $out.= '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/colorpicker/jquery.colorpicker.css" type="text/css" media="screen" />';
731
+                $out.= '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/colorpicker/jquery.colorpicker.js" type="text/javascript"></script>';
732
+                $out.= '<script type="text/javascript">
733 733
 	             jQuery(document).ready(function(){
734 734
 	                 jQuery(\'#colorpicker'.$prefix.'\').colorpicker({
735 735
 	                     size: 14,
@@ -930,7 +930,7 @@  discard block
 block discarded – undo
930 930
         $out.= '<select class="flat'.($morecss?' '.$morecss:'').'" id="' . $htmlname . '" name="' . $htmlname . '"'.$option.' >';
931 931
         if($useempty)
932 932
         {
933
-        	$selected_html='';
933
+            $selected_html='';
934 934
             if ($selected == '') $selected_html = ' selected';
935 935
             $out.= '<option value=""' . $selected_html . '>&nbsp;</option>';
936 936
         }
@@ -1029,55 +1029,55 @@  discard block
 block discarded – undo
1029 1029
         $boxidactivatedforuser=array();
1030 1030
         foreach($boxactivated as $box)
1031 1031
         {
1032
-        	if (empty($user->conf->$confuserzone) || $box->fk_user == $user->id) $boxidactivatedforuser[$box->id]=$box->id;	// We keep only boxes to show for user
1032
+            if (empty($user->conf->$confuserzone) || $box->fk_user == $user->id) $boxidactivatedforuser[$box->id]=$box->id;	// We keep only boxes to show for user
1033 1033
         }
1034 1034
 
1035 1035
         // Define selectboxlist
1036 1036
         $arrayboxtoactivatelabel=array();
1037 1037
         if (! empty($user->conf->$confuserzone))
1038 1038
         {
1039
-        	$boxorder='';
1040
-        	$langs->load("boxes");	// Load label of boxes
1041
-        	foreach($boxactivated as $box)
1042
-        	{
1043
-        		if (! empty($boxidactivatedforuser[$box->id])) continue;	// Already visible for user
1044
-        		$label=$langs->transnoentitiesnoconv($box->boxlabel);
1045
-        		//if (preg_match('/graph/',$box->class)) $label.=' ('.$langs->trans("Graph").')';
1046
-        		if (preg_match('/graph/',$box->class) && $conf->browser->layout != 'phone')
1047
-        		{
1048
-        			$label=$label.' <span class="fa fa-bar-chart"></span>';
1049
-        		}
1050
-        		$arrayboxtoactivatelabel[$box->id]=$label;			// We keep only boxes not shown for user, to show into combo list
1051
-        	}
1039
+            $boxorder='';
1040
+            $langs->load("boxes");	// Load label of boxes
1041
+            foreach($boxactivated as $box)
1042
+            {
1043
+                if (! empty($boxidactivatedforuser[$box->id])) continue;	// Already visible for user
1044
+                $label=$langs->transnoentitiesnoconv($box->boxlabel);
1045
+                //if (preg_match('/graph/',$box->class)) $label.=' ('.$langs->trans("Graph").')';
1046
+                if (preg_match('/graph/',$box->class) && $conf->browser->layout != 'phone')
1047
+                {
1048
+                    $label=$label.' <span class="fa fa-bar-chart"></span>';
1049
+                }
1050
+                $arrayboxtoactivatelabel[$box->id]=$label;			// We keep only boxes not shown for user, to show into combo list
1051
+            }
1052 1052
             foreach($boxidactivatedforuser as $boxid)
1053
-        	{
1054
-       			if (empty($boxorder)) $boxorder.='A:';
1055
-  				$boxorder.=$boxid.',';
1056
-        	}
1057
-
1058
-        	//var_dump($boxidactivatedforuser);
1059
-
1060
-        	// Class Form must have been already loaded
1061
-        	$selectboxlist.='<!-- Form with select box list -->'."\n";
1062
-			$selectboxlist.='<form id="addbox" name="addbox" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
1063
-			$selectboxlist.='<input type="hidden" name="addbox" value="addbox">';
1064
-			$selectboxlist.='<input type="hidden" name="userid" value="'.$user->id.'">';
1065
-			$selectboxlist.='<input type="hidden" name="areacode" value="'.$areacode.'">';
1066
-			$selectboxlist.='<input type="hidden" name="boxorder" value="'.$boxorder.'">';
1067
-			$selectboxlist.=Form::selectarray('boxcombo', $arrayboxtoactivatelabel, -1, $langs->trans("ChooseBoxToAdd").'...', 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth150onsmartphone', 0, 'hidden selected', 0, 1);
1053
+            {
1054
+                    if (empty($boxorder)) $boxorder.='A:';
1055
+                    $boxorder.=$boxid.',';
1056
+            }
1057
+
1058
+            //var_dump($boxidactivatedforuser);
1059
+
1060
+            // Class Form must have been already loaded
1061
+            $selectboxlist.='<!-- Form with select box list -->'."\n";
1062
+            $selectboxlist.='<form id="addbox" name="addbox" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
1063
+            $selectboxlist.='<input type="hidden" name="addbox" value="addbox">';
1064
+            $selectboxlist.='<input type="hidden" name="userid" value="'.$user->id.'">';
1065
+            $selectboxlist.='<input type="hidden" name="areacode" value="'.$areacode.'">';
1066
+            $selectboxlist.='<input type="hidden" name="boxorder" value="'.$boxorder.'">';
1067
+            $selectboxlist.=Form::selectarray('boxcombo', $arrayboxtoactivatelabel, -1, $langs->trans("ChooseBoxToAdd").'...', 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth150onsmartphone', 0, 'hidden selected', 0, 1);
1068 1068
             if (empty($conf->use_javascript_ajax)) $selectboxlist.=' <input type="submit" class="button" value="'.$langs->trans("AddBox").'">';
1069 1069
             $selectboxlist.='</form>';
1070 1070
             if (! empty($conf->use_javascript_ajax))
1071 1071
             {
1072
-            	include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1073
-            	$selectboxlist.=ajax_combobox("boxcombo");
1072
+                include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1073
+                $selectboxlist.=ajax_combobox("boxcombo");
1074 1074
             }
1075 1075
         }
1076 1076
 
1077 1077
         // Javascript code for dynamic actions
1078 1078
         if (! empty($conf->use_javascript_ajax))
1079 1079
         {
1080
-	        $selectboxlist.='<script type="text/javascript" language="javascript">
1080
+            $selectboxlist.='<script type="text/javascript" language="javascript">
1081 1081
 
1082 1082
 	        // To update list of activated boxes
1083 1083
 	        function updateBoxOrder(closing) {
@@ -1116,8 +1116,8 @@  discard block
 block discarded – undo
1116 1116
 	        			window.location.search=\'mainmenu='.GETPOST("mainmenu","aZ09").'&leftmenu='.GETPOST('leftmenu',"aZ09").'&action=addbox&boxid=\'+boxid;
1117 1117
 	                }
1118 1118
 	        	});';
1119
-	        	if (! count($arrayboxtoactivatelabel)) $selectboxlist.='jQuery("#boxcombo").hide();';
1120
-	        	$selectboxlist.='
1119
+                if (! count($arrayboxtoactivatelabel)) $selectboxlist.='jQuery("#boxcombo").hide();';
1120
+                $selectboxlist.='
1121 1121
 
1122 1122
 	        	jQuery("#boxhalfleft, #boxhalfright").sortable({
1123 1123
 	    	    	handle: \'.boxhandle\',
@@ -1142,7 +1142,7 @@  discard block
 block discarded – undo
1142 1142
 
1143 1143
         	});'."\n";
1144 1144
 
1145
-	        $selectboxlist.='</script>'."\n";
1145
+            $selectboxlist.='</script>'."\n";
1146 1146
         }
1147 1147
 
1148 1148
         // Define boxlista and boxlistb
@@ -1150,10 +1150,10 @@  discard block
 block discarded – undo
1150 1150
 
1151 1151
         if ($nbboxactivated)
1152 1152
         {
1153
-        	// Load translation files required by the page
1153
+            // Load translation files required by the page
1154 1154
             $langs->loadLangs(array("boxes","projects"));
1155 1155
 
1156
-        	$emptybox=new ModeleBoxes($db);
1156
+            $emptybox=new ModeleBoxes($db);
1157 1157
 
1158 1158
             $boxlista.="\n<!-- Box left container -->\n";
1159 1159
 
@@ -1164,9 +1164,9 @@  discard block
 block discarded – undo
1164 1164
             $ii=0;
1165 1165
             foreach ($boxactivated as $key => $box)
1166 1166
             {
1167
-            	if ((! empty($user->conf->$confuserzone) && $box->fk_user == 0) || (empty($user->conf->$confuserzone) && $box->fk_user != 0)) continue;
1168
-				if (empty($box->box_order) && $ii < ($nbboxactivated / 2)) $box->box_order='A'.sprintf("%02d",($ii+1));	// When box_order was not yet set to Axx or Bxx and is still 0
1169
-            	if (preg_match('/^A/i',$box->box_order)) // column A
1167
+                if ((! empty($user->conf->$confuserzone) && $box->fk_user == 0) || (empty($user->conf->$confuserzone) && $box->fk_user != 0)) continue;
1168
+                if (empty($box->box_order) && $ii < ($nbboxactivated / 2)) $box->box_order='A'.sprintf("%02d",($ii+1));	// When box_order was not yet set to Axx or Bxx and is still 0
1169
+                if (preg_match('/^A/i',$box->box_order)) // column A
1170 1170
                 {
1171 1171
                     $ii++;
1172 1172
                     //print 'box_id '.$boxactivated[$ii]->box_id.' ';
@@ -1179,10 +1179,10 @@  discard block
 block discarded – undo
1179 1179
 
1180 1180
             if ($conf->browser->layout != 'phone')
1181 1181
             {
1182
-            	$emptybox->box_id='A';
1183
-            	$emptybox->info_box_head=array();
1184
-            	$emptybox->info_box_contents=array();
1185
-            	$boxlista.= $emptybox->outputBox(array(),array());
1182
+                $emptybox->box_id='A';
1183
+                $emptybox->info_box_head=array();
1184
+                $emptybox->info_box_contents=array();
1185
+                $boxlista.= $emptybox->outputBox(array(),array());
1186 1186
             }
1187 1187
             $boxlista.= "<!-- End box left container -->\n";
1188 1188
 
@@ -1191,9 +1191,9 @@  discard block
 block discarded – undo
1191 1191
             $ii=0;
1192 1192
             foreach ($boxactivated as $key => $box)
1193 1193
             {
1194
-            	if ((! empty($user->conf->$confuserzone) && $box->fk_user == 0) || (empty($user->conf->$confuserzone) && $box->fk_user != 0)) continue;
1195
-            	if (empty($box->box_order) && $ii < ($nbboxactivated / 2)) $box->box_order='B'.sprintf("%02d",($ii+1));	// When box_order was not yet set to Axx or Bxx and is still 0
1196
-            	if (preg_match('/^B/i',$box->box_order)) // colonne B
1194
+                if ((! empty($user->conf->$confuserzone) && $box->fk_user == 0) || (empty($user->conf->$confuserzone) && $box->fk_user != 0)) continue;
1195
+                if (empty($box->box_order) && $ii < ($nbboxactivated / 2)) $box->box_order='B'.sprintf("%02d",($ii+1));	// When box_order was not yet set to Axx or Bxx and is still 0
1196
+                if (preg_match('/^B/i',$box->box_order)) // colonne B
1197 1197
                 {
1198 1198
                     $ii++;
1199 1199
                     //print 'box_id '.$boxactivated[$ii]->box_id.' ';
@@ -1206,10 +1206,10 @@  discard block
 block discarded – undo
1206 1206
 
1207 1207
             if ($conf->browser->layout != 'phone')
1208 1208
             {
1209
-            	$emptybox->box_id='B';
1210
-            	$emptybox->info_box_head=array();
1211
-            	$emptybox->info_box_contents=array();
1212
-            	$boxlistb.= $emptybox->outputBox(array(),array());
1209
+                $emptybox->box_id='B';
1210
+                $emptybox->info_box_head=array();
1211
+                $emptybox->info_box_contents=array();
1212
+                $boxlistb.= $emptybox->outputBox(array(),array());
1213 1213
             }
1214 1214
 
1215 1215
             $boxlistb.= "<!-- End box right container -->\n";
@@ -1275,7 +1275,7 @@  discard block
 block discarded – undo
1275 1275
                 print "</select>";
1276 1276
             }
1277 1277
             else
1278
-			{
1278
+            {
1279 1279
                 print $langs->trans("DictionaryEmpty");
1280 1280
             }
1281 1281
         }
Please login to merge, or discard this patch.