Merge remote-tracking branch 'upstream/develop' into socid

This commit is contained in:
Frédéric FRANCE 2019-11-02 09:14:15 +01:00
commit 77d4ca81dc
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
39 changed files with 470 additions and 507 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

@ -57,7 +57,16 @@ if ($object->fetch($id) >= 0)
$linkback = '<a href="'.DOL_URL_ROOT.'/comm/mailing/list.php">'.$langs->trans("BackToList").'</a>';
$morehtmlright='';
if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') ';
$nbtry = $nbok = 0;
if ($object->statut == 2 || $object->statut == 3)
{
$nbtry = $object->countNbOfTargets('alreadysent');
$nbko = $object->countNbOfTargets('alreadysentko');
$morehtmlright.=' ('.$nbtry.'/'.$object->nbemail;
if ($nbko) $morehtmlright.=' - '.$nbko.' '.$langs->trans("Error");
$morehtmlright.=') &nbsp; ';
}
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright);

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

@ -1029,7 +1029,7 @@ class ExtraFields
{
$morecss = 'minwidth100imp';
}
elseif ($type == 'datetime')
elseif ($type == 'datetime' || $type == 'link')
{
$morecss = 'minwidth200imp';
}

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

@ -1122,13 +1122,20 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
{
global $conf, $langs, $hookmanager;
$out="\n".'<!-- dol_get_fiche_head --><div class="tabs" data-role="controlgroup" data-type="horizontal">'."\n";
if ($morehtmlright) $out.='<div class="inline-block floatright tabsElem">'.$morehtmlright.'</div>'; // Output right area first so when space is missing, text is in front of tabs and not under.
// Show title
$showtitle=1;
if (! empty($conf->dol_optimize_smallscreen)) $showtitle=0;
$out = "\n".'<!-- dol_get_fiche_head -->';
if ((! empty($title) && $showtitle) || $morehtmlright || ! empty($links)) {
$out.= '<div class="tabs" data-role="controlgroup" data-type="horizontal">'."\n";
}
// Show right part
if ($morehtmlright) $out.='<div class="inline-block floatright tabsElem">'.$morehtmlright.'</div>'; // Output right area first so when space is missing, text is in front of tabs and not under.
// Show title
if (! empty($title) && $showtitle)
{
$limittitle=30;
@ -1138,6 +1145,8 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
$out.='</a>';
}
// Show tabs
// Define max of key (max may be higher than sizeof because of hole due to module disabling some tabs).
$maxkey=-1;
if (is_array($links) && ! empty($links))
@ -1149,16 +1158,15 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
if (! empty($conf->dol_optimize_smallscreen)) $conf->global->MAIN_MAXTABS_IN_CARD=2;
// Show tabs
$bactive=false;
// if =0 we don't use the feature
$limittoshow=(empty($conf->global->MAIN_MAXTABS_IN_CARD)?99:$conf->global->MAIN_MAXTABS_IN_CARD);
$displaytab=0;
$nbintab=0;
$popuptab=0; $outmore='';
$popuptab=0;
$outmore='';
for ($i = 0 ; $i <= $maxkey ; $i++)
{
if ((is_numeric($active) && $i == $active) || (! empty($links[$i][2]) && ! is_numeric($active) && $active == $links[$i][2]))
{
if ((is_numeric($active) && $i == $active) || (! empty($links[$i][2]) && ! is_numeric($active) && $active == $links[$i][2])) {
// If active tab is already present
if ($i >= $limittoshow) $limittoshow--;
}
@ -1166,13 +1174,10 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
for ($i = 0 ; $i <= $maxkey ; $i++)
{
if ((is_numeric($active) && $i == $active) || (! empty($links[$i][2]) && ! is_numeric($active) && $active == $links[$i][2]))
{
if ((is_numeric($active) && $i == $active) || (! empty($links[$i][2]) && ! is_numeric($active) && $active == $links[$i][2])) {
$isactive=true;
$bactive=true;
}
else
{
else {
$isactive=false;
}
@ -1258,7 +1263,9 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
$out.="</script>";
}
$out.="</div>\n";
if ((! empty($title) && $showtitle) || $morehtmlright || ! empty($links)) {
$out.="</div>\n";
}
if (! $notab || $notab == -1 || $notab == -2) $out.="\n".'<div class="tabBar'.($notab == -1 ? '' : ($notab == -2 ? ' tabBarNoTop' : ' tabBarWithBottom')).'">'."\n";
@ -8087,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

@ -1996,6 +1996,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
* @param hideOnProgressNull $hideOnProgressNull bool hide if progress is null
* @param spaced $spaced bool used to add space at bottom (made by css)
* @return string
* @see getTaskProgressBadge()
*/
function getTaskProgressView($task, $label = true, $progressNumber = true, $hideOnProgressNull = false, $spaced = false)
{
@ -2033,7 +2034,7 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide
$title = $langs->trans('TheReportedProgressIsLessThanTheCalculatedProgressionByX', abs($task->progress-$progressCalculated).' '.$langs->trans("point"));
$diff = '<span class="text-danger classfortooltip paddingrightonly" title="'.dol_htmlentities($title.$diffTitle).'" ><i class="fa fa-caret-down"></i> '.($task->progress-$progressCalculated).'%</span>';
}
elseif (doubleval($progressCalculated) > doubleval($task->progress)) { // warning if close at 1%
elseif (doubleval($progressCalculated) > doubleval($task->progress)) { // warning if close at 10%
$progressBarClass = 'progress-bar-warning';
$title = $langs->trans('TheReportedProgressIsLessThanTheCalculatedProgressionByX', abs($task->progress-$progressCalculated).' '.$langs->trans("point"));
$diff = '<span class="text-warning classfortooltip paddingrightonly" title="'.dol_htmlentities($title.$diffTitle).'" ><i class="fa fa-caret-left"></i> '.($task->progress-$progressCalculated).'%</span>';
@ -2116,6 +2117,7 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide
* @param label $label string empty = auto (progress), string = replace output
* @param tooltip $tooltip string empty = auto , string = replace output
* @return string
* @see getTaskProgressView()
*/
function getTaskProgressBadge($task, $label = '', $tooltip = '')
{
@ -2135,10 +2137,10 @@ function getTaskProgressBadge($task, $label = '', $tooltip = '')
// this conf is actually hidden, by default we use 10% for "be carefull or warning"
$warningRatio = !empty($conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT) ? (1 + $conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT / 100) : 1.10;
if($progressCalculated > doubleval($task->progress)){
if (doubleval($progressCalculated) > doubleval($task->progress * $warningRatio)) {
$badgeClass.= 'badge-danger';
}
elseif($progressCalculated * $warningRatio >= doubleval($task->progress)){ // warning if close at 1%
elseif (doubleval($progressCalculated) > doubleval($task->progress)) { // warning if close at 10%
$badgeClass.= 'badge-warning';
}
else{

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;
@ -633,7 +633,6 @@ class PaymentDonation extends CommonObject
$result='';
if (empty($this->ref)) $this->ref=$this->lib;
$label = $langs->trans("ShowPayment").': '.$this->ref;
if (!empty($this->id))

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

@ -1506,7 +1506,7 @@ if ($action == 'create')
print '<tr>';
print '<td>'.$langs->trans("ModePaiement").'</td>';
print '<td>';
$form->select_types_paiements(2, 'fk_c_paiement');
$form->select_types_paiements('', 'fk_c_paiement');
print '</td>';
print '</tr>';
}
@ -1832,7 +1832,7 @@ else
{
print '<tr>';
print '<td>'.$langs->trans("ModePaiement").'</td>';
print '<td>'.$object->libelle_paiement.'</td>';
print '<td>'.$object->fk_c_paiement.'</td>';
print '</tr>';
}

View File

@ -511,7 +511,7 @@ class ExpenseReport extends CommonObject
$sql.= " d.fk_user_author, d.fk_user_modif, d.fk_user_validator,";
$sql.= " d.fk_user_valid, d.fk_user_approve,";
$sql.= " d.fk_statut as status, d.fk_c_paiement, d.paid,";
$sql.= " dp.libelle as libelle_paiement, dp.code as code_paiement"; // INNER JOIN paiement
$sql.= " dp.libelle as label_payment, dp.code as code_paiement"; // INNER JOIN paiement
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element." as d";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as dp ON d.fk_c_paiement = dp.id";
if ($ref) $sql.= " WHERE d.ref = '".$this->db->escape($ref)."'";
@ -567,15 +567,13 @@ class ExpenseReport extends CommonObject
$this->fk_c_paiement = $obj->fk_c_paiement;
$this->paid = $obj->paid;
if ($this->fk_statut==5 || $this->fk_statut==6)
if ($this->fk_statut == self::STATUS_APPROVED || $this->fk_statut == self::STATUS_CLOSED)
{
$user_valid = new User($this->db);
if ($this->fk_user_valid > 0) $user_valid->fetch($this->fk_user_valid);
$this->user_valid_infos = dolGetFirstLastname($user_valid->firstname, $user_valid->lastname);
}
$this->libelle_statut = $obj->libelle_statut;
$this->libelle_paiement = $obj->libelle_paiement;
$this->code_statut = $obj->code_statut;
$this->code_paiement = $obj->code_paiement;

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

@ -221,7 +221,6 @@ if ($result)
print '<td class="right">'.price($obj->total_ttc).'</td>';
print '<td class="right">'.dol_print_date($db->jdate($obj->dm), 'day').'</td>';
print '<td class="right">';
//print $obj->libelle;
print $expensereportstatic->LibStatut($obj->fk_status, 3);
print '</td>';
print '</tr>';

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

@ -545,8 +545,6 @@ class PaymentLoan extends CommonObject
$result='';
if (empty($this->ref)) $this->ref=$this->lib;
if (!empty($this->id))
{
$link = '<a href="'.DOL_URL_ROOT.'/loan/payment/card.php?id='.$this->id.'">';

View File

@ -61,14 +61,9 @@ if (GETPOST('actioncode', 'array'))
}
else
{
$actioncode=GETPOST("actioncode", "alpha", 3)?GETPOST("actioncode", "alpha", 3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
$actioncode = GETPOST("actioncode", "alpha", 3)?GETPOST("actioncode", "alpha", 3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
}
$search_agenda_label=GETPOST('search_agenda_label');
// Security check - Protection if external user
//if ($user->socid > 0) access_forbidden();
//if ($user->socid > 0) $socid = $user->socid;
//$result = restrictedArea($user, 'mymodule', $id);
$search_agenda_label = GETPOST('search_agenda_label');
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
@ -79,10 +74,10 @@ $offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortfield) $sortfield='a.datep,a.id';
if (! $sortorder) $sortorder='DESC';
if (! $sortorder) $sortorder='DESC,DESC';
// Initialize technical objects
$object=new MyObject($db);
$object = new MyObject($db);
$extrafields = new ExtraFields($db);
$diroutputmassaction=$conf->mymodule->dir_output . '/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('myobjectagenda','globalcard')); // Note that conf->hooks_modules contains array
@ -93,13 +88,17 @@ $extrafields->fetch_name_optionals_label($object->table_element);
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
if ($id > 0 || ! empty($ref)) $upload_dir = $conf->mymodule->multidir_output[$object->entity] . "/" . $object->id;
// Security check - Protection if external user
//if ($user->socid > 0) access_forbidden();
//if ($user->socid > 0) $socid = $user->socid;
//$result = restrictedArea($user, 'mymodule', $object->id);
/*
* Actions
* Actions
*/
$parameters=array('id'=>$socid);
$parameters=array('id'=>$id);
$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@ -126,8 +125,6 @@ if (empty($reshook))
* View
*/
$contactstatic = new Contact($db);
$form = new Form($db);
if ($object->id > 0)

View File

@ -163,7 +163,7 @@ if ($resql)
print '<tr class="oddeven">';
print '<td>'.$staticbom->getNomUrl(1, 32).'</td>';
print '<td>'.dol_print_date($db->jdate($obj->datem), 'dayhour').'</td>';
print '<td class="right">'.$staticbom->getLibStatut(5).'</td>';
print '<td class="right">'.$staticbom->getLibStatut(3).'</td>';
print '</tr>';
$i++;
}
@ -216,7 +216,7 @@ if ($resql)
print '<tr class="oddeven">';
print '<td>'.$staticmo->getNomUrl(1, 32).'</td>';
print '<td>'.dol_print_date($db->jdate($obj->datem), 'dayhour').'</td>';
print '<td class="right">'.$staticmo->getLibStatut(5).'</td>';
print '<td class="right">'.$staticmo->getLibStatut(3).'</td>';
print '</tr>';
$i++;
}

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

@ -509,7 +509,7 @@ if ($action == 'create' && $user->rights->projet->creer)
dol_fiche_head();
print '<table class="border" width="100%">';
print '<table class="border centpercent tableforfieldcreate">';
$defaultref='';
$modele = empty($conf->global->PROJECT_ADDON)?'mod_project_simple':$conf->global->PROJECT_ADDON;

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

@ -171,7 +171,7 @@ print_projecttasks_array($db, $form, $socid, $projectsListId, 0, 0, $listofoppst
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
// Last modified projects
// Latest modified projects
$sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut, p.tms as datem,";
$sql.= " s.rowid as socid, s.nom as name, s.email, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.canvas";
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
@ -243,7 +243,7 @@ if ($resql)
}
print '</td>';
print '<td>'.dol_print_date($db->jdate($obj->datem), 'day').'</td>';
print '<td class="right">'.$projectstatic->LibStatut($obj->fk_statut, 5).'</td>';
print '<td class="right">'.$projectstatic->LibStatut($obj->fk_statut, 3).'</td>';
print '</tr>';
$i++;
}

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

@ -37,6 +37,13 @@ require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php';
// Load translation files required by the page
$langs->load("companies");
// Get parameters
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'alpha');
$cancel = GETPOST('cancel', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha');
if (GETPOST('actioncode', 'array'))
{
$actioncode=GETPOST('actioncode', 'array', 3);
@ -48,21 +55,6 @@ else
}
$search_agenda_label=GETPOST('search_agenda_label');
// Security check
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
if ($user->socid) $id=$user->socid;
// Protection if external user
if ($user->socid > 0)
{
accessforbidden();
}
if( ! $user->rights->resource->read)
{
accessforbidden();
}
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
@ -74,9 +66,20 @@ $pagenext = $page + 1;
if (! $sortfield) $sortfield='a.datep,a.id';
if (! $sortorder) $sortorder='DESC,DESC';
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$object = new DolResource($db);
$object->fetch($id, $ref);
// Initialize technical objects
//$object=new MyObject($db);
$extrafields = new ExtraFields($db);
$hookmanager->initHooks(array('agendaresource'));
// Security check
if( ! $user->rights->resource->read)
{
accessforbidden();
}
/*
* Actions
@ -110,10 +113,9 @@ if (empty($reshook))
*/
$contactstatic = new Contact($db);
$form = new Form($db);
if ($id > 0 || $ref)
if ($object->id > 0)
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
@ -121,9 +123,6 @@ if ($id > 0 || $ref)
$langs->load("companies");
$picto = 'resource';
$object = new Dolresource($db);
$result = $object->fetch($id);
$title=$langs->trans("Agenda");
if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/productnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->ref." - ".$title;
llxHeader('', $title);
@ -138,13 +137,15 @@ if ($id > 0 || $ref)
$linkback = '<a href="'.DOL_URL_ROOT.'/resource/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
$morehtmlref='<div class="refidno">';
$morehtmlref.='</div>';
$shownav = 1;
if ($user->socid && ! in_array('resource', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
dol_banner_tab($object, 'id', $linkback, $shownav, 'id');
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '</div>';
@ -153,11 +154,9 @@ if ($id > 0 || $ref)
if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
{
print '<br>';
$param='&id='.$id;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
$param='&id='.$object->id.'&socid='.$socid;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
print_barre_liste($langs->trans("ActionsOnResource"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlcenter, '', 0, 1, 1);

View File

@ -63,9 +63,9 @@ $extrafields->fetch_name_optionals_label($object->table_element);
/*******************************************************************
* ACTIONS
********************************************************************/
/*
* Actions
*/
$hookmanager->initHooks(array('resource', 'resource_card','globalcard'));
$parameters=array('resource_id'=>$id);
@ -211,18 +211,17 @@ if (empty($reshook))
}
/***************************************************
* VIEW
*
* Put here all code to build page
****************************************************/
/*
* View
*/
$title = $langs->trans($action == 'create' ? 'AddResource' : 'ResourceSingular');
llxHeader('', $title, '');
$form = new Form($db);
$formresource = new FormResource($db);
if ($action == 'create' || $object->fetch($id) > 0)
if ($action == 'create' || $object->fetch($id, $ref) > 0)
{
if ($action == 'create')
{

View File

@ -82,7 +82,7 @@ $form = new Form($db);
llxHeader('', $langs->trans("Resource"));
if ($object->id)
if ($object->id > 0)
{
$object->fetch_thirdparty();
@ -100,7 +100,7 @@ if ($object->id)
}
$linkback = '<a href="' . DOL_URL_ROOT . '/resource/list.php' . (! empty($socid) ? '?id=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/resource/list.php' . (! empty($socid) ? '?id=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
$morehtmlref='<div class="refidno">';

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;