diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index 6807e75ba80..67693b83c6b 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -1029,7 +1029,7 @@ class ExtraFields
{
$morecss = 'minwidth100imp';
}
- elseif ($type == 'datetime')
+ elseif ($type == 'datetime' || $type == 'link')
{
$morecss = 'minwidth200imp';
}
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 7750e62c506..90583e1d4e4 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -1122,13 +1122,20 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
{
global $conf, $langs, $hookmanager;
- $out="\n".'
'."\n";
-
- if ($morehtmlright) $out.='
'.$morehtmlright.'
'; // Output right area first so when space is missing, text is in front of tabs and not under.
-
// Show title
$showtitle=1;
if (! empty($conf->dol_optimize_smallscreen)) $showtitle=0;
+
+ $out = "\n".'';
+
+ if ((! empty($title) && $showtitle) || $morehtmlright || ! empty($links)) {
+ $out.= '
'."\n";
+ }
+
+ // Show right part
+ if ($morehtmlright) $out.='
'.$morehtmlright.'
'; // Output right area first so when space is missing, text is in front of tabs and not under.
+
+ // Show title
if (! empty($title) && $showtitle)
{
$limittitle=30;
@@ -1138,6 +1145,8 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
$out.='';
}
+ // Show tabs
+
// Define max of key (max may be higher than sizeof because of hole due to module disabling some tabs).
$maxkey=-1;
if (is_array($links) && ! empty($links))
@@ -1149,16 +1158,15 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
if (! empty($conf->dol_optimize_smallscreen)) $conf->global->MAIN_MAXTABS_IN_CARD=2;
// Show tabs
- $bactive=false;
// if =0 we don't use the feature
$limittoshow=(empty($conf->global->MAIN_MAXTABS_IN_CARD)?99:$conf->global->MAIN_MAXTABS_IN_CARD);
$displaytab=0;
$nbintab=0;
- $popuptab=0; $outmore='';
+ $popuptab=0;
+ $outmore='';
for ($i = 0 ; $i <= $maxkey ; $i++)
{
- if ((is_numeric($active) && $i == $active) || (! empty($links[$i][2]) && ! is_numeric($active) && $active == $links[$i][2]))
- {
+ if ((is_numeric($active) && $i == $active) || (! empty($links[$i][2]) && ! is_numeric($active) && $active == $links[$i][2])) {
// If active tab is already present
if ($i >= $limittoshow) $limittoshow--;
}
@@ -1166,13 +1174,10 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
for ($i = 0 ; $i <= $maxkey ; $i++)
{
- if ((is_numeric($active) && $i == $active) || (! empty($links[$i][2]) && ! is_numeric($active) && $active == $links[$i][2]))
- {
+ if ((is_numeric($active) && $i == $active) || (! empty($links[$i][2]) && ! is_numeric($active) && $active == $links[$i][2])) {
$isactive=true;
- $bactive=true;
}
- else
- {
+ else {
$isactive=false;
}
@@ -1258,7 +1263,9 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
$out.="";
}
- $out.="
\n";
+ if ((! empty($title) && $showtitle) || $morehtmlright || ! empty($links)) {
+ $out.="
\n";
+ }
if (! $notab || $notab == -1 || $notab == -2) $out.="\n".''."\n";
diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php
index 06cd96ab995..a177b3f13c0 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -1996,6 +1996,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
* @param hideOnProgressNull $hideOnProgressNull bool hide if progress is null
* @param spaced $spaced bool used to add space at bottom (made by css)
* @return string
+ * @see getTaskProgressBadge()
*/
function getTaskProgressView($task, $label = true, $progressNumber = true, $hideOnProgressNull = false, $spaced = false)
{
@@ -2033,7 +2034,7 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide
$title = $langs->trans('TheReportedProgressIsLessThanTheCalculatedProgressionByX', abs($task->progress-$progressCalculated).' '.$langs->trans("point"));
$diff = '
'.($task->progress-$progressCalculated).'%';
}
- elseif (doubleval($progressCalculated) > doubleval($task->progress)) { // warning if close at 1%
+ elseif (doubleval($progressCalculated) > doubleval($task->progress)) { // warning if close at 10%
$progressBarClass = 'progress-bar-warning';
$title = $langs->trans('TheReportedProgressIsLessThanTheCalculatedProgressionByX', abs($task->progress-$progressCalculated).' '.$langs->trans("point"));
$diff = '
'.($task->progress-$progressCalculated).'%';
@@ -2116,6 +2117,7 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide
* @param label $label string empty = auto (progress), string = replace output
* @param tooltip $tooltip string empty = auto , string = replace output
* @return string
+ * @see getTaskProgressView()
*/
function getTaskProgressBadge($task, $label = '', $tooltip = '')
{
@@ -2135,10 +2137,10 @@ function getTaskProgressBadge($task, $label = '', $tooltip = '')
// this conf is actually hidden, by default we use 10% for "be carefull or warning"
$warningRatio = !empty($conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT) ? (1 + $conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT / 100) : 1.10;
- if($progressCalculated > doubleval($task->progress)){
+ if (doubleval($progressCalculated) > doubleval($task->progress * $warningRatio)) {
$badgeClass.= 'badge-danger';
}
- elseif($progressCalculated * $warningRatio >= doubleval($task->progress)){ // warning if close at 1%
+ elseif (doubleval($progressCalculated) > doubleval($task->progress)) { // warning if close at 10%
$badgeClass.= 'badge-warning';
}
else{
diff --git a/htdocs/mrp/index.php b/htdocs/mrp/index.php
index 742d94109e2..9abb940283e 100644
--- a/htdocs/mrp/index.php
+++ b/htdocs/mrp/index.php
@@ -163,7 +163,7 @@ if ($resql)
print '
';
print '| '.$staticbom->getNomUrl(1, 32).' | ';
print ''.dol_print_date($db->jdate($obj->datem), 'dayhour').' | ';
- print ''.$staticbom->getLibStatut(5).' | ';
+ print ''.$staticbom->getLibStatut(3).' | ';
print '
';
$i++;
}
@@ -216,7 +216,7 @@ if ($resql)
print '
';
print '| '.$staticmo->getNomUrl(1, 32).' | ';
print ''.dol_print_date($db->jdate($obj->datem), 'dayhour').' | ';
- print ''.$staticmo->getLibStatut(5).' | ';
+ print ''.$staticmo->getLibStatut(3).' | ';
print '
';
$i++;
}
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index f15499d4682..e4a8dd078ec 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -509,7 +509,7 @@ if ($action == 'create' && $user->rights->projet->creer)
dol_fiche_head();
- print '
';
+ print '';
$defaultref='';
$modele = empty($conf->global->PROJECT_ADDON)?'mod_project_simple':$conf->global->PROJECT_ADDON;
diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php
index c16d42ae97c..be8a924e1ab 100644
--- a/htdocs/projet/index.php
+++ b/htdocs/projet/index.php
@@ -171,7 +171,7 @@ print_projecttasks_array($db, $form, $socid, $projectsListId, 0, 0, $listofoppst
print '';
-// Last modified projects
+// Latest modified projects
$sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut, p.tms as datem,";
$sql.= " s.rowid as socid, s.nom as name, s.email, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.canvas";
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
@@ -243,7 +243,7 @@ if ($resql)
}
print '';
print '
'.dol_print_date($db->jdate($obj->datem), 'day').' | ';
- print ''.$projectstatic->LibStatut($obj->fk_statut, 5).' | ';
+ print ''.$projectstatic->LibStatut($obj->fk_statut, 3).' | ';
print '';
$i++;
}