|
@@ -11,6 +11,7 @@ use App\Enum\Core\FileTypeEnum;
|
|
|
use App\Repository\Organization\OrganizationRepository;
|
|
use App\Repository\Organization\OrganizationRepository;
|
|
|
use App\Service\Export\Model\LicenceCmf;
|
|
use App\Service\Export\Model\LicenceCmf;
|
|
|
use App\Service\Export\Model\LicenceCmfCollection;
|
|
use App\Service\Export\Model\LicenceCmfCollection;
|
|
|
|
|
+use App\Service\Utils\StringsUtils;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Exporte la licence CMF de la structure ou du ou des access, au format demandé.
|
|
* Exporte la licence CMF de la structure ou du ou des access, au format demandé.
|
|
@@ -49,12 +50,12 @@ class LicenceCmfExporter extends BaseExporter implements ExporterInterface
|
|
|
$licenceCmf->setId($organization->getId());
|
|
$licenceCmf->setId($organization->getId());
|
|
|
$licenceCmf->setYear($exportRequest->getYear());
|
|
$licenceCmf->setYear($exportRequest->getYear());
|
|
|
$licenceCmf->setIsOrganizationLicence($exportRequest instanceof LicenceCmfOrganizationER);
|
|
$licenceCmf->setIsOrganizationLicence($exportRequest instanceof LicenceCmfOrganizationER);
|
|
|
- $licenceCmf->setOrganizationName($organization->getName());
|
|
|
|
|
|
|
+ $licenceCmf->setOrganizationName(StringsUtils::elide($organization->getName(), 64));
|
|
|
$licenceCmf->setOrganizationIdentifier($organization->getIdentifier());
|
|
$licenceCmf->setOrganizationIdentifier($organization->getIdentifier());
|
|
|
|
|
|
|
|
$parentFederation = $organization->getNetworkOrganizations()->get(0)?->getParent();
|
|
$parentFederation = $organization->getNetworkOrganizations()->get(0)?->getParent();
|
|
|
if ($parentFederation !== null) {
|
|
if ($parentFederation !== null) {
|
|
|
- $licenceCmf->setFederationName($parentFederation->getName());
|
|
|
|
|
|
|
+ $licenceCmf->setFederationName(StringsUtils::elide($parentFederation->getName(), 64));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$licenceCmf->setColor(
|
|
$licenceCmf->setColor(
|
|
@@ -72,8 +73,8 @@ class LicenceCmfExporter extends BaseExporter implements ExporterInterface
|
|
|
if ($president !== null) {
|
|
if ($president !== null) {
|
|
|
$licenceCmf->setPersonId($president->getId());
|
|
$licenceCmf->setPersonId($president->getId());
|
|
|
$licenceCmf->setPersonGender($president->getGender() ?? null);
|
|
$licenceCmf->setPersonGender($president->getGender() ?? null);
|
|
|
- $licenceCmf->setPersonFirstName($president->getGivenName());
|
|
|
|
|
- $licenceCmf->setPersonLastName($president->getName());
|
|
|
|
|
|
|
+ $licenceCmf->setPersonFirstName(StringsUtils::elide($president->getGivenName(), 64));
|
|
|
|
|
+ $licenceCmf->setPersonLastName(StringsUtils::elide($president->getName(), 64));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -117,4 +118,5 @@ class LicenceCmfExporter extends BaseExporter implements ExporterInterface
|
|
|
|
|
|
|
|
return self::LICENCE_CMF_COLOR[($year - self::LICENCE_CMF_COLOR_START_YEAR) % count(self::LICENCE_CMF_COLOR)];
|
|
return self::LICENCE_CMF_COLOR[($year - self::LICENCE_CMF_COLOR_START_YEAR) % count(self::LICENCE_CMF_COLOR)];
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
}
|
|
}
|