Skip to content

Commit

Permalink
Merge pull request #86 from slub/fix-85
Browse files Browse the repository at this point in the history
Fix conditions for contact event view.
  • Loading branch information
Alexander Bigga authored Oct 4, 2021
2 parents 66bd758 + 5244476 commit 4f9ebaa
Show file tree
Hide file tree
Showing 12 changed files with 128 additions and 79 deletions.
4 changes: 0 additions & 4 deletions Classes/Controller/CategoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ public function contactListAction(\Slub\SlubEvents\Domain\Model\Category $catego
}
}

#if ($category != NULL) {
# $events = $this->eventRepository->findAllGbByCategory($category);
#}

// get Default Category
if (is_null($category)) {
$category = $this->categoryRepository->findDefaultGeniusbarCategory();
Expand Down
1 change: 0 additions & 1 deletion Classes/Domain/Repository/EventRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ public function findEventByContact($contact, $category = null)
if ($category != null) {
$constraints[] = $query->in('categories.uid', explode(',', $category));
}
$constraints[] = $query->greaterThan('max_subscriber', 'subscribers');
$constraints[] = $query->greaterThan('start_date_time', strtotime('today'));

if (count($constraints)) {
Expand Down
2 changes: 1 addition & 1 deletion Documentation/Settings.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[general]
project = SLUB Event Management
release = 5.0
release = 5.1
t3author = Alexander Bigga
copyright = 2013-2021 by the author
description = Tool for event registration and experts booking.
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Partials/Event/GbItem.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<f:render partial="Event/DateFromTo" arguments="{event : event}"/>

<div class="subscription">
<f:link.action action="new" class="button submit" controller="Subscriber" pageUid="{settings.pidSubscribeForm}"
<f:link.action action="new" class="button subscribe" controller="Subscriber" pageUid="{settings.pidSubscribeForm}"
title="Anmelden bei {event.contact.name}" arguments="{event : event, category: category}">
<f:translate key="tx_slubevents_domain_model_event.subscribe"/>
</f:link.action>
Expand Down
10 changes: 5 additions & 5 deletions Resources/Private/Partials/Event/GbItemKind1.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@
<div class="subscription">

<f:form name="subscribe_{event.uid}" object="{subscriber}" pageUid="{settings.pidSubscribeForm}" action="new" controller="Subscriber" arguments="{event : event}">
<f:comment><f:form.select name="category" style="width:200px;" class="form-control" options="{event.categories}" /></f:comment>
<f:comment><f:form.select name="category" class="form-control" options="{event.categories}" /></f:comment>

<select style="width:200px;" class="form-control" id="sel_{event.uid}" name="tx_slubevents_eventsubscribe[category]" onchange="check_wiba({event.uid});">
<select class="form-control" id="sel_{event.uid}" name="tx_slubevents_eventsubscribe[category]" onchange="check_wiba({event.uid});">
<option value="-1"><f:translate key="persSelectTopic" /></option>
<f:for each="{event.categories}" as="cat" key="key" iteration="singleEventIterator">
<option value="{cat.uid}">{cat.title}</option>
</f:for>
</select>
<label style="display:none;" for="sel_{event.uid}" class="error" id="slub-forms-select-{event.uid}-error"><f:translate key="selecttopictobook"/></label>

<f:comment><f:form.submit class="button submit" value="{f:translate(key: 'tx_slubevents_domain_model_event.subscribe')}" style="margin-top:0px" /></f:comment>
<f:comment><f:form.submit class="button subscribe" value="{f:translate(key: 'tx_slubevents_domain_model_event.subscribe')}" style="margin-top:0px" /></f:comment>
<a href="javascript:;" onclick="reg_wiba({event.uid});" class="button submit"><f:translate key="tx_slubevents_domain_model_event.subscribe"/></a>
</f:form>



<f:comment>
<f:link.action action="new" class="button submit" controller="Subscriber" pageUid="{settings.pidSubscribeForm}"
<f:link.action action="new" class="button subscribe" controller="Subscriber" pageUid="{settings.pidSubscribeForm}"
title="Anmelden bei {event.contact.name}" arguments="{event : event, category: category}">
<f:translate key="tx_slubevents_domain_model_event.subscribe"/>
</f:link.action>
</f:comment>

</div>
<div class="clear"></div>
</li>
</li>
22 changes: 17 additions & 5 deletions Resources/Private/Partials/Event/GbItemKind2.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,23 @@
<li class="{f:if(condition: eventIterator.isEven, then: 'Even')} {f:if(condition: eventIterator.isOdd, then: 'Odd')} {f:if(condition: eventIterator.isFirst, then: 'First')} {f:if(condition: eventIterator.isLast, then: 'Last')}">
<f:render partial="Event/DateFromTo" arguments="{event : event}"/> - <f:link.action action="show" controller="Event" pluginName="Eventlist" title="{event.description -> f:format.stripTags()}" pageUid="{settings.pidDetails}" arguments="{event : event}">{event.title}</f:link.action>
<div class="subscription">
<f:link.action action="new" class="button submit" controller="Subscriber" pageUid="{settings.pidSubscribeForm}"
title="Anmelden bei {event.contact.name}" arguments="{event : event, category: category}">
<f:translate key="tx_slubevents_domain_model_event.subscribe"/>
</f:link.action>

<f:if condition="<se:condition.IsSubscriptionAllowed event='{event}' />">
<f:then>
<f:link.action action="new" class="button subscribe" controller="Subscriber" pageUid="{settings.pidSubscribeForm}"
title="Anmelden bei {event.contact.name}" arguments="{event : event, category: category}">
<f:translate key="tx_slubevents_domain_model_event.subscribe"/>
</f:link.action>
</f:then>
<f:else>
<f:if condition="{event.externalRegistration}">
<f:then>
<f:link.external uri="{event.externalRegistration}" class="button subscribe external" target="_blank">
<f:translate key="tx_slubevents_domain_model_event.external_registration" />
</f:link.external>
</f:then>
</f:if>
</f:else>
</f:if>
</div>
<div class="clear"></div>
</li>
47 changes: 21 additions & 26 deletions Resources/Private/Templates/Category/ContactList.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,22 @@
<li class="heading"><h4><f:format.date date="<se:format.newMonthTitle events='{wibas}' index='{label}' />" format="%B %Y" /></h4></li>
</f:then>
</f:if>
<f:if condition="<se:condition.IsSubscriptionAllowed event='{wiba}' />">
<f:then>
<f:if condition="<se:format.freePlacesLeft event='{wiba}' /> >= 1">
<f:then>
<f:if condition="{kind} == 1">
<f:comment>Wissensbar</f:comment>
<f:render partial="Event/GbItemKind1" arguments="{event: wiba, category: category, eventIterator:wibaIterator}"/>
</f:if>
<f:if condition="{kind} == 2">
<f:comment>Veranstaltungen</f:comment>
<f:render partial="Event/GbItemKind2" arguments="{event: wiba, category: category, eventIterator:wibaIterator}"/>
</f:if>
<f:if condition="{kind} == 3">
<f:comment>Sprechstunden</f:comment>
<f:render partial="Event/GbItem" arguments="{event: wiba, category: category, eventIterator:wibaIterator}"/>
</f:if>
</f:then>
</f:if>
</f:then>
</f:if>
<f:if condition="{kind} == 1">
<f:comment>Wissensbar</f:comment>
<f:if condition="<se:condition.IsSubscriptionAllowed event='{wiba}' />">
<f:render partial="Event/GbItemKind1" arguments="{event: wiba, category: category, eventIterator:wibaIterator}"/>
</f:if>
</f:if>
<f:if condition="{kind} == 2">
<f:comment>Veranstaltungen</f:comment>
<f:render partial="Event/GbItemKind2" arguments="{event: wiba, category: category, eventIterator:wibaIterator}"/>
</f:if>
<f:if condition="{kind} == 3">
<f:comment>Sprechstunden</f:comment>
<f:if condition="<se:condition.IsSubscriptionAllowed event='{wiba}' />">
<f:render partial="Event/GbItem" arguments="{event: wiba, category: category, eventIterator:wibaIterator}"/>
</f:if>
</f:if>
</f:for>
</ul>

Expand All @@ -43,7 +39,6 @@
Bitte wählen Sie einen Ansprechpartner im Backend!
</f:then>
<f:else>

<div class="contacts">
<p><f:translate key="tx_slubevents.gb.i_consult_you" /></p>
<f:for each="{contacts}" as="contact">
Expand All @@ -65,7 +60,7 @@
<f:then>
<f:if condition="{wibas}">
<f:then>
<h3><f:translate key="tx_slubevents_domain_model_event.genius_bar" /></h3>
<h3><f:translate key="tx_slubevents_domain_model_event.genius_bar" /></h3>
<f:if condition="{settings.hidePagination}">
<f:then>
<f:render section="wibaListing" arguments="{wibas: wibas, category: category, kind: 1}" />
Expand All @@ -92,7 +87,7 @@ <h3><f:translate key="tx_slubevents_domain_model_event.genius_bar" /></h3>
}
}
</script>
<br style="clear:both">
<br style="clear:both">
</f:then>
</f:if>
</f:then>
Expand All @@ -103,7 +98,7 @@ <h3><f:translate key="tx_slubevents_domain_model_event.genius_bar" /></h3>
<f:then>
<f:if condition="{events}">
<f:then>
<h3><f:translate key="persEvents" /></h3>
<h3><f:translate key="persEvents" /></h3>
<f:if condition="{settings.hidePagination}">
<f:then>
<f:render section="wibaListing" arguments="{wibas: events, category: category, kind: 2}" />
Expand All @@ -114,7 +109,7 @@ <h3><f:translate key="persEvents" /></h3>
</f:widget.paginate>
</f:else>
</f:if>
<br style="clear:both">
<br style="clear:both">
</f:then>
</f:if>
</f:then>
Expand All @@ -125,7 +120,7 @@ <h3><f:translate key="persEvents" /></h3>
<f:then>
<f:if condition="{consultation}">
<f:then>
<h3><f:translate key="persConsultingHours" /></h3>
<h3><f:translate key="persConsultingHours" /></h3>
<f:if condition="{settings.hidePagination}">
<f:then>
<f:render section="wibaListing" arguments="{wibas: consultation, category: category, kind: 3}" />
Expand Down
6 changes: 1 addition & 5 deletions Resources/Private/Templates/Category/GbList.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@
</f:if>
<f:if condition="<se:condition.IsSubscriptionAllowed event='{event}' />">
<f:then>
<f:if condition="<se:format.freePlacesLeft event='{event}' /> >= 1">
<f:then>
<f:render partial="Event/GbItem" arguments="{event: event, category: category, eventIterator:eventIterator}"/>
</f:then>
</f:if>
<f:render partial="Event/GbItem" arguments="{event: event, category: category, eventIterator:eventIterator}"/>
</f:then>
</f:if>
</f:then>
Expand Down
6 changes: 4 additions & 2 deletions Resources/Private/Templates/Event/Show.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,13 @@ <h3>{event.title}</h3>

<div class="submit">
<f:link.action action="list" class="button linkback" pageUid="{settings.pidListing}">
<f:translate key="paginate_back" /></f:link.action>
<f:translate key="paginate_back" />
</f:link.action>
<f:if condition="<se:condition.IsSubscriptionAllowed event='{event}' />">
<f:then>
<f:link.action action="new" class="button subscribe" controller="Subscriber" pageUid="{settings.pidSubscribeForm}" arguments="{event : event}">
<f:translate key="tx_slubevents_domain_model_event.subscribe" /></f:link.action>
<f:translate key="tx_slubevents_domain_model_event.subscribe" />
</f:link.action>
</f:then>
</f:if>
</div>
Expand Down
Loading

0 comments on commit 4f9ebaa

Please sign in to comment.