Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion templates/default/bookings.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<select name="group_filter" id="group_filter">
<option value="0">{{ _T("Select a group") }}</option>
{% for group in groups %}
<option value="{{ group.getId() }}"{% if filters.group_filter == group.getId() %} selected="selected"{% endif %}>{{ group.getIndentName()|raw }}</option>
<option value="{{ group.getId() }}"{% if filters.group_filter == group.getId() %} selected="selected"{% endif %}>{{ group.getFullName() }}</option>
{% endfor %}
</select>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/default/event.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

{% set group_list_values = {(0): _T("Select a group")} %}
{% for group in groups %}
{% set group_list_values = group_list_values + {(group.getId()): group.getIndentName()} %}
{% set group_list_values = group_list_values + {(group.getId()): group.getFullName()} %}
{% endfor %}

{% include "components/forms/select.html.twig" with {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,26 @@ public function testVisitorCannotListBookings(): void
}
}

/**
* Sub groups are listed with their full name in the groups filter
*/
public function testListGroupsFullNames(): void
{
$this->logSuperAdmin();
$parent = $this->createGroup('Parent group');
$child = new \Galette\Entity\Group();
$child->setName('Child group');
$child->setParentGroup((int)$parent->getId());
$this->assertTrue($child->store());

$body = (string)$this->app->handle($this->createRequest('events_bookings', ['event' => 'all']))->getBody();
$this->assertStringContainsString(
sprintf('<option value="%1$s">Parent group / Child group</option>', $child->getId()),
$body
);
$this->assertStringNotContainsString('&raquo;', $body);
}

/**
* Members can neither display nor change bookings of other members
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,27 @@ public function testPastEventFormKeepsOpenFlag(): void
$this->assertStringContainsString('value="1"', $matches[0]);
}

/**
* Sub groups are listed with their full name, without HTML entities
*/
public function testFormGroupsFullNames(): void
{
$this->logSuperAdmin();
$parent = $this->createGroup('Parent group');
$child = new \Galette\Entity\Group();
$child->setName('Child group');
$child->setParentGroup((int)$parent->getId());
$this->assertTrue($child->store());

$body = (string)$this->app->handle($this->createRequest('events_event_add'))->getBody();
$this->assertMatchesRegularExpression(
sprintf('|<option\s+value="%1$s"\s*>\s*Parent group / Child group\s*</option>|', $child->getId()),
$body
);
$this->assertStringNotContainsString('&amp;raquo;', $body);
$this->assertStringNotContainsString('&amp;nbsp;', $body);
}

/**
* Calendar requires dates
*/
Expand Down
Loading