name === $needEnumName; } public function getActualRoute(string $value, string $route): string { return $value === $route ? 'active' : ''; } public function getMailtoLink(Reports $reports): string { $subject = rawurlencode("Sprawozdanie z wykonania układu nr {$reports->getNumber()}"); $dateBase = (clone $reports->getDateStart())->modify("-1 month"); $template = "email/report.html.twig"; $dateStart = (clone $dateBase)->modify("-".(AddReports::NEXT_REPORT_MONTH-1)." months")->modify("first day of this month"); if ($reports->getNumber() === 1){ $template = "email/firstReport.html.twig"; $dateStart = $reports->getClient()->getDateLegitimacy(); } $view = sprintf( file_get_contents($_SERVER['PWD']."/templates/".$template), MonthHelper::takeDateFormatWithPolishMonths($dateStart), MonthHelper::takeDateFormatWithPolishMonths($dateBase->modify("last day of this month")) ); $content = rawurlencode($view); /** @var Clients $client */ $client = $reports->getClient(); return "mailto:{$client->getStrEmail()}?subject=$subject&body=$content"; } }