瀏覽代碼

Adds HelloAsso form integration

Integrates HelloAsso forms into event displays.

This change introduces a new property to the Event model
to indicate whether an event has a HelloAsso form associated
with it.  If so, the form is rendered on the event details page.
Olivier Massot 2 月之前
父節點
當前提交
fe61e0bc37

+ 18 - 0
ot_core/Classes/Domain/Model/Event.php

@@ -246,6 +246,13 @@ class Event extends AbstractEntity
      */
     protected $parentSubdomain;
 
+    /**
+     * hasHelloAssoForm
+     *
+     * @var string
+     */
+    protected $hasHelloAssoForm;
+
     /**
      * organization
      *
@@ -977,6 +984,17 @@ class Event extends AbstractEntity
         $this->parentSubdomain = $parentSubdomain;
     }
 
+    public function getHasHelloAssoForm(): string
+    {
+        return $this->hasHelloAssoForm;
+    }
+
+    public function setHasHelloAssoForm(string $hasHelloAssoForm): self
+    {
+        $this->hasHelloAssoForm = $hasHelloAssoForm;
+        return $this;
+    }
+
     /**
      * Returns the organization
      *

+ 1 - 0
ot_core/Classes/Domain/Repository/EventRepository.php

@@ -195,6 +195,7 @@ class EventRepository extends BaseApiRepository
         $event->setApi($record['api']);
         $event->setParentName($record['parentName']);
         $event->setParentSubdomain($record['parentSubDomain']);
+        $event->setHasHelloAssoForm($record['hasHelloAssoForm']);
         return $event;
     }
 }

+ 4 - 0
ot_templating/Resources/Private/Partials/Classic/EventsShow.html

@@ -55,6 +55,10 @@
         </div>
     </div>
 
+    <f:if condition="{event.hasHelloAssoForm}">
+        <f:render partial="Classic/HelloAssoForm" arguments="{eventId: event.id}"/>
+    </f:if>
+
     <f:if condition="{event.longitude}">
         <f:then>
             <div class="event-map-container">

+ 4 - 0
ot_templating/Resources/Private/Partials/Modern/EventsShow.html

@@ -55,6 +55,10 @@
         </div>
     </div>
 
+    <f:if condition="{event.hasHelloAssoForm}">
+        <f:render partial="Modern/HelloAssoForm" arguments="{eventId: event.id}"/>
+    </f:if>
+
     <f:if condition="{event.longitude}">
         <f:then>
             <div class="event-map-container">