From e6eb34a8db26d97c94d4808fa8ec4e7be8c46603 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Nov 2023 10:10:24 +0100 Subject: [PATCH] Fiw warnings: The private array ->status_short, ->statuts and ->status_long are now array ->labelStatusShort and ->labelStatus everywhere. --- ChangeLog | 1 + htdocs/api/class/api.class.php | 5 -- htdocs/comm/mailing/class/mailing.class.php | 16 ++-- .../class/ligneprelevement.class.php | 28 +++--- htdocs/core/class/commoninvoice.class.php | 5 ++ htdocs/core/class/commonobject.class.php | 26 ++---- .../class/html.formexpensereport.class.php | 4 +- htdocs/core/lib/project.lib.php | 2 +- .../doc/pdf_standard.modules.php | 2 +- ...face_95_modZapier_ZapierTriggers.class.php | 6 +- htdocs/delivery/class/delivery.class.php | 10 +-- htdocs/expedition/class/expedition.class.php | 24 ++--- .../class/expensereport.class.php | 18 ++-- htdocs/expensereport/stats/index.php | 2 +- .../class/api_interventions.class.php | 5 +- htdocs/fichinter/class/fichinterrec.class.php | 13 +-- .../class/fournisseur.commande.class.php | 48 +++++----- .../fournisseur.commande.dispatch.class.php | 36 ++++---- htdocs/holiday/class/holiday.class.php | 6 +- htdocs/product/class/product.class.php | 2 +- htdocs/product/stock/card.php | 4 +- htdocs/product/stock/class/entrepot.class.php | 14 +-- htdocs/product/stock/list.php | 2 +- htdocs/projet/card.php | 2 +- htdocs/projet/class/project.class.php | 10 +-- htdocs/projet/class/task.class.php | 88 +++++++++---------- htdocs/projet/tasks/list.php | 2 +- htdocs/ticket/card.php | 2 +- htdocs/ticket/class/actions_ticket.class.php | 6 +- htdocs/ticket/class/api_tickets.class.php | 4 +- htdocs/ticket/class/ticket.class.php | 18 ++-- htdocs/ticket/index.php | 16 ++-- htdocs/ticket/list.php | 2 +- 33 files changed, 206 insertions(+), 223 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4ae175c119f..2a5fdc83f7d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -238,6 +238,7 @@ The following changes may create regressions for some external modules, but were * The property ->user_validation to store ID of user validating has been renamed into ->user_validation_id. * The property ->user_creation to store ID of user of creation has been renamed into ->user_creation_id. * The property ->user_modification to store ID of user of modification has been renamed into ->user_modification_id. +* The private array ->status_short, ->statuts and ->status_long are now array ->labelStatusShort and ->labelStatus everywhere. * The duplicate property ->user_creat, ->date_creat, ->date_valid has been removed (use instead user_creation, date_creation, date_validation). * The method get_substitutionarray_shipment_lines() has been removed. Use the generic get_substitutionarray_lines() instead. * The method ProductcustomerPrice->fetch_all_log() has been renamed into camel case ->fetchAllLog() diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php index fbd57d7afc3..868b03304e5 100644 --- a/htdocs/api/class/api.class.php +++ b/htdocs/api/class/api.class.php @@ -179,11 +179,6 @@ class DolibarrApi unset($object->alreadypaid); unset($object->openid); - unset($object->statuts); - unset($object->statuts_short); - unset($object->statuts_logo); - unset($object->statuts_long); - //unset($object->labelStatus); //unset($object->labelStatusShort); diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index f8d51b74787..bb9c16db08e 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -188,9 +188,9 @@ class Mailing extends CommonObject public $statut_dest = array(); /** - * @var array statuts + * @var array labelStatus */ - public $statuts = array(); + public $labelStatus = array(); /** * @var array substitutionarray @@ -220,10 +220,10 @@ class Mailing extends CommonObject $this->db = $db; // List of language codes for status - $this->statuts[0] = 'MailingStatusDraft'; - $this->statuts[1] = 'MailingStatusValidated'; - $this->statuts[2] = 'MailingStatusSentPartialy'; - $this->statuts[3] = 'MailingStatusSentCompletely'; + $this->labelStatus[0] = 'MailingStatusDraft'; + $this->labelStatus[1] = 'MailingStatusValidated'; + $this->labelStatus[2] = 'MailingStatusSentPartialy'; + $this->labelStatus[3] = 'MailingStatusSentCompletely'; $this->statut_dest[0] = 'MailingStatusNotSent'; $this->statut_dest[1] = 'MailingStatusSent'; @@ -893,8 +893,8 @@ class Mailing extends CommonObject global $langs; $langs->load("mailing"); - $labelStatus = $langs->transnoentitiesnoconv($this->statuts[$status]); - $labelStatusShort = $langs->transnoentitiesnoconv($this->statuts[$status]); + $labelStatus = $langs->transnoentitiesnoconv($this->labelStatus[$status]); + $labelStatusShort = $langs->transnoentitiesnoconv($this->labelStatus[$status]); $statusType = 'status'.$status; if ($status == 2) { diff --git a/htdocs/compta/prelevement/class/ligneprelevement.class.php b/htdocs/compta/prelevement/class/ligneprelevement.class.php index 36758d310c2..8b65dd77537 100644 --- a/htdocs/compta/prelevement/class/ligneprelevement.class.php +++ b/htdocs/compta/prelevement/class/ligneprelevement.class.php @@ -66,7 +66,7 @@ class LignePrelevement */ public $db; - public $statuts = array(); + public $labelStatus = array(); const STATUS_DRAFT = 0; const STATUS_NOT_USED = 1; @@ -89,9 +89,9 @@ class LignePrelevement // List of language codes for status $langs->load("withdrawals"); - $this->statuts[0] = $langs->trans("StatusWaiting"); - $this->statuts[2] = $langs->trans("StatusPaid"); - $this->statuts[3] = $langs->trans("StatusRefused"); + $this->labelStatus[0] = $langs->trans("StatusWaiting"); + $this->labelStatus[2] = $langs->trans("StatusPaid"); + $this->labelStatus[3] = $langs->trans("StatusRefused"); } /** @@ -165,30 +165,30 @@ class LignePrelevement global $langs; if ($mode == 0) { - return $langs->trans($this->statuts[$status]); + return $langs->trans($this->labelStatus[$status]); } elseif ($mode == 1) { if ($status == 0) { - return img_picto($langs->trans($this->statuts[$status]), 'statut1', 'class="valignmiddle"').' '.$langs->transnoentitiesnoconv($this->statuts[$status]); // Waiting + return img_picto($langs->trans($this->labelStatus[$status]), 'statut1', 'class="valignmiddle"').' '.$langs->transnoentitiesnoconv($this->labelStatus[$status]); // Waiting } elseif ($status == 2) { - return img_picto($langs->trans($this->statuts[$status]), 'statut6', 'class="valignmiddle"').' '.$langs->transnoentitiesnoconv($this->statuts[$status]); // Credited + return img_picto($langs->trans($this->labelStatus[$status]), 'statut6', 'class="valignmiddle"').' '.$langs->transnoentitiesnoconv($this->labelStatus[$status]); // Credited } elseif ($status == 3) { - return img_picto($langs->trans($this->statuts[$status]), 'statut8', 'class="valignmiddle"').' '.$langs->transnoentitiesnoconv($this->statuts[$status]); // Refused + return img_picto($langs->trans($this->labelStatus[$status]), 'statut8', 'class="valignmiddle"').' '.$langs->transnoentitiesnoconv($this->labelStatus[$status]); // Refused } } elseif ($mode == 2) { if ($status == 0) { - return img_picto($langs->trans($this->statuts[$status]), 'statut1', 'class="valignmiddle"'); + return img_picto($langs->trans($this->labelStatus[$status]), 'statut1', 'class="valignmiddle"'); } elseif ($status == 2) { - return img_picto($langs->trans($this->statuts[$status]), 'statut6', 'class="valignmiddle"'); + return img_picto($langs->trans($this->labelStatus[$status]), 'statut6', 'class="valignmiddle"'); } elseif ($status == 3) { - return img_picto($langs->trans($this->statuts[$status]), 'statut8', 'class="valignmiddle"'); + return img_picto($langs->trans($this->labelStatus[$status]), 'statut8', 'class="valignmiddle"'); } } elseif ($mode == 3) { if ($status == 0) { - return $langs->trans($this->statuts[$status]).' '.img_picto($langs->transnoentitiesnoconv($this->statuts[$status]), 'statut1', 'class="valignmiddle"'); + return $langs->trans($this->labelStatus[$status]).' '.img_picto($langs->transnoentitiesnoconv($this->labelStatus[$status]), 'statut1', 'class="valignmiddle"'); } elseif ($status == 2) { - return $langs->trans($this->statuts[$status]).' '.img_picto($langs->transnoentitiesnoconv($this->statuts[$status]), 'statut6', 'class="valignmiddle"'); + return $langs->trans($this->labelStatus[$status]).' '.img_picto($langs->transnoentitiesnoconv($this->labelStatus[$status]), 'statut6', 'class="valignmiddle"'); } elseif ($status == 3) { - return $langs->trans($this->statuts[$status]).' '.img_picto($langs->transnoentitiesnoconv($this->statuts[$status]), 'statut8', 'class="valignmiddle"'); + return $langs->trans($this->labelStatus[$status]).' '.img_picto($langs->transnoentitiesnoconv($this->labelStatus[$status]), 'statut8', 'class="valignmiddle"'); } } //return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 8bb1907cd3b..dba7c6a4d2e 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -34,6 +34,11 @@ abstract class CommonInvoice extends CommonObject { use CommonIncoterm; + /** + * @var string Label used as ref for template invoices + */ + public $title; + /** * @var int Type of invoice (See TYPE_XXX constants) */ diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 1ef60a21f49..68344c03756 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -682,25 +682,17 @@ abstract class CommonObject /** * @var array Array with label of status */ - public $labelStatus; - - /** - * @var array array of status string - * @deprecated Use instead labelStatus - */ - public $statuts = array(); + public $labelStatus = array(); /** * @var array Array with short label of status */ - protected $labelStatusShort; + public $labelStatusShort = array(); /** - * @var array array of short status string - * @deprecated Use instead labelStatusShort + * @var array Array to store list of tpl */ - public $statuts_short = array(); - + public $tpl; /** @@ -3837,7 +3829,7 @@ abstract class CommonObject // Situations totals if (!empty($this->situation_cycle_ref) && !empty($this->situation_counter) && $this->situation_counter > 1 && method_exists($this, 'get_prev_sits')) { include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; - if ($this->type != Facture::TYPE_CREDIT_NOTE) { + if ($this->type != Facture::TYPE_CREDIT_NOTE) { // @phpstan-ignore-line $prev_sits = $this->get_prev_sits(); foreach ($prev_sits as $sit) { // $sit is an object Facture loaded with a fetch. @@ -4597,7 +4589,7 @@ abstract class CommonObject if ($fieldstatus == 'tosell') { $this->status = $status; } elseif ($fieldstatus == 'tobuy') { - $this->status_buy = $status; + $this->status_buy = $status; // @phpstan-ignore-line } else { $this->statut = $status; $this->status = $status; @@ -4991,8 +4983,7 @@ abstract class CommonObject */ public function formAddObjectLine($dateSelector, $seller, $buyer, $defaulttpldir = '/core/tpl') { - global $conf, $user, $langs, $object, $hookmanager, $extrafields; - global $form; + global $conf, $user, $langs, $object, $hookmanager, $extrafields, $form; // Line extrafield if (!is_object($extrafields)) { @@ -10295,8 +10286,7 @@ abstract class CommonObject ); foreach ($fields as $key => $value) { if (array_key_exists($key, $this->fields)) { - // @phpstan-ignore-next-line - $this->{$key} = $value; + $this->{$key} = $value; // @phpstan-ignore-line } } diff --git a/htdocs/core/class/html.formexpensereport.class.php b/htdocs/core/class/html.formexpensereport.class.php index c08431b534e..bcb80a780dd 100644 --- a/htdocs/core/class/html.formexpensereport.class.php +++ b/htdocs/core/class/html.formexpensereport.class.php @@ -69,9 +69,9 @@ class FormExpenseReport if ($useempty) { $html.=''; } - $arrayoflabels = $tmpep->statuts; + $arrayoflabels = $tmpep->labelStatus; if ($useshortlabel) { - $arrayoflabels = $tmpep->statuts_short; + $arrayoflabels = $tmpep->labelStatusShort; } foreach ($arrayoflabels as $key => $val) { if ($selected != '' && $selected == $key) { diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 8416df31b72..101d6e97d95 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -2519,7 +2519,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks $title = $langs->trans("Projects"); if (strcmp($status, '') && $status >= 0) { - $title = $langs->trans("Projects").' '.$langs->trans($projectstatic->statuts_long[$status]); + $title = $langs->trans("Projects").' '.$langs->trans($projectstatic->labelStatus[$status]); } print ''; diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index a7066ad41fb..6194835eed4 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -717,7 +717,7 @@ class pdf_standard extends ModeleExpenseReport $pdf->SetXY($posx, $posy); $pdf->SetFont('', 'B', $default_font_size + 2); $pdf->SetTextColor(111, 81, 124); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $posx, 3, $outputlangs->transnoentities($object->statuts_short[$object->status]), '', 'R'); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $posx, 3, $outputlangs->transnoentities($object->labelStatusShort[$object->status]), '', 'R'); if ($showaddress) { // Sender properties diff --git a/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php b/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php index 7c16599f039..2b6208c025d 100644 --- a/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php +++ b/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php @@ -470,10 +470,8 @@ function cleanObjectDatas($toclean) unset($toclean->timespent_fk_user); unset($toclean->timespent_note); - unset($toclean->statuts); - unset($toclean->statuts_short); - unset($toclean->statuts_logo); - unset($toclean->statuts_long); + unset($toclean->labelStatus); + unset($toclean->labelStatusShort); unset($toclean->element); unset($toclean->fk_element); diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index 025c61a2ef1..b890746e2a4 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -110,9 +110,9 @@ class Delivery extends CommonObject public $commande_id; /** - * @var array statuts labels + * @var array Status labels */ - public $statuts; + public $labelStatus; /** * @var DeliveryLine[] lines @@ -135,9 +135,9 @@ class Delivery extends CommonObject $this->db = $db; // List of short language codes for status - $this->statuts[-1] = 'StatusDeliveryCanceled'; - $this->statuts[0] = 'StatusDeliveryDraft'; - $this->statuts[1] = 'StatusDeliveryValidated'; + $this->labelStatus[-1] = 'StatusDeliveryCanceled'; + $this->labelStatus[0] = 'StatusDeliveryDraft'; + $this->labelStatus[1] = 'StatusDeliveryValidated'; } /** diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index d667cd795dd..ca5315994d1 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -267,18 +267,18 @@ class Expedition extends CommonObject $this->db = $db; // List of long language codes for status - $this->statuts = array(); - $this->statuts[-1] = 'StatusSendingCanceled'; - $this->statuts[0] = 'StatusSendingDraft'; - $this->statuts[1] = 'StatusSendingValidated'; - $this->statuts[2] = 'StatusSendingProcessed'; + $this->labelStatus = array(); + $this->labelStatus[-1] = 'StatusSendingCanceled'; + $this->labelStatus[0] = 'StatusSendingDraft'; + $this->labelStatus[1] = 'StatusSendingValidated'; + $this->labelStatus[2] = 'StatusSendingProcessed'; // List of short language codes for status - $this->statuts_short = array(); - $this->statuts_short[-1] = 'StatusSendingCanceledShort'; - $this->statuts_short[0] = 'StatusSendingDraftShort'; - $this->statuts_short[1] = 'StatusSendingValidatedShort'; - $this->statuts_short[2] = 'StatusSendingProcessedShort'; + $this->labelStatusShort = array(); + $this->labelStatusShort[-1] = 'StatusSendingCanceledShort'; + $this->labelStatusShort[0] = 'StatusSendingDraftShort'; + $this->labelStatusShort[1] = 'StatusSendingValidatedShort'; + $this->labelStatusShort[2] = 'StatusSendingProcessedShort'; } /** @@ -1928,8 +1928,8 @@ class Expedition extends CommonObject // phpcs:enable global $langs; - $labelStatus = $langs->transnoentitiesnoconv($this->statuts[$status]); - $labelStatusShort = $langs->transnoentitiesnoconv($this->statuts_short[$status]); + $labelStatus = $langs->transnoentitiesnoconv($this->labelStatus[$status]); + $labelStatusShort = $langs->transnoentitiesnoconv($this->labelStatusShort[$status]); $statusType = 'status'.$status; if ($status == self::STATUS_VALIDATED) { diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 011d1fb2f7f..3a2df95dda6 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -179,9 +179,8 @@ class ExpenseReport extends CommonObject public $localtax1; // for backward compatibility (real field should be total_localtax1 defined into CommonObject) public $localtax2; // for backward compatibility (real field should be total_localtax2 defined into CommonObject) - public $statuts = array(); - public $statuts_short = array(); - public $statuts_logo; + public $labelStatus = array(); + public $labelStatusShort = array(); // Multicurrency /** @@ -293,9 +292,8 @@ class ExpenseReport extends CommonObject $this->modepaymentid = 0; // List of language codes for status - $this->statuts_short = array(0 => 'Draft', 2 => 'Validated', 4 => 'Canceled', 5 => 'Approved', 6 => 'Paid', 99 => 'Refused'); - $this->statuts = array(0 => 'Draft', 2 => 'ValidatedWaitingApproval', 4 => 'Canceled', 5 => 'Approved', 6 => 'Paid', 99 => 'Refused'); - $this->statuts_logo = array(0 => 'status0', 2 => 'status1', 4 => 'status6', 5 => 'status4', 6 => 'status6', 99 => 'status5'); + $this->labelStatusShort = array(0 => 'Draft', 2 => 'Validated', 4 => 'Canceled', 5 => 'Approved', 6 => 'Paid', 99 => 'Refused'); + $this->labelStatus = array(0 => 'Draft', 2 => 'ValidatedWaitingApproval', 4 => 'Canceled', 5 => 'Approved', 6 => 'Paid', 99 => 'Refused'); } /** @@ -811,10 +809,12 @@ class ExpenseReport extends CommonObject // phpcs:enable global $langs; - $labelStatus = $langs->transnoentitiesnoconv($this->statuts[$status]); - $labelStatusShort = $langs->transnoentitiesnoconv($this->statuts_short[$status]); + $labelStatus = $langs->transnoentitiesnoconv($this->labelStatus[$status]); + $labelStatusShort = $langs->transnoentitiesnoconv($this->labelStatusShort[$status]); - $statusType = $this->statuts_logo[$status]; + $statuslogo = array(0 => 'status0', 2 => 'status1', 4 => 'status6', 5 => 'status4', 6 => 'status6', 99 => 'status5'); + + $statusType = $statuslogo[$status]; return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode); } diff --git a/htdocs/expensereport/stats/index.php b/htdocs/expensereport/stats/index.php index 04ce5d5d648..4ad6caa7a69 100644 --- a/htdocs/expensereport/stats/index.php +++ b/htdocs/expensereport/stats/index.php @@ -239,7 +239,7 @@ print $form->select_dolusers($userid, 'userid', 1, '', 0, $include, '', 0, 0, 0, print ''; // Status print ''.$langs->trans("Status").''; -$liststatus = $tmpexpensereport->statuts; +$liststatus = $tmpexpensereport->labelStatus; print $form->selectarray('object_status', $liststatus, GETPOST('object_status', 'intcomma'), -4, 0, 0, '', 1); print ''; // Year diff --git a/htdocs/fichinter/class/api_interventions.class.php b/htdocs/fichinter/class/api_interventions.class.php index e90bb20aae3..8cfc57155d7 100644 --- a/htdocs/fichinter/class/api_interventions.class.php +++ b/htdocs/fichinter/class/api_interventions.class.php @@ -444,9 +444,8 @@ class Interventions extends DolibarrApi // phpcs:enable $object = parent::_cleanObjectDatas($object); - unset($object->statuts_short); - unset($object->statuts_logo); - unset($object->statuts); + unset($object->labelStatus); + unset($object->labelStatusShort); return $object; } diff --git a/htdocs/fichinter/class/fichinterrec.class.php b/htdocs/fichinter/class/fichinterrec.class.php index 95cc4f020e4..39a1b987e2e 100644 --- a/htdocs/fichinter/class/fichinterrec.class.php +++ b/htdocs/fichinter/class/fichinterrec.class.php @@ -80,8 +80,6 @@ class FichinterRec extends Fichinter public $id_origin; - public $statuts_logo; - /** * @var string Unit frequency */ @@ -123,14 +121,11 @@ class FichinterRec extends Fichinter $this->db = $db; //status dans l'ordre de l'intervention - $this->statuts[0] = 'Draft'; - $this->statuts[1] = 'Closed'; + $this->labelStatus[0] = 'Draft'; + $this->labelStatus[1] = 'Closed'; - $this->statuts_short[0] = 'Draft'; - $this->statuts_short[1] = 'Closed'; - - $this->statuts_logo[0] = 'statut0'; - $this->statuts_logo[1] = 'statut1'; + $this->labelStatusShort[0] = 'Draft'; + $this->labelStatusShort[1] = 'Closed'; } /** diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 73618399801..4e93238b6a5 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -124,12 +124,12 @@ class CommandeFournisseur extends CommonOrder /** * @var array List of status */ - public $statuts; + public $labelStatus; /** * @var array List of status short */ - public $statuts_short; + public $labelStatusShort; public $billed; @@ -788,33 +788,33 @@ class CommandeFournisseur extends CommonOrder // phpcs:enable global $conf, $langs, $hookmanager; - if (empty($this->statuts) || empty($this->statuts_short)) { + if (empty($this->labelStatus) || empty($this->labelStatusShort)) { $langs->load('orders'); - $this->statuts[0] = 'StatusSupplierOrderDraft'; - $this->statuts[1] = 'StatusSupplierOrderValidated'; - $this->statuts[2] = 'StatusSupplierOrderApproved'; + $this->labelStatus[0] = 'StatusSupplierOrderDraft'; + $this->labelStatus[1] = 'StatusSupplierOrderValidated'; + $this->labelStatus[2] = 'StatusSupplierOrderApproved'; if (empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS)) { - $this->statuts[3] = 'StatusSupplierOrderOnProcess'; + $this->labelStatus[3] = 'StatusSupplierOrderOnProcess'; } else { - $this->statuts[3] = 'StatusSupplierOrderOnProcessWithValidation'; + $this->labelStatus[3] = 'StatusSupplierOrderOnProcessWithValidation'; } - $this->statuts[4] = 'StatusSupplierOrderReceivedPartially'; - $this->statuts[5] = 'StatusSupplierOrderReceivedAll'; - $this->statuts[6] = 'StatusSupplierOrderCanceled'; // Approved->Canceled - $this->statuts[7] = 'StatusSupplierOrderCanceled'; // Process running->canceled - $this->statuts[9] = 'StatusSupplierOrderRefused'; + $this->labelStatus[4] = 'StatusSupplierOrderReceivedPartially'; + $this->labelStatus[5] = 'StatusSupplierOrderReceivedAll'; + $this->labelStatus[6] = 'StatusSupplierOrderCanceled'; // Approved->Canceled + $this->labelStatus[7] = 'StatusSupplierOrderCanceled'; // Process running->canceled + $this->labelStatus[9] = 'StatusSupplierOrderRefused'; // List of language codes for status - $this->statuts_short[0] = 'StatusSupplierOrderDraftShort'; - $this->statuts_short[1] = 'StatusSupplierOrderValidatedShort'; - $this->statuts_short[2] = 'StatusSupplierOrderApprovedShort'; - $this->statuts_short[3] = 'StatusSupplierOrderOnProcessShort'; - $this->statuts_short[4] = 'StatusSupplierOrderReceivedPartiallyShort'; - $this->statuts_short[5] = 'StatusSupplierOrderReceivedAllShort'; - $this->statuts_short[6] = 'StatusSupplierOrderCanceledShort'; - $this->statuts_short[7] = 'StatusSupplierOrderCanceledShort'; - $this->statuts_short[9] = 'StatusSupplierOrderRefusedShort'; + $this->labelStatusShort[0] = 'StatusSupplierOrderDraftShort'; + $this->labelStatusShort[1] = 'StatusSupplierOrderValidatedShort'; + $this->labelStatusShort[2] = 'StatusSupplierOrderApprovedShort'; + $this->labelStatusShort[3] = 'StatusSupplierOrderOnProcessShort'; + $this->labelStatusShort[4] = 'StatusSupplierOrderReceivedPartiallyShort'; + $this->labelStatusShort[5] = 'StatusSupplierOrderReceivedAllShort'; + $this->labelStatusShort[6] = 'StatusSupplierOrderCanceledShort'; + $this->labelStatusShort[7] = 'StatusSupplierOrderCanceledShort'; + $this->labelStatusShort[9] = 'StatusSupplierOrderRefusedShort'; } $statustrans = array( @@ -842,8 +842,8 @@ class CommandeFournisseur extends CommonOrder $statusClass = 'status6'; } - $statusLong = $langs->transnoentitiesnoconv($this->statuts[$status]).$billedtext; - $statusShort = $langs->transnoentitiesnoconv($this->statuts_short[$status]); + $statusLong = $langs->transnoentitiesnoconv($this->labelStatus[$status]).$billedtext; + $statusShort = $langs->transnoentitiesnoconv($this->labelStatusShort[$status]); $parameters = array('status' => $status, 'mode' => $mode, 'billed' => $billed); $reshook = $hookmanager->executeHooks('LibStatut', $parameters, $this); // Note that $action and $object may have been modified by hook diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index 06c49aa519a..c6b715546d8 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -129,12 +129,12 @@ class CommandeFournisseurDispatch extends CommonObjectLine $this->db = $db; // List of language codes for status - $this->statuts[0] = 'Received'; - $this->statuts[1] = 'Verified'; - $this->statuts[2] = 'Denied'; - $this->statuts_short[0] = 'Received'; - $this->statuts_short[1] = 'Verified'; - $this->statuts_short[2] = 'Denied'; + $this->labelStatus[0] = 'Received'; + $this->labelStatus[1] = 'Verified'; + $this->labelStatus[2] = 'Denied'; + $this->labelStatusShort[0] = 'Received'; + $this->labelStatusShort[1] = 'Verified'; + $this->labelStatusShort[2] = 'Denied'; } @@ -579,34 +579,34 @@ class CommandeFournisseurDispatch extends CommonObjectLine $langs->load('orders'); if ($mode == 0) { - return $langs->trans($this->statuts[$status]); + return $langs->trans($this->labelStatus[$status]); } elseif ($mode == 1) { - return $langs->trans($this->statuts_short[$status]); + return $langs->trans($this->labelStatusShort[$status]); } elseif ($mode == 2) { - return $langs->trans($this->statuts[$status]); + return $langs->trans($this->labelStatus[$status]); } elseif ($mode == 3) { if ($status == 0) { - return img_picto($langs->trans($this->statuts[$status]), 'statut0'); + return img_picto($langs->trans($this->labelStatus[$status]), 'statut0'); } elseif ($status == 1) { - return img_picto($langs->trans($this->statuts[$status]), 'statut4'); + return img_picto($langs->trans($this->labelStatus[$status]), 'statut4'); } elseif ($status == 2) { - return img_picto($langs->trans($this->statuts[$status]), 'statut8'); + return img_picto($langs->trans($this->labelStatus[$status]), 'statut8'); } } elseif ($mode == 4) { if ($status == 0) { - return img_picto($langs->trans($this->statuts[$status]), 'statut0').' '.$langs->trans($this->statuts[$status]); + return img_picto($langs->trans($this->labelStatus[$status]), 'statut0').' '.$langs->trans($this->labelStatus[$status]); } elseif ($status == 1) { - return img_picto($langs->trans($this->statuts[$status]), 'statut4').' '.$langs->trans($this->statuts[$status]); + return img_picto($langs->trans($this->labelStatus[$status]), 'statut4').' '.$langs->trans($this->labelStatus[$status]); } elseif ($status == 2) { - return img_picto($langs->trans($this->statuts[$status]), 'statut8').' '.$langs->trans($this->statuts[$status]); + return img_picto($langs->trans($this->labelStatus[$status]), 'statut8').' '.$langs->trans($this->labelStatus[$status]); } } elseif ($mode == 5) { if ($status == 0) { - return ''.$langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts[$status]), 'statut0'); + return ''.$langs->trans($this->labelStatusShort[$status]).' '.img_picto($langs->trans($this->labelStatus[$status]), 'statut0'); } elseif ($status == 1) { - return ''.$langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts[$status]), 'statut4'); + return ''.$langs->trans($this->labelStatusShort[$status]).' '.img_picto($langs->trans($this->labelStatus[$status]), 'statut4'); } elseif ($status == 2) { - return ''.$langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts[$status]), 'statut8'); + return ''.$langs->trans($this->labelStatusShort[$status]).' '.img_picto($langs->trans($this->labelStatus[$status]), 'statut8'); } } return ""; diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 2694b46cab6..f3ae583694c 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1496,7 +1496,7 @@ class Holiday extends CommonObject /** - * Affiche un select HTML des statuts de congés payés + * Show select with list of leave status * * @param int $selected Id of preselected status * @param string $htmlname Name of HTML select field @@ -1507,7 +1507,7 @@ class Holiday extends CommonObject { global $langs; - // Liste des statuts + // List of status label $name = array('DraftCP', 'ToReviewCP', 'ApprovedCP', 'CancelCP', 'RefuseCP'); $nb = count($name) + 1; @@ -1515,7 +1515,7 @@ class Holiday extends CommonObject $out = ''; - foreach ($object->statuts as $key => $value) { + foreach ($object->labelStatus as $key => $value) { if ($key == 1) { print ''; } else { @@ -936,7 +936,7 @@ if ($action == 'create') { // Status print ''.$langs->trans("Status").''; print ''; - foreach ($object->statuts_short as $key => $val) { + foreach ($object->labelStatusShort as $key => $val) { print ''; } print ''; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 4218ef5d402..522efc2c287 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -202,8 +202,8 @@ class Project extends CommonObject */ public $max_attendees; - public $statuts_short; - public $statuts_long; + public $labelStatusShort; + public $labelStatus; public $statut; // 0=draft, 1=opened, 2=closed @@ -363,8 +363,8 @@ class Project extends CommonObject $this->db = $db; - $this->statuts_short = array(0 => 'Draft', 1 => 'Opened', 2 => 'Closed'); - $this->statuts_long = array(0 => 'Draft', 1 => 'Opened', 2 => 'Closed'); + $this->labelStatusShort = array(0 => 'Draft', 1 => 'Opened', 2 => 'Closed'); + $this->labelStatus = array(0 => 'Draft', 1 => 'Opened', 2 => 'Closed'); global $conf; @@ -1309,7 +1309,7 @@ class Project extends CommonObject $statusClass = $statustrans[$status]; } - return dolGetStatus($langs->transnoentitiesnoconv($this->statuts_long[$status]), $langs->transnoentitiesnoconv($this->statuts_short[$status]), '', $statusClass, $mode); + return dolGetStatus($langs->transnoentitiesnoconv($this->labelStatus[$status]), $langs->transnoentitiesnoconv($this->labelStatusShort[$status]), '', $statusClass, $mode); } /** diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index e6d10c194f0..35df1f3e676 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -138,12 +138,12 @@ class Task extends CommonObjectLine /** * @var array */ - public $statuts; + public $labelStatus; /** * @var array */ - public $statuts_short; + public $labelStatusShort; // Properties calculated from sum of llx_element_time linked to task public $tobill; @@ -2133,80 +2133,80 @@ class Task extends CommonObjectLine global $langs; // list of Statut of the task - $this->statuts[0] = 'Draft'; - $this->statuts[1] = 'ToDo'; - $this->statuts[2] = 'Running'; - $this->statuts[3] = 'Finish'; - $this->statuts[4] = 'Transfered'; - $this->statuts_short[0] = 'Draft'; - $this->statuts_short[1] = 'ToDo'; - $this->statuts_short[2] = 'Running'; - $this->statuts_short[3] = 'Completed'; - $this->statuts_short[4] = 'Transfered'; + $this->labelStatus[0] = 'Draft'; + $this->labelStatus[1] = 'ToDo'; + $this->labelStatus[2] = 'Running'; + $this->labelStatus[3] = 'Finish'; + $this->labelStatus[4] = 'Transfered'; + $this->labelStatusShort[0] = 'Draft'; + $this->labelStatusShort[1] = 'ToDo'; + $this->labelStatusShort[2] = 'Running'; + $this->labelStatusShort[3] = 'Completed'; + $this->labelStatusShort[4] = 'Transfered'; if ($mode == 0) { - return $langs->trans($this->statuts[$status]); + return $langs->trans($this->labelStatus[$status]); } elseif ($mode == 1) { - return $langs->trans($this->statuts_short[$status]); + return $langs->trans($this->labelStatusShort[$status]); } elseif ($mode == 2) { if ($status == 0) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts_short[$status]); + return img_picto($langs->trans($this->labelStatusShort[$status]), 'statut0').' '.$langs->trans($this->labelStatusShort[$status]); } elseif ($status == 1) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut1').' '.$langs->trans($this->statuts_short[$status]); + return img_picto($langs->trans($this->labelStatusShort[$status]), 'statut1').' '.$langs->trans($this->labelStatusShort[$status]); } elseif ($status == 2) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut3').' '.$langs->trans($this->statuts_short[$status]); + return img_picto($langs->trans($this->labelStatusShort[$status]), 'statut3').' '.$langs->trans($this->labelStatusShort[$status]); } elseif ($status == 3) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts_short[$status]); + return img_picto($langs->trans($this->labelStatusShort[$status]), 'statut6').' '.$langs->trans($this->labelStatusShort[$status]); } elseif ($status == 4) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts_short[$status]); + return img_picto($langs->trans($this->labelStatusShort[$status]), 'statut6').' '.$langs->trans($this->labelStatusShort[$status]); } elseif ($status == 5) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut5').' '.$langs->trans($this->statuts_short[$status]); + return img_picto($langs->trans($this->labelStatusShort[$status]), 'statut5').' '.$langs->trans($this->labelStatusShort[$status]); } } elseif ($mode == 3) { if ($status == 0) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut0'); + return img_picto($langs->trans($this->labelStatusShort[$status]), 'statut0'); } elseif ($status == 1) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut1'); + return img_picto($langs->trans($this->labelStatusShort[$status]), 'statut1'); } elseif ($status == 2) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut3'); + return img_picto($langs->trans($this->labelStatusShort[$status]), 'statut3'); } elseif ($status == 3) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut6'); + return img_picto($langs->trans($this->labelStatusShort[$status]), 'statut6'); } elseif ($status == 4) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut6'); + return img_picto($langs->trans($this->labelStatusShort[$status]), 'statut6'); } elseif ($status == 5) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut5'); + return img_picto($langs->trans($this->labelStatusShort[$status]), 'statut5'); } } elseif ($mode == 4) { if ($status == 0) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts[$status]); + return img_picto($langs->trans($this->labelStatusShort[$status]), 'statut0').' '.$langs->trans($this->labelStatus[$status]); } elseif ($status == 1) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut1').' '.$langs->trans($this->statuts[$status]); + return img_picto($langs->trans($this->labelStatusShort[$status]), 'statut1').' '.$langs->trans($this->labelStatus[$status]); } elseif ($status == 2) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut3').' '.$langs->trans($this->statuts[$status]); + return img_picto($langs->trans($this->labelStatusShort[$status]), 'statut3').' '.$langs->trans($this->labelStatus[$status]); } elseif ($status == 3) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts[$status]); + return img_picto($langs->trans($this->labelStatusShort[$status]), 'statut6').' '.$langs->trans($this->labelStatus[$status]); } elseif ($status == 4) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts[$status]); + return img_picto($langs->trans($this->labelStatusShort[$status]), 'statut6').' '.$langs->trans($this->labelStatus[$status]); } elseif ($status == 5) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut5').' '.$langs->trans($this->statuts[$status]); + return img_picto($langs->trans($this->labelStatusShort[$status]), 'statut5').' '.$langs->trans($this->labelStatus[$status]); } } elseif ($mode == 5) { - /*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'); + /*if ($status==0) return $langs->trans($this->labelStatusShort[$status]).' '.img_picto($langs->trans($this->labelStatusShort[$status]),'statut0'); + elseif ($status==1) return $langs->trans($this->labelStatusShort[$status]).' '.img_picto($langs->trans($this->labelStatusShort[$status]),'statut1'); + elseif ($status==2) return $langs->trans($this->labelStatusShort[$status]).' '.img_picto($langs->trans($this->labelStatusShort[$status]),'statut3'); + elseif ($status==3) return $langs->trans($this->labelStatusShort[$status]).' '.img_picto($langs->trans($this->labelStatusShort[$status]),'statut6'); + elseif ($status==4) return $langs->trans($this->labelStatusShort[$status]).' '.img_picto($langs->trans($this->labelStatusShort[$status]),'statut6'); + elseif ($status==5) return $langs->trans($this->labelStatusShort[$status]).' '.img_picto($langs->trans($this->labelStatusShort[$status]),'statut5'); */ //else return $this->progress.' %'; return ' '; } elseif ($mode == 6) { - /*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'); + /*if ($status==0) return $langs->trans($this->labelStatus[$status]).' '.img_picto($langs->trans($this->labelStatusShort[$status]),'statut0'); + elseif ($status==1) return $langs->trans($this->labelStatus[$status]).' '.img_picto($langs->trans($this->labelStatusShort[$status]),'statut1'); + elseif ($status==2) return $langs->trans($this->labelStatus[$status]).' '.img_picto($langs->trans($this->labelStatusShort[$status]),'statut3'); + elseif ($status==3) return $langs->trans($this->labelStatus[$status]).' '.img_picto($langs->trans($this->labelStatusShort[$status]),'statut6'); + elseif ($status==4) return $langs->trans($this->labelStatus[$status]).' '.img_picto($langs->trans($this->labelStatusShort[$status]),'statut6'); + elseif ($status==5) return $langs->trans($this->labelStatus[$status]).' '.img_picto($langs->trans($this->labelStatusShort[$status]),'statut5'); */ //else return $this->progress.' %'; return ' '; diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 05223813b11..885199bfa3d 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -914,7 +914,7 @@ if (!empty($arrayfields['s.name_alias']['checked'])) { if (!empty($arrayfields['p.fk_statut']['checked'])) { print ''; $arrayofstatus = array(); - foreach ($projectstatic->statuts_short as $key => $val) { + foreach ($projectstatic->labelStatusShort as $key => $val) { $arrayofstatus[$key] = $langs->trans($val); } $arrayofstatus['99'] = $langs->trans("NotClosed").' ('.$langs->trans('Draft').'+'.$langs->trans('Opened').')'; diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index a266173e9f6..f15d5bb6b06 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -853,7 +853,7 @@ if ($action == 'create' || $action == 'presend') { if ($action == 'set_status') { $new_status = GETPOST('new_status'); //var_dump($url_page_current . "?track_id=" . $object->track_id); - print $form->formconfirm($url_page_current."?track_id=".$object->track_id."&new_status=".GETPOST('new_status'), $langs->trans("TicketChangeStatus"), $langs->trans("TicketConfirmChangeStatus", $langs->transnoentities($object->statuts_short[$new_status])), "confirm_set_status", '', '', 1); + print $form->formconfirm($url_page_current."?track_id=".$object->track_id."&new_status=".GETPOST('new_status'), $langs->trans("TicketChangeStatus"), $langs->trans("TicketConfirmChangeStatus", $langs->transnoentities($object->labelStatusShort[$new_status])), "confirm_set_status", '', '', 1); } // project info diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index 6e13cb9a605..e37fac7df81 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -483,7 +483,7 @@ class ActionsTicket extends CommonHookActions // Sort results to be similar to status object list //sort($exclude_status); - foreach ($object->statuts_short as $status => $status_label) { + foreach ($object->labelStatusShort as $status => $status_label) { if (!in_array($status, $exclude_status)) { print '
'; @@ -495,8 +495,8 @@ class ActionsTicket extends CommonHookActions print ''; print $object->LibStatut($status, 3, 1).' '; - //print img_picto($langs->trans($object->statuts_short[$status]), 'statut'.$status.'.png@ticket', '', false, 0, 0, '', 'valignmiddle').' '; - print $langs->trans($object->statuts_short[$status]); + //print img_picto($langs->trans($object->labelStatusShort[$status]), 'statut'.$status.'.png@ticket', '', false, 0, 0, '', 'valignmiddle').' '; + print $langs->trans($object->labelStatusShort[$status]); print ''; print '
'; } diff --git a/htdocs/ticket/class/api_tickets.class.php b/htdocs/ticket/class/api_tickets.class.php index f4b28992e0a..cc78da32f2b 100644 --- a/htdocs/ticket/class/api_tickets.class.php +++ b/htdocs/ticket/class/api_tickets.class.php @@ -520,8 +520,8 @@ class Tickets extends DolibarrApi "cache_types_tickets", "cache_category_tickets", "regeximgext", - "statuts_short", - "statuts" + "labelStatus", + "labelStatusShort" ); foreach ($attr2clean as $toclean) { unset($object->$toclean); diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index d2e8af40572..d1ec0e9c41c 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -233,14 +233,14 @@ class Ticket extends CommonObject public $cache_msgs_ticket; /** - * @var array statuts labels + * @var array status labels */ - public $statuts; + public $labelStatus; /** - * @var array statuts short labels + * @var array status short labels */ - public $statuts_short; + public $labelStatusShort; /** * @var int Notify thirdparty at create @@ -362,7 +362,7 @@ class Ticket extends CommonObject $this->db = $db; - $this->statuts_short = array( + $this->labelStatusShort = array( self::STATUS_NOT_READ => 'Unread', self::STATUS_READ => 'Read', self::STATUS_ASSIGNED => 'Assigned', @@ -372,7 +372,7 @@ class Ticket extends CommonObject self::STATUS_CLOSED => 'SolvedClosed', self::STATUS_CANCELED => 'Canceled' ); - $this->statuts = array( + $this->labelStatus = array( self::STATUS_NOT_READ => 'Unread', self::STATUS_READ => 'Read', self::STATUS_ASSIGNED => 'Assigned', @@ -1257,7 +1257,7 @@ class Ticket extends CommonObject */ public function printSelectStatus($selected = "") { - print Form::selectarray('search_fk_statut', $this->statuts_short, $selected, $show_empty = 1, $key_in_label = 0, $value_as_key = 0, $option = '', $translate = 1, $maxlen = 0, $disabled = 0, $sort = '', $morecss = ''); + print Form::selectarray('search_fk_statut', $this->labelStatusShort, $selected, $show_empty = 1, $key_in_label = 0, $value_as_key = 0, $option = '', $translate = 1, $maxlen = 0, $disabled = 0, $sort = '', $morecss = ''); } @@ -1424,8 +1424,8 @@ class Ticket extends CommonObject // phpcs:enable global $langs, $hookmanager; - $labelStatus = $this->statuts[$status]; - $labelStatusShort = $this->statuts_short[$status]; + $labelStatus = $this->labelStatus[$status]; + $labelStatusShort = $this->labelStatusShort[$status]; if ($status == self::STATUS_NOT_READ) { $statusType = 'status0'; diff --git a/htdocs/ticket/index.php b/htdocs/ticket/index.php index ddca41d9dfe..5db24bc1e85 100644 --- a/htdocs/ticket/index.php +++ b/htdocs/ticket/index.php @@ -212,21 +212,21 @@ if ($result) { $dataseries = array(); $colorseries = array(); - $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->statuts_short[Ticket::STATUS_NOT_READ]), 'data' => round($tick['unread'])); + $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->labelStatusShort[Ticket::STATUS_NOT_READ]), 'data' => round($tick['unread'])); $colorseries[Ticket::STATUS_NOT_READ] = '-'.$badgeStatus0; - $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->statuts_short[Ticket::STATUS_READ]), 'data' => round($tick['read'])); + $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->labelStatusShort[Ticket::STATUS_READ]), 'data' => round($tick['read'])); $colorseries[Ticket::STATUS_READ] = $badgeStatus1; - $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->statuts_short[Ticket::STATUS_ASSIGNED]), 'data' => round($tick['assigned'])); + $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->labelStatusShort[Ticket::STATUS_ASSIGNED]), 'data' => round($tick['assigned'])); $colorseries[Ticket::STATUS_ASSIGNED] = $badgeStatus3; - $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->statuts_short[Ticket::STATUS_IN_PROGRESS]), 'data' => round($tick['inprogress'])); + $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->labelStatusShort[Ticket::STATUS_IN_PROGRESS]), 'data' => round($tick['inprogress'])); $colorseries[Ticket::STATUS_IN_PROGRESS] = $badgeStatus4; - $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->statuts_short[Ticket::STATUS_WAITING]), 'data' => round($tick['waiting'])); + $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->labelStatusShort[Ticket::STATUS_WAITING]), 'data' => round($tick['waiting'])); $colorseries[Ticket::STATUS_WAITING] = '-'.$badgeStatus4; - $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->statuts_short[Ticket::STATUS_NEED_MORE_INFO]), 'data' => round($tick['needmoreinfo'])); + $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->labelStatusShort[Ticket::STATUS_NEED_MORE_INFO]), 'data' => round($tick['needmoreinfo'])); $colorseries[Ticket::STATUS_NEED_MORE_INFO] = '-'.$badgeStatus3; - $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->statuts_short[Ticket::STATUS_CANCELED]), 'data' => round($tick['canceled'])); + $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->labelStatusShort[Ticket::STATUS_CANCELED]), 'data' => round($tick['canceled'])); $colorseries[Ticket::STATUS_CANCELED] = $badgeStatus9; - $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->statuts_short[Ticket::STATUS_CLOSED]), 'data' => round($tick['closed'])); + $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->labelStatusShort[Ticket::STATUS_CLOSED]), 'data' => round($tick['closed'])); $colorseries[Ticket::STATUS_CLOSED] = $badgeStatus6; } else { dol_print_error($db); diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 504b3c9e52d..91d9d07cf2c 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -878,7 +878,7 @@ foreach ($object->fields as $key => $val) { } elseif ($key == 'fk_statut') { $arrayofstatus = array(); $arrayofstatus['openall'] = '-- '.$langs->trans('OpenAll').' --'; - foreach ($object->statuts_short as $key2 => $val2) { + foreach ($object->labelStatusShort as $key2 => $val2) { if ($key2 == Ticket::STATUS_CLOSED) { $arrayofstatus['closeall'] = '-- '.$langs->trans('ClosedAll').' --'; }