Loading module/Oscar/config/module.config.php +1 −0 Original line number Diff line number Diff line Loading @@ -765,6 +765,7 @@ return array( 'fileSize' => \Oscar\View\Helpers\Filesize::class, 'hasAccess' => \Oscar\View\Helpers\Access::class, 'keyvalue' => \Oscar\View\Helpers\KeyValueHelper::class, 'oscarFormRowVite' => \Oscar\View\Helpers\OscarFormRowViteHelper::class, 'activityNumbers' => \Oscar\View\Helpers\ActivityNumberHelper::class, 'moment' => \Oscar\View\Helpers\Moment::class, 'oscarFormRow' => \Oscar\View\Helpers\OscarFormRow::class, Loading module/Oscar/src/Oscar/Entity/Activity.php +11 −0 Original line number Diff line number Diff line Loading @@ -1701,6 +1701,17 @@ class Activity implements ResourceInterface return null; } public function getFreeFieldsData(ActivityFreeField $type): mixed { /** @var ActivityFreeFieldValue $freeField */ foreach ($this->getFreeFields() as $freeField) { if ($freeField->getType() == $type) { return $freeField->getData(); } } return null; } /** * @param ArrayCollection $validatorsAdm */ Loading module/Oscar/src/Oscar/Hydrator/ProjectGrantFormHydrator.php +9 −0 Original line number Diff line number Diff line Loading @@ -119,6 +119,10 @@ class ProjectGrantFormHydrator implements HydratorInterface, UseServiceContainer $value = $fieldConf->hydrateFromData($data); break; case FreeFieldUtils::TYPE_LISTREST : $value = $fieldConf->hydrateFromData($data); break; default : throw new Exception("Le type de champs personnalisé '" . $fieldInfos['type'] . "' n'est pas géré"); } Loading Loading @@ -336,6 +340,11 @@ class ProjectGrantFormHydrator implements HydratorInterface, UseServiceContainer $out[$key] = $value; break; case FreeFieldUtils::TYPE_LISTREST : $value = $object->getFreeFieldsData($typeObj); $out[$key] = $value; break; default : throw new Exception("Le type de champs personnalisé '" . $fieldInfos['type'] . "' n'est pas pris en charge"); } Loading module/Oscar/src/Oscar/Utils/FreeField/FreeFieldUtils.php +2 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ class FreeFieldUtils const TYPE_DATE = 'date'; const TYPE_INTEGER = 'integer'; const TYPE_LIST = 'list'; const TYPE_LISTREST = 'listrest'; public function __construct(array $freeFieldOptions, string $key) { Loading @@ -41,6 +42,7 @@ class FreeFieldUtils { return [ 'label' => $this->freeFieldOptions['label'], 'type' => $this->type, 'required' => $this->freeFieldOptions['required'] === true, 'label_attributes' => [ 'class' => 'control-label' Loading module/Oscar/src/Oscar/Utils/FreeField/FreeFieldUtilsFactory.php +3 −1 Original line number Diff line number Diff line Loading @@ -15,9 +15,11 @@ class FreeFieldUtilsFactory return new FreeFieldUtilsText($config, $key); case FreeFieldUtils::TYPE_LIST : return new FreeFieldUtilsList($config, $key); case FreeFieldUtils::TYPE_LISTREST : return new FreeFieldUtilsListRest($config, $key); default: throw new OscarException("Type '$type' not supported"); throw new OscarException("Type de champs personnalisé '$type' non supporté"); } } } No newline at end of file Loading
module/Oscar/config/module.config.php +1 −0 Original line number Diff line number Diff line Loading @@ -765,6 +765,7 @@ return array( 'fileSize' => \Oscar\View\Helpers\Filesize::class, 'hasAccess' => \Oscar\View\Helpers\Access::class, 'keyvalue' => \Oscar\View\Helpers\KeyValueHelper::class, 'oscarFormRowVite' => \Oscar\View\Helpers\OscarFormRowViteHelper::class, 'activityNumbers' => \Oscar\View\Helpers\ActivityNumberHelper::class, 'moment' => \Oscar\View\Helpers\Moment::class, 'oscarFormRow' => \Oscar\View\Helpers\OscarFormRow::class, Loading
module/Oscar/src/Oscar/Entity/Activity.php +11 −0 Original line number Diff line number Diff line Loading @@ -1701,6 +1701,17 @@ class Activity implements ResourceInterface return null; } public function getFreeFieldsData(ActivityFreeField $type): mixed { /** @var ActivityFreeFieldValue $freeField */ foreach ($this->getFreeFields() as $freeField) { if ($freeField->getType() == $type) { return $freeField->getData(); } } return null; } /** * @param ArrayCollection $validatorsAdm */ Loading
module/Oscar/src/Oscar/Hydrator/ProjectGrantFormHydrator.php +9 −0 Original line number Diff line number Diff line Loading @@ -119,6 +119,10 @@ class ProjectGrantFormHydrator implements HydratorInterface, UseServiceContainer $value = $fieldConf->hydrateFromData($data); break; case FreeFieldUtils::TYPE_LISTREST : $value = $fieldConf->hydrateFromData($data); break; default : throw new Exception("Le type de champs personnalisé '" . $fieldInfos['type'] . "' n'est pas géré"); } Loading Loading @@ -336,6 +340,11 @@ class ProjectGrantFormHydrator implements HydratorInterface, UseServiceContainer $out[$key] = $value; break; case FreeFieldUtils::TYPE_LISTREST : $value = $object->getFreeFieldsData($typeObj); $out[$key] = $value; break; default : throw new Exception("Le type de champs personnalisé '" . $fieldInfos['type'] . "' n'est pas pris en charge"); } Loading
module/Oscar/src/Oscar/Utils/FreeField/FreeFieldUtils.php +2 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ class FreeFieldUtils const TYPE_DATE = 'date'; const TYPE_INTEGER = 'integer'; const TYPE_LIST = 'list'; const TYPE_LISTREST = 'listrest'; public function __construct(array $freeFieldOptions, string $key) { Loading @@ -41,6 +42,7 @@ class FreeFieldUtils { return [ 'label' => $this->freeFieldOptions['label'], 'type' => $this->type, 'required' => $this->freeFieldOptions['required'] === true, 'label_attributes' => [ 'class' => 'control-label' Loading
module/Oscar/src/Oscar/Utils/FreeField/FreeFieldUtilsFactory.php +3 −1 Original line number Diff line number Diff line Loading @@ -15,9 +15,11 @@ class FreeFieldUtilsFactory return new FreeFieldUtilsText($config, $key); case FreeFieldUtils::TYPE_LIST : return new FreeFieldUtilsList($config, $key); case FreeFieldUtils::TYPE_LISTREST : return new FreeFieldUtilsListRest($config, $key); default: throw new OscarException("Type '$type' not supported"); throw new OscarException("Type de champs personnalisé '$type' non supporté"); } } } No newline at end of file