Merge pull request #10770 from atm-john/theme_badge_status

Add badge status css part1
This commit is contained in:
Laurent Destailleur 2019-03-11 20:49:31 +01:00 committed by GitHub
commit 3559d600e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 145 additions and 252 deletions

View File

@ -3193,20 +3193,14 @@ class Propal extends CommonObject
$this->labelstatut_short[4]=$langs->trans("PropalStatusBilledShort"); $this->labelstatut_short[4]=$langs->trans("PropalStatusBilledShort");
} }
$statuttrans=''; $statusType='';
if ($statut==self::STATUS_DRAFT) $statuttrans='statut0'; if ($statut==self::STATUS_DRAFT) $statusType='status0';
elseif ($statut==self::STATUS_VALIDATED) $statuttrans='statut1'; elseif ($statut==self::STATUS_VALIDATED) $statusType='status1';
elseif ($statut==self::STATUS_SIGNED) $statuttrans='statut3'; elseif ($statut==self::STATUS_SIGNED) $statusType='status3';
elseif ($statut==self::STATUS_NOTSIGNED) $statuttrans='statut5'; elseif ($statut==self::STATUS_NOTSIGNED) $statusType='status5';
elseif ($statut==self::STATUS_BILLED) $statuttrans='statut6'; elseif ($statut==self::STATUS_BILLED) $statusType='status6';
if ($mode == 0) return $this->labelstatut[$statut]; return dolGetStatus($this->labelstatut[$statut], $this->labelstatut_short[$statut], '', $statusType, $mode);
elseif ($mode == 1) return $this->labelstatut_short[$statut];
elseif ($mode == 2) return img_picto($this->labelstatut_short[$statut], $statuttrans).' '.$this->labelstatut_short[$statut];
elseif ($mode == 3) return img_picto($this->labelstatut[$statut], $statuttrans);
elseif ($mode == 4) return img_picto($this->labelstatut[$statut], $statuttrans).' '.$this->labelstatut[$statut];
elseif ($mode == 5) return '<span class="hideonsmartphone">'.$this->labelstatut_short[$statut].' </span>'.img_picto($this->labelstatut[$statut], $statuttrans);
elseif ($mode == 6) return '<span class="hideonsmartphone">'.$this->labelstatut[$statut].' </span>'.img_picto($this->labelstatut[$statut], $statuttrans);
} }

View File

@ -3425,77 +3425,49 @@ class Commande extends CommonOrder
$billedtext = ''; $billedtext = '';
if (empty($donotshowbilled)) $billedtext .= ($billed?' - '.$langs->trans("Billed"):''); if (empty($donotshowbilled)) $billedtext .= ($billed?' - '.$langs->trans("Billed"):'');
//print 'x'.$statut.'-'.$billed; if ($statut==self::STATUS_CANCELED){
if ($mode == 0) $labelstatut = $langs->trans('StatusOrderCanceled');
{ $labelstatutShort = $langs->trans('StatusOrderCanceledShort');
if ($statut==self::STATUS_CANCELED) return $langs->trans('StatusOrderCanceled'); $statusType='status5';
elseif ($statut==self::STATUS_DRAFT) return $langs->trans('StatusOrderDraft');
elseif ($statut==self::STATUS_VALIDATED) return $langs->trans('StatusOrderValidated').$billedtext;
elseif ($statut==self::STATUS_SHIPMENTONPROCESS) return $langs->trans('StatusOrderSentShort').$billedtext;
elseif ($statut==self::STATUS_CLOSED && (! $billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return $langs->trans('StatusOrderToBill');
elseif ($statut==self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return $langs->trans('StatusOrderProcessed').$billedtext;
elseif ($statut==self::STATUS_CLOSED && (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return $langs->trans('StatusOrderDelivered');
} }
elseif ($mode == 1) elseif ($statut==self::STATUS_DRAFT){
{ $labelstatut = $langs->trans('StatusOrderDraft');
if ($statut==self::STATUS_CANCELED) return $langs->trans('StatusOrderCanceledShort'); $labelstatutShort = $langs->trans('StatusOrderDraftShort');
elseif ($statut==self::STATUS_DRAFT) return $langs->trans('StatusOrderDraftShort'); $statusType='status0';
elseif ($statut==self::STATUS_VALIDATED) return $langs->trans('StatusOrderValidatedShort').$billedtext;
elseif ($statut==self::STATUS_SHIPMENTONPROCESS) return $langs->trans('StatusOrderSentShort').$billedtext;
elseif ($statut==self::STATUS_CLOSED && (! $billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return $langs->trans('StatusOrderToBillShort');
elseif ($statut==self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return $langs->trans('StatusOrderProcessed').$billedtext;
elseif ($statut==self::STATUS_CLOSED && (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return $langs->trans('StatusOrderDelivered');
} }
elseif ($mode == 2) elseif ($statut==self::STATUS_VALIDATED){
{ $labelstatut = $langs->trans('StatusOrderValidated').$billedtext;
if ($statut==self::STATUS_CANCELED) return img_picto($langs->trans('StatusOrderCanceled'), 'statut5').' '.$langs->trans('StatusOrderCanceledShort'); $labelstatutShort = $langs->trans('StatusOrderValidatedShort').$billedtext;
elseif ($statut==self::STATUS_DRAFT) return img_picto($langs->trans('StatusOrderDraft'), 'statut0').' '.$langs->trans('StatusOrderDraftShort'); $statusType='status1';
elseif ($statut==self::STATUS_VALIDATED) return img_picto($langs->trans('StatusOrderValidated'), 'statut1').' '.$langs->trans('StatusOrderValidatedShort').$billedtext;
elseif ($statut==self::STATUS_SHIPMENTONPROCESS) return img_picto($langs->trans('StatusOrderSent'), 'statut3').' '.$langs->trans('StatusOrderSentShort').$billedtext;
elseif ($statut==self::STATUS_CLOSED && (! $billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderToBill'), 'statut4').' '.$langs->trans('StatusOrderToBillShort');
elseif ($statut==self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderProcessed').$billedtext, 'statut6').' '.$langs->trans('StatusOrderProcessed').$billedtext;
elseif ($statut==self::STATUS_CLOSED && (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderDelivered'), 'statut6').' '.$langs->trans('StatusOrderDeliveredShort');
} }
elseif ($mode == 3) elseif ($statut==self::STATUS_SHIPMENTONPROCESS){
{ $labelstatut = $langs->trans('StatusOrderSentShort').$billedtext;
if ($statut==self::STATUS_CANCELED) return img_picto($langs->trans('StatusOrderCanceled'), 'statut5'); $labelstatutShort = $langs->trans('StatusOrderSentShort').$billedtext;
elseif ($statut==self::STATUS_DRAFT) return img_picto($langs->trans('StatusOrderDraft'), 'statut0'); $statusType='status3';
elseif ($statut==self::STATUS_VALIDATED) return img_picto($langs->trans('StatusOrderValidated').$billedtext, 'statut1');
elseif ($statut==self::STATUS_SHIPMENTONPROCESS) return img_picto($langs->trans('StatusOrderSentShort').$billedtext, 'statut3');
elseif ($statut==self::STATUS_CLOSED && (! $billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderToBill'), 'statut4');
elseif ($statut==self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderProcessed').$billedtext, 'statut6');
elseif ($statut==self::STATUS_CLOSED && (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderDelivered'), 'statut6');
} }
elseif ($mode == 4) elseif ($statut==self::STATUS_CLOSED && (! $billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))){
{ $labelstatut = $langs->trans('StatusOrderToBill');
if ($statut==self::STATUS_CANCELED) return img_picto($langs->trans('StatusOrderCanceled'), 'statut5').' '.$langs->trans('StatusOrderCanceled'); $labelstatutShort = $langs->trans('StatusOrderToBillShort');
elseif ($statut==self::STATUS_DRAFT) return img_picto($langs->trans('StatusOrderDraft'), 'statut0').' '.$langs->trans('StatusOrderDraft'); $statusType='status4';
elseif ($statut==self::STATUS_VALIDATED) return img_picto($langs->trans('StatusOrderValidated').$billedtext, 'statut1').' '.$langs->trans('StatusOrderValidated').$billedtext;
elseif ($statut==self::STATUS_SHIPMENTONPROCESS) return img_picto($langs->trans('StatusOrderSentShort').$billedtext, 'statut3').' '.$langs->trans('StatusOrderSent').$billedtext;
elseif ($statut==self::STATUS_CLOSED && (! $billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderToBill'), 'statut4').' '.$langs->trans('StatusOrderToBill');
elseif ($statut==self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderProcessedShort').$billedtext, 'statut6').' '.$langs->trans('StatusOrderProcessed').$billedtext;
elseif ($statut==self::STATUS_CLOSED && (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderDelivered'), 'statut6').' '.$langs->trans('StatusOrderDelivered');
} }
elseif ($mode == 5) elseif ($statut==self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))){
{ $labelstatut = $langs->trans('StatusOrderProcessed').$billedtext;
if ($statut==self::STATUS_CANCELED) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderCanceledShort').' </span>'.img_picto($langs->trans('StatusOrderCanceled'), 'statut5'); $labelstatutShort = $langs->trans('StatusOrderProcessed').$billedtext;
elseif ($statut==self::STATUS_DRAFT) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderDraftShort').' </span>'.img_picto($langs->trans('StatusOrderDraft'), 'statut0'); $statusType='status6';
elseif ($statut==self::STATUS_VALIDATED) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderValidatedShort').$billedtext.' </span>'.img_picto($langs->trans('StatusOrderValidated').$billedtext, 'statut1');
elseif ($statut==self::STATUS_SHIPMENTONPROCESS) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderSentShort').$billedtext.' </span>'.img_picto($langs->trans('StatusOrderSent').$billedtext, 'statut3');
elseif ($statut==self::STATUS_CLOSED && (! $billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderToBillShort').' </span>'.img_picto($langs->trans('StatusOrderToBill'), 'statut4');
elseif ($statut==self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderProcessedShort').$billedtext.' </span>'.img_picto($langs->trans('StatusOrderProcessed').$billedtext, 'statut6');
elseif ($statut==self::STATUS_CLOSED && (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderDeliveredShort').' </span>'.img_picto($langs->trans('StatusOrderDelivered'), 'statut6');
} }
elseif ($mode == 6) elseif ($statut==self::STATUS_CLOSED && (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))){
{ $labelstatut = $langs->trans('StatusOrderDelivered');
if ($statut==self::STATUS_CANCELED) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderCanceled').' </span>'.img_picto($langs->trans('StatusOrderCanceled'), 'statut5'); $labelstatutShort = $langs->trans('StatusOrderDelivered');
elseif ($statut==self::STATUS_DRAFT) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderDraft').' </span>'.img_picto($langs->trans('StatusOrderDraft'), 'statut0'); $statusType='status6';
elseif ($statut==self::STATUS_VALIDATED) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderValidated').$billedtext.' </span>'.img_picto($langs->trans('StatusOrderValidated').$billedtext, 'statut1');
elseif ($statut==self::STATUS_SHIPMENTONPROCESS) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderSent').$billedtext.' </span>'.img_picto($langs->trans('StatusOrderSent').$billedtext, 'statut3');
elseif ($statut==self::STATUS_CLOSED && (! $billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderToBill').' </span>'.img_picto($langs->trans('StatusOrderToBill'), 'statut4');
elseif ($statut==self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderProcessed').$billedtext.' </span>'.img_picto($langs->trans('StatusOrderProcessed').$billedtext, 'statut6');
elseif ($statut==self::STATUS_CLOSED && (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderDelivered').' </span>'.img_picto($langs->trans('StatusOrderDelivered'), 'statut6');
} }
else{
$labelstatut = $langs->trans('Unknown');
$labelstatutShort = '';
$statusType='';
$mode = 0;
}
return dolGetStatus($labelstatut, $labelstatutShort, '', $statusType, $mode);
} }

View File

@ -469,118 +469,55 @@ abstract class CommonInvoice extends CommonObject
global $langs; global $langs;
$langs->load('bills'); $langs->load('bills');
//print "$paye,$status,$mode,$alreadypaid,$type"; $statusType='status0';
if ($mode == 0) { $prefix='Short';
$prefix=''; if (! $paye){
if (! $paye) { if ($status == 0){
if ($status == 0) return $langs->trans('Bill'.$prefix.'StatusDraft'); $labelstatut = $langs->trans('BillStatusDraft');
elseif (($status == 3 || $status == 2) && $alreadypaid <= 0) return $langs->trans('Bill'.$prefix.'StatusClosedUnpaid'); $labelstatutShort = $langs->trans('Bill'.$prefix.'StatusDraft');
elseif (($status == 3 || $status == 2) && $alreadypaid > 0) return $langs->trans('Bill'.$prefix.'StatusClosedPaidPartially'); }
elseif ($alreadypaid <= 0) return $langs->trans('Bill'.$prefix.'StatusNotPaid'); elseif (($status == 3 || $status == 2) && $alreadypaid <= 0){
else return $langs->trans('Bill'.$prefix.'StatusStarted'); $labelstatut = $langs->trans('BillStatusClosedUnpaid');
} $labelstatutShort = $langs->trans('Bill'.$prefix.'StatusClosedUnpaid');
else $statusType='status5';
{ }
if ($type == self::TYPE_CREDIT_NOTE) return $langs->trans('Bill'.$prefix.'StatusPaidBackOrConverted'); // credit note elseif (($status == 3 || $status == 2) && $alreadypaid > 0){
elseif ($type == self::TYPE_DEPOSIT) return $langs->trans('Bill'.$prefix.'StatusConverted'); // deposit invoice $labelstatut = $langs->trans('BillStatusClosedPaidPartially');
else return $langs->trans('Bill'.$prefix.'StatusPaid'); $labelstatutShort = $langs->trans('Bill'.$prefix.'StatusClosedPaidPartially');
} $statusType='status9';
}
elseif ($alreadypaid <= 0){
$labelstatut = $langs->trans('BillStatusNotPaid');
$labelstatutShort = $langs->trans('Bill'.$prefix.'StatusNotPaid');
$statusType='status1';
}
else{
$labelstatut = $langs->trans('BillStatusStarted');
$labelstatutShort = $langs->trans('Bill'.$prefix.'StatusStarted');
$statusType='status3';
}
} }
elseif ($mode == 1) else
{ {
$prefix='Short'; $statusType='status6';
if (! $paye)
{ if ($type == self::TYPE_CREDIT_NOTE){
if ($status == 0) return $langs->trans('Bill'.$prefix.'StatusDraft'); $labelstatut = $langs->trans('BillStatusPaidBackOrConverted'); // credit note
elseif (($status == 3 || $status == 2) && $alreadypaid <= 0) return $langs->trans('Bill'.$prefix.'StatusCanceled'); $labelstatutShort = $langs->trans('Bill'.$prefix.'StatusPaidBackOrConverted'); // credit note
elseif (($status == 3 || $status == 2) && $alreadypaid > 0) return $langs->trans('Bill'.$prefix.'StatusClosedPaidPartially'); }
elseif ($alreadypaid <= 0) return $langs->trans('Bill'.$prefix.'StatusNotPaid'); elseif ($type == self::TYPE_DEPOSIT){
else return $langs->trans('Bill'.$prefix.'StatusStarted'); $labelstatut = $langs->trans('BillStatusConverted'); // deposit invoice
} $labelstatutShort = $langs->trans('Bill'.$prefix.'StatusConverted'); // deposit invoice
else }
{ else{
if ($type == self::TYPE_CREDIT_NOTE) return $langs->trans('Bill'.$prefix.'StatusPaidBackOrConverted'); $labelstatut = $langs->trans('BillStatusPaid');
elseif ($type == self::TYPE_DEPOSIT) return $langs->trans('Bill'.$prefix.'StatusConverted'); $labelstatutShort = $langs->trans('Bill'.$prefix.'StatusPaid');
else return $langs->trans('Bill'.$prefix.'StatusPaid'); }
}
}
elseif ($mode == 2)
{
$prefix='Short';
if (! $paye)
{
if ($status == 0) return img_picto($langs->trans('BillStatusDraft'), 'statut0').' '.$langs->trans('Bill'.$prefix.'StatusDraft');
elseif (($status == 3 || $status == 2) && $alreadypaid <= 0) return img_picto($langs->trans('StatusCanceled'), 'statut5').' '.$langs->trans('Bill'.$prefix.'StatusCanceled');
elseif (($status == 3 || $status == 2) && $alreadypaid > 0) return img_picto($langs->trans('BillStatusClosedPaidPartially'), 'statut9').' '.$langs->trans('Bill'.$prefix.'StatusClosedPaidPartially');
elseif ($alreadypaid <= 0) return img_picto($langs->trans('BillStatusNotPaid'), 'statut1').' '.$langs->trans('Bill'.$prefix.'StatusNotPaid');
else return img_picto($langs->trans('BillStatusStarted'), 'statut3').' '.$langs->trans('Bill'.$prefix.'StatusStarted');
}
else
{
if ($type == self::TYPE_CREDIT_NOTE) return img_picto($langs->trans('BillStatusPaidBackOrConverted'), 'statut6').' '.$langs->trans('Bill'.$prefix.'StatusPaidBackOrConverted');
elseif ($type == self::TYPE_DEPOSIT) return img_picto($langs->trans('BillStatusConverted'), 'statut6').' '.$langs->trans('Bill'.$prefix.'StatusConverted');
else return img_picto($langs->trans('BillStatusPaid'), 'statut6').' '.$langs->trans('Bill'.$prefix.'StatusPaid');
}
}
elseif ($mode == 3)
{
$prefix='Short';
if (! $paye)
{
if ($status == 0) return img_picto($langs->trans('BillStatusDraft'), 'statut0');
elseif (($status == 3 || $status == 2) && $alreadypaid <= 0) return img_picto($langs->trans('BillStatusCanceled'), 'statut5');
elseif (($status == 3 || $status == 2) && $alreadypaid > 0) return img_picto($langs->trans('BillStatusClosedPaidPartially'), 'statut9');
elseif ($alreadypaid <= 0) return img_picto($langs->trans('BillStatusNotPaid'), 'statut1');
else return img_picto($langs->trans('BillStatusStarted'), 'statut3');
}
else
{
if ($type == self::TYPE_CREDIT_NOTE) return img_picto($langs->trans('BillStatusPaidBackOrConverted'), 'statut6');
elseif ($type == self::TYPE_DEPOSIT) return img_picto($langs->trans('BillStatusConverted'), 'statut6');
else return img_picto($langs->trans('BillStatusPaid'), 'statut6');
}
}
elseif ($mode == 4)
{
$prefix='';
if (! $paye)
{
if ($status == 0) return img_picto($langs->trans('BillStatusDraft'), 'statut0').' '.$langs->trans('BillStatusDraft');
elseif (($status == 3 || $status == 2) && $alreadypaid <= 0) return img_picto($langs->trans('BillStatusCanceled'), 'statut5').' '.$langs->trans('Bill'.$prefix.'StatusCanceled');
elseif (($status == 3 || $status == 2) && $alreadypaid > 0) return img_picto($langs->trans('BillStatusClosedPaidPartially'), 'statut9').' '.$langs->trans('Bill'.$prefix.'StatusClosedPaidPartially');
elseif ($alreadypaid <= 0) return img_picto($langs->trans('BillStatusNotPaid'), 'statut1').' '.$langs->trans('BillStatusNotPaid');
else return img_picto($langs->trans('BillStatusStarted'), 'statut3').' '.$langs->trans('BillStatusStarted');
}
else
{
if ($type == self::TYPE_CREDIT_NOTE) return img_picto($langs->trans('BillStatusPaidBackOrConverted'), 'statut6').' '.$langs->trans('BillStatusPaidBackOrConverted');
elseif ($type == self::TYPE_DEPOSIT) return img_picto($langs->trans('BillStatusConverted'), 'statut6').' '.$langs->trans('BillStatusConverted');
else return img_picto($langs->trans('BillStatusPaid'), 'statut6').' '.$langs->trans('BillStatusPaid');
}
}
elseif ($mode == 5 || $mode == 6)
{
$prefix='';
if ($mode == 5) $prefix='Short';
if (! $paye)
{
if ($status == 0) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusDraft').' </span>'.img_picto($langs->trans('BillStatusDraft'), 'statut0');
elseif (($status == 3 || $status == 2) && $alreadypaid <= 0) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusCanceled').' </span>'.img_picto($langs->trans('BillStatusCanceled'), 'statut5');
elseif (($status == 3 || $status == 2) && $alreadypaid > 0) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusClosedPaidPartially').' </span>'.img_picto($langs->trans('BillStatusClosedPaidPartially'), 'statut9');
elseif ($alreadypaid <= 0)
{
if ($type == self::TYPE_CREDIT_NOTE) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusNotRefunded').' </span>'.img_picto($langs->trans('StatusNotRefunded'), 'statut1');
return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusNotPaid').' </span>'.img_picto($langs->trans('BillStatusNotPaid'), 'statut1');
}
else return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusStarted').' </span>'.img_picto($langs->trans('BillStatusStarted'), 'statut3');
}
else
{
if ($type == self::TYPE_CREDIT_NOTE) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusPaidBackOrConverted').' </span>'.img_picto($langs->trans('BillStatusPaidBackOrConverted'), 'statut6');
elseif ($type == self::TYPE_DEPOSIT) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusConverted').' </span>'.img_picto($langs->trans('BillStatusConverted'), 'statut6');
else return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusPaid').' </span>'.img_picto($langs->trans('BillStatusPaid'), 'statut6');
}
} }
return dolGetStatus($labelstatut, $labelstatutShort, '', $statusType, $mode);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps

View File

@ -7989,7 +7989,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
if($displayMode==0){ if($displayMode==0){
$return = !empty($html)?$html:$statusLabel; $return = !empty($html)?$html:$statusLabel;
} }
elseif($displayMode===1){ elseif($displayMode==1){
$return = !empty($html)?$html:(!empty($statusLabelShort)?$statusLabelShort:$statusLabel); $return = !empty($html)?$html:(!empty($statusLabelShort)?$statusLabelShort:$statusLabel);
} }
// use status with images // use status with images

View File

@ -4159,75 +4159,65 @@ class Product extends CommonObject
if ($type == 2) { if ($type == 2) {
switch ($mode) switch ($mode)
{ {
case 0: case 0:
return ($status == 0 ? $langs->trans('ProductStatusNotOnBatch') : $langs->trans('ProductStatusOnBatch')); $label = ($status == 0 ? $langs->trans('ProductStatusNotOnBatch') : $langs->trans('ProductStatusOnBatch'));
case 1: return dolGetStatus($label);
return ($status == 0 ? $langs->trans('ProductStatusNotOnBatchShort') : $langs->trans('ProductStatusOnBatchShort')); case 1:
case 2: $label = ($status == 0 ? $langs->trans('ProductStatusNotOnBatchShort') : $langs->trans('ProductStatusOnBatchShort'));
return $this->LibStatut($status, 3, 2).' '.$this->LibStatut($status, 1, 2); return dolGetStatus($label);
case 3: case 2:
if ($status == 0) { return $this->LibStatut($status, 3, 2).' '.$this->LibStatut($status, 1, 2);
return img_picto($langs->trans('ProductStatusNotOnBatch'), 'statut5'); case 3:
} return dolGetStatus($langs->trans('ProductStatusNotOnBatch'), '','',empty($status)?'status5':'status4',3,'dot');
return img_picto($langs->trans('ProductStatusOnBatch'), 'statut4'); case 4:
case 4: return $this->LibStatut($status, 3, 2).' '.$this->LibStatut($status, 0, 2);
return $this->LibStatut($status, 3, 2).' '.$this->LibStatut($status, 0, 2); case 5:
case 5: return $this->LibStatut($status, 1, 2).' '.$this->LibStatut($status, 3, 2);
return $this->LibStatut($status, 1, 2).' '.$this->LibStatut($status, 3, 2); default:
default: return dolGetStatus($langs->trans('Unknown'));
return $langs->trans('Unknown');
} }
} }
if ($mode == 0) {
if ($status == 0) { $statuttrans=empty($status)?'status5':'status4';
return ($type==0 ? $langs->trans('ProductStatusNotOnSellShort'):$langs->trans('ProductStatusNotOnBuyShort'));
} elseif ($status == 1) { if($status == 0){
return ($type==0 ? $langs->trans('ProductStatusOnSellShort'):$langs->trans('ProductStatusOnBuyShort')); // $type 0=Status "to sell", 1=Status "to buy", 2=Status "to Batch"
if($type==0){
$labelstatut = $langs->trans('ProductStatusNotOnSellShort');
$labelstatutShort = $langs->trans('ProductStatusNotOnSell');
}
elseif($type == 1){
$labelstatut = $langs->trans('ProductStatusNotOnBuyShort');
$labelstatutShort = $langs->trans('ProductStatusNotOnBuy');
}
elseif($type == 2){
$labelstatut = $langs->trans('ProductStatusNotOnBatch');
$labelstatutShort = $langs->trans('ProductStatusNotOnBatchShort');
} }
} }
elseif ($mode == 1) { elseif($status == 1){
if ($status == 0) { // $type 0=Status "to sell", 1=Status "to buy", 2=Status "to Batch"
return ($type==0 ? $langs->trans('ProductStatusNotOnSell'):$langs->trans('ProductStatusNotOnBuy')); if($type==0){
} elseif ($status == 1) { $labelstatut = $langs->trans('ProductStatusOnSellShort');
return ($type==0 ? $langs->trans('ProductStatusOnSell'):$langs->trans('ProductStatusOnBuy')); $labelstatutShort = $langs->trans('ProductStatusOnSell');
}
elseif($type == 1){
$labelstatut = $langs->trans('ProductStatusOnBuyShort');
$labelstatutShort = $langs->trans('ProductStatusOnBuy');
}
elseif($type == 2){
$labelstatut = $langs->trans('ProductStatusOnBatch');
$labelstatutShort = $langs->trans('ProductStatusOnBatchShort');
} }
} }
elseif ($mode == 2) {
if ($status == 0) {
return img_picto($langs->trans('ProductStatusNotOnSell'), 'statut5', 'class="pictostatus"').' '.($type==0 ? $langs->trans('ProductStatusNotOnSellShort'):$langs->trans('ProductStatusNotOnBuyShort')); if($mode>6){
} elseif ($status == 1) { return dolGetStatus($langs->trans('Unknown'),'', '', 'status0', 0);
return img_picto($langs->trans('ProductStatusOnSell'), 'statut4', 'class="pictostatus"').' '.($type==0 ? $langs->trans('ProductStatusOnSellShort'):$langs->trans('ProductStatusOnBuyShort'));
}
} }
elseif ($mode == 3) { else{
if ($status == 0) { return dolGetStatus($labelstatut, $labelstatutShort, '', $statuttrans, $mode);
return img_picto(($type==0 ? $langs->trans('ProductStatusNotOnSell') : $langs->trans('ProductStatusNotOnBuy')), 'statut5', 'class="pictostatus"');
} elseif ($status == 1) {
return img_picto(($type==0 ? $langs->trans('ProductStatusOnSell') : $langs->trans('ProductStatusOnBuy')), 'statut4', 'class="pictostatus"');
}
} }
elseif ($mode == 4) {
if ($status == 0) {
return img_picto($langs->trans('ProductStatusNotOnSell'), 'statut5', 'class="pictostatus"').' '.($type==0 ? $langs->trans('ProductStatusNotOnSell'):$langs->trans('ProductStatusNotOnBuy'));
} elseif ($status == 1) {
return img_picto($langs->trans('ProductStatusOnSell'), 'statut4', 'class="pictostatus"').' '.($type==0 ? $langs->trans('ProductStatusOnSell'):$langs->trans('ProductStatusOnBuy'));
}
}
elseif ($mode == 5) {
if ($status == 0) {
return ($type==0 ? $langs->trans('ProductStatusNotOnSellShort'):$langs->trans('ProductStatusNotOnBuyShort')).' '.img_picto(($type==0 ? $langs->trans('ProductStatusNotOnSell'):$langs->trans('ProductStatusNotOnBuy')), 'statut5', 'class="pictostatus"');
} elseif ($status == 1) {
return ($type==0 ? $langs->trans('ProductStatusOnSellShort'):$langs->trans('ProductStatusOnBuyShort')).' '.img_picto(($type==0 ? $langs->trans('ProductStatusOnSell'):$langs->trans('ProductStatusOnBuy')), 'statut4', 'class="pictostatus"');
}
}
elseif ($mode == 6) {
if ($status == 0) {
return ($type==0 ? $langs->trans('ProductStatusNotOnSellShort'):$langs->trans('ProductStatusNotOnBuyShort')).' '.img_picto(($type==0 ? $langs->trans('ProductStatusNotOnSell'):$langs->trans('ProductStatusNotOnBuy')), 'statut5', 'class="pictostatus"');
} elseif ($status == 1) {
return ($type==0 ? $langs->trans('ProductStatusOnSellShort'):$langs->trans('ProductStatusOnBuyShort')).' '.img_picto(($type==0 ? $langs->trans('ProductStatusOnSell'):$langs->trans('ProductStatusOnBuy')), 'statut4', 'class="pictostatus"');
}
}
return $langs->trans('Unknown');
} }