Commit 004e650d authored by François Agneray's avatar François Agneray
Browse files

Modifications couleurs badges

parent 036746fb
......@@ -32,10 +32,15 @@ final class DashboardGenerateBadgeAction
return $response->write('Email invalide')->withStatus(400);
}
$role = strtolower($participant->getRole());
if ($role == 'invité') {
$role = 'invite';
}
// Parametres par defaut
$width = 890;
$height = 600;
$imagefile = './public/images/badge.png';
$imagefile = './public/images/badge_' . $role . '.png';
$fontroboto = './config/Roboto-Black.ttf';
$fontrobotolight = './config/Roboto-Light.ttf';
$fontTopSecret = './config/top_secret.ttf';
......@@ -51,7 +56,7 @@ final class DashboardGenerateBadgeAction
if ($participant->getEvenementSocial()) {
imagettftext($image, 25, 20, 75, 350, $black, $fontTopSecret, 'Event');
}
imagettftext($image, 40, 0, 255, 100, $black, $fontroboto, $participant->getPrenom());
imagettftext($image, 40, 0, 255, 100, $black, $fontroboto, ucfirst(strtolower($participant->getPrenom())));
imagettftext($image, 40, 0, 255, 160, $black, $fontroboto, strtoupper($participant->getNom()));
imagettftext($image, 29, 0, 255, 250, $black, $fontrobotolight, $participant->getOrganisme()->getLabel());
$roleString = $participant->getRole();
......
......@@ -70,10 +70,15 @@ final class DashboardGenerateBadgeListAction
private function createBadge($participant)
{
$role = strtolower($participant->getRole());
if ($role == 'invité') {
$role = 'invite';
}
// Parametres par defaut
$width = 890;
$height = 600;
$imagefile = './public/images/badge.png';
$imagefile = './public/images/badge_' . $role . '.png';
$fontroboto = './config/Roboto-Black.ttf';
$fontrobotolight = './config/Roboto-Light.ttf';
$fontTopSecret = './config/top_secret.ttf';
......@@ -89,7 +94,7 @@ final class DashboardGenerateBadgeListAction
if ($participant->getEvenementSocial()) {
imagettftext($image, 25, 20, 75, 350, $black, $fontTopSecret, 'Event');
}
imagettftext($image, 40, 0, 255, 100, $black, $fontroboto, $participant->getPrenom());
imagettftext($image, 40, 0, 255, 100, $black, $fontroboto, ucfirst(strtolower($participant->getPrenom())));
imagettftext($image, 40, 0, 255, 160, $black, $fontroboto, strtoupper($participant->getNom()));
imagettftext($image, 29, 0, 255, 250, $black, $fontrobotolight, $participant->getOrganisme()->getLabel());
$roleString = $participant->getRole();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment