From 989f285d32a03c7f43dccaa0cf6b7654ee533fe6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Oct 2017 01:23:07 +0200 Subject: [PATCH] Replace table with div --- htdocs/admin/delais.php | 217 ++++++++++++++++------------------------ 1 file changed, 86 insertions(+), 131 deletions(-) diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 0d9e80f5326..37f66427225 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -136,10 +136,10 @@ if ($action == 'update') } } } - + dolibarr_set_const($db, "MAIN_DISABLE_METEO",$_POST["MAIN_DISABLE_METEO"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_USE_METEO_WITH_PERCENTAGE",GETPOST("MAIN_USE_METEO_WITH_PERCENTAGE"),'chaine',0,'',$conf->entity); - + // For update value with percentage $plus=''; if(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) $plus = '_PERCENTAGE'; @@ -147,7 +147,7 @@ if ($action == 'update') for($i=0;$i<4;$i++) { if(isset($_POST['MAIN_METEO'.$plus.'_LEVEL'.$i])) dolibarr_set_const($db, 'MAIN_METEO'.$plus.'_LEVEL'.$i, GETPOST('MAIN_METEO'.$plus.'_LEVEL'.$i, 'int'),'chaine',0,'',$conf->entity); } - + } @@ -249,26 +249,26 @@ else } -print '
'; +print '
'; // Show logo for weather print $langs->trans("DescWeather").'
'; if($action == 'edit') { - + $str_mode_std = $langs->trans('MeteoStdModEnabled').' : '.$langs->trans('MeteoUseMod', $langs->trans('MeteoPercentageMod')); $str_mode_percentage = $langs->trans('MeteoPercentageModEnabled').' : '.$langs->trans('MeteoUseMod', $langs->trans('MeteoStdMod')); if(empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) $str_mode_enabled = $str_mode_std; else $str_mode_enabled = $str_mode_percentage; print ''.$str_mode_enabled.''; print ''; - - print '

'; - + + print '

'; + } else { if(empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) print $langs->trans('MeteoStdModEnabled'); else print $langs->trans('MeteoPercentageModEnabled'); - print '

'; + print '

'; } $offset=0; @@ -279,88 +279,63 @@ $level0=$offset; if (! empty($conf->global->MAIN_METEO_LEVEL0)) $level $level1=$offset+1*$cursor; if (! empty($conf->global->MAIN_METEO_LEVEL1)) $level1=$conf->global->MAIN_METEO_LEVEL1; $level2=$offset+2*$cursor; if (! empty($conf->global->MAIN_METEO_LEVEL2)) $level2=$conf->global->MAIN_METEO_LEVEL2; $level3=$offset+3*$cursor; if (! empty($conf->global->MAIN_METEO_LEVEL3)) $level3=$conf->global->MAIN_METEO_LEVEL3; -$text=''; $options='height="60px"'; - +$text=''; $options='class="valignmiddle" height="60px"'; + + +if ($action == 'edit') { + -if($action == 'edit') { - - print '
global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '' : 'style="display:none;"').'>'; - - print ''; - print ''; - print ''; - print ''; - print ''; + print '
'; print img_weather($text,'weather-few-clouds.png',$options); - print '
'; - print ''; - print ''; + print '
'; print img_weather($text,'weather-clouds.png',$options); - print '
'; - print ''; - - print ''; + print '
'; print img_weather($text,'weather-many-clouds.png',$options); - print '
'; - print ''; - /*print '';*/ - print ''; - print ''; - print ''; - print ''; - - print '
'; - print img_weather($text,'weather-clear.png',$options); - print '=         '; + + print '
'; + print '
'; + print img_weather($text,'weather-clear.png', $options); + print '=
<=         '; + print '<= <=
'; + print '<= <=         '; - print img_weather($text,'weather-storm.png',$options); - print '> '.$level3.'                        
'; - + print '<= '; print '
'; + print ''; + + print ''; + print '
global->MAIN_USE_METEO_WITH_PERCENTAGE) ? 'style="display:none;"' : '').'>'; - - print ''; - print ''; - print ''; - print ''; - print ''; + print '
'; print img_weather($text,'weather-few-clouds.png',$options); - print '
'; - print ''; - print ''; + print '
'; print img_weather($text,'weather-clouds.png',$options); - print '
'; - print ''; - - print ''; + print '
'; print img_weather($text,'weather-many-clouds.png',$options); - print '
'; - print ''; - /*print '';*/ - print ''; - print ''; - print ''; - print ''; - - print '
'; + + print '
'; + print '
'; print img_weather($text,'weather-clear.png',$options); - print '
=  %         '; + print '=  %<=  %         '; + print '<=  %<=  %
'; + print '<=  %<=  %         '; - print img_weather($text,'weather-storm.png',$options); - print '> '.$level3.'                        
'; - + print '<=  %'; print '
'; - + print ''; + + print ''; + ?> - + global->MAIN_USE_METEO_WITH_PERCENTAGE)) { - - print ''; - print ''; - print ''; - print ''; - print ''; + print '
'; print img_weather($text,'weather-few-clouds.png',$options); - print '
'; - print ''; - print ''; + print '
'; print img_weather($text,'weather-clouds.png',$options); - print '
'; - print ''; - - print ''; + print '
'; print img_weather($text,'weather-many-clouds.png',$options); - print '
'; - print ''; - print ''; + print '
'; print img_weather($text,'weather-storm.png',$options); - print '
'; - print ''; - print ''; - print ''; - print ''; - - print '
'; + + print '
'; + print '
'; print img_weather($text,'weather-clear.png',$options); - print '
= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL0.' %         '; + print '= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL0.' %<= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL1.' %         '; + print '<= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL1.' %<= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL2.' %
'; + print '<= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL2.' %<= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL3.' %         '; + print '<= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL3.' %> '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL3.' %                        
'; - + print '> '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL3.' %'; + print ''; + print ''; + } else { - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - print '
'; + + print '
'; + print '
'; print img_weather($text,'weather-clear.png',$options); - print '
= '.$level0.'         '; + print '= '.$level0; + print '
'; print img_weather($text,'weather-few-clouds.png',$options); - print '
<= '.$level1.'         '; + print '<= '.$level1; + print '
'; print img_weather($text,'weather-clouds.png',$options); - print '
<= '.$level2.'
'; + print '<= '.$level2; + print '
'; print img_weather($text,'weather-many-clouds.png',$options); - print '
<= '.$level3.'         '; + print '<= '.$level3; + print '
'; print img_weather($text,'weather-storm.png',$options); - print '
> '.$level3.'                        
'; - + print '> '.$level3; + print ''; + print ''; + } } print ''; - + if($action == 'edit') { - + print '
'; print '
'; - + } else { - + // Boutons d'action print '
'; print ''.$langs->trans("Modify").'
'; - + } llxFooter();