From 40e18741b389980b7550de8bd4f9f18a6e0d0420 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 4 Nov 2020 18:05:48 +0100 Subject: [PATCH] Fix look and feel v13 --- .../class/expensereport.class.php | 8 ++++---- htdocs/expensereport/index.php | 12 ++++++++---- htdocs/holiday/class/holiday.class.php | 6 +++--- htdocs/user/bank.php | 18 ++++++++++-------- 4 files changed, 25 insertions(+), 19 deletions(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index c540d124f6b..611cf72593a 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -1594,7 +1594,10 @@ class ExpenseReport extends CommonObject if ($short) return $url; - $label = img_picto('', $this->picto).' '.$langs->trans("ExpenseReport").''; + $label = img_picto('', $this->picto).' '.$langs->trans("ExpenseReport").''; + if (isset($this->status)) { + $label .= ' '.$this->getLibStatut(5); + } if (!empty($this->ref)) $label .= '
'.$langs->trans('Ref').': '.$this->ref; if (!empty($this->total_ht)) @@ -1603,9 +1606,6 @@ class ExpenseReport extends CommonObject $label .= '
'.$langs->trans('VAT').': '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); if (!empty($this->total_ttc)) $label .= '
'.$langs->trans('AmountTTC').': '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); - if (isset($this->status)) { - $label .= '
'.$langs->trans("Status").": ".$this->getLibStatut(5); - } if ($moretitle) $label .= ' - '.$moretitle; //if ($option != 'nolink') diff --git a/htdocs/expensereport/index.php b/htdocs/expensereport/index.php index fa0974dedd9..046bde4efa1 100644 --- a/htdocs/expensereport/index.php +++ b/htdocs/expensereport/index.php @@ -165,8 +165,8 @@ $max = 10; $langs->load("boxes"); -$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.statut, u.photo, u.email, u.admin"; -$sql .= ", d.rowid, d.ref, d.date_debut as dated, d.date_fin as datef, d.date_create as dm, d.total_ht, d.total_ttc, d.fk_statut as fk_status"; +$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.statut as user_status, u.photo, u.email, u.admin,"; +$sql .= " d.rowid, d.ref, d.date_debut as dated, d.date_fin as datef, d.date_create as dm, d.total_ht, d.total_ttc, d.fk_statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."expensereport as d, ".MAIN_DB_PREFIX."user as u"; if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " WHERE u.rowid = d.fk_user_author"; @@ -210,16 +210,20 @@ if ($result) while ($i < $num && $i < $max) { $obj = $db->fetch_object($result); + $expensereportstatic->id = $obj->rowid; $expensereportstatic->ref = $obj->ref; + $expensereportstatic->status = $obj->status; + $userstatic->id = $obj->uid; $userstatic->admin = $obj->admin; $userstatic->email = $obj->email; $userstatic->lastname = $obj->lastname; $userstatic->firstname = $obj->firstname; $userstatic->login = $obj->login; - $userstatic->statut = $obj->statut; + $userstatic->statut = $obj->user_status; $userstatic->photo = $obj->photo; + print ''; print ''.$expensereportstatic->getNomUrl(1).''; print ''.$userstatic->getNomUrl(-1).''; @@ -227,7 +231,7 @@ if ($result) print ''.price($obj->total_ttc).''; print ''.dol_print_date($db->jdate($obj->dm), 'day').''; print ''; - print $expensereportstatic->LibStatut($obj->fk_status, 3); + print $expensereportstatic->getLibStatut(3); print ''; print ''; diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index acfa9cca3d7..a0f640f0cd3 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1178,11 +1178,11 @@ class Holiday extends CommonObject $result = ''; - $label = img_picto('', $this->picto).' '.$langs->trans("Holiday").''; - $label .= '
'.$langs->trans('Ref').': '.$this->ref; + $label = img_picto('', $this->picto).' '.$langs->trans("Holiday").''; if (isset($this->statut)) { - $label .= '
'.$langs->trans("Status").": ".$this->getLibStatut(5); + $label .= ' '.$this->getLibStatut(5); } + $label .= '
'.$langs->trans('Ref').': '.$this->ref; $url = DOL_URL_ROOT.'/holiday/card.php?id='.$this->id; diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index b8b670027ae..2f2c1ee0a86 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -396,7 +396,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco { $holiday = new Holiday($db); - $sql = "SELECT h.rowid, h.statut, h.fk_type, h.date_debut, h.date_fin, h.halfday"; + $sql = "SELECT h.rowid, h.statut as status, h.fk_type, h.date_debut, h.date_fin, h.halfday"; $sql .= " FROM ".MAIN_DB_PREFIX."holiday as h"; $sql .= " WHERE h.fk_user = ".$object->id; $sql .= " AND h.entity = ".$conf->entity; @@ -419,17 +419,18 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco { $objp = $db->fetch_object($resql); - print ''; - print ''; $holiday->id = $objp->rowid; $holiday->ref = $objp->rowid; $holiday->fk_type = $objp->fk_type; + $holiday->statut = $objp->status; $nbopenedday = num_open_day($db->jdate($objp->date_debut), $db->jdate($objp->date_fin), 0, 1, $objp->halfday); + print ''; + print ''; print $holiday->getNomUrl(1); print ''.dol_print_date($db->jdate($objp->date_debut), 'day')."\n"; print ''.$nbopenedday.' '.$langs->trans('DurationDays').''; - print ''.$holiday->LibStatut($objp->statut, 5).''; + print ''.$holiday->LibStatut($objp->status, 5).''; $i++; } $db->free($resql); @@ -450,7 +451,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco { $exp = new ExpenseReport($db); - $sql = "SELECT e.rowid, e.ref, e.fk_statut, e.date_debut, e.total_ttc"; + $sql = "SELECT e.rowid, e.ref, e.fk_statut as status, e.date_debut, e.total_ttc"; $sql .= " FROM ".MAIN_DB_PREFIX."expensereport as e"; $sql .= " WHERE e.fk_user_author = ".$object->id; $sql .= " AND e.entity = ".$conf->entity; @@ -473,16 +474,17 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco { $objp = $db->fetch_object($resql); - print ''; - print ''; $exp->id = $objp->rowid; $exp->ref = $objp->ref; $exp->fk_type = $objp->fk_type; + $exp->status = $objp->status; + print ''; + print ''; print $exp->getNomUrl(1); print ''.dol_print_date($db->jdate($objp->date_debut), 'day')."\n"; print ''.price($objp->total_ttc).''; - print ''.$exp->LibStatut($objp->fk_statut, 5).''; + print ''.$exp->LibStatut($objp->status, 5).''; $i++; } $db->free($resql);