Merge remote-tracking branch 'origin/master' into cire16

This commit is contained in:
2022-12-22 10:22:58 +01:00
801 changed files with 39243 additions and 6591 deletions

View File

@@ -17,7 +17,7 @@ const getLocations = () => fetchResults('/api/1.0/main/location.json');
const getLocationTypes = () => fetchResults('/api/1.0/main/location-type.json');
const getUserCurrentLocation =
const getUserCurrentLocation =
() => fetch('/api/1.0/main/user-current-location.json')
.then(response => {
if (response.ok) { return response.json(); }
@@ -35,6 +35,13 @@ const getLocationTypeByDefaultFor = (entity) => {
);
};
/**
* Post a location
*
* **NOTE**: also in use for Calendar
* @param body
* @returns {Promise<T>}
*/
const postLocation = (body) => {
const url = `/api/1.0/main/location.json`;
return fetch(url, {

View File

@@ -58,7 +58,7 @@ const makeAccompanyingPeriodLocation = (locationType, store) => {
export default function prepareLocations(store) {
// find the locations
// find the locations
let allLocations = getLocations().then(
(results) => {
store.commit('addAvailableLocationGroup', {
@@ -114,7 +114,7 @@ export default function prepareLocations(store) {
if (window.default_location_id) {
for (let group of store.state.availableLocations) {
let location = group.locations.find((l) => l.id === window.default_location_id);
if (location !== undefined & store.state.activity.location === null) {
if (location !== undefined && store.state.activity.location === null) {
store.dispatch('updateLocation', location);
break;
}

View File

@@ -1,3 +1,14 @@
{#
WARNING: this file is in use in both ActivityBundle and CalendarBundle.
Take care when editing this file.
Maybe should we think about abstracting this file a bit more ? Moving it to PersonBundle ?
#}
{% if context == 'calendar_accompanyingCourse' %}
{% import "@ChillCalendar/_invite.html.twig" as invite %}
{% endif %}
{% macro href(pathname, key, value) %}
{% set parms = { (key): value } %}
{{ path(pathname, parms) }}
@@ -18,7 +29,7 @@
{% endmacro %}
{% set blocks = [] %}
{% if entity.activityType.personsVisible %}
{% if context == 'calendar_accompanyingCourse' or context == 'calendar_person' or entity.activityType.personsVisible %}
{% if context == 'person' %}
{% set blocks = blocks|merge([{
'title': 'Others persons'|trans,
@@ -43,7 +54,7 @@
}]) %}
{% endif %}
{% endif %}
{% if entity.activityType.thirdPartiesVisible %}
{% if context == 'calendar_accompanyingCourse' or context == 'calendar_person' or entity.activityType.thirdPartiesVisible %}
{% set blocks = blocks|merge([{
'title': 'Third parties'|trans,
'items': entity.thirdParties,
@@ -52,7 +63,7 @@
'key' : 'id',
}]) %}
{% endif %}
{% if entity.activityType.usersVisible %}
{% if context == 'calendar_accompanyingCourse' or context == 'calendar_person' or entity.activityType.usersVisible %}
{% set blocks = blocks|merge([{
'title': 'Users concerned'|trans,
'items': entity.users,
@@ -132,6 +143,12 @@
{% if bloc.type == 'user' %}
<span class="badge-user">
{{ item|chill_entity_render_box({'render': 'raw', 'addAltNames': false }) }}
{%- if context == 'calendar_accompanyingCourse' or context == 'calendar_person' %}
{% set invite = entity.inviteForUser(item) %}
{% if invite is not null %}
{{ invite.invite_span(invite) }}
{% endif %}
{%- endif -%}
</span>
{% else %}
{{ _self.insert_onthefly(bloc.type, item) }}