Look and feel v11

This commit is contained in:
Laurent Destailleur 2019-11-01 23:58:14 +01:00
parent 8608c5db9c
commit cea2c3a9f4
25 changed files with 377 additions and 421 deletions

View File

@ -638,11 +638,11 @@ class AccountingAccount extends CommonObject
/**
* Renvoi le libelle d'un statut donne
*
* @param int $statut Id statut
* @param int $status Id status
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Label of status
*/
public function LibStatut($statut, $mode = 0)
public function LibStatut($status, $mode = 0)
{
// phpcs:enable
global $langs;
@ -650,34 +650,33 @@ class AccountingAccount extends CommonObject
if ($mode == 0)
{
$prefix='';
if ($statut == 1) return $langs->trans('Enabled');
elseif ($statut == 0) return $langs->trans('Disabled');
if ($status == 1) return $langs->trans('Enabled');
elseif ($status == 0) return $langs->trans('Disabled');
}
elseif ($mode == 1)
{
if ($statut == 1) return $langs->trans('Enabled');
elseif ($statut == 0) return $langs->trans('Disabled');
if ($status == 1) return $langs->trans('Enabled');
elseif ($status == 0) return $langs->trans('Disabled');
}
elseif ($mode == 2)
{
if ($statut == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled');
elseif ($statut == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled');
if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled');
elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled');
}
elseif ($mode == 3)
{
if ($statut == 1) return img_picto($langs->trans('Enabled'), 'statut4');
elseif ($statut == 0) return img_picto($langs->trans('Disabled'), 'statut5');
if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4');
elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5');
}
elseif ($mode == 4)
{
if ($statut == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled');
elseif ($statut == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled');
if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled');
elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled');
}
elseif ($mode == 5)
{
if ($statut == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'), 'statut4');
elseif ($statut == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'), 'statut5');
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'), 'statut4');
elseif ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'), 'statut5');
}
}
}

View File

@ -174,7 +174,7 @@ class Adherent extends CommonObject
// -1:brouillon, 0:resilie, >=1:valide,paye
// def in common object
//public $statut;
//public $status;
public $photo;
@ -2168,13 +2168,13 @@ class Adherent extends CommonObject
/**
* Renvoi le libelle d'un statut donne
*
* @param int $statut Id statut
* @param int $status Id status
* @param int $need_subscription 1 if member type need subscription, 0 otherwise
* @param int $date_end_subscription Date fin adhesion
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
* @return string Label
*/
public function LibStatut($statut, $need_subscription, $date_end_subscription, $mode = 0)
public function LibStatut($status, $need_subscription, $date_end_subscription, $mode = 0)
{
// phpcs:enable
global $langs;
@ -2184,13 +2184,13 @@ class Adherent extends CommonObject
$labelStatus = '';
$labelStatusShort = '';
if ($statut == -1)
if ($status == -1)
{
$statusType = 'status0';
$labelStatus = $langs->trans("MemberStatusDraft");
$labelStatusShort = $langs->trans("MemberStatusDraftShort");
}
elseif ($statut >= 1) {
elseif ($status >= 1) {
if ($need_subscription == 0)
{
$statusType = 'status4';
@ -2215,7 +2215,7 @@ class Adherent extends CommonObject
$labelStatusShort = $langs->trans("MemberStatusPaidShort");
}
}
elseif ($statut == 0)
elseif ($status == 0)
{
$statusType = 'status6';
$labelStatus = $langs->trans("MemberStatusResiliated");

View File

@ -479,14 +479,13 @@ if ($object->fetch($id) >= 0)
{
$num = $db->num_rows($resql);
$param = "&id=".$object->id;
$param = "&id=".$object->id;
//if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
if ($search_lastname) $param.= "&search_lastname=".urlencode($search_lastname);
if ($search_firstname) $param.= "&search_firstname=".urlencode($search_firstname);
if ($search_email) $param.= "&search_email=".urlencode($search_email);
if ($search_other) $param.= "&search_other=".urlencode($search_other);
if ($page) $param.= "&page=".urlencode($page);
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -500,6 +499,7 @@ if ($object->fetch($id) >= 0)
$morehtmlcenter='<span class="opacitymedium">'.$langs->trans("ToClearAllRecipientsClickHere").'</span> <a href="'.$_SERVER["PHP_SELF"].'?clearlist=1&id='.$object->id.'" class="button reposition">'.$langs->trans("TargetsReset").'</a>';
}
$morehtmlcenter.=' <a class="reposition" href="'.$_SERVER["PHP_SELF"].'?exportcsv=1&id='.$object->id.'">'.$langs->trans("Download").'</a>';
print_barre_liste($langs->trans("MailSelectedRecipients"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $morehtmlcenter, $num, $nbtotalofrecords, 'generic', 0, '', '', $limit);
print '</form>';
@ -560,6 +560,8 @@ if ($object->fetch($id) >= 0)
print '</td>';
print '</tr>';
if ($page) $param.= "&page=".urlencode($page);
print '<tr class="liste_titre">';
print_liste_field_titre("EMail", $_SERVER["PHP_SELF"], "mc.email", $param, "", "", $sortfield, $sortorder);
print_liste_field_titre("Lastname", $_SERVER["PHP_SELF"], "mc.lastname", $param, "", "", $sortfield, $sortorder);

View File

@ -618,48 +618,24 @@ class Mailing extends CommonObject
/**
* Renvoi le libelle d'un statut donne
*
* @param int $statut Id statut
* @param int $status Id status
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Label
*/
public function LibStatut($statut, $mode = 0)
public function LibStatut($status, $mode = 0)
{
// phpcs:enable
global $langs;
$langs->load('mails');
$langs->load("mailing");
if ($mode == 0 || $mode == 1)
{
return $langs->trans($this->statuts[$statut]);
}
elseif ($mode == 2)
{
if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]), 'statut0').' '.$langs->trans($this->statuts[$statut]);
elseif ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]), 'statut1').' '.$langs->trans($this->statuts[$statut]);
elseif ($statut == 2) return img_picto($langs->trans($this->statuts[$statut]), 'statut3').' '.$langs->trans($this->statuts[$statut]);
elseif ($statut == 3) return img_picto($langs->trans($this->statuts[$statut]), 'statut6').' '.$langs->trans($this->statuts[$statut]);
}
elseif ($mode == 3)
{
if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]), 'statut0');
elseif ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]), 'statut1');
elseif ($statut == 2) return img_picto($langs->trans($this->statuts[$statut]), 'statut3');
elseif ($statut == 3) return img_picto($langs->trans($this->statuts[$statut]), 'statut6');
}
elseif ($mode == 4)
{
if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]), 'statut0').' '.$langs->trans($this->statuts[$statut]);
elseif ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]), 'statut1').' '.$langs->trans($this->statuts[$statut]);
elseif ($statut == 2) return img_picto($langs->trans($this->statuts[$statut]), 'statut3').' '.$langs->trans($this->statuts[$statut]);
elseif ($statut == 3) return img_picto($langs->trans($this->statuts[$statut]), 'statut6').' '.$langs->trans($this->statuts[$statut]);
}
elseif ($mode == 5)
{
if ($statut == 0) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]), 'statut0');
elseif ($statut == 1) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]), 'statut1');
elseif ($statut == 2) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]), 'statut3');
elseif ($statut == 3) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]), 'statut6');
}
$labelStatus = $langs->trans($this->statuts[$status]);
$labelStatusShort = $langs->trans($this->statuts[$status]);
$statusType = 'status'.$status;
if ($status == 2) $statusType = 'status3';
if ($status == 3) $statusType = 'status6';
return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode);
}
@ -667,58 +643,37 @@ class Mailing extends CommonObject
* Renvoi le libelle d'un statut donne
* TODO Add class mailin_target.class.php
*
* @param int $statut Id statut
* @param int $status Id status
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @param string $desc Desc error
* @return string Label
*/
public static function libStatutDest($statut, $mode = 0, $desc = '')
public static function libStatutDest($status, $mode = 0, $desc = '')
{
global $langs;
$langs->load('mails');
$langs->load("mails");
if ($mode == 0)
{
return $langs->trans('MailingStatusError');
}
elseif ($mode == 1)
{
return $langs->trans('MailingStatusSent');
}
elseif ($mode == 2)
{
if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
elseif ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"), 'statut6');
elseif ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"), 'statut4');
elseif ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"), 'statut3');
}
elseif ($mode == 3)
{
if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
elseif ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"), 'statut6');
elseif ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"), 'statut4');
elseif ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"), 'statut3');
}
elseif ($mode == 4)
{
if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
elseif ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"), 'statut6');
elseif ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"), 'statut4');
elseif ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"), 'statut3');
}
elseif ($mode == 5)
{
if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
elseif ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"), 'statut6');
elseif ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"), 'statut4');
elseif ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"), 'statut3');
}
elseif ($mode == 6)
{
if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
elseif ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"), 'statut6');
elseif ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"), 'statut4');
elseif ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"), 'statut3');
$labelStatus = array();
$labelStatusShort = array();
$labelStatus[-1] = $langs->trans('MailingStatusError');
$labelStatus[1] = $langs->trans('MailingStatusSent');
$labelStatus[2] = $langs->trans('MailingStatusRead');
$labelStatus[3] = $langs->trans('MailingStatusNotContact');
$labelStatusShort[-1] = $langs->trans('MailingStatusError');
$labelStatusShort[1] = $langs->trans('MailingStatusSent');
$labelStatusShort[2] = $langs->trans('MailingStatusRead');
$labelStatusShort[3] = $langs->trans('MailingStatusNotContact');
$statusType = 'status'.$status;
if ($status == -1) $statusType = 'status8';
if ($status == 1) $statusType = 'status6';
if ($status == 2) $statusType = 'status4';
$param = array();
if ($status == - 1) {
$param = array('badgeParams'=>array('attr'=>array('title'=>$desc)));
}
return dolGetStatus($labelStatus[$status], $labelStatusShort[$status], '', $statusType, $mode, '', $param);
}
}

View File

@ -3200,11 +3200,11 @@ class Propal extends CommonObject
/**
* Return label of a status (draft, validated, ...)
*
* @param int $statut id statut
* @param int $status Id status
* @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto, 6=Long label + Picto
* @return string Label
*/
public function LibStatut($statut, $mode = 1)
public function LibStatut($status, $mode = 1)
{
// phpcs:enable
global $conf;
@ -3227,13 +3227,13 @@ class Propal extends CommonObject
}
$statusType='';
if ($statut==self::STATUS_DRAFT) $statusType='status0';
elseif ($statut==self::STATUS_VALIDATED) $statusType='status1';
elseif ($statut==self::STATUS_SIGNED) $statusType='status3';
elseif ($statut==self::STATUS_NOTSIGNED) $statusType='status5';
elseif ($statut==self::STATUS_BILLED) $statusType='status6';
if ($status==self::STATUS_DRAFT) $statusType='status0';
elseif ($status==self::STATUS_VALIDATED) $statusType='status1';
elseif ($status==self::STATUS_SIGNED) $statusType='status3';
elseif ($status==self::STATUS_NOTSIGNED) $statusType='status5';
elseif ($status==self::STATUS_BILLED) $statusType='status6';
return dolGetStatus($this->labelStatus[$statut], $this->labelStatusShort[$statut], '', $statusType, $mode);
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
}
@ -3272,17 +3272,17 @@ class Propal extends CommonObject
$now=dol_now();
$delay_warning = 0;
$statut = 0;
$status = 0;
$label = $labelShort = '';
if ($mode == 'opened') {
$delay_warning=$conf->propal->cloture->warning_delay;
$statut = self::STATUS_VALIDATED;
$status = self::STATUS_VALIDATED;
$label = $langs->trans("PropalsToClose");
$labelShort = $langs->trans("ToAcceptRefuse");
}
if ($mode == 'signed') {
$delay_warning=$conf->propal->facturation->warning_delay;
$statut = self::STATUS_SIGNED;
$status = self::STATUS_SIGNED;
$label = $langs->trans("PropalsToBill"); // We set here bill but may be billed or ordered
$labelShort = $langs->trans("ToBill");
}
@ -3291,8 +3291,8 @@ class Propal extends CommonObject
$response->warning_delay = $delay_warning/60/60/24;
$response->label = $label;
$response->labelShort = $labelShort;
$response->url = DOL_URL_ROOT.'/comm/propal/list.php?viewstatut='.$statut.'&mainmenu=commercial&leftmenu=propals';
$response->url_late = DOL_URL_ROOT.'/comm/propal/list.php?viewstatut='.$statut.'&mainmenu=commercial&leftmenu=propals&sortfield=p.datep&sortorder=asc';
$response->url = DOL_URL_ROOT.'/comm/propal/list.php?viewstatut='.$status.'&mainmenu=commercial&leftmenu=propals';
$response->url_late = DOL_URL_ROOT.'/comm/propal/list.php?viewstatut='.$status.'&mainmenu=commercial&leftmenu=propals&sortfield=p.datep&sortorder=asc';
$response->img = img_object('', "propal");
// This assignment in condition is not a bug. It allows walking the results.

View File

@ -3469,13 +3469,13 @@ class Commande extends CommonOrder
/**
* Return label of status
*
* @param int $statut Id statut
* @param int $status Id status
* @param int $billed If invoiced
* @param int $mode 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 int $donotshowbilled Do not show billed status after order status
* @return string Label of status
*/
public function LibStatut($statut, $billed, $mode, $donotshowbilled = 0)
public function LibStatut($status, $billed, $mode, $donotshowbilled = 0)
{
// phpcs:enable
global $langs, $conf;
@ -3483,37 +3483,37 @@ class Commande extends CommonOrder
$billedtext = '';
if (empty($donotshowbilled)) $billedtext .= ($billed?' - '.$langs->trans("Billed"):'');
if ($statut==self::STATUS_CANCELED){
if ($status==self::STATUS_CANCELED){
$labelStatus = $langs->trans('StatusOrderCanceled');
$labelStatusShort = $langs->trans('StatusOrderCanceledShort');
$statusType='status5';
}
elseif ($statut==self::STATUS_DRAFT){
elseif ($status==self::STATUS_DRAFT){
$labelStatus = $langs->trans('StatusOrderDraft');
$labelStatusShort = $langs->trans('StatusOrderDraftShort');
$statusType='status0';
}
elseif ($statut==self::STATUS_VALIDATED){
elseif ($status==self::STATUS_VALIDATED){
$labelStatus = $langs->trans('StatusOrderValidated').$billedtext;
$labelStatusShort = $langs->trans('StatusOrderValidatedShort').$billedtext;
$statusType='status1';
}
elseif ($statut==self::STATUS_SHIPMENTONPROCESS){
elseif ($status==self::STATUS_SHIPMENTONPROCESS){
$labelStatus = $langs->trans('StatusOrderSentShort').$billedtext;
$labelStatusShort = $langs->trans('StatusOrderSentShort').$billedtext;
$statusType='status3';
}
elseif ($statut==self::STATUS_CLOSED && (! $billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))){
elseif ($status==self::STATUS_CLOSED && (! $billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))){
$labelStatus = $langs->trans('StatusOrderToBill');
$labelStatusShort = $langs->trans('StatusOrderToBillShort');
$statusType='status4';
}
elseif ($statut==self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))){
elseif ($status==self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))){
$labelStatus = $langs->trans('StatusOrderProcessed').$billedtext;
$labelStatusShort = $langs->trans('StatusOrderProcessed').$billedtext;
$statusType='status6';
}
elseif ($statut==self::STATUS_CLOSED && (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))){
elseif ($status==self::STATUS_CLOSED && (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))){
$labelStatus = $langs->trans('StatusOrderDelivered');
$labelStatusShort = $langs->trans('StatusOrderDelivered');
$statusType='status6';

View File

@ -523,46 +523,46 @@ class PaymentVarious extends CommonObject
/**
* Renvoi le libelle d'un statut donne
*
* @param int $statut Id status
* @param int $status Id status
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Libelle
*/
public function LibStatut($statut, $mode = 0)
public function LibStatut($status, $mode = 0)
{
// phpcs:enable
global $langs;
if ($mode == 0)
{
return $langs->trans($this->statuts[$statut]);
return $langs->trans($this->statuts[$status]);
}
elseif ($mode == 1)
{
return $langs->trans($this->statuts_short[$statut]);
return $langs->trans($this->statuts_short[$status]);
}
elseif ($mode == 2)
{
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0').' '.$langs->trans($this->statuts_short[$statut]);
elseif ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut4').' '.$langs->trans($this->statuts_short[$statut]);
elseif ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6').' '.$langs->trans($this->statuts_short[$statut]);
if ($status==0) return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts_short[$status]);
elseif ($status==1) return img_picto($langs->trans($this->statuts_short[$status]), 'statut4').' '.$langs->trans($this->statuts_short[$status]);
elseif ($status==2) return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts_short[$status]);
}
elseif ($mode == 3)
{
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0');
elseif ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut4');
elseif ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6');
if ($status==0 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut0');
elseif ($status==1 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut4');
elseif ($status==2 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut6');
}
elseif ($mode == 4)
{
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0').' '.$langs->trans($this->statuts[$statut]);
elseif ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut4').' '.$langs->trans($this->statuts[$statut]);
elseif ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6').' '.$langs->trans($this->statuts[$statut]);
if ($status==0 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts[$status]);
elseif ($status==1 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut4').' '.$langs->trans($this->statuts[$status]);
elseif ($status==2 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts[$status]);
}
elseif ($mode == 5)
{
if ($statut==0 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]), 'statut0');
elseif ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]), 'statut4');
elseif ($statut==2 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]), 'statut6');
if ($status==0 && ! empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut0');
elseif ($status==1 && ! empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut4');
elseif ($status==2 && ! empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut6');
}
}

View File

@ -336,46 +336,46 @@ class Deplacement extends CommonObject
/**
* Renvoi le libelle d'un statut donne
*
* @param int $statut Id status
* @param int $status Id status
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Libelle
*/
public function LibStatut($statut, $mode = 0)
public function LibStatut($status, $mode = 0)
{
// phpcs:enable
global $langs;
if ($mode == 0)
{
return $langs->trans($this->statuts[$statut]);
return $langs->trans($this->statuts[$status]);
}
elseif ($mode == 1)
{
return $langs->trans($this->statuts_short[$statut]);
return $langs->trans($this->statuts_short[$status]);
}
elseif ($mode == 2)
{
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0').' '.$langs->trans($this->statuts_short[$statut]);
elseif ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut4').' '.$langs->trans($this->statuts_short[$statut]);
elseif ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6').' '.$langs->trans($this->statuts_short[$statut]);
if ($status==0) return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts_short[$status]);
elseif ($status==1) return img_picto($langs->trans($this->statuts_short[$status]), 'statut4').' '.$langs->trans($this->statuts_short[$status]);
elseif ($status==2) return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts_short[$status]);
}
elseif ($mode == 3)
{
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0');
elseif ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut4');
elseif ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6');
if ($status==0 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut0');
elseif ($status==1 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut4');
elseif ($status==2 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut6');
}
elseif ($mode == 4)
{
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0').' '.$langs->trans($this->statuts[$statut]);
elseif ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut4').' '.$langs->trans($this->statuts[$statut]);
elseif ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6').' '.$langs->trans($this->statuts[$statut]);
if ($status==0 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts[$status]);
elseif ($status==1 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut4').' '.$langs->trans($this->statuts[$status]);
elseif ($status==2 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts[$status]);
}
elseif ($mode == 5)
{
if ($statut==0 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]), 'statut0');
elseif ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]), 'statut4');
elseif ($statut==2 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]), 'statut6');
if ($status==0 && ! empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut0');
elseif ($status==1 && ! empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut4');
elseif ($status==2 && ! empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut6');
}
}

View File

@ -1995,11 +1995,11 @@ class BonPrelevement extends CommonObject
/**
* Return status label for a status
*
* @param int $statut id statut
* @param int $status Id status
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
* @return string Label
*/
public function LibStatut($statut, $mode = 0)
public function LibStatut($status, $mode = 0)
{
// phpcs:enable
if (empty($this->labelStatus))
@ -2013,37 +2013,37 @@ class BonPrelevement extends CommonObject
if ($mode == 0 || $mode == 1)
{
return $this->labelStatus[$statut];
return $this->labelStatus[$status];
}
elseif ($mode == 2)
{
if ($statut==0) return img_picto($this->labelStatus[$statut], 'statut1').' '.$this->labelStatus[$statut];
elseif ($statut==1) return img_picto($this->labelStatus[$statut], 'statut3').' '.$this->labelStatus[$statut];
elseif ($statut==2) return img_picto($this->labelStatus[$statut], 'statut6').' '.$this->labelStatus[$statut];
if ($status==0) return img_picto($this->labelStatus[$status], 'statut1').' '.$this->labelStatus[$status];
elseif ($status==1) return img_picto($this->labelStatus[$status], 'statut3').' '.$this->labelStatus[$status];
elseif ($status==2) return img_picto($this->labelStatus[$status], 'statut6').' '.$this->labelStatus[$status];
}
elseif ($mode == 3)
{
if ($statut==0) return img_picto($this->labelStatus[$statut], 'statut1');
elseif ($statut==1) return img_picto($this->labelStatus[$statut], 'statut3');
elseif ($statut==2) return img_picto($this->labelStatus[$statut], 'statut6');
if ($status==0) return img_picto($this->labelStatus[$status], 'statut1');
elseif ($status==1) return img_picto($this->labelStatus[$status], 'statut3');
elseif ($status==2) return img_picto($this->labelStatus[$status], 'statut6');
}
elseif ($mode == 4)
{
if ($statut==0) return img_picto($this->labelStatus[$statut], 'statut1').' '.$this->labelStatus[$statut];
elseif ($statut==1) return img_picto($this->labelStatus[$statut], 'statut3').' '.$this->labelStatus[$statut];
elseif ($statut==2) return img_picto($this->labelStatus[$statut], 'statut6').' '.$this->labelStatus[$statut];
if ($status==0) return img_picto($this->labelStatus[$status], 'statut1').' '.$this->labelStatus[$status];
elseif ($status==1) return img_picto($this->labelStatus[$status], 'statut3').' '.$this->labelStatus[$status];
elseif ($status==2) return img_picto($this->labelStatus[$status], 'statut6').' '.$this->labelStatus[$status];
}
elseif ($mode == 5)
{
if ($statut==0) return $this->labelStatus[$statut].' '.img_picto($this->labelStatus[$statut], 'statut1');
elseif ($statut==1) return $this->labelStatus[$statut].' '.img_picto($this->labelStatus[$statut], 'statut3');
elseif ($statut==2) return $this->labelStatus[$statut].' '.img_picto($this->labelStatus[$statut], 'statut6');
if ($status==0) return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut1');
elseif ($status==1) return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut3');
elseif ($status==2) return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut6');
}
elseif ($mode == 6)
{
if ($statut==0) return $this->labelStatus[$statut].' '.img_picto($this->labelStatus[$statut], 'statut1');
elseif ($statut==1) return $this->labelStatus[$statut].' '.img_picto($this->labelStatus[$statut], 'statut3');
elseif ($statut==2) return $this->labelStatus[$statut].' '.img_picto($this->labelStatus[$statut], 'statut6');
if ($status==0) return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut1');
elseif ($status==1) return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut3');
elseif ($status==2) return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut6');
}
}
}

View File

@ -132,36 +132,36 @@ class LignePrelevement
/**
* Return status label for a status
*
* @param int $statut id statut
* @param int $status Id status
* @param int $mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto
* @return string Label
*/
public function LibStatut($statut, $mode = 0)
public function LibStatut($status, $mode = 0)
{
// phpcs:enable
global $langs;
if ($mode == 0)
{
return $langs->trans($this->statuts[$statut]);
return $langs->trans($this->statuts[$status]);
}
elseif ($mode == 1)
{
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]), 'statut1').' '.$langs->trans($this->statuts[$statut]); // Waiting
elseif ($statut==2) return img_picto($langs->trans($this->statuts[$statut]), 'statut6').' '.$langs->trans($this->statuts[$statut]); // Credited
elseif ($statut==3) return img_picto($langs->trans($this->statuts[$statut]), 'statut8').' '.$langs->trans($this->statuts[$statut]); // Refused
if ($status==0) return img_picto($langs->trans($this->statuts[$status]), 'statut1').' '.$langs->trans($this->statuts[$status]); // Waiting
elseif ($status==2) return img_picto($langs->trans($this->statuts[$status]), 'statut6').' '.$langs->trans($this->statuts[$status]); // Credited
elseif ($status==3) return img_picto($langs->trans($this->statuts[$status]), 'statut8').' '.$langs->trans($this->statuts[$status]); // Refused
}
elseif ($mode == 2)
{
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]), 'statut1');
elseif ($statut==2) return img_picto($langs->trans($this->statuts[$statut]), 'statut6');
elseif ($statut==3) return img_picto($langs->trans($this->statuts[$statut]), 'statut8');
if ($status==0) return img_picto($langs->trans($this->statuts[$status]), 'statut1');
elseif ($status==2) return img_picto($langs->trans($this->statuts[$status]), 'statut6');
elseif ($status==3) return img_picto($langs->trans($this->statuts[$status]), 'statut8');
}
elseif ($mode == 3)
{
if ($statut==0) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]), 'statut1');
elseif ($statut==2) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]), 'statut6');
elseif ($statut==3) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]), 'statut8');
if ($status==0) return $langs->trans($this->statuts[$status]).' '.img_picto($langs->trans($this->statuts[$status]), 'statut1');
elseif ($status==2) return $langs->trans($this->statuts[$status]).' '.img_picto($langs->trans($this->statuts[$status]), 'statut6');
elseif ($status==3) return $langs->trans($this->statuts[$status]).' '.img_picto($langs->trans($this->statuts[$status]), 'statut8');
}
}

View File

@ -465,12 +465,12 @@ class ChargeSociales extends CommonObject
/**
* Renvoi le libelle d'un statut donne
*
* @param int $statut Id statut
* @param int $status Id status
* @param int $mode 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 double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
* @return string Label
*/
public function LibStatut($statut, $mode = 0, $alreadypaid = -1)
public function LibStatut($status, $mode = 0, $alreadypaid = -1)
{
// phpcs:enable
global $langs;
@ -480,38 +480,38 @@ class ChargeSociales extends CommonObject
if ($mode == 0 || $mode == 1)
{
if ($statut == 0) return $langs->trans("Unpaid");
elseif ($statut == 1) return $langs->trans("Paid");
if ($status == 0) return $langs->trans("Unpaid");
elseif ($status == 1) return $langs->trans("Paid");
}
elseif ($mode == 2)
{
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
elseif ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
elseif ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
if ($status == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
elseif ($status == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
elseif ($status == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
}
elseif ($mode == 3)
{
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1');
elseif ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3');
elseif ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6');
if ($status == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1');
elseif ($status == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3');
elseif ($status == 1) return img_picto($langs->trans("Paid"), 'statut6');
}
elseif ($mode == 4)
{
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
elseif ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
elseif ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
if ($status == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
elseif ($status == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
elseif ($status == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
}
elseif ($mode == 5)
{
if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
elseif ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
elseif ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
if ($status == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
elseif ($status == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
elseif ($status == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
}
elseif ($mode == 6)
{
if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
elseif ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
elseif ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
if ($status == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
elseif ($status == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
elseif ($status == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
}
else return "Error, mode/status not found";

View File

@ -290,42 +290,42 @@ class Fiscalyear extends CommonObject
/**
* Give a label from a status
*
* @param int $statut Id status
* @param int $status Id status
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Label
*/
public function LibStatut($statut, $mode = 0)
public function LibStatut($status, $mode = 0)
{
// phpcs:enable
global $langs;
if ($mode == 0)
{
return $langs->trans($this->statuts[$statut]);
return $langs->trans($this->statuts[$status]);
}
elseif ($mode == 1)
{
return $langs->trans($this->statuts_short[$statut]);
return $langs->trans($this->statuts_short[$status]);
}
elseif ($mode == 2)
{
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut4').' '.$langs->trans($this->statuts_short[$statut]);
elseif ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut8').' '.$langs->trans($this->statuts_short[$statut]);
if ($status==0) return img_picto($langs->trans($this->statuts_short[$status]), 'statut4').' '.$langs->trans($this->statuts_short[$status]);
elseif ($status==1) return img_picto($langs->trans($this->statuts_short[$status]), 'statut8').' '.$langs->trans($this->statuts_short[$status]);
}
elseif ($mode == 3)
{
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut4');
elseif ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut8');
if ($status==0 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut4');
elseif ($status==1 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut8');
}
elseif ($mode == 4)
{
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut4').' '.$langs->trans($this->statuts[$statut]);
elseif ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut8').' '.$langs->trans($this->statuts[$statut]);
if ($status==0 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut4').' '.$langs->trans($this->statuts[$status]);
elseif ($status==1 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut8').' '.$langs->trans($this->statuts[$status]);
}
elseif ($mode == 5)
{
if ($statut==0 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]), 'statut4');
elseif ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]), 'statut6');
if ($status==0 && ! empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut4');
elseif ($status==1 && ! empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut6');
}
}

View File

@ -8094,7 +8094,7 @@ function roundUpToNextMultiple($n, $x = 5)
* @param string $type type of badge : Primary Secondary Success Danger Warning Info Light Dark status0 status1 status2 status3 status4 status5 status6 status7 status8 status9
* @param string $mode default '' , pill, dot
* @param string $url the url for link
* @param array $params various params for future : recommended rather than adding more fuction arguments
* @param array $params various params for future : recommended rather than adding more fuction arguments. array('attr'=>array('title'=>'abc'))
* @return string Html badge
*/
function dolGetBadge($label, $html = '', $type = 'primary', $mode = '', $url = '', $params = array())

View File

@ -474,11 +474,11 @@ class PaymentDonation extends CommonObject
/**
* Renvoi le libelle d'un statut donne
*
* @param int $statut Id statut
* @param int $status Id status
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Libelle du statut
*/
public function LibStatut($statut, $mode = 0)
public function LibStatut($status, $mode = 0)
{
// phpcs:enable
global $langs;

View File

@ -1668,44 +1668,44 @@ class Expedition extends CommonObject
/**
* Return label of a status
*
* @param int $statut Id statut
* @param int $status Id statut
* @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto
* @return string Label of status
*/
public function LibStatut($statut, $mode)
public function LibStatut($status, $mode)
{
// phpcs:enable
global $langs;
if ($mode==0)
{
if ($statut==0) return $langs->trans($this->statuts[$statut]);
elseif ($statut==1) return $langs->trans($this->statuts[$statut]);
elseif ($statut==2) return $langs->trans($this->statuts[$statut]);
if ($status==0) return $langs->trans($this->statuts[$status]);
elseif ($status==1) return $langs->trans($this->statuts[$status]);
elseif ($status==2) return $langs->trans($this->statuts[$status]);
}
elseif ($mode==1)
{
if ($statut==0) return $langs->trans($this->statutshorts[$statut]);
elseif ($statut==1) return $langs->trans($this->statutshorts[$statut]);
elseif ($statut==2) return $langs->trans($this->statutshorts[$statut]);
if ($status==0) return $langs->trans($this->statutshorts[$status]);
elseif ($status==1) return $langs->trans($this->statutshorts[$status]);
elseif ($status==2) return $langs->trans($this->statutshorts[$status]);
}
elseif ($mode == 3)
{
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]), 'statut0');
elseif ($statut==1) return img_picto($langs->trans($this->statuts[$statut]), 'statut4');
elseif ($statut==2) return img_picto($langs->trans($this->statuts[$statut]), 'statut6');
if ($status==0) return img_picto($langs->trans($this->statuts[$status]), 'statut0');
elseif ($status==1) return img_picto($langs->trans($this->statuts[$status]), 'statut4');
elseif ($status==2) return img_picto($langs->trans($this->statuts[$status]), 'statut6');
}
elseif ($mode == 4)
{
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]), 'statut0').' '.$langs->trans($this->statuts[$statut]);
elseif ($statut==1) return img_picto($langs->trans($this->statuts[$statut]), 'statut4').' '.$langs->trans($this->statuts[$statut]);
elseif ($statut==2) return img_picto($langs->trans($this->statuts[$statut]), 'statut6').' '.$langs->trans($this->statuts[$statut]);
if ($status==0) return img_picto($langs->trans($this->statuts[$status]), 'statut0').' '.$langs->trans($this->statuts[$status]);
elseif ($status==1) return img_picto($langs->trans($this->statuts[$status]), 'statut4').' '.$langs->trans($this->statuts[$status]);
elseif ($status==2) return img_picto($langs->trans($this->statuts[$status]), 'statut6').' '.$langs->trans($this->statuts[$status]);
}
elseif ($mode == 5)
{
if ($statut==0) return $langs->trans($this->statutshorts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]), 'statut0');
elseif ($statut==1) return $langs->trans($this->statutshorts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]), 'statut4');
elseif ($statut==2) return $langs->trans($this->statutshorts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]), 'statut6');
if ($status==0) return $langs->trans($this->statutshorts[$status]).' '.img_picto($langs->trans($this->statuts[$status]), 'statut0');
elseif ($status==1) return $langs->trans($this->statutshorts[$status]).' '.img_picto($langs->trans($this->statuts[$status]), 'statut4');
elseif ($status==2) return $langs->trans($this->statutshorts[$status]).' '.img_picto($langs->trans($this->statuts[$status]), 'statut6');
}
}

View File

@ -476,11 +476,11 @@ class PaymentExpenseReport extends CommonObject
/**
* Renvoi le libelle d'un statut donne
*
* @param int $statut Id statut
* @param int $status Id status
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Libelle du statut
*/
public function LibStatut($statut, $mode = 0)
public function LibStatut($status, $mode = 0)
{
// phpcs:enable
global $langs;

View File

@ -539,11 +539,11 @@ class CommandeFournisseurDispatch extends CommonObject
/**
* Return label of a status
*
* @param int $statut Id statut
* @param int $status Id status
* @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto
* @return string Label of status
*/
public function LibStatut($statut, $mode = 0)
public function LibStatut($status, $mode = 0)
{
// phpcs:enable
global $langs;
@ -551,33 +551,33 @@ class CommandeFournisseurDispatch extends CommonObject
if ($mode == 0)
{
return $langs->trans($this->statuts[$statut]);
return $langs->trans($this->statuts[$status]);
}
elseif ($mode == 1)
{
return $langs->trans($this->statutshort[$statut]);
return $langs->trans($this->statutshort[$status]);
}
elseif ($mode == 2)
{
return $langs->trans($this->statuts[$statut]);
return $langs->trans($this->statuts[$status]);
}
elseif ($mode == 3)
{
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]), 'statut0');
elseif ($statut==1) return img_picto($langs->trans($this->statuts[$statut]), 'statut4');
elseif ($statut==2) return img_picto($langs->trans($this->statuts[$statut]), 'statut8');
if ($status==0) return img_picto($langs->trans($this->statuts[$status]), 'statut0');
elseif ($status==1) return img_picto($langs->trans($this->statuts[$status]), 'statut4');
elseif ($status==2) return img_picto($langs->trans($this->statuts[$status]), 'statut8');
}
elseif ($mode == 4)
{
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]), 'statut0').' '.$langs->trans($this->statuts[$statut]);
elseif ($statut==1) return img_picto($langs->trans($this->statuts[$statut]), 'statut4').' '.$langs->trans($this->statuts[$statut]);
elseif ($statut==2) return img_picto($langs->trans($this->statuts[$statut]), 'statut8').' '.$langs->trans($this->statuts[$statut]);
if ($status==0) return img_picto($langs->trans($this->statuts[$status]), 'statut0').' '.$langs->trans($this->statuts[$status]);
elseif ($status==1) return img_picto($langs->trans($this->statuts[$status]), 'statut4').' '.$langs->trans($this->statuts[$status]);
elseif ($status==2) return img_picto($langs->trans($this->statuts[$status]), 'statut8').' '.$langs->trans($this->statuts[$status]);
}
elseif ($mode == 5)
{
if ($statut==0) return '<span class="hideonsmartphone">'.$langs->trans($this->statutshort[$statut]).' </span>'.img_picto($langs->trans($this->statuts[$statut]), 'statut0');
elseif ($statut==1) return '<span class="hideonsmartphone">'.$langs->trans($this->statutshort[$statut]).' </span>'.img_picto($langs->trans($this->statuts[$statut]), 'statut4');
elseif ($statut==2) return '<span class="hideonsmartphone">'.$langs->trans($this->statutshort[$statut]).' </span>'.img_picto($langs->trans($this->statuts[$statut]), 'statut8');
if ($status==0) return '<span class="hideonsmartphone">'.$langs->trans($this->statutshort[$status]).' </span>'.img_picto($langs->trans($this->statuts[$status]), 'statut0');
elseif ($status==1) return '<span class="hideonsmartphone">'.$langs->trans($this->statutshort[$status]).' </span>'.img_picto($langs->trans($this->statuts[$status]), 'statut4');
elseif ($status==2) return '<span class="hideonsmartphone">'.$langs->trans($this->statutshort[$status]).' </span>'.img_picto($langs->trans($this->statuts[$status]), 'statut8');
}
}

View File

@ -117,14 +117,14 @@ if ($resql)
print '<table class="noborder nohover" width="100%">';
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("SuppliersOrders").'</th></tr>';
print "</tr>\n";
foreach (array(0,1,2,3,4,5,6) as $statut)
foreach (array(0,1,2,3,4,5,6) as $status)
{
$dataseries[]=array($commandestatic->LibStatut($statut, 1), (isset($vals[$statut])?(int) $vals[$statut]:0));
$dataseries[]=array($commandestatic->LibStatut($status, 1), (isset($vals[$status])?(int) $vals[$status]:0));
if (! $conf->use_javascript_ajax)
{
print '<tr class="oddeven">';
print '<td>'.$commandestatic->LibStatut($statut, 0).'</td>';
print '<td class="right"><a href="list.php?statut='.$statut.'">'.(isset($vals[$statut])?$vals[$statut]:0).'</a></td>';
print '<td>'.$commandestatic->LibStatut($status, 0).'</td>';
print '<td class="right"><a href="list.php?statut='.$status.'">'.(isset($vals[$status])?$vals[$status]:0).'</a></td>';
print "</tr>\n";
}
}

View File

@ -823,44 +823,44 @@ class Livraison extends CommonObject
/**
* Renvoi le libelle d'un statut donne
*
* @param int $statut Id statut
* @param int $status Id status
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Label
*/
public function LibStatut($statut, $mode)
public function LibStatut($status, $mode)
{
// phpcs:enable
global $langs;
if ($mode==0)
{
if ($statut==-1) return $langs->trans('StatusDeliveryCanceled');
elseif ($statut==0) return $langs->trans('StatusDeliveryDraft');
elseif ($statut==1) return $langs->trans('StatusDeliveryValidated');
if ($status==-1) return $langs->trans('StatusDeliveryCanceled');
elseif ($status==0) return $langs->trans('StatusDeliveryDraft');
elseif ($status==1) return $langs->trans('StatusDeliveryValidated');
}
elseif ($mode==1)
{
if ($statut==-1) return $langs->trans($this->statuts[$statut]);
elseif ($statut==0) return $langs->trans($this->statuts[$statut]);
elseif ($statut==1) return $langs->trans($this->statuts[$statut]);
if ($status==-1) return $langs->trans($this->statuts[$status]);
elseif ($status==0) return $langs->trans($this->statuts[$status]);
elseif ($status==1) return $langs->trans($this->statuts[$status]);
}
elseif ($mode == 3)
{
if ($statut==-1) return img_picto($langs->trans('StatusDeliveryCanceled'), 'statut5');
if ($statut==0) return img_picto($langs->trans('StatusDeliveryDraft'), 'statut0');
if ($statut==1) return img_picto($langs->trans('StatusDeliveryValidated'), 'statut4');
if ($status==-1) return img_picto($langs->trans('StatusDeliveryCanceled'), 'statut5');
if ($status==0) return img_picto($langs->trans('StatusDeliveryDraft'), 'statut0');
if ($status==1) return img_picto($langs->trans('StatusDeliveryValidated'), 'statut4');
}
elseif ($mode == 4)
{
if ($statut==-1) return img_picto($langs->trans('StatusDeliveryCanceled'), 'statut5').' '.$langs->trans('StatusDeliveryCanceled');
elseif ($statut==0) return img_picto($langs->trans('StatusDeliveryDraft'), 'statut0').' '.$langs->trans('StatusDeliveryDraft');
elseif ($statut==1) return img_picto($langs->trans('StatusDeliveryValidated'), 'statut4').' '.$langs->trans('StatusDeliveryValidated');
if ($status==-1) return img_picto($langs->trans('StatusDeliveryCanceled'), 'statut5').' '.$langs->trans('StatusDeliveryCanceled');
elseif ($status==0) return img_picto($langs->trans('StatusDeliveryDraft'), 'statut0').' '.$langs->trans('StatusDeliveryDraft');
elseif ($status==1) return img_picto($langs->trans('StatusDeliveryValidated'), 'statut4').' '.$langs->trans('StatusDeliveryValidated');
}
elseif ($mode == 6)
{
if ($statut==-1) return $langs->trans('StatusDeliveryCanceled').' '.img_picto($langs->trans('StatusDeliveryCanceled'), 'statut5');
elseif ($statut==0) return $langs->trans('StatusDeliveryDraft').' '.img_picto($langs->trans('StatusDeliveryDraft'), 'statut0');
elseif ($statut==1) return $langs->trans('StatusDeliveryValidated').' '.img_picto($langs->trans('StatusDeliveryValidated'), 'statut4');
if ($status==-1) return $langs->trans('StatusDeliveryCanceled').' '.img_picto($langs->trans('StatusDeliveryCanceled'), 'statut5');
elseif ($status==0) return $langs->trans('StatusDeliveryDraft').' '.img_picto($langs->trans('StatusDeliveryDraft'), 'statut0');
elseif ($status==1) return $langs->trans('StatusDeliveryValidated').' '.img_picto($langs->trans('StatusDeliveryValidated'), 'statut4');
}
}

View File

@ -402,12 +402,12 @@ class Loan extends CommonObject
/**
* Return label for given status
*
* @param int $statut Id statut
* @param int $status Id status
* @param int $mode 0=Label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Label, 5=Short label + Picto
* @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
* @return string Label
*/
public function LibStatut($statut, $mode = 0, $alreadypaid = -1)
public function LibStatut($status, $mode = 0, $alreadypaid = -1)
{
// phpcs:enable
global $langs;
@ -415,38 +415,38 @@ class Loan extends CommonObject
if ($mode == 0 || $mode == 1)
{
if ($statut == 0) return $langs->trans("Unpaid");
elseif ($statut == 1) return $langs->trans("Paid");
if ($status == 0) return $langs->trans("Unpaid");
elseif ($status == 1) return $langs->trans("Paid");
}
elseif ($mode == 2)
{
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
elseif ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
elseif ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
if ($status == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
elseif ($status == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
elseif ($status == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
}
elseif ($mode == 3)
{
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1');
elseif ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3');
elseif ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6');
if ($status == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1');
elseif ($status == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3');
elseif ($status == 1) return img_picto($langs->trans("Paid"), 'statut6');
}
elseif ($mode == 4)
{
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
elseif ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
elseif ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
if ($status == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
elseif ($status == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
elseif ($status == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
}
elseif ($mode == 5)
{
if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
elseif ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
elseif ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
if ($status == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
elseif ($status == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
elseif ($status == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
}
elseif ($mode == 6)
{
if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
elseif ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
elseif ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
if ($status == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
elseif ($status == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
elseif ($status == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
}
else return "Error, mode/status not found";

View File

@ -501,11 +501,11 @@ class Productlot extends CommonObject
/**
* Return label of a given status
*
* @param int $statut Status
* @param int $status Status
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Label of status
*/
public function LibStatut($statut, $mode = 0)
public function LibStatut($status, $mode = 0)
{
// phpcs:enable
global $langs;

View File

@ -1839,11 +1839,11 @@ class Task extends CommonObject
/**
* Return status label for an object
*
* @param int $statut Id statut
* @param int $status Id status
* @param integer $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Label
*/
public function LibStatut($statut, $mode = 0)
public function LibStatut($status, $mode = 0)
{
// phpcs:enable
// list of Statut of the task
@ -1862,59 +1862,59 @@ class Task extends CommonObject
if ($mode == 0)
{
return $langs->trans($this->statuts[$statut]);
return $langs->trans($this->statuts[$status]);
}
elseif ($mode == 1)
{
return $langs->trans($this->statuts_short[$statut]);
return $langs->trans($this->statuts_short[$status]);
}
elseif ($mode == 2)
{
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0').' '.$langs->trans($this->statuts_short[$statut]);
elseif ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut1').' '.$langs->trans($this->statuts_short[$statut]);
elseif ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut3').' '.$langs->trans($this->statuts_short[$statut]);
elseif ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6').' '.$langs->trans($this->statuts_short[$statut]);
elseif ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6').' '.$langs->trans($this->statuts_short[$statut]);
elseif ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut5').' '.$langs->trans($this->statuts_short[$statut]);
if ($status==0) return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts_short[$status]);
elseif ($status==1) return img_picto($langs->trans($this->statuts_short[$status]), 'statut1').' '.$langs->trans($this->statuts_short[$status]);
elseif ($status==2) return img_picto($langs->trans($this->statuts_short[$status]), 'statut3').' '.$langs->trans($this->statuts_short[$status]);
elseif ($status==3) return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts_short[$status]);
elseif ($status==4) return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts_short[$status]);
elseif ($status==5) return img_picto($langs->trans($this->statuts_short[$status]), 'statut5').' '.$langs->trans($this->statuts_short[$status]);
}
elseif ($mode == 3)
{
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0');
elseif ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut1');
elseif ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut3');
elseif ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6');
elseif ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6');
elseif ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut5');
if ($status==0) return img_picto($langs->trans($this->statuts_short[$status]), 'statut0');
elseif ($status==1) return img_picto($langs->trans($this->statuts_short[$status]), 'statut1');
elseif ($status==2) return img_picto($langs->trans($this->statuts_short[$status]), 'statut3');
elseif ($status==3) return img_picto($langs->trans($this->statuts_short[$status]), 'statut6');
elseif ($status==4) return img_picto($langs->trans($this->statuts_short[$status]), 'statut6');
elseif ($status==5) return img_picto($langs->trans($this->statuts_short[$status]), 'statut5');
}
elseif ($mode == 4)
{
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0').' '.$langs->trans($this->statuts[$statut]);
elseif ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut1').' '.$langs->trans($this->statuts[$statut]);
elseif ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut3').' '.$langs->trans($this->statuts[$statut]);
elseif ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6').' '.$langs->trans($this->statuts[$statut]);
elseif ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6').' '.$langs->trans($this->statuts[$statut]);
elseif ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]), 'statut5').' '.$langs->trans($this->statuts[$statut]);
if ($status==0) return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts[$status]);
elseif ($status==1) return img_picto($langs->trans($this->statuts_short[$status]), 'statut1').' '.$langs->trans($this->statuts[$status]);
elseif ($status==2) return img_picto($langs->trans($this->statuts_short[$status]), 'statut3').' '.$langs->trans($this->statuts[$status]);
elseif ($status==3) return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts[$status]);
elseif ($status==4) return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts[$status]);
elseif ($status==5) return img_picto($langs->trans($this->statuts_short[$status]), 'statut5').' '.$langs->trans($this->statuts[$status]);
}
elseif ($mode == 5)
{
/*if ($statut==0) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
elseif ($statut==1) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut1');
elseif ($statut==2) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut3');
elseif ($statut==3) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
elseif ($statut==4) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
elseif ($statut==5) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut5');
/*if ($status==0) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut0');
elseif ($status==1) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut1');
elseif ($status==2) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut3');
elseif ($status==3) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut6');
elseif ($status==4) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut6');
elseif ($status==5) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut5');
*/
//else return $this->progress.' %';
return '&nbsp;';
}
elseif ($mode == 6)
{
/*if ($statut==0) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
elseif ($statut==1) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut1');
elseif ($statut==2) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut3');
elseif ($statut==3) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
elseif ($statut==4) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
elseif ($statut==5) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut5');
/*if ($status==0) return $langs->trans($this->statuts[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut0');
elseif ($status==1) return $langs->trans($this->statuts[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut1');
elseif ($status==2) return $langs->trans($this->statuts[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut3');
elseif ($status==3) return $langs->trans($this->statuts[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut6');
elseif ($status==4) return $langs->trans($this->statuts[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut6');
elseif ($status==5) return $langs->trans($this->statuts[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut5');
*/
//else return $this->progress.' %';
return '&nbsp;';

View File

@ -1136,44 +1136,44 @@ class Reception extends CommonObject
/**
* Return label of a status
*
* @param int $statut Id statut
* @param int $status Id status
* @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto
* @return string Label of status
*/
public function LibStatut($statut, $mode)
public function LibStatut($status, $mode)
{
// phpcs:enable
global $langs;
if ($mode==0)
{
if ($statut==0) return $langs->trans($this->statuts[$statut]);
elseif ($statut==1) return $langs->trans($this->statuts[$statut]);
elseif ($statut==2) return $langs->trans($this->statuts[$statut]);
if ($status==0) return $langs->trans($this->statuts[$status]);
elseif ($status==1) return $langs->trans($this->statuts[$status]);
elseif ($status==2) return $langs->trans($this->statuts[$status]);
}
elseif ($mode==1)
{
if ($statut==0) return $langs->trans('StatusReceptionDraftShort');
elseif ($statut==1) return $langs->trans('StatusReceptionValidatedShort');
elseif ($statut==2) return $langs->trans('StatusReceptionProcessedShort');
if ($status==0) return $langs->trans('StatusReceptionDraftShort');
elseif ($status==1) return $langs->trans('StatusReceptionValidatedShort');
elseif ($status==2) return $langs->trans('StatusReceptionProcessedShort');
}
elseif ($mode == 3)
{
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]), 'statut0');
elseif ($statut==1) return img_picto($langs->trans($this->statuts[$statut]), 'statut4');
elseif ($statut==2) return img_picto($langs->trans('StatusReceptionProcessed'), 'statut6');
if ($status==0) return img_picto($langs->trans($this->statuts[$status]), 'statut0');
elseif ($status==1) return img_picto($langs->trans($this->statuts[$status]), 'statut4');
elseif ($status==2) return img_picto($langs->trans('StatusReceptionProcessed'), 'statut6');
}
elseif ($mode == 4)
{
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]), 'statut0').' '.$langs->trans($this->statuts[$statut]);
elseif ($statut==1) return img_picto($langs->trans($this->statuts[$statut]), 'statut4').' '.$langs->trans($this->statuts[$statut]);
elseif ($statut==2) return img_picto($langs->trans('StatusReceptionProcessed'), 'statut6').' '.$langs->trans('StatusReceptionProcessed');
if ($status==0) return img_picto($langs->trans($this->statuts[$status]), 'statut0').' '.$langs->trans($this->statuts[$status]);
elseif ($status==1) return img_picto($langs->trans($this->statuts[$status]), 'statut4').' '.$langs->trans($this->statuts[$status]);
elseif ($status==2) return img_picto($langs->trans('StatusReceptionProcessed'), 'statut6').' '.$langs->trans('StatusReceptionProcessed');
}
elseif ($mode == 5)
{
if ($statut==0) return $langs->trans('StatusReceptionDraftShort').' '.img_picto($langs->trans($this->statuts[$statut]), 'statut0');
elseif ($statut==1) return $langs->trans('StatusReceptionValidatedShort').' '.img_picto($langs->trans($this->statuts[$statut]), 'statut4');
elseif ($statut==2) return $langs->trans('StatusReceptionProcessedShort').' '.img_picto($langs->trans('StatusReceptionProcessedShort'), 'statut6');
if ($status==0) return $langs->trans('StatusReceptionDraftShort').' '.img_picto($langs->trans($this->statuts[$status]), 'statut0');
elseif ($status==1) return $langs->trans('StatusReceptionValidatedShort').' '.img_picto($langs->trans($this->statuts[$status]), 'statut4');
elseif ($status==2) return $langs->trans('StatusReceptionProcessedShort').' '.img_picto($langs->trans('StatusReceptionProcessedShort'), 'statut6');
}
}

View File

@ -1169,123 +1169,123 @@ class Ticket extends CommonObject
/**
* Return status label of object
*
* @param string $statut id statut
* @param string $status Id status
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
* @return string Label
*/
public function LibStatut($statut, $mode = 0)
public function LibStatut($status, $mode = 0)
{
// phpcs:enable
global $langs;
if ($mode == 0) {
return $langs->trans($this->statuts[$statut]);
return $langs->trans($this->statuts[$status]);
}
elseif ($mode == 1) {
return $langs->trans($this->statuts_short[$statut]);
return $langs->trans($this->statuts_short[$status]);
}
elseif ($mode == 2) {
if ($statut == self::STATUS_NOT_READ) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
if ($status == self::STATUS_NOT_READ) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut0.png@ticket') . ' ' . $langs->trans($this->statuts_short[$status]);
}
elseif ($statut == self::STATUS_READ) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut1.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
elseif ($status == self::STATUS_READ) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut1.png@ticket') . ' ' . $langs->trans($this->statuts_short[$status]);
}
elseif ($statut == self::STATUS_ASSIGNED) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut2.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
elseif ($status == self::STATUS_ASSIGNED) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut2.png@ticket') . ' ' . $langs->trans($this->statuts_short[$status]);
}
elseif ($statut == self::STATUS_IN_PROGRESS) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut3.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
elseif ($status == self::STATUS_IN_PROGRESS) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut3.png@ticket') . ' ' . $langs->trans($this->statuts_short[$status]);
}
elseif ($statut == self::STATUS_NEED_MORE_INFO) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut5.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
elseif ($status == self::STATUS_NEED_MORE_INFO) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut5.png@ticket') . ' ' . $langs->trans($this->statuts_short[$status]);
}
elseif ($statut == self::STATUS_WAITING) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
elseif ($status == self::STATUS_WAITING) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut6.png@ticket') . ' ' . $langs->trans($this->statuts_short[$status]);
}
elseif ($statut == self::STATUS_CLOSED) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut8.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
elseif ($status == self::STATUS_CLOSED) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut8.png@ticket') . ' ' . $langs->trans($this->statuts_short[$status]);
}
elseif ($statut == self::STATUS_CANCELED) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut9.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
elseif ($status == self::STATUS_CANCELED) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut9.png@ticket') . ' ' . $langs->trans($this->statuts_short[$status]);
}
}
elseif ($mode == 3) {
if ($statut == self::STATUS_NOT_READ) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0.png@ticket');
if ($status == self::STATUS_NOT_READ) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut0.png@ticket');
}
elseif ($statut == self::STATUS_READ) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut1.png@ticket');
elseif ($status == self::STATUS_READ) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut1.png@ticket');
}
elseif ($statut == self::STATUS_ASSIGNED) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut2.png@ticket');
elseif ($status == self::STATUS_ASSIGNED) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut2.png@ticket');
}
elseif ($statut == self::STATUS_IN_PROGRESS) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut3.png@ticket');
elseif ($status == self::STATUS_IN_PROGRESS) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut3.png@ticket');
}
elseif ($statut == self::STATUS_NEED_MORE_INFO) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut5.png@ticket');
elseif ($status == self::STATUS_NEED_MORE_INFO) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut5.png@ticket');
}
elseif ($statut == self::STATUS_WAITING) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6.png@ticket');
elseif ($status == self::STATUS_WAITING) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut6.png@ticket');
}
elseif ($statut == self::STATUS_CLOSED) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut8.png@ticket');
elseif ($status == self::STATUS_CLOSED) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut8.png@ticket');
}
elseif ($statut == self::STATUS_CANCELED) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut9.png@ticket');
elseif ($status == self::STATUS_CANCELED) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut9.png@ticket');
}
}
elseif ($mode == 4) {
if ($statut == self::STATUS_NOT_READ) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
if ($status == self::STATUS_NOT_READ) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut0.png@ticket') . ' ' . $langs->trans($this->statuts_short[$status]);
}
elseif ($statut == self::STATUS_READ) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut1.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
elseif ($status == self::STATUS_READ) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut1.png@ticket') . ' ' . $langs->trans($this->statuts_short[$status]);
}
elseif ($statut == self::STATUS_ASSIGNED) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut2.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
elseif ($status == self::STATUS_ASSIGNED) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut2.png@ticket') . ' ' . $langs->trans($this->statuts_short[$status]);
}
elseif ($statut == self::STATUS_IN_PROGRESS) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut3.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
elseif ($status == self::STATUS_IN_PROGRESS) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut3.png@ticket') . ' ' . $langs->trans($this->statuts_short[$status]);
}
elseif ($statut == self::STATUS_NEED_MORE_INFO) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut5.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
elseif ($status == self::STATUS_NEED_MORE_INFO) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut5.png@ticket') . ' ' . $langs->trans($this->statuts_short[$status]);
}
elseif ($statut == self::STATUS_WAITING) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
elseif ($status == self::STATUS_WAITING) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut6.png@ticket') . ' ' . $langs->trans($this->statuts_short[$status]);
}
elseif ($statut == self::STATUS_CLOSED) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut8.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
elseif ($status == self::STATUS_CLOSED) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut8.png@ticket') . ' ' . $langs->trans($this->statuts_short[$status]);
}
elseif ($statut == self::STATUS_CANCELED) {
return img_picto($langs->trans($this->statuts_short[$statut]), 'statut9.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]);
elseif ($status == self::STATUS_CANCELED) {
return img_picto($langs->trans($this->statuts_short[$status]), 'statut9.png@ticket') . ' ' . $langs->trans($this->statuts_short[$status]);
}
}
elseif ($mode == 5 || $mode == 6) {
if ($statut == self::STATUS_NOT_READ) {
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut0.png@ticket');
if ($status == self::STATUS_NOT_READ) {
return $langs->trans($this->statuts_short[$status]) . ' ' . img_picto($langs->trans($this->statuts_short[$status]), 'statut0.png@ticket');
}
elseif ($statut == self::STATUS_READ) {
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut1.png@ticket');
elseif ($status == self::STATUS_READ) {
return $langs->trans($this->statuts_short[$status]) . ' ' . img_picto($langs->trans($this->statuts_short[$status]), 'statut1.png@ticket');
}
elseif ($statut == self::STATUS_ASSIGNED) {
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut2.png@ticket');
elseif ($status == self::STATUS_ASSIGNED) {
return $langs->trans($this->statuts_short[$status]) . ' ' . img_picto($langs->trans($this->statuts_short[$status]), 'statut2.png@ticket');
}
elseif ($statut == self::STATUS_IN_PROGRESS) {
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut3.png@ticket');
elseif ($status == self::STATUS_IN_PROGRESS) {
return $langs->trans($this->statuts_short[$status]) . ' ' . img_picto($langs->trans($this->statuts_short[$status]), 'statut3.png@ticket');
}
elseif ($statut == self::STATUS_NEED_MORE_INFO) {
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut5.png@ticket');
elseif ($status == self::STATUS_NEED_MORE_INFO) {
return $langs->trans($this->statuts_short[$status]) . ' ' . img_picto($langs->trans($this->statuts_short[$status]), 'statut5.png@ticket');
}
elseif ($statut == self::STATUS_WAITING) {
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut6.png@ticket');
elseif ($status == self::STATUS_WAITING) {
return $langs->trans($this->statuts_short[$status]) . ' ' . img_picto($langs->trans($this->statuts_short[$status]), 'statut6.png@ticket');
}
elseif ($statut == self::STATUS_CLOSED) {
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut8.png@ticket');
elseif ($status == self::STATUS_CLOSED) {
return $langs->trans($this->statuts_short[$status]) . ' ' . img_picto($langs->trans($this->statuts_short[$status]), 'statut8.png@ticket');
}
elseif ($statut == self::STATUS_CANCELED) {
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut9.png@ticket');
elseif ($status == self::STATUS_CANCELED) {
return $langs->trans($this->statuts_short[$status]) . ' ' . img_picto($langs->trans($this->statuts_short[$status]), 'statut9.png@ticket');
}
}
}
@ -2228,13 +2228,13 @@ class Ticket extends CommonObject
* Get array of all contacts for a ticket
* Override method of file commonobject.class.php to add phone number
*
* @param int $statut Status of lines to get (-1=all)
* @param int $status Status of lines to get (-1=all)
* @param string $source Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user)
* @param int $list 0:Return array contains all properties, 1:Return array contains just id
* @param string $code Filter on this code of contact type ('SHIPPING', 'BILLING', ...)
* @return array Array of contacts
*/
public function listeContact($statut = -1, $source = 'external', $list = 0, $code = '')
public function listeContact($status = -1, $source = 'external', $list = 0, $code = '')
{
global $langs;
@ -2281,8 +2281,8 @@ class Ticket extends CommonObject
}
$sql .= " AND tc.active=1";
if ($statut >= 0) {
$sql .= " AND ec.statut = '" . $statut . "'";
if ($status >= 0) {
$sql .= " AND ec.statut = '" . $status . "'";
}
$sql .= " ORDER BY t.lastname ASC";

View File

@ -836,11 +836,11 @@ class UserGroup extends CommonObject
/**
* Renvoi le libelle d'un statut donne
*
* @param int $statut Id statut
* @param int $status Id status
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Label of status
*/
public function LibStatut($statut, $mode = 0)
public function LibStatut($status, $mode = 0)
{
// phpcs:enable
global $langs;