From b02e4ff5b18ad81ee39b7fc7c5ebbfe228b7f6ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 30 Oct 2024 21:08:52 +0100 Subject: [PATCH] use constant (#31410) * use constant * use constant * use constant * fix * fix * fix --- htdocs/expensereport/card.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 5812ece39b3..2011ca068e5 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -5,7 +5,7 @@ * Copyright (C) 2015-2023 Alexandre Spangaro * Copyright (C) 2017 Ferran Marcet * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -142,7 +142,7 @@ $candelete = 0; if ($user->hasRight('expensereport', 'supprimer')) { $candelete = 1; } -if ($object->statut == ExpenseReport::STATUS_DRAFT && $user->hasRight('expensereport', 'write') && in_array($object->fk_user_author, $childids)) { +if ($object->status == ExpenseReport::STATUS_DRAFT && $user->hasRight('expensereport', 'write') && in_array($object->fk_user_author, $childids)) { $candelete = 1; } @@ -1567,7 +1567,7 @@ if ($action == 'create') { $head = expensereport_prepare_head($object); - if ($action == 'edit' && ($object->status < 3 || $object->status == 99)) { + if ($action == 'edit' && ($object->status < 3 || $object->status == ExpenseReport::STATUS_REFUSED)) { print "
\n"; print ''; print ''; @@ -1575,7 +1575,7 @@ if ($action == 'create') { print dol_get_fiche_head($head, 'card', $langs->trans("ExpenseReport"), 0, 'trip'); - if ($object->status == 99) { + if ($object->status == ExpenseReport::STATUS_REFUSED) { print ''; } else { print ''; @@ -1641,7 +1641,7 @@ if ($action == 'create') { print ''; } - if ($object->status == 6) { + if ($object->status == ExpenseReport::STATUS_CLOSED) { print ''; print ''.$langs->trans("AUTHORPAIEMENT").''; print ''; @@ -1781,10 +1781,10 @@ if ($action == 'create') { print ''; print ''.$langs->trans("DATE_SAVE").''; print ''.dol_print_date($object->date_valid, 'dayhour', 'tzuser'); - if ($object->status == 2 && $object->hasDelay('toapprove')) { + if ($object->status == ExpenseReport::STATUS_VALIDATED && $object->hasDelay('toapprove')) { print ' '.img_warning($langs->trans("Late").' - '.$langs->trans("ToApprove")); } - if ($object->status == 5 && $object->hasDelay('topay')) { + if ($object->status == ExpenseReport::STATUS_APPROVED && $object->hasDelay('topay')) { print ' '.img_warning($langs->trans("Late").' - '.$langs->trans("ToPay")); } print ''; @@ -1847,7 +1847,7 @@ if ($action == 'create') { print ''; } - if ($object->status == 99 || !empty($object->detail_refuse)) { + if ($object->status == ExpenseReport::STATUS_REFUSED || !empty($object->detail_refuse)) { print ''; print ''.$langs->trans("REFUSEUR").''; print ''; @@ -2051,7 +2051,7 @@ if ($action == 'create') { print '
'; $actiontouse = 'updateline'; - if (($object->status == 0 || $object->status == 99) && $action != 'editline') { + if (($object->status == ExpenseReport::STATUS_DRAFT || $object->status == ExpenseReport::STATUS_REFUSED) && $action != 'editline') { $actiontouse = 'addline'; } @@ -2099,7 +2099,7 @@ if ($action == 'create') { print ''; // Ajout des boutons de modification/suppression - if (($object->status < 2 || $object->status == 99) && $user->hasRight('expensereport', 'creer')) { + if (($object->status < ExpenseReport::STATUS_VALIDATED || $object->status == ExpenseReport::STATUS_REFUSED) && $user->hasRight('expensereport', 'creer')) { print ''; } print '';