diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 5c314226214..f2aab587169 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3531,6 +3531,8 @@ class Commande extends CommonOrder $billedtext = ''; if (empty($donotshowbilled)) $billedtext .= ($billed ? ' - '.$langs->trans("Billed") : ''); + $labelTooltip = ''; + if ($status == self::STATUS_CANCELED) { $labelStatus = $langs->trans('StatusOrderCanceled'); $labelStatusShort = $langs->trans('StatusOrderCanceledShort'); @@ -3544,8 +3546,9 @@ class Commande extends CommonOrder $labelStatusShort = $langs->trans('StatusOrderValidatedShort').$billedtext; $statusType = 'status1'; } elseif ($status == self::STATUS_SHIPMENTONPROCESS) { - $labelStatus = $langs->trans('StatusOrderSentShort').$billedtext; + $labelStatus = $langs->trans('StatusOrderSent').$billedtext; $labelStatusShort = $langs->trans('StatusOrderSentShort').$billedtext; + $labelTooltip = $langs->trans("StatusOrderSent").' - '.$langs->trans("DateDeliveryPlanned").dol_print_date($this->date_livraison).$billedtext; $statusType = 'status4'; } elseif ($status == self::STATUS_CLOSED && (!$billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) { $labelStatus = $langs->trans('StatusOrderToBill'); @@ -3553,11 +3556,11 @@ class Commande extends CommonOrder $statusType = 'status4'; } elseif ($status == self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) { $labelStatus = $langs->trans('StatusOrderProcessed').$billedtext; - $labelStatusShort = $langs->trans('StatusOrderProcessed').$billedtext; + $labelStatusShort = $langs->trans('StatusOrderProcessedShort').$billedtext; $statusType = 'status6'; } elseif ($status == self::STATUS_CLOSED && (!empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) { $labelStatus = $langs->trans('StatusOrderDelivered'); - $labelStatusShort = $langs->trans('StatusOrderDelivered'); + $labelStatusShort = $langs->trans('StatusOrderDeliveredShort'); $statusType = 'status6'; } else { $labelStatus = $langs->trans('Unknown'); @@ -3566,7 +3569,7 @@ class Commande extends CommonOrder $mode = 0; } - return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode); + return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode, '', array('tooltip' => $labelTooltip)); } diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index c30a60424a6..eaf944ff968 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -46,7 +46,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; // Load translation files required by the page -$langs->loadLangs(array("orders", 'sendings', 'deliveries', 'companies', 'compta', 'bills')); +$langs->loadLangs(array("orders", 'sendings', 'deliveries', 'companies', 'compta', 'bills', 'stocks')); $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); @@ -680,9 +680,9 @@ if ($resql) print ''; } // Town - if (!empty($arrayfields['s.town']['checked'])) print ''; + if (!empty($arrayfields['s.town']['checked'])) print ''; // Zip - if (!empty($arrayfields['s.zip']['checked'])) print ''; + if (!empty($arrayfields['s.zip']['checked'])) print ''; // State if (!empty($arrayfields['state.nom']['checked'])) { @@ -905,6 +905,7 @@ if ($resql) $total = 0; $subtotal = 0; $productstat_cache = array(); + $productstat_cachevirtual = array(); $getNomUrl_cache = array(); $generic_commande = new Commande($db); @@ -962,7 +963,6 @@ if ($resql) // Show shippable Icon (create subloop, so may be slow) if ($conf->stock->enabled) { - $langs->load("stocks"); if (($obj->fk_statut > 0) && ($obj->fk_statut < 3)) { $numlines = count($generic_commande->lines); // Loop on each line of order @@ -986,16 +986,16 @@ if ($resql) if (empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) // Default code. Default is when this option is not set, setting it create strange result { - $text_info .= $generic_commande->lines[$lig]->qty.' X '.$generic_commande->lines[$lig]->ref.' '.dol_trunc($generic_commande->lines[$lig]->product_label, 25); - $text_info .= ' - '.$langs->trans("Stock").': '.$generic_product->stock_reel; - $text_info .= ' - '.$langs->trans("VirtualStock").': '.$generic_product->stock_theorique; + $text_info .= $generic_commande->lines[$lig]->qty.' X '.$generic_commande->lines[$lig]->product_ref.' '.dol_trunc($generic_commande->lines[$lig]->product_label, 25); + $text_info .= ' - '.$langs->trans("Stock").': '.$generic_product->stock_reel.''; + $text_info .= ' - '.$langs->trans("VirtualStock").': '.$generic_product->stock_theorique.''; $text_info .= '
'; if ($generic_commande->lines[$lig]->qty > $generic_product->stock_reel) { $notshippable++; } - } else { // Detailed code, looks bugged + } else { // Detailed virtual stock, looks bugged, uncomplete and need heavy load. // stock order and stock order_supplier $stock_order = 0; $stock_order_supplier = 0; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 38e9d972760..9af7584288b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8369,7 +8369,7 @@ function dolGetBadge($label, $html = '', $type = 'primary', $mode = '', $url = ' /** - * Function dolGetStatus + * Output the badge of a status. * * @param string $statusLabel Label of badge no html : use in alt attribute for accessibility * @param string $statusLabelShort Short label of badge no html @@ -8377,7 +8377,7 @@ function dolGetBadge($label, $html = '', $type = 'primary', $mode = '', $url = ' * @param string $statusType status0 status1 status2 status3 status4 status5 status6 status7 status8 status9 : image name or badge name * @param int $displayMode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto, 6=Long label + Picto * @param string $url The url for link - * @param array $params Various params for future : recommended rather than adding more function arguments + * @param array $params Various params. Example: array('tooltip'=>'...', 'badgeParams'=>...) * @return string Html status string */ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $statusType = 'status0', $displayMode = 0, $url = '', $params = array()) @@ -8446,7 +8446,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st $statusLabelShort = (empty($statusLabelShort) ? $statusLabel : $statusLabelShort); $dolGetBadgeParams['attr']['class'] = 'badge-status'; - $dolGetBadgeParams['attr']['title'] = $statusLabel; + $dolGetBadgeParams['attr']['title'] = empty($params['tooltip']) ? $statusLabel : $params['tooltip']; if ($displayMode == 3) { $return = dolGetBadge((empty($conf->dol_optimize_smallscreen) ? $statusLabel : (empty($statusLabelShort) ? $statusLabel : $statusLabelShort)), '', $statusType, 'dot', $url, $dolGetBadgeParams);